Skip to content

Commit f120602

Browse files
authored
When edit-canvas-app is used on a blank app, use generate instead (#69)
1 parent 0018263 commit f120602

1 file changed

Lines changed: 19 additions & 1 deletion

File tree

  • plugins/canvas-apps/skills/edit-canvas-app

plugins/canvas-apps/skills/edit-canvas-app/SKILL.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,25 @@ Read this file before planning any edits.
2424

2525
Before editing any YAML files, call the `sync_canvas` MCP tool to ensure a local copy of the canvas app YAML is present and up to date. This pulls the current app state from the coauthoring session into local `.pa.yaml` files.
2626

27-
Only proceed to edit the YAML files after `sync_canvas` completes successfully.
27+
Only proceed after `sync_canvas` completes successfully.
28+
29+
## CRITICAL: Check for Meaningful App Content After Sync
30+
31+
After `sync_canvas` completes, read the synced `.pa.yaml` files and check whether the app has meaningful content. An app is considered **empty** if:
32+
33+
- No `.pa.yaml` files were written, or
34+
- The only files present contain no screens, or
35+
- Every screen present has no controls (i.e., only bare screen-level YAML with no children), or
36+
- Every screen's controls consist solely of containers (e.g., `GroupContainer`) with no leaf controls inside them
37+
38+
If the app is empty, **do not proceed with the edit workflow**. Instead, inform the user:
39+
40+
> **The synced app appears to be empty — no existing screens or controls were found.**
41+
> Switching to app generation mode to build the app from scratch.
42+
43+
Then follow the full **generate-canvas-app** workflow (Discover → Plan → Design → Implement → Validate → Iterate → Complete), using the user's original request as the generation requirements.
44+
45+
If the app has meaningful content, proceed with the editing workflow below.
2846

2947
## Editing Workflow
3048

0 commit comments

Comments
 (0)