一键导入
autodev
Autonomous feature development loop for low-risk, self-contained features using git worktrees/sandboxes and the autoresearch-style experiment pattern.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Autonomous feature development loop for low-risk, self-contained features using git worktrees/sandboxes and the autoresearch-style experiment pattern.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | autodev |
| description | Autonomous feature development loop for low-risk, self-contained features using git worktrees/sandboxes and the autoresearch-style experiment pattern. |
[FIRST-RUN / STARTUP BLOCK — AGENT INSTRUCTIONS]
🛑 AGENT SELF-CUSTOMIZATION PROTOCOL
If you are the AI agent reading this block, it means this
/autodevprotocol has not been customized for this repository yet. You MUST stop and execute this self-customization sequence before performing any actual feature development.Follow these steps immediately:
Step 1: Prompt the User
Ask the user to clarify their stack, risk tolerance, and preferences. You may copy and paste the following template to prompt them:
🚀 Autodev Initialization Initiated! Let's customize this protocol for your codebase. Please answer the following:
- What is your Tech Stack? (e.g., React + TypeScript + Vite + Node.js, Rust + Actix, Python + FastAPI, etc.)
- What are your exact local verification commands?
- Compilation/Typecheck: (e.g.,
npx tsc --noEmitorcargo check)- Linting/Static Analysis: (e.g.,
npm run lintoreslint .)- Production Build: (e.g.,
npm run buildorvite build)- Test Suite: (e.g.,
npm run testorcargo test)- What is your Risk Tolerance level?
High: YOLO mode is default; writing/updating existing files is relaxed; database writes are okay; less strict file protection rules.Medium(Recommended): Balanced; isolation preferred for non-trivial edits; database writes scoped only to feature namespaces.Strict: Worktrees mandatory; strict "New Files Only" limit; zero production DB changes; zero changes to shared configs/routing manifests.- What are your Protected Files? (Files the AI must never edit autonomously, such as
.env,package-lock.json, database configurations, auth middleware, etc.)- What is your environment config? (e.g., Local dev server port, Staging URL)
Step 2: Adapt and Re-write This Protocol
Once the user provides answers, edit the sections of this file to fit their parameters:
- Update The Eval Harness block with their exact terminal commands.
- Adjust the Low-Risk Feature Criteria and boundaries according to their selected
Risk Tolerancelevel.- Update Protected Files lists in Phase 1, Phase 2, Phase 3, and Phase 4.
- Fill out the Environment Awareness Template with their active URLs.
Step 3: Self-Destruct This Block
After editing the sections, delete this entire
[FIRST-RUN / STARTUP BLOCK — AGENT INSTRUCTIONS]block.Step 4: Commit the Final Custom Protocol
Perform a git commit (
git commit -am "chore(autodev): initialize custom autodev protocol for project") so the finalized, customized workflow is permanently saved for future sessions.
Purpose: Ship low-risk, self-contained features autonomously using an automated build-evaluate-iterate loop. The agent builds → evaluates → iterates → never stops until the feature is complete, verifying correctness at every step.
At the start of the /autodev workflow, the developer chooses between two execution modes based on convenience and isolation preferences:
graph TD
Start["Developer: 'Run /autodev'"] --> CheckElig{"Is the feature eligible?"}
CheckElig -- No --> Esc["Escalate to standard interactive development"]
CheckElig -- Yes --> ChooseMode{"Select Runtime Mode"}
ChooseMode -- "Standard Mode (Two-Session Worktree)" --> Standard["1. Planning in Session A<br/>2. Create isolated git worktree<br/>3. Execute autonomously in Session B (new window)"]
ChooseMode -- "Yolo Mode (Single-Session Inline)" --> Yolo["1. Planning in current session<br/>2. Checkout local feature branch<br/>3. Execute loop immediately in current session"]
| Metric | 📁 Standard Mode (Two-Session Sandbox) | ⚡ Yolo Mode (Single-Session Inline) |
|---|---|---|
| Sandbox Style | Isolated git worktree (separate directory) | Local checkout on new branch (current directory) |
| Context Scope | 2 windows (Window A: Plan, Window B: Execute) | 1 window (Same session plans and immediately executes) |
| Best Used For | Large, complex features, multi-hour runs, overnight builds, or when you want to keep working on other things in your main window. | Tiny additions, small UI iterations, self-contained scripts, or when you want to monitor the loop progress in real-time. |
| Human Supervision | Zero supervision. Human closes window and awaits PR. | Minimal/Passive. Human watches loop outputs and can pause/interject if needed. |
This architecture spans two separate AI conversation windows (or session contexts) with isolated scopes to prevent instructions from colliding.
┌────────────────────────────────────────┐
│ SESSION A — Main Repo (Planning) │
│ │
│ Planning Mode ON │
│ Artifacts: implementation_plan.md │ ← Developer reviews & approves this
│ │
│ On approval: │
│ 1. Writes custom spec file: │
│ [feature-name]-autodev-spec.md │ ← Custom-named cross-session handoff
│ 2. Creates sandbox branch/worktree │
│ 3. Tells developer to open Session B │
└────────────────────────────────────────┘
│
│ Developer opens Session B in Sandbox
▼
┌────────────────────────────────────────┐
│ SESSION B — Sandbox (Execution Loop) │
│ │
│ Planning Mode OFF (execution only) │
│ Reads spec from customized file: │ ← [feature-name]-autodev-spec.md
│ Artifacts: task.md (loop tracker) │
│ walkthrough.md (final) │
│ │
│ LOOP FOREVER until Done Definition │
│ Pushes branch, creates PR │
└────────────────────────────────────────┘
The bridge between sessions is a custom, feature-scoped specification file committed to the feature branch at <feature-name>-autodev-spec.md in the project root. Session A writes it; Session B reads it. Dynamic naming prevents conflicts during parallel builds.
This architecture runs entirely in your current active conversation and workspace window. No worktrees are created, and no second window is required.
┌────────────────────────────────────────┐
│ ACTIVE SESSION — Current Workspace │
│ │
│ 1. Planning Phase (Planning Mode ON) │ ← Developer approves implementation_plan.md
│ 2. Branch Phase: │
│ Creates new branch locally │ ← e.g. feature/yolo-<feature-name>
│ 3. Execution Phase (Planning Mode OFF)│ ← Agent transitions inline to execute
│ 4. Loop Iterations: │
│ Modifies code → Runs Eval Harness │ ← Streamed directly to current chat
│ 5. Push & Pull Request: │
│ Pushes branch, opens PR, Handoff │ ← Walkthrough written directly
└────────────────────────────────────────┘
Before accepting a /autodev task, the agent MUST verify that the request represents a low-risk, verifiable feature.
A feature is eligible for /autodev if it satisfies ALL of the following criteria:
| Criterion | Check | Description |
|---|---|---|
| Isolated Impact | [ ] | The changes are isolated to new files, or are trivially additive to 1-2 existing integration points (like routers or navigation files). |
| No Security-Critical Areas | [ ] | No modifications to authorization, authentication, identity management, encryption, or payment/billing flows. |
| No Core Config/Rules Changes | [ ] | No changes to global security rules (e.g., Firestore rules, AWS IAM, database access lists) or core infrastructure code. |
| Read-Only / Isolated Data Access | [ ] | The feature uses read-only access to existing data models, or its writes are strictly isolated to the new feature's own scoped tables/documents. |
| No Shared UI Component Changes | [ ] | No modifications to shared UI components or utility functions used by other active features in the codebase. |
| Verifiable Done Definition | [ ] | The feature has a concrete, testable definition of done (e.g., "Page renders at route /new-feature, displaying data model X and handling click event Y"). |
If ANY criterion is not met → Do NOT proceed with /autodev. Escalate to the developer for standard, interactive development.
The ultimate boundary for AutoDev eligibility is whether the local evaluation harness is a sufficient oracle for correctness.
tsc --noEmit, cargo check, go build, etc.)The developer describes the goal. The planning agent drives the research and design—do NOT pre-write the spec file yourself.
To kick off the workflow, simply tell the agent:
"I want to build [feature description]. Run /autodev [standard | yolo]."
The agent handles the rest in three phases: Plan → Execute → Review.
This phase uses the agent's Planning Mode. The agent researches the codebase, produces an implementation plan, and waits for explicit developer approval.
Follow a structured context-loading routine to ensure alignment with existing project patterns:
Verify all items in the Low-Risk Feature Criteria. If any check fails, immediately pause, explain the risk to the developer, and switch to a standard interactive protocol.
Critique the design before writing code:
implementation_plan.mdCreate a native implementation plan document containing:
Set RequestFeedback: true on this plan. Do not proceed to execution until the developer explicitly approves this plan.
Once the developer approves the plan, branch based on the selected mode:
<feature-name>-autodev-spec.md: Create a custom, feature-scoped spec file in the project root. Convert the feature name into a lowercase, hyphen-separated slug (e.g., user-profile-autodev-spec.md).
⚠️ CRITICAL RULE: Do not name the file
autodev-spec.md. It MUST be prefixed with the feature/mission slug to prevent filename collisions during parallel development or leftover spec file clutter.
git checkout main
git pull
# Create a separate worktree directory to isolate files completely
git worktree add -b feature/autodev-<feature-name> ../worktrees/<feature-name> main
<feature-name>-autodev-spec.md directly into the worktree branch."✅ Plan approved! Feature branch
feature/autodev-<feature-name>is created and bootstrapped with the custom spec file<feature-name>-autodev-spec.md.Please open this branch/worktree in a new agent window and run
/autodevto start the autonomous build loop."
git checkout main
git pull
# Create branch directly in current directory
git checkout -b feature/yolo-<feature-name>
"⚡ Yolo Mode activated. I have checked out the branch
feature/yolo-<feature-name>locally. I am transitioning directly into the Autonomous Build Loop in this window. You will see progress updates streamed live in this chat!"
Planning Mode is turned OFF. The agent is strictly focused on writing, testing, and refining.
Verify the environment:
feature/autodev-* or feature/yolo-*).<feature-name>-autodev-spec.md (prefix matches the current branch name feature slug). This is your absolute source of truth.task.md artifact to track your progress and log iterations.Define the exact set of commands that must pass with exit code 0 before any git commit is kept.
(Customize these commands for your stack!)
# Gate 1: Type Checking / Compilation (Must pass with 0 errors)
# [Example: npx tsc --noEmit, cargo check, go build]
# Gate 2: Static Analysis / Linting (Must pass with 0 violations)
# [Example: npm run lint, pylint, flake8]
# Gate 3: Production Bundling / Build (Must bundle successfully)
# [Example: npm run build, go build]
# Gate 4: Test Suite (All local unit tests must pass)
# [Example: npm run test, cargo test, pytest]
Follow this strict loop until all requirements are met:
ITERATION N:
1. Inspect Git status and current code state: git status
2. Plan the next small, incremental change (focused on 1 done requirement at a time).
* Before writing UI: Check design tokens, stylesheets, and existing component layouts.
* Before writing Data Code: Double-check schemas and type signatures.
3. Write/Modify Code: Only create files listed in the "New Files" list of the spec/plan,
or modify the 1-2 allowed integration points.
4. Run the Eval Harness:
* Execute compilation, linting, tests, and builds.
* If all gates pass (Exit Code 0) → Proceed to Step 5.
* If any gate fails → Fix the code and re-run.
5. Commit on Pass:
* Run a git commit with a clear, atomic message (e.g., "feat(profile): implement loading state").
6. Revert on Repeated Failure:
* If a change cannot pass the eval harness after 2 attempts, discard the changes (`git checkout -- <file>`),
log the failed experiment in the Iteration Log, and try a different implementation approach.
* If blocked after 3 different approaches, trigger your debugging protocol to locate root causes.
7. Update `task.md` (Mark items as completed [x] or in-progress [/], and log the iteration).
8. Evaluate Done Definition: If all items in the plan are checked → GOTO Phase 3.
9. If not fully done → Loop again (GOTO ITERATION N+1).
package.json, Cargo.toml, go.mod) without explicit permission.task.md ArtifactCreate this artifact at the start of Phase 2 to give the developer a real-time window into your progress:
# AutoDev Progress: <Feature Name> (Mode: Standard/Yolo)
Branch: `feature/autodev-<feature-name>`
## Done Definition & Checklist
- `[x]` Orientation complete — Plan read, environment verified
- `[x]` Baseline commit — Empty component structure created
- `[/]` Requirement 1 — [Description of current task]
- `[ ]` Requirement 2
- `[ ]` All Eval Harness gates passing
- `[ ]` PR created
## Iteration Log
| Iteration | Intended Change | Eval Harness Result | Action / Decision |
|---|---|---|---|
| 1 | Create base layout file | ✅ Pass | Committed structure |
| 2 | Connect data retrieval hook | ✅ Pass | Committed hook integration |
| 3 | Custom animation setup | ❌ Compilation Fail | Reverted change; will simplify |
| 4 | Add standard transition animation | ✅ Pass | Committed animation |
## Autonomous Decisions Made
- Reused `X` layout template to match current project spacing.
- Handled empty states by returning a graceful fallback component.
When every checklist item in the Done Definition is marked complete, prepare for handoff:
Run a final sanity check on all staged diffs before pushing:
git diff main...HEAD -- [protected paths] to guarantee that zero lines of protected files were modified.git commit -m "style(autodev): clean up margins and styling").main or develop) using your CLI tools or platform APIs.
[AutoDev] <Feature Name> (Yolo/Standard)task.md (Checklist, Iteration Log, and Autonomous Decisions Made) so the developer has a rich, transparent review trail.If your repository is configured with remote GitHub Actions or similar CI/CD pipelines, execute the following validation block:
gh pr checks or via Git MCP commands).Success) → Proceed directly to Step 3.Failure):
git commit -m "fix(ci): patch remote check failure - [details]"task.md and escalate to the developer.walkthrough.md ArtifactCreate a native walkthrough.md artifact in this window to serve as the final handoff:
/new-route").Print a concise completion message to the chat:
"✅ AutoDev Loop Completed!
- Feature:
- Branch:
feature/yolo-<feature-name>orfeature/autodev-<feature-name>- PR: [Link to Pull Request]
- Status: All Eval Harness Gates and Remote CI Checks passed successfully in N iterations.
Please review the comprehensive
walkthrough.mdartifact created in this window for complete details and local testing instructions."
When the developer returns, they complete the merge:
walkthrough.md artifact for all autonomous choices made by the execution agent.<feature-name>-autodev-spec.md spec file from the main branch as a post-merge cleanup commit.Use this template to map out project environments for your AI agent's orientation:
| Environment | Host/Base URL | Purpose | Access Level |
|---|---|---|---|
| Local (Sandbox) | e.g., http://localhost:3000 | Building, compiling, running lint, and test suites | Fully read-write |
| Staging/QA | e.g., https://staging.example.com | Automated CI/CD deployments for remote integration tests | Triggered via PR merge |
| Production | e.g., https://example.com | Live site for production traffic | Restricted; release branch merges only |