harness/plugins/code-search/claude/skills/codebase-analyzer/SKILL.md
Router skill for codebase analysis. Launches one implementation analyzer subagent and produces one evidence-backed report with file:line references.
npx skillsauth add popoffvg/dotfiles codebase-analyzerInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
This skill is an orchestrator. Do not do a single-pass analysis directly.
Use this skill only for analysis/audit requests ("analyze", "map", "understand", "what does this do").
Do not use this skill for operational/edit requests (for example: permissions, tool permission updates, AGENTS/agent guide edits, git hooks, CI failures, installs, "fix it", "make it executable"). In those cases, do the requested edit workflow directly (read target file, edit, validate) or use the appropriate skill.
If the user request is ambiguous (e.g. "fix it" without an explicit analysis goal), ask one clarifying question instead of launching subagents.
Produce one combined analysis that covers:
All claims must be backed by absolute/path:line references.
Run one subagent only for the target:
codebase-analyzer-implementationDo not use parallel execution.
Use this exact shape when calling the subagent tool:
{
"agent": "codebase-analyzer-implementation",
"task": "Analyze target: <TARGET>. Return Implementation, Domain Terms/Relations, and Constraints with absolute path:line citations."
}
Execution rules:
context: "fresh" unless prior context is explicitly required.needs verification.continue, resume using the last unresolved analysis target.Use cocoindex and fff MCP servers for code discovery and evidence collection.
When executing this skill, allow only the tools required for analysis output:
mcp (must use only cocoindex and fff servers)readwrite (only for _notes/analysis-<target>.md)After the subagent returns:
Always write final result to:
_notes/analysis-<target>.md
Use short kebab-case <target>.
## Analysis: <Target>
### Overview
- 2-4 bullets summarizing behavior, domain model, and key limits.
### Implementation (Current Behavior)
- Evidence-backed explanation of entry points, flow, transformations, side effects.
### Domain Terms (DDD)
#### Terms
- **Term** — definition (`/abs/path/file.ext:line`)
#### Relations
- **TermA -> TermB**: relation description (`/abs/path/file.ext:line`)
### Constraints
Express constraints as **TypeScript-style pseudocode** inside a component namespace.
Use `throw` for hard constraints and comments for soft constraints.
```ts
namespace <Target>Component {
export function validateConstraints(input: <InputType>): void {
// hard constraints (must hold)
if (!(<invariant description>)) {
throw new Error("<constraint name>") // /abs/path/file.ext:line
}
if (!(<invariant description>)) {
throw new Error("<constraint name>") // /abs/path/file.ext:line
}
// soft constraints (warn/operational limits)
// WARN: <soft limit description> // /abs/path/file.ext:line
}
export function describeConstraintInteractions(): void {
// <ConstraintA> + <ConstraintB> => <combined effect> // /abs/path/file.ext:line
}
}
Express flow as TypeScript-style pseudocode with a namespaced state model. Only include if a concrete execution flow exists.
namespace <Target>Component {
export type State = "<stateA>" | "<stateB>" | "<stateC>"
export function transition(state: State, trigger: string): State {
if (state === "<stateA>" && trigger === "<trigger>") {
return "<stateB>" // /abs/path/file.ext:line
}
if (state === "<stateA>" && trigger === "<trigger>") {
return "<stateC>" // /abs/path/file.ext:line
}
return state
}
export function assertStateInvariants(state: State): void {
if (!(<state-level invariant>)) {
throw new Error("State invariant failed") // /abs/path/file.ext:line
}
}
}
function flow() {
<TargetComponent>.transision(/*params*/)
<TargetComponent>.assertStateInvairants(/*params*/)
}
## Non-goals
- No recommendations
- No refactors
- No bug hunting
- No quality critique
- No speculative architecture
Describe only what exists now.
tools
Improve a whole CLAUDE.local.md — the private, per-project rules captured from user corrections. Wraps each conditional rule in a <task-relevant> block so it only surfaces for matching work, merges duplicates, generalizes one-off facts, drops stale entries, and routes raw project facts to engram. Use when the user says "improve claude.local", "clean up the local rules", "claude.local is bloated", or after the Stop hook has appended many rules.
testing
WM pipeline and conventions shared across all phases. Agents must read this before spec, impl, or verify work.
development
One entry point for spec writing, implementation, and bug fixing. Default is new (write spec → grill loop → produce notes → author TODO bodies). Other subcommands: verify (audit), revise (sync to shipped), prototype (settle a decision), code-map (diagram), impl (execute one TODO), fix (analyze cause, correct thoughts, fix behavior), help (this page). Invoke as /code <subcommand>.
development
Red-Green-Refactor cycle for bug fixes. Before fixing a bug, first write a failing test that reproduces it (Red), then make the minimal change to pass (Green), then clean up the code (Refactor). Use on any bug fix, error correction, failing test repair, or when user says "fix this bug".