@fr-e-d/skill-usage-audit
BScan all artefacts (epics, stories, PRDs) for Base Rule #2 compliance — verify that every artefact declares skills_invoked and related_decs in frontmatter. Produces an audit report with pass/fail per artefact and overall compliance rate.
Install
agr install @fr-e-d/skill-usage-audit --target claudeWrites 1 file into .claude/skills/, pinned to git-80f5e41e.
- .claude/skills/skill-usage-audit/SKILL.md
Document
name: skill-usage-audit description: Scan all artefacts (epics, stories, PRDs) for Base Rule #2 compliance — verify that every artefact declares skills_invoked and related_decs in frontmatter. Produces an audit report with pass/fail per artefact and overall compliance rate. license: ELv2 compatibility: Works with any filesystem-based AI coding agent metadata: author: gaai-framework version: "1.0" category: cross track: governance id: SKILL-CRS-028 updated_at: 2026-03-21 status: stable inputs:
- contexts/artefacts/epics/*.epic.md
- contexts/artefacts/stories/*.story.md outputs:
- skill_usage_audit_report (inline)
Skill Usage Audit
Purpose / When to Activate
Activate:
- Periodically (e.g., after a Discovery session) to verify governance compliance
- Before a release or milestone to audit artefact quality
- When trust in agent compliance needs verification
- On demand by the human (
/gaai-statusor direct invocation)
This skill enforces Base Rule #2 (Skill-first) by scanning artefacts for the skills_invoked attestation field. It detects artefacts that were produced from cached knowledge without reading the corresponding skill file.
Process
-
Scan all Epic files at
contexts/artefacts/epics/*.epic.md(exclude_template.epic.md):- Check frontmatter for
skills_invokedfield - If present: verify it includes
generate-epics - If missing: mark as FAIL
- Check frontmatter for
-
Scan all Story files at
contexts/artefacts/stories/*.story.md(exclude_template.story.md):- Check frontmatter for
skills_invokedfield - If present: verify it includes
generate-stories - If missing: mark as FAIL
- Check frontmatter for
related_decsfield - If missing: mark as FAIL (separate from skills_invoked)
- Check frontmatter for
epicfield - If missing: mark as WARN
- Check frontmatter for
-
Produce audit report with:
- Per-artefact pass/fail status
- Compliance rate:
(passing artefacts / total artefacts) × 100 - List of non-compliant artefacts for remediation
- Timestamp of audit
Outputs
Skill Usage Audit Report — {date}
Epics scanned: {count}
Stories scanned: {count}
Non-compliant artefacts:
- {id}: FAIL — missing skills_invoked
- {id}: FAIL — missing related_decs
- {id}: WARN — missing epic field
Compliance rate: {n}/{total} ({pct}%)
Verdict: CLEAN | {n} VIOLATIONS FOUND
Remediation
For each non-compliant artefact, the human or agent must:
- Read the corresponding skill file (
generate-stories/SKILL.mdorgenerate-epics/SKILL.md) - Verify the artefact content follows all process steps
- Add the missing frontmatter fields
- Commit the fix
This skill does NOT auto-fix artefacts — it reports only. Remediation is a conscious act.
Quality Checks
- Every artefact file in the scan directories is checked (no silent skips)
- Template files (
_template.*) are excluded from the scan - The report clearly distinguishes FAIL (blocking) from WARN (advisory)
- Compliance rate is computed correctly
Non-Goals
This skill must NOT:
- Auto-fix artefacts (report only — remediation is deliberate)
- Check artefact content quality (use
validate-artefactsfor that) - Scan non-artefact files (memory, decisions, patterns)
Trustgrade B
- passBody integrity
Whether the stored document is plausibly the kind of file the artifact declares, rather than something fetched by mistake.
- passType matchnot applicable to this artifact type
Whether the artifact is really the kind of thing its metadata claims it is.
- passFreshness
How long since the source repository was last pushed to.
- passPrompt injection
Scans the artifact's own text for instructions aimed at your agent rather than at you.
- warnLicenseno SPDX license detected
Whether the source repository declares an SPDX license permissive enough to redistribute.
How the grade is calculated
Each check contributes 0 points when it passes, 1 when it warns, and 2 when it fails. The total maps to a letter:
- Aevery check passed
- Bone warning
- Ctwo warnings
- Dprompt injection or body integrity failed, or three warnings
- Fone of those failed, and something else is wrong
These are automated hygiene checks, not a security audit, and not a dependency or vulnerability scan. A grade of A means nothing was flagged — not that the artifact is safe.
Versions
git-80f5e41e1f902026-07-31