shard
Skill0 starsChanged 50 days agoMITView on GitHub
Split a large FSD, PRD or SRS markdown spec into indexed section files with INDEX.md and ID-MAP.md, so the agent reads only the relevant section and cites requirement IDs as file:line instead of guessing. Use when asked to shard, split, chunk, index or re-index a spec or requirements document, make a spec greppable, map requirement IDs, or when docs/original-requirement.md changes.
3 other projects use a version of this.
Adopted by
Most recently taken up by
- nauvalazhar/skillstheir own version, first seen Oct 15, 2026
- cwinvestments/memstacktheir own version, first seen Jun 22, 2026
- vbrevik/claude_code_skillstheir own version, first seen Mar 14, 2026
Other versions3 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 3
- cwinvestments/memstack★ 425same name
- nauvalazhar/skills★ 4same name
- vbrevik/claude_code_skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository2 other files it gives its agents.
- code-reviewSkill
- tddSkill
The file
We split this skill into the rules it gives an agent
7 rules. 0 are common, 0 are distinctive, and 7 are very specific to this project.
0
Common
Most of the 3 edited versions we read keep these.
0
Distinctive
This author's own choices. Worth a look.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 12
Every shard starts with <!-- source: <path>:L<start>-L<end> -->, so citations trace back to the original.
- Very specific: line 22
If none exists, stop and ask for the path.
- Very specific: line 25
If the user points at a shard, INDEX.md or the shards folder, the source is the path in the shard's line-1 marker (<!-- source: …
- Very specific: line 38
Read the candidate families (e.g.
- Very specific: line 40
Choose ID patterns: Default patterns cover AREA-NN, CODE-NNN, AREA-NN.Rn and AC-AREA-NN-n.
- Very specific: line 41
If the doc also uses bare-letter IDs (D1, J5, Q6), add a pattern for them.
- Very specific: line 53
If the section uses bold pseudo-headings instead of ###, it cannot be split further.
“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
grepable:shard
Splits one large spec (FSD, PRD, SRS) into one file per section, plus:
INDEX.md: section map (what each file covers, IDs defined, line ranges, open-item count).ID-MAP.md: every requirement ID / rule / code / decision / question -> shardfile:lineand source line.
Every shard starts with <!-- source: <path>:L<start>-L<end> -->, so citations trace back to the original.
The script is deterministic: it never rewrites or summarises spec text. It copies byte ranges and
verifies that the shards join back into the source exactly (lossless check).
Spec location (shared by all grepable skills)
Find the requirement document in this order and use the first that exists:
- A path the user gives in the request.
- A
Spec source: <path>line in the repo'sCLAUDE.mdorAGENTS.md. docs/original-requirement.md(the default).
If none exists, stop and ask for the path. Never pick a "similar-looking" document yourself.
Shards go to the Spec shards: <dir> line if present, otherwise docs/fsd/. The source is the business
source of truth: never edit it.
If the user points at a shard, INDEX.md or the shards folder, the source is the path in the shard's
line-1 marker (<!-- source: <path>:L<start>-L<end> -->).
Script
scripts/shard.py in this skill's own directory (bundled). Run it with the absolute path of this
skill directory, e.g. python3 "<skill-dir>/scripts/shard.py" .... If the repo has its own
scripts/shard.py, prefer that one so the repo pins the version. Run commands from the repo root so
markers show repo-relative paths.
Steps
- Discover ID families.
python3 <skill-dir>/scripts/shard.py <source> --discoverRead the candidate families (e.g.LN-NN,BLK-NNN,DNN/JNN/QNNas table first cells). - Choose ID patterns. Default patterns cover
AREA-NN,CODE-NNN,AREA-NN.RnandAC-AREA-NN-n. If the doc also uses bare-letter IDs (D1, J5, Q6), add a pattern for them. Always keep the(?<![\w-])…(?![\w-])boundaries soAC-LN-01-1is not also counted asLN-01. Typical full set:
(Passing any--id-pattern '(?<![\w-])[A-Z]{1,5}-\d{1,4}(?:\.R\d+)?(?![\w-])' --id-pattern '(?<![\w-])AC-[A-Z]{1,5}-\d{1,4}-\d{1,3}(?![\w-])' --id-pattern '(?<![\w-])[DJQ]\d{1,2}(?![\w-])'--id-patternreplaces the defaults, so pass all of them.) - Dry run. Same command with
<shards-dir> --dry-run. Check:- Shard sizes: if one shard is over ~400 lines, re-run with
--max-lines 400(it re-splits at###). If the section uses bold pseudo-headings instead of###, it cannot be split further; tell the user and suggest converting those to###headings in the source. Lossless check: PASS. If FAIL, stop and report; do not write.- Duplicate definitions: report them; they are real spec defects (two places define one ID).
- Shard sizes: if one shard is over ~400 lines, re-run with
- Write. Re-run without
--dry-run. Add--forceonly when the shards folder already holds generated shards from this script (it deletes the old.mdfiles there first). If it contains hand-written files, stop and ask before using--force. - Report to the user (short):
- Number of shards, IDs defined, lossless PASS.
- Spec defects found:
- Duplicate IDs.
- "Referenced but never defined" IDs from
ID-MAP.md. Split these into (a) IDs owned by another document, such as a technical design's ADRs, and (b) IDs that only appear in prose (a real gap: no single definition to grep). - Shorthand ranges the script expanded (rows marked "written as
BLK-002 / 003"). Recommend writing each ID in full in the source.
- Sections with a ⚠ count (Decision pending / TBD / NOT IN SPEC): not buildable yet.
- Don't edit shard files, summarise the spec, or add requirements. If the user wants the spec itself
improved (atomic rules, IDs for prose), that is a separate conversion task using their FSD template;
after it, re-run this skill. Then
grepable:tddandgrepable:code-reviewcan cite the spec.
Re-sharding
Whenever the source changes, re-run steps 3–4 with the same patterns (record the command in the repo,
e.g. a make spec target or a line in CLAUDE.md). Stale shards are worse than none.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

