Add a docs-lookup subagent for wide documentation lookups - #3
Draft
abernier wants to merge 1 commit into
Draft
Conversation
A question that spans a drei helper, the R3F hook under it and the zustand store behind that pulls three index listings and several page bodies into whatever the session was actually working on. `docs-lookup` reads those in its own context and reports back. It is deliberately not the default path. One index plus one page is smaller than the round trip through another agent, and a summary of a signature is the failure mode this component exists to prevent — so the agent is told to quote verbatim and link, and SKILL.md keeps the lookup inline unless the reading is wide (3+ pages, or 2+ libraries). The agent carries no copy of the coverage table: it preloads the `docs` skill, which stays the single place recording which libraries the server serves and when that was last checked. Extends the test harness to agents, covering what fails silently rather than loudly: `tools` entries must use the scoped `mcp__plugin_<plugin>_<server>__<tool>` form derived from the manifests, and must name real built-in tools — a list resolving to nothing stops the agent launching. Preloaded skills must exist, since a missing one is skipped with only a debug-log warning. `hooks`, `mcpServers` and `permissionMode` must be absent, since plugin agents ignore them. And the coverage table must stay in one file. Each invariant was mutation-checked: breaking it fails the test that claims to guard it, and no other. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TnvYiz7aGhnBTK2tzExHis
abernier
force-pushed
the
claude/sous-agent-docs-onxyyw
branch
from
August 10, 2026 06:04
4e5ab69 to
4935a15
Compare
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.
Stacked on #4 — review that one first; this diff is only the agent.
Adds
agents/docs-lookup.mdand extends #4's test harness to cover agents.Why
A question that spans a drei helper, the R3F hook under it and the zustand store behind that pulls three index listings and several page bodies into whatever the session was actually working on.
drei's index alone is 134 lines. The subagent reads those in its own context and reports back.It is deliberately not the default path. One index plus one page is smaller than the round trip through another agent, and a summary of a signature is precisely the failure mode this component exists to prevent — the caller would then write code from a paraphrase, which is memory at one remove. So:
SKILL.mdkeeps the lookup inline by default and hands off only when the reading is wide — 3+ pages, or 2+ libraries.Read-only (
ListMcpResourcesTool,ReadMcpResourceTool,get_page_content), Haiku, capped at 12 turns.Single source of truth
The agent carries no copy of the coverage table. It preloads the
docsskill via theskills:frontmatter field, soSKILL.mdstays the one place recording which libraries the server actually serves and when that was last checked. A test enforces the table doesn't get copied.Tests
Extends the harness to agents, same principle — catch what fails silently at runtime rather than loudly at load:
toolsentries use the scopedmcp__plugin_{plugin}_{server}__{tool}formhooks/mcpServers/permissionModeabsent@pmndrs:docs-lookupshouldn't read as a twin of/pmndrs:docsMutation-checked — breaking an invariant fails the test that claims to guard it, and no other:
23/23 green locally,
claude plugin validate .included.Worth a look during review
Not in this stack
An eval — N questions with known documented answers, replayed through
claude -pwith and without each component, counting lookups triggered and signatures quoted correctly. It's the only thing that would settle both the delegation threshold and whether the skill changes behaviour at all. It needs model calls, so it'd benpm run evalby hand rather than CI.