Codex stop-hook #8: elements.md had `trigger: null` which makes resolveSkills('generation', ...) unconditionally load its 1500-token N-tool reference into every generation prompt — including the embedded orchestrator in apps/web/src/services/ai that emits single-shot JSON and CANNOT call MCP tools. The content was dead weight there (orchestrator-sub-agent.ts:333 / ai-prompts.ts:132 both build generation prompt via resolveSkills without any tool-use path). Fix: trigger: { flags: [hasMcpTools] }. Skill only auto-loads when caller explicitly declares MCP tools are available. No existing caller sets this flag, so the embedded orchestrator prompt is now clean again. External MCP clients (Claude Code / Codex / Gemini CLI / Cursor) still get the content via get_design_prompt(section='elements'), which uses getSkillByName direct lookup and bypasses resolveSkills' trigger filter. That contract is preserved. Added explanatory HTML comment in the skill header so future editors understand the gating + opt-in rule. Tests: 4 new cases in design-prompt-elements.test.ts verify: - getSkillByName returns skill regardless of flags (direct lookup) - resolveSkills('generation') WITHOUT flag → elements excluded - resolveSkills('generation') WITH {hasMcpTools:true} → elements included - buildDesignPrompt('elements') works regardless of flag (bypass path) 14/14 design-prompt-elements tests pass; 186/186 across pen-mcp + pen-ai-skills. format + tsc green. Bundle rebuilt. |
||
|---|---|---|
| .. | ||
| agent-native@e1f90cab96 | ||
| pen-acp | ||
| pen-ai-skills | ||
| pen-core | ||
| pen-engine | ||
| pen-figma | ||
| pen-mcp | ||
| pen-react | ||
| pen-renderer | ||
| pen-sdk | ||
| pen-types | ||
| CLAUDE.md | ||