Logo Custom Canvas And Gestures

Custom Canvas And Gestures

Cộng đồng
zakariaf
custom-canvas-and-gestures

Quy định cách dùng CustomPainter/Canvas — tách View/Painter/Scene, trong đó painter đơn giản nhận một giá trị Scene bất biến; shouldRepaint chỉ so sánh giá trị và tách biệt hoàn toàn với luồng animation dùng AnimationController để vẽ lại; dùng chung một phép biến đổi affine cho CẢ painter lẫn bộ kiểm tra nhấn (toCanvas/toLogical là phép nghịch đảo chính xác, không tính lại tỷ lệ); kiểm tra nhấn theo hình học (lưới số nguyên hoặc bộ đệm ID vùng đã raster hóa, tuyệt đối không dùng Path.contains); paint() không cấp phát bộ nhớ; cử chỉ chỉ chuyển đổi thành command có kiểu rồi gửi đến Notifier (không thay đổi trạng thái trong handler); dùng ExcludeSemantics cùng Semantics ngang hàng, đọc giá trị hiển thị và có cách mã hóa bổ sung ngoài màu sắc; căn chỉnh TextPainter dựa trên đo đạc; RoundedSuperellipseBorder chính chủ; nét mảnh theo pixel vật lý; và chỉ dùng hình học có hướng. Dùng khi viết hoặc đánh giá CustomPainter/CustomPaint, cử chỉ trên canvas, kiểm tra nhấn/kéo, animation canvas, căn chỉnh văn bản theo số đo hoặc Semantics trên các pixel tự vẽ.

Add to TypingMind

Tổng quan

Nhà phát hànhzakariaf
Kho mãFlutter-Skills
Tên kỹ năngcustom-canvas-and-gestures
Sao
64
Bản fork
15
Tệp đi kèm
8
Giấy phépMIT
Liên kết
  • Hướng dẫn bằng Markdown

    Tệp SKILL.md được mô hình tải khi cần, nên chỉ tốn token khi có yêu cầu thực sự phù hợp.

  • Dùng được với mọi LLM

    Kỹ năng AI dùng hướng dẫn viết bằng Markdown thay vì mã dành riêng cho một nhà cung cấp, nên dùng được với GPT, Claude, Gemini, Grok hoặc mô hình cục bộ.

  • 8 tệp đi kèm

    Các tập lệnh, mẫu và tài liệu tham khảo mà mô hình có thể đọc khi làm việc. Các tệp chỉ cho phép đọc và không bao giờ được thực thi.

  • Mã nguồn mở

    Được zakariaf công bố trên GitHub. Hãy đọc các tệp nguồn trước khi cài đặt.

Cài đặt

Cài đặt kỹ năng AI Custom Canvas And Gestures trong TypingMind để dùng với bất kỳ LLM nào, hoặc thêm vào một tác nhân AI khác có thể đọc SKILL.md.

1

Cài đặt trong TypingMind

TypingMind cài đặt kỹ năng trực tiếp từ thư mục GitHub — đọc SKILL.md, đóng gói các tệp tài nguyên và lưu kết quả trên máy.

  1. Mở ứng dụng và vào Plugin → Kỹ năng.
  2. Chọn "Cài đặt từ GitHub".
  3. Dán URL của thư mục kỹ năng được hiển thị bên dưới rồi xác nhận.
    https://github.com/zakariaf/Flutter-Skills/tree/main/skills/custom-canvas-and-gestures
  4. Bật kỹ năng trong từng cuộc trò chuyện mà bạn muốn sử dụng kỹ năng đó.
Plugin → Kỹ năng → Thêm kỹ năng → Từ URL GitHub, sau đó dán URL thư mục và nhấn Tiếp tục.
2

Cài đặt trong tác nhân AI khác

Bất kỳ tác nhân AI nào đọc được định dạng Agent Skills đều có thể dùng kỹ năng này — hãy sao chép thư mục vào thư mục kỹ năng của tác nhân AI đó.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/zakariaf/Flutter-Skills.git /tmp/Flutter-Skills
mkdir -p .claude/skills
cp -r /tmp/Flutter-Skills/skills/custom-canvas-and-gestures .claude/skills/custom-canvas-and-gestures
Khởi động lại Claude Code sau khi sao chép để ứng dụng nhận kỹ năng mới.

Sử dụng trong TypingMind

Bật Custom Canvas And Gestures trong bất kỳ cuộc trò chuyện nào trên TypingMind, mô hình sẽ tự xử lý phần còn lại. Tên và mô tả của kỹ năng nằm trong prompt hệ thống. Ngay khi có yêu cầu phù hợp, mô hình tự tải toàn bộ hướng dẫn — bạn không cần gọi thủ công và kỹ năng không tốn token cho đến khi thực sự được dùng.

Mô hình tự nạp Custom Canvas And Gestures ngay khi có yêu cầu phù hợp.

Dùng được với mọi mô hình AI

Kỹ năng AI là các hướng dẫn Markdown thuần túy, không phải mã dành riêng cho một nhà cung cấp, nên bạn có thể dùng Custom Canvas And Gestures với cả những mô hình khác ngoài mô hình ban đầu. Chỉ cần cài đặt một lần trong TypingMind rồi dùng với GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama hoặc mô hình cục bộ do bạn tự chạy — tất cả đều dùng khóa API của riêng bạn.

  • Chỉ tải khi cần

    Prompt hệ thống chỉ chứa tên và mô tả. Hướng dẫn được tải khi có yêu cầu phù hợp đầu tiên, nên khi kỹ năng chưa được dùng, bạn không tốn token cho phần hướng dẫn.

  • Đổi mô hình ngay trong cuộc trò chuyện

    Vì kỹ năng là hướng dẫn chứ không phải mã, việc đổi mô hình không làm kỹ năng ngừng hoạt động — mô hình tiếp theo vẫn đọc cùng tệp SKILL.md.

Hướng dẫn của kỹ năng

Đây là nội dung SKILL.md mà mô hình tải. Hãy đọc trước khi cài đặt — kỹ năng là những hướng dẫn mà mô hình của bạn sẽ làm theo.

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.

  4. Hit-test by geometry class — integers for a lattice, a rasterized ID buffer for irregular regions — never Path.contains in the hot path. A grid cell is (x ~/ cell, y ~/ cell), one division per axis. An irregular region is resolved by indexing a cell → RegionId Uint32List rasterized once at load. O(1) and concavity-proof; testing a tap against N concave polygons every touch is not.

  5. Allocate nothing inside paint(). Precompute every Paint, Path, and Gradient as painter fields and mutate .color per element rather than constructing. Paint()/Path() inside paint() is the classic jank source; reserve saveLayer for a real group opacity/blend, never a plain fill.

  6. Every animation is driven by an AnimationController passed as the painter's repaint: Listenable — never setState/notifyListeners in a ticker. That repaints the painter directly without rebuilding the widget tree. Resolve the animation's duration through design-system-structure's reduced-motion token / resolveMotion helper (it owns that rule — collapse to zero, not gentler); when motion is suppressed, cut straight to the end state rather than tweening. A state change must never rely on motion or hue as its only signal — carry a redundant non-colour channel (shape + label + haptic) per accessibility-as-code.

  7. A gesture handler is a pure translator: pointer → localPosition → shared transform → hit-test → typed immutable command → a ViewModel method. It mutates nothing. Read TapDownDetails.localPosition/DragUpdateDetails.localPosition (never globalPosition), map through transform.toLogical, and call ref.read(vmProvider.notifier).<command>(...). Wrap the CustomPaint in HitTestBehavior.opaque so the whole rect is live over transparent gaps.

  8. One verb, one recognizer; arbitrate collisions explicitly in the arena. The primary verb owns a single recognizer; secondary verbs get separate recognizers. Where two can claim a pointer, resolve it via RawGestureDetector — do not hope. An axis-locked drag is a clamp (bounds snapshot at drag-start), not per-frame collision detection.

  9. Canonical in, display out — never convert units, format dates, or shape numerals inside paint(). The painter receives values already converted to display units and formatted upstream; it maps numbers to pixels. Bucket/downsample large histories off-isolate via Isolate.run, keyed off a revision counter — never loop thousands of points in paint().

  10. A custom-drawn surface is opaque to screen readers — author Semantics explicitly. Either wrap the CustomPaint in ExcludeSemantics with a sibling Semantics node that speaks the display value (the answer, not the shape), or return List<CustomPainterSemantics> from semanticsBuilder for per-element nodes. Colour is never the only channel — the never-colour-alone rule is owned by accessibility-as-code. The a11y action commits the same command the gesture does.

  11. Geometry is direction-agnostic; only chrome mirrors. Plotted data, a physical drag, a waveform have no handedness — never flip them for RTL. Legends, tooltips, axis placement, and label lead-edge mirror. Derive any sign from Directionality.of(context) and use *Directional insets — never a hard-coded Offset(-x, y), .left, or .right.

  12. Isolate the surface behind a RepaintBoundary. It gets its own compositor layer so a canvas tick does not repaint the surrounding chrome and vice versa. Set isComplex/willChange honestly. Do not blanket-wrap everything — each boundary costs GPU memory.

View / Painter / Scene

The Scene is the painter's entire input, an immutable value type (@freezed or a hand-rolled @immutable with ==/hashCode). Value equality is what makes shouldRepaint a cheap compare.

dart
@immutable
class ChartScene {
  const ChartScene({required this.points, required this.transform, required this.phase});
  final List<Offset> points;        // logical space, already downsampled upstream
  final CanvasTransform transform;  // the ONE mapping (rule 3)
  final double phase;               // 0..1 animation value, or 0 when idle

  @override
  bool operator ==(Object other) =>
      other is ChartScene &&
      identical(other.points, points) &&   // Notifier hands a new list only on real change
      other.transform == transform &&
      other.phase == phase;
  @override
  int get hashCode => Object.hash(points.length, transform, phase);
}

The View watches the ViewModel (a Riverpod Notifier/AsyncNotifier), projects its state into the Scene, and never mutates state from inside the painter. See state-management-riverpod for the ViewModel spine.

The shared transform

One uniform scale + centering origin; toLogical is the exact inverse of toCanvas. Both the painter and the hit-tester read it.

dart
class CanvasTransform {
  const CanvasTransform({required this.scale, required this.origin});
  final double scale;   // logical unit -> px
  final Offset origin;  // top-left of the drawn rect within the canvas, in px

  Offset toCanvas(Offset logical) => origin + logical * scale;
  Offset toLogical(Offset canvasPx) => (canvasPx - origin) / scale; // exact inverse

  factory CanvasTransform.fit(Size size, Size logicalBounds) {
    final scale = math.min(size.width / logicalBounds.width,
                           size.height / logicalBounds.height);
    final drawn = logicalBounds * scale;
    return CanvasTransform(
      scale: scale,
      origin: Offset((size.width - drawn.width) / 2, (size.height - drawn.height) / 2),
    );
  }
}

Hit-testing by geometry class

dart
// Lattice: pure integers, one division per axis.
({int col, int row})? hitLattice(Offset p, int cols, int rows) {
  final c = p.dx.floor(), r = p.dy.floor();
  if (c < 0 || r < 0 || c >= cols || r >= rows) return null;
  return (col: c, row: r);
}

// Irregular regions: index a Uint32List rasterized ONCE at load — O(1), concavity-proof.
int? hitRegion(Offset p, RegionIdMap m) {
  final gx = (p.dx * m.cols / m.logicalWidth).floor();
  final gy = (p.dy * m.rows / m.logicalHeight).floor();
  if (gx < 0 || gy < 0 || gx >= m.cols || gy >= m.rows) return null;
  return m.ids[gy * m.cols + gx];
}

Build the buffer once by drawing each region in a unique id-colour into a PictureRecorder → Picture.toImage → Image.toByteData, read into a Uint32List, and cache it. Rebuild only on a genuine geometry change. Full recipe in references/painter-and-scene.md.

Zero-allocation paint()

dart
class ChartPainter extends CustomPainter {
  ChartPainter(this.scene, {required Listenable repaint}) : super(repaint: repaint);
  final ChartScene scene;

  // Paints are FIELDS — allocate nothing in paint() (rule 5).
  final Paint _line = Paint()
    ..style = PaintingStyle.stroke
    ..strokeWidth = 2
    ..strokeJoin = StrokeJoin.round
    ..strokeCap = StrokeCap.round;

  @override
  void paint(Canvas canvas, Size size) {
    if (scene.points.length < 2) return; // empty state handled by the View, not here
    final t = scene.transform;           // the SAME transform the hit-tester inverts (rule 3)
    final first = t.toCanvas(scene.points.first);
    final path = Path()..moveTo(first.dx, first.dy);
    for (final p in scene.points.skip(1)) {
      final c = t.toCanvas(p);           // logical -> canvas px, mapped here in the painter
      path.lineTo(c.dx, c.dy);
    }
    canvas.drawPath(path, _line);
  }

  @override
  bool shouldRepaint(ChartPainter old) => old.scene != scene; // one value compare (rule 2)
}

Gesture → typed command

dart
class ChartView extends ConsumerWidget {
  const ChartView({required this.scene, super.key});
  final ChartScene scene;

  @override
  Widget build(BuildContext context, WidgetRef ref) {
    final vm = ref.read(chartNotifierProvider.notifier);
    return RepaintBoundary(                        // own compositor layer (rule 12)
      child: GestureDetector(
        behavior: HitTestBehavior.opaque,          // whole rect is live (rule 7)
        onTapUp: (d) {
          final logical = scene.transform.toLogical(d.localPosition); // never globalPosition
          final hit = hitLattice(logical, scene.cols, scene.rows);
          if (hit != null) vm.select(hit.col, hit.row); // typed command; no mutation here
        },
        child: CustomPaint(
          painter: ChartPainter(scene, repaint: ref.watch(chartTickProvider)),
          isComplex: true,
          willChange: scene.phase != 0,
        ),
      ),
    );
  }
}

Semantics over a canvas

dart
// Simple case: the whole surface speaks one display value.
Semantics(
  label: 'Balance trending up, from 12 to 41 over the last 30 days', // the answer, display values
  child: ExcludeSemantics(                          // the painter itself says nothing
    child: RepaintBoundary(child: CustomPaint(painter: ChartPainter(scene, repaint: tick))),
  ),
)

For per-element nodes (each tappable), return List<CustomPainterSemantics> from semanticsBuilder and override shouldRebuildSemantics — see references/gestures-and-semantics.md. The a11y onTap must call the same command the gesture does.

Measured text fitting

Scale text to a measured width with a linear TextPainter probe. Layout unconstrained — a constrained layout() wraps and tp.width then reports the constraint, silently returning the same size for every line.

dart
double fitFontSize(String text, TextStyle style, double maxWidth,
    {double min = 12, double max = 96}) {
  const probe = 100.0;
  final tp = TextPainter(
    text: TextSpan(text: text, style: style.copyWith(fontSize: probe)),
    textDirection: TextDirection.ltr,
    maxLines: 1,
  )..layout(); // NO maxWidth — glyph advances scale linearly with fontSize
  return (probe * maxWidth / tp.width).clamp(min, max);
}

Set weight with fontWeight only — do not also pass FontVariation('wght', …); FontWeight drives the axis and passing both conflicts. Fix optical centring metrically with TextHeightBehavior(applyHeightToFirstAscent: false, applyHeightToLastDescent: false, leadingDistribution: TextLeadingDistribution.even) — never a hardcoded pixel nudge, which breaks at 200% text scale. Never FittedBox/auto-shrink for content that must stay a uniform size. Details in references/text-and-shapes.md.

Shapes & hairlines

  • Prefer a CustomPainter over an image asset for repeated vector detail — it stays crisp at every DPR and theme. For many identical marks, draw them in one Canvas pass rather than N widgets.
  • First-party squircle: RoundedSuperellipseBorder / ClipRSuperellipse / Canvas.drawRSuperellipse are first-party with an Impeller GPU path. Do not reach for figma_squircle/smooth_corner; ContinuousRectangleBorder is not an iOS-grade squircle.
  • A true hairline is one physical pixel: 1.0 / MediaQuery.devicePixelRatioOf(context) with strokeAlign: BorderSide.strokeAlignInside. Border.all() defaults to 1.0 logical px = ~3 physical px on a modern phone — a table border, not a hairline.
  • Nested corners are concentric by construction: inner = outer - padding, computed, never a second constant that drifts.

Anti-patterns

  • shouldRepaint(_) => true, or a shouldRepaint that deep-walks mutable objects — the Scene is a value type; compare it (rule 2).
  • A god widget that holds state, reads ref inside paint(), or decides a rule in the painter — the painter is dumb (rule 1).
  • A hit-tester that re-derives scale from size, or math off globalPosition — always transform.toLogical(localPosition) (rules 3, 7).
  • Path.contains(tap) in the touch path, or re-rasterizing the ID buffer per tap/frame — it is geometry-stable (rule 4).
  • Paint()/Path() allocated inside paint() (when hoistable), a per-frame ui.Gradient, or saveLayer for a plain fill (rule 5).
  • Animating by setState/notifyListeners every ticker frame — pass the controller as repaint: instead (rule 6).
  • An un-skippable animation, or motion/hue as the only signal for a state change (rule 6).
  • Converting units / formatting dates / shaping numerals inside paint(), or looping raw history there — do it upstream, off-isolate (rule 9).
  • One opaque Semantics(label: 'chart') that describes the shape instead of the value, or no ExcludeSemantics on the decorative painter (rule 10).
  • A hard-coded Offset(-x, y), .left/.right, or Alignment.centerRight in a painter — derive from Directionality.of(context) (rule 11).
  • FittedBox/auto-shrink where uniform sizing is required; a constrained TextPainter.layout() in a fitter (measured-fit section).
  • Border.all() for a hairline; ContinuousRectangleBorder/third-party squircle packages (shapes section).
  • A CustomPaint with no RepaintBoundary, or blanket boundaries everywhere (rule 12).

Definition of done

  • The surface is a View + a Painter extends CustomPainter + an immutable Scene; the painter holds no Notifier/BuildContext/DateTime/rule (rule 1).
  • shouldRepaint returns old.scene != scene only; per-frame animation flows through repaint:, not shouldRepaint (rules 2, 6).
  • Exactly one transform is built per layout and read by both painter and hit-tester; toLogical/toCanvas are exact inverses; the hit-tester never re-derives scale (rule 3).
  • Hit-testing uses integer lattice math or a Uint32List region-ID buffer rasterized once; no Path.contains in the hot path; no target below ~44 pt (rules 4, 7).
  • paint() allocates nothing hoistable — Paint/Path/Gradient are fields, .color mutated per element, saveLayer only for a real group blend (rule 5).
  • Animation is driven by an AnimationController as repaint:; motion is resolved through design-system-structure's resolveMotion (cut to end state when suppressed); no state change relies on hue or motion alone (rule 6).
  • Gesture handlers translate localPosition → transform → hit-test → typed command → ViewModel method and mutate nothing; the CustomPaint is under HitTestBehavior.opaque (rule 7).
  • One recognizer per verb; arena collisions resolved via RawGestureDetector; axis-locked drags clamp to a drag-start bound (rule 8).
  • paint() receives canonical→display values formatted upstream; large histories are downsampled off-isolate keyed on a revision (rule 9).
  • The painter is ExcludeSemantics, and a sibling Semantics/semanticsBuilder speaks display values with a redundant non-colour channel; the a11y action equals the gesture command (rule 10).
  • No hard-coded directional sign in any painter; geometry is direction-agnostic, chrome mirrors from Directionality.of(context) (rule 11).
  • The surface sits under a RepaintBoundary; isComplex/willChange set honestly (rule 12).
  • scripts/check_painter_hygiene.sh and scripts/analyze.sh pass.

Related skills

  • See state-management-riverpod for the Notifier/AsyncNotifier ViewModel the View watches and the commands gestures call.
  • See widget-composition for the small-const-widget composition the View lives inside and controller disposal.
  • See flutter-performance for .select rebuild scoping, RepaintBoundary budgeting, and off-isolate work.
  • See design-system-structure for the theme colours, hairline/shape, and reduced-motion tokens the View snapshots at the widget layer and passes into painter/Scene fields — the painter never reads BuildContext. It owns the resolveMotion reduced-motion helper this skill's animation path defers to.
  • See accessibility-as-code for the never-colour-alone, MediaQuery-a11y-flag, redundant-channel, 44px-target, and sortKey rules the Semantics here obey.
  • See i18n-rtl-l10n for the canonical-store + localize-at-render contract that feeds display values into paint().
  • See motion-and-haptics for what animation on this surface commits to: one haptic per committed gesture, interruptibility, and the declared reduced-motion end state.
  • See widget-golden-and-a11y-testing for pinning the painted surface with a golden on real fonts.

References

Tệp đi kèm

Khi kỹ năng đã được tải, mô hình có thể đọc các tệp này nếu cần. Các tệp này chỉ dùng để đọc và không bao giờ được thực thi.

Câu hỏi thường gặp

Kỹ năng AI Custom Canvas And Gestures làm được gì?

Quy định cách dùng CustomPainter/Canvas — tách View/Painter/Scene, trong đó painter đơn giản nhận một giá trị Scene bất biến; shouldRepaint chỉ so sánh giá trị và tách biệt hoàn toàn với luồng animation dùng AnimationController để vẽ lại; dùng chung một phép biến đổi affine cho CẢ painter lẫn bộ kiểm tra nhấn (toCanvas/toLogical là phép nghịch đảo chính xác, không tính lại tỷ lệ); kiểm tra nhấn theo hình học (lưới số nguyên hoặc bộ đệm ID vùng đã raster hóa, tuyệt đối không dùng Path.contains); paint() không cấp phát bộ nhớ; cử chỉ chỉ chuyển đổi thành command có kiểu rồi gửi đến Notifier (...

Vì sao nên dùng Custom Canvas And Gestures trên TypingMind?

Vì bạn chỉ cần cài một lần rồi dùng với bất kỳ mô hình nào. Custom Canvas And Gestures là nội dung Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên cùng một kỹ năng có thể chạy trên GPT-5, Claude, Gemini, Grok hoặc mô hình trên thiết bị — và bạn có thể đổi mô hình ngay trong cuộc trò chuyện mà kỹ năng vẫn hoạt động. TypingMind dùng khóa API riêng của bạn, nên bạn thanh toán trực tiếp cho nhà cung cấp thay vì trả phí thuê bao theo suất người dùng, đồng thời kỹ năng và các cuộc trò chuyện vẫn nằm trong bộ lưu trữ của bạn.

Làm thế nào để cài Custom Canvas And Gestures trong TypingMind?

Mở Plugin → Kỹ năng → Cài đặt từ GitHub trong TypingMind rồi dán https://github.com/zakariaf/Flutter-Skills/tree/main/skills/custom-canvas-and-gestures. TypingMind đọc tệp SKILL.md, đóng gói các tệp đi kèm rồi cài đặt cả gói dưới dạng một kỹ năng mà bạn có thể bật cho từng cuộc trò chuyện.

Những mô hình AI nào có thể dùng Custom Canvas And Gestures?

Bất kỳ mô hình nào bạn kết nối trong TypingMind. Kỹ năng AI là các hướng dẫn bằng Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên GPT, Claude, Gemini, Grok và các mô hình chạy trên thiết bị đều có thể tải kỹ năng này khi có yêu cầu phù hợp.

Có thể dùng Custom Canvas And Gestures với bao nhiêu mô hình AI?

Bao nhiêu cũng được. Miễn là mô hình hỗ trợ kỹ năng, bạn có thể dùng Custom Canvas And Gestures với mô hình đó — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama và nhiều mô hình khác — tất cả đều trên TypingMind với khóa API riêng của bạn.

Kỹ năng AI Custom Canvas And Gestures có miễn phí không?

Có. Kỹ năng này được zakariaf phát hành trên GitHub theo giấy phép MIT. Bạn chỉ trả tiền cho nhà cung cấp AI của mình theo số token đã dùng.

Kỹ năng AI là gì?

Kỹ năng AI là một gói hướng dẫn có thể tái sử dụng, chỉ cho mô hình AI cách thực hiện một tác vụ cụ thể. Kỹ năng tuân theo định dạng mở Agent Skills: một tệp SKILL.md chứa tên và mô tả, cùng các tập lệnh, mẫu hoặc tệp tham khảo mà mô hình có thể cần. Mô hình chỉ đọc hướng dẫn khi yêu cầu của bạn phù hợp với kỹ năng, nên kỹ năng đã cài đặt không phát sinh chi phí cho đến khi được sử dụng.

Kỹ năng AI khác gì với plugin hoặc máy chủ MCP?

Plugin hoặc máy chủ MCP cung cấp các công cụ mới mà mô hình có thể gọi. Khi mô hình gọi một công cụ, mã của công cụ đó chạy ở đâu đó và trả về kết quả. Còn kỹ năng AI cung cấp kiến thức và quy trình: cách tiếp cận tác vụ, các bước cần thực hiện và những tiêu chí mà kết quả cần đáp ứng. Kỹ năng chỉ là nội dung Markdown, nên không cần máy chủ, khóa API hay môi trường thực thi và hoạt động với mọi mô hình.

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇