{"id":14819,"date":"2026-11-22T13:17:06","date_gmt":"2026-11-22T13:17:06","guid":{"rendered":"https:\/\/mpelembe.net\/?p=14819"},"modified":"2026-11-22T13:17:06","modified_gmt":"2026-11-22T13:17:06","slug":"cleaning-code-bloat-with-anti-gravity","status":"publish","type":"post","link":"https:\/\/mpelembe.net\/index.php\/cleaning-code-bloat-with-anti-gravity\/","title":{"rendered":"Cleaning Code Bloat With Anti Gravity"},"content":{"rendered":"<p><strong>The Autonomous Software Factory: Eliminating Enterprise Technical Debt with Google Antigravity and Gemini<\/strong><\/p>\n<p>Sun, Nov 22 2026 \/Mpelembe Media\/ \u2014 Software engineering is undergoing a fundamental paradigm shift away from editor-centric autocompletion toward <strong>autonomous multi-agent software factories<\/strong>. Rather than relying on human developers to manually prompt tools line by line, this operational model deploys fleets of specialized artificial intelligence agents that independently plan, build, refactor, and test code across isolated branches before submitting verified pull requests for final human sign-off. This automation specifically targets the enterprise &#8220;maintainability gap&#8221; and systemic codebase degradation\u2014exemplified by an 81% surge in duplicate code blocks across industry repositories\u2014by systematically purging obsolete dependencies, removing dead code, and stripping unnecessary polyfills.<!--more--><\/p>\n<p><iframe loading=\"lazy\" title=\"Build an AI Software Factory for Code Cleanup\" width=\"604\" height=\"340\" src=\"https:\/\/www.youtube.com\/embed\/ZAa7vI49lr4?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe><\/p>\n<p>At the core of the software factory is <strong>Google Antigravity<\/strong> paired with a tiered Gemini model architecture engineered to balance throughput with reasoning depth. High-throughput models such as Gemini Flash act as the primary orchestration tier, maintaining fluid background coordination, file indexing, and sub-200-millisecond turn latencies. For complex tasks such as cross-language legacy migrations, multi-thousand-line refactors, and critical vulnerability patching, the factory dynamically escalates workloads to Gemini 4 Argon to capitalize on its one-million-token context window and specialized agentic optimization.<\/p>\n<p>Operational safety and domain specialization are achieved using <strong>custom sub-agents<\/strong> defined via Markdown files and structured YAML frontmatter that explicitly govern system prompts and tool allowlists. Through Antigravity&#8217;s <code>invoke_subagent<\/code> mechanism running in Git worktree branch isolation, domain-specific agents for Web, iOS, and Android concurrently audit framework deprecations, bundle sizes, and memory leaks on temporary branches without causing merge locks or polluting the developer&#8217;s main working tree. This parallel maintenance pipeline reduces codebase bloat by up to 65% while preserving system stability. Human oversight remains central to the factory via the <strong>Agent Manager dashboard<\/strong>, which provides real-time telemetry into agent states, reveals private reasoning paths and tool diffs, and allows engineers to message or pause running sub-agents at any stage.<\/p>\n<p>To establish an autonomous compliance fleet, Google Antigravity discovers custom sub-agents as Markdown files containing structured YAML frontmatter placed in your project&#8217;s <code>.agents\/agents\/<\/code> directory.<\/p>\n<p>Below is the directory hierarchy, followed by the exact sub-agent definitions and invocation configurations for <strong>Web<\/strong>, <strong>iOS<\/strong>, and <strong>Android<\/strong> compliance workers.<\/p>\n<h3>1. Workspace Directory Layout<\/h3>\n<p>Antigravity traverses configuration files hierarchically, resolving universal project rules first before activating scoped agents and skills:<\/p>\n<pre><code>my-project\/\r\n\u251c\u2500\u2500 AGENTS.md                                # Universal orchestrator root instructions\r\n\u251c\u2500\u2500 GEMINI.md                                # Native Gemini model instructions\r\n\u251c\u2500\u2500 .agents\/\r\n\u2502   \u251c\u2500\u2500 rules\/\r\n\u2502   \u2502   \u251c\u2500\u2500 git-workflow.md                  # PR and branch commit standards\r\n\u2502   \u2502   \u2514\u2500\u2500 security.md                      # Secret hygiene &amp; permission rules\r\n\u2502   \u2514\u2500\u2500 agents\/\r\n\u2502       \u251c\u2500\u2500 web-compliance-auditor.md        # Web \/ Next.js compliance sub-agent\r\n\u2502       \u251c\u2500\u2500 ios-compliance-auditor.md        # iOS \/ Swift compliance sub-agent\r\n\u2502       \u2514\u2500\u2500 android-compliance-auditor.md    # Android \/ Kotlin compliance sub-agent\r\n\u2514\u2500\u2500 skills\/\r\n    \u251c\u2500\u2500 web-bundle-analyzer\/SKILL.md\r\n    \u251c\u2500\u2500 ios-memory-lint\/SKILL.md\r\n    \u2514\u2500\u2500 android-lint-rules\/SKILL.md\r\n<\/code><\/pre>\n<h3>2. Custom Sub-Agent Definitions<\/h3>\n<h4>A. Web Compliance Auditor<\/h4>\n<p><em>File location: <code>.agents\/agents\/web-compliance-auditor.md<\/code><\/em><\/p>\n<pre><code>---\r\nname: web-compliance-auditor\r\ndescription: Specialized subagent that audits React, Next.js, and TypeScript codebases for server\/client boundary violations, dead code, bundle bloat, and accessibility standards.\r\ntools:\r\n  - view_file\r\n  - replace_file_content\r\n  - grep_search\r\n  - run_command\r\nsubagent: true\r\nmainAgent: false\r\nmodel: pro\r\ncommandExecutionPolicy: sandbox\r\nskills:\r\n  - skills\/web-bundle-analyzer\r\n---\r\n\r\n# System Role &amp; Instructions\r\nYou are an expert Frontend and Full-Stack Web engineering sub-agent specializing in codebase health and dependency pruning.\r\n\r\n## Operational Objectives\r\n1. **Server\/Client Separation**: Inspect Next.js and React trees to ensure `'use client'` and `'use server'` boundaries are strictly respected.\r\n2. **Bundle Optimization**: Identify and remove unused npm dependencies, obsolete polyfills, and orphaned CSS modules to reduce bundle size.\r\n3. **Accessibility &amp; Linting**: Audit UI components against WCAG AA standards and eliminate duplicate utility abstractions.\r\n4. **Verification**: Execute `npm run lint` and `npm run build` within the sandbox before returning code diffs to verify structural integrity.\r\n<\/code><\/pre>\n<h4>B. iOS Compliance Auditor<\/h4>\n<p><em>File location: <code>.agents\/agents\/ios-compliance-auditor.md<\/code><\/em><\/p>\n<pre><code>---\r\nname: ios-compliance-auditor\r\ndescription: Specialized subagent that audits iOS Swift and SwiftUI codebases for deprecated UIKit patterns, memory leaks, retain cycles, and Swift Concurrency safety.\r\ntools:\r\n  - view_file\r\n  - replace_file_content\r\n  - grep_search\r\n  - run_command\r\nsubagent: true\r\nmainAgent: false\r\nmodel: pro\r\ncommandExecutionPolicy: sandbox\r\nskills:\r\n  - skills\/ios-memory-lint\r\n---\r\n\r\n# System Role &amp; Instructions\r\nYou are an expert Apple Platform engineering sub-agent specializing in Swift codebase modernization and memory stability.\r\n\r\n## Operational Objectives\r\n1. **API Modernization**: Scan Swift code to refactor legacy UIKit delegates, deprecated Combine pipelines, and outdated `URLSession` handlers into modern Swift Concurrency (`async\/await`).\r\n2. **Memory Leak Detection**: Detect strong reference cycles in closures, unowned self-references, and unmanaged notification observers.\r\n3. **Dead Code Elimination**: Prune unreferenced SwiftUI views, orphaned asset catalog items, and legacy feature flags.\r\n4. **Verification**: Run `xcodebuild test` or `swift test` in the sandbox environment to ensure zero regression in test suites.\r\n<\/code><\/pre>\n<h4>C. Android Compliance Auditor<\/h4>\n<p><em>File location: <code>.agents\/agents\/android-compliance-auditor.md<\/code><\/em><\/p>\n<pre><code>---\r\nname: android-compliance-auditor\r\ndescription: Specialized subagent that audits Android repositories for deprecated APIs, Jetpack compliance, Gradle configuration health, and permission security boundaries.\r\ntools:\r\n  - view_file\r\n  - replace_file_content\r\n  - grep_search\r\n  - run_command\r\nsubagent: true\r\nmainAgent: false\r\nmodel: pro\r\ncommandExecutionPolicy: sandbox\r\nskills:\r\n  - skills\/android-lint-rules\r\n---\r\n\r\n# System Role &amp; Instructions\r\nYou are an expert Android engineering sub-agent specializing in platform compliance and code bloat reduction.\r\n\r\n## Operational Objectives\r\n1. **Framework Modernization**: Inspect `build.gradle.kts` and Kotlin source files for deprecated Android framework APIs, migrating legacy components to modern Android Jetpack\/AndroidX standards.\r\n2. **Permission Boundaries**: Validate that runtime permissions declared in `AndroidManifest.xml` adhere to strict least-privilege security policies.\r\n3. **Dependency Cleanup**: Remove outdated third-party support libraries, duplicate XML drawables, and unused view bindings.\r\n4. **Verification**: Execute `.\/gradlew lint` inside the isolated sandbox to confirm compilation and lint compliance.\r\n<\/code><\/pre>\n<h3>3. Orchestration &amp; Worktree Isolation via <code>invoke_subagent<\/code><\/h3>\n<p>To run multiple sub-agents simultaneously without Git conflicts or file locks on your working tree, configure the parent orchestrator to invoke each worker using <code>workspace_mode: \"branch\"<\/code>. This isolates the sub-agent inside an independent Git worktree branch:<\/p>\n<pre><code># Dispatched concurrently by the parent agent\r\ninvoke_subagent(\r\n    name=\"web-compliance-auditor\",\r\n    task=\"Audit Next.js routes under \/app for client boundary leaks and unused lodash imports.\",\r\n    workspace_mode=\"branch\"\r\n)\r\n\r\ninvoke_subagent(\r\n    name=\"ios-compliance-auditor\",\r\n    task=\"Scan NetworkService.swift and refactor completion-handler closures to async\/await.\",\r\n    workspace_mode=\"branch\"\r\n)\r\n\r\ninvoke_subagent(\r\n    name=\"android-compliance-auditor\",\r\n    task=\"Audit build.gradle.kts and update legacy Jetpack dependencies to current stable BOM.\",\r\n    workspace_mode=\"branch\"\r\n)\r\n<\/code><\/pre>\n<p>Each sub-agent starts with an isolated context window, executes its task inside its worktree sandbox, and reports verified diffs back to the parent agent or Agent Manager dashboard for human sign-off.<\/p>\n<p>Here are the root orchestrator instructions to place in your repository&#8217;s root <strong><code>AGENTS.md<\/code><\/strong> file.<\/p>\n<p>In Google Antigravity, <code>AGENTS.md<\/code> takes precedence as the universal orchestrator contract, establishing operating roles, delegation heuristics, execution sandboxes, and verification gates across the entire fleet.<\/p>\n<h3>Root Configuration: <code>AGENTS.md<\/code><\/h3>\n<pre><code># AGENTS.md \u2014 Autonomous Software Factory Orchestrator\r\n\r\n## 1. Role &amp; Operating Architecture\r\nYou are the **Lead Software Factory Orchestrator**. Your mandate is to maintain repository health, eliminate technical debt, prune obsolete dependencies, and enforce cross-platform compliance without creating AI-generated code bloat or merge lockouts.\r\n\r\nYou do not perform large-scale, multi-file code refactors directly within the primary context window. Instead, you act as the architectural dispatch: diagnosing objectives, breaking them into isolated workstreams, and delegating execution to specialized sub-agents.\r\n\r\n---\r\n\r\n## 2. Platform Support &amp; Trailing-Edge Policy\r\nAdhere to the enterprise platform policy defined below. Flag and prune code, polyfills, and backward-compatibility shims that support versions older than:\r\n- **Web**: Modern Evergreen browsers (Chrome, Edge, Firefox, Safari) within the trailing 2 major versions. Strip obsolete ECMAScript polyfills and legacy browser vendor prefixes.\r\n- **iOS**: Minimum deployment target: iOS 17.0+ (SwiftUI, Swift 6 Concurrency \/ Strict Concurrency Checking).\r\n- **Android**: Minimum SDK: API 28 (Android 9.0 Pie), Target SDK: Current stable API. Jetpack Compose and Modern Android Architecture (BOM) required.\r\n\r\n---\r\n\r\n## 3. Sub-Agent Delegation Matrix\r\nWhen processing maintenance, audits, or refactoring tasks, immediately evaluate the project target and delegate using `invoke_subagent` with `workspace_mode: \"branch\"`.\r\n\r\n| Objective \/ File Scope | Designated Sub-Agent | Invocation Mode | Verification Command |\r\n| :--- | :--- | :--- | :--- |\r\n| Next.js, React, TypeScript, CSS modules, Webpack\/Vite configs, bundle bloat | `web-compliance-auditor` | `branch` (Git worktree) | `npm run lint &amp;&amp; npm run build` |\r\n| Swift, SwiftUI, Xcode targets, CocoaPods\/SPM, memory leaks, concurrency | `ios-compliance-auditor` | `branch` (Git worktree) | `swift test` or `xcodebuild test` |\r\n| Kotlin, Jetpack Compose, Gradle (`build.gradle.kts`), Android manifest | `android-compliance-auditor` | `branch` (Git worktree) | `.\/gradlew lint` |\r\n| Cross-cutting architectural analysis or repository indexing | `research` (Built-in) | `inherit` (Read-only) | N\/A |\r\n\r\n### Dispatch Rules:\r\n1. **Parallelism**: Multiple platform sub-agents may run concurrently. Always assign distinct scopes to prevent overlapping file diffs.\r\n2. **Context Freshness**: Provide sub-agents with a self-contained objective prompt containing the target path, platform constraint, and verification command. Do not pass monolithic conversation transcripts.\r\n3. **Branch Worktree Isolation**: Never invoke modifying sub-agents with `workspace_mode: \"inherit\"` or `workspace_mode: \"share\"`. Enforce `branch` mode to isolate tool execution and avoid polluting the developer's working tree.\r\n\r\n---\r\n\r\n## 4. Operational Guardrails &amp; Execution Boundaries\r\n1. **Destructive Action Gating**: Never execute or approve `rm -rf`, `git push --force`, schema dropping, or secret modification without explicit human confirmation.\r\n2. **Permission Boundary**: The orchestrator operates in planning and validation mode. File modification tools (`replace_file_content`, `write_file`) must only be exercised by designated sub-agents inside sandbox worktrees.\r\n3. **Token Stewardship (Progressive Disclosure)**: Load sub-agent schemas and skill references on demand. Do not ingest full directory trees or multi-megabyte log files into the root context.\r\n\r\n---\r\n\r\n## 5. Verification Gate (\"Proof Before Done\")\r\nBefore summarizing results or presenting changes to the human operator:\r\n1. **Diff Audit**: Verify that each sub-agent returned a unified git diff containing only the requested scope.\r\n2. **Test &amp; Build Integrity**: Ensure the sub-agent\u2019s sandbox verification command exited cleanly (`exit code 0`). \"Syntax appears correct\" or \"compiled without errors\" is unacceptable without logged test\/lint execution proofs.\r\n3. **Pull Request Synthesis**: Formulate concise PR proposals highlighting lines removed, dependencies dropped, and platform guidelines satisfied.\r\n<\/code><\/pre>\n<h3>How Antigravity Executes This Configuration<\/h3>\n<ol>\n<li><strong>Discovery Order<\/strong>: Upon opening a session, Antigravity checks the repository root for <code>AGENTS.md<\/code>. It uses this file to set the system role and register the custom sub-agents discovered inside <code>.agents\/agents\/<\/code>.<\/li>\n<li><strong>Progressive Token Management<\/strong>: Only the metadata and descriptions of <code>web-compliance-auditor<\/code>, <code>ios-compliance-auditor<\/code>, and <code>android-compliance-auditor<\/code> are loaded into memory (~100 tokens each). The sub-agent instructions are loaded strictly when the orchestrator calls <code>invoke_subagent<\/code>.<\/li>\n<li><strong>Isolated Worktrees<\/strong>: When <code>workspace_mode: \"branch\"<\/code> is triggered, Antigravity creates temporary Git worktrees behind the scenes, runs the sub-agent checks within sandboxed containers, and reports the resulting diffs back to the Agent Manager panel for review.<\/li>\n<\/ol>\n<p>In Google Antigravity and the Gemini ecosystem, rules in Markdown serve as behavioral guidance, but <strong>lifecycle hooks<\/strong> operate as non-negotiable deterministic firewalls [cite: 11, 27]. When registered, a <strong><code>PreToolUse<\/code> hook<\/strong> intercepts agent actions before execution, parsing the incoming payload and blocking forbidden commands [cite: 11, 27].<\/p>\n<p>Here is the setup to configure automated <code>PreToolUse<\/code> shell guardrails (such as <code>gemini-shield<\/code> \/ <code>safety-shield<\/code>) for your autonomous software factory [cite: 27].<\/p>\n<hr \/>\n<h3>1. Directory Structure<\/h3>\n<p>Place hook scripts in your project\u2019s <code>.agents\/hooks\/<\/code> directory (or globally in <code>~\/.gemini\/config\/hooks\/<\/code>) [cite: 1, 20]:<\/p>\n<pre><code>my-project\/\r\n\u251c\u2500\u2500 .agents\/\r\n\u2502   \u251c\u2500\u2500 hooks\/\r\n\u2502   \u2502   \u251c\u2500\u2500 gemini-shield.sh         # PreToolUse shell command validator\r\n\u2502   \u2502   \u2514\u2500\u2500 secret-scrubber.sh       # PreToolUse file write &amp; credential scanner\r\n\u2502   \u251c\u2500\u2500 settings.json                # Project-scoped hook and tool permissions\r\n\u2502   \u2514\u2500\u2500 agents\/                      # Platform sub-agents (web, ios, android)\r\n\u2514\u2500\u2500 AGENTS.md\r\n<\/code><\/pre>\n<hr \/>\n<h3>2. The <code>PreToolUse<\/code> Shell Guardrail Script<\/h3>\n<p>This script intercepts <code>run_command<\/code> \/ <code>command<\/code> invocations. It parses the incoming tool payload from <code>stdin<\/code>, checks for destructive commands, and exits with a non-zero exit code (or typed block decision) to halt execution and return the rationale directly to the agent [cite: 11, 21, 27].<\/p>\n<p><em>File location: <code>.agents\/hooks\/gemini-shield.sh<\/code><\/em><\/p>\n<pre><code>#!\/usr\/bin\/env bash\r\nset -euo pipefail\r\n\r\n# Read the typed hook JSON payload from stdin\r\nPAYLOAD=$(cat)\r\n\r\n# Extract tool name and command string using jq\r\nTOOL_NAME=$(echo \"$PAYLOAD\" | jq -r '.tool \/\/ .tool_name \/\/ empty')\r\nCOMMAND=$(echo \"$PAYLOAD\" | jq -r '.tool_input.command \/\/ .tool_input.CommandLine \/\/ empty')\r\n\r\n# Only evaluate shell command execution tools\r\nif [[ \"$TOOL_NAME\" != \"run_command\" &amp;&amp; \"$TOOL_NAME\" != \"Bash\" &amp;&amp; \"$TOOL_NAME\" != \"command\" ]]; then\r\n  exit 0\r\nfi\r\n\r\n# 1. Block destructive file system deletions\r\nif echo \"$COMMAND\" | grep -E -q '(rm[[:space:]]+-[rfR]{1,3}[[:space:]]+(\/|~|\\.|\\*|\\$HOME))|(mkfs|dd[[:space:]]+if=)'; then\r\n  echo \"{\\\"decision\\\": \\\"block\\\", \\\"reason\\\": \\\"Execution Denied: Destructive filesystem deletion commands are prohibited.\\\"}\" &gt;&amp;2\r\n  exit 2\r\nfi\r\n\r\n# 2. Block forced Git push operations\r\nif echo \"$COMMAND\" | grep -E -q 'git[[:space:]]+push[[:space:]]+.*(--force|-f)'; then\r\n  echo \"{\\\"decision\\\": \\\"block\\\", \\\"reason\\\": \\\"Execution Denied: Force pushing to remote branches is blocked by policy.\\\"}\" &gt;&amp;2\r\n  exit 2\r\nfi\r\n\r\n# 3. Block destructive database drops\r\nif echo \"$COMMAND\" | grep -E -i -q '(drop[[:space:]]+database|drop[[:space:]]+table|truncate[[:space:]]+table)'; then\r\n  echo \"{\\\"decision\\\": \\\"block\\\", \\\"reason\\\": \\\"Execution Denied: Destructive SQL drop or truncate statements are restricted.\\\"}\" &gt;&amp;2\r\n  exit 2\r\nfi\r\n\r\n# 4. Block permission bypass flags or privileged Docker containers\r\nif echo \"$COMMAND\" | grep -E -q '(--dangerously-skip-permissions|--privileged|CAP_SYS_ADMIN)'; then\r\n  echo \"{\\\"decision\\\": \\\"block\\\", \\\"reason\\\": \\\"Execution Denied: Security boundary bypass flags are forbidden.\\\"}\" &gt;&amp;2\r\n  exit 2\r\nfi\r\n\r\n# Allow compliant command to proceed\r\nexit 0\r\n<\/code><\/pre>\n<p>Make the hook executable:<\/p>\n<pre><code>chmod +x .agents\/hooks\/gemini-shield.sh\r\n<\/code><\/pre>\n<hr \/>\n<h3>3. Registering the Hook in <code>settings.json<\/code><\/h3>\n<p>Register the hook script and configure declarative execution permissions in <code>.agents\/settings.json<\/code> (or <code>~\/.gemini\/antigravity-cli\/settings.json<\/code>) [cite: 1, 6]:<\/p>\n<pre><code>{\r\n  \"permissions\": {\r\n    \"allow\": [\r\n      \"command(git diff)\",\r\n      \"command(git log)\",\r\n      \"command(npm test)\",\r\n      \"command(npm run lint)\",\r\n      \"command(swift test)\",\r\n      \"command(.\/gradlew lint)\"\r\n    ],\r\n    \"deny\": [\r\n      \"command(git push --force)\",\r\n      \"command(git reset --hard)\",\r\n      \"file_read(.\/.env)\",\r\n      \"file_read(.\/.env.*)\"\r\n    ]\r\n  },\r\n  \"hooks\": {\r\n    \"PreToolUse\": [\r\n      {\r\n        \"matcher\": \"run_command\",\r\n        \"script\": \".agents\/hooks\/gemini-shield.sh\"\r\n      },\r\n      {\r\n        \"matcher\": \"write_file\",\r\n        \"script\": \".agents\/hooks\/secret-scrubber.sh\"\r\n      }\r\n    ],\r\n    \"PostToolUse\": [\r\n      {\r\n        \"matcher\": \"replace_file_content\",\r\n        \"command\": \"npx prettier --write \\\"$FILE_PATH\\\"\"\r\n      }\r\n    ]\r\n  }\r\n}\r\n<\/code><\/pre>\n<h3>4. How the Guardrail Operates During Agent Execution<\/h3>\n<ol>\n<li><strong>Pre-Execution Interception<\/strong>: Whenever the orchestrator or an invoked sub-agent attempts to call <code>run_command<\/code>, the runtime pauses execution and routes the parameters through <code>gemini-shield.sh<\/code> [cite: 27].<\/li>\n<li><strong>Deterministic Blocking (<code>exit 2<\/code>)<\/strong>: If an agent attempts an action like <code>git push --force<\/code> or <code>rm -rf \/<\/code>, the script exits with code <code>2<\/code> [cite: 11, 27]. The agent does not crash; instead, the error message from stderr is injected back into the model&#8217;s reasoning loop [cite: 11].<\/li>\n<li><strong>Autonomous Self-Correction<\/strong>: The sub-agent recognizes that the operation was denied by project policy, updates its plan, and proceeds with a safe alternative without requiring human manual intervention.<\/li>\n<\/ol>\n<p>In Google Antigravity and the Gemini multi-agent ecosystem, agents and sub-agents signal task completion by transitioning to an idle state or issuing a completion turn [cite: 6, 7, 29]. The <strong><code>Stop<\/code> lifecycle hook<\/strong> intercepts this termination attempt [cite: 27, 32].<\/p>\n<p>If tests, lint checks, or build pipelines are failing, the hook returns a typed decision: <code>{\"decision\": \"continue\", \"reason\": \"...\"}<\/code> [cite: 29, 32]. This forcibly pushes the agent back into its active execution loop with the test failures injected into context, preventing &#8220;AI slop&#8221; or unverified code from ever being declared finished [cite: 11, 32].<\/p>\n<h3>1. The <code>goal-verifier.sh<\/code> Script<\/h3>\n<p>This script dynamically detects the project type (or checks the platform target of the current worktree), runs the corresponding verification commands, and outputs the typed decision contract on <code>stdout<\/code> [cite: 32].<\/p>\n<p><em>File location: <code>.agents\/hooks\/goal-verifier.sh<\/code><\/em><\/p>\n<pre><code>#!\/usr\/bin\/env bash\r\nset -euo pipefail\r\n\r\n# Read hook payload from stdin (contains agent role, session ID, and workspace directory)\r\nPAYLOAD=$(cat)\r\n\r\n# Capture any uncommitted modifications or diffs\r\nGIT_DIFF=$(git status --porcelain)\r\n\r\n# If no files were touched, allow the agent to finish\r\nif [[ -z \"$GIT_DIFF\" ]]; then\r\n  echo '{\"decision\": \"allow\"}'\r\n  exit 0\r\nfi\r\n\r\nFAILURE_LOG=\"\"\r\n\r\n# 1. Web Target Verification (Next.js \/ TypeScript \/ React)\r\nif [[ -f \"package.json\" ]]; then\r\n  echo \"==&gt; Running Web Verification Suite...\" &gt;&amp;2\r\n  if ! npm run lint &gt; \/tmp\/web_lint.log 2&gt;&amp;1; then\r\n    FAILURE_LOG+=\"[Web Lint Failure]:\\n$(tail -n 25 \/tmp\/web_lint.log)\\n\\n\"\r\n  fi\r\n  if ! npm test -- --passWithNoTests &gt; \/tmp\/web_test.log 2&gt;&amp;1; then\r\n    FAILURE_LOG+=\"[Web Test Failure]:\\n$(tail -n 25 \/tmp\/web_test.log)\\n\\n\"\r\n  fi\r\nfi\r\n\r\n# 2. iOS Target Verification (Swift Package \/ Xcode)\r\nif [[ -f \"Package.swift\" ]]; then\r\n  echo \"==&gt; Running Swift Verification Suite...\" &gt;&amp;2\r\n  if ! swift test &gt; \/tmp\/swift_test.log 2&gt;&amp;1; then\r\n    FAILURE_LOG+=\"[iOS\/Swift Test Failure]:\\n$(tail -n 25 \/tmp\/swift_test.log)\\n\\n\"\r\n  fi\r\nfi\r\n\r\n# 3. Android Target Verification (Gradle \/ Kotlin)\r\nif [[ -f \"build.gradle.kts\" || -f \"build.gradle\" ]]; then\r\n  echo \"==&gt; Running Android Gradle Lint Suite...\" &gt;&amp;2\r\n  if ! .\/gradlew lint test --daemon &gt; \/tmp\/android_test.log 2&gt;&amp;1; then\r\n    FAILURE_LOG+=\"[Android Lint\/Test Failure]:\\n$(tail -n 25 \/tmp\/android_test.log)\\n\\n\"\r\n  fi\r\nfi\r\n\r\n# Evaluate results: Block termination if failures were detected\r\nif [[ -n \"$FAILURE_LOG\" ]]; then\r\n  # Format error log safely for JSON output\r\n  ESCAPED_REASON=$(echo -e \"Proof Before Done Violation: Verification suite failed. You cannot complete the task until all errors are resolved:\\n\\n$FAILURE_LOG\" | jq -Rs .)\r\n\r\n  # Return 'continue' directive to reject the Stop event\r\n  echo \"{\\\"decision\\\": \\\"continue\\\", \\\"reason\\\": $ESCAPED_REASON}\"\r\n  exit 0\r\nfi\r\n\r\n# All suites passed: allow agent to stop\r\necho '{\"decision\": \"allow\"}'\r\nexit 0\r\n<\/code><\/pre>\n<p>Make the hook executable:<\/p>\n<pre><code>chmod +x .agents\/hooks\/goal-verifier.sh\r\n<\/code><\/pre>\n<h3>2. Registering the <code>Stop<\/code> Hook in <code>.agents\/settings.json<\/code><\/h3>\n<p>Add the <code>Stop<\/code> event handler to your project\u2019s existing hooks configuration alongside <code>PreToolUse<\/code> and <code>PostToolUse<\/code> [cite: 27, 32]:<\/p>\n<pre><code>{\r\n  \"permissions\": {\r\n    \"allow\": [\r\n      \"command(git diff)\",\r\n      \"command(git status)\",\r\n      \"command(npm test)\",\r\n      \"command(npm run lint)\",\r\n      \"command(swift test)\",\r\n      \"command(.\/gradlew lint)\"\r\n    ],\r\n    \"deny\": [\r\n      \"command(git push --force)\",\r\n      \"command(git reset --hard)\"\r\n    ]\r\n  },\r\n  \"hooks\": {\r\n    \"PreToolUse\": [\r\n      {\r\n        \"matcher\": \"run_command\",\r\n        \"script\": \".agents\/hooks\/gemini-shield.sh\"\r\n      }\r\n    ],\r\n    \"PostToolUse\": [\r\n      {\r\n        \"matcher\": \"replace_file_content\",\r\n        \"command\": \"npx prettier --write \\\"$FILE_PATH\\\"\"\r\n      }\r\n    ],\r\n    \"Stop\": [\r\n      {\r\n        \"script\": \".agents\/hooks\/goal-verifier.sh\"\r\n      }\r\n    ]\r\n  }\r\n}\r\n<\/code><\/pre>\n<hr \/>\n<h3>3. Execution Lifecycle<\/h3>\n<pre><code>       Agent Attempts Completion (Stop Event)\r\n                         \u2502\r\n                         \u25bc\r\n           [.agents\/hooks\/goal-verifier.sh]\r\n                         \u2502\r\n            \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\r\n       [Tests Pass]             [Tests Fail]\r\n            \u2502                         \u2502\r\n            \u25bc                         \u25bc\r\n  {\"decision\": \"allow\"}     {\"decision\": \"continue\",\r\n            \u2502                \"reason\": \"&lt;error_logs&gt;\"}\r\n            \u25bc                         \u2502\r\n   Sub-agent enters Idle              \u25bc\r\n   Diff sent to Parent     Agent forced back to active;\r\n   &amp; Agent Manager         reads logs and self-corrects\r\n<\/code><\/pre>\n<ol>\n<li><strong>Trigger on Completion<\/strong>: When a sub-agent (e.g., <code>web-compliance-auditor<\/code>) finishes editing files and attempts to declare its work complete, Antigravity fires the <code>Stop<\/code> hook [cite: 32].<\/li>\n<li><strong>Rejection &amp; Log Injection<\/strong>: If a TypeScript compilation error or failing unit test is detected, the script returns <code>decision: \"continue\"<\/code> with the error tail [cite: 32].<\/li>\n<li><strong>Autonomous Self-Healing<\/strong>: Antigravity rejects the stop attempt and feeds the failure message directly into the agent&#8217;s context [cite: 11, 32]. The sub-agent immediately re-evaluates the failure, uses <code>replace_file_content<\/code> to fix the regression, re-runs tests, and only stops once the verification gate exits with code 0 [cite: 11].<\/li>\n<\/ol>\n<p>To deploy the multi-agent compliance fleet as an automated nightly cron maintenance pipeline, you can run Google Antigravity CLI (<code>agy<\/code>) in headless mode (<code>-p<\/code> \/ <code>--print<\/code>) within a GitHub Actions workflow [cite: 1, 4, 16].<\/p>\n<p>In this setup, the workflow authenticates via Google Cloud Workload Identity Federation (WIF) and Application Default Credentials (ADC) using <code>AGY_ADC_AUTH=1<\/code>, executes the fleet in an isolated sandbox, and automatically raises a structured Pull Request if any compliance refactoring occurs [cite: 3, 16, 17].<\/p>\n<h3>1. GitHub Actions Workflow File<\/h3>\n<p><em>File location: <code>.github\/workflows\/nightly-compliance-factory.yml<\/code><\/em><\/p>\n<pre><code>name: Nightly Multi-Agent Compliance Sweep\r\n\r\non:\r\n  schedule:\r\n    # Runs every morning at 02:00 UTC (02:00 AM)\r\n    - cron: '0 2 * * *'\r\n  workflow_dispatch: # Allows manual trigger from the GitHub Actions tab\r\n\r\npermissions:\r\n  contents: write\r\n  pull-requests: write\r\n  id-token: write # Required for Google Cloud Workload Identity Federation\r\n\r\njobs:\r\n  software-factory-audit:\r\n    runs-on: ubuntu-latest\r\n    timeout-minutes: 45\r\n\r\n    steps:\r\n      - name: Checkout Repository\r\n        uses: actions\/checkout@v5\r\n        with:\r\n          fetch-depth: 0 # Full git history for worktree branch management\r\n\r\n      # 1. Passwordless Cloud Authentication via WIF &amp; ADC\r\n      - name: Authenticate to Google Cloud\r\n        uses: google-github-actions\/auth@v3\r\n        with:\r\n          workload_identity_provider: 'projects\/123456789012\/locations\/global\/workloadIdentityPools\/github-actions-pool\/providers\/github-provider'\r\n          service_account: 'antigravity-ci-runner@enterprise-project.iam.gserviceaccount.com'\r\n\r\n      # 2. Install Official Antigravity CLI (agy)\r\n      - name: Install Antigravity CLI\r\n        run: |\r\n          curl -fsSL https:\/\/antigravity.google\/cli\/install.sh | bash\r\n          echo \"$HOME\/.antigravity\/bin\" &gt;&gt; $GITHUB_PATH\r\n\r\n      # 3. Environment &amp; Tooling Setup\r\n      - name: Setup Node.js Environment\r\n        uses: actions\/setup-node@v4\r\n        with:\r\n          node-version: '22'\r\n          cache: 'npm'\r\n\r\n      - name: Install Dependencies\r\n        run: npm ci\r\n\r\n      # 4. Dispatch the Multi-Agent Fleet in Headless Mode\r\n      - name: Run Headless Autonomous Audit Fleet\r\n        env:\r\n          AGY_ADC_AUTH: \"1\"\r\n        run: |\r\n          # Prompt the orchestrator defined in AGENTS.md to dispatch sub-agents\r\n          agy -p \"Execute the automated nightly compliance sweep across Web, iOS, and Android scopes using your designated sub-agents. Prune dead code, remove deprecated polyfills, and modernize trailing-edge APIs in isolated branch worktrees. Ensure all test suites pass before completing.\" \\\r\n              --mode accept-edits \\\r\n              --sandbox \\\r\n              --output-format json &gt; sweep_output.json\r\n\r\n      # 5. Check Diffs &amp; Create Maintenance PR\r\n      - name: Create Pull Request with Verified Diffs\r\n        uses: peter-evans\/create-pull-request@v6\r\n        with:\r\n          commit-message: \"chore(factory): automated nightly compliance &amp; dead code cleanup\"\r\n          branch: \"factory\/nightly-compliance-audit\"\r\n          delete-branch: true\r\n          title: \"\ud83e\udd16 Software Factory: Automated Platform Compliance &amp; Debt Pruning\"\r\n          body: |\r\n            ### Automated Codebase Compliance &amp; Health Audit\r\n            This Pull Request was generated autonomously by the **Antigravity Software Factory Fleet**.\r\n\r\n            #### What Changed:\r\n            - **Web Compliance (`web-compliance-auditor`)**: Checked React\/Next.js client-server boundaries, pruned unused dependencies, and audited bundle size.\r\n            - **iOS Compliance (`ios-compliance-auditor`)**: Checked UIKit deprecations and modernized Swift Concurrency.\r\n            - **Android Compliance (`android-compliance-auditor`)**: Audited Jetpack dependencies and permission bounds.\r\n\r\n            #### Safety Gates &amp; Verification:\r\n            - Verified against project `.agents\/hooks\/gemini-shield.sh` (PreToolUse)\r\n            - Blocked premature termination via `.agents\/hooks\/goal-verifier.sh` (Stop Hook)\r\n            - All test suites (`npm test`, linting, and build steps) passed in sandbox before completion.\r\n          labels: |\r\n            automated-pr\r\n            technical-debt\r\n            software-factory\r\n<\/code><\/pre>\n<h3>2. Key Architecture &amp; Operational Mechanics<\/h3>\n<ol>\n<li><strong>Zero Long-Lived Secrets (<code>AGY_ADC_AUTH: \"1\"<\/code>)<\/strong>: Rather than storing static API keys or long-lived service account JSON files in GitHub Secrets, GitHub Actions exchanges short-lived OIDC tokens with Google Cloud via Workload Identity Federation (WIF) [cite: 16, 17]. Setting <code>AGY_ADC_AUTH: \"1\"<\/code> signals the CLI to consume Application Default Credentials natively [cite: 16, 17].<\/li>\n<li><strong>Headless Execution (<code>agy -p --mode accept-edits<\/code>)<\/strong>: The <code>-p<\/code> flag launches the CLI without an interactive terminal GUI [cite: 2, 4]. Supplying <code>--mode accept-edits<\/code> permits sub-agents to stage modifications directly, while <code>--sandbox<\/code> isolates command execution [cite: 3, 17].<\/li>\n<li><strong>Triggering the Fleet<\/strong>: Because the repository root contains <code>AGENTS.md<\/code> and <code>.agents\/agents\/<\/code>, the headless orchestrator parses the prompt and invokes <code>web-compliance-auditor<\/code>, <code>ios-compliance-auditor<\/code>, and <code>android-compliance-auditor<\/code> into their isolated Git worktrees [cite: 8, 15, 20].<\/li>\n<li><strong>Hook Protection in CI<\/strong>: Even in headless CI\/CD, Antigravity respects <code>.agents\/settings.json<\/code> [cite: 4, 33]. <code>gemini-shield.sh<\/code> will block any destructive terminal actions (<code>exit 2<\/code>), and <code>goal-verifier.sh<\/code> will reject the <code>Stop<\/code> event if tests or linting fail, ensuring broken code is never submitted into the PR [cite: 11, 23, 32].<\/li>\n<li><strong>Terms of Service Compliance (Section 6)<\/strong>: Running <code>agy -p<\/code> directly from first-party shell scripts and official CI runners (like GitHub Actions) is explicitly supported under Antigravity guidelines [cite: 18, 41].<\/li>\n<\/ol>\n<p>To give your team full visibility into what the autonomous fleet accomplished, we can parse <code>sweep_output.json<\/code> directly inside the workflow and combine it with git statistics [cite: 3, 17].<\/p>\n<p>Below is the complete update to your GitHub Actions workflow, including a <strong>metrics-extraction script<\/strong> that calculates lines dropped, bundle size deltas, and platform-by-platform summaries, injecting them directly into the Pull Request description [cite: 17, 20].<\/p>\n<h3>1. Updated GitHub Actions Workflow with Dynamic PR Metrics<\/h3>\n<p><em>File location: <code>.github\/workflows\/nightly-compliance-factory.yml<\/code><\/em><\/p>\n<pre><code>name: Nightly Multi-Agent Compliance Sweep\r\n\r\non:\r\n  schedule:\r\n    # Runs every morning at 02:00 UTC (02:00 AM)\r\n    - cron: '0 2 * * *'\r\n  workflow_dispatch:\r\n\r\npermissions:\r\n  contents: write\r\n  pull-requests: write\r\n  id-token: write\r\n\r\njobs:\r\n  software-factory-audit:\r\n    runs-on: ubuntu-latest\r\n    timeout-minutes: 45\r\n\r\n    steps:\r\n      - name: Checkout Repository\r\n        uses: actions\/checkout@v5\r\n        with:\r\n          fetch-depth: 0\r\n\r\n      - name: Authenticate to Google Cloud via WIF\r\n        uses: google-github-actions\/auth@v3\r\n        with:\r\n          workload_identity_provider: 'projects\/123456789012\/locations\/global\/workloadIdentityPools\/github-actions-pool\/providers\/github-provider'\r\n          service_account: 'antigravity-ci-runner@enterprise-project.iam.gserviceaccount.com'\r\n\r\n      - name: Install Antigravity CLI (agy)\r\n        run: |\r\n          curl -fsSL https:\/\/antigravity.google\/cli\/install.sh | bash\r\n          echo \"$HOME\/.antigravity\/bin\" &gt;&gt; $GITHUB_PATH\r\n\r\n      - name: Setup Node.js Environment\r\n        uses: actions\/setup-node@v4\r\n        with:\r\n          node-version: '22'\r\n          cache: 'npm'\r\n\r\n      - name: Install Dependencies &amp; Record Baseline Web Bundle\r\n        id: baseline-metrics\r\n        run: |\r\n          npm ci\r\n          # Record baseline production bundle size if build directory exists\r\n          npm run build --if-present\r\n          BASELINE_BUNDLE_KB=$(du -sk .next\/static 2&gt;\/dev\/null | awk '{print $1}' || echo \"0\")\r\n          echo \"BASELINE_BUNDLE_KB=${BASELINE_BUNDLE_KB}\" &gt;&gt; $GITHUB_ENV\r\n\r\n      # -------------------------------------------------------------\r\n      # Dispatch the Multi-Agent Fleet in Headless Mode\r\n      # -------------------------------------------------------------\r\n      - name: Run Headless Autonomous Audit Fleet\r\n        env:\r\n          AGY_ADC_AUTH: \"1\"\r\n        run: |\r\n          agy -p \"Execute the automated nightly compliance sweep across Web, iOS, and Android scopes using your designated sub-agents. Prune dead code, remove deprecated polyfills, and modernize trailing-edge APIs in isolated branch worktrees. Ensure all test suites pass before completing.\" \\\r\n              --mode accept-edits \\\r\n              --sandbox \\\r\n              --output-format json &gt; sweep_output.json\r\n\r\n      # -------------------------------------------------------------\r\n      # Extract Quantitative Health &amp; Bloat Metrics\r\n      # -------------------------------------------------------------\r\n      - name: Generate PR Body Metrics\r\n        id: parse-metrics\r\n        run: |\r\n          # 1. Measure Code Lines Delta\r\n          INSERTIONS=$(git diff --shortstat | grep -o -E '+ insertion' | cut -d ' ' -f 1 || echo 0)\r\n          DELETIONS=$(git diff --shortstat | grep -o -E '+ deletion' | cut -d ' ' -f 1 || echo 0)\r\n          NET_LINES=$(( INSERTIONS - DELETIONS ))\r\n\r\n          # 2. Re-measure bundle after agent refactoring\r\n          npm run build --if-present\r\n          NEW_BUNDLE_KB=$(du -sk .next\/static 2&gt;\/dev\/null | awk '{print $1}' || echo \"0\")\r\n          BUNDLE_DELTA_KB=$(( NEW_BUNDLE_KB - BASELINE_BUNDLE_KB ))\r\n\r\n          # 3. Parse Sub-Agent Executive Summary from agy JSON output\r\n          AGENT_SUMMARY=$(jq -r '.response \/\/ .summary \/\/ \"Sub-agents completed routine maintenance without high-level remarks.\"' sweep_output.json)\r\n\r\n          # Export into GITHUB_ENV as a multi-line markdown block\r\n          {\r\n            echo \"PR_BODY&lt;&lt;EOF\"\r\n            echo \"## \ud83e\udd16 Software Factory: Automated Nightly Maintenance\"\r\n            echo \"\"\r\n            echo \"### \ud83d\udcca Codebase Health Delta\"\r\n            echo \"| Metric | Baseline \/ Before | After Clean-up | Net Impact |\"\r\n            echo \"| :--- | :--- | :--- | :--- |\"\r\n            echo \"| **Lines of Code** | +${INSERTIONS} | -${DELETIONS} | **${NET_LINES} lines** |\"\r\n            echo \"| **Web Client Bundle (.next\/static)** | ${BASELINE_BUNDLE_KB} KB | ${NEW_BUNDLE_KB} KB | **${BUNDLE_DELTA_KB} KB** |\"\r\n            echo \"\"\r\n            echo \"### \ud83d\udee0\ufe0f Sub-Agent Actions &amp; Highlights\"\r\n            echo \"${AGENT_SUMMARY}\"\r\n            echo \"\"\r\n            echo \"---\"\r\n            echo \"### \ud83d\udee1\ufe0f Safety &amp; Verification Gates\"\r\n            echo \"- \u2705 **PreToolUse Shell Firewall (`gemini-shield.sh`)**: Intercepted destructive commands; 0 policy violations.\"\r\n            echo \"- \u2705 **Stop Event Goal Verifier (`goal-verifier.sh`)**: Enforced unit tests, lint checks, and builds across all modified worktrees before permitting completion.\"\r\n            echo \"- \u2705 **Isolation**: Sub-agents executed on isolated git worktree branches; zero main working tree pollution.\"\r\n            echo \"EOF\"\r\n          } &gt;&gt; $GITHUB_ENV\r\n\r\n      # -------------------------------------------------------------\r\n      # Create Pull Request with Dynamically Generated Telemetry\r\n      # -------------------------------------------------------------\r\n      - name: Create Pull Request\r\n        uses: peter-evans\/create-pull-request@v6\r\n        with:\r\n          commit-message: \"chore(factory): nightly compliance audit &amp; dead code elimination\"\r\n          branch: \"factory\/nightly-compliance-audit\"\r\n          delete-branch: true\r\n          title: \"\ud83e\udd16 Software Factory: Nightly Compliance &amp; Debt Pruning (${{ env.DELETIONS }} lines removed)\"\r\n          body: ${{ env.PR_BODY }}\r\n          labels: |\r\n            automated-pr\r\n            technical-debt\r\n            software-factory\r\n<\/code><\/pre>\n<h3>2. How the Pull Request Looks to Developers<\/h3>\n<p>When human engineers log in the next morning, the generated PR clearly visualizes the debt reduction:<\/p>\n<pre><code>## \ud83e\udd16 Software Factory: Automated Nightly Maintenance\r\n\r\n### \ud83d\udcca Codebase Health Delta\r\n| Metric | Baseline \/ Before | After Clean-up | Net Impact |\r\n| :--- | :--- | :--- | :--- |\r\n| **Lines of Code** | +42 | -589 | **-547 lines** |\r\n| **Web Client Bundle (.next\/static)** | 14,280 KB | 13,912 KB | **-368 KB** |\r\n\r\n### \ud83d\udee0\ufe0f Sub-Agent Actions &amp; Highlights\r\n- **web-compliance-auditor**: Removed obsolete `core-js` polyfills, converted 4 legacy React components from `'use client'` to Server Components, and pruned unused `lodash` helpers.\r\n- **ios-compliance-auditor**: Modernized completion handlers in `NetworkManager.swift` to Swift 6 `async\/await`.\r\n- **android-compliance-auditor**: Bumped target SDK support and stripped redundant XML drawables replaced by Jetpack Compose icons.\r\n\r\n---\r\n### \ud83d\udee1\ufe0f Safety &amp; Verification Gates\r\n- \u2705 **PreToolUse Shell Firewall (`gemini-shield.sh`)**: Intercepted destructive commands; 0 policy violations.\r\n- \u2705 **Stop Event Goal Verifier (`goal-verifier.sh`)**: Enforced unit tests, lint checks, and builds across all modified worktrees before permitting completion.\r\n- \u2705 **Isolation**: Sub-agents executed on isolated git worktree branches; zero main working tree pollution.<\/code><\/pre>\n<pre><code>\u00a0<\/code><\/pre>\n<p>To notify your engineering team immediately when the factory opens a maintenance PR, you can append a webhook step to your GitHub Actions workflow. This sends a formatted summary card with line deltas, bundle savings, and a direct link to the pull request.<\/p>\n<p>Here are the configuration snippets for both <strong>Slack<\/strong> and <strong>Google Chat<\/strong>.<\/p>\n<h3>Option A: Slack Incoming Webhook (Block Kit Card)<\/h3>\n<p>Store your webhook URL in your GitHub repository secrets as <code>SLACK_WEBHOOK_URL<\/code> (<code>Settings<\/code> &gt; <code>Secrets and variables<\/code> &gt; <code>Actions<\/code>).<\/p>\n<p>Add this step directly after the <code>Create Pull Request<\/code> step in <code>.github\/workflows\/nightly-compliance-factory.yml<\/code>:<\/p>\n<pre><code>      # -------------------------------------------------------------\r\n      # Dispatch Slack Alert on New PR\r\n      # -------------------------------------------------------------\r\n      - name: Send Slack Notification\r\n        if: steps.cpr.outputs.pull-request-number != ''\r\n        env:\r\n          SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}\r\n          PR_URL: ${{ steps.cpr.outputs.pull-request-url }}\r\n          PR_NUM: ${{ steps.cpr.outputs.pull-request-number }}\r\n          INSERTIONS: ${{ env.INSERTIONS }}\r\n          DELETIONS: ${{ env.DELETIONS }}\r\n          BUNDLE_DELTA_KB: ${{ env.BUNDLE_DELTA_KB }}\r\n        run: |\r\n          curl -s -X POST -H 'Content-type: application\/json' \\\r\n            --data \"{\r\n              \\\"blocks\\\": [\r\n                {\r\n                  \\\"type\\\": \\\"header\\\",\r\n                  \\\"text\\\": {\r\n                    \\\"type\\\": \\\"plain_text\\\",\r\n                    \\\"text\\\": \\\"\ud83e\udd16 Software Factory: Nightly Pruning PR #${PR_NUM}\\\",\r\n                    \\\"emoji\\\": true\r\n                  }\r\n                },\r\n                {\r\n                  \\\"type\\\": \\\"section\\\",\r\n                  \\\"fields\\\": [\r\n                    {\\\"type\\\": \\\"mrkdwn\\\", \\\"text\\\": \\\"*Lines Pruned:*\\n-${DELETIONS} (+${INSERTIONS})\\\"},\r\n                    {\\\"type\\\": \\\"mrkdwn\\\", \\\"text\\\": \\\"*Bundle Impact:*\\n${BUNDLE_DELTA_KB} KB\\\"}\r\n                  ]\r\n                },\r\n                {\r\n                  \\\"type\\\": \\\"section\\\",\r\n                  \\\"text\\\": {\r\n                    \\\"type\\\": \\\"mrkdwn\\\",\r\n                    \\\"text\\\": \\\"Autonomous sub-agents (*Web*, *iOS*, *Android*) finished auditing and verified all unit tests in isolated sandboxes.\\\"\r\n                  }\r\n                },\r\n                {\r\n                  \\\"type\\\": \\\"actions\\\",\r\n                  \\\"elements\\\": [\r\n                    {\r\n                      \\\"type\\\": \\\"button\\\",\r\n                      \\\"text\\\": {\\\"type\\\": \\\"plain_text\\\", \\\"text\\\": \\\"Review Pull Request\\\"},\r\n                      \\\"url\\\": \\\"${PR_URL}\\\",\r\n                      \\\"style\\\": \\\"primary\\\"\r\n                    }\r\n                  ]\r\n                }\r\n              ]\r\n            }\" \"$SLACK_WEBHOOK_URL\"\r\n<\/code><\/pre>\n<h3>Option B: Google Chat Webhook (Cards v2 Format)<\/h3>\n<p>Store your space&#8217;s webhook URL in GitHub Secrets as <code>GOOGLE_CHAT_WEBHOOK_URL<\/code>.<\/p>\n<pre><code>      # -------------------------------------------------------------\r\n      # Dispatch Google Chat Alert on New PR\r\n      # -------------------------------------------------------------\r\n      - name: Send Google Chat Notification\r\n        if: steps.cpr.outputs.pull-request-number != ''\r\n        env:\r\n          CHAT_WEBHOOK_URL: ${{ secrets.GOOGLE_CHAT_WEBHOOK_URL }}\r\n          PR_URL: ${{ steps.cpr.outputs.pull-request-url }}\r\n          PR_NUM: ${{ steps.cpr.outputs.pull-request-number }}\r\n          INSERTIONS: ${{ env.INSERTIONS }}\r\n          DELETIONS: ${{ env.DELETIONS }}\r\n          BUNDLE_DELTA_KB: ${{ env.BUNDLE_DELTA_KB }}\r\n        run: |\r\n          curl -s -X POST -H 'Content-Type: application\/json; charset=UTF-8' \\\r\n            --data \"{\r\n              \\\"cardsV2\\\": [\r\n                {\r\n                  \\\"cardId\\\": \\\"compliance-pr-${PR_NUM}\\\",\r\n                  \\\"card\\\": {\r\n                    \\\"header\\\": {\r\n                      \\\"title\\\": \\\"\ud83e\udd16 Software Factory: Automated Pruning PR #${PR_NUM}\\\",\r\n                      \\\"subtitle\\\": \\\"Nightly Codebase Health &amp; Platform Compliance Sweep\\\"\r\n                    },\r\n                    \\\"sections\\\": [\r\n                      {\r\n                        \\\"header\\\": \\\"Impact Telemetry\\\",\r\n                        \\\"widgets\\\": [\r\n                          {\r\n                            \\\"decoratedText\\\": {\r\n                              \\\"topLabel\\\": \\\"Lines Dropped\\\",\r\n                              \\\"text\\\": \\\"&lt;b&gt;-${DELETIONS}&lt;\/b&gt; (+${INSERTIONS})\\\"\r\n                            }\r\n                          },\r\n                          {\r\n                            \\\"decoratedText\\\": {\r\n                              \\\"topLabel\\\": \\\"Client Bundle Delta\\\",\r\n                              \\\"text\\\": \\\"&lt;b&gt;${BUNDLE_DELTA_KB} KB&lt;\/b&gt;\\\"\r\n                            }\r\n                          }\r\n                        ]\r\n                      },\r\n                      {\r\n                        \\\"widgets\\\": [\r\n                          {\r\n                            \\\"buttonList\\\": {\r\n                              \\\"buttons\\\": [\r\n                                {\r\n                                  \\\"text\\\": \\\"Review PR in GitHub\\\",\r\n                                  \\\"onClick\\\": {\r\n                                    \\\"openLink\\\": { \\\"url\\\": \\\"${PR_URL}\\\" }\r\n                                  }\r\n                                }\r\n                              ]\r\n                            }\r\n                          }\r\n                        ]\r\n                      }\r\n                    ]\r\n                  }\r\n                }\r\n              ]\r\n            }\" \"$CHAT_WEBHOOK_URL\"\r\n<\/code><\/pre>\n<hr \/>\n<h3>Operational Details<\/h3>\n<ol>\n<li><strong>Conditional Dispatch (<code>if: steps.cpr.outputs.pull-request-number != ''<\/code>)<\/strong>: Ensure your <code>create-pull-request<\/code> step has <code>id: cpr<\/code>. The alert step will only run if modifications were staged and a new or updated PR was generated. If the repository was already compliant and no changes were made, no alert is sent.<\/li>\n<li><strong>Actionable Cards<\/strong>: Team members get the exact lines and bundle size shaved directly in their chat feed, with a direct button leading straight to the GitHub review interface.<\/li>\n<\/ol>\n<h1>Enterprise Runbook: Deploying the Autonomous Software Factory<\/h1>\n<p>This runbook brings together the complete architecture for an autonomous codebase compliance and maintenance fleet powered by Google Antigravity and the Gemini model family [cite: 14, 21].<\/p>\n<hr \/>\n<h3>1. Unified Workspace Hierarchy<\/h3>\n<p>Antigravity traverses configuration files hierarchically, resolving universal project rules first before activating scoped agents and skills [cite: 2, 16]:<\/p>\n<p>\\[\\text{AGENTS.md (Universal Standard)} \\longrightarrow \\text{GEMINI.md (Native Config)} \\longrightarrow \\text{Scoped Rules (.agents\/rules\/*.md)} \\text{ }\\] [cite: 16]<\/p>\n<p>Organize your target repository with the following layout [cite: 2, 5, 13]:<\/p>\n<pre><code>your-repository\/\r\n\u251c\u2500\u2500 AGENTS.md                                # Root orchestrator instructions &amp; delegation matrix\r\n\u251c\u2500\u2500 .agents\/\r\n\u2502   \u251c\u2500\u2500 settings.json                        # Declarative tool permissions &amp; lifecycle hook bindings\r\n\u2502   \u251c\u2500\u2500 hooks\/\r\n\u2502   \u2502   \u251c\u2500\u2500 gemini-shield.sh                 # PreToolUse shell command firewall\r\n\u2502   \u2502   \u2514\u2500\u2500 goal-verifier.sh                 # Stop lifecycle completion verifier\r\n\u2502   \u2514\u2500\u2500 agents\/\r\n\u2502       \u251c\u2500\u2500 web-compliance-auditor.md        # Next.js \/ TypeScript auditor\r\n\u2502       \u251c\u2500\u2500 ios-compliance-auditor.md        # Swift \/ SwiftUI auditor\r\n\u2502       \u2514\u2500\u2500 android-compliance-auditor.md    # Android Jetpack \/ Gradle auditor\r\n\u2514\u2500\u2500 .github\/\r\n    \u2514\u2500\u2500 workflows\/\r\n        \u2514\u2500\u2500 nightly-compliance-factory.yml   # Headless Antigravity CLI (agy -p) cron pipeline\r\n<\/code><\/pre>\n<h3>2. Universal Root Orchestrator: <code>AGENTS.md<\/code><\/h3>\n<p>Save this file in your repository root [cite: 2, 6]. It acts as the cross-platform contract defining the orchestrator role, platform policies, and delegation heuristics [cite: 6, 7, 16].<\/p>\n<pre><code># AGENTS.md \u2014 Autonomous Software Factory Orchestrator\r\n\r\n## 1. Role &amp; Architectural Boundaries\r\nYou are the **Lead Software Factory Orchestrator**. Your mandate is to maintain repository health, eliminate technical debt, prune obsolete polyfills, and enforce cross-platform compliance without creating AI-generated code bloat or working-tree lockouts.\r\n\r\nNever perform large-scale multi-file refactors directly within the primary context window. Act as the architectural dispatch: diagnose objectives, break them into orthogonal tasks, and delegate to specialized sub-agents.\r\n\r\n## 2. Trailing-Edge Platform Support Policy\r\nFlag and prune code, polyfills, and backward-compatibility shims supporting versions older than:\r\n- **Web**: Modern Evergreen browsers within trailing 2 major versions. Strip obsolete ECMAScript polyfills and legacy browser vendor prefixes.\r\n- **iOS**: Minimum deployment target: iOS 17.0+ (SwiftUI, Swift 6 Concurrency).\r\n- **Android**: Minimum SDK: API 28 (Android 9.0 Pie), Target SDK: Current stable API. Modern Android Architecture (BOM) required.\r\n\r\n## 3. Sub-Agent Delegation Matrix\r\nDelegate maintenance tasks using `invoke_subagent` with `workspace_mode: \"branch\"`:\r\n\r\n| Objective \/ File Scope | Sub-Agent | Invocation Mode | Verification Gate |\r\n| :--- | :--- | :--- | :--- |\r\n| Next.js, React, TypeScript, CSS modules, bundle bloat | `web-compliance-auditor` | `branch` (Worktree) | `npm run lint &amp;&amp; npm run build` |\r\n| Swift, SwiftUI, Xcode targets, SPM, memory leaks | `ios-compliance-auditor` | `branch` (Worktree) | `swift test` or `xcodebuild test` |\r\n| Kotlin, Jetpack Compose, Gradle (`build.gradle.kts`) | `android-compliance-auditor` | `branch` (Worktree) | `.\/gradlew lint` |\r\n| Repository search and documentation indexing | `research` (Built-in) | `inherit` (Read-only) | N\/A |\r\n\r\n### Dispatch Rules:\r\n1. **Parallel Worktrees**: Multiple platform sub-agents may run concurrently in isolated Git worktrees. Assign distinct file scopes to avoid merge conflicts.\r\n2. **Context Freshness**: Pass self-contained prompts to sub-agents (target paths, platform constraints, verification commands). Do not forward monolithic transcripts.\r\n3. **Isolation Guarantee**: Never invoke modifying sub-agents with `workspace_mode: \"inherit\"`. Enforce `branch` mode.\r\n\r\n## 4. Operational Guardrails\r\n1. **Destructive Actions**: Never execute or approve `rm -rf`, `git push --force`, or schema dropping without explicit human confirmation.\r\n2. **Permission Boundary**: Modification tools (`replace_file_content`, `write_file`) must only be exercised by sub-agents inside sandbox worktrees.\r\n\r\n## 5. Verification Gate (\"Proof Before Done\")\r\nBefore presenting changes for human sign-off:\r\n1. Verify each sub-agent returned a clean unified git diff scoped to its target.\r\n2. Confirm the sub-agent\u2019s verification command exited cleanly (`exit code 0`).\r\n<\/code><\/pre>\n<h3>3. Specialized Sub-Agent Fleet (<code>.agents\/agents\/<\/code>)<\/h3>\n<p>Antigravity auto-discovers custom agents defined in Markdown with structured YAML frontmatter [cite: 12, 13, 15]. The metadata is loaded via progressive disclosure to conserve tokens until invoked [cite: 3, 37, 40].<\/p>\n<h4>A. Web Auditor (<code>.agents\/agents\/web-compliance-auditor.md<\/code>)<\/h4>\n<pre><code>---\r\nname: web-compliance-auditor\r\ndescription: Specialized subagent that audits React, Next.js, and TypeScript codebases for server\/client boundary violations, dead code, bundle bloat, and accessibility standards.\r\ntools:\r\n  - view_file\r\n  - replace_file_content\r\n  - grep_search\r\n  - run_command\r\nsubagent: true\r\nmainAgent: false\r\nmodel: pro\r\ncommandExecutionPolicy: sandbox\r\n---\r\n\r\n# Web Compliance Instructions\r\n1. Inspect Next.js routes to ensure `'use client'` and `'use server'` boundaries are respected.\r\n2. Identify and remove unused npm dependencies, obsolete polyfills, and orphaned CSS modules.\r\n3. Eliminate duplicate utility abstractions and audit UI components against WCAG AA standards.\r\n4. Execute `npm run lint &amp;&amp; npm run build` inside the sandbox before returning diffs.\r\n<\/code><\/pre>\n<h4>B. iOS Auditor (<code>.agents\/agents\/ios-compliance-auditor.md<\/code>)<\/h4>\n<pre><code>---\r\nname: ios-compliance-auditor\r\ndescription: Specialized subagent that audits iOS Swift and SwiftUI codebases for deprecated UIKit patterns, memory leaks, retain cycles, and Swift Concurrency safety.\r\ntools:\r\n  - view_file\r\n  - replace_file_content\r\n  - grep_search\r\n  - run_command\r\nsubagent: true\r\nmainAgent: false\r\nmodel: pro\r\ncommandExecutionPolicy: sandbox\r\n---\r\n\r\n# iOS Compliance Instructions\r\n1. Refactor legacy UIKit delegates, deprecated Combine pipelines, and closure-based handlers into modern Swift Concurrency (`async\/await`).\r\n2. Audit closures for strong reference cycles, unowned self-references, and unmanaged observers.\r\n3. Prune unreferenced SwiftUI views, orphaned asset catalog items, and dead feature flags.\r\n4. Execute `swift test` or `xcodebuild test` in the sandbox to verify zero regressions.\r\n<\/code><\/pre>\n<h4>C. Android Auditor (<code>.agents\/agents\/android-compliance-auditor.md<\/code>)<\/h4>\n<pre><code>---\r\nname: android-compliance-auditor\r\ndescription: Specialized subagent that audits Android repositories for deprecated APIs, Jetpack compliance, Gradle configuration health, and permission security boundaries.\r\ntools:\r\n  - view_file\r\n  - replace_file_content\r\n  - grep_search\r\n  - run_command\r\nsubagent: true\r\nmainAgent: false\r\nmodel: pro\r\ncommandExecutionPolicy: sandbox\r\n---\r\n\r\n# Android Compliance Instructions\r\n1. Audit `build.gradle.kts` and Kotlin files to migrate legacy components to modern Android Jetpack\/AndroidX BOM standards.\r\n2. Validate that runtime permissions in `AndroidManifest.xml` adhere to least-privilege security policies.\r\n3. Remove outdated support libraries, duplicate XML drawables, and unused view bindings.\r\n4. Execute `.\/gradlew lint` in the sandbox to confirm compilation and lint compliance.\r\n<\/code><\/pre>\n<h3>4. Deterministic Lifecycle Hooks &amp; Permissions<\/h3>\n<p>While Markdown provides behavioral instructions, lifecycle hooks operate as deterministic firewalls [cite: 37, 39]. A <code>PreToolUse<\/code> hook blocks forbidden commands before shell execution, while a <code>Stop<\/code> hook prevents termination until tests pass [cite: 37, 39].<\/p>\n<h4>A. Settings &amp; Permissions (<code>.agents\/settings.json<\/code>)<\/h4>\n<pre><code>{\r\n  \"permissions\": {\r\n    \"allow\": [\r\n      \"command(git diff)\",\r\n      \"command(git status)\",\r\n      \"command(npm test)\",\r\n      \"command(npm run lint)\",\r\n      \"command(swift test)\",\r\n      \"command(.\/gradlew lint)\"\r\n    ],\r\n    \"deny\": [\r\n      \"command(git push --force)\",\r\n      \"command(git reset --hard)\",\r\n      \"file_read(.\/.env)\",\r\n      \"file_read(.\/.env.*)\"\r\n    ]\r\n  },\r\n  \"hooks\": {\r\n    \"PreToolUse\": [\r\n      {\r\n        \"matcher\": \"run_command\",\r\n        \"script\": \".agents\/hooks\/gemini-shield.sh\"\r\n      }\r\n    ],\r\n    \"PostToolUse\": [\r\n      {\r\n        \"matcher\": \"replace_file_content\",\r\n        \"command\": \"npx prettier --write \\\"$FILE_PATH\\\"\"\r\n      }\r\n    ],\r\n    \"Stop\": [\r\n      {\r\n        \"script\": \".agents\/hooks\/goal-verifier.sh\"\r\n      }\r\n    ]\r\n  }\r\n}\r\n<\/code><\/pre>\n<h4>B. PreToolUse Shell Guardrail (<code>.agents\/hooks\/gemini-shield.sh<\/code>)<\/h4>\n<pre><code>#!\/usr\/bin\/env bash\r\nset -euo pipefail\r\n\r\nPAYLOAD=$(cat)\r\nTOOL_NAME=$(echo \"$PAYLOAD\" | jq -r '.tool \/\/ .tool_name \/\/ empty')\r\nCOMMAND=$(echo \"$PAYLOAD\" | jq -r '.tool_input.command \/\/ .tool_input.CommandLine \/\/ empty')\r\n\r\nif [[ \"$TOOL_NAME\" != \"run_command\" &amp;&amp; \"$TOOL_NAME\" != \"Bash\" &amp;&amp; \"$TOOL_NAME\" != \"command\" ]]; then\r\n  exit 0\r\nfi\r\n\r\n# Block destructive file system deletions\r\nif echo \"$COMMAND\" | grep -E -q '(rm[[:space:]]+-[rfR]{1,3}[[:space:]]+(\/|~|\\.|\\*|\\$HOME))|(mkfs|dd[[:space:]]+if=)'; then\r\n  echo '{\"decision\": \"block\", \"reason\": \"Destructive filesystem deletion commands are prohibited.\"}' &gt;&amp;2\r\n  exit 2\r\nfi\r\n\r\n# Block force push operations\r\nif echo \"$COMMAND\" | grep -E -q 'git[[:space:]]+push[[:space:]]+.*(--force|-f)'; then\r\n  echo '{\"decision\": \"block\", \"reason\": \"Force pushing to remote branches is blocked by policy.\"}' &gt;&amp;2\r\n  exit 2\r\nfi\r\n\r\n# Block destructive database operations\r\nif echo \"$COMMAND\" | grep -E -i -q '(drop[[:space:]]+database|drop[[:space:]]+table|truncate[[:space:]]+table)'; then\r\n  echo '{\"decision\": \"block\", \"reason\": \"Destructive SQL operations are restricted.\"}' &gt;&amp;2\r\n  exit 2\r\nfi\r\n\r\nexit 0\r\n<\/code><\/pre>\n<h4>C. Stop Event Goal Verifier (<code>.agents\/hooks\/goal-verifier.sh<\/code>)<\/h4>\n<pre><code>#!\/usr\/bin\/env bash\r\nset -euo pipefail\r\n\r\nPAYLOAD=$(cat)\r\nGIT_DIFF=$(git status --porcelain)\r\n\r\nif [[ -z \"$GIT_DIFF\" ]]; then\r\n  echo '{\"decision\": \"allow\"}'\r\n  exit 0\r\nfi\r\n\r\nFAILURE_LOG=\"\"\r\n\r\nif [[ -f \"package.json\" ]]; then\r\n  if ! npm run lint &gt; \/tmp\/web_lint.log 2&gt;&amp;1; then\r\n    FAILURE_LOG+=\"[Web Lint Failure]:\\n$(tail -n 20 \/tmp\/web_lint.log)\\n\\n\"\r\n  fi\r\n  if ! npm test -- --passWithNoTests &gt; \/tmp\/web_test.log 2&gt;&amp;1; then\r\n    FAILURE_LOG+=\"[Web Test Failure]:\\n$(tail -n 20 \/tmp\/web_test.log)\\n\\n\"\r\n  fi\r\nfi\r\n\r\nif [[ -f \"Package.swift\" ]]; then\r\n  if ! swift test &gt; \/tmp\/swift_test.log 2&gt;&amp;1; then\r\n    FAILURE_LOG+=\"[Swift Test Failure]:\\n$(tail -n 20 \/tmp\/swift_test.log)\\n\\n\"\r\n  fi\r\nfi\r\n\r\nif [[ -f \"build.gradle.kts\" || -f \"build.gradle\" ]]; then\r\n  if ! .\/gradlew lint test --daemon &gt; \/tmp\/android_test.log 2&gt;&amp;1; then\r\n    FAILURE_LOG+=\"[Android Test Failure]:\\n$(tail -n 20 \/tmp\/android_test.log)\\n\\n\"\r\n  fi\r\nfi\r\n\r\nif [[ -n \"$FAILURE_LOG\" ]]; then\r\n  ESCAPED_REASON=$(echo -e \"Proof Before Done Violation: Test suites failed. Fix all errors before completing:\\n\\n$FAILURE_LOG\" | jq -Rs .)\r\n  echo \"{\\\"decision\\\": \\\"continue\\\", \\\"reason\\\": $ESCAPED_REASON}\"\r\n  exit 0\r\nfi\r\n\r\necho '{\"decision\": \"allow\"}'\r\nexit 0\r\n<\/code><\/pre>\n<p>Make scripts executable:<\/p>\n<pre><code>chmod +x .agents\/hooks\/gemini-shield.sh .agents\/hooks\/goal-verifier.sh\r\n<\/code><\/pre>\n<h3>5. Headless CI\/CD Pipeline &amp; Quantitative Telemetry<\/h3>\n<p><em>File location: <code>.github\/workflows\/nightly-compliance-factory.yml<\/code><\/em> [cite: 18, 19]<\/p>\n<p>This workflow authenticates with Google Cloud via Workload Identity Federation (WIF) and Application Default Credentials (ADC) using <code>AGY_ADC_AUTH=1<\/code> [cite: 18]. It executes <code>agy -p<\/code> in headless mode and extracts quantitative metrics (lines dropped, bundle byte delta) directly into the generated pull request [cite: 10, 18, 19].<\/p>\n<pre><code>name: Nightly Multi-Agent Compliance Sweep\r\n\r\non:\r\n  schedule:\r\n    - cron: '0 2 * * *'\r\n  workflow_dispatch:\r\n\r\npermissions:\r\n  contents: write\r\n  pull-requests: write\r\n  id-token: write\r\n\r\njobs:\r\n  software-factory-audit:\r\n    runs-on: ubuntu-latest\r\n    timeout-minutes: 45\r\n\r\n    steps:\r\n      - name: Checkout Repository\r\n        uses: actions\/checkout@v5\r\n        with:\r\n          fetch-depth: 0\r\n\r\n      - name: Authenticate to Google Cloud via WIF\r\n        uses: google-github-actions\/auth@v3\r\n        with:\r\n          workload_identity_provider: 'projects\/123456789012\/locations\/global\/workloadIdentityPools\/github-actions-pool\/providers\/github-provider'\r\n          service_account: 'antigravity-ci-runner@enterprise-project.iam.gserviceaccount.com'\r\n\r\n      - name: Install Antigravity CLI (agy)\r\n        run: |\r\n          curl -fsSL https:\/\/antigravity.google\/cli\/install.sh | bash\r\n          echo \"$HOME\/.antigravity\/bin\" &gt;&gt; $GITHUB_PATH\r\n\r\n      - name: Setup Node.js Environment\r\n        uses: actions\/setup-node@v4\r\n        with:\r\n          node-version: '22'\r\n          cache: 'npm'\r\n\r\n      - name: Install Dependencies &amp; Record Baseline Web Bundle\r\n        run: |\r\n          npm ci\r\n          npm run build --if-present\r\n          BASELINE_BUNDLE_KB=$(du -sk .next\/static 2&gt;\/dev\/null | awk '{print $1}' || echo \"0\")\r\n          echo \"BASELINE_BUNDLE_KB=${BASELINE_BUNDLE_KB}\" &gt;&gt; $GITHUB_ENV\r\n\r\n      - name: Run Headless Autonomous Audit Fleet\r\n        env:\r\n          AGY_ADC_AUTH: \"1\"\r\n        run: |\r\n          agy -p \"Execute the automated nightly compliance sweep across Web, iOS, and Android scopes using your designated sub-agents. Prune dead code, remove deprecated polyfills, and modernize trailing-edge APIs in isolated branch worktrees. Ensure all test suites pass before completing.\" \\\r\n              --mode accept-edits \\\r\n              --sandbox \\\r\n              --output-format json &gt; sweep_output.json\r\n\r\n      - name: Extract Metrics &amp; Formulate PR Body\r\n        run: |\r\n          INSERTIONS=$(git diff --shortstat | grep -o -E '+ insertion' | cut -d ' ' -f 1 || echo 0)\r\n          DELETIONS=$(git diff --shortstat | grep -o -E '+ deletion' | cut -d ' ' -f 1 || echo 0)\r\n          NET_LINES=$(( INSERTIONS - DELETIONS ))\r\n\r\n          npm run build --if-present\r\n          NEW_BUNDLE_KB=$(du -sk .next\/static 2&gt;\/dev\/null | awk '{print $1}' || echo \"0\")\r\n          BUNDLE_DELTA_KB=$(( NEW_BUNDLE_KB - BASELINE_BUNDLE_KB ))\r\n          AGENT_SUMMARY=$(jq -r '.response \/\/ .summary \/\/ \"Routine maintenance completed.\"' sweep_output.json)\r\n\r\n          echo \"INSERTIONS=${INSERTIONS}\" &gt;&gt; $GITHUB_ENV\r\n          echo \"DELETIONS=${DELETIONS}\" &gt;&gt; $GITHUB_ENV\r\n          echo \"BUNDLE_DELTA_KB=${BUNDLE_DELTA_KB}\" &gt;&gt; $GITHUB_ENV\r\n\r\n          {\r\n            echo \"PR_BODY&lt;&lt;EOF\"\r\n            echo \"## \ud83e\udd16 Software Factory: Automated Nightly Maintenance\"\r\n            echo \"\"\r\n            echo \"### \ud83d\udcca Codebase Health Delta\"\r\n            echo \"| Metric | Baseline | After Clean-up | Net Impact |\"\r\n            echo \"| :--- | :--- | :--- | :--- |\"\r\n            echo \"| **Lines of Code** | +${INSERTIONS} | -${DELETIONS} | **${NET_LINES} lines** |\"\r\n            echo \"| **Web Client Bundle** | ${BASELINE_BUNDLE_KB} KB | ${NEW_BUNDLE_KB} KB | **${BUNDLE_DELTA_KB} KB** |\"\r\n            echo \"\"\r\n            echo \"### \ud83d\udee0\ufe0f Sub-Agent Actions &amp; Highlights\"\r\n            echo \"${AGENT_SUMMARY}\"\r\n            echo \"\"\r\n            echo \"---\"\r\n            echo \"### \ud83d\udee1\ufe0f Safety &amp; Verification Gates\"\r\n            echo \"- \u2705 **PreToolUse Shell Firewall (`gemini-shield.sh`)**: Intercepted destructive commands; 0 policy violations.\"\r\n            echo \"- \u2705 **Stop Event Goal Verifier (`goal-verifier.sh`)**: All test suites and builds passed in sandbox.\"\r\n            echo \"- \u2705 **Isolation**: Sub-agents executed on isolated git worktrees; zero main working tree pollution.\"\r\n            echo \"EOF\"\r\n          } &gt;&gt; $GITHUB_ENV\r\n\r\n      - name: Create Pull Request\r\n        id: cpr\r\n        uses: peter-evans\/create-pull-request@v6\r\n        with:\r\n          commit-message: \"chore(factory): nightly compliance audit &amp; dead code elimination\"\r\n          branch: \"factory\/nightly-compliance-audit\"\r\n          delete-branch: true\r\n          title: \"\ud83e\udd16 Software Factory: Nightly Compliance &amp; Debt Pruning (-${{ env.DELETIONS }} lines)\"\r\n          body: ${{ env.PR_BODY }}\r\n          labels: |\r\n            automated-pr\r\n            technical-debt\r\n            software-factory\r\n\r\n      # Alert integration: Slack\r\n      - name: Send Slack Notification\r\n        if: steps.cpr.outputs.pull-request-number != ''\r\n        env:\r\n          SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}\r\n          PR_URL: ${{ steps.cpr.outputs.pull-request-url }}\r\n          PR_NUM: ${{ steps.cpr.outputs.pull-request-number }}\r\n          INSERTIONS: ${{ env.INSERTIONS }}\r\n          DELETIONS: ${{ env.DELETIONS }}\r\n          BUNDLE_DELTA_KB: ${{ env.BUNDLE_DELTA_KB }}\r\n        run: |\r\n          curl -s -X POST -H 'Content-type: application\/json' \\\r\n            --data \"{\r\n              \\\"blocks\\\": [\r\n                {\r\n                  \\\"type\\\": \\\"header\\\",\r\n                  \\\"text\\\": {\\\"type\\\": \\\"plain_text\\\", \\\"text\\\": \\\"\ud83e\udd16 Software Factory: Nightly Pruning PR #${PR_NUM}\\\"}\r\n                },\r\n                {\r\n                  \\\"type\\\": \\\"section\\\",\r\n                  \\\"fields\\\": [\r\n                    {\\\"type\\\": \\\"mrkdwn\\\", \\\"text\\\": \\\"*Lines Pruned:*\\n-${DELETIONS} (+${INSERTIONS})\\\"},\r\n                    {\\\"type\\\": \\\"mrkdwn\\\", \\\"text\\\": \\\"*Bundle Impact:*\\n${BUNDLE_DELTA_KB} KB\\\"}\r\n                  ]\r\n                },\r\n                {\r\n                  \\\"type\\\": \\\"actions\\\",\r\n                  \\\"elements\\\": [\r\n                    {\r\n                      \\\"type\\\": \\\"button\\\",\r\n                      \\\"text\\\": {\\\"type\\\": \\\"plain_text\\\", \\\"text\\\": \\\"Review Pull Request\\\"},\r\n                      \\\"url\\\": \\\"${PR_URL}\\\",\r\n                      \\\"style\\\": \\\"primary\\\"\r\n                    }\r\n                  ]\r\n                }\r\n              ]\r\n            }\" \"$SLACK_WEBHOOK_URL\"\r\n<\/code><\/pre>\n<h3>6. Deployment &amp; Verification Checklist<\/h3>\n<ol>\n<li><strong>Verify Local Hooks<\/strong>:\n<pre><code># Test the PreToolUse hook by feeding a simulated dangerous command:\r\necho '{\"tool\": \"run_command\", \"tool_input\": {\"command\": \"rm -rf \/\"}}' | .agents\/hooks\/gemini-shield.sh\r\n# Expected output: exits with code 2 and outputs blocking JSON to stderr\r\n<\/code><\/pre>\n<\/li>\n<li><strong>Verify Agent Discovery<\/strong>:\n<pre><code># Confirm that Antigravity discovers your custom sub-agents\r\nagy \/agents\r\n<\/code><\/pre>\n<p>Confirm that <code>web-compliance-auditor<\/code>, <code>ios-compliance-auditor<\/code>, and <code>android-compliance-auditor<\/code> appear in the registry [cite: 11, 13].<\/li>\n<li><strong>Verify CI Authentication<\/strong>: Confirm that Google Cloud Workload Identity Federation is configured to accept tokens issued by your GitHub repository and mapped to the runner service account with appropriate Vertex AI \/ Gemini invocation roles [cite: 18].<\/li>\n<\/ol>\n<h3><span style=\"font-weight: 400;\">Stop Using AI Just to Write Code: 5 Surprising Lessons from Building an AI-Powered &#8220;Software Factory&#8221;<\/span><\/h3>\n<p><span style=\"font-weight: 400;\">We\u2019ve all seen it happen: an AI coding assistant churns out 500 lines of syntactically valid code in ten seconds flat. Feature velocity skyrockets, pull requests stack up, and engineering leads start celebrating\u2014until code review bottlenecks hit. Before long, your repository is burdened by subtle bloat, unmaintained abstractions, and low-quality\u00a0 <\/span><b>&#8220;AI slop.&#8221;<\/b><\/p>\n<p><span style=\"font-weight: 400;\">If we only use artificial intelligence to write\u00a0 <\/span><i><span style=\"font-weight: 400;\">more<\/span><\/i><span style=\"font-weight: 400;\">\u00a0 code, we are simply accelerating technical debt.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">The real magic happens when you shift AI from front-line code generation to\u00a0 <\/span><b>&#8220;trailing edge&#8221;<\/b><span style=\"font-weight: 400;\">\u00a0 maintenance. Instead of asking agents to draft your next feature, what if you tasked them with hunting down legacy APIs, stripping out redundant polyfills, and keeping your dependencies pristine?<\/span><\/p>\n<p><span style=\"font-weight: 400;\">By pairing\u00a0 <\/span><b>anti-gravity<\/b><span style=\"font-weight: 400;\">\u00a0 (the agentic development platform) with\u00a0 <\/span><b>Gemini for Argonne<\/b><span style=\"font-weight: 400;\">\u00a0 (the underlying intelligence engine capable of long-horizon reasoning), you can construct a fully automated, agentic\u00a0 <\/span><b>&#8220;software factory.&#8221;<\/b><span style=\"font-weight: 400;\">\u00a0 Powered by specialized sub-agents defined in simple Markdown, this approach turns AI from an unchecked code generator into a tireless janitor for your codebase.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Here are five key lessons learned from building an automated software factory designed to eliminate code rot.<\/span><\/p>\n<h4><span style=\"font-weight: 400;\">1. Use AI to\u00a0 <\/span><i><span style=\"font-weight: 400;\">Delete<\/span><\/i><span style=\"font-weight: 400;\">\u00a0 Code, Not Just Write It<\/span><\/h4>\n<p><span style=\"font-weight: 400;\">Every modern codebase carries historical weight. Years ago, your web app might have needed complex polyfills or custom helpers to handle cross-browser inconsistencies. Today, native web APIs and modern mobile SDKs handle those exact capabilities out of the box. Yet, those legacy fallbacks sit untouched in your source tree because nobody wants to break a legacy production path.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Clearing out this dead weight delivers immediate engineering ROI: it speeds up user load times, shrinks bundle sizes, and dramatically reduces the surface area that future AI agents have to analyze. Fewer lines of code mean smaller token counts and fewer hallucinations during downstream tasks.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Within anti-gravity, you govern code elimination using a\u00a0 <\/span><b>platform config<\/b><span style=\"font-weight: 400;\"> . This central policy file establishes your company\u2019s exact operational baseline:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Indie Projects \/ Bleeding-Edge Apps:<\/b><span style=\"font-weight: 400;\">\u00a0 Configured to target only the latest platform and browser releases, allowing sub-agents to ruthlessly prune legacy code paths.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Enterprise Applications:<\/b><span style=\"font-weight: 400;\">\u00a0 Mandated to maintain backward compatibility across\u00a0 <\/span><b>2\u20133 browser or mobile versions<\/b><span style=\"font-weight: 400;\"> , giving agents strict boundaries on what can be safely removed.<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400;\">Once this policy is defined, your factory automatically audits source files against platform standards, identifying redundant polyfills and obsolete method signatures for removal.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Rhodey, a developer on the anti-gravity team, puts the problem into sharp perspective:<\/span><\/p>\n<p><span style=\"font-weight: 400;\">&#8220;There are probably so many APIs in your code base that are there in your code for legacy reasons that haven&#8217;t been invoked in years&#8230; Take a look today in your code base, see what you can remove&#8230;&#8221;<\/span><\/p>\n<h4><span style=\"font-weight: 400;\">2. Modular Sub-Agents Outperform Single-Prompt Chat Sessions<\/span><\/h4>\n<p><span style=\"font-weight: 400;\">If you drop an entire multi-platform application into a single long-running chat session and ask it to perform a full codebase audit, performance degrades rapidly. Large prompt context windows inevitably suffer from\u00a0 <\/span><b>context window compaction<\/b><span style=\"font-weight: 400;\"> . As the conversation history swells, the model forgets earlier system constraints, drops minor edge-case rules, and begins hallucinating fixes.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">The solution is to replace mega-prompts with a structured assembly line of modular\u00a0 <\/span><b>custom sub-agents<\/b><span style=\"font-weight: 400;\"> , defined in Markdown inside anti-gravity. Each worker operates within its own\u00a0 <\/span><b>isolated context window<\/b><span style=\"font-weight: 400;\">\u00a0 and executes tasks across a clear 3-phase pipeline:<\/span><\/p>\n<p><span style=\"font-weight: 400;\">[ Incoming Issues \/ GitHub Tickets ]<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u2502<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u25bc<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0Phase 1: Intake Sub-Agent<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u2502<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u25bc\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u25bc\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u25bc<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Phase 2:\u00a0 \u00a0 \u00a0 Phase 2:\u00a0 \u00a0 \u00a0 Phase 2:<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Node\/Web \u00a0 \u00a0 Android\/Jet\u00a0 \u00a0 iOS\/SwiftUI<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Sub-Agent \u00a0 \u00a0 Sub-Agent\u00a0 \u00a0 \u00a0 Sub-Agent<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u2502\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u2502\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u2502<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u25bc<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0Phase 3: Read-Only Auditor<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u2502<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u25bc<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0[ Verified PR \/ Code Cleanup ]<\/span><\/p>\n<h5><span style=\"font-weight: 400;\">The 3-Phase Pipeline Breakdown<\/span><\/h5>\n<ol>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Phase 1: Intake &amp; Policy Parsing:<\/b><span style=\"font-weight: 400;\">\u00a0 The\u00a0 <\/span><b>Intake Sub-Agent<\/b><span style=\"font-weight: 400;\">\u00a0 ingests raw materials\u2014such as reported technical debt issues wired directly to your\u00a0 <\/span><b>GitHub<\/b><span style=\"font-weight: 400;\">\u00a0 repo or internal ticketing system\u2014and evaluates them against your corporate platform config.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Phase 2: Parallel Execution &amp; Modifications:<\/b><span style=\"font-weight: 400;\">\u00a0 Tasks are dispatched simultaneously to specialized sub-agents ( <\/span><b>Web\/Node<\/b><span style=\"font-weight: 400;\"> ,\u00a0 <\/span><b>Android\/Jetpack Compose<\/b><span style=\"font-weight: 400;\"> , and\u00a0 <\/span><b>iOS\/SwiftUI<\/b><span style=\"font-weight: 400;\"> ). Because each sub-agent runs in parallel with an isolated context window, multi-platform updates complete rapidly without cluttering the primary orchestration session.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Phase 3: Review &amp; Audit Reporting:<\/b><span style=\"font-weight: 400;\">\u00a0 The final output is aggregated into structured audit reports, verified code diffs, or clean pull requests ready for human approval.<\/span><\/li>\n<\/ol>\n<p><span style=\"font-weight: 400;\">By isolating worker contexts, anti-gravity keeps main session history lean while allowing parallel workers to analyze large, multi-repository platforms simultaneously.<\/span><\/p>\n<h4><span style=\"font-weight: 400;\">3. You Are the &#8220;Floor Manager&#8221;\u2014Enforce Read-Only Guardrails<\/span><\/h4>\n<p><span style=\"font-weight: 400;\">Fully autonomous agents sound great in marketing demos, but production codebases require hard safety boundaries. In an anti-gravity software factory, the developer steps out of the raw coding trench and into the role of a\u00a0 <\/span><b>&#8220;Floor Manager.&#8221;<\/b><\/p>\n<p><span style=\"font-weight: 400;\">As the Floor Manager, your job is to observe, direct, and enforce security guardrails across your agent workforce.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u2502\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 FLOOR MANAGER DASHBOARD\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u2502<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u2502 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u2502<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u2502\u00a0 [Main Orchestrator] \u2500\u2500&gt; Real-Time Chat Log Inspection\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u2502<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u2502\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u2500\u2500&gt; Direct Message \/ Mid-Flight Steering \u00a0 \u2502<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u2502\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u2500\u2500&gt; Intercept &amp; Repair via \/learn Command \u00a0 \u2502<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518<\/span><\/p>\n<h5><span style=\"font-weight: 400;\">Deterministic Tool Exclusion<\/span><\/h5>\n<p><span style=\"font-weight: 400;\">How do you stop an auditing agent from accidentally rewriting core business logic? In anti-gravity, sub-agent skills are configured via Markdown, allowing you to\u00a0 <\/span><b>explicitly exclude code-writing tools<\/b><span style=\"font-weight: 400;\">\u00a0 from Phase 3 reviewer workers. By stripping file-write capabilities, your audit sub-agents are strictly locked into\u00a0 <\/span><b>read-only mode<\/b><span style=\"font-weight: 400;\"> . They can analyze syntax, trace dependency graphs, and flag deprecations, but they cannot alter a single line of code without authorization.<\/span><\/p>\n<h5><span style=\"font-weight: 400;\">Real-Time Observability &amp; Steering<\/span><\/h5>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Live Chat Inspection:<\/b><span style=\"font-weight: 400;\">\u00a0 Click into any sub-agent&#8217;s active thread mid-execution to observe its step-by-step reasoning.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Direct Messaging:<\/b><span style=\"font-weight: 400;\">\u00a0 Intervene immediately if a worker drifts off course. You can message sub-agents directly while they run to refine their focus or halt execution entirely.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>System Procedure Repair (<\/b><span style=\"font-weight: 400;\">\u00a0 <\/span><b>\/learn<\/b><span style=\"font-weight: 400;\">\u00a0 <\/span><b>):<\/b><span style=\"font-weight: 400;\">\u00a0 If a worker produces a sub-optimal review or misses a structural rule, invoke the built-in \/learn command. The factory pauses, analyzes the mistake, updates the worker\u2019s underlying procedural Markdown rules, and ensures the error isn&#8217;t repeated in future runs.<\/span><\/li>\n<\/ul>\n<h4><span style=\"font-weight: 400;\">4. Automate Code &#8220;Freshness Audits&#8221; Around Major Tech Events<\/span><\/h4>\n<p><span style=\"font-weight: 400;\">Technical debt rarely arrives with a loud bang; it accumulates silently as external web and mobile ecosystems evolve around your application. To combat silent rot, anti-gravity features an\u00a0 <\/span><b>automation panel<\/b><span style=\"font-weight: 400;\">\u00a0 to trigger recurring, background\u00a0 <\/span><b>freshness audits<\/b><span style=\"font-weight: 400;\"> .<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Audit Metric,Evaluated Criteria,Factory Action<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Git Edit Recency,Scans commit timestamps across modules to flag unmaintained code paths.,Identifies stale modules that haven&#8217;t been audited in 12+ months.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">API Recency Check,Compares current codebase syntax against modern platform SDK baselines.,Highlights deprecated methods eligible for immediate refactoring.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">External Standards,&#8221;Queries external documentation platforms (e.g., MDN compatibility matrices).&#8221;,Flags polyfills whose target APIs are now natively supported across all browsers.<\/span><\/p>\n<h5><span style=\"font-weight: 400;\">Strategic Triggering: The Conference-Driven Audit<\/span><\/h5>\n<p><span style=\"font-weight: 400;\">While scheduled monthly audits are useful, the most effective time to spin up your software factory is immediately following major tech events like\u00a0 <\/span><b>Apple WWDC<\/b><span style=\"font-weight: 400;\">\u00a0 or\u00a0 <\/span><b>Google I\/O<\/b><span style=\"font-weight: 400;\"> .<\/span><\/p>\n<p><span style=\"font-weight: 400;\">When Apple or Google announces sweeping SDK updates, platform deprecations, and modern syntax patterns, your code base is instantly hit with new debt. By combining anti-gravity\u2019s\u00a0 <\/span><b>native web search<\/b><span style=\"font-weight: 400;\">\u00a0 and\u00a0 <\/span><b>multimodal reasoning capabilities<\/b><span style=\"font-weight: 400;\"> , sub-agents can ingest live documentation\u2014such as updated\u00a0 <\/span><b>MDN browser compatibility tables<\/b><span style=\"font-weight: 400;\">\u00a0 or newly published API specs\u2014the moment they go live.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Running automated freshness sweeps directly after major platform keynotes lets your factory identify newly redundant polyfills and flag breaking changes long before tech debt settles into your master branch.<\/span><\/p>\n<h4><span style=\"font-weight: 400;\">5. Balance Hands-On Control with &#8220;Long Horizon&#8221; Hands-Off Modes<\/span><\/h4>\n<p><span style=\"font-weight: 400;\">Not every engineering task fits neatly into a rigid, step-by-step sub-agent pipeline. Sometimes you want granular, deterministic control over code deletion; other times you need an agent to autonomously navigate a complex, ambiguous refactoring task across dozens of files.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Anti-gravity leverages\u00a0 <\/span><b>Gemini for Argonne<\/b><span style=\"font-weight: 400;\">\u00a0 to provide a dynamic spectrum of execution modes built specifically for complex, long-horizon tasks:<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u2502\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 EXECUTION CONTROL SPECTRUM \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u2502<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u2502 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u2502<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u2502\u00a0 Custom Sub-Agents \u00a0 \u2500\u2500\u2500&gt; \u00a0 Teamwork Preview \u00a0 \u2500\u2500\u2500&gt; \u00a0 \/boost\u00a0 \u00a0 \u2502<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u2502\u00a0 (Granular Control) \u00a0 \u00a0 \u00a0 \u00a0 (Mini-Teams) \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 (Linear) \u00a0 \u00a0 \u2502<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518<\/span><\/p>\n<ol>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Custom Sub-Agent Pipelines (Granular Control):<\/b><span style=\"font-weight: 400;\">\u00a0 Fully customizable. You manually define skills, isolated tool permissions (such as read-only mode), and phase structures in Markdown. Ideal for routine, policy-driven code cleanup.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Teamwork Preview (Autonomous Collaboration):<\/b><span style=\"font-weight: 400;\">\u00a0 Gemini for Argonne automatically spins up dynamic mini-teams of sub-agents that collaborate, cross-check work, and divide responsibilities to solve broad, loosely defined architecture goals.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>The<\/b><span style=\"font-weight: 400;\">\u00a0 <\/span><b>\/boost<\/b><span style=\"font-weight: 400;\">\u00a0 <\/span><b>Command (Linear Autonomous Execution):<\/b><span style=\"font-weight: 400;\">\u00a0 An opinionated, high-velocity execution mode. When triggered, Gemini for Argonne spins up ad-hoc sub-agents on the fly to solve multi-file tasks in a streamlined, linear sequence\u2014eliminating setup overhead entirely.<\/span><\/li>\n<\/ol>\n<p><span style=\"font-weight: 400;\">This flexibility ensures you retain strict procedural control when auditing compliance policies, while unlocking long-horizon autonomy when executing complex codebase overhauls.<\/span><\/p>\n<h4><span style=\"font-weight: 400;\">Redefine Your AI Workflow Today<\/span><\/h4>\n<p><span style=\"font-weight: 400;\">The measure of a modern engineering team isn&#8217;t how many thousands of lines of AI code they push to production each week. It&#8217;s how cleanly and efficiently they maintain their system&#8217;s core core architecture over time.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">By shifting your mindset from code generation to automated debt reduction\u2014using anti-gravity and Gemini for Argonne to orchestrate parallel sub-agents, enforce read-only guardrails, and trigger event-driven freshness audits\u2014you can stop drowning in AI slop and build a software factory that keeps your code lean, fast, and modern.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Take a look at your main repository today:\u00a0 <\/span><b>Which legacy APIs and outdated polyfills are still running in your system simply because no one has taken the time to delete them?<\/b><\/p>\n<p><span style=\"font-weight: 400;\">Open anti-gravity, configure your sub-agents, and let your software factory start cleaning up today.<\/span><\/p>\n<p>&nbsp;<\/p>\n<pre><code><\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>The Autonomous Software Factory: Eliminating Enterprise Technical Debt with Google Antigravity and Gemini Sun, Nov 22 2026 \/Mpelembe Media\/ \u2014 Software engineering is undergoing<a class=\"moretag\" href=\"https:\/\/mpelembe.net\/index.php\/cleaning-code-bloat-with-anti-gravity\/\">Read More&#8230;<\/a><\/p>\n","protected":false},"author":1,"featured_media":14821,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"googlesitekit_rrm_CAowu7GVCw:productID":"","activitypub_content_warning":"","activitypub_content_visibility":"","activitypub_max_image_attachments":3,"activitypub_interaction_policy_quote":"anyone","activitypub_status":"federated","footnotes":""},"categories":[5823],"tags":[505,224,22500,1035,22497,19366,15568,7310,6123,5223,22498,510,451,1166,15252],"class_list":["post-14819","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-developers","tag-android","tag-computing","tag-cpr","tag-cross-platform-software","tag-diff","tag-git","tag-github","tag-ios","tag-javascript","tag-programming-languages","tag-project-management-software","tag-smartphones","tag-software","tag-south-of-market-san-francisco","tag-swift"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.7 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Cleaning Code Bloat With Anti Gravity - Mpelembe Network<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/mpelembe.net\/index.php\/cleaning-code-bloat-with-anti-gravity\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Cleaning Code Bloat With Anti Gravity - Mpelembe Network\" \/>\n<meta property=\"og:description\" content=\"The Autonomous Software Factory: Eliminating Enterprise Technical Debt with Google Antigravity and Gemini Sun, Nov 22 2026 \/Mpelembe Media\/ \u2014 Software engineering is undergoingRead More...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/mpelembe.net\/index.php\/cleaning-code-bloat-with-anti-gravity\/\" \/>\n<meta property=\"og:site_name\" content=\"Mpelembe Network\" \/>\n<meta property=\"article:published_time\" content=\"2026-11-22T13:17:06+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/mpelembe.net\/wp-content\/uploads\/2026\/11\/The-Autonomous-Software-Factory.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1021\" \/>\n\t<meta property=\"og:image:height\" content=\"683\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"43 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/mpelembe.net\\\/index.php\\\/cleaning-code-bloat-with-anti-gravity\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/mpelembe.net\\\/index.php\\\/cleaning-code-bloat-with-anti-gravity\\\/\"},\"author\":{\"name\":\"admin\",\"@id\":\"https:\\\/\\\/mpelembe.net\\\/#\\\/schema\\\/person\\\/2421ebbf3150931b1066b10a196d7608\"},\"headline\":\"Cleaning Code Bloat With Anti Gravity\",\"datePublished\":\"2026-11-22T13:17:06+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/mpelembe.net\\\/index.php\\\/cleaning-code-bloat-with-anti-gravity\\\/\"},\"wordCount\":3352,\"image\":{\"@id\":\"https:\\\/\\\/mpelembe.net\\\/index.php\\\/cleaning-code-bloat-with-anti-gravity\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/mpelembe.net\\\/wp-content\\\/uploads\\\/2026\\\/11\\\/The-Autonomous-Software-Factory.png\",\"keywords\":[\"Android\",\"Computing\",\"cpr\",\"Cross-platform software\",\"Diff\",\"Git\",\"GitHub\",\"IOS\",\"JavaScript\",\"Programming languages\",\"Project management software\",\"Smartphones\",\"Software\",\"South of Market, San Francisco\",\"SWIFT\"],\"articleSection\":[\"Developers\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/mpelembe.net\\\/index.php\\\/cleaning-code-bloat-with-anti-gravity\\\/\",\"url\":\"https:\\\/\\\/mpelembe.net\\\/index.php\\\/cleaning-code-bloat-with-anti-gravity\\\/\",\"name\":\"Cleaning Code Bloat With Anti Gravity - Mpelembe Network\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/mpelembe.net\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/mpelembe.net\\\/index.php\\\/cleaning-code-bloat-with-anti-gravity\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/mpelembe.net\\\/index.php\\\/cleaning-code-bloat-with-anti-gravity\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/mpelembe.net\\\/wp-content\\\/uploads\\\/2026\\\/11\\\/The-Autonomous-Software-Factory.png\",\"datePublished\":\"2026-11-22T13:17:06+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/mpelembe.net\\\/#\\\/schema\\\/person\\\/2421ebbf3150931b1066b10a196d7608\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/mpelembe.net\\\/index.php\\\/cleaning-code-bloat-with-anti-gravity\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/mpelembe.net\\\/index.php\\\/cleaning-code-bloat-with-anti-gravity\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/mpelembe.net\\\/index.php\\\/cleaning-code-bloat-with-anti-gravity\\\/#primaryimage\",\"url\":\"https:\\\/\\\/mpelembe.net\\\/wp-content\\\/uploads\\\/2026\\\/11\\\/The-Autonomous-Software-Factory.png\",\"contentUrl\":\"https:\\\/\\\/mpelembe.net\\\/wp-content\\\/uploads\\\/2026\\\/11\\\/The-Autonomous-Software-Factory.png\",\"width\":1021,\"height\":683},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/mpelembe.net\\\/index.php\\\/cleaning-code-bloat-with-anti-gravity\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/mpelembe.net\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Cleaning Code Bloat With Anti Gravity\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/mpelembe.net\\\/#website\",\"url\":\"https:\\\/\\\/mpelembe.net\\\/\",\"name\":\"Mpelembe Network\",\"description\":\"Agentic Integrated Intelligence Collaboration Platform\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/mpelembe.net\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/mpelembe.net\\\/#\\\/schema\\\/person\\\/2421ebbf3150931b1066b10a196d7608\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/c66a2765397adfb52418f6f2310640167a0af23ce662da1b68c8a0b8650de556?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/c66a2765397adfb52418f6f2310640167a0af23ce662da1b68c8a0b8650de556?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/c66a2765397adfb52418f6f2310640167a0af23ce662da1b68c8a0b8650de556?s=96&d=mm&r=g\",\"caption\":\"admin\"},\"sameAs\":[\"https:\\\/\\\/mpelembe.net\"],\"url\":\"https:\\\/\\\/mpelembe.net\\\/index.php\\\/author\\\/admin\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Cleaning Code Bloat With Anti Gravity - Mpelembe Network","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/mpelembe.net\/index.php\/cleaning-code-bloat-with-anti-gravity\/","og_locale":"en_US","og_type":"article","og_title":"Cleaning Code Bloat With Anti Gravity - Mpelembe Network","og_description":"The Autonomous Software Factory: Eliminating Enterprise Technical Debt with Google Antigravity and Gemini Sun, Nov 22 2026 \/Mpelembe Media\/ \u2014 Software engineering is undergoingRead More...","og_url":"https:\/\/mpelembe.net\/index.php\/cleaning-code-bloat-with-anti-gravity\/","og_site_name":"Mpelembe Network","article_published_time":"2026-11-22T13:17:06+00:00","og_image":[{"width":1021,"height":683,"url":"https:\/\/mpelembe.net\/wp-content\/uploads\/2026\/11\/The-Autonomous-Software-Factory.png","type":"image\/png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"Written by":"admin","Est. reading time":"43 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/mpelembe.net\/index.php\/cleaning-code-bloat-with-anti-gravity\/#article","isPartOf":{"@id":"https:\/\/mpelembe.net\/index.php\/cleaning-code-bloat-with-anti-gravity\/"},"author":{"name":"admin","@id":"https:\/\/mpelembe.net\/#\/schema\/person\/2421ebbf3150931b1066b10a196d7608"},"headline":"Cleaning Code Bloat With Anti Gravity","datePublished":"2026-11-22T13:17:06+00:00","mainEntityOfPage":{"@id":"https:\/\/mpelembe.net\/index.php\/cleaning-code-bloat-with-anti-gravity\/"},"wordCount":3352,"image":{"@id":"https:\/\/mpelembe.net\/index.php\/cleaning-code-bloat-with-anti-gravity\/#primaryimage"},"thumbnailUrl":"https:\/\/mpelembe.net\/wp-content\/uploads\/2026\/11\/The-Autonomous-Software-Factory.png","keywords":["Android","Computing","cpr","Cross-platform software","Diff","Git","GitHub","IOS","JavaScript","Programming languages","Project management software","Smartphones","Software","South of Market, San Francisco","SWIFT"],"articleSection":["Developers"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/mpelembe.net\/index.php\/cleaning-code-bloat-with-anti-gravity\/","url":"https:\/\/mpelembe.net\/index.php\/cleaning-code-bloat-with-anti-gravity\/","name":"Cleaning Code Bloat With Anti Gravity - Mpelembe Network","isPartOf":{"@id":"https:\/\/mpelembe.net\/#website"},"primaryImageOfPage":{"@id":"https:\/\/mpelembe.net\/index.php\/cleaning-code-bloat-with-anti-gravity\/#primaryimage"},"image":{"@id":"https:\/\/mpelembe.net\/index.php\/cleaning-code-bloat-with-anti-gravity\/#primaryimage"},"thumbnailUrl":"https:\/\/mpelembe.net\/wp-content\/uploads\/2026\/11\/The-Autonomous-Software-Factory.png","datePublished":"2026-11-22T13:17:06+00:00","author":{"@id":"https:\/\/mpelembe.net\/#\/schema\/person\/2421ebbf3150931b1066b10a196d7608"},"breadcrumb":{"@id":"https:\/\/mpelembe.net\/index.php\/cleaning-code-bloat-with-anti-gravity\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/mpelembe.net\/index.php\/cleaning-code-bloat-with-anti-gravity\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/mpelembe.net\/index.php\/cleaning-code-bloat-with-anti-gravity\/#primaryimage","url":"https:\/\/mpelembe.net\/wp-content\/uploads\/2026\/11\/The-Autonomous-Software-Factory.png","contentUrl":"https:\/\/mpelembe.net\/wp-content\/uploads\/2026\/11\/The-Autonomous-Software-Factory.png","width":1021,"height":683},{"@type":"BreadcrumbList","@id":"https:\/\/mpelembe.net\/index.php\/cleaning-code-bloat-with-anti-gravity\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/mpelembe.net\/"},{"@type":"ListItem","position":2,"name":"Cleaning Code Bloat With Anti Gravity"}]},{"@type":"WebSite","@id":"https:\/\/mpelembe.net\/#website","url":"https:\/\/mpelembe.net\/","name":"Mpelembe Network","description":"Agentic Integrated Intelligence Collaboration Platform","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/mpelembe.net\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/mpelembe.net\/#\/schema\/person\/2421ebbf3150931b1066b10a196d7608","name":"admin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/c66a2765397adfb52418f6f2310640167a0af23ce662da1b68c8a0b8650de556?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/c66a2765397adfb52418f6f2310640167a0af23ce662da1b68c8a0b8650de556?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/c66a2765397adfb52418f6f2310640167a0af23ce662da1b68c8a0b8650de556?s=96&d=mm&r=g","caption":"admin"},"sameAs":["https:\/\/mpelembe.net"],"url":"https:\/\/mpelembe.net\/index.php\/author\/admin\/"}]}},"_links":{"self":[{"href":"https:\/\/mpelembe.net\/index.php\/wp-json\/wp\/v2\/posts\/14819","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mpelembe.net\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mpelembe.net\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mpelembe.net\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mpelembe.net\/index.php\/wp-json\/wp\/v2\/comments?post=14819"}],"version-history":[{"count":1,"href":"https:\/\/mpelembe.net\/index.php\/wp-json\/wp\/v2\/posts\/14819\/revisions"}],"predecessor-version":[{"id":14822,"href":"https:\/\/mpelembe.net\/index.php\/wp-json\/wp\/v2\/posts\/14819\/revisions\/14822"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/mpelembe.net\/index.php\/wp-json\/wp\/v2\/media\/14821"}],"wp:attachment":[{"href":"https:\/\/mpelembe.net\/index.php\/wp-json\/wp\/v2\/media?parent=14819"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mpelembe.net\/index.php\/wp-json\/wp\/v2\/categories?post=14819"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mpelembe.net\/index.php\/wp-json\/wp\/v2\/tags?post=14819"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}