ronjunevaldoz/kmp-agent-skills/kmp-compose-graphics-modifiers
Claude Code and agent skill by ronjunevaldoz/kmp-agent-skills
- community
Checking that the SKILL.md file is still in the repository.
Jetpack Compose graphics modifiers for KMP and CMP — use graphicsLayer for transforms, clipping, alpha, elevation, and layer effects; use Canvas, drawBehind, and drawWithCache for actual custom drawing. Recommended for workflow editors, node-based UIs, and other surfaces where a composable needs a transformable shell around a custom-drawn interior.
Install
npx vskill@latest install ronjunevaldoz/kmp-agent-skills/kmp-compose-graphics-modifiersSKILL.md
The same SKILL.md was published earlier as ronjunevaldoz/kmp-agent-skills/kmp-compose-graphics-modifiers.
When to Use This Skill
Use this skill when you need to:
- Build a workflow node, graph editor, or draggable surface in Compose
- Decide between
graphicsLayer,Canvas,drawBehind, anddrawWithCache - Add transforms, clipping, elevation, alpha, or rotation without redrawing layout
- Improve performance for repeated drawing objects like paths, brushes, and shaders
Recommended default: use Modifier.graphicsLayer for the node shell and Canvas or drawWithCache for the graph drawing itself.
Trigger keywords: graphicsLayer, Canvas, drawBehind, drawWithCache, custom drawing, workflow node, node editor, graph editor, drag transform, layer effects, elevation.
Freshness rule: Compose graphics and drawing APIs change with each CMP release — recheck the Compose developer docs before upgrading or copying snippets.
Recommendation First
For a workflow node, split the surface into two parts:
- Node shell:
graphicsLayerfor scale, alpha, clip, shadow, rotation, and lift. - Graph drawing:
CanvasordrawWithCachefor connectors, ports, grid, and paths.
Why:
graphicsLayerdoes not change measure or placement, so it is good for visual effectsCanvasis the right tool for actual renderingdrawWithCacheavoids rebuilding paths and brushes on every frame
Do not replace every canvas workflow with graphicsLayer. It improves the container, not the drawing system.
Project Structure
Use a structure that separates node chrome from the graph surface:
Rules:
WorkflowNodeSurfaceownsgraphicsLayerWorkflowGraphCanvasowns custom drawingWorkflowNodeControlsowns handles, buttons, and stateful interactions- keep drawing logic out of the top-level screen
Workflow Node Pattern
Use graphicsLayer for the node itself:
Use Canvas or drawWithCache for edges and cached drawing:
Use drawWithCache when the shape or brush should be reused:
Choosing the Right Tool
Use graphicsLayer when:
- the content should scale, rotate, fade, clip, or cast elevation
- you want a reusable visual wrapper around a composable
- you do not need to change layout size or position
Use Canvas when:
- you are drawing the graph, lines, shapes, or node connectors
- you need direct
DrawScopeaccess - layout is already decided and only the paint phase changes
Use drawWithCache when:
- the drawing uses expensive objects like
Path,Brush, orShader - the cached objects depend on size or small state inputs
Use drawBehind when:
- you want a simple background or underline behind normal content
- caching is not needed
Testing
Common Anti-Patterns
- using
graphicsLayerto fake the whole graph rendering - redrawing expensive paths every frame without caching
- changing layout or hit areas when only a transform is needed
- putting workflow node geometry directly inside screen composables
- using
drawWithCachewhen the draw objects are trivial and do not need caching
If the problem is geometry, use drawing. If the problem is presentation, use a layer.
Reference
See references/workflow-node-zoom.png for the workflow editor mockup with the toolbar outside the zoomed graph surface and sample zoom levels.
Related Skills
kmp-compose-design-system— design tokens and variants drive the visual style of workflow nodeskmp-compose-slot-api— node content areas are often implemented as composable slotskmp-mvi— draggable node state (position, selection) is managed through MVI state
Output Style
When asked about graphics modifiers or custom drawing, respond in this order:
- recommendation (graphicsLayer vs Canvas vs drawWithCache — pick the right tool)
- code snippet (the modifier or Canvas call for the stated use case)
- why that tool fits
- main alternative
Lead with the decision table when the user is choosing between tools. Keep snippets to one modifier or one Canvas block.
Changelog
| Date | Change | |
|---|---|---|
| 2026-06-13 | Initial release. |
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/kmp-compose-graphics-modifiers/SKILL.md
Popularity
- 7-day trend score
- 0
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/ronjunevaldoz/kmp-agent-skills/kmp-compose-graphics-modifiers)