一键导入
learn
Extract a repeatable workflow from the current session into a skill draft, then run the evolution pipeline (reflect → explore → evaluate) to optimize it
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Extract a repeatable workflow from the current session into a skill draft, then run the evolution pipeline (reflect → explore → evaluate) to optimize it
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | learn |
| description | Extract a repeatable workflow from the current session into a skill draft, then run the evolution pipeline (reflect → explore → evaluate) to optimize it |
This skill fuses two capabilities:
Use this skill when the current session uncovered a repeatable workflow that should become a reusable, optimized OMS skill.
Before extracting a skill, verify ALL THREE are true. If any is false, stop and tell the user this belongs in documentation, not a skill.
Prefer skills that encode decision-making heuristics, constraints, pitfalls, and verification steps. Avoid generic snippets, boilerplate, or library usage examples.
Extract the repeatable task the session accomplished:
~/.snow/skills/oms/<name>/SKILL.md^[a-zA-Z0-9_-]+$.Call the oms-learn MCP tool with the extracted workflow:
oms-learn({
summary: "<one-line description of what the skill does>",
patterns: "<JSON array of pattern objects>",
skillName: "<validated-skill-name>",
maxIterations: 2
})
patterns format — derive from the extracted workflow's ordered steps + pitfalls:
[
{
"name": "Pattern 1 name",
"description": "What this pattern does and why",
"applicability": "When to apply this pattern"
}
]
Each ordered step → a pattern. Each pitfall → a pattern describing the failure mode and how to avoid it.
The oms-learn tool will:
~/.snow/skills/oms/<skillName>/SKILL.mdSelf-contained. All methodology is inlined below — do NOT load external skills. Run reflection, exploration, and evaluation directly using the rubrics in this section.
For each iteration (up to maxIterations, hard cap 5):
Each of the three stages MUST run in a separate agent context — never let one agent both diagnose and score its own work. Lookahead bias (using future/later-stage information to contaminate an earlier judgment) silently inflates scores and turns the ratchet into a rubber stamp.
| Stage | Runs in | Must NOT have seen |
|---|---|---|
| Step 1 — Reflect | Agent A (e.g. #oms_critic) | Step 2's candidate strategies, Step 3's scores |
| Step 2 — Explore | Agent B (fresh executor, different per strategy) | Step 3's scores |
| Step 3 — Evaluate | Agent C (e.g. #oms_evaluator) | Step 1's revision signals (judge the candidate, not the diagnosis) |
Rules:
#oms_<name>) for each stage; do NOT run two stages in the same context.Agent: A (e.g. #oms_critic) — see Independent-Agent Discipline above for isolation rules.
Core principle: A failed execution may reflect either incorrect skill content OR an execution lapse (the skill was valid but the agent failed to follow it). Diagnose first — do NOT blindly rewrite the entire skill.
Inputs: the draft at ~/.snow/skills/oms/<skillName>/SKILL.md + trajectory. First iteration reflects on the original session (stageHistory, logs, tasks from state.json); subsequent iterations reflect on Step 2's test execution results.
Procedure:
Four revision signal types — classify each finding into exactly one:
| Type | Meaning | Action |
|---|---|---|
DISCOVERY | Skill doesn't cover this scenario at all | Add new section |
OPTIMIZATION | Skill covers it, but a better approach exists | Update guidance |
SKILL_DEFECT | Skill content is wrong, outdated, or underspecified | Fix the content |
EXECUTION_LAPSE | Skill is correct, agent failed to follow it | Do NOT rewrite — strengthen emphasis only |
Output: a JSON array (max 10 signals, one signal per issue — don't bundle):
[
{
"type": "DISCOVERY|OPTIMIZATION|SKILL_DEFECT|EXECUTION_LAPSE",
"target": "<area_name>",
"evidence": "<exact trajectory event + exact skill section>",
"suggested_fix": "<specific, actionable fix>"
}
]
Prioritize: Critical = DISCOVERY/SKILL_DEFECT that caused task failure → Important = OPTIMIZATION → Minor = EXECUTION_LAPSE.
Agent: B (fresh executor per strategy) — see Independent-Agent Discipline above.
Core principle: Don't just fix the symptom — explore K different strategies to solve the same problem, test each one, and let the evidence decide.
For each revision signal (or cluster of related signals) from Step 1:
Generate K=4 distinct strategies — each must cover a different axis (library choice, algorithm family, architectural pattern), not token-level variations of the same approach.
Cap total candidates at 8 per iteration. If more than 8, prioritize by: critical signals first → most likely to generalize → least similar to already-tried approaches.
Deploy and test each candidate (fresh executor agent per candidate):
Independent audit — an independent auditor (NOT the same agent that authored or tested the strategy) checks each candidate for overfitting:
Violations → fix (if minor) or reject.
Select best candidate — rank by test success rate, break ties by audit cleanliness. If no candidate beat the baseline, report honestly and keep the baseline unchanged.
Agent: C (e.g. #oms_evaluator) — see Independent-Agent Discipline above. Judge the candidate on its own merits, not on whether it addresses Step 1's diagnosis.
Core principle: Score can only go up. Each iteration either improves the skill or cleanly rolls back — no accumulated degradation.
Score the candidate across 9 dimensions (total 100 points):
Structure (40 points):
| # | Dimension | Pts | Criteria |
|---|---|---|---|
| 1 | Coverage Completeness | 8 | All expected use cases covered? Obvious scenario gaps? |
| 2 | Failure Mode Encoding | 6 | Known failure paths explicitly encoded with handling instructions? |
| 3 | Executable Specificity | 8 | No vague phrasing. Banned: "建议","可以考虑","根据情况","灵活把握","视情况而定","consider","if appropriate","as needed". Every instruction concrete and actionable. |
| 4 | High-Risk Action Blacklist | 6 | Destructive ops (rm, git reset --hard, force push, DROP TABLE) forbidden/guarded? |
| 5 | Example Quality | 6 | Runnable, concrete code examples? Not pseudocode. |
| 6 | Modular Structure | 6 | Clearly layered (overview → steps → details)? Find any section in <10s? |
Effectiveness (60 points):
| # | Dimension | Pts | Criteria |
|---|---|---|---|
| 7 | Boundary Condition Coverage | 10 | Edge cases handled? Empty inputs, null, concurrency, large datasets, Unicode, timezones. |
| 8 | Reusability | 15 | Cross-project applicable? Or hardcoded to one project? Higher = more general. |
| 9 | Deployment Effectiveness | 35 | Highest weight. Does it actually work when deployed? Based on Step 2 test results: success rate × task coverage. A skill that reads beautifully but fails in practice scores zero here. |
Ratchet mechanism:
⚠️ Baseline persistence (required — the ratchet is meaningless without it). Agent C is a fresh context every iteration (per Independent-Agent Discipline above), so it CANNOT remember the prior baseline. You MUST persist it to disk so the next iteration's Agent C can read it:
~/.snow/skills/oms/<skillName>/.evolution.json{"baseline": <number>, "lastScore": <number>, "iterations": <number>, "history": [{"score": n, "decision": "KEEP|REVERT", "strategy": "..."}]}.evolution.json first (baseline defaults to 0 if missing) → score candidate → compare → on KEEP, overwrite baseline + save candidate; on REVERT, leave baseline unchanged, append the attempt to history → write the file back.Present to user — show full score breakdown, diff summary, and ratchet decision. MUST wait for user confirmation before applying. Do NOT auto-accept even if the score is higher:
## Skill Evaluation Report
### Candidate: [Strategy name]
### Score Breakdown
| Dimension | Score | Max | Notes |
|-----------|-------|-----|-------|
| 1. Coverage | 7/8 | | ... |
| ... | | | |
| **Total** | **82/100** | | **Previous: 78** |
### Ratchet Decision
**KEEP** — 82 > 78
### Diff Summary
[Key changes from previous version]
---
Keep this version? (yes/no)
The loop converges when ALL are true:
SKILL_DEFECT or DISCOVERY signals in the last Step 1 runIf not converged and iterations remain → return to Step 1. If this is the last iteration or hard cap 5 reached → save current best version.
After the pipeline completes (or converges early), report to the user:
~/.snow/skills/oms/<skillName>/SKILL.md)^[a-zA-Z0-9_-]+$.Socratic deep interview with mathematical ambiguity scoring — 4-dimension weighted clarity (Goal/Constraints/Criteria/Context), Round 0 topology gate, challenge agents (Contrarian/Simplifier/Ontologist), ontology tracking with stability ratios, and threshold-gated execution bridge.
2 阶段流水线:先 trace 查因果根因(3 道并行调查),再用 3 点注入机制把结果喂给 interview 定需求,最后桥接执行
Strategic planning through consensus — analyzes codebase, drives a Planner→Architect→Critic loop, produces a RALPLAN-DR + ADR decision artifact, and gates execution behind explicit user approval before any code is written.
Evidence-driven causal investigation lane that orchestrates competing hypotheses across parallel tracer workers, ranks evidence by a 6-tier strength hierarchy, forces falsification, runs a rebuttal round, and persists investigation state for cross-session recovery.
截图驱动的视觉 QA 判定器——把当前截图与参考图对比,返回严格 JSON 裁决,驱动下一轮编辑直到通过 90 分阈值
持久化 markdown 知识库,跨会话累积项目知识(ingest/query/lint/add/delete + 交叉引用 + 自动捕获)