Logo di Svg Add Primitive

Svg Add Primitive

Community
ChanMeng666
svg-add-primitive

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.

Panoramica

Pubblicato daChanMeng666
Repositorysvg-animation-studio
Nome della skillsvg-add-primitive
Stelle
3
Fork
0
File inclusi
Solo istruzioni
LicenzaMIT
Link
  • Istruzioni in Markdown

    Un file SKILL.md che il modello carica quando serve, consumando token solo quando una richiesta è effettivamente pertinente.

  • Funziona con qualsiasi LLM

    Le skill IA sono in semplice Markdown, non in codice specifico di un fornitore, quindi funzionano con GPT, Claude, Gemini, Grok o un modello locale.

  • Tutto nelle istruzioni

    Tutto ciò che serve al modello è nelle istruzioni: nessun file aggiuntivo da sincronizzare.

  • Open source

    Pubblicata da ChanMeng666 su GitHub. Leggi i sorgenti prima di installarla.

Installazione

Installa la skill IA Svg Add Primitive in TypingMind per usarla con qualsiasi LLM, oppure copiala in un altro agente in grado di leggere SKILL.md.

1

Installa in TypingMind

TypingMind installa una skill direttamente dalla sua cartella GitHub: legge SKILL.md, raccoglie i file delle risorse e salva il risultato in locale.

  1. Apri l'app e vai su Plugin → Skill.
  2. Scegli "Installa da GitHub".
  3. Incolla l'URL della cartella della skill riportato qui sotto e conferma.
    https://github.com/ChanMeng666/svg-animation-studio/tree/main/.claude/skills/svg-add-primitive
  4. Attiva la skill in ogni chat in cui vuoi averla a disposizione.
Plugin → Skill → Aggiungi skill → Da URL GitHub, poi incolla l'URL della cartella e premi Continua.
2

Installa in un altro agente

Qualsiasi agente che legge il formato Agent Skills può usare questa skill: copia la cartella della skill nella directory delle skill di quell'agente.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/ChanMeng666/svg-animation-studio.git /tmp/svg-animation-studio
mkdir -p .claude/skills
cp -r /tmp/svg-animation-studio/.claude/skills/svg-add-primitive .claude/skills/svg-add-primitive
Dopo la copia, riavvia Claude Code per caricare la nuova skill.

Usala in TypingMind

Attiva Svg Add Primitive in qualsiasi chat di TypingMind e al resto pensa il modello. Il nome e la descrizione della skill sono nel prompt di sistema e, non appena arriva una richiesta pertinente, il modello carica da solo le istruzioni complete: non devi mai richiamarla manualmente e non consuma token finché non viene effettivamente usata.

Il modello carica automaticamente Svg Add Primitive non appena riceve una richiesta pertinente.

Funziona con qualsiasi modello IA

Le skill IA sono semplici istruzioni in Markdown, non codice specifico di un fornitore, quindi Svg Add Primitive non è vincolata al modello per cui è stata scritta. Installala una sola volta in TypingMind e usala con GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama o un modello locale che esegui tu, sempre con le tue chiavi API.

  • Caricata solo quando serve

    Il prompt di sistema contiene solo il nome e la descrizione. Le istruzioni vengono recuperate alla prima richiesta pertinente, quindi una skill inutilizzata non costa nulla.

  • Cambia modello durante la chat

    Poiché la skill è composta da istruzioni e non da codice, continua a funzionare anche se cambi modello: il nuovo modello legge lo stesso file SKILL.md.

Istruzioni della skill

Questo è il contenuto di SKILL.md che il modello carica. Leggilo prima dell'installazione: una skill è un insieme di istruzioni che il tuo modello seguirà.

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 from the caller.
  • Counter reset: not your concern — the preset's compose() calls motion.resetIdCounter() at start.

Step 2 — Write the function

Add the new function to lib/primitives/<category>.js and to its module.exports. Include a 1-line JSDoc above the function explaining what motion / shape / filter it produces and what the key params control. Do not pad the JSDoc with @param lines for every option — the lib-api.md table is the contract for that.

Example skeleton (motion):

js
/** Orbital sweep: an element traces a circle around a center point. */
function createOrbit(opts = {}) {
  const {
    duration = '4s', easing = 'linear',
    radius = 20, centerX = 0, centerY = 0,
    direction = 'cw'
  } = opts;
  const cls = uniqueId('cv-orbit');
  const kf = `kf-${cls}`;
  const sign = direction === 'cw' ? 1 : -1;
  const css = `.${cls} {
  animation: ${kf} ${duration} ${cssEasing[easing]} infinite;
  transform-origin: ${centerX}px ${centerY}px;
}
@keyframes ${kf} {
  0%   { transform: rotate(0deg) translateX(${radius}px) rotate(0deg); }
  100% { transform: rotate(${sign * 360}deg) translateX(${radius}px) rotate(${-sign * 360}deg); }
}`;
  return { css, className: cls };
}

Step 3 — Use it from at least one preset

A primitive that no preset uses is unverified vocabulary. Pick an existing preset that legitimately needs the new primitive, OR — if the user is adding the primitive for a brand-new animation — make sure they're about to write that preset.

If no preset will use it within this session, stop and report:

Need primitive <name> but no consuming preset is being built. Either wait until building one needs it, or write a placeholder preset that demonstrates the primitive (recommended: name it <name>-demo).

Step 4 — Run snapshots

bash
npm test

Three outcomes:

  • All pass → great. Move to step 5.
  • A previously-passing snapshot now differs → you changed a primitive signature used elsewhere, or the export order in module.exports shifted something. Re-examine your diff. If the change is intentional, run npm run snapshot:update AND in your final report flag every affected preset so the caller does a visual recheck.
  • A test errors out (not just snapshot mismatch) → you broke an import. Fix before proceeding.

Step 5 — Document

Two files MUST be updated:

  1. docs/lib-api.md — add an H3 section under the right category with:

    • one-paragraph description
    • opts table (option / type / default)
    • the consuming preset(s)
    • source line range if reverse-engineered from a seed SVG
  2. CLAUDE.md — add a one-line entry under lib/primitives/<category>.js in the "lib API index" section. Format: - \createOrbit` — orbital sweep around a center point`

Increment the count in CLAUDE.md (e.g., "(10)" → "(11)").

Step 6 — Report

Return a one-block report. Keep it short.

EXTENDED: motion.createOrbit
Signature: createOrbit({ duration, easing, radius, centerX, centerY, direction })
Used by: <preset slug>
Tests: <pass | updated snapshots: list>
Docs: docs/lib-api.md, CLAUDE.md

What you must NOT do

  • ❌ Edit lib/primitives/*.js for any reason other than this skill.
  • ❌ Add a primitive with no consuming preset.
  • ❌ Skip the docs update — undocumented primitives become invisible to future sessions and rot quickly.
  • ❌ Use positional args. The convention is one opts object.
  • ❌ Forget module.exports — the function exists in memory but no one can use it.
  • ❌ Run npm run snapshot:update without explicit reason. Snapshots that silently change are bug seeds.

When the primitive doesn't fit any category

If motion, shapes, filters doesn't seem right — stop and propose a new category. This is rare (we've seen easing cover one edge case). Adding a fourth category is a design decision, not a routine extension. Ask the calling thread before proceeding.

Domande frequenti

Cosa fa la skill IA Svg Add Primitive?

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.

Perché usare Svg Add Primitive su TypingMind?

Perché la installi una volta e la usi con qualsiasi modello. Svg Add Primitive è scritta in semplice Markdown anziché in codice specifico di un fornitore, quindi la stessa skill funziona con GPT-5, Claude, Gemini, Grok o un modello locale, e puoi cambiare modello durante la chat senza che la skill smetta di funzionare. TypingMind usa le tue chiavi API, quindi paghi direttamente i fornitori anziché un abbonamento per posto utente, e le tue skill e chat restano nel tuo spazio di archiviazione.

Come installo Svg Add Primitive in TypingMind?

Apri Plugin → Skill → Installa da GitHub in TypingMind e incolla https://github.com/ChanMeng666/svg-animation-studio/tree/main/.claude/skills/svg-add-primitive. TypingMind legge il file SKILL.md e installa la skill, che puoi abilitare per ogni singola chat.

Quali modelli IA possono usare Svg Add Primitive?

Qualsiasi modello che colleghi a TypingMind. Le skill IA sono semplici istruzioni in Markdown anziché codice specifico di un fornitore, quindi GPT, Claude, Gemini, Grok e i modelli locali possono tutti caricare questa skill quando una richiesta corrisponde al suo scopo.

Quanti modelli IA posso usare con Svg Add Primitive?

Quanti ne vuoi. Se un modello supporta le skill, puoi usarlo con Svg Add Primitive: GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama e molti altri, tutti su TypingMind con le tue chiavi API.

La skill IA Svg Add Primitive è gratuita?

Sì. È pubblicata su GitHub da ChanMeng666 con licenza MIT. Paghi solo il tuo fornitore IA per i token che usi.

Cosa sono le skill IA?

Una skill IA è un pacchetto di istruzioni riutilizzabili che insegna a un modello IA come svolgere un'attività specifica. Segue il formato aperto Agent Skills: un file SKILL.md con un nome e una descrizione, più eventuali script, template o file di riferimento di cui il modello potrebbe aver bisogno. Il modello legge le istruzioni solo quando la tua richiesta corrisponde alla skill, quindi una skill installata non comporta costi finché non viene usata.

In cosa si differenziano le skill IA dai plugin o dai server MCP?

Un plugin o un server MCP fornisce a un modello nuovi strumenti da richiamare: codice che viene eseguito da qualche parte e restituisce un risultato. Una skill IA, invece, fornisce al modello conoscenze e procedure: come affrontare un'attività, quali passaggi seguire e quali caratteristiche deve avere un buon output. Le skill sono semplici istruzioni in Markdown, quindi non richiedono server, chiavi API né ambienti di esecuzione e funzionano con qualsiasi modello.

Elenco completo

Crea subito il tuo spazio di lavoro AI

Iscriviti alla nostra newsletter per ricevere aggiornamenti sulle nuove funzionalità e sulle prossime iniziative a premi 👇