feat(cli): skillforge audit <dir> — fleet security + quality scan - #21
Conversation
|
Warning Review limit reached
More reviews will be available in 56 minutes and 15 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughThis PR introduces a fleet security and quality auditing system for skillforge. It adds an ChangesAudit System Implementation
Sequence DiagramsequenceDiagram
participant User
participant CLI
participant auditSkills as auditSkills Function
participant FileSystem
User->>CLI: skillforge audit [--from dir] [--severity level] [--json]
CLI->>auditSkills: call with fromDir, severityFilter
auditSkills->>FileSystem: validate directory and list skills
loop for each skill
auditSkills->>FileSystem: read SKILL.md, stat files, walk recursively
FileSystem-->>auditSkills: file metadata and content
auditSkills->>auditSkills: emit findings (security/quality rules)
end
auditSkills->>auditSkills: filter by severity, compute counts
auditSkills-->>CLI: return AuditReport
CLI->>CLI: format as JSON or human-readable
CLI-->>User: print report and exit (0 or 1 or 2)
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Walks every skill directory at the top level of `--from <dir>` (default `~/.claude/skills/`) and emits one structured report covering: security/embedded-binary error >1MB non-text file security/shell-shebang warning #!/bin/sh|bash|zsh at top of file security/exec-bit warning file has exec bit set quality/todo-marker info SKILL.md body still says TODO/FIXME quality/missing-examples info no `## Examples` section quality/vague-description warning description <40 chars or contains TODO `--severity error|warning|info` filters output. `--json` emits the full structured `AuditReport`. Exit 0 if zero errors, 1 if any error — drops straight into CI to fail a release that smuggled a binary or a half- finished description. Composition over refactor — doesn't import internals of validate/lint/ pack/install/cat/inspect. TDD-first per §17 of the rulebook: Red: Error: Failed to load url ./audit.js — Does the file exist? Green: Test Files 1 passed (1) · Tests 11 passed (11) Gates: typecheck clean, biome clean (3 auto-fixes), vitest 192/192 (181 baseline + 11 new), tsup ESM+DTS build success. Co-authored-by: Aditya-Chilka <197743688+Aditya-Chilka@users.noreply.github.com>
What
skillforge audit [dir]— fleet security + quality scan across every skill directory at the top level of--from <dir>(default~/.claude/skills/). One report, one exit code, drops into CI.Rules
Six built-in rules, each behind a tiny guard:
security/embedded-binarysecurity/shell-shebang#!/bin/sh,#!/bin/bash,#!/usr/bin/env zsh, etc. at top of any non-SKILL.md filesecurity/exec-bitquality/vague-descriptiondescription< 40 chars or still says TODOquality/missing-examples## Examplessectionquality/todo-markerCLI
Exit 0 if zero errors, 1 if any error. Warnings + info don't affect the exit code.
TDD-first (§17 of the rulebook)
11 new tests covering: empty dir, clean skill, each rule individually,
severityFilter, multi-skill aggregation, non-directory error, JSON shape.Test plan
pnpm installnpx tsc --noEmitbiome check src--fix --unsafe)vitest runtsup(ESM + DTS build)Composition discipline
No imports from
validate.ts/lint.ts/pack.ts/install.ts/cat.ts/inspect.tsinternals. Composition over refactor — the rule walker is independent and adding a new rule is a small additive change.Declaration of AI-Tools / LLMs usage
Summary by CodeRabbit
skillforge auditcommand to scan skill directories for security and quality issues--severityfiltering and--jsonoutput format