mirror of
https://github.com/davila7/claude-code-templates.git
synced 2026-09-19 01:30:23 +08:00
45fdddf98f
Anthropic renamed function hooks to "Claude Mods", committed to shipping them in weeks and published the built-in mods' source plus the full TypeScript declarations (anthropics/claude-code#91870, mods/ in the claude-code repo). This aligns our component type with that. Rename - Component type `function-hooks` -> `mods` (dir, catalog key, route /mods, CLI `--mod` with `--function-hook` kept as a hidden alias, tracking `mod`). Old URLs redirect via dashboard/public/_redirects. - Banners, blog, CLAUDE.md and .claude/rules updated from "proposal" to "early access behind CLAUDE_CODE_ENABLE_FUNCTION_HOOKS=1 (2.1.259+)". Format: one directory = one complete plugin (Anthropic's mods/ layout) - cli-tool/components/mods/{category}/{name}/ with .claude-plugin/plugin.json (name, description, userConfig), hooks/hooks.json, hooks/** (any number of files, relative imports), optional types/, tests/, README.md. - Generator: README.md is the content; every text file ships in the per-component content file (`files`), plus `modules` and `userConfig`. - CLI: recursive download of the plugin directory (like skills), written verbatim to .claude/skills/{name}/; validates manifest + hooks.json + modules. - Site: SkillExplorer generalized (componentType, mainFile, files) so the detail page shows README + the full file tree from the content file; SendToRepoModal writes the whole plugin. Modules rewritten against the real API - types/claude-code.d.ts (as /plugin-types writes it, 2.1.271), tsconfig and a CI job (mods-typecheck.yml) running tsc over every mod. - All 10 existing mods fixed to the shipped shapes ($.fs.read(path), $.http.fetch(url, init), $.ui.ask, { refuse } on plugin.register, Box/Text elements, {result}/{deny}/context, static engine.create withholding) and verified on Claude Code 2.1.272: claude plugin validate passes on all, and deny / modifying / after / cache / audit / withhold+refuse were exercised end to end with `claude -p --plugin-dir --debug-file`. - Options need `userConfig` in plugin.json and are read from user/managed settings (pluginConfigs[name].options), never project settings; documented. Games - games/cc-arcade vendored as-is (MIT, Seza Akgün) with two runtime fixes ($.clock.now() is a Promise in the 2.1.271 API). - games/{snake,tetris,2048,minesweeper,flappy,pong,invaders,typing-test, doom,pet}: each cc-arcade game as its own installable mod with its own command (/tetris, /snake, ...), attributed to the original author. - games/{pacman,tool-defense,diff-invaders}: new, written for aitmpl. Pac-Man with the original ghost behaviours; Tool Defense, a tower defense where every tool call Claude makes is an enemy; Diff Invaders, where every Edit/Write's added lines become the alien formation. Pure logic with bun tests, surface-module boards, typechecked and validated. Catalog regenerated (24 mods).