skills/shard/SKILL.md
Use when the user says 'shard this', 'split file', or when working with files over 1000 lines.
npx skillsauth add cwinvestments/memstack shardInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Split monolithic files into focused, maintainable modules.
When this skill activates, output:
💎 Shard — Refactoring large file...
Then execute the protocol below.
| 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 |
Identify the target file and count lines:
wc -l <file>
Analyze structure:
Propose the split — present to user BEFORE executing:
Execute the refactor:
Verify build:
npm run build 2>&1 | tail -20
Present result — new file structure with line counts
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: ✓ passed
tools
Use when the user says 'save diary', 'log session', 'wrapping up', or at end of a productive session.
tools
Use when the user says 'submit to marketplace', 'publish my skill', 'share this skill', 'list on marketplace', 'submit plugin', 'publish to community', or needs to submit a skill or plugin to a community marketplace via PR. Do NOT use for building skills or writing plugin code.
development
Use when the user says 'write browser tests', 'test this page', 'playwright test', 'e2e test', 'end to end test', 'browser test', 'test the UI', or needs Playwright-based browser testing for a web application. Do NOT use for unit tests, API tests, or non-browser testing.
development
Use when the user says 'teach me', 'explain as you go', 'mentor mode', 'walk me through', 'help me learn', 'explain why', 'learning mode', or wants real-time plain language narration of decisions and tradeoffs while building. Do NOT use for code review or debugging.