| composition | {"steps":[{"id":"clarify_intent","label":"意图澄清","label_en":"Intent clarification","kind":"llm_chat","with":{"system":"You are the intent gate for meta-skill-creator. Do not inspect\nworkspace files, history, memory, or external sources. Decide only\nfrom the explicit user request and activation context.\n","task":"Clarify whether the user wants a meta-skill, not a normal standalone\nskill. If the request is generic skill creation, return\nROUTE: normal-skill. If it requires orchestrating multiple existing\nskills, return ROUTE: meta-skill. Also summarize desired inputs,\noutputs, trigger phrases, and whether a human preference branch is\nneeded. Set NEEDS_CLARIFICATION: yes only when the workflow goal,\noutput shape, trigger boundary, or human preference branch is\ngenuinely ambiguous and the request is an interactive user request.\nFor unattended auto-propose, dream, or cron activation, set\nNEEDS_CLARIFICATION: no and continue from available context.\n\nUser request:\n{{ inputs.user_message | xml_escape | truncate(1200) }}\n\nOuter system / activation context:\n{{ inputs.system_prompt | default(\"\") | xml_escape | truncate(1200) }}\n\nReturn:\nROUTE: <normal-skill|meta-skill>\nWORKFLOW_GOAL: <goal or unclear>\nOUTPUT_SHAPE: <deliverable or unclear>\nTRIGGERS: <phrases or unclear>\nHUMAN_PREFERENCE_BRANCH: <yes|no|unclear>\nNEEDS_CLARIFICATION: <yes|no>\nMISSING_FIELDS:\n - <workflow_goal|output_shape|trigger_boundary|human_preference_branch|none>\nCLARIFY_REASON: <one concise reason, or none>\n"}},{"id":"creator_clarify","label":"创建澄清","label_en":"Creation clarification","kind":"user_input","depends_on":["clarify_intent"],"when":"'route: meta-skill' in (outputs.clarify_intent | lower) and 'needs_clarification: yes' in (outputs.clarify_intent | lower)","clarify":{"mode":"form","intro":"新 meta-skill 的边界还不够明确。请补齐目标和输出形态,避免生成过宽的触发词。\n","intro_zh":"新 meta-skill 的边界还不够明确。请补齐目标和输出形态,避免生成过宽的触发词。","intro_en":"The new meta-skill boundary is not clear enough. Fill in the goal and output shape so the trigger stays precise.","nl_extract":true,"fields":[{"name":"workflow_goal","type":"string","required":true,"prompt":"工作流目标 / Workflow goal","prompt_zh":"工作流目标","prompt_en":"Workflow goal","max_chars":300},{"name":"output_shape","type":"string","required":true,"prompt":"最终输出形态 / Output shape","prompt_zh":"最终输出形态","prompt_en":"Output shape","max_chars":200},{"name":"trigger_boundary","type":"string","prompt":"触发边界或不要覆盖的场景 / Trigger boundary","prompt_zh":"触发边界或不要覆盖的场景","prompt_en":"Trigger boundary or cases to avoid","max_chars":300},{"name":"human_preference_branch","type":"bool","default":false,"prompt":"是否需要运行中让用户选择偏好 / Need human preference branch?","prompt_zh":"是否需要运行中让用户选择偏好","prompt_en":"Need a human preference branch during the run?"}],"cancel_keywords":["算了","取消","cancel","stop","abort"],"timeout_hours":24}},{"id":"normal_skill_exit","label":"普通技能退出","label_en":"Regular skill exit","kind":"tool_call","depends_on":["clarify_intent"],"when":"'route: normal-skill' in (outputs.clarify_intent | lower)","tool":"emit_text","tool_args":{"text":"This request was classified as a normal standalone skill request, not\na meta-skill composition request. The meta-skill creator stopped\nbefore proposal assembly or persistence.\n"}},{"id":"creator_mode","label":"创建模式","label_en":"Creation mode","kind":"llm_classify","depends_on":["clarify_intent","creator_clarify"],"when":"'route: meta-skill' in (outputs.clarify_intent | lower)","output_choices":["PREVIEW_ONLY","PERSISTED_PROPOSAL","FULL_GATED"],"with":{"text":"Classify how far the creator workflow should go.\n\nUser request:\n{{ inputs.user_message | xml_escape | truncate(1200) }}\n\nOuter system / activation context:\n{{ inputs.system_prompt | default(\"\") | xml_escape | truncate(1200) }}\n\nClarified intent:\n{{ outputs.clarify_intent | truncate(1200) }}\n\nClarification answers (may be empty when not needed):\n{{ inputs.get('collected', {}).get('creator_clarify', {}) | tojson }}\n\nDecision rules:\n- PREVIEW_ONLY: user asks for an example, template, plan, draft,\n or wants to inspect before writing/persisting anything.\n- PERSISTED_PROPOSAL: user asks to create/save/write/propose a\n meta-skill but does not ask for exhaustive smoke testing.\n- FULL_GATED: user asks for a production-ready, accepted, tested,\n validated, or fully gated meta-skill.\n- FULL_GATED: unattended auto-propose, dream, or cron activation\n requires preserving all creator gates before any auto-enable\n decision.\n"}},{"id":"harvest","label":"需求采集","label_en":"Requirement capture","kind":"skill_exec","skill":"history-explorer","depends_on":["clarify_intent","creator_clarify"],"when":"'route: meta-skill' in (outputs.clarify_intent | lower) and 'Unattended meta-skill auto-propose run' in inputs.get('system_prompt', '')","on_failure":"harvest_empty","with":{"query":"Co-occurring skill chains and meta-skill usage for: {{ outputs.clarify_intent | truncate(1000) }}\nClarification answers:\n{{ inputs.get('collected', {}).get('creator_clarify', {}) | tojson }}\n","window_days":30,"include":["co_occurrences","meta_usage","router_fixtures"]}},{"id":"harvest_empty","label":"空采集兜底","label_en":"Empty-capture fallback","kind":"tool_call","tool":"emit_text","tool_args":{"text":"no history available; downstream should rely on user intent only"}},{"id":"pick_pattern","label":"模式选择","label_en":"Mode selection","kind":"llm_classify","depends_on":["creator_mode","harvest"],"when":"'route: meta-skill' in (outputs.clarify_intent | lower)","output_choices":["p1_sequential","p2_fan_out_merge","p3_condition_gated"],"with":{"history_summary":"{{ outputs.harvest | truncate(2000) }}","user_intent":"Raw user request:\n{{ inputs.user_message | xml_escape | truncate(1200) }}\n\nClarified intent:\n{{ outputs.clarify_intent | truncate(1000) }}\n"}},{"id":"fill_slots","label":"填充槽位","label_en":"Fill slots","kind":"tool_call","depends_on":["pick_pattern"],"when":"'route: meta-skill' in (outputs.clarify_intent | lower)","tool":"meta_skill_fill_slots","tool_args":{"pattern_id":"{{ outputs.pick_pattern }}","history_summary":"{{ outputs.harvest | truncate(2000) }}","user_intent":"Raw user request:\n{{ inputs.user_message | xml_escape | truncate(1200) }}\n\nClarified intent:\n{{ outputs.clarify_intent | truncate(1000) }}\n"}},{"id":"assemble","label":"组装","label_en":"Assembly","kind":"tool_call","depends_on":["fill_slots"],"when":"'route: meta-skill' in (outputs.clarify_intent | lower)","tool":"meta_skill_assemble","tool_args":{"pattern_id":"{{ outputs.pick_pattern }}","slots_json":"{{ outputs.fill_slots }}"}},{"id":"collision_check","label":"冲突检查","label_en":"Conflict check","kind":"llm_chat","depends_on":["assemble"],"when":"'route: meta-skill' in (outputs.clarify_intent | lower)","with":{"system":"You are a trigger-collision reviewer for meta-skill-creator. Use only\nthe candidate SKILL.md provided in the task and the bundled creator\nboundaries named there. Do not call tools or inspect the workspace.\n","task":"Review this generated meta-skill proposal for trigger collisions with\nexisting bundled skills. Flag generic triggers, overlaps with\nmeta-skill-creator, and broad phrases that would steal unrelated user\nintent. Return PASS or REVISE_NEEDED plus reasons.\n\nCandidate SKILL.md:\n{{ outputs.assemble | truncate(8000) }}\n"}},{"id":"lint","label":"Lint 检查","label_en":"Lint check","kind":"tool_call","depends_on":["collision_check"],"when":"'route: meta-skill' in (outputs.clarify_intent | lower)","tool":"meta_skill_lint_run","tool_args":{"skill_md":"{{ outputs.assemble }}","gates":"G1,G2"}},{"id":"risk_classify","label":"风险分类","label_en":"Risk classification","kind":"llm_chat","depends_on":["lint"],"when":"'route: meta-skill' in (outputs.clarify_intent | lower)","with":{"system":"You are an operational-risk classifier for generated meta-skills. Use\nonly the candidate SKILL.md and lint result in the task. Do not call\ntools or inspect the workspace.\n","task":"Classify operational risk for the generated meta-skill. Consider file\nwrites, network access, GitHub/gh actions, shell commands, memory\nwrites, and destructive operations. Return:\nRISK: low|medium|high\nCAPABILITIES:\n - <capability>\nREQUIRED_GATES:\n - <gate>\n\nCandidate SKILL.md:\n{{ outputs.assemble | truncate(8000) }}\n\nLint result:\n{{ outputs.lint | truncate(2000) }}\n"}},{"id":"single_model_baseline","label":"单模基线","label_en":"Single-mode baseline","kind":"llm_chat","depends_on":["creator_mode"],"when":"'route: meta-skill' in (outputs.clarify_intent | lower) and outputs.creator_mode == 'FULL_GATED'","with":{"system":"You are the highest-tier baseline model for meta-skill authoring.\nSolve the same task directly in one pass under the same outer\nassistant system prompt and user request, but without history\nmining, intent clarification output, deterministic slot filling,\nlint tools, smoke tools, persistence, or sub-skill orchestration.\nProduce the strongest standalone SKILL.md candidate you can from\nthat full prompt context.\n","task":"Same task as the orchestrated meta-skill creator workflow, but solve\nit as a standalone highest-tier model response. Use the outer system\nprompt and raw user request below; do not rely on any meta-skill\nintermediate output.\n\nOuter system prompt:\n{{ inputs.system_prompt | xml_escape | truncate(12000) }}\n\nUser request:\n{{ inputs.user_message | xml_escape | truncate(1600) }}\n\nReturn:\n- proposed meta-skill name\n- triggers\n- inputs\n- step graph\n- gates\n- collision risks\n- SKILL.md preview\n\nBoundary rule:\nCreator validation, proposal persistence, auto-enable decisions,\nand gate execution are handled by the outer meta-skill-creator\nworkflow. Do not require the generated candidate SKILL.md itself to\ncontain steps for saving proposals, running creator gates, comparing\nagainst baselines, or deciding auto-enable. The candidate SKILL.md\nshould describe only the reusable business workflow that will run\nlater when the new meta-skill is invoked.\n"}},{"id":"acceptance_compare","label":"验收对比","label_en":"Acceptance comparison","kind":"llm_chat","depends_on":["assemble","single_model_baseline"],"when":"'route: meta-skill' in (outputs.clarify_intent | lower) and outputs.creator_mode == 'FULL_GATED'","with":{"system":"You are an acceptance reviewer. Compare an orchestrated candidate\nagainst a single-model baseline that used the highest-tier model on\nthe same task. Reward verifiable skill composition, trigger safety,\ngates, operational risk handling, and reusable SKILL.md quality.\nKeep the boundary strict: proposal persistence, gate execution,\nruntime E2E, acceptance comparison, and auto-enable decisions belong\nto the outer meta-skill-creator workflow. Do not penalize a candidate\nSKILL.md for omitting creator-workflow steps that should not run when\nthe generated meta-skill is invoked later.\n","task":"User request:\n{{ inputs.user_message | xml_escape | truncate(1200) }}\n\nOrchestrated candidate:\n{{ outputs.assemble | truncate(7000) }}\n\nSingle-model baseline:\n{{ outputs.single_model_baseline | truncate(7000) }}\n\nReturn this exact structure:\nWINNER: orchestrated|single-model|tie\nQUALITY_SCORE: <0.00-1.00 weighted final product quality score>\nREASONS:\n- <specific evidence>\nREGRESSIONS:\n- <what the orchestrated candidate lacks versus the baseline>\nREQUIRED_IMPROVEMENTS:\n- <blocking edit required before acceptance, or \"none\">\n\nTreat REQUIRED_IMPROVEMENTS as a hard acceptance gate. Do not list\noptional nice-to-have enhancements there. If the orchestrated\ncandidate is production-acceptable and any baseline advantages are\nnon-blocking, put those advantages under REGRESSIONS and set\nREQUIRED_IMPROVEMENTS to \"none\".\nScore final product quality with high weight: 40% usefulness and\ncompleteness of the generated SKILL.md, 25% trigger/input/output\nspecificity, 20% gate/risk/collision coverage, and 15% reusable\nworkflow generality. Scores below 0.80 are not acceptable for\nFULL_GATED persistence even when WINNER is orchestrated.\nNever make proposal persistence, auto-enable state, acceptance\ncomparison, or runtime E2E execution a REQUIRED_IMPROVEMENT for the\ncandidate SKILL.md; those are already performed by this outer creator\nworkflow and are evaluated from the creator's gate outputs.\n"}},{"id":"smoke","label":"冒烟测试","label_en":"Smoke test","kind":"tool_call","depends_on":["risk_classify"],"when":"'route: meta-skill' in (outputs.clarify_intent | lower) and outputs.creator_mode != 'PREVIEW_ONLY'","tool":"meta_skill_smoke_run","tool_args":{"skill_md":"{{ outputs.assemble }}","fixture_gen_model":"openai/gpt-4o-mini","classifier_model":"openrouter/auto"}},{"id":"runtime_e2e","label":"运行时 E2E","label_en":"Runtime E2E","kind":"tool_call","depends_on":["assemble","smoke"],"when":"'route: meta-skill' in (outputs.clarify_intent | lower) and outputs.creator_mode == 'FULL_GATED'","tool":"meta_skill_runtime_e2e_run","tool_args":{"skill_md":"{{ outputs.assemble }}","eval_prompts":""}},{"id":"preview","label":"预览","label_en":"Preview","kind":"llm_chat","depends_on":["smoke","acceptance_compare","runtime_e2e"],"when":"'route: meta-skill' in (outputs.clarify_intent | lower)","with":{"system":"You are the final preview writer for meta-skill-creator. Produce only\na concise operator-facing proposal preview from the supplied step\noutputs. Do not call tools, inspect files, or invent persistence IDs.\n","task":"Produce a concise proposal preview for the user/operator before\npersistence. Include proposed name, triggers, DAG summary, collision\nresult, risk classification, lint status, smoke status, baseline\ncomparison status, and whether it appears eligible for acceptance.\nDo not invent paths or proposal IDs.\n\nCandidate SKILL.md:\n{{ outputs.assemble | truncate(8000) }}\n\nCollision check:\n{{ outputs.collision_check | truncate(1200) }}\n\nRisk:\n{{ outputs.risk_classify | truncate(1200) }}\n\nCreator mode:\n{{ outputs.creator_mode }}\n\nLint:\n{{ outputs.lint | truncate(2000) }}\n\nSmoke:\n{{ outputs.smoke | truncate(2000) }}\n\nBaseline comparison:\n{{ outputs.acceptance_compare | truncate(2000) }}\n\nRuntime E2E:\n{{ outputs.runtime_e2e | truncate(2000) }}\n"}},{"id":"persist","label":"保存","label_en":"Save","kind":"tool_call","depends_on":["preview"],"when":"'route: meta-skill' in (outputs.clarify_intent | lower) and outputs.creator_mode != 'PREVIEW_ONLY'","tool":"meta_skill_persist_proposal","tool_args":{"skill_md":"{{ outputs.assemble }}","lint_result":"{{ outputs.lint }}","smoke_result":"{{ outputs.smoke }}","creator_mode":"{{ outputs.creator_mode }}","acceptance_result":"{{ outputs.acceptance_compare }}","runtime_e2e_result":"{{ outputs.runtime_e2e }}","collision_result":"{{ outputs.collision_check }}","risk_result":"{{ outputs.risk_classify }}"}},{"id":"final_response","label":"最终回复","label_en":"Final response","kind":"tool_call","depends_on":["preview","normal_skill_exit"],"tool":"emit_text","tool_args":{"text":"{% if outputs.normal_skill_exit %}\n{{ outputs.normal_skill_exit }}\n{% else %}\n{{ outputs.preview }}\n{% endif %}\n"}}]} |