1---
2name: meta-skill-creator
3visibility: meta
4invocation: meta_only
5description: "Create or propose a new meta-skill that explicitly orchestrates multiple existing Skills, with trigger-collision, lint, smoke, and preview gates. Do not use for a standalone Skill, conceptual questions, pasted catalogs, or discussion of existing MetaSkills."
6description_zh: "仅当用户明确要求创建、组合、合成或提出一个编排多个现有技能的新元技能时,使用此元技能而非直接回答。它通过多技能编排完成意图澄清、可选的历史挖掘、触发词冲突检查、linting、冒烟/运行时闸门、预览和可选的提案持久化。不用于创建普通独立技能、询问元技能原理、分析粘贴的技能列表或讨论现有元技能。"
7kind: meta
8meta_priority: 90
9always: false
10final_text_mode: "step:final_response"
11request_template:
12 outcome: "Proposed meta-skill spec or saved proposal with trigger, DAG, tests, and validation notes."
13 outcome_zh: "生成 meta-skill 提案或保存方案,包含触发词、DAG、测试和验证记录。"
14 outcome_en: "Proposed meta-skill spec or saved proposal with trigger, DAG, tests, and validation notes."
15 fields:
16 - name: meta_skill_goal
17 label_zh: "Meta-skill 目标"
18 label_en: "Meta-skill goal"
19 required: true
20 - name: existing_skills_to_orchestrate
21 label_zh: "要编排的现有技能"
22 label_en: "Existing skills to orchestrate"
23 required: false
24 - name: save_or_preview
25 label_zh: "保存或预览"
26 label_en: "Save or preview"
27 required: false
28 default: "preview unless the user asks to persist"
29 default_zh: "默认预览;仅在用户要求持久化时保存"
30 default_en: "preview unless the user asks to persist"
31 - name: constraints
32 label_zh: "限制条件"
33 label_en: "Constraints"
34 required: false
35 - name: audience
36 label_zh: "受众"
37 label_en: "Audience"
38 required: false
39 default: "meta-skill author"
40 default_zh: "meta-skill 作者"
41 default_en: "meta-skill author"
42 - name: language
43 label_zh: "输出语言"
44 label_en: "Output language"
45 required: false
46 default: "match the user's language"
47 default_zh: "跟随用户语言"
48 default_en: "match the user's language"
49 assumptions:
50 - "Create a meta-skill only when orchestration is explicitly requested."
51 - "Check trigger collisions and lint before presenting a proposal."
52 assumptions_zh:
53 - "仅在用户明确要求编排时创建 meta-skill。"
54 - "展示提案前检查触发词冲突并运行 lint。"
55 assumptions_en:
56 - "Create a meta-skill only when orchestration is explicitly requested."
57 - "Check trigger collisions and lint before presenting a proposal."
58output_contract:
59 append_to_final_text: false
60 required_sections:
61 - "Intent summary"
62 - "Proposed DAG"
63 - "Trigger and collision notes"
64 - "Validation results"
65 - "Save or next-step status"
66 assumptions:
67 - "Preview mode is used unless persistence is explicit."
68 unverified:
69 - "Live runtime smoke results when execution gates are unavailable."
70 artifacts:
71 - name: "meta_skill_proposal"
72 required: false
73eval_prompts:
74 - name: "meta-skill-creator-baseline"
75 prompt: "Draft a meta-skill that orchestrates search, synthesis, validation, and proposal persistence."
76 rubric:
77 - "Intent summary"
78 - "Proposed DAG"
79 - "Trigger and collision notes"
80 - "Validation results"
81 - "Save or next-step status"
82preference_keys:
83 - preferred_language
84 - meta_authoring_style
85policy_tags:
86 - trigger-collision-check
87 - lint-before-enable
88triggers:
89 - "新增 meta 技能"
90 - "组合现有 skill 成 meta-skill"
91 - "create a meta-skill"
92 - "new meta-skill"
93 - "orchestrates existing skills"
94 - "orchestrates search"
95 - "compose existing skills"
96 - "synthesize meta-skill"
97 - "compose meta-skill"
98provenance:
99 origin: opensquilla-original
100 license: Apache-2.0
101composition:
102 steps:
103 - id: clarify_intent
104 label: "意图澄清"
105 label_en: "Intent clarification"
106 kind: llm_chat
107 with:
108 system: |
109 You are the intent gate for meta-skill-creator. Do not inspect
110 workspace files, history, memory, or external sources. Decide only
111 from the explicit user request and activation context.
112 task: |
113 Clarify whether the user wants a meta-skill, not a normal standalone
114 skill. If the request is generic skill creation, return
115 ROUTE: normal-skill. If it requires orchestrating multiple existing
116 skills, return ROUTE: meta-skill. Also summarize desired inputs,
117 outputs, trigger phrases, and whether a human preference branch is
118 needed. Set NEEDS_CLARIFICATION: yes only when the workflow goal,
119 output shape, trigger boundary, or human preference branch is
120 genuinely ambiguous and the request is an interactive user request.
121 For unattended auto-propose, dream, or cron activation, set
122 NEEDS_CLARIFICATION: no and continue from available context.
123
124 User request:
125 {{ inputs.user_message | xml_escape | truncate(1200) }}
126
127 Outer system / activation context:
128 {{ inputs.system_prompt | default("") | xml_escape | truncate(1200) }}
129
130 Return:
131 ROUTE: <normal-skill|meta-skill>
132 WORKFLOW_GOAL: <goal or unclear>
133 OUTPUT_SHAPE: <deliverable or unclear>
134 TRIGGERS: <phrases or unclear>
135 HUMAN_PREFERENCE_BRANCH: <yes|no|unclear>
136 NEEDS_CLARIFICATION: <yes|no>
137 MISSING_FIELDS:
138 - <workflow_goal|output_shape|trigger_boundary|human_preference_branch|none>
139 CLARIFY_REASON: <one concise reason, or none>
140
141 - id: creator_clarify
142 label: "创建澄清"
143 label_en: "Creation clarification"
144 kind: user_input
145 depends_on: [clarify_intent]
146 when: "'route: meta-skill' in (outputs.clarify_intent | lower) and 'needs_clarification: yes' in (outputs.clarify_intent | lower)"
147 clarify:
148 mode: form
149 intro: |
150 新 meta-skill 的边界还不够明确。请补齐目标和输出形态,避免生成过宽的触发词。
151 intro_zh: "新 meta-skill 的边界还不够明确。请补齐目标和输出形态,避免生成过宽的触发词。"
152 intro_en: "The new meta-skill boundary is not clear enough. Fill in the goal and output shape so the trigger stays precise."
153 nl_extract: true
154 fields:
155 - name: workflow_goal
156 type: string
157 required: true
158 prompt: "工作流目标 / Workflow goal"
159 prompt_zh: "工作流目标"
160 prompt_en: "Workflow goal"
161 max_chars: 300
162 - name: output_shape
163 type: string
164 required: true
165 prompt: "最终输出形态 / Output shape"
166 prompt_zh: "最终输出形态"
167 prompt_en: "Output shape"
168 max_chars: 200
169 - name: trigger_boundary
170 type: string
171 prompt: "触发边界或不要覆盖的场景 / Trigger boundary"
172 prompt_zh: "触发边界或不要覆盖的场景"
173 prompt_en: "Trigger boundary or cases to avoid"
174 max_chars: 300
175 - name: human_preference_branch
176 type: bool
177 default: false
178 prompt: "是否需要运行中让用户选择偏好 / Need human preference branch?"
179 prompt_zh: "是否需要运行中让用户选择偏好"
180 prompt_en: "Need a human preference branch during the run?"
181 cancel_keywords: ["算了", "取消", "cancel", "stop", "abort"]
182 timeout_hours: 24
183
184 - id: normal_skill_exit
185 label: "普通技能退出"
186 label_en: "Regular skill exit"
187 kind: tool_call
188 depends_on: [clarify_intent]
189 when: "'route: normal-skill' in (outputs.clarify_intent | lower)"
190 tool: emit_text
191 tool_args:
192 text: |
193 This request was classified as a normal standalone skill request, not
194 a meta-skill composition request. The meta-skill creator stopped
195 before proposal assembly or persistence.
196
197 - id: creator_mode
198 label: "创建模式"
199 label_en: "Creation mode"
200 kind: llm_classify
201 depends_on: [clarify_intent, creator_clarify]
202 when: "'route: meta-skill' in (outputs.clarify_intent | lower)"
203 output_choices:
204 - PREVIEW_ONLY
205 - PERSISTED_PROPOSAL
206 - FULL_GATED
207 with:
208 text: |
209 Classify how far the creator workflow should go.
210
211 User request:
212 {{ inputs.user_message | xml_escape | truncate(1200) }}
213
214 Outer system / activation context:
215 {{ inputs.system_prompt | default("") | xml_escape | truncate(1200) }}
216
217 Clarified intent:
218 {{ outputs.clarify_intent | truncate(1200) }}
219
220 Clarification answers (may be empty when not needed):
221 {{ inputs.get('collected', {}).get('creator_clarify', {}) | tojson }}
222
223 Decision rules:
224 - PREVIEW_ONLY: user asks for an example, template, plan, draft,
225 or wants to inspect before writing/persisting anything.
226 - PERSISTED_PROPOSAL: user asks to create/save/write/propose a
227 meta-skill but does not ask for exhaustive smoke testing.
228 - FULL_GATED: user asks for a production-ready, accepted, tested,
229 validated, or fully gated meta-skill.
230 - FULL_GATED: unattended auto-propose, dream, or cron activation
231 requires preserving all creator gates before any auto-enable
232 decision.
233
234 - id: harvest
235 label: "需求采集"
236 label_en: "Requirement capture"
237 kind: skill_exec
238 skill: history-explorer
239 depends_on: [clarify_intent, creator_clarify]
240 when: "'route: meta-skill' in (outputs.clarify_intent | lower) and 'Unattended meta-skill auto-propose run' in inputs.get('system_prompt', '')"
241 on_failure: harvest_empty
242 with:
243 query: |
244 Co-occurring skill chains and meta-skill usage for: {{ outputs.clarify_intent | truncate(1000) }}
245 Clarification answers:
246 {{ inputs.get('collected', {}).get('creator_clarify', {}) | tojson }}
247 window_days: 30
248 include: [co_occurrences, meta_usage, router_fixtures]
249
250 - id: harvest_empty
251 label: "空采集兜底"
252 label_en: "Empty-capture fallback"
253 kind: tool_call
254 tool: emit_text
255 tool_args:
256 text: "no history available; downstream should rely on user intent only"
257
258 - id: pick_pattern
259 label: "模式选择"
260 label_en: "Mode selection"
261 kind: llm_classify
262 depends_on: [creator_mode, harvest]
263 when: "'route: meta-skill' in (outputs.clarify_intent | lower)"
264 output_choices: [p1_sequential, p2_fan_out_merge, p3_condition_gated]
265 with:
266 history_summary: "{{ outputs.harvest | truncate(2000) }}"
267 user_intent: |
268 Raw user request:
269 {{ inputs.user_message | xml_escape | truncate(1200) }}
270
271 Clarified intent:
272 {{ outputs.clarify_intent | truncate(1000) }}
273
274 - id: fill_slots
275 label: "填充槽位"
276 label_en: "Fill slots"
277 kind: tool_call
278 depends_on: [pick_pattern]
279 when: "'route: meta-skill' in (outputs.clarify_intent | lower)"
280 tool: meta_skill_fill_slots
281 tool_args:
282 pattern_id: "{{ outputs.pick_pattern }}"
283 history_summary: "{{ outputs.harvest | truncate(2000) }}"
284 user_intent: |
285 Raw user request:
286 {{ inputs.user_message | xml_escape | truncate(1200) }}
287
288 Clarified intent:
289 {{ outputs.clarify_intent | truncate(1000) }}
290
291 - id: assemble
292 label: "组装"
293 label_en: "Assembly"
294 kind: tool_call
295 depends_on: [fill_slots]
296 when: "'route: meta-skill' in (outputs.clarify_intent | lower)"
297 tool: meta_skill_assemble
298 tool_args:
299 pattern_id: "{{ outputs.pick_pattern }}"
300 slots_json: "{{ outputs.fill_slots }}"
301
302 - id: collision_check
303 label: "冲突检查"
304 label_en: "Conflict check"
305 kind: llm_chat
306 depends_on: [assemble]
307 when: "'route: meta-skill' in (outputs.clarify_intent | lower)"
308 with:
309 system: |
310 You are a trigger-collision reviewer for meta-skill-creator. Use only
311 the candidate SKILL.md provided in the task and the bundled creator
312 boundaries named there. Do not call tools or inspect the workspace.
313 task: |
314 Review this generated meta-skill proposal for trigger collisions with
315 existing bundled skills. Flag generic triggers, overlaps with
316 meta-skill-creator, and broad phrases that would steal unrelated user
317 intent. Return PASS or REVISE_NEEDED plus reasons.
318
319 Candidate SKILL.md:
320 {{ outputs.assemble | truncate(8000) }}
321
322 - id: lint
323 label: "Lint 检查"
324 label_en: "Lint check"
325 kind: tool_call
326 depends_on: [collision_check]
327 when: "'route: meta-skill' in (outputs.clarify_intent | lower)"
328 tool: meta_skill_lint_run
329 tool_args:
330 skill_md: "{{ outputs.assemble }}"
331 gates: "G1,G2"
332
333 - id: risk_classify
334 label: "风险分类"
335 label_en: "Risk classification"
336 kind: llm_chat
337 depends_on: [lint]
338 when: "'route: meta-skill' in (outputs.clarify_intent | lower)"
339 with:
340 system: |
341 You are an operational-risk classifier for generated meta-skills. Use
342 only the candidate SKILL.md and lint result in the task. Do not call
343 tools or inspect the workspace.
344 task: |
345 Classify operational risk for the generated meta-skill. Consider file
346 writes, network access, GitHub/gh actions, shell commands, memory
347 writes, and destructive operations. Return:
348 RISK: low|medium|high
349 CAPABILITIES:
350 - <capability>
351 REQUIRED_GATES:
352 - <gate>
353
354 Candidate SKILL.md:
355 {{ outputs.assemble | truncate(8000) }}
356
357 Lint result:
358 {{ outputs.lint | truncate(2000) }}
359
360 - id: single_model_baseline
361 label: "单模基线"
362 label_en: "Single-mode baseline"
363 kind: llm_chat
364 depends_on: [creator_mode]
365 when: "'route: meta-skill' in (outputs.clarify_intent | lower) and outputs.creator_mode == 'FULL_GATED'"
366 with:
367 system: |
368 You are the highest-tier baseline model for meta-skill authoring.
369 Solve the same task directly in one pass under the same outer
370 assistant system prompt and user request, but without history
371 mining, intent clarification output, deterministic slot filling,
372 lint tools, smoke tools, persistence, or sub-skill orchestration.
373 Produce the strongest standalone SKILL.md candidate you can from
374 that full prompt context.
375 task: |
376 Same task as the orchestrated meta-skill creator workflow, but solve
377 it as a standalone highest-tier model response. Use the outer system
378 prompt and raw user request below; do not rely on any meta-skill
379 intermediate output.
380
381 Outer system prompt:
382 {{ inputs.system_prompt | xml_escape | truncate(12000) }}
383
384 User request:
385 {{ inputs.user_message | xml_escape | truncate(1600) }}
386
387 Return:
388 - proposed meta-skill name
389 - triggers
390 - inputs
391 - step graph
392 - gates
393 - collision risks
394 - SKILL.md preview
395
396 Boundary rule:
397 Creator validation, proposal persistence, auto-enable decisions,
398 and gate execution are handled by the outer meta-skill-creator
399 workflow. Do not require the generated candidate SKILL.md itself to
400 contain steps for saving proposals, running creator gates, comparing
401 against baselines, or deciding auto-enable. The candidate SKILL.md
402 should describe only the reusable business workflow that will run
403 later when the new meta-skill is invoked.
404
405 - id: acceptance_compare
406 label: "验收对比"
407 label_en: "Acceptance comparison"
408 kind: llm_chat
409 depends_on: [assemble, single_model_baseline]
410 when: "'route: meta-skill' in (outputs.clarify_intent | lower) and outputs.creator_mode == 'FULL_GATED'"
411 with:
412 system: |
413 You are an acceptance reviewer. Compare an orchestrated candidate
414 against a single-model baseline that used the highest-tier model on
415 the same task. Reward verifiable skill composition, trigger safety,
416 gates, operational risk handling, and reusable SKILL.md quality.
417 Keep the boundary strict: proposal persistence, gate execution,
418 runtime E2E, acceptance comparison, and auto-enable decisions belong
419 to the outer meta-skill-creator workflow. Do not penalize a candidate
420 SKILL.md for omitting creator-workflow steps that should not run when
421 the generated meta-skill is invoked later.
422 task: |
423 User request:
424 {{ inputs.user_message | xml_escape | truncate(1200) }}
425
426 Orchestrated candidate:
427 {{ outputs.assemble | truncate(7000) }}
428
429 Single-model baseline:
430 {{ outputs.single_model_baseline | truncate(7000) }}
431
432 Return this exact structure:
433 WINNER: orchestrated|single-model|tie
434 QUALITY_SCORE: <0.00-1.00 weighted final product quality score>
435 REASONS:
436 - <specific evidence>
437 REGRESSIONS:
438 - <what the orchestrated candidate lacks versus the baseline>
439 REQUIRED_IMPROVEMENTS:
440 - <blocking edit required before acceptance, or "none">
441
442 Treat REQUIRED_IMPROVEMENTS as a hard acceptance gate. Do not list
443 optional nice-to-have enhancements there. If the orchestrated
444 candidate is production-acceptable and any baseline advantages are
445 non-blocking, put those advantages under REGRESSIONS and set
446 REQUIRED_IMPROVEMENTS to "none".
447 Score final product quality with high weight: 40% usefulness and
448 completeness of the generated SKILL.md, 25% trigger/input/output
449 specificity, 20% gate/risk/collision coverage, and 15% reusable
450 workflow generality. Scores below 0.80 are not acceptable for
451 FULL_GATED persistence even when WINNER is orchestrated.
452 Never make proposal persistence, auto-enable state, acceptance
453 comparison, or runtime E2E execution a REQUIRED_IMPROVEMENT for the
454 candidate SKILL.md; those are already performed by this outer creator
455 workflow and are evaluated from the creator's gate outputs.
456
457 - id: smoke
458 label: "冒烟测试"
459 label_en: "Smoke test"
460 kind: tool_call
461 depends_on: [risk_classify]
462 when: "'route: meta-skill' in (outputs.clarify_intent | lower) and outputs.creator_mode != 'PREVIEW_ONLY'"
463 tool: meta_skill_smoke_run
464 tool_args:
465 skill_md: "{{ outputs.assemble }}"
466 fixture_gen_model: openai/gpt-4o-mini
467 classifier_model: openrouter/auto
468
469 - id: runtime_e2e
470 label: "运行时 E2E"
471 label_en: "Runtime E2E"
472 kind: tool_call
473 depends_on: [assemble, smoke]
474 when: "'route: meta-skill' in (outputs.clarify_intent | lower) and outputs.creator_mode == 'FULL_GATED'"
475 tool: meta_skill_runtime_e2e_run
476 tool_args:
477 skill_md: "{{ outputs.assemble }}"
478 # Leave eval_prompts empty so the runtime gate derives an operational
479 # positive prompt from the candidate skill's own trigger. The outer
480 # creator request asks for a meta-skill proposal; using it here would
481 # incorrectly compare a candidate workflow run against proposal prose.
482 eval_prompts: ""
483
484 - id: preview
485 label: "预览"
486 label_en: "Preview"
487 kind: llm_chat
488 depends_on: [smoke, acceptance_compare, runtime_e2e]
489 when: "'route: meta-skill' in (outputs.clarify_intent | lower)"
490 with:
491 system: |
492 You are the final preview writer for meta-skill-creator. Produce only
493 a concise operator-facing proposal preview from the supplied step
494 outputs. Do not call tools, inspect files, or invent persistence IDs.
495 task: |
496 Produce a concise proposal preview for the user/operator before
497 persistence. Include proposed name, triggers, DAG summary, collision
498 result, risk classification, lint status, smoke status, baseline
499 comparison status, and whether it appears eligible for acceptance.
500 Do not invent paths or proposal IDs.
501
502 Candidate SKILL.md:
503 {{ outputs.assemble | truncate(8000) }}
504
505 Collision check:
506 {{ outputs.collision_check | truncate(1200) }}
507
508 Risk:
509 {{ outputs.risk_classify | truncate(1200) }}
510
511 Creator mode:
512 {{ outputs.creator_mode }}
513
514 Lint:
515 {{ outputs.lint | truncate(2000) }}
516
517 Smoke:
518 {{ outputs.smoke | truncate(2000) }}
519
520 Baseline comparison:
521 {{ outputs.acceptance_compare | truncate(2000) }}
522
523 Runtime E2E:
524 {{ outputs.runtime_e2e | truncate(2000) }}
525
526 - id: persist
527 label: "保存"
528 label_en: "Save"
529 kind: tool_call
530 depends_on: [preview]
531 when: "'route: meta-skill' in (outputs.clarify_intent | lower) and outputs.creator_mode != 'PREVIEW_ONLY'"
532 tool: meta_skill_persist_proposal
533 tool_args:
534 skill_md: "{{ outputs.assemble }}"
535 lint_result: "{{ outputs.lint }}"
536 smoke_result: "{{ outputs.smoke }}"
537 creator_mode: "{{ outputs.creator_mode }}"
538 acceptance_result: "{{ outputs.acceptance_compare }}"
539 runtime_e2e_result: "{{ outputs.runtime_e2e }}"
540 collision_result: "{{ outputs.collision_check }}"
541 risk_result: "{{ outputs.risk_classify }}"
542
543 - id: final_response
544 label: "最终回复"
545 label_en: "Final response"
546 kind: tool_call
547 depends_on: [preview, normal_skill_exit]
548 tool: emit_text
549 tool_args:
550 text: |
551 {% if outputs.normal_skill_exit %}
552 {{ outputs.normal_skill_exit }}
553 {% else %}
554 {{ outputs.preview }}
555 {% endif %}
556---
557
558# Meta-Skill Creator
559
560Safeguarded DAG that synthesizes a new bundled meta-skill from observed skill
561co-occurrence patterns + user description of the desired workflow. It now
562separates preview-only, persisted-proposal, and fully gated modes so lightweight
563requests do not pay for persistence or smoke testing. The workflow separates
564generic skill creation from meta-skill composition, checks trigger collisions,
565classifies operational risk, and previews the proposal before optional
566persistence.
567
568Output is a SKILL.md candidate written to `~/.opensquilla/proposals/<id>/`.
569By default it is not auto-loaded; run `opensquilla meta accept <id>` (Phase 2)
570to enable. If the operator has enabled the auto-propose `auto_enable` setting,
571this manual path also runs the same conservative static safety preflight used by
572cron/dream auto-propose and may promote a low-risk gated proposal immediately.
573
574## Fallback
575
576If creator's pipeline fails at any step, **report the failure verbatim** to the
577user:
578
5791. State which step failed (e.g. "harvest", "lint")
5802. Quote the error message from the orchestrator's structured log
5813. Stop. Do NOT improvise.
582
583Do NOT:
584- Claim a proposal was written unless you have verified it by reading
585 `~/.opensquilla/proposals/<id>/SKILL.md` with the `read_file` tool
586- Invent file paths, proposal IDs, or skill names that you have not seen
587 in the orchestrator's actual output
588- "Manually run" the individual skills as a recovery — that bypasses
589 the validation gates the user explicitly opted into
590
591If the user wants to retry, suggest they re-issue the request after the
592underlying error is resolved (often a sandbox or provider issue), not a
593manual workaround.