AGENT SKILL

autonomous-coding-loop

MANDATORY CORE SKILL: Enforces the Autonomous Coding & Self-Correction Loop for Antigravity in every session. Activate this skill whenever writing, modifying, refactoring, or debugging code, implementing features, or fixing bugs across any programming language. It mandates rigorous specification analysis, test-first synthesis, sandboxed execution, failure taxonomy classification, and iterative zero-regression self-correction.

License 许可
MIT
最近更新
2026-08-31
Stars
★ 1
Forks
0

01 前言 Front Matter

name
autonomous-coding-loop
description
MANDATORY CORE SKILL: Enforces the Autonomous Coding & Self-Correction Loop for Antigravity in every session. Activate this skill whenever writing, modifying, refactoring, or debugging code, implementing features, or fixing bugs across any programming language. It mandates rigorous specification analysis, test-first synthesis, sandboxed execution, failure taxonomy classification, and iterative zero-regression self-correction.

02 资源文件 2

03 SKILL.md 正文

Autonomous Coding & Self-Correction Loop (Antigravity Core Workflow)

This skill mandates and guides the Autonomous Coding & Self-Correction Loop for Antigravity in all coding and debugging sessions.


1. Golden Invariant: Never Deliver Unverified Code

Antigravity must NEVER guess, assume, or deliver code without proving correctness through the 6-phase closed-loop cycle:

flowchart LR
    A[Phase 1: Spec & Invariants] --> B[Phase 2: Test Synthesis]
    B --> C[Phase 3: Code Actuation]
    C --> D[Phase 4: Multi-Tier Verification]
    D --> E{All Tests Pass?}
    E -- Yes --> F[Phase 6: Convergence & Proof]
    E -- No --> G[Phase 5: Diagnostic & Repair]
    G --> C

2. Mandatory 6-Phase Execution Protocol

Whenever user tasks involve writing, editing, or fixing code, you MUST execute the following phases:

Phase 1: Problem Decomposition & Invariant Grounding

  1. Identify functional requirements, non-functional performance targets, and boundary constraints.
  2. Establish explicit Invariant Rules $\mathcal{I}$ that must remain invariant throughout execution.
  3. If the task is non-trivial, activate Planning Mode and construct implementation_plan.md.

Phase 2: Multi-Tier Verification & Test Bench Synthesis (Test-First / CEGIS)

Synthesize verification probes before or in conjunction with code changes:

  • Level 1: Static AST & Typing: Type hints, linters, import validation.
  • Level 2: Core Invariant Tests: Functional happy paths and mathematical correctness.
  • Level 3: Boundary & Edge Tests: $0, -1, \text{None}$, empty collections, max buffer sizes.
  • Level 4: Concurrency & Safety Probes: Thread synchronization, race conditions, memory leaks.
  • Level 5: Rollback & Transactional Invariants: Fault-injection and atomic state resets.

Phase 3: High-Precision Code Actuation

  • Use targeted modification tools: replace_file_content or multi_replace_file_content for surgical edits.
  • Maintain comment integrity and adhere to existing codebase architectural idioms.
  • Avoid massive full-file rewrites unless creating brand new modules.

Phase 4: Sandboxed Execution & Telemetry Capture

  • Run unit test suites, linters, and verification scripts via run_command.
  • Intercept and isolate standard outputs, errors, exit codes, and structured tracebacks.

Phase 5: Seven-Tier Failure Classification & Anti-Regression Repair

If any verification probe fails, classify the failure using the Failure Taxonomy Matrix:

Category Diagnostic Signal Actionable Repair Strategy
SYNTAX_ERROR SyntaxError, indentation, token mismatch Re-parse AST, fix syntax, balance delimiters
TYPE_ERROR TypeError, AttributeError, NameError Inspect interfaces, add type narrowing & guards
RUNTIME_ASSERTION AssertionError, state mismatch Trace state transitions, audit return transformations
EDGE_CASE_BREACH Boundary condition failures Add defensive clauses for zero/null/empty/negative inputs
TIMEOUT_INFINITE_LOOP Process hang, deadlock Add loop invariants, recursion limits, non-blocking locks
SEMANTIC_LOGIC_ERROR Incorrect output despite valid syntax Step through algorithm invariants and formula logic
ENVIRONMENT_OR_IO Missing packages, permissions Check environment, install dependencies, resolve paths

Anti-Regression Invariant:

  • Maintain a checkpoint of the best passing state.
  • After applying each patch, run the entire test suite.
  • If a patch introduces a regression (fails a previously passing test), immediately revert the patch and formulate an alternative hypothesis.

Phase 6: Formal Convergence & Walkthrough Synthesis

  • Convergence is achieved when 100% of test cases pass with 0 regressions.
  • Document changes, validation results, and telemetry in walkthrough.md.

3. Quick Reference Scripts & Tools

  • Run loop verification harness:
    python .agents/skills/autonomous-coding-loop/scripts/verify_loop.py
    
  • Detailed mathematical specification: references/loop_specification.md

04 同仓库更多 Skills

nguyenhungtran18
nguyenhungtran18/skill-and-tool-tracker

xcode-project-setup

Safely modifies Xcode projects (.pbxproj) to add Swift Packages and link files. Use this skill whenever an iOS project needs dependencies installed (e.g. Firebase, Alamofire).

★ 1
nguyenhungtran18
nguyenhungtran18/skill-and-tool-tracker

writing-skills

Use when creating new skills, editing existing skills, or verifying skills work before deployment

★ 1
nguyenhungtran18
nguyenhungtran18/skill-and-tool-tracker

writing-plans

Use when you have a spec or requirements for a multi-step task, before touching code

★ 1
nguyenhungtran18
nguyenhungtran18/skill-and-tool-tracker

workflow-skill-creator

Distills a completed user workflow or interaction into a reusable agent skill. Use when the user asks to turn their workflow, interaction, or multi-step process into a skill, or when they say "make this a skill", "create a skill from what we just did", "package this workflow" or similar. Do not use for creating skills from scratch without an existing workflow (use a generic skill-creator for that).

★ 1
nguyenhungtran18
nguyenhungtran18/skill-and-tool-tracker

verify-and-stop

Prove existing work meets acceptance conditions without expanding scope. Use for validation-only tasks, completion checks, focused gate runs, and last-mile proof.

★ 1
nguyenhungtran18
nguyenhungtran18/skill-and-tool-tracker

verification-before-completion

Use when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions always

★ 1