skills/write-skill/SKILL.md
How to write, update, or split skill files in this repo. Use when creating a new SKILL.md, updating an existing one, or deciding whether to put content in a skill vs. docs/.
npx skillsauth add bkinsey808/songshare-effect write-skillInstall 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.
Requires: file-read. No terminal or network access needed.
SKILL.md under skills/.npm run check:skill-line-count) enforces this. If you're over, move detail to docs/ and deep-link.docs/.docs/ via deep links. Update the doc when you learn something new; then update the skill to point at it.Every skill needs these sections in order:
---
name: <kebab-case-name>
description: <one sentence — what this covers and when to use it>
---
# <Title>
## Use When
<bullet list of trigger conditions>
---
## Execution Workflow (if the skill covers a multi-step task)
<numbered steps>
---
## Key Patterns
<only the most essential facts — defer detail to docs>
---
## References
<links to docs/, workflows, and related skills>
## Do Not
<short list of common mistakes to avoid>
| Content type | Where it lives |
| ----------------------------------------- | ----------------------------------------- |
| Step-by-step task workflow | .agent/workflows/<name>.md |
| Full pattern reference with many examples | docs/<topic>.md |
| Quick lookup table / rule summary | docs/lint-best-practices.md or similar |
| "Use this when X, do Y, see Z" | SKILL.md |
| Project background / motivation | docs/ |
Skills should link into docs/ at the heading level using GitHub-flavored Markdown anchors. Heading ## Foo Bar becomes #foo-bar. Special chars are stripped; spaces become -:
<!-- From a skill, linking into a doc section -->
See [→ Foo Bar pattern](../../../docs/my-doc.md#foo-bar)
IDE markdown linters may warn that fragment links can't be resolved — ignore these warnings. The links work on GitHub and in agent context.
Split when the skill covers two clearly distinct audiences or task types. Example: unit-testing and unit-testing-hooks are separate because hooks tests need a different setup. Don't split just to stay under 300 lines — trim first; split only when topic focus genuinely differs.
version in frontmatter.npm run check:skill-line-count to verify ≤ 300 lines.scripts/check-skill-line-count/.agent/workflows/docs/docs/ and link.description frontmatter field — agents use it for relevance matching.tools
Zustand state management patterns for this project — store creation, selectors, Immer middleware, async actions with loading states, devtools, persist, and testing. Use when authoring or editing Zustand stores (use*Store files) or components that subscribe to stores. Do NOT use for React component structure or TypeScript-only utilities.
development
Complete guide for testing React hooks — renderHook, Documentation by Harness, installStore, fixtures, subscription patterns, lint/compiler traps, and pre-completion checklist. Read docs/testing/unit-test-hook-best-practices.md for the full reference.
development
Vitest unit test authoring for this repo — setup, mocking, API handler testing, and common pitfalls for non-hook code. Use when the user asks to add, update, fix, or review unit tests for utilities, components, API handlers, or scripts. Do NOT use for React hook tests — load unit-test-hook-best-practices instead.
development
TypeScript conventions for this repo (no `any`, explicit return types, JSDoc, exactOptionalPropertyTypes, ambient types, import style). Use when authoring or editing any `.ts` or `.tsx` file, resolving TypeScript strictness errors, or fixing type-related lint failures. Do NOT use for React-specific typing patterns (see react-best-practices skill) or JSDoc-only changes (see code-comment-best-practices skill).