| name | code-analysis-flow |
| description | Workflow for reverse-engineering a codebase into grounded architecture docs, requirements capture, etc. |
<code_analysis_flow>
<description_and_purpose>
Problem: Code analysis degrades into transcription, drifts into suggestions/refactors, or stalls when codebase exceeds single-agent context; assumptions and unknowns are silently adopted.
Solution: Thin, sequential workflow that classifies SMALL vs LARGE codebase, delegates analysis to the reverse-engineering skill, must partition LARGE codebases via large-workspace-handling, gates critical/high unknowns through questioning, and optionally extracts requirements via requirements-authoring. Grounded by links, HITL at unknowns and final review.
Validation: Output files exist under docs/<feature>/; every claim traces to code/docs; no generated or suggested implementation; open questions and assumptions are documented; state file reflects phase evidence.
</description_and_purpose>
<workflow_phases>
- All Rosetta prep steps MUST be FULLY completed
- USE SKILL
load-project-context, orchestration, hitl
- MUST ALWAYS use todo tasks ledger, ASAP. Phases are sequential. Independent tasks can run in parallel. Module analysis in LARGE codebases runs in parallel via SKILL
large-workspace-handling.
- No rush, take your time, MUST FOLLOW WORKFLOW ENTIRELY, no skipping
- Orchestrator trusts skills to own execution internals; coordinates sequence, artifacts, state, and approvals only.
- State file:
agents/TEMP/<FEATURE>/code-analysis-flow-state.md updated after each phase.
- Documentation principle: ground with links; no code generation, no suggestions, no speculation. See
best_practices for sizing and diagram rules.
- If is set repeat phases 4-8 until goal is met.