AgentSkillsCN

Skill

助力打造与 Crescendo 视觉主题相匹配的 Flutter UI 代码。

SKILL.md

Apps SDK UI 1:1 Catalog Skill

This skill defines strict, deterministic rules for generating JSON Renderer specs mapped 1:1 to @openai/apps-sdk-ui components.

Purpose

  • Keep generated UI specs deterministic and machine-validated.
  • Restrict generation to known component names and strict prop schemas.
  • Use serializable action descriptors only.

Required Workflow

  1. Generate or update the UI spec using only allowed component names from src/catalog/apps-sdk-ui/inventory.generated.ts.
  2. Validate the spec with validateAppsSdkUiSpec before any render/runtime step.
  3. Stop on validation errors (hard fail). Do not auto-fix silently.
  4. Return structured validation errors including component name and JSON path.

Allowed Component Set

  • Source of truth: APPS_SDK_UI_COMPONENTS in src/catalog/apps-sdk-ui/inventory.generated.ts.
  • Custom component names are forbidden in this phase.

Action Rules

  • Interactive components may only use serializable action descriptors from src/catalog/apps-sdk-ui/actions.ts.
  • Allowed action kinds:
    • tool.call
    • ui.message
    • open.url
  • Function callbacks in JSON are forbidden.

Forbidden Patterns

  • Unknown component names.
  • Unknown props on any component.
  • Function values anywhere in props payloads.
  • Non-serializable values in action params.

Drift and Upgrade Protocol

  1. When bumping @openai/apps-sdk-ui, run:
    • npm run sync:inventory
  2. Commit inventory updates and mapping/schema/test updates in the same PR.
  3. CI must pass:
    • inventory drift check
    • parity tests
    • strict validation tests
    • render smoke tests

Notes

  • This skill intentionally excludes MCP widget execution/runtime wiring.
  • Rendering/runtime integration is a separate phase.