composing-grid-canvases
Fungsinya
Skill ini menempatkan, memindahkan, mengubah ukuran, dan mengonfigurasi widget pada canvas grid, termasuk canvas beranda Anda. Ditujukan untuk siapa saja yang ingin menata ringkasan PostHog dari widget yang sudah jadi.
Kapan dipakai
- βSaat Anda ingin menambahkan widget, seperti widget cuaca atau tugas, ke canvas beranda Anda.
- βSaat Anda ingin menata ulang atau mengubah ukuran widget pada grid.
- βSaat Anda ingin seluruh rangkaian widget diatur dari satu permintaan.
Link skill
https://github.com/PostHog/posthog/blob/master/products/canvas/skills/composing-grid-canvases/SKILL.mdSalin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.
Cara pakai
Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.
Pesan siap tempel
Untuk Claude Code, Codex, atau Cursor: jalankan di folder proyek, lalu skill langsung terpasang.
Unduh SKILL.md lalu taruh di folder skill agen Anda.
Contoh permintaan ke AI
βTambahkan widget daftar tugas ke canvas beranda saya dan letakkan di sebelah grafik pendaftaran saya.β
5 skill baru setiap minggu. 1 menit baca.
Cara kerjanya
AI terlebih dahulu mencari widget yang sudah ada dan cocok, lalu mengonfigurasinya jika memungkinkan. Jika tidak ada yang cocok, AI menyesuaikan widget yang mirip atau membangun widget baru, lalu memperbarui tata letak grid.
Konten teknis (SKILL.md asli)
Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.
Composing grid canvases
A grid canvas is a composition, not an app: a grid of placements, each rendering a component canvas (a reusable widget with its own source, build, and placement contract). The user's home canvas is an ordinary grid canvas in their personal channel. Layout is data β publishing or patching one is live immediately, with no build.
Three canvas kinds share one lifecycle:
freeformβ a standalone app (thebuilding-canvasesskill owns these).componentβ a reusable widget. Same source/build pipeline as freeform, plus a placement contract. Visibility rides its channel: personal channel = private, team channel = shared.gridβ a layout of placements referencing components. No file source; layout only.
The resolution ladder: configure, fork, build
When a grid placement needs content ("a weather widget here", "a kanban of my tasks"), resolve in this order β placing an existing component beats authoring a duplicate:
- Search the store:
canvas-listwithkind=componentandsearch=<what the widget shows>. A component is placeable when bothcomponent_metaandpublished_build_idare set. If itsconfigSchemacan express the request ("weather for Lisbon" β existing weather component withconfig: {"location": "Lisbon"}), place and configure it β write no code. - Fork when a component is close but its config cannot express the ask: read its source
(
canvas-source-retrieve), create a new component (canvas-createwithkind=component), adapt, publish. Name the difference in the new component's description. - Build new when nothing fits β see "Building a component" below.
New components land in the channel you create them in. Create them in the same channel as the grid they serve unless the user asks to share them more widely.
Building a component
A component is authored exactly like a freeform canvas β load building-react-quill-canvases (or
building-html-canvases) plus querying-canvas-data and validating-and-publishing-canvases β
with three additions. A component that shows PostHog data follows the same verifiability rule as
any canvas: an insight-backed figure links its saved insight, an ad-hoc query exposes the exact
query that ran (see "Verifiability" in querying-canvas-data).
Start from the complete, buildable project in references/component-example.md; its envelope, placement contract, capability declarations, and defensive ph.state access are the parts that break when improvised.
Create with
kind=componentand adescriptionwritten for store search: say what the widget shows and what its config controls. Future placements are found by this text.Declare the placement contract in the project's top-level
componentkey:{ "component": { "size": { "defaultW": 2, "defaultH": 1, "minW": 1, "minH": 1, "maxW": 4 }, "configSchema": { "type": "object", "properties": { "location": { "type": "string", "description": "City to show weather for" } } } } }Size is in grid units (widths 1β12, heights 1β40);
minW <= defaultW <= maxW. The range is advisory: users may resize a placement to any size, so it informs defaults and warnings, never rejections. The config schema vocabulary is an allowlist βtype,title,description,default,properties,required,additionalProperties,items,enum,const,minimum,maximum,minLength,maxLength,minItems,maxItems,format. No$ref, nopatternβ validation rejects them.Design responsively. Give the component's root
min-h-screenso it fills the placement iframe's viewport and grows past it as content demands. Adapt the layout to any size the user drags: a 2Γ1 placement is a glanceable tile; a 6Γ4 is a full app surface. Do not useh-screenon the root: a fixed viewport height caps a flex column, so tall children shrink and clip instead of scrolling. Do not useh-fullon the root either: a published component's artifact shell gives itshtml,body, and#rootelements no explicit height, soheight: 100%collapses to the content height. Render usefully atminWΓminH, and treatconfigas the only per-placement input.
Publish and wait for the build like any canvas β a component with no ready build cannot go live on a grid.
Composing a whole canvas
A whole-canvas ask ("a home canvas that summariz
Pertanyaan umum
Mengapa menggunakan ulang widget yang sudah ada?
Menempatkan widget yang sudah jadi lebih cepat dan menghindari duplikasi, sehingga skill memeriksa penyimpanan terlebih dahulu.
Apakah mengubah tata letak memerlukan pembangunan ulang?
Tidak. Tata letak adalah data yang tersimpan, sehingga perubahannya langsung terlihat.
Siapa yang bisa melihat widget yang saya tambahkan?
Visibilitas mengikuti kanal. Widget di kanal pribadi tetap privat, dan widget di kanal tim dibagikan.
Detail
Deskripsi asli dari pembuat
Compose PostHog grid canvases β widget grids (including the user's home canvas) built from reusable component canvases. Use when a task asks to add, fill, move, resize, or remove a widget on a grid or home canvas, to compose a whole canvas of widgets from one ask, to build a reusable widget/component, or when a placement id or grid canvas id is the target. Covers the component store search β configure β fork β build ladder, the component placement contract (size, configSchema), the placement lifecycle (pending/generating/live/failed), the guarded layout patch loop, and reading the canvas's com
repo: PostHog/posthog
Popularitas
- Bintang GitHub
- 41k
- Peringkat
- #6841
- Lisensi
- β
- Diperbarui
- 2/11/2026
Komentar
- β¦
Skill lain dari repositori ini
depot-ci
41kMembantu agent Anda menyiapkan dan menjalankan alur kerja Depot CI, alternatif GitHub Actions, termasuk memigrasikan alur kerja yang ada dan membaca log eksekusi.
depot-container-builds
41kMembantu agent Anda membangun image Docker di builder jarak jauh Depot, termasuk image multi-platform, pengiriman ke registry, dan perbaikan kegagalan build.
depot-github-runners
41kMembantu agent Anda memindahkan job GitHub Actions ke runner yang dikelola Depot, memilih ukuran dan label runner, serta memecahkan masalah pengaturan runner.
editing-agents-md
41kMembantu agent Anda memutuskan apakah sebuah aturan layak masuk ke berkas AGENTS.md atau CLAUDE.md, dan menulisnya agar tetap dipatuhi tanpa membuat berkas membengkak.
Skill serupa
angular-developer
280kMembantu agent Anda membuat kode Angular dan memberi saran struktur proyek. Berguna saat memulai proyek baru, membuat komponen, atau meningkatkan performa.
frontend-a11y
280kMembantu agent Anda membuat antarmuka web dapat diakses semua orang. Memastikan website dan aplikasi berfungsi baik dengan screen reader dan navigasi keyboard.
frontend-patterns
280kMembuat agent Anda menerapkan pola modern dalam frontend. Mengoptimalkan performa, mengelola state, dan mengikuti praktik terbaik React dan Next.js.