Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Workflow for reverse-engineering a codebase into grounded architecture docs, requirements capture, etc.
.claude/skills/griddynamics-code-analysis-flow/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-12 | ✗→✓ | ▲ Improved | 111% | 0% |
| case-04 | ✗→✓ | ▲ Improved | 87% | 0% |
| case-05 | ✗→✓ | ▲ Improved | 159% | 0% |
| case-06 | ✗→✓ | ▲ Improved | 240% | 0% |
| case-07 | ✗→✓ | ▲ Improved | 293% | 0% |
<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>
<prerequisites phase="0" applies="ALL">
load-project-context, orchestration, hitllarge-workspace-handling.agents/TEMP/<FEATURE>/code-analysis-flow-state.md updated after each phase.best_practices for sizing and diagram rules./goal is set repeat phases 4-8 until goal is met.large-workspace-handling.requirements-authoringrequirements_branch and review (more agents - less scope each).</prerequisites>
<context_load phase="1" applies="ALL" subagent="discoverer" role="Context gatherer for analysis scope" subagent_required_model="claude-sonnet-5, gpt-5.4-medium, gemini-3.1-pro, grok-4.5, gpt-5.6-terra">
docs/CONTEXT.md, docs/ARCHITECTURE.md, agents/IMPLEMENTATION.md; grep headers of docs/CODEMAP.md, docs/TECHSTACK.md, docs/DEPENDENCIES.md if present.load-project-contextcode-analysis-flow-state.md.</context_load>
<scope_and_classify phase="2" applies="ALL" subagent="discoverer" role="Scope and size scanner" subagent_required_model="claude-sonnet-5, gpt-5.4-medium, gemini-3.1-pro, grok-4.5, gpt-5.6-terra">
scope (paths), size (SMALL|LARGE), module-list (LARGE only).reasoningcode-analysis-flow-state.md.</scope_and_classify>
<clarify_unknowns phase="3" applies="ALL" type="HITL">
questioningcode-analysis-flow-state.md.</clarify_unknowns>
<requirements_branch phase="4" applies="ALL" when="user requested requirements reverse-engineering" subagent="architect" role="Requirements engineer extracting intent from code" subagent_required_model="claude-opus-4-8, gpt-5.5-high, gemini-3.1-pro-high, gpt-5.6-sol">
reverse-engineering skill to distill intent, then requirements-authoring skill to produce atomic, testable functional and non-functional requirements with SMART, MECE, acceptance criteria, EARS phrasing, priority (MoSCoW), and predecessors.docs/REQUIREMENTS/ per requirements-authoring layout, with HITL per-unit approval owned by that skill.reverse-engineering, requirements-authoringcode-analysis-flow-state.md.large-workspace-handling (Summarization & Indexing strategy): every file belongs to exactly one scope; subagents analyze per-module in parallel.</requirements_branch>
<analyze_small phase="5" applies="SMALL" subagent="architect" role="Senior systems analyst producing a single grounded analysis document" subagent_required_model="claude-opus-4-8, gpt-5.5-high, gemini-3.1-pro-high, gpt-5.6-sol">
docs/<feature>/analysis.md.reverse-engineeringcode-analysis-flow-state.md.</analyze_small>
<analyze_large_parallel phase="6" applies="LARGE" subagent="architect" role="Per-module systems analyst (parallel dispatch)" subagent_required_model="claude-opus-4-8, gpt-5.5-high, gemini-3.1-pro-high, gpt-5.6-sol">
large-workspace-handling (Summarization & Indexing strategy): every file belongs to exactly one scope; subagents analyze per-module in parallel.module-list + scope + context. Output: docs/<feature>/module-<module>.md per module.large-workspace-handling, reverse-engineeringcode-analysis-flow-state.md.</analyze_large_parallel>
<summarize phase="7" applies="LARGE" subagent="architect" role="Cross-module summarizer" subagent_required_model="claude-opus-4-8, gpt-5.5-high, gemini-3.1-pro-high, gpt-5.6-sol">
docs/<feature>/summary.md with: Business context (processes/scenarios with involved components and Mermaid diagrams), Domain description (data models with business purpose and cross-repo physical references), Detailed analysis (per repository/component: tech stack, features, dependencies), Architecture insights (patterns and conventions), Dependency map (Mermaid at component and subcomponent level).module-<module>.md documents. Output: docs/<feature>/summary.md.reverse-engineeringcode-analysis-flow-state.md.</summarize>
<review phase="8" applies="ALL" subagent="reviewer" role="Analysis quality reviewer" subagent_required_model="gpt-5.4-medium, gemini-3.1-pro-preview, claude-sonnet-5, grok-4.5, gpt-5.6-terra" must-be-subagent>
reasoningcode-analysis-flow-state.md.</review>
<user_review phase="9" applies="ALL" type="HITL">
analyze_small, analyze_large_parallel, summarize, or requirements_branch).</user_review>
<finalize phase="10" applies="ALL" subagent="architect" role="Analysis finalizer" subagent_required_model="claude-opus-4-8, gpt-5.5-high, gemini-3.1-pro-high, gpt-5.6-sol">
IMPLEMENTATION.md with a brief pointer to produced analysis artifacts.code-analysis-flow-state.md complete with phase evidence and artifact paths.</finalize>
</workflow_phases>
<best_practices>
reverse-engineering pitfalls.</best_practices>
<validation_checklist>
analysis.md; LARGE → module-*.md + summary.md).code-analysis-flow-state.md has artifact evidence for every executed phase.docs/REQUIREMENTS/ artifacts only when the user requested it.docs/REQUIREMENTS/INDEX.md is greppable by headers, which provides automatic ToC for all requirement files with short description.</validation_checklist>
<pitfalls>
</pitfalls>
</code_analysis_flow>
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-12 | fail→pass | 9,949 | 2,294 | -77% | 1 | 1 | 0% | 1,517 | 3,199 | +111% | 0 | 0 | — |
case-01 | fail→fail | 23,988 | 5,494 | -77% | 1 | 1 | 0% | 4,421 | 3,244 | -27% | 0 | 0 | — |
case-02 | fail→fail | 5,113 | 9,299 | +82% | 1 | 1 | 0% | 338 | 3,582 | +960% | 0 | 0 | — |
case-03 | fail→fail | 3,542 | 8,225 | +132% | 1 | 1 | 0% | 232 | 3,510 | +1413% | 0 | 0 | — |
case-04 | fail→pass | 12,210 | 3,555 | -71% | 1 | 1 | 0% | 1,822 | 3,410 | +87% | 0 | 0 | — |
case-05 | fail→pass | 8,867 | 4,133 | -53% | 1 | 1 | 0% | 1,393 | 3,601 | +159% | 0 | 0 | — |
case-06 | fail→pass | 6,494 | 2,596 | -60% | 1 | 1 | 0% | 998 | 3,396 | +240% | 0 | 0 | — |
case-07 | fail→pass | 6,228 | 4,463 | -28% | 1 | 1 | 0% | 953 | 3,745 | +293% | 0 | 0 | — |
case-08 | fail→pass | 19,054 | 3,641 | -81% | 1 | 1 | 0% | 1,021 | 3,548 | +248% | 0 | 0 | — |
case-09 | fail→pass | 7,636 | 2,796 | -63% | 1 | 1 | 0% | 1,104 | 3,392 | +207% | 0 | 0 | — |
case-10 | pass→pass | 19,585 | 18,350 | -6% | 1 | 1 | 0% | 3,153 | 6,056 | +92% | 0 | 0 | — |
case-11 | fail→pass | 7,043 | 2,279 | -68% | 1 | 1 | 0% | 1,066 | 3,244 | +204% | 0 | 0 | — |
case-13 | pass→pass | 8,751 | 1,889 | -78% | 1 | 1 | 0% | 1,173 | 3,222 | +175% | 0 | 0 | — |
case-14 | pass→pass | 9,559 | 6,003 | -37% | 1 | 1 | 0% | 1,498 | 3,820 | +155% | 0 | 0 | — |
case-15 | pass→pass | 9,340 | 5,665 | -39% | 1 | 1 | 0% | 1,445 | 3,939 | +173% | 0 | 0 | — |
case-16 | fail→pass | 25,098 | 2,351 | -91% | 1 | 1 | 0% | 1,868 | 3,221 | +72% | 0 | 0 | — |
case-17 | pass→pass | 4,931 | 2,794 | -43% | 1 | 1 | 0% | 781 | 3,368 | +331% | 0 | 0 | — |
case-18 | fail→pass | 15,665 | 7,347 | -53% | 1 | 1 | 0% | 2,504 | 4,113 | +64% | 0 | 0 | — |
case-19 | fail→fail | 8,077 | 1,993 | -75% | 1 | 1 | 0% | 1,270 | 3,230 | +154% | 0 | 0 | — |
case-20 | fail→fail | 9,633 | 11,223 | +17% | 1 | 1 | 0% | 2,044 | 3,494 | +71% | 0 | 0 | — |
case-21 | fail→fail | 15,807 | 21,687 | +37% | 1 | 1 | 0% | 3,075 | 6,395 | +108% | 0 | 0 | — |
case-22 | fail→fail | 19,803 | 7,686 | -61% | 1 | 1 | 0% | 4,347 | 3,248 | -25% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted, and 16 counted toward the lift figure. The other 6 produced results that are not comparable between the two arms, so they are excluded from the headline rather than averaged into it. The headline lift of +45 percentage points is the difference between those two pass rates over the 16 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.