code-analysis-flow

code-analysis-flow is a command for coding agents from griddynamics/rosetta. It costs 22 tokens per session (2,619 once invoked), scanned A, original, Apache-2.0.

Workflow for reverse-engineering a codebase into grounded architecture docs, requirements capture, etc.

Command

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/griddynamics/rosetta/code-analysis-flow
Clone the repo
git clone --depth 1 https://github.com/griddynamics/rosetta

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for code-analysis-flow

README.md
[![agentmods](https://agentmods.dev/badge/commands/griddynamics/rosetta/code-analysis-flow.svg)](https://agentmods.dev/commands/griddynamics/rosetta/code-analysis-flow)
Your own site
<a href="https://agentmods.dev/commands/griddynamics/rosetta/code-analysis-flow"><img src="https://agentmods.dev/badge/commands/griddynamics/rosetta/code-analysis-flow.svg" alt="Measured on agentmods" height="20"></a>
Per session 22 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,619 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin unknown No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00022 $0.02619
Opus 5 $0.00011 $0.01309
Sonnet 5 $0.00004 $0.00524
Haiku 4.5 $0.00002 $0.00262

Measured today against content hash 8bc20244084f, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

code-analysis-flow scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured today.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/core-copilot-light/commands/code-analysis-flow.md · 172 lines

How it starts

The opening of the file, as written. The whole thing — 172 lines — stays where its author put it; the contents beside it link to each section on GitHub.

<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>

  1. All Rosetta prep steps MUST be FULLY completed
  2. USE SKILL load-project-context, orchestration, hitl
  3. 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.
  4. No rush, take your time, MUST FOLLOW WORKFLOW ENTIRELY, no skipping
  5. Orchestrator trusts skills to own execution internals; coordinates sequence, artifacts, state, and approvals only.
  6. State file: agents/TEMP/<FEATURE>/code-analysis-flow-state.md updated after each phase.
  7. Documentation principle: ground with links; no code generation, no suggestions, no speculation. See best_practices for sizing and diagram rules.
  8. If /goal is set repeat phases 4-8 until goal is met.
  9. If task is to extract/document/reverse engineer requirements or specifications from existing app/code:
    • This is much more intense per subagent: reclassify SMALL if < 10 source files, otherwise LARGE and MUST USE large-workspace-handling.
    • Both orchestrator and subagents MUST USE SKILL requirements-authoring
    • Spawn MULTIPLE subagents with each handling one unit of analysis (one module, one community, one screen, one controller, one endpoint, etc) to effectively prevent hallucinations by narrowing scope down for phases requirements_branch and review (more agents - less scope each).

<context_load phase="1" applies="ALL" subagent="discoverer" role="Context gatherer for analysis scope" subagent_required_model="Claude Sonnet 5, GPT-5.6 Terra, Gemini 3.7 Flash">

  1. Read all lines of docs/CONTEXT.md, docs/ARCHITECTURE.md, agents/IMPLEMENTATION.md; grep headers of docs/CODEMAP.md, docs/TECHSTACK.md, docs/DEPENDENCIES.md if present.
  2. Input: user analysis request. Output: loaded project context + entry points (APIs, webhooks, CLIs, cron jobs).
  3. Recommended skills: load-project-context
  4. Update code-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.6 Terra, Gemini 3.7 Flash">

  1. Classify target codebase: LARGE if 100+ files recursively or 4+ modules; otherwise SMALL.
  2. Identify target scope (repo, module, feature, path glob). Record boundaries and non-goals.
  3. Input: user request + loaded context. Output: scope (paths), size (SMALL|LARGE), module-list (LARGE only).
  4. Required skills: reasoning
  5. Update code-analysis-flow-state.md.

</scope_and_classify>

<clarify_unknowns phase="3" applies="ALL" type="HITL">

  1. Surface only critical/high assumptions and unknowns affecting analysis accuracy; skip low and nit-picking.
  2. Ask up to 10 targeted, MECE, one-decision-per-question batch. Include safe default per question.
  3. Record resolved answers and unresolved items as assumptions; both are persisted in final output.
  4. Required skills: questioning
  5. Update code-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 5, GPT-5.6 Sol, Gemini 3.7 Flash">

Read the full file on GitHub · 172 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. today First seen · 172 lines · 22 tokens per session scan A 8bc20244084f

Subscribe to this mod's changes

code-analysis-flow is a command published in the GitHub repository griddynamics/rosetta (342 stars, last pushed today), licensed Apache-2.0. It adds 22 tokens to every session and 2,619 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.