Skip to content

Split SKILL.md (1,114 lines) into a core skill + on-demand references/ for progressive disclosure #1641

Open

Description

@vickaul-ai

The installed Claude Code skill (~/.claude/skills/graphify/SKILL.md, v0.8.14) is a single
1,114-line file. Claude Code loads the whole body every time the skill fires, and its trigger is
deliberately broad ("any question about a codebase … especially if graphify-out/ exists"), so a
quick one-line graph query pays the context cost of the entire pipeline documentation
(~10–12k tokens).

Agent Skills' progressive-disclosure convention handles this: keep the always-needed core in
SKILL.md and move branch-specific documentation into references/ files that the model reads
only when that branch is taken.

Suggested split (v0.8.14 line ranges):

Content Lines Destination
Usage, "what graphify is for", pipeline Steps 0–9 1–~765 keep in SKILL.md
Subagent extraction-prompt template ~332–397 references/extraction-prompt.md
--update incremental rebuild ~786–943 references/subcommands.md
--cluster-only ~947–955 references/subcommands.md
query / path / explain / add ~959–1053 references/subcommands.md
--watch ~1055–1074 references/subcommands.md
git hook integration ~1076–1088 references/subcommands.md
CLAUDE.md integration ~1092–1105 references/subcommands.md

Each moved section is replaced in SKILL.md by a one-line pointer, e.g.
For --update / --watch / query / git-hook / CLAUDE.md integration, read references/subcommands.md.

This keeps the common invocation (build or query a graph) at roughly 60% of the current size
while making the rarely-used branches free until needed. Happy to PR this if the structure is
agreeable.

Activity

  1. shojicantos commented on Sep 11, 2026

    @shojicantos

    Follow-up as of v0.9.54: most of this proposal has shipped — references/ now carries update.md, query.md, add-watch.md, hooks.md, exports.md, github-and-merge.md, transcribe.md, extraction-spec.md, each behind a one-line pointer. Nice.

    The remaining cost is the part the original table said to keep inline. Measured on the installed skill:

    • SKILL.md: 41,276 chars total
    • ## What You Must Do When Invoked (Steps 0–9, B0–B3 cache/dispatch/merge, health check, labelling, manifest): 34,308 chars
    • ## For /graphify query: 769 chars

    The description routes every codebase question here and the body's own fast path says: if graphify-out/graph.json exists and it's a question, skip Steps 1–5 and go to query. So the most common invocation — a query against an existing graph — loads ~34 KB (~8.5K tokens) of build steps it never runs.

    Proposed second cut, same shape as the first:

    Keep in SKILL.md (≤ ~6 KB): Usage; What graphify is for; the dispatch logic at the top of "What You Must Do" (--help, fast path, default ., GitHub URL → Step 0); Honesty Rules; Interpreter guard; the existing one-line routers for query / update / add / hooks.

    Move to references/build.md, loaded only when a build actually happens (no graph.json, or an explicit path/URL/--update/--cluster-only): Step 1 install + interpreter detection, Step 2/2.5 detect + transcribe hand-off, Step 3 extraction (Parts A/B/C, B0–B3), Step 4/4.5 build + health check, Step 5 labelling, Step 6/6b–8 exports hand-off, Step 9 manifest/cost/report. The absolute-path reference to extraction-spec.md in B0/B3 moves with it; guards and issue refs (#479, #1392, #1361) unchanged.

    Every build branch already passes through that dispatch block, so the change is one added line — "load references/build.md, continue at Step 1" — and the query path stops paying for the pipeline.

  2. ifsys commented on Nov 29, 2026

    @ifsys

    Data point from a local check, in case it helps prioritize this:

    • graphify 0.9.95 (.graphify_version), installed SKILL.md body: 49,468 chars
    • claude-skills-doctor 0.8.2 reports body-too-large for graphify ("move detail into references/") and budget-exceeded for the whole skill listing (about 31,648 chars against an 8,000-char budget at the default 1% of a 200k-token window)
    • Most of the body is Steps 2–4 PowerShell blocks plus inline #NNN fix-history comments. references/ already has 7 files.
    • Moving the Troubleshooting section to references/ alone barely changes the size (about 650 chars), so a meaningful reduction needs Steps 3–4 split out too.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions