[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7DAKWT3C8CDGXQMZRN0NFCE":3,"skill-same:01M7DAKWT3C8CDGXQMZRN0NFCE":47},{"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":26,"commitSha":27,"skillDirectory":28,"forksCount":29,"repositoryHtmlUrl":30,"repositoryHomepageUrl":6,"ownerHtmlUrl":31,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":32,"install":33,"resources":46},"01M7DAKWT3C8CDGXQMZRN0NFCE","code-gen",null,"Regenerate the committed generated files, such as the JSON Schemas under docs\u002Fschemas\u002F, the rulebook pages under docs\u002Frulebook\u002F and the rule index under src\u002Florecraft\u002Frules\u002Findex.py, after changing the package types or the rule declarations and docstrings they are rendered from, or a gen-* recipe in the justfile or a generator in gen\u002Fsrc\u002Florecraft_gen\u002F. Use after editing such a type, recipe or generator, before running tests or committing, or when CI's `gen-check` job fails with \"Generated code is out of date\". Not for formatting or linting; see \u002Fcode-format and \u002Fcode-check.","LNSD\u002Florecraft","LNSD","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F3949095?v=4","01M7DAK7ETP75C8S8PT783SWSP","Lorenzo Delgado","01M7DAK7FBVXE30743ZG437MTN",0,"Apache-2.0","https:\u002F\u002Fgithub.com\u002FLNSD\u002Florecraft\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fcode-gen\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: code-gen\ndescription: Regenerate the committed generated files, such as the JSON Schemas under docs\u002Fschemas\u002F, the rulebook pages under docs\u002Frulebook\u002F and the rule index under src\u002Florecraft\u002Frules\u002Findex.py, after changing the package types or the rule declarations and docstrings they are rendered from, or a gen-* recipe in the justfile or a generator in gen\u002Fsrc\u002Florecraft_gen\u002F. Use after editing such a type, recipe or generator, before running tests or committing, or when CI's `gen-check` job fails with \"Generated code is out of date\". Not for formatting or linting; see \u002Fcode-format and \u002Fcode-check.\ncompatibility: Requires the just task runner and uv. The generators import the package, so the development environment must be synced first.\nallowed-tools: Bash(just gen*) Bash(just sync) Bash(git status *) Bash(git diff *) Bash(grep -nE * gen\u002Fsrc\u002Florecraft_gen\u002F*.py)\n---\n\n# Code Generation Skill\n\nSome files in this repository are generated and committed: the JSON Schemas under `docs\u002Fschemas\u002F`, which\neditors validate the spec files against, the rulebook pages under `docs\u002Frulebook\u002F`, one per rule\ncode, and the rule index, `src\u002Florecraft\u002Frules\u002Findex.py`, the identity of every rule as strings and tuples. Each is\nrendered from what the package declares, so a change to it leaves the committed file stale until it\nis regenerated.\n\n## When to Run\n\nRun `just gen` when a change touches:\n\n- **A type a generator imports.** The generators are the modules of the private `lorecraft_gen` package in\n  `gen\u002Fsrc\u002Florecraft_gen\u002F`, each run by a `gen-*` recipe of the `justfile`, which installs\n  it on the fly: `just sync` does not. A generator imports what it renders\n  from the packages, so its imports are its inputs:\n\n  ```bash\n  grep -nE '^from lorecraft[. ]' gen\u002Fsrc\u002Florecraft_gen\u002F*.py\n  ```\n\n  A change to a module those lines import, or to anything that module's types are built from, changes the\n  output. Their field docstrings and their `SchemaInfo` metadata are rendered too, so a reworded docstring is\n  a change to the output.\n- **A rule.** The rulebook generator renders every rule's class: its code, name, release and aliases, and the\n  sections of its docstring. A new, renamed or removed rule, or a reworded docstring, changes a page. The rule\n  index, written by its own generator, records each rule's code, name, kind, level or severity, aliases and group, so a\n  change to any of them changes it too.\n- **A generator or its recipe itself**: a module of `gen\u002Fsrc\u002Florecraft_gen\u002F`, or a `gen-*` recipe.\n\nNothing else needs it. When unsure, run it: a generator with nothing to change leaves the tree as it was.\n\n## Commands\n\n```bash\njust sync   # first, when the environment may be stale: the generators import the package\njust gen    # every generator; `just gen-schemas`, `just gen-rulebook` and `just gen-rule-index` run one alone\n```\n\nThen look at what changed, and read the diff as a review of the change that caused it:\n\n```bash\ngit status --short docs\u002Fschemas docs\u002Frulebook src\u002Florecraft\u002Frules\u002Findex.py\ngit diff docs\u002Fschemas docs\u002Frulebook src\u002Florecraft\u002Frules\u002Findex.py\n```\n\nA description that reads badly in the diff reads badly in an editor too: fix the docstring, not the output. A\nrulebook page is generated output too: fix its rule's docstring and regenerate, never the page. No spec\ngoverns the pages, so `just check-docs` does not read them; `gen-check` keeps them current.\n\n## Rules\n\n- **Commit the output with the change that caused it.** CI's `gen-check` job runs `just gen` and fails on\n  any difference from the committed tree, a new file included.\n- **Never edit a generated file by hand.** The next `just gen` undoes it, and CI rejects it before that.\n- **A generator restates nothing.** It imports the types it renders; a field, a description or an example\n  written into a generator is a second copy that drifts. Add it to the package's type instead.\n- **Generation code lives in `lorecraft_gen`, never in `lorecraft`.** A recipe is one `uv run --with-editable\n  .\u002Fgen python -m lorecraft_gen.\u003Cmodule> --outdir \u003Cdir>` line, where the `justfile` variable names the directory and the module\n  keeps the same path as the default of `--outdir`. Nothing in `lorecraft` imports the generators, so none ships\n  in the wheel. The package's responsibility is `docs\u002Fcode\u002Fpackage-lorecraft-gen.md`.\n- **A generator carries no tests.** The check on a generator is `just gen` leaving the tree clean, which CI's\n  `gen-check` job enforces. Ruff and ty cover `gen\u002F`; pytest and coverage do not.\n- **A schema is rendered from the model that validates the file.** The package deserializes each file with the\n  same pydantic model the generator renders, so the schema an editor applies and the check's validation cannot\n  disagree about a shape. A test beside each model, such as\n  `tests\u002Fit\u002Ftest_structure_spec_schema.py`, holds the committed schema to every file this\n  repository writes. When it fails, fix the model or the file. Never loosen the test.\n\n## Where It Fits\n\nRun it after `\u002Fcode-format` and `\u002Fcode-check`, and before `\u002Fcode-test`: the schema tests read the committed\nschemas, so a stale one fails them for a reason that has nothing to do with the code under test.\n\n## Common Mistakes to Avoid\n\n- **Fixing a failed `gen-check` job by hand-editing the file** to match what CI printed. Run `just gen`.\n- **Running a generator's code another way**, such as a copy of it in a scratch script. The recipe is the one\n  place that writes the output, and the one CI checks.\n- **Adding a generator to `lorecraft`** because it is the package that holds the types. Add a module to\n  `lorecraft_gen` and a `gen-*` recipe that runs it.\n\n## Next Steps\n\nAfter regenerating:\n1. **Run targeted tests** → use `\u002Fcode-test`; the schema tests are in the integration tier, `just test-it`\n2. **Commit the generated files with the change** → use `\u002Fcommit`\n","# Code Generation Skill\n\nSome files in this repository are generated and committed: the JSON Schemas under `docs\u002Fschemas\u002F`, which\neditors validate the spec files against, the rulebook pages under `docs\u002Frulebook\u002F`, one per rule\ncode, and the rule index, `src\u002Florecraft\u002Frules\u002Findex.py`, the identity of every rule as strings and tuples. Each is\nrendered from what the package declares, so a change to it leaves the committed file stale until it\nis regenerated.\n\n## When to Run\n\nRun `just gen` when a change touches:\n\n- **A type a generator imports.** The generators are the modules of the private `lorecraft_gen` package in\n  `gen\u002Fsrc\u002Florecraft_gen\u002F`, each run by a `gen-*` recipe of the `justfile`, which installs\n  it on the fly: `just sync` does not. A generator imports what it renders\n  from the packages, so its imports are its inputs:\n\n  ```bash\n  grep -nE '^from lorecraft[. ]' gen\u002Fsrc\u002Florecraft_gen\u002F*.py\n  ```\n\n  A change to a module those lines import, or to anything that module's types are built from, changes the\n  output. Their field docstrings and their `SchemaInfo` metadata are rendered too, so a reworded docstring is\n  a change to the output.\n- **A rule.** The rulebook generator renders every rule's class: its code, name, release and aliases, and the\n  sections of its docstring. A new, renamed or removed rule, or a reworded docstring, changes a page. The rule\n  index, written by its own generator, records each rule's code, name, kind, level or severity, aliases and group, so a\n  change to any of them changes it too.\n- **A generator or its recipe itself**: a module of `gen\u002Fsrc\u002Florecraft_gen\u002F`, or a `gen-*` recipe.\n\nNothing else needs it. When unsure, run it: a generator with nothing to change leaves the tree as it was.\n\n## Commands\n\n```bash\njust sync   # first, when the environment may be stale: the generators import the package\njust gen    # every generator; `just gen-schemas`, `just gen-rulebook` and `just gen-rule-index` run one alone\n```\n\nThen look at what changed, and read the diff as a review of the change that caused it:\n\n```bash\ngit status --short docs\u002Fschemas docs\u002Frulebook src\u002Florecraft\u002Frules\u002Findex.py\ngit diff docs\u002Fschemas docs\u002Frulebook src\u002Florecraft\u002Frules\u002Findex.py\n```\n\nA description that reads badly in the diff reads badly in an editor too: fix the docstring, not the output. A\nrulebook page is generated output too: fix its rule's docstring and regenerate, never the page. No spec\ngoverns the pages, so `just check-docs` does not read them; `gen-check` keeps them current.\n\n## Rules\n\n- **Commit the output with the change that caused it.** CI's `gen-check` job runs `just gen` and fails on\n  any difference from the committed tree, a new file included.\n- **Never edit a generated file by hand.** The next `just gen` undoes it, and CI rejects it before that.\n- **A generator restates nothing.** It imports the types it renders; a field, a description or an example\n  written into a generator is a second copy that drifts. Add it to the package's type instead.\n- **Generation code lives in `lorecraft_gen`, never in `lorecraft`.** A recipe is one `uv run --with-editable\n  .\u002Fgen python -m lorecraft_gen.\u003Cmodule> --outdir \u003Cdir>` line, where the `justfile` variable names the directory and the module\n  keeps the same path as the default of `--outdir`. Nothing in `lorecraft` imports the generators, so none ships\n  in the wheel. The package's responsibility is `docs\u002Fcode\u002Fpackage-lorecraft-gen.md`.\n- **A generator carries no tests.** The check on a generator is `just gen` leaving the tree clean, which CI's\n  `gen-check` job enforces. Ruff and ty cover `gen\u002F`; pytest and coverage do not.\n- **A schema is rendered from the model that validates the file.** The package deserializes each file with the\n  same pydantic model the generator renders, so the schema an editor applies and the check's validation cannot\n  disagree about a shape. A test beside each model, such as\n  `tests\u002Fit\u002Ftest_structure_spec_schema.py`, holds the committed schema to every file this\n  repository writes. When it fails, fix the model or the file. Never loosen the test.\n\n## Where It Fits\n\nRun it after `\u002Fcode-format` and `\u002Fcode-check`, and before `\u002Fcode-test`: the schema tests read the committed\nschemas, so a stale one fails them for a reason that has nothing to do with the code under test.\n\n## Common Mistakes to Avoid\n\n- **Fixing a failed `gen-check` job by hand-editing the file** to match what CI printed. Run `just gen`.\n- **Running a generator's code another way**, such as a copy of it in a scratch script. The recipe is the one\n  place that writes the output, and the one CI checks.\n- **Adding a generator to `lorecraft`** because it is the package that holds the types. Add a module to\n  `lorecraft_gen` and a `gen-*` recipe that runs it.\n\n## Next Steps\n\nAfter regenerating:\n1. **Run targeted tests** → use `\u002Fcode-test`; the schema tests are in the integration tier, `just test-it`\n2. **Commit the generated files with the change** → use `\u002Fcommit`\n",{"name":5,"description":7,"allowed-tools":24,"compatibility":25},"Bash(just gen*) Bash(just sync) Bash(git status *) Bash(git diff *) Bash(grep -nE * gen\u002Fsrc\u002Florecraft_gen\u002F*.py)","Requires the just task runner and uv. The generators import the package, so the development environment must be synced first.","main","d2f3a5835a8673ccf134ae62f0a5e84104ff7098",".agents\u002Fskills\u002Fcode-gen",1,"https:\u002F\u002Fgithub.com\u002FLNSD\u002Florecraft","https:\u002F\u002Fgithub.com\u002FLNSD","2026-11-10 04:14:00",{"source":8,"skillName":5,"commands":34,"prompt":44,"zipAvailable":45},[35,38,41],{"tool":36,"command":37},"npx","npx skills add LNSD\u002Florecraft --skill code-gen",{"tool":39,"command":40},"bunx","bunx skills add LNSD\u002Florecraft --skill code-gen",{"tool":42,"command":43},"pnpm","pnpm dlx skills add LNSD\u002Florecraft --skill code-gen","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FLNSD\u002Florecraft\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fcode-gen\u002FSKILL.md",true,[],[48,55,60,65,70,75],{"skillNo":49,"name":50,"nameZh":6,"description":51,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":52,"categories":53,"keywords":54,"publishedAt":19},"01M7DASA0R4R68AVTZJFJJBYDB","review","Review a change. Use when asked to review.","https:\u002F\u002Fgithub.com\u002FLNSD\u002Florecraft\u002Fblob\u002Fmain\u002Ftests\u002Fit\u002Frule_cases\u002FLC504\u002Ftrigger\u002Freference-link-to-parent-skill-file\u002Froot\u002F.agents\u002Fskills\u002Freview\u002FSKILL.md",[],[],{"skillNo":56,"name":50,"nameZh":6,"description":51,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":57,"categories":58,"keywords":59,"publishedAt":19},"01M7DAS1YXJQ8FGABR8BGX9FAT","https:\u002F\u002Fgithub.com\u002FLNSD\u002Florecraft\u002Fblob\u002Fmain\u002Ftests\u002Fit\u002Frule_cases\u002FLC504\u002Fnear_miss\u002Fclimb-that-stays-inside-and-document-climb\u002Froot\u002F.agents\u002Fskills\u002Freview\u002FSKILL.md",[],[],{"skillNo":61,"name":50,"nameZh":6,"description":51,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":62,"categories":63,"keywords":64,"publishedAt":19},"01M7DAS0TCKQFF2YJ5VY9SWHV2","https:\u002F\u002Fgithub.com\u002FLNSD\u002Florecraft\u002Fblob\u002Fmain\u002Ftests\u002Fit\u002Frule_cases\u002FLC503\u002Ftrigger\u002Fskill-reference-link-read-from-skill-root\u002Froot\u002F.agents\u002Fskills\u002Freview\u002FSKILL.md",[],[],{"skillNo":66,"name":50,"nameZh":6,"description":51,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":67,"categories":68,"keywords":69,"publishedAt":19},"01M7DARZNA9QGXHAY17142R8YT","https:\u002F\u002Fgithub.com\u002FLNSD\u002Florecraft\u002Fblob\u002Fmain\u002Ftests\u002Fit\u002Frule_cases\u002FLC503\u002Fnear_miss\u002Fskill-link-climbing-above-skill-root\u002Froot\u002F.agents\u002Fskills\u002Freview\u002FSKILL.md",[],[],{"skillNo":71,"name":50,"nameZh":6,"description":51,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":72,"categories":73,"keywords":74,"publishedAt":19},"01M7DARYHB7WBR44AJXFJSZQ7X","https:\u002F\u002Fgithub.com\u002FLNSD\u002Florecraft\u002Fblob\u002Fmain\u002Ftests\u002Fit\u002Frule_cases\u002FLC502\u002Ftrigger\u002Fskill-fragment-in-file-without-headings\u002Froot\u002F.agents\u002Fskills\u002Freview\u002FSKILL.md",[],[],{"skillNo":76,"name":50,"nameZh":6,"description":51,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":77,"categories":78,"keywords":79,"publishedAt":19},"01M7DARXCTFKMH92FHVV8H30MM","https:\u002F\u002Fgithub.com\u002FLNSD\u002Florecraft\u002Fblob\u002Fmain\u002Ftests\u002Fit\u002Frule_cases\u002FLC501\u002Ftrigger\u002Fskill-link-starting-with-slash\u002Froot\u002F.agents\u002Fskills\u002Freview\u002FSKILL.md",[],[]]