Adding a Skill (Shortest Path)
This guide summarizes the shortest path to add a new skill (skills/**/*.md) to River Review, validate it, and run it locally.
For detailed writing guidelines (Anti-patterns, Evidence, Non-goals, False positive guards, etc.), refer to pages/guides/write-a-skill.en.md.
0) Prerequisites
- Node.js (This repo uses
node --test) - Run
npm ciif dependencies are not installed
1) Create Skill from Template
- Copy
skills/_template.mdand place it under the target category directory.- Example:
skills/midstream/my-skill.md
- Example:
- Fill in the minimum YAML frontmatter (Refer to
schemas/skill.schema.jsonfor required fields).id: Unique ID (e.g.,my-skill)name: Skill namedescription: What to detect/point out (short)category: one ofcore/upstream/midstream/downstream(the primary routing key)applyTo: Glob for target files (Recommend narrowing scope initially).files/path_patternsare accepted aliases.phase: include only when backward compatibility is required (new skills only needcategory)
See pages/reference/metadata-fields.en.md for metadata details.
2) Pass Schema Validation
npm run skills:validate
If it fails, fix the fields shown in the error message (missing required, enum mismatch, etc.) and re-run.
3) Run Local Dry-run (No API)
To verify behavior first without LLM (Prioritizing reproducibility):
river run . --phase midstream --dry-run --debug --context diff,fullFile
Points:
- Skill is not selected if
applyTodoes not match changed files. - If
inputContextis set, skill is skipped if not included in--context.- If unsure, starting with
inputContext: [diff]is safe.
- If unsure, starting with
4) Minimum Checks for PR
npm run skills:validatenpm test- If possible, check perspectives for False positive guards / Non-goals (What NOT to say)