Split the six monolithic SKILL.md files in git-agent and social-media-tools into a small always-loaded core plus skill-local references/*.md files, without changing any frontmatter description, any step order, or any safety guard.
Six single-file skills across git-agent and social-media-tools bill 9,758 words of context every time one of them fires, and three of them are the skills that rewrite git history and push to remotes. We will know it worked when every one of the six loads a core under 600 words, each safety guard is still greppable in that core, and the skills still branch, ship, and publish cards end to end.
Read and implement all steps in the plan at docs/plans/split-git-social-skills.md — Stop paying 9,758 words to run one git command. Verify against the plan's Tests, Verification, and Acceptance Criteria before reporting done. If everything passed, mark completion in docs/plans/split-git-social-skills.md — tick each step's [x] marker and each criterion's - [x], set status: completed — and re-render the HTML from the spec. If any check failed, leave status: in-progress and say which.
More ways to run this plan — goal & workflow prompts, file path
Achieve this goal: Stop paying 9,758 words to run one git command. The plan at docs/plans/split-git-social-skills.md describes one approach — use it as reference, but optimize for the outcome. Fan out across parallel subagents where that serves the outcome. Verify against the plan's Tests, Verification, and Acceptance Criteria before reporting done. If everything passed, mark completion in docs/plans/split-git-social-skills.md — tick each step's [x] marker and each criterion's - [x], set status: completed — and re-render the HTML from the spec. If any check failed, leave status: in-progress and say which.
Run a workflow to implement the plan at docs/plans/split-git-social-skills.md — Stop paying 9,758 words to run one git command. Brief subagents with the plan file at docs/plans/split-git-social-skills.md. Reserve a final verification phase for the lead agent, not a subagent. Verify against the plan's Tests, Verification, and Acceptance Criteria before reporting done. If everything passed, mark completion in docs/plans/split-git-social-skills.md — tick each step's [x] marker and each criterion's - [x], set status: completed — and re-render the HTML from the spec. If any check failed, leave status: in-progress and say which.
split-git-social-skills.html
docs/plans/split-git-social-skills.html
docs/plans/split-git-social-skills.md
Context
The story behind this plan — what prompted the work and why it matters now.
Anthropic's "The new rules of context engineering for Claude 5 generation models" makes progressive disclosure (Rule 3) the load-bearing one for this repo: move detailed guidance out of the always-loaded body into references the model pulls on demand. A SKILL.md body has no partial load — the moment a skill triggers, its entire body is paid. A measured audit of this repo found 17 SKILL.md files over 1,200 words shipping as a single file with zero sibling reference files. Six of them live in the two plugins this plan touches:
| Skill | Words | Lines |
|---|---|---|
| git-agent/skills/ship-autonomous/SKILL.md | 2,448 | 414 |
| social-media-tools/skills/share-explanation/SKILL.md | 1,863 | 366 |
| git-agent/skills/branch-agent/SKILL.md | 1,515 | 268 |
| social-media-tools/skills/share-session/SKILL.md | 1,414 | 275 |
| social-media-tools/skills/share-selection/SKILL.md | 1,284 | 228 |
| git-agent/skills/ship/SKILL.md | 1,234 | 266 |
Total 9,758 words across two plugins, so two version bumps: git-agent 4.7.0 → 4.8.0 and social-media-tools 2.19.0 → 2.20.0 in .claude-plugin/marketplace.json (refactor = minor).
The git-agent hazard is the whole risk of this plan. ship, ship-autonomous, and branch-agent mutate the working tree, rewrite refs, push to remotes, and end in an irreversible squash merge. ship-autonomous alone carries 22 negative imperatives (never/always/must/do not). A guard that gets relocated into a reference file the model never opens is a guard that no longer exists — and its absence is invisible until the day it should have fired. The rule this plan adopts: guards stay in the SKILL.md core; only procedure detail moves out. A guard is the statement ("never merge on anything but green", "never pass --delete-branch on the strength of a merge approval", "no --no-verify", "cap autofix at 3 attempts per check", "report the git error verbatim, do not retry, do not force", "--no-track or a later push targets the wrong ref"). Procedure detail is the commands and tables that implement it — the gh api graphql review-thread query, the CI failure classification table, the branch-name type-inference table, the stash-pop recovery script. Step 9 of this plan greps for ten specific guard phrases in the six cores, so a guard that slips into a reference file fails the build.
Second hazard, cheaper but easy to get wrong: social-media-tools already has an established layout. Eight of its skills ship a skill-local references/ dir beside SKILL.md (share-blog/references/platforms.md, share-react/references/props-extraction.md, write-guide/references/{exemplars,skeleton,tone-rules}.md, security-scrub/references/scrub-rules.md, share-code, share-video, share-scan, share-project), linked from the body as `Read references/props-extraction.md (bundled with this skill). That is distinct from the plugin-level $PLUGIN_DIR/references/ (platforms, variables, copy-panels, rendering-pipeline, saving-and-delivery, reuse-check, language-map, social-config) which every share-* skill already reads. Match the existing convention exactly: new files go in the skill-local references/, and existing $PLUGIN_DIR/references/... links stay untouched. git-agent has the same shape in create-issue/references/` (5 files, linked from a "Reference files" list at the end of the body).
Third hazard, discovered by reading the tests: tests/plugins/test-ship-self-review.sh greps ship/SKILL.md directly for the Step 4.5 heading (check 2), its position between Step 4 and Step 5 (check 3), by default and --no-review (check 4), the four regression checks accessibility/escaping/truncation/Responsive (check 5), commit --amend --no-edit (check 6), Do not loop a third time (check 7), never blocks the ship (check 8), the Step 7 delegation (check 9), and Edit in allowed-tools (check 10). Moving Step 4.5's detail into a reference file silently breaks six counted assertions — check 5's four terms, check 6, and check 7 — in a test that is not wired into CI. Mitigation: keep the heading and the four policy lines (default-on, --no-review opt-out, non-blocking, reuse Step 7's base) in the core, move only the four-item review checklist and the amend procedure to references/self-review.md, and update the test so those four content checks resolve against the reference file while the policy checks stay on SKILL.md — then prove the updated test still fails by deleting one check from the reference.
Risks and mitigations: (a) behavior drift — a step's meaning changes when its detail moves; mitigated by Step 9's behavioral run of all six skills, not just a word count. (b) dangling links — a reference is named but not written, or written but never linked; mitigated by the objective test resolving every references/*.md mention on disk and failing on orphans in both directions. (c) description drift — a split tempts a rewrite of the frontmatter; the descriptions are budget-checked at 200 chars by tests/plugins/test-description-budget.sh and are the sole trigger surface, so the objective test pins all six to their exact current strings. (d) unbumped versions — mitigated by BASE_REF=main node scripts/check-plugin-versions.mjs.
Out of scope, deliberately: the eleven share-* skills that repeat the same TEMPLATES_DIR locating shell block verbatim. That is a cross-skill dedup with its own blast radius — see Next Steps.
Files that change
Every file this plan touches, and what happens to each one.
docs/plans/split-git-social-skills.mdnew this speckit/plugins/git-agent/skills/ship-autonomous/SKILL.mdmodified core keeps trigger, step names, and every guard; procedure detail moves to four references- kit/plugins/git-agent/skills/ship-autonomous/references/
preflight-and-verify.mdnew Step 1 guard commands and Step 2.5 test/lint/preview detectionpr-events.mdnew Step 5 subscribe-vs-poll mechanics, Step 6a triage, Step 6c review-comment and refutation handlingci-autofix.mdnew Step 6b classification table and the lint/typecheck/peer-deps fix proceduresmerge-gate.mdnew Step 7 and Step 8 exact commands, including the--match-head-commitand branch-deletion sequences
kit/plugins/git-agent/skills/branch-agent/SKILL.mdmodified core keeps Step 1 guards,--no-track, and the no-retry/no-force rule- kit/plugins/git-agent/skills/branch-agent/references/
branch-naming.mdnew Step 2/2a/2b name resolution, type and scope inference, examples, validation, date suffixstash-and-recovery.mdnew Step 4.5 conflict detection and Step 5 stash/checkout/pop recovery
kit/plugins/git-agent/skills/ship/SKILL.mdmodified core keeps Step 1 guards, Step 4.5 policy lines, and the no---no-verifyrule- kit/plugins/git-agent/skills/ship/references/
platform-clis.mdnew GitHub/GitLab detection and thegh/glabauth failure messagesself-review.mdnew the four Step 4.5 regression checks and the amend procedurepr-body.mdnew Step 6/7/7.5/8 detail and the PR/MR body template
kit/plugins/social-media-tools/skills/share-explanation/SKILL.mdmodified core keeps the phase index, the scrub gate, and delivery- kit/plugins/social-media-tools/skills/share-explanation/references/
target-resolution.mdnew the five-tier target lookup from Phase 2synthesis-structure.mdnew Phase 3 section structures per target typecard-population.mdnew Phase 6 template selection, escape order, variable tables
kit/plugins/social-media-tools/skills/share-session/SKILL.mdmodified core keeps the phase index and the scrub gate- kit/plugins/social-media-tools/skills/share-session/references/
session-data.mdnew Phase 1a–1e gathering,session_usage.pyoutput, git stats, narrative rulescard-population.mdnew Phase 4 escape order andsession-card.htmlvariable table
kit/plugins/social-media-tools/skills/share-selection/SKILL.mdmodified core keeps the phase index, selection guards, and the scrub gate- kit/plugins/social-media-tools/skills/share-selection/references/
selection-sources.mdnew Phase 1 source precedence, file guards, objective capturecard-population.mdnew Phase 4/5 template pick, escape order, snippet and diff variable tables
- tests/plugins/
test-skill-split-git-social.shnew objective test: ceiling, references exist, links resolve both ways, descriptions pinned, guards presenttest-ship-self-review.shmodified content checks resolve againstship/references/self-review.md; policy checks stay on SKILL.md
.github/workflows/check-plugin-versions.ymlmodified a step running the objective test, plus eight steps wiring previously-unwired tests that already existed and already passed onmain(test-claude-md-budget,test-remaining-skill-splits,test-artifact-tools,test-artifact-to-post,test-memory-doctor-guard,test-generator-skills-verify-output,test-description-budget,test-exitplanmode-guard). Wider than Step 9 specified: the repo has no test runner, so an unwired test never runs again after the PR that added it. All nine verified green locally before wiring..claude-plugin/marketplace.jsonmodified git-agent 4.7.0 → 4.8.0, social-media-tools 2.19.0 → 2.20.0kit/plugins/git-agent/CHANGELOG.mdmodified v4.8.0 entrykit/plugins/social-media-tools/CHANGELOG.mdmodified v2.20.0 entry
Steps
The step-by-step work, in order — each step says what to do, why it matters, and how to check it worked.
wc -w on each SKILL.md and copy each description: line verbatim into a scratch note, then read kit/plugins/social-media-tools/skills/share-react/references/props-extraction.md and the ## Reference Files list at kit/plugins/git-agent/skills/create-issue/SKILL.md lines 197-204 to fix the house layout in mind.
wc -w kit/plugins/git-agent/skills/{ship-autonomous,branch-agent,ship}/SKILL.md kit/plugins/social-media-tools/skills/{share-explanation,share-session,share-selection}/SKILL.md.tests/plugins/test-skill-split-git-social.sh before touching any skill — assert per skill that wc -w SKILL.md is under 600, that references/ exists with at least one .md, that every `references/<name>.md string in the body resolves on disk, that every file in references/ is named at least once in the body, that the description: line equals the exact string recorded in Step 1, and that the ten guard phrases (Never merge on anything but green, --delete-branch, --match-head-commit, no-verify, Cap autofix at, do not commit a red tree, detached HEAD, Cannot ship from the default branch, no-track, Do not retry. Do not force`) appear in the SKILL.md core of the skill that owns each.
bash tests/plugins/test-skill-split-git-social.sh exits 1 and names all six skills as over the ceiling with no references dir.branch-agent — move Step 2/2a/2b (688 words of name resolution, type inference table, scope rules, examples, validation, date suffix) to references/branch-naming.md and Step 4.5/Step 5's conflict detection and stash-pop recovery (353 words) to references/stash-and-recovery.md, leaving in the core: the Step 1 guard trio (not a repo / detached HEAD / no origin remote → STOP), the git checkout -b <branch> --no-track origin/<default> command with its one-line reason, "report the git error verbatim and STOP. Do not retry. Do not force.", and a one-line pointer to each reference at the step that needs it.
wc -w kit/plugins/git-agent/skills/branch-agent/SKILL.md is under 600 and grep -c "no-track\|Do not retry. Do not force\|detached HEAD" kit/plugins/git-agent/skills/branch-agent/SKILL.md is at least 3.ship — move platform detection and the gh/glab auth failure messages to references/platform-clis.md, the Step 4.5 four-item regression checklist and the git add -A && git commit --amend --no-edit procedure to references/self-review.md, and Step 6/7/7.5/8's commands and PR body template to references/pr-body.md; keep in the core the Step 1 guard list (clean tree, detached HEAD, Cannot ship from the default branch, CLI authenticated), the Step 4 no-verify prohibition, and Step 4.5's four policy lines (runs by default, --no-review opt-out, never blocks the ship, reuse Step 7's base).
--no-verify" lines change whether the pipeline stops.bash tests/plugins/test-ship-self-review.sh fails on exactly checks 5, 6, and 7 (the four regression terms, the amend line, and the loop bound) and still passes checks 2, 3, 4, 8, 9, and 10.tests/plugins/test-ship-self-review.sh so checks 5, 6, and 7 read kit/plugins/git-agent/skills/ship/references/self-review.md while checks 2, 3, 4, 8, 9, and 10 keep reading SKILL.md and checks 11-22 keep reading the untouched agents/agent-ship.md, and add one assertion that SKILL.md links references/self-review.md.
bash tests/plugins/test-ship-self-review.sh exits 0, and deleting the Responsive bullet from references/self-review.md makes it exit 1.ship-autonomous — move Step 1's command block and Step 2.5's test/lint/preview detection (477 words) to references/preflight-and-verify.md, Step 5's subscribe-vs-poll mechanics plus Step 6a triage and 6c review-comment/refutation handling (roughly 700 words) to references/pr-events.md, Step 6b's classification table and per-class fix procedures to references/ci-autofix.md, and Step 7/8's exact gh and gh api graphql commands to references/merge-gate.md; the core retains every negative imperative verbatim, specifically "do not commit a red tree", "Do not use --no-verify", "Cap autofix at 3 attempts per failing check", "Never merge on anything but green.", the AskUserQuestion approval gate before merge, "--match-head-commit", "Branch deletion requires its own explicit approval", and "Never dismiss a review on your own initiative".
wc -w kit/plugins/git-agent/skills/ship-autonomous/SKILL.md is under 600 and for p in "Never merge on anything but green" "delete-branch" "match-head-commit" "no-verify" "Cap autofix at" "do not commit a red tree"; do grep -q "$p" kit/plugins/git-agent/skills/ship-autonomous/SKILL.md || echo "MISSING: $p"; done prints nothing.references/ dirs matching the share-react layout — share-explanation sheds Phase 2's five-tier lookup (460 words), Phase 3's synthesis structures (245), and Phase 6's template/escape/variable tables (247); share-session sheds Phase 1's gathering procedure (428) and Phase 4's variable table (193); share-selection sheds Phase 1's source precedence and file guards (328) and Phase 4/5's template pick and variable tables (270) — while every core keeps its Quick Reference phase index, the GATE RESULT: BLOCKED hard stop with its Skill(skill: "social-media-tools:security-scrub", ...) call, the non-code-file and 80-line guards as one-liners, and every existing $PLUGIN_DIR/references/... link unchanged.
wc -w kit/plugins/social-media-tools/skills/{share-explanation,share-session,share-selection}/SKILL.md reports under 600 for each, and grep -c 'PLUGIN_DIR/references/' kit/plugins/social-media-tools/skills/{share-explanation,share-session,share-selection}/SKILL.md still returns 7, 8, and 11 respectively — the pre-split counts.git-agent to 4.8.0 and social-media-tools to 2.20.0 in .claude-plugin/marketplace.json, add a ## v4.8.0 and a ## v2.20.0 entry to the two kit/plugins/<name>/CHANGELOG.md files naming the skills split and the word counts before and after, and confirm neither plugin.json gained a version field.
kit/plugins/<name>/ ships to installers only if the marketplace version moves, and a version in plugin.json silently overrides it.BASE_REF=main node scripts/check-plugin-versions.mjs exits 0 and grep -L version kit/plugins/{git-agent,social-media-tools}/.claude-plugin/plugin.json lists both files.tests/plugins/test-skill-split-git-social.sh into .github/workflows/check-plugin-versions.yml as a step after "Test gallery index merge driver", with a comment stating that these six skills carry the repo's irreversible git operations and their guards are checked at review time.
grep -n "test-skill-split-git-social" .github/workflows/check-plugin-versions.yml returns one line, and python3 -c "import yaml,sys; yaml.safe_load(open('.github/workflows/check-plugin-versions.yml'))" exits 0.Tests
The tests that prove the change does what it promises.
ship self-review contract survives relocation into references/self-review.md. File: tests/plugins/test-ship-self-review.sh; Targets: kit/plugins/git-agent/skills/ship/SKILL.md and its new references/self-review.md, plus kit/plugins/git-agent/agents/agent-ship.md; Key cases: Step 4.5 still ordered between Step 4 and Step 5 in the core (check 3); default-on and --no-review still in the core (check 4); the four regression checks, commit --amend --no-edit, and Do not loop a third time found in the reference (checks 5-7); SKILL.md links the reference; the background agent still denies Edit (check 19)marketplace.json after adding reference dirs, and both bumped versions are higher than main. File: tests/plugins/test-no-orphan-plugin-dirs.sh and scripts/check-plugin-versions.mjs; Targets: .claude-plugin/marketplace.json against kit/plugins/; Key cases: new references/ subdirectories do not register as plugin dirs; git-agent 4.8.0 and social-media-tools 2.20.0 both beat mainDefinition of done
The plan counts as done when every statement below is true — check each one off as you verify it.
Final check
One last pass to confirm the whole change works end to end.
Run the full local gate in one pass: bash tests/plugins/test-skill-split-git-social.sh && bash tests/plugins/test-ship-self-review.sh && bash tests/plugins/test-description-budget.sh && bash tests/plugins/test-no-orphan-plugin-dirs.sh && BASE_REF=main node scripts/check-plugin-versions.mjs. Expected result: every script prints its PASS lines and the chain exits 0, with the objective test reporting six skills under the 600-word ceiling and every guard phrase located in its owning core — 12 git guard assertions plus 6 scrub-gate assertions, a tally the test prints rather than a literal it hard-codes. The 12 exceeds Step 2's list of ten distinct phrases because no-verify is asserted in two cores (ship-autonomous and ship) and CLI not available or not authenticated was added after review found ship had lost it.
Tautology check, run three times against different assertions so a single lenient grep cannot hide: (1) append 400 words of filler to kit/plugins/git-agent/skills/ship/SKILL.md and confirm bash tests/plugins/test-skill-split-git-social.sh exits 1 naming ship over the ceiling; (2) delete the line containing Never merge on anything but green from ship-autonomous/SKILL.md — or, worse and more realistically, move that line into references/merge-gate.md — and confirm the test still exits 1 on the missing guard; (3) change one character in share-session's frontmatter description: and confirm the test exits 1 on the pinned description. Then git checkout -- <paths> after each and re-run to confirm a clean exit 0. Also delete the Responsive bullet from ship/references/self-review.md and confirm bash tests/plugins/test-ship-self-review.sh exits 1 before reverting.
Behavioral check — word counts prove nothing about whether the skills still work, so exercise all six against a scratch branch of this repo. Load both plugins with claude --plugin-dir kit/plugins/git-agent --plugin-dir kit/plugins/social-media-tools. For branch-agent: with an uncommitted edit in the tree, invoke it with no argument and confirm it still auto-generates a <type>/<scope>-<description>-YYYY-MM-DD name, branches with --no-track (git config branch.<name>.remote returns empty), and stops after the confirmation line. For ship: run it on that branch and confirm Step 1 still refuses from main, Step 4.5 still reports findings or "Self-review: no findings.", and the PR body still carries the Summary/Changes/Test Plan structure — then close the PR. For ship-autonomous: confirm from a clean tree that it stops at "Nothing to ship — working tree is clean." and, on a dirty tree with a deliberately failing lint script, that it stops before committing rather than proceeding. For the three share-* skills: run share-selection on a pasted snippet, share-session on the current session, and share-explanation on share-scan, and confirm each still reaches a rendered PNG under docs/media/social/ with the security-scrub gate having printed GATE RESULT: APPROVED. Any skill that opens a reference file it names is behaving correctly; any skill that stalls asking where a step's detail went is a dangling link the objective test missed — fix the link, not the test.
Wrapping up
Three gates that must all pass before this plan is marked completed.
Completion Report
No items to report — all requirements met.