Repository navigation
feat(pool): a skill carries hooks that give text to the agents (ADR-0094) - #454
Merged
Merged
Conversation
…094) A `hooks.toml` beside a skill's SKILL.md names texts for the agent's context at a session's start or on a prompt matching a pattern, once a session or once per match, optionally only while a pool's upstream is accepted. The coordinator checks the file at the fetch; the hook shares its skill's acceptance, switch, repositories and updates. Each hub writes one entry per event, `devstack hook <event> --agent <id>`, into the hook configuration of Claude Code and Codex when switched on; the dispatcher picks the texts from the hub's state on disk and never holds up a prompt. No command of a pool runs on a member's machine. The Skills page and `devstack doctor` show the hooks and the agents that get none. Refs #453 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #453.
A pool's skill can carry hooks: a
hooks.tomlbeside itsSKILL.mdnames texts that Claude Code and Codex get in their context at a session's start or on a prompt that matches a pattern. This is for routines that must not depend on the model deciding to load a skill (a session timer, a ticket checklist).Review card
The owner approved all six points in the conversation on 2026-11-05 ("accepted, so bauen").
hooks.tomlin its skill's folder and shares the skill's fate: packed, accepted, switched on and off (ADR-0077), bound to repositories (metadata.repos) and updated with it.devstack hook <event> --agent <id>; this dispatcher decides on each call which hooks apply (skill installed and on,cwdin a bound repository, upstream accepted, pattern matches, not given yet) and prints their texts..claude/settings.local.json.[[hook]]withevent(session-startorprompt-submit),match(a regex on the prompt,prompt-submitonly),once(sessionormatch),upstream(optional),contextorcontext_file(a file in the skill's folder), at most 2000 characters a hook.[agent.hooks](devstack's own section ofagents.toml, like[agent.open]), first Claude Code and Codex; the Skills page anddoctorsay which agent switched on gets none.Decided on my own, not on the card (also listed in ADR-0094):
devstackfrom PATH, not the binary's path. A path changes with an update, and Codex would then ask to trust the entry again.clearorcompactis given the texts again.oncedefaults tomatchfor a hook with a pattern, otherwise tosession.hooks.toml), like devstack's other files. It allows at most 8 hooks per skill, rejects unknown keys (such ascommand), and a pattern may be at most 500 characters.serde_jsonfeatureraw_valueandindexmap). The user's own hooks stay. A file that is not JSON is left alone; the error shows on the Skills page only when an entry should go into it.What changed
devstack-node::hooks: the format and its checks.packreads the file when it fetches a set; a wrong file leaves the skill out, with the reason.SkillEntry.hooks(added field, read as 0 when missing) gives the number of hooks.devstack-hub::agenthooks: writes the index (agent-hooks.json) and the entries in~/.claude/settings.jsonand~/.codex/hooks.json, and holds the dispatcher.poolskills::syncreads each wanted skill's hooks from the archive of the version the user agreed to.Upstreams::pool_acceptedanswers the upstream check.devstack hook <event> --agent <id>(hidden): always exits 0.agents.toml:[agent.hooks]for Claude Code and Codex;scripts/sync-agents.pykeeps this section when the table is taken again.devstack doctor: lists which agents get the hooks, the Codex/hookstrust step, agents switched on that get none, and warns whendevstackis not on PATH.docs/pool.md(A skill's hooks),docs/dashboard-api.md, CHANGELOG.Tests
cargo testfor devstack-node, devstack-hub, devstack-skills and devstack: green.cargo clippy --workspace --all-targetsandcargo fmt --check: clean.npm run typecheckandvitest run: green.hooks.tomlat the fetch;settings.jsonand out again, with the key order kept and nothing written when nothing changes;devstack hookwithout an index takes about 40 ms, prints nothing and exits 0.Not tested here: a real Claude Code or Codex session running the entry, and macOS (the CI covers it).
🤖 Generated with Claude Code