custom-canvas-and-gestures

custom-canvas-and-gestures is a skill for Claude Code from zakariaf/Flutter-Skills. It costs 207 tokens per session (5,110 once invoked), scanned A, original, MIT.

A set of rules for Flutter custom-painted surfaces, separating the screen view, drawing code, immutable scene data, coordinate transforms, gestures, and accessibility semantics.

In plain words
What is it for?
Use it when building diagrams, games, editors, charts, or other interfaces drawn with CustomPainter and controlled by gestures.
Why use it?
It keeps drawing and touch handling aligned and prevents large custom-canvas widgets from mixing rendering, interaction, and state decisions.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the flutter plugin — 40 skills shipped together

Good fit Use it when building diagrams, games, editors, charts, or other interfaces drawn with CustomPainter and controlled by gestures.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/zakariaf/flutter-skills/custom-canvas-and-gestures
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add zakariaf/Flutter-Skills --skill custom-canvas-and-gestures
Clone the repo
git clone --depth 1 https://github.com/zakariaf/Flutter-Skills

Made for: Claude Code.

Or install flutter, the plugin that ships this one along with the rest of its 40 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for custom-canvas-and-gestures

README.md
[![agentmods](https://agentmods.dev/badge/skills/zakariaf/flutter-skills/custom-canvas-and-gestures/github.svg)](https://agentmods.dev/skills/zakariaf/flutter-skills/custom-canvas-and-gestures)
Your own site
<a href="https://agentmods.dev/skills/zakariaf/flutter-skills/custom-canvas-and-gestures"><img src="https://agentmods.dev/badge/skills/zakariaf/flutter-skills/custom-canvas-and-gestures/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for custom-canvas-and-gestures

Your own site · 80×15
<a href="https://agentmods.dev/skills/zakariaf/flutter-skills/custom-canvas-and-gestures"><img src="https://agentmods.dev/badge/skills/zakariaf/flutter-skills/custom-canvas-and-gestures.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 207 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 5,110 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00207 $0.05110
Opus 5 $0.00103 $0.02555
Sonnet 5 $0.00041 $0.01022
Haiku 4.5 $0.00021 $0.00511

Measured 11d ago against content hash 36de200b1426, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

custom-canvas-and-gestures scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 11d ago.

The scan reads SKILL.md. This mod also ships 2 executable files (scripts/analyze.sh, scripts/check_painter_hygiene.sh), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/custom-canvas-and-gestures/SKILL.md · 270 lines

How it starts

The opening of the file, as written. The whole thing — 270 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Custom Canvas & Gestures

Hand-painted surfaces (CustomPainter/Canvas) own every pixel, so they look byte-identical across platforms — but only if the painter stays dumb, the coordinate math is shared, and gestures translate rather than decide. This skill is the contract for that layer: how it splits, how pixels and pointers agree, and how a screen reader hears a canvas.

Read the reference for the task at hand:

  • references/painter-and-scene.md — the View/Painter/Scene split, the shared transform, hit-testing by geometry class, zero-allocation paint(), the two-path repaint pitfall.
  • references/gestures-and-semantics.md — gesture-as-translator, arena arbitration, clamp-not-collision drags, custom-canvas Semantics, action/gesture parity.
  • references/text-and-shapes.md — measured TextPainter fitting, optical centring, RoundedSuperellipseBorder, physical-pixel hairlines, concentric radii, painter-over-image-asset.

Run scripts/check_painter_hygiene.sh and scripts/analyze.sh before a PR.

Non-negotiable rules

  1. A canvas surface is three collaborators — a View, a Painter, and an immutable Scene — never one god-widget. The View watches the ViewModel, builds an immutable Scene value type holding everything the painter needs and nothing more, and hands it to CustomPaint. The Painter extends CustomPainter is dumb: no Notifier, no BuildContext, no DateTime, no domain rules — it draws the Scene and never decides state. A dumb painter is testable and re-skinnable.

  2. shouldRepaint is one value compare — old.scene != scene — and nothing else. Because Scene has value equality, this is both correct and cheap. => true repaints every frame; a wrong false freezes the surface — both fail silently. Config-driven repaints go through shouldRepaint; per-frame animation goes through the repaint: Listenable. The two paths must never double-repaint.

  3. Exactly one affine transform maps logical space ↔ canvas pixels, read by BOTH the painter and the hit-tester. Build it once per layout from the incoming Size; expose toCanvas/toLogical as exact inverses. The single most corrosive bug is a painter and hit-tester that disagree by a few pixels; a shared, tested transform forecloses it. The hit-tester never re-derives scale from size — it calls transform.toLogical.

Read the full file on GitHub · 270 lines

Files

What ships with it

8 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 11d ago First seen · 270 lines · 207 tokens per session scan A 36de200b1426

Subscribe to this mod's changes

custom-canvas-and-gestures is a skill published in the GitHub repository zakariaf/Flutter-Skills (2 stars, last pushed 13d ago), licensed MIT. It adds 207 tokens to every session and 5,110 once invoked, about $0.0010 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

accessibility

Audits or remediates Flutter widgets against WCAG 2.2 conformance levels A, AA, or AAA across iOS, Android, Web, macOS, Windows, and Linux, covering Semantics labels and screen reader output under VoiceOver and TalkBack, touch target sizes, dragging alternatives, focus order and keyboard navigation, color contrast…

VeryGoodOpenSource/vgv-ai-flutter-plugin · 119 tokens

material-theming

Best practices for Flutter theming with Material 3, treating ThemeData as the single source of truth for colors, typography, component styles, and spacing. Use when creating, modifying, or reviewing ThemeData, ColorScheme, TextTheme, component themes, spacing systems, or light/dark mode support, and whenever widget…

VeryGoodOpenSource/vgv-ai-flutter-plugin · 137 tokens

android-edge-to-edge

Migrate a Jetpack Compose app to edge-to-edge display and fix system bar inset issues. Use when UI components are obscured by navigation/status bars, fixing IME insets, or enabling edge-to-edge for SDK 35+.

HoangNguyen0403/agent-skills-standard · 52 tokens

common-mobile-animation

Apply motion design principles for mobile apps covering timing curves, transitions, gestures, and performance-conscious animations. Use when implementing screen transitions, gesture-driven interactions, shared-element animations, or optimizing animation frame rates on iOS, Android, or Flutter.

HoangNguyen0403/agent-skills-standard · 52 tokens

flutter-design-system

Enforce Design Language System adherence in Flutter. Use when implementing design tokens, preventing hardcoded colors/spacing, or building a DLS.

HoangNguyen0403/agent-skills-standard · 32 tokens

common-mobile-ux-core

Enforce universal mobile UX principles for touch-first interfaces including touch targets, safe areas, and mobile-specific interaction patterns. Use when building mobile screens, handling touch interactions, or validating safe area compliance.

HoangNguyen0403/agent-skills-standard · 45 tokens