v5-terse
暂无简介
- License 许可
- MIT
- 所属仓库
- jemdiggity/kojo
- 最近更新
- 2026-11-01
- Stars
- ★ 0
- Forks
- 0
03 SKILL.md 正文
CLI from spec: the short rules
- The spec is the test suite. Before coding, list every command, flag, error row (type, exit code, trigger), output field, and example. Keep the list until each item has been run.
- Exit codes come from the row that names the error type. Category prose never overrides an explicit number.
- One error emitter, one exit table. The envelope's command field is the subcommand the user typed whenever one is present, even for bad global flags or option values; the "no command" placeholder is only for invocations without a subcommand token. Never derive it from a hard-coded list of commands.
- A traceback or internal-error exit is always a bug. Translate foreign exceptions (missing file, bad JSON, failed int conversion, KeyError on a user name) into the spec's types where the input origin is known.
- Command-line values and file contents have different error types even for the same bad text. If the runtime value parser reuses the file parser, catch and re-raise the command-line type, and extend the runtime grammar with every new value syntax the part allows.
- One value parser, one value formatter, one data model, shared by all commands and formats. Extend with parameters; never copy.
- Adding a command or flag means updating every place that enumerates them: usage text, dispatcher, error handler.
- Do not shadow builtins or helpers (
format,type,input,id,hash), and never name a class like a builtin exception. - Run the program.
python3 <entry> args; echo $?with fixtures inscratch/inside the workspace (system temp may be blocked, the entry may not be executable, stderr cache warnings are noise). Running the spec's examples is part of the task, not extra testing; no framework or dependencies. - Run every example of the current part and match stdout and exit code byte for byte (key order, prefixes, sorting, blank lines). Trigger every new error type once with
--jsonand check type, exit code, command field. - After any change to shared code, rerun one success and one error case from every earlier part.
- Exercise new formats and commands with the richest existing features (multi-bit values, nested expressions), not just the simplest example.
- Where output must be deterministic, sort explicitly; "dependency order, ties by name" means emit the smallest-named ready item each step.
- Delete
scratch/and report which commands you ran. Never finish with "did not run".
04 同仓库更多 Skills
service-spec
Invoke before reading any code, for any task whose prompt is a multi-part spec for a service, API or CLI built up over successive parts (part 1, part 2, ... each adding or changing behavior). Apply its rules while reading the spec literally and while choosing behavior where the spec is silent.
service-spec
Invoke before reading any code, for any task whose prompt is a multi-part spec for a service, API or CLI built up over successive parts (part 1, part 2, ... each adding or changing behavior). Apply its rules while reading the spec literally and while choosing behavior where the spec is silent.
service-spec
Invoke before reading any code, for any task whose prompt is a multi-part spec for a service, API or CLI built up over successive parts (part 1, part 2, ... each adding or changing behavior). Apply its rules while reading the spec literally and while choosing behavior where the spec is silent.
service-spec
Invoke before reading any code, for any task whose prompt is a multi-part spec for a service, API or CLI built up over successive parts (part 1, part 2, ... each adding or changing behavior). Apply its rules while reading the spec literally and while choosing behavior where the spec is silent.
service-spec
Invoke before reading any code, for any task whose prompt is a multi-part spec for a service, API or CLI built up over successive parts (part 1, part 2, ... each adding or changing behavior). Apply its rules while reading the spec literally and while choosing behavior where the spec is silent.
service-spec
Use for any task whose prompt is a multi-part spec for a service, API, or CLI built up over successive parts (part 1, part 2, ... each adding or changing behavior). Guides literal reading of the spec and the choices to make where it is silent.