openpencil/packages
Fini 43a6b7b86f 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.
2026-04-19 18:52:00 +08:00
..
agent-native@e1f90cab96 chore(agent): bump agent-native to v0.4.0 release 2026-04-17 19:04:15 +08:00
pen-acp chore(release): bump to v0.7.4 2026-04-17 19:20:19 +08:00
pen-ai-skills feat(ai): add 'elements' section to get_design_prompt + new skill 2026-04-19 18:52:00 +08:00
pen-core chore(release): bump to v0.7.4 2026-04-17 19:20:19 +08:00
pen-engine chore(release): bump to v0.7.4 2026-04-17 19:20:19 +08:00
pen-figma chore(release): bump to v0.7.4 2026-04-17 19:20:19 +08:00
pen-mcp feat(ai): add 'elements' section to get_design_prompt + new skill 2026-04-19 18:52:00 +08:00
pen-react chore(release): bump to v0.7.4 2026-04-17 19:20:19 +08:00
pen-renderer chore(release): bump to v0.7.4 2026-04-17 19:20:19 +08:00
pen-sdk chore(release): bump to v0.7.4 2026-04-17 19:20:19 +08:00
pen-types chore(release): bump to v0.7.4 2026-04-17 19:20:19 +08:00
CLAUDE.md V0.7.0 (#95) 2026-04-11 23:25:13 +08:00