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. Lightweight variant: a single architect pass produces discovery, design, specs, and plan; one reviewer gate and one HITL gate approve all of it before implementation.
- All Rosetta prep steps MUST be FULLY completed
- MUST USE SKILL
load-project-context(required: all),orchestration(all except trivial),hitl(all, unlessNo HITLorFully 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
engineerwithdebuggingskill to save LLM context - INVOKE SUBAGENT
executorfor 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-useand LOAD all affected requirements. Use refs to requirements for subagents. - If
/goalis set repeat phases 4-7 postponing 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.mdfile. - If context already contains request for TDD => implement properly red and green adjusting this workflow, including by moving execution of phases
testsandreview_teststo be afteruser_review_designand beforeimplementation.
Execute strongly in the specified order. A step MUST NOT start before the previous step is complete.
- Step 1: Discover project context, affected and related code, dependencies, constraints, and requirements; derive the architecture requirements that address the user request fully. Input: user request +
CONTEXT.md+ARCHITECTURE.md+IMPLEMENTATION.md. Do not stop until 100% clear. - 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. Record Steps 1-3 as concise
architecture-notes.mdin FEATURE PLAN folder. - Step 4: Once done, USE SKILL
tech-specs(load JIT) to createplans/<FEATURE>/<FEATURE>-SPECS.md. Specs own WHAT. - Step 5: Once done, USE SKILL
planning(load JIT) to createplans/<FEATURE>/<FEATURE>-PLAN.md. Plan owns HOW. Target: 100% clarity. Cross-reference specs, never duplicate them. - Required skills:
reasoning,tech-specs,planning - Recommended skills:
questioning,codemap(structural project discovery) - If REQUIREMENTS in use:
requirements-useskill is required. Plan/Specs must have pointers to requirements identifiers. - Additionally discover existing libraries, packages, and search web for similar problems/tasks (if this make sense)
- SMALL: output specs and plan as message, no files. MEDIUM: concise. LARGE: full.
- Update
coding-flow-state.md
- Review all three artifacts together -
architecture-notes.md, specs, and plan - against user request, do not assume user is in context, give him full information with TLDR. - Input: architecture notes, specs, plan, user request. Output: review findings and recommendations.
- Report gaps between the three artifacts: a design decision absent from specs, a spec element absent from plan.
- Update
coding-flow-state.md
- Present main solution first and then alternatives, do not assume user is in context, give him full information with TLDR.
- Present architecture notes, specs, plan, and review findings. This is the ONLY gate before implementation. User MUST approve: "Yes, I reviewed the design" or "Approve, the design was reviewed".
- Strict approval; anything else = review feedback, iterate.
- 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 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 - MUST also validate by running locally and check implementation actually works, once code review is done and there are no major issues
- 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 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
- 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
MCPs:
DeepWiki,Context7— external documentation and library knowledgePlaywright,Chrome-DevTools— web app testingAppium— mobile app testingGitNexus— codebase knowledge graphSerena— semantic code retrieval at symbol level