Agent Skillsgridaco/grida › io-grida

io-grida

GitHub

指导 TS 端处理 Grida 文件格式的 I/O 操作,包括加载、打包及剪贴板协议。涵盖 FlatBuffers 格式解析、ZIP 归档处理及冻结绑定维护,用于编辑器或包内的文件读写与格式调试。

.agents/skills/io-grida/SKILL.md gridaco/grida

Trigger Scenarios

处理 .grida 文件读取或写入 调试文件格式往返问题 进行档案打包或解包

Install

npx skills add gridaco/grida --skill io-grida -g -y
More Options

Non-standard path

npx skills add https://github.com/gridaco/grida/tree/main/.agents/skills/io-grida -g -y

Use without installing

npx skills use gridaco/grida@io-grida

指定 Agent (Claude Code)

npx skills add gridaco/grida --skill io-grida -a claude-code -g -y

安装 repo 全部 skill

npx skills add gridaco/grida --all -g -y

预览 repo 内 skill

npx skills add gridaco/grida --list

SKILL.md

Frontmatter
{
    "name": "io-grida",
    "description": "Guides work on the Grida file format (.grida) from the TS side: the I\/O packages that read\/write it (loading, archive packing, clipboard) and the frozen schema bindings. Use when working with .grida files in the editor or packages, or debugging format round-trip issues. (The schema and the Rust decoder live in the engine repo.)"
}

Grida I/O — .grida Format & Loading (TS side)

Format Overview

Grida uses FlatBuffers as the canonical binary format. File identifier: "GRID".

Two on-disk variants:

Variant Detection Notes
Raw FlatBuffers "GRID" at bytes 4–7 Bare document, no images
ZIP archive ZIP magic bytes manifest.json + document.grida + images/

Document model: Flat node repository (not nested). Nodes reference parents via ID + fractional-index position strings. Multi-scene: each Figma page → a SceneNode.

Key Locations

Path Role
packages/grida-canvas-schema/grida.ts TS runtime types (grida namespace) + SCHEMA_VERSION
packages/grida-canvas-io/ TS file loading, archive pack/unpack, clipboard protocol
packages/grida-format/src/ FROZEN flatc TS bindings (tombstone — see below)

The schema source of truth and the Rust decoder live in the engine repo: format/grida.fbs · crates/grida/src/io/.

TS Side — packages/grida-canvas-io/

  • io.load(file) — auto-detects format, decodes, extracts images → LoadedDocument
  • io.is_grid(bytes) — checks "GRID" identifier
  • io.archive.pack/unpack — ZIP with manifest.json
  • io.clipboard.encode/decode — Grida clipboard protocol

The tombstone — packages/grida-format

The generated TS FlatBuffers bindings are committed and frozen: the flatc generator wiring was deleted at the engine split (this repo has no format/grida.fbs and no bin/activate-flatc). The bindings are byte-identical to pinned flatc v25.12.19 output and the formatter/linter ignore them to keep it that way. Do not edit them. If the schema evolves in the engine repo and this reader should follow, re-snapshot deliberately from a gridaco/nothing checkout.

Verification

pnpm turbo test --filter='@grida/io'
pnpm turbo typecheck --filter='@grida/io' --filter='@grida/canvas-schema'

Schema Changes

Schema evolution happens in the engine repo (see its io-grida skill and format/AGENTS.md). What this repo owes on a breaking change — a cross-REPO lockstep:

  1. TS: bump grida.program.document.SCHEMA_VERSION in packages/grida-canvas-schema/grida.ts to match the engine's SCHEMA_VERSION in crates/grida/src/io/io_grida_fbs.rsexactly in sync; both writers must emit the same version string.
  2. Re-snapshot the frozen bindings from the new schema (deliberate act, see above).
  3. Old files are rejected by the TS reader (format.ts calls isSchemaCompatible() and throws on mismatch).

Version compatibility logic (isSchemaCompatible in grida-canvas-schema/grida.ts):

  • While MAJOR=0: same MAJOR.MINOR required (e.g. 0.91.* accepts 0.91.*, rejects 0.90.*)
  • Once MAJOR≥1: same MAJOR required (standard semver)

Format: MAJOR.MINOR.PATCH-prerelease+build (e.g. "0.91.0-beta+20260311").

Note: the TS FlatBuffers decoder is more lenient than the Rust verifier — a TS-side round-trip may pass on structurally invalid bytes. For byte-level verification, use the engine repo's Rust verifier.

Version History

  • 29f3afa Current 2026-08-20 15:55

Same Skill Collection

.agents/skills/ai-models/SKILL.md
.agents/skills/code-react/SKILL.md
.agents/skills/code-ts/SKILL.md
.agents/skills/database/SKILL.md
.agents/skills/docs-canvas/SKILL.md
.agents/skills/docs/SKILL.md
.agents/skills/editor-perf/SKILL.md
.agents/skills/ee-billing/SKILL.md
.agents/skills/ee/SKILL.md
.agents/skills/etiology/SKILL.md
.agents/skills/fixtures/SKILL.md
.agents/skills/io-figma/SKILL.md
.agents/skills/links/SKILL.md
.agents/skills/naming/SKILL.md
.agents/skills/opt-library/SKILL.md
.agents/skills/oss-standards/SKILL.md
skills/dotcanvas/SKILL.md
skills/slides/SKILL.md
skills/svg/SKILL.md
.agents/skills/agent-system/SKILL.md
.agents/skills/desktop/SKILL.md
.agents/skills/docs-svg-kit/SKILL.md
.agents/skills/docs-wg/SKILL.md
.agents/skills/gg/SKILL.md
.agents/skills/grounding/SKILL.md
.agents/skills/pedantic/SKILL.md
.agents/skills/sdk-design/SKILL.md
.agents/skills/sdk-seam/SKILL.md
.agents/skills/security/SKILL.md
.agents/skills/seo/SKILL.md
.agents/skills/vision/SKILL.md

Metadata

Files
0
Version
8ef5e53
Hash
76000c6a
Indexed
2026-08-20 15:55

Accueil - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-30 05:52
浙ICP备14020137号-1 $Carte des visiteurs$