Audit Command
Args: $ARGUMENTS (optional: target path, or "list", "targets", "stats")
Run
node scripts/audit-tracker.cjs $ARGUMENTS
Workflow
Read .claude/rules/auditing.md for the complete 8-dimension audit protocol.
Default Behavior (no args)
- •Run
node scripts/audit-tracker.cjsto get the queue - •Immediately propose the top recommendation with a brief rationale
- •Ask ONE question: "Audit [target]?" with options: Yes / Pick different target
- •On confirmation, claim and begin the audit
Minimize interaction. User runs /audit, you propose a target, they say go, you audit.
With Target Specified
If user provides a target (e.g., /audit features/compose), skip proposal and begin immediately after claiming.
Large Module Protection
Modules with >30 files or >3 sub-features cannot be audited as a single unit. The script will refuse and show sub-features to audit instead.
Example: features/create (521 files, 6 sub-features) -> audit features/create/assemble, features/create/generate, etc. instead.
If the claim command shows "MODULE TOO LARGE FOR SINGLE AUDIT":
- •Pick one of the listed sub-features
- •Claim and audit that sub-feature
- •Repeat for other sub-features as needed
This ensures audits are thorough and meaningful - you can't claim to have audited 500+ files in one pass.
The Audit Process
- •Claim the target:
node scripts/audit-tracker.cjs claim "<target>" - •Read the entry component and map the component tree
- •Grade across 8 dimensions (see auditing.md):
- •Architecture, Code Quality, Svelte 5 Compliance, Accessibility
- •UX States, UI Consistency, Performance, Security
- •Present the scorecard with grades and prioritized issues
- •Immediately record grades (no confirmation needed):
node scripts/audit-tracker.cjs record "<target>" --grades "A+,A,A,B,A,A,A+,A" --notes "..." - •If fixes needed: Present the fix plan and ask "Ready to bring this to A+?" with options to proceed or defer
- •If no fixes needed (A+ across the board): Ask "Shall I audit the next feature?"
Useful Commands
# See what needs auditing node scripts/audit-tracker.cjs # List all recorded audits node scripts/audit-tracker.cjs list # List all auditable targets node scripts/audit-tracker.cjs targets # Check status of a specific target node scripts/audit-tracker.cjs status features/compose # Show coverage stats node scripts/audit-tracker.cjs stats # Claim a target (prevents parallel agent conflicts) node scripts/audit-tracker.cjs claim features/compose # Force claim a large module (not recommended - prefer sub-features) node scripts/audit-tracker.cjs claim features/create --force # Record audit results (order: Arch, Code, Svelte5, A11y, UX, UI, Perf, Security) node scripts/audit-tracker.cjs record features/compose --grades "A+,A,A,B,A,A,A+,A" # Release a claim without recording (if audit abandoned) node scripts/audit-tracker.cjs release features/compose
Post-Audit Workflow
After recording an audit:
- •Recording auto-releases the claim - no manual release needed
- •If you made code changes, offer to commit them:
- •Use
/commitor ask user if they want changes committed - •Group audit fixes into a single commit with descriptive message
- •Use
- •Summary: Provide a brief summary of grades and key changes made
Important Notes
- •Always claim before auditing to prevent conflicts with parallel agents
- •Claims use file locking to prevent race conditions between parallel agents
- •Large modules (>30 files or >3 sub-features) must be audited as sub-features - the script will refuse to claim them
- •Grade order for
--gradesflag: Architecture, Code Quality, Svelte 5, Accessibility, UX States, UI Consistency, Performance, Security - •Targets are auto-browseed from
src/lib/features/andsrc/lib/shared/ - •Sub-features are auto-browseed within large modules (e.g.,
create/assemble,create/generate) - •Audits older than 30 days are flagged as stale
- •Claims expire after 4 hours if not released
- •The goal is A+ across all dimensions