claude/plugins/local/cheese-flow/skills/explore/SKILL.md
Code exploration orchestrator. Takes a free-form query and dispatches four parallel leaf sub-agents (graph, tilth, tokei, LSP) for structural, token-budgeted, statistical, and type-aware perspectives. Synthesizes into a structured XML artifact with codebase map, business context per module, and change callstack. Use when the user says "explore," "how does X work," "explain this codebase," "map the architecture," "what needs to change for X," "where is Y implemented," or invokes /explore. Do NOT use for implementation (fromage-cook), dead-code audits (ghostbuster), PR review (age), or onboarding narratives (onboard).
npx skillsauth add paulnsorensen/dotfiles exploreInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Free-form code exploration via four specialized sub-agents. One query in, one XML artifact out.
Architecture note: This is a SKILL (not an agent) so the four sub-agents are first-level agents, avoiding nested-agent depth issues.
| Agent | Specialty | Shines at |
|-------|-----------|-----------|
| explore-graph | code-review-graph MCP plugin | Multi-hop call chains, impact radius, flows, communities, architecture overview |
| explore-tilth | Tree-sitter smart reader | Token-budgeted file/symbol reads, callers, deps, structural map |
| explore-tokei | Language/file statistics | Size, language mix, mass concentration, largest files |
| explore-lsp | Language server navigation | Type-resolved definitions, references, hover, call hierarchy |
Tool division rule-of-thumb: LSP for single-hop precision, graph for multi-hop chains, tilth for budget-capped reads, tokei for scale.
"How does X work?" / "What is this codebase?" / "Where is Y implemented?"
Produces: <summary>, <stats>, <map>, <business>, optionally <flow>.
"What needs to change to add feature X?" / "How would I refactor Y?"
Produces everything from Understand mode plus <change-plan> with ordered steps and affected callers.
Detect change-plan mode by verb cues in the query: add, remove, change, refactor, extend, support, introduce, replace.
Extract from $ARGUMENTS:
--scope <dir>), defaults to .--budget <N>), defaults to 4000 tokens per sub-agent--out <path>), defaults to .claude/exploration/<slug>.xmlIf the question is empty, ask the user for one. Don't guess.
Run these three checks in parallel before dispatching sub-agents:
git status --porcelain — is the tree dirty?git rev-parse HEAD — what revision are we at?which tilth tokei — confirm CLIs are installedIf tilth or tokei are missing, report it and exit — don't fall back to grep. If the tree is dirty, note it in <sources> so the graph's freshness is clear.
Launch ALL FOUR sub-agents in a single message (one message, four Agent tool calls). Each sub-agent receives the same base context plus a tool-specific framing:
Agent(subagent_type="explore-graph", prompt="Query: <question>\nScope: <scope>\nMode: <mode>\nBudget hint: <budget>\n\nAnswer using code-review-graph. Run build_or_update_graph_tool once if the tree was modified. Return structured JSON per your agent protocol.")
Agent(subagent_type="explore-tilth", prompt="Query: <question>\nScope: <scope>\nMode: <mode>\nBudget: <budget>\n\nAnswer using tilth. Use --map for orientation, --callers/--deps for relationship queries, --expand for symbol reads. Always --json --budget. Return structured JSON per your agent protocol.")
Agent(subagent_type="explore-tokei", prompt="Query: <question>\nScope: <scope>\n\nRun tokei on the scope and return language breakdown, largest files, and mass concentration. Use --files --output json. Return structured JSON per your agent protocol.")
Agent(subagent_type="explore-lsp", prompt="Query: <question>\nScope: <scope>\nMode: <mode>\n\nAnswer type-aware questions using LSP. If the query is clearly multi-hop or architectural, defer to explore-graph (return confidence ~30 with a defer note). Return structured JSON per your agent protocol.")
Each sub-agent returns structured JSON only — no narrative. That keeps parent context clean.
Merge the four JSON payloads into one XML document per the schema below. Rules:
sources="graph lsp" attribute on the enclosing section.<notes severity="warn">.<change-path omitted="true" reason="query is not change-oriented"/>. Parser-stable is more important than compact.<, >, or & in text nodes.**bold**, no bullet characters.<structure> is tilth+tokei territory, <context> is graph territory, <change-path> blends LSP (ground truth) + graph (inferred edges). Label accordingly on each section.--out path (create parent dir if needed).Read it when needed.<?xml version="1.0" encoding="UTF-8"?>
<exploration
schema-version="1.0"
query="how does authentication work?"
generated-at="2026-04-08T12:34:56Z"
scope="."
mode="understand"
revision="abc1234"
dirty="false">
<!-- Provenance — one entry per sub-agent that actually ran -->
<sources>
<source id="graph" agent="explore-graph" confidence="84"
sequence="build_or_update_graph_tool,get_architecture_overview_tool,get_review_context_tool,get_impact_radius_tool"/>
<source id="tilth" agent="explore-tilth" confidence="78"
sequence="tilth --map --json,tilth UserSession --callers --json"/>
<source id="tokei" agent="explore-tokei" confidence="95"
sequence="tokei --files --output json"/>
<source id="lsp" agent="explore-lsp" confidence="88"
sequence="workspaceSymbol,goToDefinition,findReferences,callHierarchy"/>
</sources>
<summary confidence="82"><![CDATA[
Authentication flows from src/adapters/http/auth_handler.rs → src/domains/auth/session.rs →
src/domains/auth/token.rs. Sessions live 24h; refresh extends via TokenStore::issue.
]]></summary>
<!-- Structural facts: tilth + tokei territory -->
<structure sources="tilth tokei">
<stats>
<total files="312" code="48210" comments="8041" blanks="6120"/>
<lang name="Rust" files="180" code="32100" pct="66.6"/>
<lang name="Shell" files="45" code="6200" pct="12.9"/>
</stats>
<module name="auth" path="src/domains/auth" role="domain" code="1104">
<file path="src/domains/auth/index.rs" code="42" fingerprint="sha1:a3f9e2"/>
<file path="src/domains/auth/session.rs" code="342" fingerprint="sha1:b81c44">
<symbol name="UserSession" kind="struct" exported="true" line="12"/>
<symbol name="refresh" kind="method" parent="UserSession" exported="true" line="42"/>
</file>
<file path="src/domains/auth/token.rs" code="218" fingerprint="sha1:cc2217">
<symbol name="TokenStore" kind="trait" exported="true" line="8"/>
<symbol name="TokenStore::issue" kind="method" exported="true" line="55"/>
</file>
</module>
<module name="http" path="src/adapters/http" role="adapter" code="842">
<file path="src/adapters/http/auth_handler.rs" code="201" fingerprint="sha1:d41f09">
<symbol name="login" kind="fn" exported="true" line="34"/>
</file>
</module>
</structure>
<!-- Semantic / business context: graph territory -->
<context sources="graph">
<module name="auth">
<purpose><![CDATA[
Owns user session lifecycle, token refresh, and credential validation.
Business rule: sessions expire after 24h unless refreshed via TokenStore::issue.
]]></purpose>
<dependencies>
<dep module="http" reason="inbound credentials arrive via login handler"/>
<dep module="common" reason="uses shared error types"/>
</dependencies>
</module>
<module name="http">
<purpose><![CDATA[
HTTP transport layer. Translates REST requests into domain calls; enforces
rate limits on the login endpoint.
]]></purpose>
<dependencies>
<dep module="auth" reason="delegates credential verification"/>
</dependencies>
</module>
</context>
<!-- Optional: a named end-to-end flow. Emit sentinel if not applicable. -->
<flow name="login" sources="graph lsp" confidence="88">
<step order="1" file="src/adapters/http/auth_handler.rs" symbol="login" line="34">
<description>Receives POST /login, parses credentials, enforces rate limit</description>
</step>
<step order="2" file="src/domains/auth/session.rs" symbol="UserSession::create" line="18">
<description>Validates credentials against store, creates session</description>
</step>
<step order="3" file="src/domains/auth/token.rs" symbol="TokenStore::issue" line="55">
<description>Issues JWT with 24h expiry; persists refresh token</description>
</step>
</flow>
<!-- Optional: change path for a planned feature. LSP-confirmed edges carry ground truth. -->
<change-path feature="add OAuth2 support" sources="lsp graph" confidence="71">
<rationale><![CDATA[
Adding an OAuth2 provider requires a new adapter, a domain extension to accept
federated principals, and handler routing for the callback.
]]></rationale>
<step order="1" action="add" path="src/adapters/oauth2/provider.rs">
<rationale>New inbound adapter for OAuth2 callback</rationale>
</step>
<step order="2" action="modify" path="src/domains/auth/session.rs" symbol="UserSession::create">
<rationale>Accept an optional OAuth2 principal in addition to credentials</rationale>
</step>
<step order="3" action="modify" path="src/domains/auth/token.rs" symbol="TokenStore::issue">
<rationale>Claims must include an oauth2 issuer marker for federated tokens</rationale>
</step>
<edges>
<edge from="src/adapters/http/auth_handler.rs:login"
to="src/domains/auth/session.rs:UserSession::create"
kind="calls" lsp-confirmed="true"/>
<edge from="src/domains/auth/session.rs:UserSession::create"
to="src/domains/auth/token.rs:TokenStore::issue"
kind="calls" lsp-confirmed="true"/>
<edge from="src/adapters/oauth2/provider.rs"
to="src/domains/auth/session.rs:UserSession::create"
kind="calls" lsp-confirmed="false"/>
</edges>
</change-path>
<notes>
<note severity="info">No OAuth2 adapter exists — green-field slice needed under src/adapters/</note>
<note severity="warn">UserSession::refresh has 14 call sites — non-trivial ripple if its signature changes</note>
</notes>
</exploration>
Never drop a tag entirely. Emit a sentinel instead so downstream parsers have a stable tree:
<flow omitted="true" reason="query did not resolve a named flow"/>
<change-path omitted="true" reason="query is not change-oriented"/>
<source> in <sources> must reference an agent that actually ran. If a sub-agent failed, include it with confidence="0" and a matching <note severity="warn"> entry.<structure>, <context>, <flow>, <change-path>) carries sources="..." (space-separated agent ids) matching IDs from <sources>.<flow omitted="true"/>, <change-path omitted="true"/>. Never silently drop.fingerprint on <file> = SHA-1 of the file's content at exploration time. Enables reviewers to diff two runs and see which files changed underneath the artifact.<, >, or &.**bold**, no code fences, no bullet characters inside text nodes.name, kind, path/file, line, confidence, sources, then everything else.schema-version on the root — bump major on breaking changes, minor on additive fields.<notes severity="warn"> and use the higher-confidence value in the main body.The orchestrator's top-level <summary confidence="..."> is a weighted average:
Sub-agents that failed (confidence 0) contribute 0 and their weight is redistributed.
select(.key == "Total" | not) instead
of select(.key != "Total") — shell history expansion can mangle !=.Every run MUST produce:
--out (or default path), valid against the schema above.tools
Reconstruct what a past coding-agent session was doing so you can resume it — goal, files touched, last verified state, and the next step — by querying the session logs. Use when the user says "what was I working on", "recover that session", "reconstruct where I left off", "resume my last session", "what did that session change", "rebuild context from logs", or invokes /work-recovery. Report-only — it never scores or judges. Do NOT use for usage scoring (that is /skill-improver, /tool-efficiency, /prompt-analytics) or one-off interactive log queries (that is /session-analytics).
development
Curate this repo's hallouminate wiki (.hallouminate/wiki/, the repo:dotfiles:wiki corpus) — add or update architecture pages, per-harness docs, and gotchas. Use when the user says "update the wiki", "document this in the wiki", "refresh the harness docs", "add a wiki page", "curate the wiki", "the wiki is stale", or invokes /wiki-curator. Also use at session end to write back a non-obvious decision or gotcha worth preserving. Grounds the existing wiki first, follows one-topic-per-file conventions, verifies every external doc URL before writing, and reindexes. Do NOT use for general code search (that is cheez-search) or for editing AGENTS.md command reference.
tools
Audit how a tool, command, or MCP server is actually used across coding-agent sessions and produce calibrated recommendations — tool-vs-task fit, error forensics, fix recommendations, permission friction, MCP health, and token economics. Use when the user says "tool efficiency", "am I using X efficiently", "audit tool usage", "why does X keep failing", "how do I fix this error", "what should I change", "permission friction", "is this MCP worth it", "tool error rate", "fix recommendations", or invokes /tool-efficiency. Do NOT use for auditing a skill or agent definition (that is /skill-improver) or for one-off interactive log queries (that is /session-analytics).
tools
Analyze how prompts and skill routing behave across coding-agent sessions and produce calibrated recommendations — prompt-pattern analysis, routing accuracy, and knowledge gaps. Use when the user says "analyze my prompts", "prompt patterns", "is routing working", "which skill should have fired", "knowledge gaps", "what do I keep asking", or invokes /prompt-analytics. Do NOT use for auditing a single skill/agent definition (that is /skill-improver), tool/MCP efficiency (that is /tool-efficiency), or one-off interactive log queries (that is /session-analytics).