一键导入
self-audit
Use when sessions have committed code and you need to check compliance with CLAUDE.md conventions, log entry standards, and experiment validation
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use when sessions have committed code and you need to check compliance with CLAUDE.md conventions, log entry standards, and experiment validation
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | self-audit |
| description | Use when sessions have committed code and you need to check compliance with CLAUDE.md conventions, log entry standards, and experiment validation |
| complexity | medium |
| model-minimum | glm-5 |
| disable-model-invocation | false |
| allowed-tools | ["Read","Grep","Glob","Bash"] |
| argument-hint | [time range, e.g. '24h' or '3d', or 'last-session'] |
Audit recent session work for compliance with CLAUDE.md conventions. The argument specifies the scope: last-session (default), 24h, 3d, or 7d. Reads recent commits and diffs to identify convention violations.
/self-audit when you want to check whether recent sessions followed CLAUDE.md conventions (log entries, commit discipline, experiment structure, task tags). Works on committed history.pixi run validate when you want to check experiment YAML frontmatter and structural validity. Validate checks schema; self-audit checks behavioral conventions./review when you want to check whether specific findings are valid or metric computations are meaningful. /review checks claim quality and methodology; /self-audit checks process compliance and workflow adherence.This skill checks conventions that are NOT already enforced by code:
| Convention | Enforced by code? | Self-audit checks? |
|---|---|---|
| EXPERIMENT.md frontmatter schema | Yes (pixi run validate) | No — defer to validator |
| Session footer presence | Yes (verify.ts) | No — defer to verifier |
| Orphaned files | Yes (verify.ts, auto-commit.ts) | No — defer to verifier |
| Log entry per session | Partially (verify.ts checks modified READMEs) | Yes — deeper check |
| Inline logging (discovery → file) | No | Yes |
| Cross-referencing (log entries → experiment dirs) | No | Yes |
| Findings provenance (script or arithmetic) | Yes (verify.ts) | No — defer to verifier |
Task lifecycle tags ([in-progress] cleared) | Yes (verify.ts) | No — defer to verifier |
| Decision debt (implicit choices) | No | Yes |
| Budget check before resource work | No | Yes |
| Experiment record created for non-trivial work | No | Yes |
| Archive threshold (README log >5 entries) | No | Yes |
| Partial completion anti-pattern | No | Yes |
Parse the time-range argument:
last-session (default): examine the most recent session's commits only24h, 3d, 7d: examine all commits in that time window# Get commits in scope
git log --oneline --since="<time>" --format="%H %s"
For each commit in scope, collect the diff:
git diff <commit>^..<commit> --stat
git diff <commit>^..<commit> -- '*.md'
For each session (identified by session footer blocks in README log entries), check:
Check 1: Log entry completeness
Check 2: Inline logging discipline
Check 3: Findings provenance
Check 4: Task lifecycle hygiene
TASKS.md files[in-progress: <date>] where the date is >3 days old (stale)[x] with "(partial)" in description (anti-pattern per CLAUDE.md)Done when: conditions that appear unverifiable[approval-needed] tags: For tasks with [approval-needed], search APPROVAL_QUEUE.md for resolved approvals matching the task text. If found, the tag should be [approved: YYYY-MM-DD] instead. This detects the gap where approvals are granted but task tags are not updated.Check 5: Budget compliance
budget.yaml, check whether resource-consuming work in the diff period was preceded by a ledger entryledger.yaml entriesCheck 6: Experiment record coverage
experiments/Check 7: Archive thresholds
Check 8: Decision debt
Check 9: Cross-referencing discipline
experiments/foo/analysis.md" or "See experiments/bar/EXPERIMENT.md")Produce a structured compliance report:
## Convention Compliance Report — YYYY-MM-DD
Scope: <time range>
Sessions audited: <count>
Commits examined: <count>
### Summary
| Check | Status | Violations |
|-------|--------|------------|
| Log entry completeness | PASS/WARN/FAIL | <count> |
| Inline logging discipline | PASS/WARN/FAIL | <count> |
| Findings provenance | PASS/WARN/FAIL | <count> |
| Task lifecycle hygiene | PASS/WARN/FAIL | <count> |
| Budget compliance | PASS/WARN/FAIL | <count> |
| Experiment record coverage | PASS/WARN/FAIL | <count> |
| Archive thresholds | PASS/WARN/FAIL | <count> |
| Decision debt | PASS/WARN/FAIL | <count> |
| Cross-referencing discipline | PASS/WARN/FAIL | <count> |
Overall: <X/9 passing>
### Violations
#### <Check name>
- **Violation**: <what was wrong>
**Location**: <file:line or commit hash>
**Convention**: <which CLAUDE.md section>
**Severity**: low | medium | high
**Suggested fix**: <concrete action>
### Trends
<If auditing >24h, note patterns: are violations improving or recurring?>
Save the report to projects/akari/diagnosis/compliance-audit-<date>.md.
For high-severity violations, create tasks in the relevant project's TASKS.md with Priority: high and reference the audit report.
Follow docs/sops/commit-workflow.md. Commit message: self-audit: convention compliance report <date>
Use when a file or module is too large, responsibilities are tangled, or a cross-cutting redesign is needed
Use when literature notes exist and need citation verification, or before publishing any artifact that cites literature
Use at the end of a work session to embed learnings into conventions. Simplified for models with lower reasoning capacity.
Use at the end of a work session, or when accumulated findings need to be embedded into conventions, skills, or patterns
Use when the Slack bot needs to handle an operational action like launching an experiment, querying status, or processing approvals
Use when a plan, finding, or design needs adversarial review before committing to it