一键导入
phase-audit
Mandatory audit procedure that must pass before any phase may be marked COMPLETE. Verifies documentation updates, ADRs, and validation scripts.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Mandatory audit procedure that must pass before any phase may be marked COMPLETE. Verifies documentation updates, ADRs, and validation scripts.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | phase-audit |
| description | Mandatory audit procedure that must pass before any phase may be marked COMPLETE. Verifies documentation updates, ADRs, and validation scripts. |
| user-invocable | true |
| allowed-tools | Read Grep Glob Bash Write |
Verify that all phase completion artifacts exist and are valid before allowing the phase to be marked COMPLETE.
Phase completion artifacts include:
This is an enforcement mechanism, not a suggestion. There is exactly one place where phase completion can be blocked: this audit.
| Input | Required | Description |
|---|---|---|
phase_number | Yes | The phase number being marked complete (e.g., "1", "2a") |
phase_description | Yes | Brief description of what the phase accomplished |
changes_made | Yes | List of infrastructure, schema, or component changes made |
Before invoking this skill:
docs/glossary/markdown-glossary.md) is treated as authoritative and must not be bypassed or partially appliedRead docs/glossary/markdown-glossary.md in full.
Extract all entries that have an Update Triggers section.
Build a mapping:
{file_path} -> [list of triggers]
For each file in the mapping, evaluate whether any of its triggers match the changes_made input.
A trigger matches if:
Phase completion ALWAYS triggers:
docs/plan/plan-template.md (must be updated to mark phase done)README.md (if capabilities or getting-started changed)Build a list: files_requiring_update
For each file in files_requiring_update:
Record for each file:
status: UPDATED | MISSING_UPDATE | FILE_NOT_FOUNDevidence: What was found or not foundThis file requires special verification:
[x], COMPLETE, Done)in progress or unmarkedIf docs/plan/plan-template.md does not reflect phase completion: status = MISSING_UPDATE
For the completed phase, verify that an Architecture Decision Record exists.
Grandfather clause: ADRs numbered 001-009 are exempt from template enforcement. Template validation applies only to ADR-010 and later.
Check for ADR existence
docs/decisions/ for at least one ADR that references this phaseadr-NNN-<short-slug>.mdPhase: N/A)Validate ADR structure (ADR-010+ only)
docs/decisions/adr-template.mdStatus: AcceptedValidate ADR content
Record ADR status
CREATED_AND_VALID: ADR exists, follows template, content is accurateMISSING: No ADR exists for this phaseINVALID_FORMAT: ADR exists but does not follow template (ADR-010+ only)INCOMPLETE_CONTENT: ADR exists but decisions/constraints are not grounded in codeExamples that PASS:
Examples that FAIL:
For the phase under audit:
Identify the expected validation script(s)
scripts/validate_* for a script corresponding to the phaseVerify the script(s) exist
Verify the script(s) have been executed successfully
Record validation status:
VALIDATED: Script exists and was executed successfullyNOT_EXECUTED: Script exists but was not runSCRIPT_MISSING: No validation script found for behavioral phaseEXEMPT: Phase is non-behavioral (documentation-only)A phase audit MUST return FAIL if validation scripts were not executed.
Produce a structured report in the following format:
## Phase Audit Report
**Phase:** {phase_number}
**Description:** {phase_description}
**Audit Time:** {timestamp}
### Changes Declared
{bulleted list of changes_made}
### Files Requiring Update
{bulleted list of files_requiring_update with trigger reason}
### Documentation Audit Results
| File | Status | Evidence |
|------|--------|----------|
| ... | UPDATED / MISSING_UPDATE / FILE_NOT_FOUND | ... |
### ADR Audit Results
| Check | Status | Evidence |
|-------|--------|----------|
| ADR Exists | YES / NO | {filename or "not found"} |
| Follows Template | YES / NO | {missing sections if any} |
| Content Valid | YES / NO | {ungrounded claims if any} |
| **ADR Status** | {CREATED_AND_VALID / MISSING / INVALID_FORMAT / INCOMPLETE_CONTENT} | |
### Validation Audit Results
| Check | Status | Evidence |
|-------|--------|----------|
| Script Exists | YES / NO | {script path or "not found"} |
| Script Executed | YES / NO | {execution evidence} |
| **Validation Status** | {VALIDATED / NOT_EXECUTED / SCRIPT_MISSING / EXEMPT} | |
### Verdict
**{PASS | FAIL}**
{If FAIL: list specific remediation actions required}
PASS if and only if:
files_requiring_update have status = UPDATEDCREATED_AND_VALIDVALIDATED or EXEMPTFAIL if ANY of the following:
status = MISSING_UPDATE or status = FILE_NOT_FOUNDMISSING, INVALID_FORMAT, or INCOMPLETE_CONTENTNOT_EXECUTED or SCRIPT_MISSINGIf verdict is PASS, create an audit file at docs/audits/phase-NN-audit.md containing:
# Phase NN Audit Report
| Field | Value |
|-------|-------|
| Phase | NN |
| Description | {phase_description} |
| Git SHA | {current_commit_sha} |
| Date | {YYYY-MM-DD} |
| Verdict | **PASS** |
## Validation Scripts
| Script | Result |
|--------|--------|
| `scripts/validate_xxx.sh` | N/N passed |
## ADR
| Field | Value |
|-------|-------|
| Path | `docs/decisions/adr-NNN-xxx.md` |
| Status | Accepted |
## Documentation Updates
| File | Trigger | Updated |
|------|---------|---------|
| ... | ... | Yes |
## Auditor
Claude (automated phase audit)
This file is required. CI will fail if a phase is marked COMPLETE without a corresponding audit file.
All of the following must be true:
docs/plan/plan-template.md reflects the phase as completedocs/decisions/docs/decisions/adr-template.mddocs/audits/phase-NN-audit.mdAny of the following:
docs/plan/plan-template.md does not mark the phase completeThe skill MUST output:
VERDICT: PASS or VERDICT: FAILdocs/audits/phase-NN-audit.mdInputs:
phase_number: "1"
phase_description: "Database foundation with Alembic migrations"
changes_made:
- Added PostgreSQL schema for directives table
- Created Alembic migration infrastructure
- Added SQLAlchemy models in src/infra/models/
VERDICT: FAIL
Required actions before marking Phase 1 complete:
1. Update docs/models.md to document the directives table schema
2. Update docs/architecture.md to reflect the new database layer
3. Mark Phase 1 as complete in docs/plan/plan-template.md
4. Create ADR for Phase 1 following docs/decisions/adr-template.md
VERDICT: FAIL
ADR Status: INCOMPLETE_CONTENT
Required actions before marking Phase 3 complete:
1. ADR-006 is missing "Alternatives Considered" section
2. ADR-006 "Constraints Enforced" lists "vector store integration" but no vector code exists
3. Add validation evidence to ADR-006 Validation section
docs/glossary/markdown-glossary.md) is the sole source of truth for documentation update requirements.docs/decisions/adr-template.md) is the sole source of truth for ADR structure.The following documents are retrospective seals that document past work. They MUST NOT be treated as implementation plans or authorization to write code:
| Document | Purpose | Authorizes Code? |
|---|---|---|
docs/stubs.md | Registry of existing stubs | No |
docs/artifacts.md | Taxonomy of existing artifact types | No |
docs/contracts.md | Completeness status of existing interfaces | No |
docs/decisions/*.md (ADRs) | Decision justification | No |
docs/glossary/*.md | Routing & enforcement rules | No |
Only docs/plan/plan-template.md authorizes implementation work.
If Claude attempts to proceed with code changes based on any of the above documents
without an approved entry in docs/plan/plan-template.md, the audit MUST FAIL.
When auditing a phase, verify:
docs/plan/plan-template.mdThis skill is bound to CLAUDE.md as a mandatory pre-completion check.
Claude must refuse to mark a phase complete if this audit returns FAIL.
Note on enforcement mechanism: This enforcement currently relies on Claude's compliance with CLAUDE.md directives. Future automation (CI hooks, git checks) may formalize this into machinery. Until then, the audit is convention-based but mandatory.
When a phase audit passes:
A PASS verdict is an explicit grant of execution authority. Claude should complete all phase work—including documentation updates, ADR creation, and implementation-plan marking—without waiting for additional confirmation.