Skip to content

Validation

skill-forge’s validation engine catches problems before they reach users. Run it early and often during development.

Terminal window
# Validate the skill in the current directory
skill-forge validate
# Validate a specific directory
skill-forge validate ./path/to/skill
# Verbose output with rule explanations
skill-forge validate --verbose
# JSON output for CI integration
skill-forge validate --format json

Each rule has a severity level:

LevelMeaningEffect
errorMust fix before publishingBlocks skill-forge publish
warningShould fix, but not blockingShows yellow warning
infoSuggestion for improvementShows blue hint
RuleLevelDescription
skill-md-existserrorSKILL.md must exist at skill root
skill-md-not-emptyerrorSKILL.md must have content
no-nested-skillserrorNo SKILL.md in subdirectories
references-validwarningReferences directory should exist if referenced
RuleLevelDescription
has-descriptionerrorSKILL.md must have a Description section
has-when-to-useerrorSKILL.md must have a When to Use section
has-instructionserrorSKILL.md must have an Instructions section
no-duplicate-headerswarningSection headers should be unique
no-empty-sectionswarningSections should have content
RuleLevelDescription
refs-resolveerrorAll referenced file paths must exist
no-broken-symlinkserrorNo broken symbolic links in references/
no-absolute-pathswarningUse relative paths, not absolute
no-parent-traversalwarningAvoid ../ in reference paths
RuleLevelDescription
has-readmeinfoInclude a README.md for humans
reasonable-sizewarningSKILL.md should be under 500 lines
instructions-specificinfoInstructions should have numbered steps

Add validation to your CI pipeline:

.github/workflows/validate.yml
name: Validate Skill
on: [push, pull_request]
jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
- run: npx skill-forge validate --format json

Create project-specific validation rules:

.skill-forge/rules/custom-rule.js
export default {
name: 'require-examples',
level: 'warning',
message: 'SKILL.md should include an Examples section',
check(skill) {
return skill.sections.some(s => s.title === 'Examples');
}
};