[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7D4WDKYJYMEEJ336PKY0F1Z":3,"skill-same:01M7D4WDKYJYMEEJ336PKY0F1Z":44},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":21,"frontMatter":22,"refName":23,"commitSha":24,"skillDirectory":25,"forksCount":13,"repositoryHtmlUrl":26,"repositoryHomepageUrl":6,"ownerHtmlUrl":27,"ownerBlogUrl":6,"ownerDescription":28,"updatedAt":29,"install":30,"resources":43},"01M7D4WDKYJYMEEJ336PKY0F1Z","skill-embed-adoption",null,"Ship Agent Skills inside a Rust binary with skill-embed, and give that binary a skill install command. Read this when adding the crate to a tool, when choosing a front end, or when an install reports a state that is hard to act on. Covers the wiring for each front end, the traps that are silent, and how to check the result.","mpyw\u002Frust-skill-embed","mpyw","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F1351893?v=4","01M7D0YKHP7VHJGE7T64FR9HHD","01M7D4W2EJRVE885EG5TB39AFT",0,"MIT","https:\u002F\u002Fgithub.com\u002Fmpyw\u002Frust-skill-embed\u002Fblob\u002Fmain\u002Fskill-embed\u002Fskills\u002Fskill-embed-adoption\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: skill-embed-adoption\ndescription: Ship Agent Skills inside a Rust binary with skill-embed, and give that binary a skill install command. Read this when adding the crate to a tool, when choosing a front end, or when an install reports a state that is hard to act on. Covers the wiring for each front end, the traps that are silent, and how to check the result.\nlicense: MIT\n---\n\n# Adopting skill-embed\n\nWritten against **skill-embed 0.1**. Check the version first.\n\nRead [the README](https:\u002F\u002Fgithub.com\u002Fmpyw\u002Frust-skill-embed#readme) for the API.\nThis covers the decisions and the traps.\n\n## Decide three things first\n\n| Decision | Options | Default |\n| --- | --- | --- |\n| Front end | `intercept`, `run`, or the clap adapter | none |\n| Agents | every built-in agent, or a subset through `with_agents` | every one |\n| Command name | any word | `skill` |\n\nThe front end follows from what the tool already is.\n\n| The tool is | Use |\n| --- | --- |\n| A [clap](https:\u002F\u002Fdocs.rs\u002Fclap) tool | `skill_embed_clap::command` |\n| A tool with no framework | `intercept`, as the first thing `main` does |\n| A tool built on something with no hook | `intercept`, before that thing starts |\n| Something that parses its own arguments | `run`, which returns errors instead of exiting |\n\n## Wire it\n\nSkills live under `skills\u002F\u003Cname>\u002FSKILL.md`. That layout is the\n[Agent Skills specification](https:\u002F\u002Fagentskills.io\u002Fspecification), and the\ndiscovery reads no other.\n\n```rust\nstatic SKILLS_DIR: Dir\u003C'static> = include_dir!(\"$CARGO_MANIFEST_DIR\u002Fskills\");\n\nstatic SKILLS: LazyLock\u003CInstaller> = LazyLock::new(|| {\n    Installer::new(SkillSet::from_include_dir(&SKILLS_DIR).expect(\"valid skills\"))\n        .with_tool_name(\"mytool\")\n        .with_version(env!(\"CARGO_PKG_VERSION\"))\n});\n\nfn main() -> ExitCode {\n    if let Some(code) = SKILLS.intercept() {\n        return code;\n    }\n    ExitCode::SUCCESS\n}\n```\n\n`SkillSet::from_include_dir` is one of three ways in. Use `SkillSet::read_dir`\nfor a tool that does not embed its skills. Use `SkillSet::from_files` for any\nother embedding crate, and turn the `include_dir` feature off.\n\n## Four traps\n\nEach is silent. None produces an error at the point where it goes wrong.\n\n**An embedded file carries no mode.** A script arrives read-only. Any file\nstarting with `#!` is installed `0755`, and `with_executable` decides for a\nscript with no shebang.\n\n**`include_dir!` takes everything it finds.** A `.DS_Store` committed beside a\nskill is embedded with it. `SkillSet` refuses that skill and names the file, so\nthe failure is loud. It is still worth a `.gitignore` entry.\n\n**Installing writes into the skill's own `SKILL.md`.** Four `x-embedded-*` keys\ngo into the frontmatter, and they are what a later run compares against.\n`with_metadata(false)` removes them, and every installed copy then reads as\n`foreign`.\n\n**`intercept` reads the first argument and nothing else.** `mytool skill\ninstall` reaches it. `mytool -v skill install` does not. A tool's own help says\nnothing about the command either, so print `usage_hint` where your usage goes.\n\n## What a state means\n\n| State | The installed copy | What install does |\n| --- | --- | --- |\n| `missing` | Not there | Writes it |\n| `up-to-date` | Matches | Skips it |\n| `outdated` | Not what this binary would write | Overwrites it |\n| `modified` | Edited after installing | Skips it, and reports `Error::NeedsForce` |\n| `foreign` | Not something this tool wrote | Skips it, and reports `Error::NeedsForce` |\n| `orphaned` | Written by this tool, unchanged, and no longer embedded | Removes it |\n\n`outdated` covers a newer copy in the binary, and a file that lost its\nexecutable bit. `foreign` covers a hand-written skill, a directory with no\n`SKILL.md`, and one that cannot be read at all.\n\n> [!WARNING]\n> A full `install` deletes directories, not only writes them. Once your tool\n> drops or renames a skill, nothing else would ever reach the copy an earlier\n> version installed. `install` therefore removes it. Say so in your own release\n> notes when you drop one.\n>\n> It is claimed only when `x-embedded-by` names your tool, the contents still\n> hash to the recorded digest, and the binary has no skill of that name.\n> Anything edited since is left alone. So is anything another tool wrote, a\n> hand-written skill, and anything `.`-prefixed. `--force` does not change\n> that, and `install \u003Cname>` sweeps nothing it was not told to.\n\nA skipped skill does not stop the others. `install` returns one result per\nskill either way. The outcome beside them only says that something was left\nalone, so print the results first.\n\n## Check the result\n\nRun the real binary. The states are what the command reports, so a wiring\nmistake shows up here and in no test.\n\n```bash\ncargo build || exit 1\nBIN=target\u002Fdebug\u002Fmytool\n\n$BIN skill                      # the command, and the skills it carries\n$BIN skill install --dry-run    # where they would go\n$BIN skill install\n$BIN skill list                 # every embedded row should read up-to-date\n```\n\nAn `orphaned` row is a directory an earlier build of your tool installed and\nthis one no longer carries. On a first adoption there should be none. If there\nis one, check that `with_tool_name` matches what the earlier build used.\n\n> [!IMPORTANT]\n> Project scope resolves against the project, not the working directory. The\n> search walks up to the repository root, and the home directory is refused.\n> Run the check from a subdirectory as well. Every project scope run prints\n> `Project root:`, so compare that line between the two runs.\n\n## Traps when measuring\n\n**A skill installed by an older build may read as `modified`.** The recorded\ndigest was computed by that build. Changing what the digest covers changes the\nanswer, and the user sees a file they never edited.\n\n**`--dir` skips the agent table.** A check that passes with `--dir` says\nnothing about where a real install lands.\n\n**`--agent detected` depends on the machine.** It keeps the agents whose\ndirectory is already there, and falls back to every agent when it finds none.\nTwo machines give two answers for the same command.\n","# Adopting skill-embed\n\nWritten against **skill-embed 0.1**. Check the version first.\n\nRead [the README](https:\u002F\u002Fgithub.com\u002Fmpyw\u002Frust-skill-embed#readme) for the API.\nThis covers the decisions and the traps.\n\n## Decide three things first\n\n| Decision | Options | Default |\n| --- | --- | --- |\n| Front end | `intercept`, `run`, or the clap adapter | none |\n| Agents | every built-in agent, or a subset through `with_agents` | every one |\n| Command name | any word | `skill` |\n\nThe front end follows from what the tool already is.\n\n| The tool is | Use |\n| --- | --- |\n| A [clap](https:\u002F\u002Fdocs.rs\u002Fclap) tool | `skill_embed_clap::command` |\n| A tool with no framework | `intercept`, as the first thing `main` does |\n| A tool built on something with no hook | `intercept`, before that thing starts |\n| Something that parses its own arguments | `run`, which returns errors instead of exiting |\n\n## Wire it\n\nSkills live under `skills\u002F\u003Cname>\u002FSKILL.md`. That layout is the\n[Agent Skills specification](https:\u002F\u002Fagentskills.io\u002Fspecification), and the\ndiscovery reads no other.\n\n```rust\nstatic SKILLS_DIR: Dir\u003C'static> = include_dir!(\"$CARGO_MANIFEST_DIR\u002Fskills\");\n\nstatic SKILLS: LazyLock\u003CInstaller> = LazyLock::new(|| {\n    Installer::new(SkillSet::from_include_dir(&SKILLS_DIR).expect(\"valid skills\"))\n        .with_tool_name(\"mytool\")\n        .with_version(env!(\"CARGO_PKG_VERSION\"))\n});\n\nfn main() -> ExitCode {\n    if let Some(code) = SKILLS.intercept() {\n        return code;\n    }\n    ExitCode::SUCCESS\n}\n```\n\n`SkillSet::from_include_dir` is one of three ways in. Use `SkillSet::read_dir`\nfor a tool that does not embed its skills. Use `SkillSet::from_files` for any\nother embedding crate, and turn the `include_dir` feature off.\n\n## Four traps\n\nEach is silent. None produces an error at the point where it goes wrong.\n\n**An embedded file carries no mode.** A script arrives read-only. Any file\nstarting with `#!` is installed `0755`, and `with_executable` decides for a\nscript with no shebang.\n\n**`include_dir!` takes everything it finds.** A `.DS_Store` committed beside a\nskill is embedded with it. `SkillSet` refuses that skill and names the file, so\nthe failure is loud. It is still worth a `.gitignore` entry.\n\n**Installing writes into the skill's own `SKILL.md`.** Four `x-embedded-*` keys\ngo into the frontmatter, and they are what a later run compares against.\n`with_metadata(false)` removes them, and every installed copy then reads as\n`foreign`.\n\n**`intercept` reads the first argument and nothing else.** `mytool skill\ninstall` reaches it. `mytool -v skill install` does not. A tool's own help says\nnothing about the command either, so print `usage_hint` where your usage goes.\n\n## What a state means\n\n| State | The installed copy | What install does |\n| --- | --- | --- |\n| `missing` | Not there | Writes it |\n| `up-to-date` | Matches | Skips it |\n| `outdated` | Not what this binary would write | Overwrites it |\n| `modified` | Edited after installing | Skips it, and reports `Error::NeedsForce` |\n| `foreign` | Not something this tool wrote | Skips it, and reports `Error::NeedsForce` |\n| `orphaned` | Written by this tool, unchanged, and no longer embedded | Removes it |\n\n`outdated` covers a newer copy in the binary, and a file that lost its\nexecutable bit. `foreign` covers a hand-written skill, a directory with no\n`SKILL.md`, and one that cannot be read at all.\n\n> [!WARNING]\n> A full `install` deletes directories, not only writes them. Once your tool\n> drops or renames a skill, nothing else would ever reach the copy an earlier\n> version installed. `install` therefore removes it. Say so in your own release\n> notes when you drop one.\n>\n> It is claimed only when `x-embedded-by` names your tool, the contents still\n> hash to the recorded digest, and the binary has no skill of that name.\n> Anything edited since is left alone. So is anything another tool wrote, a\n> hand-written skill, and anything `.`-prefixed. `--force` does not change\n> that, and `install \u003Cname>` sweeps nothing it was not told to.\n\nA skipped skill does not stop the others. `install` returns one result per\nskill either way. The outcome beside them only says that something was left\nalone, so print the results first.\n\n## Check the result\n\nRun the real binary. The states are what the command reports, so a wiring\nmistake shows up here and in no test.\n\n```bash\ncargo build || exit 1\nBIN=target\u002Fdebug\u002Fmytool\n\n$BIN skill                      # the command, and the skills it carries\n$BIN skill install --dry-run    # where they would go\n$BIN skill install\n$BIN skill list                 # every embedded row should read up-to-date\n```\n\nAn `orphaned` row is a directory an earlier build of your tool installed and\nthis one no longer carries. On a first adoption there should be none. If there\nis one, check that `with_tool_name` matches what the earlier build used.\n\n> [!IMPORTANT]\n> Project scope resolves against the project, not the working directory. The\n> search walks up to the repository root, and the home directory is refused.\n> Run the check from a subdirectory as well. Every project scope run prints\n> `Project root:`, so compare that line between the two runs.\n\n## Traps when measuring\n\n**A skill installed by an older build may read as `modified`.** The recorded\ndigest was computed by that build. Changing what the digest covers changes the\nanswer, and the user sees a file they never edited.\n\n**`--dir` skips the agent table.** A check that passes with `--dir` says\nnothing about where a real install lands.\n\n**`--agent detected` depends on the machine.** It keeps the agents whose\ndirectory is already there, and falls back to every agent when it finds none.\nTwo machines give two answers for the same command.\n",{"name":5,"license":14,"description":7},"main","632bf1d49246d0e0901050581c22098372a89e33","skill-embed\u002Fskills\u002Fskill-embed-adoption","https:\u002F\u002Fgithub.com\u002Fmpyw\u002Frust-skill-embed","https:\u002F\u002Fgithub.com\u002Fmpyw","Interested in Go\u002FRust\u002FTypeScript, previously PHP\u002FLaravel","2026-09-26 09:55:19",{"source":8,"skillName":5,"commands":31,"prompt":41,"zipAvailable":42},[32,35,38],{"tool":33,"command":34},"npx","npx skills add mpyw\u002Frust-skill-embed --skill skill-embed-adoption",{"tool":36,"command":37},"bunx","bunx skills add mpyw\u002Frust-skill-embed --skill skill-embed-adoption",{"tool":39,"command":40},"pnpm","pnpm dlx skills add mpyw\u002Frust-skill-embed --skill skill-embed-adoption","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fmpyw\u002Frust-skill-embed\u002Fblob\u002Fmain\u002Fskill-embed\u002Fskills\u002Fskill-embed-adoption\u002FSKILL.md",true,[],[45,52,58,65,71],{"skillNo":46,"name":47,"nameZh":6,"description":48,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":49,"categories":50,"keywords":51,"publishedAt":18},"01M7D4WQVXQCCZBMJQ3CPW46CH","demo-skill","A skill used by this module's tests. It is not meant to be installed.","https:\u002F\u002Fgithub.com\u002Fmpyw\u002Frust-skill-embed\u002Fblob\u002Fmain\u002Fskill-embed\u002Ftestdata\u002Fskills\u002Fdemo-skill\u002FSKILL.md",[],[],{"skillNo":53,"name":54,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":55,"categories":56,"keywords":57,"publishedAt":18},"01M7D4WN697S1QVWE2TJB1672F","bare-skill","https:\u002F\u002Fgithub.com\u002Fmpyw\u002Frust-skill-embed\u002Fblob\u002Fmain\u002Fskill-embed\u002Ftestdata\u002Fskills\u002Fbare-skill\u002FSKILL.md",[],[],{"skillNo":59,"name":60,"nameZh":6,"description":61,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":62,"categories":63,"keywords":64,"publishedAt":18},"01M7D4WBHWQE3E534T2MXEE3DN","example-adoption","Stand-in skill for the demo-lint example. A real linter ships the skill that explains how to act on its diagnostics, which is the thing an agent cannot work out from the output alone.","https:\u002F\u002Fgithub.com\u002Fmpyw\u002Frust-skill-embed\u002Fblob\u002Fmain\u002Fexamples\u002Fdemo-lint\u002Fskills\u002Fexample-adoption\u002FSKILL.md",[],[],{"skillNo":66,"name":60,"nameZh":6,"description":67,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":68,"categories":69,"keywords":70,"publishedAt":18},"01M7D4W823WRD9EZ2TKXG5KXTZ","Stand-in skill for the demo-clap example. A real linter ships the skill that explains how to act on its diagnostics, which is the thing an agent cannot work out from the output alone.","https:\u002F\u002Fgithub.com\u002Fmpyw\u002Frust-skill-embed\u002Fblob\u002Fmain\u002Fexamples\u002Fdemo-clap\u002Fskills\u002Fexample-adoption\u002FSKILL.md",[],[],{"skillNo":72,"name":73,"nameZh":6,"description":74,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":75,"categories":76,"keywords":77,"publishedAt":18},"01M7D4W69KMFAWAKT1SCFHSAP9","readme-example","Gives the README's quick start something to embed. Nothing installs this skill.","https:\u002F\u002Fgithub.com\u002Fmpyw\u002Frust-skill-embed\u002Fblob\u002Fmain\u002Fdoctests\u002Fskills\u002Freadme-example\u002FSKILL.md",[],[]]