Install
npx skillscat add parsofish/forge-studio/studio-starters-projects-cli-forge-skills-cli-conventions Install via the SkillsCat registry.
CLI Conventions Skill
Purpose
Encode this project's argv/stdout contract so a dev-loop agent extends the CLI
without smuggling untested plumbing past the quality gate. This is the
project-scoped skill the forge↔project contract expects every project to bind
at least one of (skills[] in .forge/project.json) — replace or extend it
as the project's real behaviour grows past the starter's single greet
function.
When to use
- Adding a new CLI flag, subcommand, or argument.
- Changing how output is formatted or written.
- Reviewing whether a change belongs in
main()or in a pure function.
The rule
Real behaviour lives in small, pure, testable functions (greet insrc/index.ts is the template — replace it, keep the shape). main(argv)
stays thin: parse argv, call the pure function(s), write to stdout. Theif (import.meta.url === ...) guard is what lets test/*.test.ts import the
module without executing main as a side effect — keep it when the entry
point changes.
Verification workflow
- Add or extend a pure function; write its
node:testcase FIRST, with a
distinctive value (mirroringgreet('sentinel-42')) so a stub
implementation that ignores its input is caught. npm test— fast, deterministic, must fail before the behaviour exists.npm run build(tsc →dist/) beforenpm run acceptance, which runs the
BUILT CLI — a read-back against the actually-running binary, never the
source.