myscript/iinkts-preprod/manager-patterns
Claude Code and agent skill by myscript/iinkts-preprod
- community
Checking that the SKILL.md file is still in the repository.
Patterns for creating and extending managers in iinkTS. Use when adding a new manager, extending AbstractTransformManager, or understanding dependency injection and manager lifecycle.
Install
npx vskill@latest install myscript/iinkts-preprod/manager-patternsSKILL.md
Manager Patterns
Responsibility Rule
One manager = one responsibility. When a manager grows several unrelated concerns, extract a sub-manager (see manager/interactive/math/) or move per-type logic onto the symbol's util.
| Manager family | Location | Responsibility | |
|---|---|---|---|
| Base managers | src/manager/base/ | Shared by several variants: AbstractWriterManager, EraseManager, ExportManager, PDFExportManager, LayoutManager, ColorPaletteManager | |
| Simple managers | src/manager/simple/ | INK_V2 variant (IWriterManager) — its history is IHistoryManager in src/history/ | |
| Interactive managers | src/manager/interactive/ | INTERACTIVE_INK variant (~20 managers) | |
| Debug | src/manager/debug/ | IDebugSVGManager |
Creating a New Interactive Manager
Interactive managers extend IIAbstractManager (src/manager/interactive/IIAbstractManager.ts). They receive the canvas and read their dependencies from it through inherited getters — model, renderer, client, configuration — so a manager always sees the canvas's current instances.
Rules:
- Members
protected, not#private, unless truly internal state: integrators subclass managers this.loggercomes from the base (LoggerManager.getLogger(category)), pick the matchingLoggerCategory- Optional hooks:
onInit()(end of the base constructor) andonDestroy()(called bydestroy()) - Async methods return
Promise<void>orPromise<T>, never fire-and-forget - No hidden side-effects — if you emit an event or mutate the model, it must be obvious from the method name
- Never mutate a committed symbol:
model.draftSymbol(id)→ change →model.commitSymbol(draft)
Extending IIAbstractTransformManager
For managers that apply a geometric transform to symbols. The class is IIAbstractTransformManager, in src/manager/interactive/transform/AbstractTransformManager.ts:
The base provides applyMatrix(symbols, matrix), applyToSymbol(symbol, matrix), live preview (previewTransform, previewElementTransform), history recording (recordTransformed), followed/anchored symbols and finalizeTransform(). Read an existing subclass before writing a new one.
Existing subclasses: IITranslateManager, IIRotationManager, IIResizeManager, orchestrated by IITransformManager.
Manager Registration
Managers are instantiated in the InteractiveInkCanvas constructor with the canvas, and exposed as public properties:
Also:
- declare the property on
TInteractiveInkCanvas(src/canvas/TInteractiveInkCanvas.ts) — managers are typed against it, andtest/unit/__mocks__/createCanvasMock.tsmust provide it - export the class from its folder barrel (
src/manager/interactive/index.ts) - call its
destroy()from the canvas'sdestroy()if it holds listeners or timers
Anti-Patterns
| Anti-pattern | Fix | |
|---|---|---|
Caching this.canvas.model / renderer in a field | Use the inherited getters, they follow the canvas | |
Branching on symbol.type in a manager | Ask the util: symbolRegistry.getUtilFor(symbol) | |
| Emitting events from inside a private helper | Emit only from public methods | |
setTimeout / fire-and-forget async | Return Promise, let caller await | |
| Listener added without cleanup | Remove it in onDestroy() (or at the end of the gesture) | |
| Logic > 20 lines in one method | Extract named helper |
Security
- Security scanPassed, 90 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/manager-patterns/SKILL.md
Popularity
- Repository forks
- 1
- 7-day trend score
- 0
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-preprod/manager-patterns)