[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7DGRJ0BVF87HT00VH58T3DP":3,"skill-same:01M7DGRJ0BVF87HT00VH58T3DP":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},"01M7DGRJ0BVF87HT00VH58T3DP","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\u002Fr2b-shared-code-guard\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 1: extract the checklist (before writing code)\n\nWrite a numbered list into `scratch\u002FCHECKLIST.md` (delete `scratch\u002F` at the end), 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, dispatch, 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, KeyError or IndexError on user names into the spec's types where the input origin is known.\n- Never name variables or classes after builtins or helpers you call (`format`, `type`, `input`, `id`, `hash`, builtin exception names).\n\n## Editing shared code: inventory, extend, re-test\n\nShared code: tokenizer, literal or value parser, expression parser, formatter, argument loop and dispatcher, error emitter, data model. Most points lost in later parts are old behaviour that an edit to one of these silently changed. Before you edit one:\n\n1. Inventory. Add two sections to the checklist. `ACCEPTS today`: read the function and list every input shape it accepts, one line each (each literal form: unsized, sized, each radix, separators, case; each operand kind: name, literal constant, nested call, index, slice, concatenation; each declaration form; each command-line value form). `REJECTS today`: what it rejects on purpose, with error type and exit code (forbidden tokens in files, wrong widths, unknown names, bad flag values).\n2. Extend, never replace. Add a branch or a parameter for the new form; do not rewrite the tokenizer or the regex wholesale. When the new part makes a formerly forbidden token legal in one place (a new mode, the command line, a new format), the old place must still reject it with the old error type; \"treat it as an identifier\" turns a parse error into a different error class.\n3. Re-test every line. After the edit, run one command per `ACCEPTS` line (same output as before) and one per `REJECTS` line (same type and exit code). A rejection that became a different type, or a success, is a regression even though no example in this part shows it.\n4. Literal operands. Wherever an operand may be a name it usually may be a literal constant. After any parser change run a literal operand at top level and nested inside a call, in every mode.\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; `python3` on PATH may print cache warnings, which are noise. Fixtures live inside the workspace under `scratch\u002F`.\n\n- Every example: fixture exactly as given, compare stdout and `echo $?` byte for byte (JSON key order, prefixes, sorting, blank lines).\n- Every error row: with `--json` and without; type, exit code, command field, nothing on stdout in text mode.\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- For every earlier part: one success command and one error command, plus the `ACCEPTS`\u002F`REJECTS` re-test of every shared function you touched.\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## Finish\n\nDelete `scratch\u002F`. In your summary, list the commands you ran and name any item left unverified. 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 1: extract the checklist (before writing code)\n\nWrite a numbered list into `scratch\u002FCHECKLIST.md` (delete `scratch\u002F` at the end), 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, dispatch, 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, KeyError or IndexError on user names into the spec's types where the input origin is known.\n- Never name variables or classes after builtins or helpers you call (`format`, `type`, `input`, `id`, `hash`, builtin exception names).\n\n## Editing shared code: inventory, extend, re-test\n\nShared code: tokenizer, literal or value parser, expression parser, formatter, argument loop and dispatcher, error emitter, data model. Most points lost in later parts are old behaviour that an edit to one of these silently changed. Before you edit one:\n\n1. Inventory. Add two sections to the checklist. `ACCEPTS today`: read the function and list every input shape it accepts, one line each (each literal form: unsized, sized, each radix, separators, case; each operand kind: name, literal constant, nested call, index, slice, concatenation; each declaration form; each command-line value form). `REJECTS today`: what it rejects on purpose, with error type and exit code (forbidden tokens in files, wrong widths, unknown names, bad flag values).\n2. Extend, never replace. Add a branch or a parameter for the new form; do not rewrite the tokenizer or the regex wholesale. When the new part makes a formerly forbidden token legal in one place (a new mode, the command line, a new format), the old place must still reject it with the old error type; \"treat it as an identifier\" turns a parse error into a different error class.\n3. Re-test every line. After the edit, run one command per `ACCEPTS` line (same output as before) and one per `REJECTS` line (same type and exit code). A rejection that became a different type, or a success, is a regression even though no example in this part shows it.\n4. Literal operands. Wherever an operand may be a name it usually may be a literal constant. After any parser change run a literal operand at top level and nested inside a call, in every mode.\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; `python3` on PATH may print cache warnings, which are noise. Fixtures live inside the workspace under `scratch\u002F`.\n\n- Every example: fixture exactly as given, compare stdout and `echo $?` byte for byte (JSON key order, prefixes, sorting, blank lines).\n- Every error row: with `--json` and without; type, exit code, command field, nothing on stdout in text mode.\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- For every earlier part: one success command and one error command, plus the `ACCEPTS`\u002F`REJECTS` re-test of every shared function you touched.\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## Finish\n\nDelete `scratch\u002F`. In your summary, list the commands you ran and name any item left unverified. Never finish with \"did not run\" while an interpreter is available.\n",{"name":5,"description":7},"main","90c4e234b13d749b2f69ddcb1c759e5f667f6413","skills\u002Fluna-hc\u002Fsuperseded\u002Fr2b-shared-code-guard","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\u002Fr2b-shared-code-guard\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",[],[]]