shard
Skill425 starsChanged 5 months agoMITView on GitHub
Use when the user says 'shard this', 'split file', or when working with files over 1000 lines.
3 other projects use a version of this, 1 of them edited.
Adopted by
Most recently taken up by
- karthikkumar27/grepabletheir own version, first seen Oct 20, 2026
- nauvalazhar/skillstheir own version, first seen Oct 15, 2026
- vbrevik/claude_code_skillsedited, first seen Mar 14, 2026
Other versions3 projects use a version of this.
Word for word · 0
None found.
Edited · 1
- vbrevik/claude_code_skills★ 099% same
Wrote their own version · 2
- nauvalazhar/skills★ 4same name
- karthikkumar27/grepable★ 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 repository87 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- memstack-automation-api-integrationSkill
- memstack-automation-content-pipelineSkill
- memstack-automation-cron-schedulerSkill
- memstack-automation-hosted-mcp-catalogSkill
- memstack-automation-n8n-workflow-builderSkill
- memstack-automation-webhook-designerSkill
- memstack-business-client-onboardingSkill
- memstack-business-contract-templateSkill
- memstack-business-financial-modelSkill
- memstack-business-freelancer-toolkitSkill
- memstack-business-gdprSkill
- memstack-business-invoice-generatorSkill
- memstack-business-licensingSkill
- memstack-business-proposal-writerSkill
- memstack-business-scope-of-workSkill
- memstack-business-sop-builderSkill
- compressSkill
- memstack-content-blog-postSkill
- memstack-content-email-sequenceSkill
- memstack-content-landing-page-copySkill
- memstack-content-newsletterSkill
- memstack-content-product-descriptionSkill
- memstack-content-tiktok-scriptSkill
- memstack-content-twitter-threadSkill
- memstack-content-youtube-scriptSkill
- memstack-deployment-ci-cd-pipelineSkill
- memstack-deployment-docker-setupSkill
- memstack-deployment-domain-sslSkill
- memstack-deployment-hetzner-setupSkill
- memstack-deployment-netlify-deploySkill
- memstack-deployment-railway-deploySkill
- memstack-development-api-designerSkill
- memstack-development-changelog-generatorSkill
- memstack-development-code-reviewerSkill
- memstack-development-mentorSkill
- memstack-development-migration-plannerSkill
- memstack-development-performance-auditSkill
- memstack-development-refactor-plannerSkill
- memstack-development-test-writerSkill
- memstack-development-webapp-testingSkill
- diarySkill
- echoSkill
- familiarSkill
- forgeSkill
- goalSkill
- governorSkill
- grimoireSkill
- humanizeSkill
- memstack-marketing-competitor-analysisSkill
- memstack-marketing-facebook-adSkill
- memstack-marketing-google-adSkill
- memstack-marketing-launch-planSkill
- memstack-marketing-lead-magnetSkill
- memstack-marketing-marketplace-submitSkill
- memstack-marketing-pricing-strategySkill
- memstack-marketing-sales-funnelSkill
- memstack-marketing-webinar-scriptSkill
- memstack-product-feature-specSkill
- memstack-product-feedback-analyzerSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
6 rules. 0 are common, 5 are distinctive, and 1 is very specific to this project.
0
Common
Most of the 3 edited versions we read keep these.
5
Distinctive
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 13
When this skill activates, output:
- Distinctive: line 44
Keep types near consumers
- Distinctive: line 48
Create new files with proper names
- Distinctive: line 50
Add import/export statements
- Very specific: line 51
Create index.ts barrel if needed for backwards compatibility
- Distinctive: line 52
Update all imports throughout the project
“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
💎 Shard: Refactoring Large File...
Split monolithic files into focused, maintainable modules.
Activation
When this skill activates, output:
💎 Shard: Refactoring large file...
Then execute the protocol below.
Context Guard
| Context | Status |
| User says "shard", "split file", or "refactor" | ACTIVE: full protocol |
| Editing a file over 1000 lines | ACTIVE: suggest refactor |
| User says "refactor" for logic changes (not splitting) | DORMANT: not a shard task |
| Discussing code organization concepts | DORMANT: do not activate |
| File is under 500 lines | DORMANT: not worth splitting |
Protocol
- Identify the target file and count lines:
wc -l <file> - Analyze structure:
- List all exports (functions, components, types, constants)
- Identify logical groupings
- Map internal dependencies (what calls what)
- Propose the split: present to user BEFORE executing:
- Target: 100-300 lines per new file
- Group related functionality
- Keep types near consumers
- Shared utilities in separate file
- Execute the refactor:
- Create new files with proper names
- Move code to appropriate files
- Add import/export statements
- Create index.ts barrel if needed for backwards compatibility
- Update all imports throughout the project
- Verify build:
npm run build 2>&1 | tail -20 - Present result: new file structure with line counts
Inputs
- File path to refactor
- Optional: preferred split strategy or target file count
Outputs
- Multiple smaller files replacing the original
- Updated imports throughout project
- Build verification
Example Usage
User: "shard infrastructure/page.tsx: it's 1100 lines"
💎 Shard: Refactoring large file...
infrastructure/page.tsx (1,110 lines) → 6 files:
page.tsx (~120 lines), Main page, tab switcher
RailwayTab.tsx (~200 lines), Railway monitoring
HetznerTab.tsx (~180 lines), Hetzner monitoring
HeadroomTab.tsx (~250 lines), Headroom + setup guide
types.ts (~80 lines), Shared interfaces
constants.ts (~60 lines): Status configs
Build check: ✓ passedLevel History
- Lv.1: Base: File analysis and splitting with import updates. (Origin: MemStack v1.0, Feb 2026)
- Lv.2: Enhanced: Added YAML frontmatter, context guard, propose-before-execute, activation message. (Origin: MemStack v2.0 MemoryCore merge, Feb 2026)
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.

