audit-adr
ADR audit methodology — judges one ADR against the ADR evidence model, covering declaration form, atemporal voice, and per-rule tag validity.
- License 许可
- MIT
- 最近更新
- 2026-11-14
- Stars
- ★ 1
- Forks
- 1
01 前言 Front Matter
- name
- audit-adr
- description
- ADR audit methodology — judges one ADR against the ADR evidence model, covering declaration form, atemporal voice, and per-rule tag validity.
- allowed-tools
- Read, Grep, Glob, {{! tool('use_skill') !}}, Bash(git branch --show-current:*), Bash(git merge-base:*), Bash(git diff:*)
- argument-hint
- <adr-file-path>
02 资源文件 2
- 参考文档references/rule-catalog.md6.0 KB
- 参考文档references/touched-text.md3.8 KB
03 SKILL.md 正文
<objective>
A verdict on one ADR against the ADR evidence model — APPROVED or REJECTED, with findings on touched text naming the section, rule, and evidence for declaration form, atemporal voice, or per-rule tag validity and assertion-type fit, and every other finding returned as filed.
</objective>
<constraints>
ARCHITECTURE BY DEFINITION.
An ADR's content is architecture — technology choices, data structures, implementation approaches. NEVER classify ADR content as product-behavior-versus-architecture; that classification is the PDR audit's concern. Audit the ADR's form, not whether its content belongs elsewhere.
ASSERTION TYPE MUST MATCH THE CLAIM.
Apply the canonical template's form. Rules directly under ## Verification, outside any group, await selection and may coexist with groups; judge their specificity, structure, voice, and consistency. A rule carries no tag, because its group heading names its verification type and its leading slug is its one name. /verify selects the verification type, then /test selects a Testing rule's assertion type. A universal claim is never scenario; a tag on a rule, a repeated slug, or a quantifier mismatch is a finding. Approval judges declaration quality and establishes no evidence result or Passing state.
ATEMPORAL VOICE.
ADRs state architecture truth. "The build emits one wheel per plugin" — not "We switched to per-plugin wheels because the monolith broke."
BINARY VERDICT.
APPROVED or REJECTED. An unavailable required inspection is a rejection with evidence naming the blocked inspection; it never becomes an approval through an unevaluated row.
LANGUAGE COMPOSITION BOUNDARY.
Language-specific ADR concerns — testability-in-Verification (dependency injection, no-mocking), execution-level accuracy — are composed from /audit-<lang>-architecture in Step 5b. The language skill judges only those concerns; this skill owns declaration form, atemporal voice, and tag validity from the canonical template.
- NEVER modify the ADR under audit or any other file — this audit produces a verdict, never a fix or a commit.
- ALWAYS derive the valid section set from the canonical ADR template before judging structure — never from memory.
- ALWAYS name the section, the violated rule, and the evidence in every
blockingfinding — the author repairs from the finding alone, and an unanchored finding leaves nothing to repair. - NEVER issue a finding the cited rule or canonical template does not support — drop an unbacked finding rather than reject the ADR for it.
- NEVER reject on text the changeset leaves unchanged and does not invalidate — return that finding as
filed, and NEVER raise a recorded finding's severity or let afiledfinding start to reject unless the run names a changed basis.${CLAUDE_SKILL_DIR}/references/touched-text.mddefines touched text, the finding key, and thefiledform;${CLAUDE_SKILL_DIR}/references/rule-catalog.mddefines the rule identifiers.
</constraints>
<audit_workflow>
<step name="load_context">
Step 1: Load context
Bind the required ADR path, preserving spaces within it: $ARGUMENTS supplies it when that argument is non-empty; when it is empty, the path is the one the request text carries, and the empty substitution binds nothing. If the request carries no path, run git branch --show-current for metadata and emit the <verdict_format> JSON with target: "", overall: "REJECTED", and all three native rows marked FAIL. Each row carries a missing-target finding with severity blocking, unit input, locations ["input"], observed naming the absent target, and expected and message naming the required ADR path. Stop before context loading or artifact inspection.
When the live <PRODUCT_TREE_FOUNDATION> marker is absent or lacks Template root: Use skill product-tree:understand. Read decisions/decision-name.adr.md beneath that marker's resolved absolute template directory. The template remains owned by /understand. Then, on the directory containing the ADR: Use skill product-tree:contextualize. Run git branch --show-current to populate verdict metadata without granting broader shell authority.
The input is the ADR path alone. Derive its governing node from the containing directory, using canonical spx/ for a product-root ADR. Resolve the committed changeset from the checkout as it stands: run git merge-base HEAD origin/HEAD for the base, then git diff --name-only <base> HEAD for the changed paths. Use that context with the ADR's governed declarations and linked implementation surfaces in Step 5b; no supplied language classification is required.
Do not proceed without the canonical ADR template content and live <PRODUCT_TREE_FOUNDATION> and <PRODUCT_TREE_CONTEXT> markers.
</step>
<step name="read_adr">
Step 2: Read the ADR
Read the ADR under audit. Identify its parts: the optional DEFINES lines, the CONSTRAINS opening, and Verification.
Resolve the touched text of the ADR as ${CLAUDE_SKILL_DIR}/references/touched-text.md states, so Steps 3 to 5b can classify each finding.
</step>
<step name="audit_structure">
Step 3: Declaration form
Use the canonical ADR template guidance loaded in Step 1 to derive the form in full — never from memory or a transcribed copy. A finding that contradicts the canonical template is unbacked: drop it rather than rejecting the ADR. If the template guidance cannot be loaded, reject with template-missing and name the blocked read.
Verify the ADR opens with optional DEFINES lines and then the CONSTRAINS, TO, and SO THAT paragraph, writes each mapping rule as its own ### Mapping: <slug> subsection holding one sentence and a table, keeps each group to at most ten rules, states its invariants as rules of a Property group, holds no text outside its opening, a rule, or a table, and has a ## Verification section.
Verify the SO THAT line names a property of the build that the TO mechanism yields, never an audience and never a restatement of the mechanism.
No opening, or no Verification section → blocking — "missing-section." An opening, mapping subsection, group, or text that breaks the template form → blocking — "declaration-form." A SO THAT line that names an audience or restates the mechanism → blocking — "so-that-property."
</step>
<step name="audit_voice">
Step 4: Atemporal voice
Check the opening and EVERY rule for temporal language:
| Temporal (blocking) | Atemporal (correct) |
|---|---|
| "We decided to use X because Y broke" | "X governs Z" |
| "Currently the build does X" | "The build does X" |
| "After profiling, we added caching" | "Caching reduces latency for Z" |
Any temporal language in the opening or a rule → blocking — "temporal-voice."
</step>
<step name="audit_tag_validity">
Step 5: Per-rule tag validity and assertion-type fit
Read each rule's placement before judging it. A rule directly under ## Verification, outside any group, has the canonical authoring form. For every such rule, identify its subject, the condition it constrains, and a concrete observation that would violate it. Reject a vague, ambiguous, or unfalsifiable rule with invalid-draft-rule in the tag-validity row, mark that row FAIL, and quote the rule with the missing or ambiguous criterion. For example, ALWAYS: improve quality fails because it names no observable condition. Check each draft rule against the decision statement and governing decisions; a contradiction also produces invalid-draft-rule, citing both conflicting declarations. Select no evidence type during these checks.
A rule carries no tag, because its group heading names its verification type and its leading slug is its one name. When a group heading names an assertion type: Use skill product-tree:test-evidence-standards. Load its assertion-type litmus. Apply that reference and the loaded foundation's assertion-type definitions to each rule's claim and its group's type. If the required reference cannot load, emit a blocking test-standards-unavailable finding and a failed tag-validity row. Judge declaration compatibility only; evidence completeness belongs to evidence auditing. Never invoke the mutating /test authoring workflow, select a replacement group, or change the ADR during this audit.
For each rule:
- It carries no tag and its leading slug repeats nowhere in the ADR.
- Under a group named for an assertion type, the declared type is compatible with the claim's quantifier and evidence shape under the loaded foundation and shared assertion-type litmus. A universal claim cannot sit in a
### Scenariogroup. Reject a declared type whose required domain or oracle contradicts the claim, citing the claim and the loaded criterion; do not choose among compatible types or require executable evidence for a declaration.
A rule that carries a tag, or whose slug repeats within the ADR → blocking — "invalid-tag." An assertion type that contradicts the claim's shape → blocking — "assertion-type-mismatch."
</step>
<step name="compose_language">
Step 5b: Compose language-specific architecture concerns
This skill owns section structure, atemporal voice, and tag validity from the canonical template. Language-specific architecture concerns — dependency injection, no-mocking, execution-level accuracy — are owned by the language audit skill, not by this one.
Classify the ADR from its governed implementation surface and the committed changeset established in Step 1. When the decision constrains no implementation language, classify it as language-neutral and skip composition. Otherwise preserve every implementation-language partition the decision constrains, including cross-language decisions; the repository's predominant language never narrows that set.
For every discovered partition: Use skill {lang}:audit-{lang}-architecture. Pass the ADR path. The language skill judges only language-specific concerns and never re-judges section structure, voice, or tags. When a language-specific ADR has no reliable partition or the required skill cannot load, append a FAIL row named language-routing-unavailable or language-skill-unavailable with a blocking finding.
Before consuming a composed result, validate it against the invoked skill's declared verdict contract: the schema and skill identity, matching target, every required concern row exactly once, allowed statuses, required finding fields, explanations for NOT_APPLICABLE, and agreement between the rows and overall result. An absent, malformed, incomplete, mismatched, or inconsistent result produces a FAIL row and blocking finding named language-result-invalid, identifying the failed contract check; accept no partial rows from that result. This boundary validates returned structure without repeating the language audit's judgment.
Append only validated rows. Qualify each composed row name with its language to preserve distinct concerns across partitions. Map its findings to this verdict's fields: retain the rule, message, observed, and expected evidence, use the child location or file as a locations entry, and mark findings that reject the ADR as blocking. A composed FAIL always rejects the ADR; no omitted row or empty result counts as passing coverage.
One case is not a composition failure. When the governed context establishes that the changeset itself ships the ADR's language plugin, unpublished and uninstalled in this session, no audit-<lang>-architecture skill can exist yet. Judge the decision directly against the skill files its rules name and the cross-language decisions, and record a row named language-skill-unpublished as NOT_APPLICABLE with the evidence establishing that case. An absent installed skill alone never establishes unpublished status.
</step>
<step name="verdict">
Step 6: Issue verdict
Classify every finding, native or composed, per ${CLAUDE_SKILL_DIR}/references/touched-text.md: a finding on touched text keeps severity blocking; every other finding becomes filed. If any row is FAIL through a blocking finding, issue REJECTED; otherwise issue APPROVED, whatever filed findings the rows carry.
</step>
</audit_workflow>
<verdict_format>
Emit the verdict as a single JSON object. This JSON is the skill's entire output; never a prose or markdown verdict.
The overall is APPROVED iff every native and composed row is PASS or NOT_APPLICABLE; otherwise it is REJECTED. A row holding only filed findings is PASS. Every NOT_APPLICABLE row explains why its concern does not apply. A required property that cannot be evaluated is a FAIL row with a blocking finding naming the unavailable inspection. Findings use the audit-run severities blocking or filed; this binary ADR gate emits blocking for every finding on touched text, which rejects the ADR, and filed for every finding outside touched text, which fails no row.
{
"schema_version": 1,
"skill": "audit-adr",
"target": "<adr-file-path>",
"overall": "APPROVED | REJECTED",
"rows": [
{ "name": "section-structure", "status": "PASS | FAIL | NOT_APPLICABLE", "explanation": "<required when NOT_APPLICABLE>", "findings": [] },
{ "name": "atemporal-voice", "status": "PASS | FAIL | NOT_APPLICABLE", "explanation": "<required when NOT_APPLICABLE>", "findings": [] },
{ "name": "tag-validity", "status": "PASS | FAIL | NOT_APPLICABLE", "explanation": "<required when NOT_APPLICABLE>", "findings": [] }
],
"metadata": { "branch": "<branch>" }
}
Each finding is keyed <adr-file-path>:<rule-id> and carries rule (the <rule-id>), severity: "blocking | filed", locations (every location in the ADR where that rule is violated), message, observed, and expected; a filed finding additionally carries key, baseRefEvidence, and issuesEntry (path, heading). Every <rule-id> comes from ${CLAUDE_SKILL_DIR}/references/rule-catalog.md; a validated composed finding retains the rule identifier of the invoked skill's own catalog. A finding names no identifier outside those catalogs.
</verdict_format>
<failure_modes>
Failure 1: Imported the PDR content gate into an ADR audit
Claude flagged "uses PostgreSQL with row-level locking" as architecture content that does not belong — in an ADR. An ADR's content is architecture by definition; there is no product-versus-architecture classification to run. The PDR audit's content gate has no place here.
How to avoid: The ADR audit checks form — structure, voice, tag validity. Content classification is the PDR audit's concern only.
Failure 2: Passed a universal rule tagged scenario
Claude saw a universal ALWAYS/NEVER rule in a ### Scenario group and passed it because the group named one of the five assertion types. A scenario proves one case; it cannot establish a claim about every case, so the assertion ships unverified — phantom green. The quantifier mismatch is a deterministic error, not a matter of taste.
How to avoid: Step 5 verifies the assertion type fits the claim's shape per the /test router. Reject a universal in a ### Scenario group (and any type the router would not produce for the claim). The one line the audit does not cross is relitigating a choice the router leaves open between equally-valid types — that, and only that, is /test's to decide.
Failure 3: Applied group requirements to authoring declarations
Claude rejected ungrouped authoring rules because the grouped-form requirement was applied before verification selection. Derive the form from the artifact and canonical template. Judge every draft rule, preserve the grouped-rule checks, and never interpret declaration approval as evidence completeness.
</failure_modes>
<success_criteria>
The verdict is sound when:
- Every ADR rule was judged with none skipped — declaration form, atemporal voice, and per-rule tag absence, slug uniqueness and assertion-type fit; when a language is in scope, the composed
/audit-<lang>-architecturerows are judged too (coverage-complete). - The verdict states one
APPROVEDorREJECTEDoverall determination, every native and composed row carryingPASS,FAIL, or explainedNOT_APPLICABLE, with no rule left unevaluated. - Each
blockingfinding lies on touched text, and every finding outside touched text appears asfiledwith its key,baseRefEvidence, andissuesEntry. - Each
blockingfinding is falsifiable: it names the section, the violated rule, and the evidence — the missing section, the broken form, the temporal phrase, the tag or repeated slug, or the mismatched assertion type. - The same ADR yields the same verdict.
</success_criteria>
04 同仓库更多 Skills
plugin
暂无简介
sanitize-powerpoint
ALWAYS invoke this skill when sanitizing, cleaning up, auditing, or aligning a PowerPoint (.pptx) deck — slide-master and layout structure, layout type attributes, stray fonts, non-theme colors, or layout naming. NEVER hand-edit pptx XML without this skill.
draw-excalidraw
ALWAYS invoke this skill when creating Excalidraw diagrams, visualizing workflows, architectures, or concepts. NEVER generate Excalidraw JSON without this skill.
typescript-test-standards
TypeScript test standards enforced across all skills. Loaded by other skills, not invoked directly.
typescript-code-standards
TypeScript code standards enforced across all skills. Loaded by other skills, not invoked directly.
typescript-architecture-standards
TypeScript ADR conventions enforced across architect and auditor skills. Loaded by other skills, not invoked directly.