一键导入
codebase-audit
Periodic codebase health check. Use when the user says "health check", "technical debt", "what needs attention", "codebase audit", "codebase health".
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Periodic codebase health check. Use when the user says "health check", "technical debt", "what needs attention", "codebase audit", "codebase health".
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | codebase-audit |
| description | Periodic codebase health check. Use when the user says "health check", "technical debt", "what needs attention", "codebase audit", "codebase health". |
Run a health check on the current repository and report findings.
Announce at start: "Running codebase audit on [repo name]."
Before running any checks, detect the project type from config files:
pyproject.toml present → Python project (run ruff, mypy, pytest, bandit)package.json present → TypeScript/Node project (run eslint, tsc, vitest)*.sh files present → Shell scripts (run shellcheck)git log --since="30 days ago" --name-only)git log --format=format: --name-only --since="90 days ago" | sort | uniq -c | sort -rn | head -20
Most-changed files = highest risk for bugs and complexity growth.
Run the appropriate linter for the detected project type. Flag:
uv run pytest tests/ -q --cov --cov-report=term-missing 2>/dev/null || echo "No pytest found"
Flag modules with < 70% coverage.
uv pip list --outdated 2>/dev/null || pip list --outdated 2>/dev/null || echo "No pip found"
Flag packages > 2 major versions behind.
grep -rn "TODO\|FIXME\|HACK\|XXX" --include="*.py" --include="*.sh" . | grep -v .venv | grep -v __pycache__
Count and list untracked debt markers.
Check documentation integrity:
.md file in docs/, verify that relative links resolve to existing files.docs/specs/, check that the files it describes actually exist in the codebase.README.md (skills, agents, steering docs) and compare against actual counts on disk.docs/ not modified in 30+ days that references files changed in the last 30 days.# Find docs not updated in 30+ days
find docs/ -name "*.md" -not -newer "$(date -d '30 days ago' +%Y-%m-%d 2>/dev/null || date -v-30d +%Y-%m-%d)" 2>/dev/null
Each finding must include all five fields:
| Field | Values |
|---|---|
| Category | DRY violation | God object | stale test | dead code | dependency issue | structural problem | doc staleness |
| Location | file:line |
| Severity | high | medium | low |
| Effort | small (< 30 min) | medium (1-2 hrs) | large (half day+) |
| Agent | Which agent would fix this: devops-python, devops-typescript, devops-refactor, devops-docs, devops-shell |
## Codebase Audit — [repo] — YYYY-MM-DD
### Project Type
Detected: [Python | TypeScript/Node | Shell | Mixed]
### Churn (top 10 most-changed files)
| File | Changes (90d) | Concern |
### Findings (max 20)
| # | Category | Location | Severity | Effort | Agent | Description |
### Doc Health
| Doc | Issue | Severity |
### Dependencies
| Package | Current | Latest | Behind |
### Debt Markers
TODO: X | FIXME: Y | HACK: Z
### Summary
2-3 sentence overall assessment with top 3 recommended actions.
Audits agents, prompts, skills, knowledge, and documentation for gaps, inconsistencies, and improvement opportunities. Proposes changes for user approval. Triggers on "agent-audit", "audit agents", "review config", "what can we improve".
Use before any creative work or spec creation. Explores intent, challenges assumptions, and produces specs. Triggers on "brainstorm", "let's design", "spec out", "define requirements", "write a spec", "challenge this", "poke holes", "what am I missing".
Detects documentation drift after structural changes. Dispatches parallel specialist reviewers and auto-fixes. Triggers on "check my docs", "audit docs", "doc drift", "check doc drift", or auto from post-implementation when tracked categories change.
Automated post-implementation workflow. Triggers when the orchestrator receives DONE from an implementation subagent. Runs quality gate, doc staleness check, auto-review, and improvement capture.
Takes a spec phase and generates an execution plan with parallel stages, agent routing, review gates, and verification criteria. Use before dispatching implementation work. Triggers on "plan execution", "generate execution plan", "how should we execute this", or internally when the orchestrator is about to implement a spec phase.
Use when executing implementation plans with independent tasks in the current session