feat(ai): add 'elements' section to get_design_prompt + new skill
Step 4 of N-tool element design. Teach external MCP clients (Claude
Code / Codex / Gemini CLI / Cursor) when to reach for a narrow
element tool vs fall through to batch_design.
New skill: packages/pen-ai-skills/skills/phases/generation/elements.md
- Decision tree mapping item shape → tool (card_row / metric_row /
nav_chip_row / bottom_nav / activity_ring)
- PREFER vs STILL-USE-batch_design conditions with concrete spec
phrases ("horizontal scrolling cards", "KPI cards", "bottom nav")
- Minimal usage examples for all 5 tools
- Composition pattern: build section via batch_design → insert row
with parent_id → post-hoc style via batch_design U-op
- Invariants enumeration (wrapper / id assignment / role set) so AI
knows what NOT to rebuild
- Failure-mode guidance: if tool throws, inspect message and switch
strategy rather than retry
- Priority 14 / budget 1500 tokens
design-prompt.ts: register 'elements' in SECTION_NAME_MAP,
PromptSection type, SECTION_MAP dispatch.
design-routes.ts: add 'elements' to get_design_prompt.section enum
+ updated description.
_generated/skill-registry.ts regenerates at vite build time (43 → 44
skills; gitignored, not committed).
Tests:
- 10 new unit tests (design-prompt-elements.test.ts) cover
registration, content invariants, decision-tree presence, fallback
teaching, composition pattern, invariants naming, unknown-section
fallback behavior
- d0-parity-spike snapshot updated (get_design_prompt definition
intentionally changed)
MCP live e2e smoke via StdioClientTransport confirms ListTools enum
shows 11 values including 'elements', CallTool returns 4122 char
content, all 5 tools named, all structural assertions pass.
98/98 pen-mcp tests pass. format + tsc green. Bundle rebuilt.