Audit prompt artifacts (skills, commands, agents) for anti-patterns and quality issues
Analyzes prompt artifacts for anti-patterns, token waste, and structural issues.
/plugin marketplace add bryonjacob/aug/plugin install aug-core@augAnalyze Claude Code prompt artifacts (skills, commands, agents) for anti-patterns, tracking changes to avoid re-scanning unchanged files.
/promptaudit # Audit changed files only
/promptaudit --init # Bootstrap .promptaudit.yaml only
/promptaudit --all # Audit all files regardless of changes
/promptaudit path/to/file.md # Audit specific file
/promptaudit --dry-run # Report only, no state updates
YAGNI Violations:
Token Waste:
Boundary Violations:
Structural Issues:
If missing and not --init:
/promptaudit --init to bootstrap."If --init:
.promptaudit.yaml with:
audits: sectionversion: 1If exists:
Default (no --all):
# Find all prompt artifact files
find . -path "*/skills/*.md" -o -path "*/commands/*.md" -o -path "*/agents/*.md" | \
grep -v CLAUDE.md | grep -v README.md
For each file, check if audit needed:
# Get last audited commit from .promptaudit.yaml
last_commit=$(yq ".audits[\"$file\"].commit" .promptaudit.yaml)
# Check if file changed since then
if git diff --quiet "$last_commit"..HEAD -- "$file" 2>/dev/null; then
# No changes, skip
else
# Changed or new, needs audit
fi
With --all:
With specific path:
For each file needing audit:
Read the file content.
Analyze for anti-patterns:
YAGNI Check:
Token Waste Check:
Boundary Check (based on file type):
Skills (*/skills/*.md):
Commands (*/commands/*.md):
Agents (*/agents/*.md):
Structural Check:
name: and description:just refs logic)Record findings:
Prompt Artifact Audit Report
============================
Scanned: N files (M skipped - unchanged)
Issues Found:
path/to/skill.md:
⚠ Token waste: Lines 45-60 repeat information from lines 10-25
⚠ YAGNI: Parameter `--verbose` described but never referenced
path/to/command.md:
❌ Boundary violation: Embeds domain knowledge (lines 30-80)
→ Extract to skill, reference from command
⚠ Structural: Missing `description:` in frontmatter
path/to/agent.md:
⚠ Boundary: Hardcoded decision at line 45
→ Should gather context and decide dynamically
Clean Files: K files passed all checks
✓ path/to/good-skill.md
✓ path/to/good-command.md
... (list all)
Summary:
Errors: E (must fix)
Warnings: W (consider fixing)
Clean: K
If not --dry-run:
Update audit records for scanned files:
version: 1
audits:
path/to/skill.md:
commit: abc123
date: 2025-01-06
status: warning # or: clean, error
issues: 2
path/to/command.md:
commit: abc123
date: 2025-01-06
status: error
issues: 1
# ... all audited files
If --dry-run:
Exit code 0: No errors found (warnings OK) Exit code 1: Errors found that must be fixed
$ /promptaudit --init
Creating .promptaudit.yaml...
Found 45 prompt artifact files:
Skills: 28
Commands: 15
Agents: 2
Initialized audit tracking at commit abc123
Next: Run '/promptaudit' to audit changed files
$ /promptaudit
Prompt Artifact Audit Report
============================
Scanned: 3 files (42 skipped - unchanged)
Issues Found:
aug-core/commands/new-command.md:
⚠ Token waste: Description section could be 50% shorter
⚠ Structural: Example code block not syntax-highlighted
Clean Files: 2 files passed all checks
✓ aug-dev/skills/updated-skill/SKILL.md
✓ aug-core/agents/user-standin.md
Summary:
Errors: 0
Warnings: 2
Clean: 2
Updated .promptaudit.yaml
$ /promptaudit --all
Prompt Artifact Audit Report
============================
Scanned: 45 files
Issues Found:
... (detailed list)
Summary:
Errors: 1
Warnings: 8
Clean: 36
Exit code: 1 (errors found)
--init to bootstrap tracking.promptaudit.yaml to git for team consistency