8.0 KiB
Greenfield Workflow
Workflow for new projects built from scratch. Flows linearly: Problem → Research → Plan → Decompose → Implement → Run Tests → Security Audit (optional) → Deploy.
Step Reference Table
| Step | Name | Sub-Skill | Internal SubSteps |
|---|---|---|---|
| 0 | Problem | problem/SKILL.md | Phase 1–4 |
| 1 | Research | research/SKILL.md | Mode A: Phase 1–4 · Mode B: Step 0–8 |
| 2 | Plan | plan/SKILL.md | Step 1–6 + Final |
| 3 | Decompose | decompose/SKILL.md | Step 1–4 |
| 4 | Implement | implement/SKILL.md | (batch-driven, no fixed sub-steps) |
| 5 | Run Tests | (autopilot-managed) | Unit tests → Integration/blackbox tests |
| 5b | Security Audit | security/SKILL.md | Phase 1–5 (optional) |
| 6 | Deploy | deploy/SKILL.md | Step 1–7 |
Detection Rules
Check rules in order — first match wins.
Step 0 — Problem Gathering
Condition: _docs/00_problem/ does not exist, OR any of these are missing/empty:
problem.mdrestrictions.mdacceptance_criteria.mdinput_data/(must contain at least one file)
Action: Read and execute .cursor/skills/problem/SKILL.md
Step 1 — Research (Initial)
Condition: _docs/00_problem/ is complete AND _docs/01_solution/ has no solution_draft*.md files
Action: Read and execute .cursor/skills/research/SKILL.md (will auto-detect Mode A)
Step 1b — Research Decision
Condition: _docs/01_solution/ contains solution_draft*.md files AND _docs/01_solution/solution.md does not exist AND _docs/02_document/architecture.md does not exist
Action: Present the current research state to the user:
- How many solution drafts exist
- Whether tech_stack.md and security_analysis.md exist
- One-line summary from the latest draft
Then present using the Choose format:
══════════════════════════════════════
DECISION REQUIRED: Research complete — next action?
══════════════════════════════════════
A) Run another research round (Mode B assessment)
B) Proceed to planning with current draft
══════════════════════════════════════
Recommendation: [A or B] — [reason based on draft quality]
══════════════════════════════════════
- If user picks A → Read and execute
.cursor/skills/research/SKILL.md(will auto-detect Mode B) - If user picks B → auto-chain to Step 2 (Plan)
Step 2 — Plan
Condition: _docs/01_solution/ has solution_draft*.md files AND _docs/02_document/architecture.md does not exist
Action:
- The plan skill's Prereq 2 will rename the latest draft to
solution.md— this is handled by the plan skill itself - Read and execute
.cursor/skills/plan/SKILL.md
If _docs/02_document/ exists but is incomplete (has some artifacts but no FINAL_report.md), the plan skill's built-in resumability handles it.
Step 3 — Decompose
Condition: _docs/02_document/ contains architecture.md AND _docs/02_document/components/ has at least one component AND _docs/02_tasks/ does not exist or has no task files (excluding _dependencies_table.md)
Action: Read and execute .cursor/skills/decompose/SKILL.md
If _docs/02_tasks/ has some task files already, the decompose skill's resumability handles it.
Step 4 — Implement
Condition: _docs/02_tasks/ contains task files AND _dependencies_table.md exists AND _docs/03_implementation/FINAL_implementation_report.md does not exist
Action: Read and execute .cursor/skills/implement/SKILL.md
If _docs/03_implementation/ has batch reports, the implement skill detects completed tasks and continues.
Step 5 — Run Tests
Condition: _docs/03_implementation/FINAL_implementation_report.md exists AND the autopilot state does NOT show Step 5 (Run Tests) as completed AND (_docs/04_deploy/ does not exist or is incomplete)
Action: Run the full test suite to verify the implementation before deployment.
- Unit tests: detect the project's test runner (e.g.,
pytest,dotnet test,cargo test,npm test) and run all unit tests - Integration / blackbox tests: if
docker-compose.test.ymlor an equivalent test environment exists, spin it up and run the integration test suite - Report results: present a summary of passed/failed/skipped tests
If all tests pass → auto-chain to Step 5b (Security Audit).
If tests fail → present using Choose format:
══════════════════════════════════════
TEST RESULTS: [N passed, M failed, K skipped]
══════════════════════════════════════
A) Fix failing tests and re-run
B) Proceed to deploy anyway (not recommended)
C) Abort — fix manually
══════════════════════════════════════
Recommendation: A — fix failures before deploying
══════════════════════════════════════
Step 5b — Security Audit (optional)
Condition: the autopilot state shows Step 5 (Run Tests) is completed AND the autopilot state does NOT show Step 5b (Security Audit) as completed or skipped AND (_docs/04_deploy/ does not exist or is incomplete)
Action: Present using Choose format:
══════════════════════════════════════
DECISION REQUIRED: Run security audit before deploy?
══════════════════════════════════════
A) Run security audit (recommended for production deployments)
B) Skip — proceed directly to deploy
══════════════════════════════════════
Recommendation: A — catches vulnerabilities before production
══════════════════════════════════════
- If user picks A → Read and execute
.cursor/skills/security/SKILL.md. After completion, auto-chain to Step 6 (Deploy). - If user picks B → Mark Step 5b as
skippedin the state file, auto-chain to Step 6 (Deploy).
Step 6 — Deploy
Condition: the autopilot state shows Step 5 (Run Tests) is completed AND (Step 5b is completed or skipped) AND (_docs/04_deploy/ does not exist or is incomplete)
Action: Read and execute .cursor/skills/deploy/SKILL.md
Done
Condition: _docs/04_deploy/ contains all expected artifacts (containerization.md, ci_cd_pipeline.md, environment_strategy.md, observability.md, deployment_procedures.md)
Action: Report project completion with summary. If the user runs autopilot again after greenfield completion, Flow Resolution rule 3 routes to the existing-code flow (re-entry after completion) so they can add new features.
Auto-Chain Rules
| Completed Step | Next Action |
|---|---|
| Problem Gathering | Auto-chain → Research (Mode A) |
| Research (any round) | Auto-chain → Research Decision (ask user: another round or proceed?) |
| Research Decision → proceed | Auto-chain → Plan |
| Plan | Auto-chain → Decompose |
| Decompose | Session boundary — suggest new conversation before Implement |
| Implement | Auto-chain → Run Tests (Step 5) |
| Run Tests (all pass) | Auto-chain → Security Audit choice (Step 5b) |
| Security Audit (done or skipped) | Auto-chain → Deploy (Step 6) |
| Deploy | Report completion |