[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7DGRCSXVJ3JSJYGETFHA8S0":3,"skill-same:01M7DGRCSXVJ3JSJYGETFHA8S0":44},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":14,"repositoryHtmlUrl":27,"repositoryHomepageUrl":6,"ownerHtmlUrl":28,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":29,"install":30,"resources":43},"01M7DGRCSXVJ3JSJYGETFHA8S0","cli-software",null,"Working rules for implementing or extending a command-line program from a written specification (subcommands, flags, exit codes, text and JSON output, error types). Use for every task whose prompt is a CLI spec; it shows how to turn the spec into a checklist, implement it, and prove each item by running the program before finishing.","jemdiggity\u002Fkojo","jemdiggity","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F1940552?v=4","01M7DGK797SRB0B74KVSKQ44GZ","Jeremy Hale","01M7DGK7ABQPV6AA6CPDC2NNP7",0,"MIT","https:\u002F\u002Fgithub.com\u002Fjemdiggity\u002Fkojo\u002Fblob\u002Fmain\u002Fskills\u002Fluna-hc\u002Fsuperseded\u002Fr2a-persistent-suite\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: cli-software\ndescription: Working rules for implementing or extending a command-line program from a written specification (subcommands, flags, exit codes, text and JSON output, error types). Use for every task whose prompt is a CLI spec; it shows how to turn the spec into a checklist, implement it, and prove each item by running the program before finishing.\n---\n# CLI from spec: the checklist method\n\nThe spec is the test suite written in prose. Every table row, bullet, and example is checked by a hidden test, and every earlier part stays tested forever. Work in three passes.\n\n## Pass 0: run the regression suite you inherited\n\nThe workspace persists between parts but your memory does not. If `regress\u002F` exists, run it before touching code: `sh regress\u002Fcases.sh > regress\u002Factual.txt; diff regress\u002Fexpected.txt regress\u002Factual.txt`. It must be clean. A difference is a leftover bug: fix it first, it is the cheapest points available.\n\n## Pass 1: extract the checklist (before writing code)\n\nWrite a numbered list into `scratch\u002FCHECKLIST.md`, one line per item, copied from the spec:\n\n1. Each command and flag, with its default and where it is allowed.\n2. Each error type: exit code, exact trigger, and where the bad input comes from (command-line value, file contents, semantic check). Take the exit code from the row naming the type; a general sentence such as \"parse errors exit 2\" never overrides an explicit number.\n3. Each output shape: field names, order, value formatting (prefixes, widths, sorting), text versus JSON, stdout versus file.\n4. Each sentence containing \"must\", \"never\", \"only\", \"exactly\", \"sorted\", \"deterministic\", \"still\", \"unchanged\", or \"from this part onward\".\n5. Each example invocation with its printed output and exit code.\n6. Each value syntax accepted on the command line (new characters, sized forms, case variants, separators), separately from what files may contain.\n\nExpect 20 to 60 items. Fewer means you skipped part of the spec; reread it.\n\n## Pass 2: implement against the list\n\n- Read all existing code first. Find every place that enumerates commands, flags, operators, error types, or formats (usage string, dispatch chain, error emitter, tables) and extend each one. Stale hard-coded lists are the usual reason a new part misbehaves.\n- Route every failure through one error emitter: it receives the command name and the error, looks the exit code up in one table, prints the envelope. The command field is the subcommand the user typed whenever one is present, even when a global flag or an option value was bad.\n- One value parser and one value formatter, shared by all commands. A new command never gets its own copy; add a parameter instead.\n- Command-line values and file contents can contain the same bad text and still map to different error types. If the runtime value parser delegates to the file parser, catch its error and re-raise the type the spec names for command-line values, and extend the runtime grammar with what the new part allows.\n- Any uncaught exception is a bug: it becomes the internal-error exit, which no test expects. Translate missing files, bad JSON, failed int conversions, and KeyError or IndexError on user-supplied names into the spec's named types where you know which input caused them.\n- Never name variables or classes after builtins or helpers you call (`format`, `type`, `input`, `id`, `hash`, builtin exception names).\n\n## Pass 3: prove each item by running (mandatory)\n\nRunning the spec's own examples is part of implementing it; no framework or dependency is needed. Invoke with the interpreter path the spec's examples use (the entry file may not be executable; `python3` on PATH may print cache warnings, which are noise). Fixtures live inside the workspace.\n\n- For every example: create the fixture exactly, run it, compare stdout and `echo $?` with the spec byte for byte (JSON key order, prefixes, sorting, blank lines).\n- For every error row of this part: trigger it with `--json` and without; confirm type, exit code, command field, and that text mode prints nothing on stdout.\n- For every new command-line value syntax: one success case. For every new input or output format: run it with the richest existing features (multi-bit values, nested expressions), not only the scalar example.\n- Tick an item only after its run passed. Fix and rerun until all are ticked. Spend at least a third of your effort here.\n\n## The regression suite: every verified case becomes permanent\n\nCreate `regress\u002F` in part 1 and grow it in every part. It is never deleted and never lives under `scratch\u002F`. Layout: `regress\u002Ffixtures\u002F` (input files), `regress\u002Fcases.sh`, `regress\u002Fexpected.txt`. The script:\n\n```sh\ncd \"$(dirname \"$0\")\u002F..\"\nP=\"\u003Cinterpreter path from the spec> \u003Centry>\"\nrun() { echo \"## $*\"; $P \"$@\" 2>&1; echo \"exit=$?\"; }\nrun \u003Ccommand> regress\u002Ffixtures\u002F\u003Cfile> ...\n```\n\nRules:\n- The moment a checklist item passes, append its command as a `run` line (success cases, every error row, every value syntax, every forbidden input that must stay rejected). Every bug you fix becomes a line too.\n- Rerun the suite (the `diff` from Pass 0) after every edit to a shared parser, formatter, dispatcher, or data model, and once more before finishing. A changed line for an earlier part is a regression: fix the program. Edit `expected.txt` only when the current spec explicitly changes that behaviour, and say which item.\n- When everything passes, regenerate: `sh regress\u002Fcases.sh > regress\u002Fexpected.txt`. Then run the diff once to confirm it is empty.\n- Keep the directory self-contained: relative paths only, no code the program imports, nothing else added at the workspace root. It must never influence the program.\n\n## Finish\n\nDelete `scratch\u002F`; keep `regress\u002F`. Run the suite one last time and read the diff. In your summary, list the commands you ran and the number of suite cases. Never finish with \"did not run\" while an interpreter is available.\n","# CLI from spec: the checklist method\n\nThe spec is the test suite written in prose. Every table row, bullet, and example is checked by a hidden test, and every earlier part stays tested forever. Work in three passes.\n\n## Pass 0: run the regression suite you inherited\n\nThe workspace persists between parts but your memory does not. If `regress\u002F` exists, run it before touching code: `sh regress\u002Fcases.sh > regress\u002Factual.txt; diff regress\u002Fexpected.txt regress\u002Factual.txt`. It must be clean. A difference is a leftover bug: fix it first, it is the cheapest points available.\n\n## Pass 1: extract the checklist (before writing code)\n\nWrite a numbered list into `scratch\u002FCHECKLIST.md`, one line per item, copied from the spec:\n\n1. Each command and flag, with its default and where it is allowed.\n2. Each error type: exit code, exact trigger, and where the bad input comes from (command-line value, file contents, semantic check). Take the exit code from the row naming the type; a general sentence such as \"parse errors exit 2\" never overrides an explicit number.\n3. Each output shape: field names, order, value formatting (prefixes, widths, sorting), text versus JSON, stdout versus file.\n4. Each sentence containing \"must\", \"never\", \"only\", \"exactly\", \"sorted\", \"deterministic\", \"still\", \"unchanged\", or \"from this part onward\".\n5. Each example invocation with its printed output and exit code.\n6. Each value syntax accepted on the command line (new characters, sized forms, case variants, separators), separately from what files may contain.\n\nExpect 20 to 60 items. Fewer means you skipped part of the spec; reread it.\n\n## Pass 2: implement against the list\n\n- Read all existing code first. Find every place that enumerates commands, flags, operators, error types, or formats (usage string, dispatch chain, error emitter, tables) and extend each one. Stale hard-coded lists are the usual reason a new part misbehaves.\n- Route every failure through one error emitter: it receives the command name and the error, looks the exit code up in one table, prints the envelope. The command field is the subcommand the user typed whenever one is present, even when a global flag or an option value was bad.\n- One value parser and one value formatter, shared by all commands. A new command never gets its own copy; add a parameter instead.\n- Command-line values and file contents can contain the same bad text and still map to different error types. If the runtime value parser delegates to the file parser, catch its error and re-raise the type the spec names for command-line values, and extend the runtime grammar with what the new part allows.\n- Any uncaught exception is a bug: it becomes the internal-error exit, which no test expects. Translate missing files, bad JSON, failed int conversions, and KeyError or IndexError on user-supplied names into the spec's named types where you know which input caused them.\n- Never name variables or classes after builtins or helpers you call (`format`, `type`, `input`, `id`, `hash`, builtin exception names).\n\n## Pass 3: prove each item by running (mandatory)\n\nRunning the spec's own examples is part of implementing it; no framework or dependency is needed. Invoke with the interpreter path the spec's examples use (the entry file may not be executable; `python3` on PATH may print cache warnings, which are noise). Fixtures live inside the workspace.\n\n- For every example: create the fixture exactly, run it, compare stdout and `echo $?` with the spec byte for byte (JSON key order, prefixes, sorting, blank lines).\n- For every error row of this part: trigger it with `--json` and without; confirm type, exit code, command field, and that text mode prints nothing on stdout.\n- For every new command-line value syntax: one success case. For every new input or output format: run it with the richest existing features (multi-bit values, nested expressions), not only the scalar example.\n- Tick an item only after its run passed. Fix and rerun until all are ticked. Spend at least a third of your effort here.\n\n## The regression suite: every verified case becomes permanent\n\nCreate `regress\u002F` in part 1 and grow it in every part. It is never deleted and never lives under `scratch\u002F`. Layout: `regress\u002Ffixtures\u002F` (input files), `regress\u002Fcases.sh`, `regress\u002Fexpected.txt`. The script:\n\n```sh\ncd \"$(dirname \"$0\")\u002F..\"\nP=\"\u003Cinterpreter path from the spec> \u003Centry>\"\nrun() { echo \"## $*\"; $P \"$@\" 2>&1; echo \"exit=$?\"; }\nrun \u003Ccommand> regress\u002Ffixtures\u002F\u003Cfile> ...\n```\n\nRules:\n- The moment a checklist item passes, append its command as a `run` line (success cases, every error row, every value syntax, every forbidden input that must stay rejected). Every bug you fix becomes a line too.\n- Rerun the suite (the `diff` from Pass 0) after every edit to a shared parser, formatter, dispatcher, or data model, and once more before finishing. A changed line for an earlier part is a regression: fix the program. Edit `expected.txt` only when the current spec explicitly changes that behaviour, and say which item.\n- When everything passes, regenerate: `sh regress\u002Fcases.sh > regress\u002Fexpected.txt`. Then run the diff once to confirm it is empty.\n- Keep the directory self-contained: relative paths only, no code the program imports, nothing else added at the workspace root. It must never influence the program.\n\n## Finish\n\nDelete `scratch\u002F`; keep `regress\u002F`. Run the suite one last time and read the diff. In your summary, list the commands you ran and the number of suite cases. Never finish with \"did not run\" while an interpreter is available.\n",{"name":5,"description":7},"main","90c4e234b13d749b2f69ddcb1c759e5f667f6413","skills\u002Fluna-hc\u002Fsuperseded\u002Fr2a-persistent-suite","https:\u002F\u002Fgithub.com\u002Fjemdiggity\u002Fkojo","https:\u002F\u002Fgithub.com\u002Fjemdiggity","2026-11-01 06:04:44",{"source":8,"skillName":5,"commands":31,"prompt":41,"zipAvailable":42},[32,35,38],{"tool":33,"command":34},"npx","npx skills add jemdiggity\u002Fkojo --skill cli-software",{"tool":36,"command":37},"bunx","bunx skills add jemdiggity\u002Fkojo --skill cli-software",{"tool":39,"command":40},"pnpm","pnpm dlx skills add jemdiggity\u002Fkojo --skill cli-software","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fjemdiggity\u002Fkojo\u002Fblob\u002Fmain\u002Fskills\u002Fluna-hc\u002Fsuperseded\u002Fr2a-persistent-suite\u002FSKILL.md",true,[],[45,52,57,62,67,72],{"skillNo":46,"name":47,"nameZh":6,"description":48,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":49,"categories":50,"keywords":51,"publishedAt":19},"01M7DGWAMS2Z08G9S6KYEBM4YG","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.","https:\u002F\u002Fgithub.com\u002Fjemdiggity\u002Fkojo\u002Fblob\u002Fmain\u002Fskills\u002Fsonnet-dcs\u002Fround3\u002Fd3e-accept\u002FSKILL.md",[],[],{"skillNo":53,"name":47,"nameZh":6,"description":48,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":54,"categories":55,"keywords":56,"publishedAt":19},"01M7DGW5T9M4EXVHNTNW1NY6MR","https:\u002F\u002Fgithub.com\u002Fjemdiggity\u002Fkojo\u002Fblob\u002Fmain\u002Fskills\u002Fsonnet-dcs\u002Fround3\u002Fd3d-exact-words\u002FSKILL.md",[],[],{"skillNo":58,"name":47,"nameZh":6,"description":48,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":59,"categories":60,"keywords":61,"publishedAt":19},"01M7DGW1S560QM0M72BSYP42XB","https:\u002F\u002Fgithub.com\u002Fjemdiggity\u002Fkojo\u002Fblob\u002Fmain\u002Fskills\u002Fsonnet-dcs\u002Fround3\u002Fd3c-omit\u002FSKILL.md",[],[],{"skillNo":63,"name":47,"nameZh":6,"description":48,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":64,"categories":65,"keywords":66,"publishedAt":19},"01M7DGVXQS07PEJQBS7VJC9B7R","https:\u002F\u002Fgithub.com\u002Fjemdiggity\u002Fkojo\u002Fblob\u002Fmain\u002Fskills\u002Fsonnet-dcs\u002Fround3\u002Fd3b-inherit\u002FSKILL.md",[],[],{"skillNo":68,"name":47,"nameZh":6,"description":48,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":69,"categories":70,"keywords":71,"publishedAt":19},"01M7DGVSEXFX35NZPSPBN9833Q","https:\u002F\u002Fgithub.com\u002Fjemdiggity\u002Fkojo\u002Fblob\u002Fmain\u002Fskills\u002Fsonnet-dcs\u002Fround3\u002Fd3a-gate-lean\u002FSKILL.md",[],[],{"skillNo":73,"name":47,"nameZh":6,"description":74,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":75,"categories":76,"keywords":77,"publishedAt":19},"01M7DGVNNTDB3EGQHJXTNM986H","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.","https:\u002F\u002Fgithub.com\u002Fjemdiggity\u002Fkojo\u002Fblob\u002Fmain\u002Fskills\u002Fsonnet-dcs\u002Fround2\u002Fd2e-lean\u002FSKILL.md",[],[]]