audit-existing
Purpose: produce a fast, structured inventory of what exists before code
generation begins. This prevents plans from assuming greenfield state and
surfaces duplicated contracts, missing tests, and broken wiring early.
When to Use
- Before
/skill:execute-prd drafts a plan from a PRD/prompt/RFC.
- When the requirements source predates the repo and may be out of sync.
- When a user asks "what's already here?" before extending a package.
When NOT to Use
- The repo is provably greenfield (an empty workspace stub) and the
requirement is to scaffold from zero —
/skill:execute-prd will say so and
skip the audit.
- You need to change code — this skill is read-only by contract.
Workflow
- Read repo instructions (
CLAUDE.md) and the active requirements
source, if any.
- List source files, manifests, configs, schemas, migrations, and tests.
- Identify implemented surfaces by package/module.
- Compare current state to the requested scope.
- Flag duplicated public contracts/constants, mismatched API/runtime
types, missing validation, missing failure-path tests, and
generated/native artifacts that may need runtime probes.
- Classify external dependencies using
_internal/dependency-classification/SKILL.md. Flag miscategorizations as test gaps — e.g., Postgres mocked instead of substituted with PGLite, internal services treated as true-external, filesystem mocked instead of using memfs. These miscategorizations are coverage smells: tests pass but exercise the mock, not the real semantics.
- Return an audit only; do not edit files.
Output
## Existing State
- Package/module: implemented surfaces and key files
## Missing Or Partial
- Requirement or surface: evidence
## Duplicated Or Divergent Contracts
- Contract: locations and risk
## Test And Verification Gaps
- Gap: suggested focused verification
## Planning Implications
- Tasks or ownership constraints the execution plan should include
Keep it concise and cite file paths. If the repo is genuinely greenfield,
say so and list the evidence.
Things you must not do
- Do not edit files. The audit is read-only by contract.
- Do not propose fixes — only surface gaps. Fixes are the planner's job.
- Do not duplicate work
/skill:domain-review does. Audit is what exists, not
what's wrong with what exists.
Contract
- Inputs: repository path (default cwd); optional scope hints from the calling skill. Calls
_internal/dependency-classification to label dependencies (mocked / substituted / real).
- Preconditions: in a git repo (or a directory with a recognisable project shape); read access only — never modifies the working tree.
- Outputs: structured audit report listing existing packages, public surfaces, persistence layout, current verification posture, dependency classifications, and gaps relative to the requested feature scope.
- Postconditions: caller (
/skill:execute-prd, /skill:modernize) consumes the audit as a plan input; the audit reports state-of-the-repo, not opinions about state-of-the-repo.
- Failure modes: repo unreadable → halt; asked to propose fixes → refuse and surface the request as a finding (fixes belong to the planner); duplication with
/skill:domain-review requested → refuse — audit is "what exists", review is "what's wrong with what exists".
1---2name: audit-existing-23description: Audit a repository before planning or extending it. Produces an implemented/missing/duplicated/broken checklist without editing files.4---567# audit-existing89Purpose: produce a fast, structured inventory of what exists before code10generation begins. This prevents plans from assuming greenfield state and11surfaces duplicated contracts, missing tests, and broken wiring early.1213## When to Use1415- Before `/skill:execute-prd` drafts a plan from a PRD/prompt/RFC.16- When the requirements source predates the repo and may be out of sync.17- When a user asks "what's already here?" before extending a package.1819## When NOT to Use2021- The repo is provably greenfield (an empty workspace stub) and the22 requirement is to scaffold from zero — `/skill:execute-prd` will say so and23 skip the audit.24- You need to *change* code — this skill is read-only by contract.2526## Workflow27281. Read repo instructions (`CLAUDE.md`) and the active requirements29 source, if any.302. List source files, manifests, configs, schemas, migrations, and tests.313. Identify implemented surfaces by package/module.324. Compare current state to the requested scope.335. Flag duplicated public contracts/constants, mismatched API/runtime34 types, missing validation, missing failure-path tests, and35 generated/native artifacts that may need runtime probes.366. **Classify external dependencies** using `_internal/dependency-classification/SKILL.md`. Flag miscategorizations as test gaps — e.g., Postgres mocked instead of substituted with PGLite, internal services treated as true-external, filesystem mocked instead of using `memfs`. These miscategorizations are coverage smells: tests pass but exercise the mock, not the real semantics.377. Return an audit only; do not edit files.3839## Output4041```markdown42## Existing State43- Package/module: implemented surfaces and key files4445## Missing Or Partial46- Requirement or surface: evidence4748## Duplicated Or Divergent Contracts49- Contract: locations and risk5051## Test And Verification Gaps52- Gap: suggested focused verification5354## Planning Implications55- Tasks or ownership constraints the execution plan should include56```5758Keep it concise and cite file paths. If the repo is genuinely greenfield,59say so and list the evidence.6061## Things you must not do6263- Do not edit files. The audit is read-only by contract.64- Do not propose fixes — only surface gaps. Fixes are the planner's job.65- Do not duplicate work `/skill:domain-review` does. Audit is *what exists*, not66 *what's wrong with what exists*.6768## Contract6970- **Inputs:** repository path (default cwd); optional scope hints from the calling skill. Calls `_internal/dependency-classification` to label dependencies (mocked / substituted / real).71- **Preconditions:** in a git repo (or a directory with a recognisable project shape); read access only — never modifies the working tree.72- **Outputs:** structured audit report listing existing packages, public surfaces, persistence layout, current verification posture, dependency classifications, and gaps relative to the requested feature scope.73- **Postconditions:** caller (`/skill:execute-prd`, `/skill:modernize`) consumes the audit as a plan input; the audit reports state-of-the-repo, not opinions about state-of-the-repo.74- **Failure modes:** repo unreadable → halt; asked to propose fixes → refuse and surface the request as a finding (fixes belong to the planner); duplication with `/skill:domain-review` requested → refuse — audit is "what exists", review is "what's wrong with what exists".