validating-and-publishing-canvases
하는 일
이 스킬은 캔버스 소스를 검증하고, 선언된 권한을 확인하고, PostHog에 안전하게 게시합니다. 다른 사람의 작업을 잃거나 깨뜨리지 않고 캔버스 변경을 공개하려는 제작자를 위한 것입니다.
사용하는 경우
- ✓캔버스 편집을 마쳤고 게시하고 싶을 때.
- ✓검증 오류나 버전 충돌로 게시가 실패할 때.
- ✓새 버전을 라이브로 만들기 전에 테스트하고 싶을 때.
스킬 링크
https://github.com/PostHog/posthog/blob/master/products/canvas/skills/validating-and-publishing-canvases/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“제 캔버스에 문제가 없는지 확인하고 게시해 주세요. 다른 사람의 변경이 덮어쓰이지 않도록 해 주세요.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
AI는 현재 버전을 읽고, 받은 검증 메시지를 고치고, 정확히 그 버전을 기준으로 게시해서 더 새로운 작업이 덮어쓰이지 않게 합니다. 그다음 새 빌드가 대기열에 들어가며, 끝날 때까지 캔버스는 마지막으로 성공한 빌드를 보여 줍니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
Validating and publishing canvases
A canvas's source lives in PostHog, versioned per publish. Publishing is guarded: every edit is based on a specific version, and the server refuses to overwrite newer work. Every publish queues a server-side build, and the canvas renders the last successful build.
The source project
canvas-source-retrieve returns:
project—schemaVersion(1),files(path → content),entryHtml("index.html"),dependencies(exact platform-pinned versions),canvasSdkVersion,capabilities.current_version_id— the version your edits are based on. Keep it; the publish needs it. It isnullfor a canvas that has never been published — pass thatnullon the first publish.
Keep index.html and dependencies exactly as returned. You may add relative source files and
admitted assets to the project. Use ?worker for a self-contained module worker and represent
binary assets as base64 entries in assets; new npm dependencies or dependency-version drift fail
validation.
Declare capabilities
The host enforces project.capabilities at runtime, so an undeclared ph call builds fine and
then dies in the rendered canvas. Declare:
capabilities.posthog.insights— every insight short id the canvas passes toph.loadInsight.capabilities.posthog.captureEvents— every event name it passes toph.capture.capabilities.posthog.inlineQueries: true— when it callsph.queryat all.capabilities.posthog.agentRequests: true— when it callsph.agent.request.capabilities.connectors— one{ "provider", "tools" }entry per third-party provider the canvas reads throughph.connectors.call, listing every tool it calls on that provider. A provider is a native id (github) ormcp:<server host>(mcp:mcp.calendly.com). Unknown providers, unregistered native tools, and private MCP hosts fail validation; every declared tool must haveis_read_only: truein the catalog. An upstream hint alone does not grant access. A canvas with connectors cannot declare shared state.capabilities.network.origins— each exact HTTPS origin used byfetch,XMLHttpRequest, or an external stylesheet, image, font, media file, or frame. Remote scripts remain blocked. Do not include paths, credentials, queries, fragments, or wildcards. The host must be public: loopback and private IPs, single-label names likeintranet, and the.local,.localhost,.internal, and.home.arpasuffixes are all rejected, so a local dev host such ashttps://localhost:8010fails validation with aninvalid_network_originerror. Data sent to a declared origin leaves PostHog and appears in the capability review before promotion.
Before validation, inventory every literal external URL in every source file. Classify navigation
links and ph.openExternal() URLs as navigation; they do not need a network origin. For every
request or resource URL, declare its scheme + host + optional port only. Include every origin a
request redirects to and every secondary origin a stylesheet references for fonts or images.
Never infer that one CDN hostname covers another.
Validation rejects undeclared literal calls and resource URLs (capability_missing_* diagnostics)
so you can fix them before publishing. Dynamic URLs and redirect destinations cannot be inferred,
so the inventory is still required even when validation is clean.
Validate until clean
canvas-validate-create is side-effect free; call it as often as needed.
Diagnostics carry severity, a stable code, a message, and (for file-specific problems)
path and line:
errordiagnostics block publishing — fix all of them. Common ones:import_not_allowed(bare imports are limited to the dependencies returned in the source project),forbidden_dynamic_import/forbidden_require/forbidden_inline_script,invalid_path,capability_missing_insight/capability_missing_capture_event/capability_missing_inline_queries/capability_missing_agent_requests/capability_missing_network_origin,dependency_not_admitted/dependency_version_mismatch,platform_token_redeclared(a CSS variable named like a Quill token that the platform stylesheet sets on every element, so the value never applies; prefix your own variables), and path/size violations.warningdiagnostics don't block, but heed them:network_fetch/network_xhrmean the code reaches for the network directly.
자주 묻는 질문
게시가 충돌로 실패하면 어떻게 하나요?
읽은 뒤에 누군가 캔버스를 바꿨다는 뜻입니다. AI는 최신 버전을 읽고, 자신의 변경을 합친 뒤 다시 시도합니다.
게시 후에도 왜 예전 버전이 보이나요?
PostHog는 마지막으로 성공한 빌드를 보여 주며, 새 빌드는 대기 중인 빌드가 끝나면 나타납니다.
게시 후 데이터 호출이 왜 실패하나요?
데이터 소스는 캔버스가 사용하기 전에 캔버스 설정에 선언되어야 합니다.
상세 정보
작성자의 원본 설명
Validate and publish a canvas source project safely: the source-project shape, declared capabilities, reading the current version pointer, iterating on validation diagnostics, guarded publishing with expected_current_version_id, staging a draft build and promoting it, waiting out the queued build, and recovering from a 409 version_conflict or a 429 capacity limit without overwriting concurrent work. Use whenever a canvas edit is ready to save, a draft build is wanted, a canvas publish or build returns diagnostics or a conflict, or a task needs to understand canvas version history.
repo: PostHog/posthog
인기도
- GitHub 스타
- 41k
- 순위
- #6843
- 라이선스
- —
- 업데이트
- 2026. 11. 2.
댓글
- …
이 저장소의 다른 스킬
depot-ci
41k에이전트가 GitHub Actions 대안인 Depot CI 워크플로를 설정하고 실행하도록 돕습니다. 기존 워크플로 이전과 실행 로그 읽기를 포함합니다.
depot-container-builds
41k에이전트가 Depot 원격 빌더에서 Docker 이미지를 빌드하도록 돕습니다. 다중 플랫폼 이미지, 레지스트리 푸시, 빌드 실패 수정을 포함합니다.
depot-github-runners
41k에이전트가 GitHub Actions 작업을 Depot 관리형 러너로 옮기고, 러너 크기와 라벨을 고르도록 돕습니다.
editing-agents-md
41k에이전트가 규칙을 AGENTS.md나 CLAUDE.md 중 어디에 둘지 정하고, 파일을 키우지 않으면서 잘 지켜지도록 쓰게 돕습니다.
비슷한 스킬
angular-developer
280k에이전트가 Angular 코드를 만들고 프로젝트 구조를 조언하도록 돕습니다. 새 프로젝트 시작, 코드 부분 생성, 성능과 접근성 개선에 유용합니다.
frontend-a11y
280k모든 사람이 웹 인터페이스를 쓸 수 있도록 에이전트를 돕습니다. 웹사이트와 앱이 화면 읽기 프로그램과 키보드 탐색에서 잘 작동하도록 합니다.
frontend-patterns
280k프론트엔드 개발의 현대적인 패턴을 적용하도록 에이전트를 돕습니다. React와 Next.js에서 성능을 최적화하고, 상태를 관리하며, 모범 사례를 따릅니다.