refactor(skill): split SKILL.md sections >500 lines into recipe files#394
Open
tirth8205 wants to merge 1 commit into
Open
refactor(skill): split SKILL.md sections >500 lines into recipe files#394tirth8205 wants to merge 1 commit into
tirth8205 wants to merge 1 commit into
Conversation
…Egonex-AI#313) Anthropic recommends SKILL.md <=500 lines (no guarantee that more is loaded into context). The /understand SKILL.md was 853 lines, well over the target. This change extracts large embedded bash/JS code blocks and JSON schema reference material into adjacent `recipes/` and `reference/` files referenced from SKILL.md. Extracted recipes (skills/understand/recipes/): - worktree-redirect.md (Phase 0 git worktree detection bash) - plugin-root-resolution.md (Phase 0 plugin discovery + build bash) - understandignore-generator.md (Phase 0.5 starter file generator) - incremental-update.md (Phase 2 incremental update branch) - inline-validator.md (Phase 6 default-path validator script) - llm-review-path.md (Phase 6 --review dispatch block) - fingerprints-baseline.md (Phase 7 fingerprint baseline) - intermediate-cleanup.md (Phase 7 cleanup bash) Extracted reference (skills/understand/reference/): - knowledge-graph-schema.md (node/edge type tables, weights) - output-shapes.md (layers[*], tour[*], assembled-graph shapes) SKILL.md line count: 853 -> 533. All workflow semantics preserved - the skill is still runnable end-to-end via the `see X` cross-references. Other SKILL.md files in the repo were already under 500 lines and were not touched. Updated comment in worktree-redirect.test.mjs to point at the new recipe location for the bash snippet (test content unchanged). Closes Egonex-AI#313 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Summary
Closes #313.
Anthropic recommends SKILL.md files stay under 500 lines (no guarantee that more is loaded into context). The
/understandSKILL.md was 853 lines — well over target. This PR extracts large embedded bash/JS code blocks and JSON schema reference material into adjacentrecipes/andreference/files referenced from SKILL.md, while preserving the full step-by-step workflow.Files created
understand-anything-plugin/skills/understand/recipes/worktree-redirect.md(25 lines) — Phase 0 git worktree detection bashplugin-root-resolution.md(51 lines) — Phase 0 plugin discovery + first-time build bashunderstandignore-generator.md(30 lines) — Phase 0.5.understandignorestarter generatorincremental-update.md(27 lines) — Phase 2 incremental update branchinline-validator.md(80 lines) — Phase 6 default-path validator scriptllm-review-path.md(26 lines) — Phase 6--reviewdispatch blockfingerprints-baseline.md(26 lines) — Phase 7 fingerprint baseline procedureintermediate-cleanup.md(17 lines) — Phase 7 cleanup bashunderstand-anything-plugin/skills/understand/reference/knowledge-graph-schema.md(45 lines) — node/edge type tables, weight conventionsoutput-shapes.md(61 lines) —layers[*],tour[*], assembled-graph JSON shapesEach new file starts with a one-line header explaining its purpose and a cross-reference back to the relevant SKILL.md section.
SKILL.md line counts
skills/understand/SKILL.mdskills/understand-knowledge/SKILL.mdskills/understand-diff/SKILL.mdskills/understand-dashboard/SKILL.mdskills/understand-explain/SKILL.mdskills/understand-onboard/SKILL.mdskills/understand-chat/SKILL.mdskills/understand-domain/SKILL.mdThe remaining 33 lines over 500 in the main SKILL.md are workflow narrative — the phased pipeline that needs to be read in sequence. Per the issue guidance ("a SKILL.md slightly over 500 doesn't need aggressive splitting if the structure doesn't naturally break apart"), I judged further fragmentation would hurt readability more than it would help context loading. All bash scripts, JS code blocks, JSON shape examples, and reference tables — the heaviest content — have been relocated.
Workflow semantics
All workflow semantics are preserved. Every
see Xreference points to a file in the same skill directory containing the exact code/content that was previously inline. The skill remains runnable end-to-end.Test compatibility
Tests grep'd for hardcoded paths into the skill directory only reference the
.mjs/.pyscripts (compute-batches.mjs,extract-import-map.mjs,scan-project.mjs,merge-batch-graphs.py,extract-structure.mjs) — none reference SKILL.md content directly. The only test touching SKILL.md content isworktree-redirect.test.mjs, which inlines the bash snippet as a constant; I updated the doc comment in that test to point at the new recipe location, but the snippet content (and therefore test behavior) is unchanged.Test plan
pnpm installpnpm test(all suites pass — sandbox prevented me from running locally; please verify in CI)pnpm lint/understandskill instructions still flow logically end-to-end with the recipe cross-referencesCloses #313
Co-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com