sw-audit
Periodic codebase health check. Analyzes architecture, complexity, consistency, and debt across the full codebase. Produces persistent findings in AUDIT.md.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Periodic codebase health check. Analyzes architecture, complexity, consistency, and debt across the full codebase. Produces persistent findings in AUDIT.md.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Specwright health check. Validates shared config, anchor docs, workflow and session state, commands, gates, and hooks. May backfill shipped PR metadata when it can prove the mapping safely.
Detects project stack and existing guardrails, then interactively configures deterministic quality checks across session, commit, push, and CI/CD layers.
Initializes Specwright in a project. Detects stack, asks about practices, creates constitution and charter, configures quality gates and hooks.
Shows current Specwright state for this worktree, the attached work, repo-wide active works, gate results, and lock status. Supports --reset, --cleanup, and --repair {unitId}.
TDD implementation of one work unit. Delegates test writing to the tester agent and implementation to the executor agent. Commits per task.
Captures patterns and learnings from the current work unit. Reviews build failures, gate findings, and architecture decisions. Applies objective promotion criteria autonomously — patterns.md is the artifact.
| name | sw-audit |
| description | Periodic codebase health check. Analyzes architecture, complexity, consistency, and debt across the full codebase. Produces persistent findings in AUDIT.md. |
| argument-hint | [path | --full] |
| allowed-tools | ["Read","Write","Glob","Grep","Task"] |
Find systemic codebase issues that per-change quality gates miss. Architecture debt, complexity growth, convention drift, and accumulated workarounds compound silently. Surface them, let the user prioritize, and persist findings for future design cycles.
{projectArtifactsRoot}/CONSTITUTION.md -- practices to check against{projectArtifactsRoot}/AUDIT.md -- prior findings (if exists, for ID matching){projectArtifactsRoot}/LANDSCAPE.md -- module structure (if exists, for triage){projectArtifactsRoot}/config.json -- audit config (optional audit section){projectArtifactsRoot}/AUDIT.md -- findings per protocols/audit.md formatScope (LOW freedom):
currentWork in workflow.json. Does NOT require a lock. Can run while a work unit is in progress.Triage (MEDIUM freedom):
--full argument → Full: parallel agents, all dimensionsAnalysis (HIGH freedom):
protocols/delegation.md:
specwright-architect: architecture + complexity (structural analysis)specwright-reviewer: consistency + debt (convention and quality analysis)Synthesis (LOW freedom):
protocols/audit.md (dimension + location). Reuse matched IDs, assign new IDs for unmatched. Mark unmatched prior findings as stale.Presentation (MEDIUM freedom):
protocols/decision.md CURATION for severity and export decisions:
finding tag.protocols/audit.md -- finding format, IDs, matching, lifecycleprotocols/delegation.md -- agent delegationprotocols/decision.md -- autonomous decision framework (CURATION for severity)protocols/context.md -- config and anchor doc loadingprotocols/backlog.md -- backlog item format and write targets| Condition | Action |
|---|---|
| No codebase files found | STOP: "No source files to audit." |
| Agents unavailable | Fall back to inline analysis (less thorough) |
| Prior AUDIT.md parse error | WARN, start fresh (no ID continuity) |
| Compaction during audit | Re-run from scratch |