validating-and-publishing-canvases
यह क्या करती है
यह स्किल कैनवास के सोर्स को वैलिडेट करती है, उसकी घोषित अनुमतियाँ जाँचती है, और उसे सुरक्षित रूप से PostHog पर प्रकाशित करती है। यह उन बिल्डर्स के लिए है जो कैनवास बदलाव बिना उसे तोड़े या किसी और का काम खोए जारी करना चाहते हैं।
कब इस्तेमाल करें
- ✓जब आप कैनवास का संपादन पूरा कर चुके हों और उसे प्रकाशित करना चाहें।
- ✓जब वैलिडेशन त्रुटि या संस्करण टकराव के कारण प्रकाशन विफल हो।
- ✓जब आप नया संस्करण लाइव करने से पहले उसे परखना चाहें।
Skill का लिंक
https://github.com/PostHog/posthog/blob/master/products/canvas/skills/validating-and-publishing-canvases/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“मेरे कैनवास में समस्याएँ जाँचिए और उसे प्रकाशित कीजिए, पर ध्यान रखिए कि किसी और के बदलाव ओवरराइट न हों।”
हर हफ़्ते 5 नई skills, 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
- लाइसेंस
- —
- अपडेट की गई
- 2/11/2026
कमेंट
- …
इस repository की और skills
depot-ci
41kयह आपके एजेंट को Depot CI वर्कफ़्लो सेट अप करने, चलाने और माइग्रेट करने में मदद करती है, साथ ही रन के लॉग पढ़ने में।
depot-container-builds
41kयह आपके एजेंट को Depot के रिमोट बिल्डर पर Docker इमेज बनाने में मदद करती है, जिसमें मल्टी-प्लेटफ़ॉर्म इमेज और बिल्ड सुधार शामिल हैं।
depot-github-runners
41kयह आपके एजेंट को GitHub Actions जॉब Depot के मैनेज्ड रनर पर ले जाने, रनर का साइज़ और लेबल चुनने, और रनर सेटअप की समस्याएँ ठीक करने में मदद करती है।
editing-agents-md
41kयह आपके एजेंट को तय करने में मदद करती है कि कोई नियम AGENTS.md या CLAUDE.md में जाए या नहीं, और उसे ऐसे लिखे कि फ़ाइल भारी न हो।
मिलती-जुलती skills
angular-developer
280kआपके एजेंट को Angular code बनाने और प्रोजेक्ट स्ट्रक्चर पर सलाह देने में मदद करता है। नए प्रोजेक्ट शुरू करने, code के हिस्से बनाने, या performance और accessibility सुधारने में उपयोगी है।
frontend-a11y
280kआपके एजेंट को web interfaces को सबके लिए accessible बनाने में मदद करता है। यह सुनिश्चित करता है कि websites और apps screen readers और keyboard navigation के साथ अच्छे से काम करें।
frontend-patterns
280kआपके एजेंट को React और Next.js में frontend development के modern patterns लागू करने में मदद करता है। यह performance optimize करता है, state manage करता है और best practices फॉलो करवाता है।