myscript/iinkts/add-symbol-type
Claude Code and agent skill by myscript/iinkts
- community
Checking that the SKILL.md file is still in the repository.
Step-by-step guide to add a new symbol type to iinkTS. Use when implementing a new geometric primitive, annotation type, or any new TSymbol variant. Covers the full chain: type+Ops → Util adapter → registry → renderer → tests.
Install
npx vskill@latest install myscript/iinkts/add-symbol-typeSKILL.md
Add Symbol Type
When to Use
Adding any new symbol kind that must be stored in IIModel, rendered in SVG, and manipulated by managers.
Two layers — know which one you're extending
- `*Ops` — pure logic (create/update/overlap), co-located with the type in
src/symbol/{type}/{Type}.ts. No dependency on rendering or the registry. - `*Util` — adapter in
src/symbol-utils/{type}/{Type}Util.ts, extends abstractSymbolUtil, mostly delegates to the matching*Ops, addsgetSVGElement(). Registered intosymbolRegistrysoSVGRenderercan dispatch without aswitch.
Steps
1. Add to SymbolType enum
src/symbol/Symbol.ts:
2. Create the type + Ops file
src/symbol/yourtype/YourType.ts:
Model this on an existing type in the same family — src/symbol/stroke/Stroke.ts (StrokeOps) is the reference implementation.
3. Export from src/symbol/index.ts
4. Add to TSymbol union
src/symbol/Symbol.ts:
5. Create the *Util adapter
src/symbol-utils/yourtype/YourTypeUtil.ts:
Reference: src/symbol-utils/stroke/StrokeUtil.ts.
6. Register in registerBuiltinSymbolUtils
src/symbol-utils/registerBuiltinSymbolUtils.ts:
7. Export from src/symbol-utils/index.ts
8. Handle in managers (if needed)
Check which managers need to handle the new type:
IISelectionManager— if selectable/transformableIISnapManager— if snappable (usesgetSnapPoints())IIMoveManager— if moveable- Transform managers — if resizable/rotatable (override
canSelect/canTransform/canResize/canRotateon theUtilif the type has different capabilities than the defaults)
9. Write tests
test/unit/symbol/yourtype/YourType.test.ts—create(),createFromPartial()with missing fields,updateDerivedFields(),overlaps()inside/outside boxtest/unit/symbol-utils/yourtype/YourTypeUtil.test.ts— adapter delegates correctly,getSVGElement()produces expected structure
Checklist
- [ ]
SymbolTypeenum updated - [ ] Type +
*Opscreated insrc/symbol/{type}/, with type guard - [ ] Exported from
src/symbol/index.ts - [ ] Added to
TSymbolunion - [ ]
*Utiladapter created insrc/symbol-utils/{type}/, extendsSymbolUtil - [ ] Registered in
registerBuiltinSymbolUtils - [ ] Exported from
src/symbol-utils/index.ts - [ ] Manager handling verified
- [ ] Tests written (Ops + Util), ≥75% coverage
- [ ]
yarn typecheckclean - [ ]
yarn test:unitpasses
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/add-symbol-type/SKILL.md
Popularity
- Repository stars
- 97
- Repository forks
- 16
- 7-day trend score
- 23
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/myscript/iinkts/add-symbol-type)