feat(cli): skillforge inspect <path> — one-shot validation + lint + summary#14
Conversation
|
Warning Review limit reached
Your plan currently allows 1 review/hour. Refill in 57 minutes and 48 seconds. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more review capacity refills, 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 have higher rate limits than trial, open-source, and free plans. In all cases, review capacity refills continuously over time. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (7)
✨ 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 |
What
skillforge inspect <path>— one-shot diagnostic report for a SKILL.md. Eighth piece of the authoring workflow afterinit,validate,lint,pack,install,update, andformat. Where the other commands do one thing,inspectreads — it rolls validation, linting, frontmatter parsing, body stats, and (for directory inputs) the file inventory into one structured report.Why
Users today have to run
validate, thenlint, thencat SKILL.md | headand squint at the frontmatter to understand a skill's shape.inspectrolls those into one structured view — and exposes the same data as a JSON object so CI summaries can be one HTTP-friendly call.Result shape
Semantics
validateSkill— no reimplementationlintSkill— no reimplementationbody.sections##) headings only, document order, fenced-code-awareattachedFilespack's exact exclusion rules (.git,node_modules,.DS_Store,*.log, dotfiles)summary.okvalidation.ok && lintErrors === 0(warnings don't fail the summary)inspectnever writesCode-fence-aware section parsing
The
## headingsextractor tracks fenced-code-block state so a## Not A Sectioninside amdblock doesn't pollute the section list. Dedicated test pins the behaviour.Reused exclusion rule
pack.tsexported a new helpershouldExcludeEntry(name)— a minimal extraction of the existing privateshouldExclude()function, withpacknow delegating to it. No behaviour change inpack.inspectreuses it so the two commands agree on which files belong to the skill.CLI output taste
SUMMARYline with the green check or red cross plus the counts.Exit codes
summary.oktrue (validation passed, no lint errors)Same posture as
validate/lint.Surface
src/inspect.ts—inspectSkill()plus internal helpers (path resolution, code-fence-aware section extraction, body stats, attached-file walker). ~205 LOC. No new runtime deps; composes the existingvalidateSkill/lintSkill/shouldExcludeEntryAPIs.src/inspect.test.ts— 10 tests covering happy SKILL.md, invalid frontmatter, lint TODO error, directory mode + exclusion, level-2 section extraction, fenced-code-block section masking, exact word count, file-not-found, directory-without-SKILL.md, and JSON shape stability.src/cli.ts— newinspectsubcommand with--jsonflag and the human-readableprintInspectReport()formatter.src/index.ts— re-exportsinspectSkill,InspectOptions,InspectResult,InspectBodyStats,InspectSummary.src/pack.ts— exports a newshouldExcludeEntry(name)helper and delegates the existing private function to it. No behavioural change (verified by the unchanged pack tests).README.md— new### skillforge inspect <path>section; status line updated.CHANGELOG.md—Unreleasedentry.Gates
pnpm installpnpm typecheck(tsc --noEmit)pnpm lint(biome)pnpm test(vitest)pnpm build(tsup)./dist/cli.js init demo && ./dist/cli.js inspect demo./dist/cli.js inspect demo --jsonOn
inspectvsvalidate/lintvalidateis the schema gate.lintis the style critic.inspectis the reader: it doesn't add new rules — it joins what the other commands already know into one report a human can scan in a second. The three compose; you can still run them individually.Declaration of AI-Tools / LLMs usage