| name | coding-flow |
| description | Workflow for all coding: features, fixes, refactors, unit tests, etc.; scales small to large. |
<coding_flow>
<description_and_purpose>
Problem: Unstructured coding leads to scope drift, missing validation, autonomous runaway, and misaligned deliverables.
Solution: Sequential workflow with reviewer gates, HITL gates, subagent delegation, and skill-driven execution scaled per Request size classification.
Validation: Each phase produces verifiable outputs; reviewer catches issues before user; HITL gates prevent autonomous runaway; final validation confirms implementation matches approved intent.
</description_and_purpose>
<workflow_phases>
- All Rosetta prep steps MUST be FULLY completed
- MUST USE SKILL
load-project-context (required: all), orchestration (all except trivial), hitl (all, unless No HITL or Fully Autonomous)
- MUST ALWAYS use todo tasks ledger, ASAP. Phases are sequential. Independent tasks can run in parallel.
- No rush, take your time, MUST FOLLOW WORKFLOW ENTIRELY, no skipping, if in doubt - select the safest / longest path, no deviation from the workflow is allowed
- When debugging is needed, INVOKE SUBAGENT
engineer with debugging skill to save LLM context
- INVOKE SUBAGENT
executor for building, running tests, installing packages, and similar mechanical actions.
- MUST just-in-time load each phase's skills
- If workflow is for REQUIREMENTS, MUST USE SKILL
requirements-use and LOAD all affected requirements. Use refs to requirements for subagents.
- If
/goal is set repeat phases 7-12 postponing user_review_impl and final_validation until goal is met.
- If migrate/modernize: implementation phase MUST use tiny batches ONLY (1-3 files), never bulk-read (other phases may); specs/plan enforce; FS-copy RECOMMENDED; no behavior change/new code; mirror source; subagents same; REQUIRED TO log started/completed; Use impl subagents like MAP-REDUCE;
- Run architect subagent with required model in the background and consult with it if already supported or prefer advisor if already available
- Coding workflow state MUST be saved to
agents/TEMP/<FEATURE>/coding-flow-state.md file.
- Gather project context, affected areas, dependencies, constraints, requirements. SMALL: orchestrator handles inline.
- Input: user request +
CONTEXT.md + ARCHITECTURE.md + IMPLEMENTATION.md. Output: discovery-notes.md in FEATURE PLAN folder.
- Required skills:
load-project-context
- Recommended skills:
codemap (structural project discovery)
- If REQUIREMENTS in use:
requirements-use skill is required.
- Additionally request to discover existing libraries, packages, search web for similar problems/tasks (if this make sense)
- Update
coding-flow-state.md
- Do not stop until 100% clear
- Step 1: discover affected and related code to design architecture requirements to address user request fully.
- Step 2: design 3 best architecture solutions on high level with pro/cons analysis.
- Step 3: define the best solution, but concise, phrase-terse, compressed, etc.
- Input: user request +
CONTEXT.md + ARCHITECTURE.md + IMPLEMENTATION.md. Output: concise architecture-notes.md in FEATURE PLAN folder.
- Required skills:
reasoning
- Recommended skills:
questioning
- Update
coding-flow-state.md
<user_review_design phase="3" applies="ALL" type="HITL">
- Present main solution first and then alternatives, do not assume user is in context, give him full information with TLDR.
- Present specs, plan, and review findings. User MUST approve: "Yes, I reviewed the design" or "Approve, the design was reviewed".
- Strict approval; anything else = review feedback, iterate.
- SMALL: combine with Phase 6 into single checkpoint.
</user_review_design>
<tech_plan phase="4" applies="ALL" subagent="architect" role="Senior architect defining specs and plan" subagent_required_model="inherit">
- MUST USE SKILL
tech-specs and planning together. Split: specs own WHAT, plan owns HOW. Target: 100% clarity.
- Input: discovery notes, user request,
ARCHITECTURE.md. Output: plans/<FEATURE>/<FEATURE>-SPECS.md + plans/<FEATURE>/<FEATURE>-PLAN.md.
- SMALL: output as message, no files. MEDIUM: concise. LARGE: full.
- Required skills:
tech-specs, planning
- If medium/large
reasoning skill is required
- If REQUIREMENTS in use:
requirements-use skill is required. Plan/Specs must have pointers to requirements identifiers.
- Recommended skills:
questioning
- Update
coding-flow-state.md
</tech_plan>
<review_plan phase="5" applies="MEDIUM,LARGE" subagent="reviewer" role="Reviewer inspecting specs and plan against intent" subagent_required_model="inherit" must-be-subagent>
- Review specs and plan against user request and discovery notes, do not assume user is in context, give him full information with TLDR.
- Input: specs, plan, user request. Output: review findings and recommendations.
- Update
coding-flow-state.md
</review_plan>
<user_review_plan phase="6" applies="ALL" type="HITL">
- Present specs, plan, and review findings. User MUST approve: "Yes, I reviewed the plan" or "Approve, the plan and specs were reviewed".
- Strict approval; anything else = review feedback, iterate.
</user_review_plan>
- Implement approved plan. Build MUST succeed. Tests excluded.
- Input: approved specs + plan. Demand subagent to read and execute it fully. Do not repeat contents => reference instead. Output: working code, build passing, update relevant documentation briefly (CONTEXT.md, ARCHITECTURE.md, etc).
- MUST follow approved scope. MUST stop and escalate if blocked.
- Required skills:
coding
- Recommended skills:
debugging, sensitive-data, testing, dangerous-actions
- If requirements are used code must contain comments refs to requirements identifiers
- Spawn multiple implementation agents on independent tasks without dependencies and files intersection if reasonable
- Update
coding-flow-state.md
<review_code phase="8" applies="ALL" subagent="reviewer" role="Reviewer inspecting implementation against specs" subagent_required_model="inherit" must-be-subagent>
- Review code changes against approved specs and plan.
- Input: implementation diff, specs, plan, check if documentation is updated, brief, and matches the file intent. Output: review findings and recommendations.
- Required skills:
coding
- Recommended skills:
reasoning, debugging, sensitive-data, testing, dangerous-actions
- Update
coding-flow-state.md
- If SMALL must also validate by running locally and check implementation actually works, once code review is done and there are no major issues
</review_code>
<impl_validation phase="9" applies="MEDIUM,LARGE" subagent="validator" role="Validation specialist" subagent_required_model="inherit">
- Validate implementation against specs: git changes, spec coverage, gaps, perform search and MCP fact-checking.
- Then it must run locally and check it actually works if there are no major issues
- Input: implementation diff, specs, plan, review findings. Demand subagent to read and verify specs/plan fully. Do not repeat contents => reference instead. Output: validation findings.
- SMALL: orchestrator performs quick inline check.
- Recommended skills:
reverse-engineering, debugging, sensitive-data, testing, dangerous-actions
- Update
coding-flow-state.md
</impl_validation>
<user_review_impl phase="10" applies="ALL" type="HITL">
- Present implementation, review findings, and validation findings. User MUST approve: "Yes, I approve the implementation".
- Strict approval required before proceeding to tests.
- SMALL: combined with Phase 13 final validation.
</user_review_impl>
- Write and execute tests. All MUST succeed, isolated, idempotent.
- Input: implementation, specs. Demand subagent to read specs fully. Do not repeat contents => reference instead. Output: passing tests with coverage.
- Required skills:
testing, coding
- Recommended skills:
debugging, sensitive-data, dangerous-actions
- Update
coding-flow-state.md
<review_tests phase="12" applies="MEDIUM,LARGE" subagent="reviewer" role="Reviewer inspecting test coverage and quality" subagent_required_model="inherit" must-be-subagent>
- Review tests against specs: coverage, scenarios, edge cases, mocking correctness.
- Input: tests, specs, implementation. Output: review findings and recommendations.
- Required skills:
testing, coding
- Recommended skills:
debugging, sensitive-data, dangerous-actions
- Update
coding-flow-state.md
</review_tests>
<final_validation phase="13" applies="MEDIUM,LARGE" subagent="validator" role="Final end-to-end verification" subagent_required_model="inherit">
- Systematic by-dependency validation: databases, APIs, web, mobile. Check logs, clean up.
- Additionally systematic "manual QA" by yourself.
- Input: full delivery (code + tests + specs + review findings). Demand subagent to read specs fully. Do not repeat contents => reference instead. Output: final validation report.
- SMALL: orchestrator confirms build + tests pass.
- Recommended skills:
coding, debugging, sensitive-data, testing, dangerous-actions
- Update
coding-flow-state.md
</final_validation>
</workflow_phases>
MCPs:
DeepWiki, Context7 — external documentation and library knowledge
Playwright, Chrome-DevTools — web app testing
Appium — mobile app testing
GitNexus — codebase knowledge graph
Serena — semantic code retrieval at symbol level
</coding_flow>