This skill only supplements the sequence constraints and does not repeat the existing detailed specifications.
MCP pre-check (required)
Before executing any generation .pen / screenshot acceptance-related work:
- First try to call any Pencil MCP tool (for example
get_editor_state/open_document/get_screenshot)。 - If the MCP tool is unavailable or the call fails: immediately stop the subsequent steps and inform the user that the project MCP environment needs to be enabled/installed first (at minimum, Pencil MCP must be callable), otherwise the design file cannot continue to be generated.
Trigger conditions
- New
prototype/component - The prototype has been completed according to the existing process, and the corresponding Pencil design file needs to be filled in
- The existing page structure is redone, and the code and Pencil must be updated in sync
Process + check (merged)
- Prepare the target path
- Target directory:
src/prototypes/<name>/orsrc/components/<name>/ <name>Use lowercase letters, numbers, and hyphens
- First complete the prototype according to the existing process
- First complete
spec.md - according to the existing rules, then complete
index.tsx - Run the acceptance command to ensure the current prototype is deliverable
- Then complete
.pen(blocking step)
- Generate in the target directory
<name>.pen - Using the currently completed
spec.md+index.tsxas the sole baseline, rebuild the Pencil file 1:1 - The structure, dimensions, block hierarchy, copy, and main interaction naming must be consistent with the existing prototype
- If
.penandspec.md/index.tsxare inconsistent, fix the differences first before continuing
- Write back
spec.md
- Supplement Pencil information:
.penpath, main artboard, module mapping - Clearly record that this directory has entered the "code/Pencil bidirectional synchronization" maintenance state
- In
index.tsxadd a synchronization comment at the top
- A comment must be added at the top of the file, clearly stating: when updating the current prototype, the same-directory
.penandspec.md - The comment must include the specific file name
<name>.pen, to avoid omissions in subsequent maintenance
- Subsequent update constraints
- Any future modification to
spec.md、.pen、index.tsxmust keep all three in sync - If only the code is changed and Pencil is not changed, it is not considered completed delivery
Acceptance command
node scripts/check-app-ready.mjs /prototypes/<name>
node scripts/check-app-ready.mjs /components/<name>
Delivery definition
- The following must exist and be in sync at the same time:
spec.md、.pen、index.tsx index.tsxA Pencil synchronization comment must exist at the topcheck-app-ready.mjsThe result isREADY- Return three file paths upon delivery