Skip to content

feat: the Skills page shows the flow of the hooks and the agents' activity (ADR-0098) - #483

Merged
7schmiede merged 3 commits into
mainfrom
feat/skills-flow
Nov 8, 2026
Merged

7schmiede merged 3 commits into
mainfrom
feat/skills-flow

Conversation

@7schmiede

Copy link
Copy Markdown
Member

What and why

A developer could not see what devstack does for their coding agent while it works: the Skills page listed how many hooks a skill carries, not when they give their text, under which condition, or what followed; a silent hook (an upstream not accepted) said nothing about why.

  • Tab Flow on the Skills page. The hooks of the skills switched on, by phase: a session starts, a prompt matches (grouped by pattern), a lane stops, a session ends. Each hook is a node in its skill's colour, with a tooltip (when, condition, how often, which agents, the start of its text, when it was last given); a hook that is not given is greyed with why. Below the flow: the tool calls through devstack, by the skill whose upstream they use.
  • Activity beside it, by session: each hook devstack gave and each tool call through devstack mcp (time, ms, ok/failed); a click on a hook narrows the list to it (its firings, its upstream's calls, lane_stop for a lane-stop hook).
  • Records. devstack hook writes a line per session start, per prompt it gave text for, per session-end kept, per lane-stop text; devstack mcp one per tools/call. Each process appends to its own activity/<day>-<pid>.jsonl in the hub's state; a write error goes to the hub's log, never to the hook or the call. Files older than seven days go.
  • API. GET /hub/activity?tree=&session=&since= (sessions and records; a record without a session is put to the latest session started in its working tree), hook_details per skill on /hub/skills, and an activity event on /hub/events (the hub looks at the folder every two seconds while a dashboard listens).

Review card

# Category Point Beats Reversing costs
1 trust The activity holds only what happened (event, skill, hook or tool name, duration, result), never a prompt, a hook's text, a tool's arguments or its answer; it stays on this machine, is not in the pool's telemetry, and goes after seven days. A full trace with arguments and answers; sending it to the pool Low: fields can be added later with a card
2 concept A session is the agent's session_id from a hook's input; a tool call (and a lane's stop) is put to the latest session that started in its working tree before it. A session id on the MCP connection (none known to be passed) Medium: two agents in one working tree at once are not told apart
3 contract GET /hub/skills carries per hook its event, condition and the start of its text; GET /hub/activity is new, and /hub/events sends activity. Working the flow out in the browser from the archives Low: additive
4 term The Skills page gets a tab "Flow". A tab on a working tree's page Low

Approved by the owner in the conversation on 2026-11-06: points 1, 2, 3 and 4.

Decided on my own: a prompt's hooks are grouped by their pattern within one phase (no guessing what a pattern means); a session start is recorded even when it gave no text (else its tool calls could not be put to it); record times are Unix ms as u64 (an internally tagged record cannot read a u128 back); at most the latest 500 records per answer; the text preview is 160 characters. Recorded as ADR-0098. Stage 3 of #482 (the agent's built-in tools through PostToolUse) is not part of it.

Checked

  • cargo fmt --check, cargo clippy --workspace --all-targets -D warnings, cargo test -p devstack-hub -p devstack-node, cargo test -p devstack --bin devstack; in ui/: typecheck, vitest (new flow.test.ts, SkillsFlow.test.ts), build.
  • Unit tests: one file per process, read back in order; a record has no field for a prompt, text, argument or answer; the dispatcher's test checks the records of starts and prompts and that neither the hook text nor the prompt is in the files; tool calls and a lane's stop go to the latest session started in their tree, with the upstream and the skills naming it.
  • Windows 11, the real path with this build against a temporary hub state (LOCALAPPDATA pointed at a temp folder): devstack hook session-start, prompt-submit (a prompt with a word to look for), session-end, and an MCP tools/call over stdio each wrote their line in their own file; the prompt's words and the hook texts are not in them.
  • Not checked: GET /hub/activity from a running hub of this build. A hub started against the temporary state would sync the skills there and could take the real hook entries out of ~/.claude/settings.json; the view is covered by the unit test of the attribution.
  • The tab in this worktree's lane against the mock hub, headless Edge: four phases with five hooks of three skills (work-session green, work-issue blue, session-end violet), the second session-end hook greyed ("not given: see why"), "given 25 min ago" etc. per node, the tool calls by skill below, the activity list with a session selector beside it. The tooltip is not in the screenshot (headless has no hover); its content is covered by SkillsFlow.test.ts.

Closes #482

🤖 Generated with Claude Code

7schmiede and others added 3 commits November 6, 2026 18:34
…ivity (ADR-0098)

A tab Flow on the Skills page draws the hooks of the skills switched on by
when they give their text, with a tooltip per hook (when, condition, how
often, agents, the start of its text) and why a hook is not given. Beside
it, what devstack did for the agent: the dispatcher records each session
start, each hook it gave and each session end kept; `devstack mcp` each
tool call (name, ms, ok). One file per process and day in the hub's state,
kept for a week; never a prompt, a text, an argument or an answer.
GET /hub/activity puts a record without a session to the latest session
started in its working tree; /hub/skills carries hook_details; the
activity event tells the page to read again.

Closes #482

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Two skills naming the same upstream listed its calls twice.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The node's opacity dimmed the tooltip inside it too; the node's parts are
dimmed instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@7schmiede
7schmiede merged commit e2eb58f into main Nov 8, 2026
@7schmiede
7schmiede deleted the feat/skills-flow branch November 8, 2026 13:04
@7schmiede 7schmiede mentioned this pull request Nov 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Skills: a flow view of the hooks, with the agent's activity linked to it

1 participant