← ClaudeAtlas

svg-add-primitivelisted

Add a new reusable motion / shape / filter primitive to lib/primitives/ with safety: JSDoc + sensible defaults + at least one consuming preset + passing snapshot tests + updated docs/lib-api.md + CLAUDE.md index. Use this only when /svg-animate has flagged a missing capability or when the user explicitly asks to "add a primitive", "extend the lib", "teach the system to <verb>", or "I need a new <motion / filter / shape> for ...". This is the only sanctioned path for growing lib/primitives/; do not edit those files directly.
ChanMeng666/svg-animation-studio · ★ 0 · Web & Frontend · score 78
Install: claude install-skill ChanMeng666/svg-animation-studio
You are extending the system's vocabulary. A new primitive is a long-term commitment — once shipped, presets will depend on it. Your job is to ship it correctly the first time, not to ship it fast. ## What was passed in `$ARGUMENTS` is the primitive's category-qualified name (e.g., `motion.createOrbit`, `shapes.createStar`, `filters.createTurbulence`). If the argument is missing or unparseable, stop and ask the calling thread to clarify with format `<category>.<name>`. ## Why this skill exists Without a gatekept extension path, `lib/primitives/` quickly accumulates inconsistent signatures, undocumented functions, and primitives used by no one. The discipline below is what makes the library compound rather than sprawl. See `D:\github_repository\svg-animation-studio\docs\extension-protocol.md` for the rationale. ## Step 1 — Read the existing category Before adding to `lib/primitives/<category>.js`, read the whole file. Match: - **Naming**: `create<Verb>` for actions (createJump), `create<Noun>` for static elements (createMusicalNote). - **Return shape**: - `motion.*` → `{ css: string, className: string }` - `shapes.*` → raw SVG element `string` - `filters.*` → `<filter>` element `string` - **Opts pattern**: single `opts = {}` object; destructure with defaults at the top; never positional args. - **ID generation**: `motion.*` uses `uniqueId(prefix)` and includes the className in the keyframe name to avoid collisions. `shapes.*` and `filters.*` accept `id` fr