[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M723348SH0FHV6DM8G7VKA8Q":3,"skill-same:01M723348SH0FHV6DM8G7VKA8Q":94},{"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":28,"commitSha":29,"skillDirectory":30,"forksCount":31,"repositoryHtmlUrl":32,"repositoryHomepageUrl":33,"ownerHtmlUrl":34,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":35,"install":36,"resources":49},"01M723348SH0FHV6DM8G7VKA8Q","askit-build-hook",null,"Creates and improves event-driven hooks (Advanced tier) for a plugin to the Advanced Skill Library Standard. Use when you need to add a hook, enforce a guard on a tool or session event, inject context, or document a hook's event, scope, and failure behavior.","product-on-purpose\u002Fagent-skills-toolkit","product-on-purpose","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F253892650?v=4","01M7230Q4442AHBADCVFJCS277","Product on Purpose","01M7230Q4SFDBKY7586D5M7EFX",3,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fproduct-on-purpose\u002Fagent-skills-toolkit\u002Fblob\u002Fmain\u002Fskills\u002Faskit-build-hook\u002FSKILL.md",[],[],"2026-11-10 18:39:20",false,"---\nname: askit-build-hook\ndescription: Creates and improves event-driven hooks (Advanced tier) for a plugin to the Advanced Skill Library Standard. Use when you need to add a hook, enforce a guard on a tool or session event, inject context, or document a hook's event, scope, and failure behavior.\nmetadata:\n  version: 0.1.0\n  tier: universal\n  audience: advanced\n---\n\n# askit-build-hook\n\n## Purpose\nAuthor a plugin's hooks: event-driven enforcement or context injection (Standard sec 3.5). Hooks are an Advanced-tier capability. Two modes: `create` scaffolds a hook and its registration; `improve` raises an existing hook toward the bar (documentation, idempotency, actionable block messages). The hook SKILL is portable; what it authors is primarily a Claude capability (31 events) with a smaller Codex event set. Authoring depth is in [references\u002Fauthoring-hooks.md](references\u002Fauthoring-hooks.md). Follows the shared builder contract ([..\u002F..\u002Fdocs\u002Freference\u002Fbuilder-pattern.md](..\u002F..\u002Fdocs\u002Freference\u002Fbuilder-pattern.md)).\n\n## When to use\nWhen the user asks to add, scaffold, author, or improve a hook (a PreToolUse \u002F PostToolUse \u002F Stop \u002F SessionStart guard, a context injector, or any event-driven automation) for a plugin.\n\n## create mode\n1. Brief interview: the event (for example PreToolUse), the trigger or matcher, the hook type (`command` \u002F `http` \u002F `mcp_tool` \u002F `prompt` \u002F `agent`), the scope (what it guards or injects), and the failure behavior (fail-safe block vs warn). Skip the interview if these are in context.\n2. Author the hook and its registration. A plugin registers hooks in `hooks\u002Fhooks.json` using `${CLAUDE_PLUGIN_ROOT}`; copy `templates\u002Fhooks.json` if none exists. Document the event, trigger, scope, and failure behavior (Standard sec 3.5 MUST).\n3. For a blocking hook (for example a PreToolUse deny), write an ACTIONABLE message that states what was blocked and how to proceed. Make the hook idempotent where the event can repeat.\n4. Register the hook in `library.json` `components.hooks` as `{ name, version, tier, status }`.\n5. Targets: Claude supports 31 events. Codex supports a smaller set (PreToolUse, PostToolUse, Pre\u002FPostCompact, SessionStart, SubagentStart\u002FStop, UserPromptSubmit, Stop, PermissionRequest). Verify current Codex plugin-hook ingestion at build time (a known caveat) and scope `agent-targets` accordingly.\n6. Assess with `node scripts\u002Fevaluate.mjs . --json`. Hook documentation and idempotency are graded at the Advanced tier; the deterministic hook check lands with Gold self-hosting (Phase 5).\n\n## improve mode\n1. Run `node scripts\u002Fevaluate.mjs . --json` and read the report.\n2. Fix what it flags. For hooks specifically, confirm the event \u002F trigger \u002F scope \u002F failure are documented (sec 3.5), the block message is actionable, and the hook is idempotent.\n3. Re-run to confirm.\n\n## Scope\nHooks are Advanced-tier and the most agent-specific component: Claude's event set is the richest, Codex covers a subset, and the wider ecosystem does not support hooks. A hook MUST document its event, trigger, scope, and failure behavior, and a blocking hook MUST emit an actionable message (Standard sec 3.5). Least privilege applies (sec 9): a hook's command runs with the narrowest scope needed.\n","# askit-build-hook\n\n## Purpose\nAuthor a plugin's hooks: event-driven enforcement or context injection (Standard sec 3.5). Hooks are an Advanced-tier capability. Two modes: `create` scaffolds a hook and its registration; `improve` raises an existing hook toward the bar (documentation, idempotency, actionable block messages). The hook SKILL is portable; what it authors is primarily a Claude capability (31 events) with a smaller Codex event set. Authoring depth is in [references\u002Fauthoring-hooks.md](references\u002Fauthoring-hooks.md). Follows the shared builder contract ([..\u002F..\u002Fdocs\u002Freference\u002Fbuilder-pattern.md](..\u002F..\u002Fdocs\u002Freference\u002Fbuilder-pattern.md)).\n\n## When to use\nWhen the user asks to add, scaffold, author, or improve a hook (a PreToolUse \u002F PostToolUse \u002F Stop \u002F SessionStart guard, a context injector, or any event-driven automation) for a plugin.\n\n## create mode\n1. Brief interview: the event (for example PreToolUse), the trigger or matcher, the hook type (`command` \u002F `http` \u002F `mcp_tool` \u002F `prompt` \u002F `agent`), the scope (what it guards or injects), and the failure behavior (fail-safe block vs warn). Skip the interview if these are in context.\n2. Author the hook and its registration. A plugin registers hooks in `hooks\u002Fhooks.json` using `${CLAUDE_PLUGIN_ROOT}`; copy `templates\u002Fhooks.json` if none exists. Document the event, trigger, scope, and failure behavior (Standard sec 3.5 MUST).\n3. For a blocking hook (for example a PreToolUse deny), write an ACTIONABLE message that states what was blocked and how to proceed. Make the hook idempotent where the event can repeat.\n4. Register the hook in `library.json` `components.hooks` as `{ name, version, tier, status }`.\n5. Targets: Claude supports 31 events. Codex supports a smaller set (PreToolUse, PostToolUse, Pre\u002FPostCompact, SessionStart, SubagentStart\u002FStop, UserPromptSubmit, Stop, PermissionRequest). Verify current Codex plugin-hook ingestion at build time (a known caveat) and scope `agent-targets` accordingly.\n6. Assess with `node scripts\u002Fevaluate.mjs . --json`. Hook documentation and idempotency are graded at the Advanced tier; the deterministic hook check lands with Gold self-hosting (Phase 5).\n\n## improve mode\n1. Run `node scripts\u002Fevaluate.mjs . --json` and read the report.\n2. Fix what it flags. For hooks specifically, confirm the event \u002F trigger \u002F scope \u002F failure are documented (sec 3.5), the block message is actionable, and the hook is idempotent.\n3. Re-run to confirm.\n\n## Scope\nHooks are Advanced-tier and the most agent-specific component: Claude's event set is the richest, Codex covers a subset, and the wider ecosystem does not support hooks. A hook MUST document its event, trigger, scope, and failure behavior, and a blocking hook MUST emit an actionable message (Standard sec 3.5). Least privilege applies (sec 9): a hook's command runs with the narrowest scope needed.\n",{"name":5,"metadata":24,"description":7},{"tier":25,"version":26,"audience":27},"universal","0.1.0","advanced","main","b0a696723b1155d08503a8441c981998f9d13c34","skills\u002Faskit-build-hook",0,"https:\u002F\u002Fgithub.com\u002Fproduct-on-purpose\u002Fagent-skills-toolkit","https:\u002F\u002Fproduct-on-purpose.github.io\u002Fagent-skills-toolkit","https:\u002F\u002Fgithub.com\u002Fproduct-on-purpose","2026-11-14 15:02:57",{"source":8,"skillName":5,"commands":37,"prompt":47,"zipAvailable":48},[38,41,44],{"tool":39,"command":40},"npx","npx skills add product-on-purpose\u002Fagent-skills-toolkit --skill askit-build-hook",{"tool":42,"command":43},"bunx","bunx skills add product-on-purpose\u002Fagent-skills-toolkit --skill askit-build-hook",{"tool":45,"command":46},"pnpm","pnpm dlx skills add product-on-purpose\u002Fagent-skills-toolkit --skill askit-build-hook","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fproduct-on-purpose\u002Fagent-skills-toolkit\u002Fblob\u002Fmain\u002Fskills\u002Faskit-build-hook\u002FSKILL.md",true,[50,56,62,66,70,74,78,82,86,90],{"path":51,"resourceType":52,"resourceTypeDesc":53,"sizeBytes":54,"sourceHtmlUrl":55},"examples\u002Fanti-wrong-exit-code.md","REFERENCE","参考文档",5381,"https:\u002F\u002Fgithub.com\u002Fproduct-on-purpose\u002Fagent-skills-toolkit\u002Fblob\u002Fmain\u002Fskills\u002Faskit-build-hook\u002Fexamples\u002Fanti-wrong-exit-code.md",{"path":57,"resourceType":58,"resourceTypeDesc":59,"sizeBytes":60,"sourceHtmlUrl":61},"examples\u002Fanti-wrong-exit-code.mjs","SCRIPT","脚本",1414,"https:\u002F\u002Fgithub.com\u002Fproduct-on-purpose\u002Fagent-skills-toolkit\u002Fblob\u002Fmain\u002Fskills\u002Faskit-build-hook\u002Fexamples\u002Fanti-wrong-exit-code.mjs",{"path":63,"resourceType":52,"resourceTypeDesc":53,"sizeBytes":64,"sourceHtmlUrl":65},"examples\u002Fgolden-1-generated-file-guard.md",4833,"https:\u002F\u002Fgithub.com\u002Fproduct-on-purpose\u002Fagent-skills-toolkit\u002Fblob\u002Fmain\u002Fskills\u002Faskit-build-hook\u002Fexamples\u002Fgolden-1-generated-file-guard.md",{"path":67,"resourceType":58,"resourceTypeDesc":59,"sizeBytes":68,"sourceHtmlUrl":69},"examples\u002Fgolden-1-generated-file-guard.mjs",3102,"https:\u002F\u002Fgithub.com\u002Fproduct-on-purpose\u002Fagent-skills-toolkit\u002Fblob\u002Fmain\u002Fskills\u002Faskit-build-hook\u002Fexamples\u002Fgolden-1-generated-file-guard.mjs",{"path":71,"resourceType":52,"resourceTypeDesc":53,"sizeBytes":72,"sourceHtmlUrl":73},"examples\u002Fgolden-2-trailing-whitespace-formatter.md",5831,"https:\u002F\u002Fgithub.com\u002Fproduct-on-purpose\u002Fagent-skills-toolkit\u002Fblob\u002Fmain\u002Fskills\u002Faskit-build-hook\u002Fexamples\u002Fgolden-2-trailing-whitespace-formatter.md",{"path":75,"resourceType":58,"resourceTypeDesc":59,"sizeBytes":76,"sourceHtmlUrl":77},"examples\u002Fgolden-2-trailing-whitespace-formatter.mjs",2596,"https:\u002F\u002Fgithub.com\u002Fproduct-on-purpose\u002Fagent-skills-toolkit\u002Fblob\u002Fmain\u002Fskills\u002Faskit-build-hook\u002Fexamples\u002Fgolden-2-trailing-whitespace-formatter.mjs",{"path":79,"resourceType":52,"resourceTypeDesc":53,"sizeBytes":80,"sourceHtmlUrl":81},"examples\u002Fgolden-3-stop-uncommitted-notifier.md",4815,"https:\u002F\u002Fgithub.com\u002Fproduct-on-purpose\u002Fagent-skills-toolkit\u002Fblob\u002Fmain\u002Fskills\u002Faskit-build-hook\u002Fexamples\u002Fgolden-3-stop-uncommitted-notifier.md",{"path":83,"resourceType":58,"resourceTypeDesc":59,"sizeBytes":84,"sourceHtmlUrl":85},"examples\u002Fgolden-3-stop-uncommitted-notifier.mjs",1968,"https:\u002F\u002Fgithub.com\u002Fproduct-on-purpose\u002Fagent-skills-toolkit\u002Fblob\u002Fmain\u002Fskills\u002Faskit-build-hook\u002Fexamples\u002Fgolden-3-stop-uncommitted-notifier.mjs",{"path":87,"resourceType":52,"resourceTypeDesc":53,"sizeBytes":88,"sourceHtmlUrl":89},"README.md",633,"https:\u002F\u002Fgithub.com\u002Fproduct-on-purpose\u002Fagent-skills-toolkit\u002Fblob\u002Fmain\u002Fskills\u002Faskit-build-hook\u002FREADME.md",{"path":91,"resourceType":52,"resourceTypeDesc":53,"sizeBytes":92,"sourceHtmlUrl":93},"references\u002Fauthoring-hooks.md",12939,"https:\u002F\u002Fgithub.com\u002Fproduct-on-purpose\u002Fagent-skills-toolkit\u002Fblob\u002Fmain\u002Fskills\u002Faskit-build-hook\u002Freferences\u002Fauthoring-hooks.md",[95,102,107,112,119,126],{"skillNo":96,"name":97,"nameZh":6,"description":98,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":99,"categories":100,"keywords":101,"publishedAt":19},"01M723BRSVFQ2KRQ8KKY42R6XB","fx-demo","A fixture skill that exists so the re-derived manifest has a component list to compare. Use only from tests\u002Funit\u002Fself-consistency.test.mjs.","https:\u002F\u002Fgithub.com\u002Fproduct-on-purpose\u002Fagent-skills-toolkit\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fself-consistency\u002Frepaired\u002Fskills\u002Ffx-demo\u002FSKILL.md",[],[],{"skillNo":103,"name":97,"nameZh":6,"description":98,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":104,"categories":105,"keywords":106,"publishedAt":19},"01M723BPZ1NQDZSEF21D3YP2VF","https:\u002F\u002Fgithub.com\u002Fproduct-on-purpose\u002Fagent-skills-toolkit\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fself-consistency\u002Fpre-fix\u002Fskills\u002Ffx-demo\u002FSKILL.md",[],[],{"skillNo":108,"name":97,"nameZh":6,"description":98,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":109,"categories":110,"keywords":111,"publishedAt":19},"01M723BNCZXT3BM577HJYESV08","https:\u002F\u002Fgithub.com\u002Fproduct-on-purpose\u002Fagent-skills-toolkit\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fself-consistency\u002Fbody-drift\u002Fskills\u002Ffx-demo\u002FSKILL.md",[],[],{"skillNo":113,"name":114,"nameZh":6,"description":115,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":116,"categories":117,"keywords":118,"publishedAt":19},"01M723BKWKX9JG10YQ6NK79ZB6","sf-caller","Calls the worker subagent to do a thing. Use when delegating work to sf-worker.","https:\u002F\u002Fgithub.com\u002Fproduct-on-purpose\u002Fagent-skills-toolkit\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fgolden\u002Fsubagent-fixture\u002Fskills\u002Fsf-caller\u002FSKILL.md",[],[],{"skillNo":120,"name":121,"nameZh":6,"description":122,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":123,"categories":124,"keywords":125,"publishedAt":19},"01M723BJNDZHEJTNBJP6ZJA8WM","sf-do-thing","Converts CSV input into a formatted summary. Use when the user asks to summarize or tabulate spreadsheet data.","https:\u002F\u002Fgithub.com\u002Fproduct-on-purpose\u002Fagent-skills-toolkit\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fgolden\u002Fsilver-fixture\u002Fskills\u002Fsf-do-thing\u002FSKILL.md",[],[],{"skillNo":127,"name":128,"nameZh":6,"description":129,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":130,"categories":131,"keywords":132,"publishedAt":19},"01M723BH7BYXT0A05PG6QH6B98","root-skill-plugin","Summarizes a changelog section into one release-note sentence. Use when the user asks to condense a list of changelog bullets into a single announcement line.","https:\u002F\u002Fgithub.com\u002Fproduct-on-purpose\u002Fagent-skills-toolkit\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fgolden\u002Froot-skill-plugin\u002FSKILL.md",[],[]]