Repository navigation
Conversation
Split the monolithic skill.md (~1,156 lines, loaded in full on every
/graphify) into a lean SKILL.md plus on-demand reference/ files, generated
from skill.md as the single source of truth. A /graphify query now loads
~202 lines instead of 1,156 (~83% less always-on context).
- Add graphify/skill_build.py: a fence-aware heading slicer driven by a
route-by-command manifest. Two output modes from one source — split (lean
SKILL.md + reference/{extract,update,query,add,watch}.md) for verified skill
loaders, and flatten (a lossless single-file round-trip of skill.md) for the
rest. `--check` regenerates and diffs as a CI drift gate.
- Commit the generated Claude split tree at graphify/skill_claude/.
- Install: the claude platform now uses the split tree; _copy_skill_file copies
SKILL.md + reference/ with SKILL.md written last for crash-safety. Centralize
removal in _remove_skill_tree (handles reference/, scoped to graphify-owned
names) and route _remove_skill_file plus the vscode/kiro/antigravity
uninstalls through it. Package the tree via pyproject package-data and
confirm it lands in the built wheel.
- Byte-accuracy: the node-ID rule and JSON extraction contract move as verbatim
slices and are pinned against _file_node_id in tests (not a frozen string),
so the doc and code cannot drift apart.
Scope: Claude is the only loader switched to split mode; every other platform
keeps its existing single-file behavior. Verified live in a Claude Code session
— a fresh build loads reference/extract.md and /graphify query loads
reference/query.md on demand.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
safishamsi
left a comment
There was a problem hiding this comment.
Really nice work @TPAteeq — this lands the design from the thread faithfully. I merged it onto current v8 and verified the risky parts mechanically, all green:
- Full suite passes on merged
v8(1,533 passed, 0 failed). - Drift gate works:
python -m graphify.skill_build --check→ in sync. - Byte-accuracy confirmed — the node-ID spec, JSON schema, and the full subagent prompt template are present verbatim in
reference/extract.md; thedescriptionis identical toskill.md. - Lean core = 76 lines (query path ≈ 202 vs 1,156, ~82% cut).
- Wheel ships all 6 files (
skill_claude/SKILL.md+reference/*.md) — built and inspected. - Install lays down the tree correctly; scope is genuinely claude-only.
One change before merge — make uninstall remove the tree it now installs.
Testing surfaced that graphify claude uninstall (and bare graphify uninstall) don't remove the claude skill — they only touch CLAUDE.md. I confirmed this is pre-existing (base v8 leaves the single SKILL.md behind too), so the PR doesn't regress it — but it makes the orphan a 6-file reference/ directory instead of one file. And since this PR already builds _remove_skill_tree, the helper is right there but the actual claude uninstall path never calls it.
Could you wire the claude uninstall to call _remove_skill_tree (the gemini path already removes its skill dir — this just makes claude consistent)? That turns "uninstall orphans 6 files" into a clean removal, and the helper you wrote does exactly the right scoped thing (I verified it preserves a sibling user file). With that, this is good to merge.
Two follow-ups you already flagged — agreed, keep them separate:
- The 8 stale flatten-mode variants with the bare-path
FileNotFoundErrorbugs — regenerating fromskill.mdfixes them; worth its own PR. - The headless
graphify extractupfront-backend-validation on code-only corpora — pre-existing, separate issue.
Thanks again — the byte-verbatim slicing + the flatten round-trip + the CI drift gate are exactly the safety net this needed.
graphify claude uninstall (and bare graphify uninstall) previously only stripped the CLAUDE.md section, leaving the user-scope skill behind. With the progressive-disclosure split that orphans a 6-file reference/ directory rather than a single SKILL.md. Route claude_uninstall through _remove_skill_file -> _remove_skill_tree (as the gemini path already does) so a user-scope uninstall removes SKILL.md + reference/ + the version stamp. Project scope is unchanged (it already removed the tree) and a sibling user file is still preserved. Add a regression test for the user-scope path. Co-Authored-By: Claude Opus 4.8 <[email protected]>
|
Thanks for the thorough review and for verifying the risky parts — really appreciate it. Done in 609a98c. Wired the user-scope Added a regression test for the user-scope path. Full suite green (1,547 passed) and the drift gate ( Also agreed on keeping the two follow-ups separate — happy to pick up the stale flatten-variant regeneration Thanks again! |
safishamsi
left a comment
There was a problem hiding this comment.
Verified the fix on current v8 — 609a98c does exactly the right thing:
graphify claude uninstall(and baregraphify uninstall) now remove the full tree —SKILL.md+reference/+ the version stamp — via_remove_skill_tree, mirroring the gemini path.- Scoped removal confirmed: a sibling
user_notes.mdI dropped in the skill dir survives the uninstall — it only removes graphify-owned names, never a blindrmtree. - Drift gate green (
skill_build --checkin sync), full suite 1534 passed.
That was the only blocker. This is clean — byte-verbatim slices, lossless flatten round-trip, preserved description, wheel ships the tree, claude-only scope. Approving. Thanks for the careful turnaround.
|
Thanks @safishamsi — appreciate the thorough review and the quick verification turnaround. Glad it landed On next steps: regenerating the other platform variants from skill.md (which also fixes the bare-path |
…or + drift fence) (#1121) All-platform progressive-disclosure skill split + generator (addresses #1106). Splits each platform's skill into a lean core (~615 lines, full default pipeline inline) + on-demand references/, generated from a single source via tools/skillgen with a CI/pre-commit drift gate. 13 hosts split, aider/devin stay monoliths. Also fixes the stale bare-path bugs across the previously hand-maintained variants and moves the always-on blocks into packaged markdown. Verified: all 5 generator guards pass, byte-verbatim load-bearing slices, lean cores self-sufficient on the default path across all 13 split hosts, references gated to non-default branches, description preserves the graphify-out-query-first clause. Supersedes #1119 (Claude-first subset). Known follow-up applied on top: harden _always_on() against a missing packaged file so a partial install can't brick the CLI.
…tion claude_uninstall only stripped the CLAUDE.md section, so `graphify uninstall` and `graphify claude uninstall` orphaned the whole installed skill tree (SKILL.md + references/ + version stamp) - gemini_uninstall already removes its skill, this makes claude consistent. The #1121 split made the orphan a 10-file directory; this restores the removal that the alternative PR #1119 had. Scoped name removal preserves sibling user files; project-scope uninstall passes project=True so it never touches the user-scope skill. Verified: claude/bare uninstall now remove the tree and keep a sibling user_notes.md; full suite 1755 passed; real extract still builds a clean graph. Co-Authored-By: Claude Opus 4.8 <[email protected]>
|
Thank you @TPAteeq, this was the right Claude-first reference and shaped the approach. We ended up merging the fuller all-platform version in #1121, which extends the same progressive-disclosure design to 18 hosts and adds a single-source generator ( |
…or + drift fence) (Graphify-Labs#1121) All-platform progressive-disclosure skill split + generator (addresses Graphify-Labs#1106). Splits each platform's skill into a lean core (~615 lines, full default pipeline inline) + on-demand references/, generated from a single source via tools/skillgen with a CI/pre-commit drift gate. 13 hosts split, aider/devin stay monoliths. Also fixes the stale bare-path bugs across the previously hand-maintained variants and moves the always-on blocks into packaged markdown. Verified: all 5 generator guards pass, byte-verbatim load-bearing slices, lean cores self-sufficient on the default path across all 13 split hosts, references gated to non-default branches, description preserves the graphify-out-query-first clause. Supersedes Graphify-Labs#1119 (Claude-first subset). Known follow-up applied on top: harden _always_on() against a missing packaged file so a partial install can't brick the CLI.
…tion claude_uninstall only stripped the CLAUDE.md section, so `graphify uninstall` and `graphify claude uninstall` orphaned the whole installed skill tree (SKILL.md + references/ + version stamp) - gemini_uninstall already removes its skill, this makes claude consistent. The Graphify-Labs#1121 split made the orphan a 10-file directory; this restores the removal that the alternative PR Graphify-Labs#1119 had. Scoped name removal preserves sibling user files; project-scope uninstall passes project=True so it never touches the user-scope skill. Verified: claude/bare uninstall now remove the tree and keep a sibling user_notes.md; full suite 1755 passed; real extract still builds a clean graph. Co-Authored-By: Claude Opus 4.8 <[email protected]>
Addresses #1106 (Claude-first; follow-ups noted below). Implements the design agreed in the issue thread.
What this does
Splits the monolithic
skill.md(~1,156 lines, loaded in full on every/graphify) into a leanSKILL.md+on-demand
reference/files, generated fromskill.mdas the single source of truth.Per-invocation win: a
/graphify querynow loadsSKILL.md(76 lines) +reference/query.md(~126) =~202 lines vs 1,156 (~83% less always-on context).
How
graphify/skill_build.py— a fence-aware heading slicer driven by a route-by-command manifest. Two outputmodes from one source: split (lean
SKILL.md+reference/{extract,update,query,add,watch}.md) forverified skill loaders, and flatten (a lossless single-file round-trip of
skill.md) for the rest.python -m graphify.skill_buildregenerates;--checkis a CI drift gate.graphify/skill_claude/.claudeplatform uses the split tree;_copy_skill_filecopiesSKILL.md+reference/with
SKILL.mdwritten last for crash-safety. Removal centralized in_remove_skill_tree(handlesreference/, scoped to graphify-owned names) and routed through_remove_skill_file+ thevscode/kiro/antigravity uninstalls. Packaged via
pyprojectpackage-data; confirmed it lands in the builtwheel.
against
_file_node_idin tests (not a frozen string). The skilldescriptionis preserved verbatim with atest asserting it.
Scope
Claude is the only loader switched to split mode; every other platform keeps its existing single-file
behavior.
Testing
tests/test_skill_build.py./graphify .followedreference/extract.mdand built areal graph;
/graphify queryran the constrained query-expansion procedure that lives only inreference/query.md— confirming on-demand loading at runtime.Follow-ups (intentionally not in this PR)
skill.md. Also a correctness fix: 8 stalevariants carry ~49 bare-path refs (
Path('.graphify_detect.json')→FileNotFoundError) that regeneratingwipes out. Kept separate to keep this PR Claude-only and reviewable.
Two pre-existing issues found while here (not changed)
uninstall_all(graphify uninstall) removes the gemini skill dir but not the claude skill dir (onlystrips the CLAUDE.md section). Left as-is since changing uninstall scope is a behavior decision - flagging.
graphify extract <path>validates an LLM backend upfront ( before checking corpus content ), so it errors 'no LLM API Key found' even for a code-only corpus that needs no LLM calls. the keyless AST-only path is 'graphify
update --no-cluster' ( or '--backend ollama' on loopback).