Yida openyida publish guard

From openyida/openyida · View interactive version

Yida openyida publish guard is an AI agent skill from the GitHub repository openyida/openyida. Prevent stale local OpenYida custom page source from overwriting live designer edits. Use before modifying, compiling, or publishing an existing Yida custom page, display page, pageDesigner URL, or formUuid with openyida publish, especially when users may have edited the page in the designer after l

How to use this skill

Skill file

OpenYida Publish Guard

For progress, completion, delivery cards, and follow-up suggestions, follow user-facing summaries. Describe only the requested business change and verified outcome; keep source paths, commands, readback fields, and diagnostics in internal records.

Purpose

Use this skill whenever an existing OpenYida custom page is about to be edited or published from local source.

The Yida designer is also a source of truth. Users can make small live edits in the designer, such as deleting a query button, while the local .oyd.jsx file still contains older code. Publishing that stale local file will silently restore the deleted UI or roll back other live changes.

This skill adds a mandatory online-state check before publishing so agents merge requested changes onto the current live page instead of overwriting it.

When To Use

Use this skill for:

Do not use this skill for creating a brand-new page that has no existing live schema.

Required Workflow

  1. Identify the target appType and formUuid from the active page or bound context. Check the local source path if it exists.
  2. Check the OpenYida environment and login state:
openyida env --json
openyida login --check-only --json
  1. For an existing Canvas page, export both the editable source and current schema in one call. Choose a fresh directory under the project cache:
openyida get-schema <appType> <formUuid> --canvas-source-dir project/.cache/openyida/publish-guard/<snapshot> --json

The path above is relative to the workspace root. From the project root, use .cache/openyida/publish-guard/<snapshot>. Read sourceFile for the relevant component or handler and keep schemaFile for checking the page configuration. If the local source is missing, use the exported source as the starting point. Keep the snapshot as a baseline and make the targeted edit in a working source file.

For a legacy JSX page, fetch its current schema:

openyida get-schema <appType> <formUuid> --json

If the schema needs to be inspected from a file, save stdout with the agent's structured file write tool to <projectRoot>/.cache/openyida/publish-guard/live-<formUuid>.json. From the workspace root that path is typically project/.cache/openyida/publish-guard/live-<formUuid>.json. Do not use shell redirection and do not commit fetched live schema files.

  1. Inspect the fetched live page for current code and configuration. Use the relevant data sources and component tree when comparing Canvas pages. For legacy JSX pages, also check:
  1. Compare the live source with the local source before publishing.
  1. Only after the merge is scoped and reviewed, run:
openyida check-page <source>
openyida compile <source>
openyida publish <source> <appType> <formUuid> --health-check

Minimal Diff Discipline

Incident That Motivated This Skill

While editing a Junjie Yida ranking page, a user had deleted the query button directly in the Yida designer. A later targeted change was published from an older local .oyd.jsx file without first checking the live designer schema. The stale publish restored the deleted query button and overwrote the user's immediate designer edit.

The fix was to restore the deleted UI state and add this guardrail: before future OpenYida page edits or publishes, fetch the live schema, compare the current live source with local source, and merge the requested change onto the latest live behavior.

Recovery If An Overwrite Happens

  1. Acknowledge the overwrite plainly.
  2. Restore the overwritten live change immediately, without broad refactors.
  3. Re-run openyida check-page, openyida compile, and openyida publish --health-check.
  4. Update this skill if the failure mode is not already covered.
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.