Codebase Analysis → CURRENT_STATE.md
The skill creates or fully rewrites CURRENT_STATE.md in the directory returned by pwd.
The skill's job is to describe how the system works right now. Do not propose a future solution, refactoring, migration, new architecture, or an implementation plan.
The resulting file always consists of two blocks:
- Block 1. For the human — a short, readable summary without overload.
- Block 2. For the agent — a detailed evidence-backed snapshot for
solution-design, planf3, and review.
Hard boundaries
You may modify only CURRENT_STATE.md and the permitted artifacts of the auxiliary graph, if they are produced by the standard tool.
Forbidden:
- modifying source code, tests, configs, schemas, dependencies, or project documentation;
- creating
SOLUTION.md;
- designing a future change;
- automatically launching
solution-design or planf3;
- commits, pushes, deploys, migrations, cloud write commands;
- turning the analysis into a full-repository audit when the user gave a narrow focus.
Launch contract
- Run
pwd and treat it as the analysis root.
- Determine the Git root, branch, revision, and the initial working tree state. If
pwd is not the Git root — record that honestly.
- Read local instructions:
AGENTS.md, CLAUDE.md, README, CONTRIBUTING, architecture documents, build/test/release docs.
- Find the relevant manifests, schemas, package roots, and code roots.
- If the user gave a focus — analyze deeply only the related area. If there is no focus — produce a bounded overview, not a file-by-file encyclopedia.
- Find an existing
graphify graph. Use it only as a navigation index. Verify every material conclusion against live code, tests, configs, and schemas.
- At the end, compare the final working tree with the initial baseline and explicitly separate pre-existing changes from the newly created
CURRENT_STATE.md.
Context management
Use read-only subagents adaptively:
- small local area: 0–1;
- several subsystems: 2–3;
- large monorepo: up to 4.
No nested spawning. Each subagent returns only facts, inference, unknowns, evidence, and analysis limitations. Only the coordinator writes the final document.
If the harness does not provide an isolated-subagent tool (for example, Pi) — perform these roles inline as separate passes: a pass outputs only findings in the role's format, then the coordinator continues. Do not simulate spawning subagents and do not claim they were launched.
Minimality and overengineering protection
Even an analysis of the current state must help future agents avoid building unnecessary architecture.
Always record:
- existing simple extension points;
- local patterns worth reusing;
- dependencies and abstractions the project currently does not have;
- places where the project deliberately lives without a global state/service/framework layer;
- complexity constraints that future changes must respect.
Do not call the absence of a framework or layer a problem. Describe it as a fact or a deliberate current style, if the code confirms it.
What to read
- analysis-workflow.md — the order of analysis.
- evidence-policy.md — evidence rules.
- repository-lenses.md — universal lenses for mobile/frontend/backend/game/CLI/library/etc.
- delegation-policy.md — subagents and context limits.
- CURRENT_STATE.template.md — the mandatory structure of the result.
Language
Write CURRENT_STATE.md and all reports in the user's language — the language of the user's request and conversation, not the language of these instructions. If the request is in Russian, the artifact is in Russian. Do not translate file names, symbols, commands, statuses, or APIs.
Completion criteria
CURRENT_STATE.md is done only if:
- there is a short human block;
- the agent block contains the evidence-backed current state;
FACT, INFERENCE, UNKNOWN are explicitly separated;
- contracts, invariants, verification, and unknowns are recorded;
- the simplicity baseline is recorded;
- no future solution is proposed;
- the final working tree has been checked;
- the status is exactly one of:
CURRENT_STATE_COMPLETE or CURRENT_STATE_PARTIAL.
1---2name: codebase-analysis3description: Creates CURRENT_STATE.md: an evidence-backed description of the current state of the repository. Use only when the user explicitly asks to run codebase-analysis. Does not design a solution, write code, or produce an implementation plan.4---56# Codebase Analysis → CURRENT_STATE.md78The skill creates or fully rewrites `CURRENT_STATE.md` in the directory returned by `pwd`.910The skill's job is to describe **how the system works right now**. Do not propose a future solution, refactoring, migration, new architecture, or an implementation plan.1112The resulting file always consists of two blocks:13141. **Block 1. For the human** — a short, readable summary without overload.152. **Block 2. For the agent** — a detailed evidence-backed snapshot for `solution-design`, `planf3`, and review.1617## Hard boundaries1819You may modify only `CURRENT_STATE.md` and the permitted artifacts of the auxiliary graph, if they are produced by the standard tool.2021Forbidden:2223- modifying source code, tests, configs, schemas, dependencies, or project documentation;24- creating `SOLUTION.md`;25- designing a future change;26- automatically launching `solution-design` or `planf3`;27- commits, pushes, deploys, migrations, cloud write commands;28- turning the analysis into a full-repository audit when the user gave a narrow focus.2930## Launch contract31321. Run `pwd` and treat it as the `analysis root`.332. Determine the Git root, branch, revision, and the initial working tree state. If `pwd` is not the Git root — record that honestly.343. Read local instructions: `AGENTS.md`, `CLAUDE.md`, README, CONTRIBUTING, architecture documents, build/test/release docs.354. Find the relevant manifests, schemas, package roots, and code roots.365. If the user gave a focus — analyze deeply only the related area. If there is no focus — produce a bounded overview, not a file-by-file encyclopedia.376. Find an existing `graphify` graph. Use it only as a navigation index. Verify every material conclusion against live code, tests, configs, and schemas.387. At the end, compare the final working tree with the initial baseline and explicitly separate pre-existing changes from the newly created `CURRENT_STATE.md`.3940## Context management4142Use read-only subagents adaptively:4344- small local area: 0–1;45- several subsystems: 2–3;46- large monorepo: up to 4.4748No nested spawning. Each subagent returns only facts, inference, unknowns, evidence, and analysis limitations. Only the coordinator writes the final document.4950If the harness does not provide an isolated-subagent tool (for example, Pi) — perform these roles inline as separate passes: a pass outputs only findings in the role's format, then the coordinator continues. Do not simulate spawning subagents and do not claim they were launched.5152## Minimality and overengineering protection5354Even an analysis of the current state must help future agents **avoid building unnecessary architecture**.5556Always record:5758- existing simple extension points;59- local patterns worth reusing;60- dependencies and abstractions the project currently does not have;61- places where the project deliberately lives without a global state/service/framework layer;62- complexity constraints that future changes must respect.6364Do not call the absence of a framework or layer a problem. Describe it as a fact or a deliberate current style, if the code confirms it.6566## What to read6768- [analysis-workflow.md](references/analysis-workflow.md) — the order of analysis.69- [evidence-policy.md](references/evidence-policy.md) — evidence rules.70- [repository-lenses.md](references/repository-lenses.md) — universal lenses for mobile/frontend/backend/game/CLI/library/etc.71- [delegation-policy.md](references/delegation-policy.md) — subagents and context limits.72- [CURRENT_STATE.template.md](references/CURRENT_STATE.template.md) — the mandatory structure of the result.7374## Language7576Write `CURRENT_STATE.md` and all reports in the user's language — the language of the user's request and conversation, **not** the language of these instructions. If the request is in Russian, the artifact is in Russian. Do not translate file names, symbols, commands, statuses, or APIs.7778## Completion criteria7980`CURRENT_STATE.md` is done only if:8182- there is a short human block;83- the agent block contains the evidence-backed current state;84- `FACT`, `INFERENCE`, `UNKNOWN` are explicitly separated;85- contracts, invariants, verification, and unknowns are recorded;86- the simplicity baseline is recorded;87- no future solution is proposed;88- the final working tree has been checked;89- the status is exactly one of: `CURRENT_STATE_COMPLETE` or `CURRENT_STATE_PARTIAL`.