Files
Daniel Avila 0281438fc6 feat: Function Hooks section (experimental) — 10 hooks, CLI flag, blog (#867)
* feat: add Function Hooks component type (experimental) with 10 hooks and blog

Introduce "function-hooks" as a new first-class component type based on
the Anthropic proposal in anthropics/claude-code#91870 (TypeScript hooks
as Koa-style middleware on a $ engine interface). The feature is not
shipped; every API name is provisional and the section is labelled
experimental everywhere.

- 10 function hooks under cli-tool/components/function-hooks/
  (security, productivity, observability, ui, integrations, enterprise),
  each as a .md doc page plus the installable .ts/.tsx hooks-module
- CLI: --function-hook installs the module as a local plugin under
  .claude/plugins/<name>/ (plugin.json, hooks/hooks.json with modules)
  and prints the experimental warning
- Catalog generator: scan function-hooks and emit dashboard artifacts
- Dashboard: type wiring, /function-hooks page with experimental banner
  linking to the issue, Events/Module cards on the detail page,
  sitemap, cart, webmcp; track-download now accepts loop/function-hook
- Blog: "Claude Code Function Hooks (Experimental)" article with cover
- Docs: CLAUDE.md and cli-tool rule

Claude-Session: https://claude.ai/code/session_01YBoJbmNMcRCexuKpH9mQtW

* fix: store function hooks as hooks.json + module, install as skills-dir plugin

Function hooks are not markdown docs. Per the proposal's architecture doc,
a function hook is a plugin's hooks/hooks.json with a "modules" key naming
a .ts/.tsx hooks-module beside it. Align the catalog and the CLI with that:

- Components are now {name}.json (hooks.json + catalog description) plus
  the {name}.ts/.tsx module it names, mirroring how shell hooks store
  .json + .py/.sh. The .md docs are removed.
- Generator reads the named module into the per-component content file
  (module, moduleSource); the detail page renders the JSON and the module
  with the experimental notice.
- CLI --function-hook downloads hooks.json and every module it names,
  strips description, and writes the plugin to .claude/skills/{name}/,
  which Claude Code auto-loads as {name}@skills-dir per the plugins
  reference (no --plugin-dir needed).
- Docs and blog updated to the same install path.

Claude-Session: https://claude.ai/code/session_01YBoJbmNMcRCexuKpH9mQtW

* fix(function-hooks): address review findings

- CartSidebar: add --loop and --function-hook to TYPE_FLAGS so stack commands install them
- SendToRepoModal: export loops and function hooks (plugin layout with hooks.json + module)
- CLI: validate function hook identifier and hooks-module file names before building URLs/paths
- block-destructive-commands: rm rule now catches split flags, --recursive, quoted/trailing-slash targets, --no-preserve-root
- admin-capability-lockdown: shellPolicy deny|guardrail|allow; default withholds Bash, guardrail is labelled bypassable
- regenerate catalog

Claude-Session: https://claude.ai/code/session_01WsWgpvgeJgRMoLiYDcRXMU
2026-09-05 11:29:13 -04:00
..