一键导入
origin-evolve-skill
trace.md 执行记录进化:处理 trace 模式归纳、proposal 生成、知识更新审批与 skill 规则沉淀。
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
trace.md 执行记录进化:处理 trace 模式归纳、proposal 生成、知识更新审批与 skill 规则沉淀。
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | origin-evolve-skill |
| description | trace.md 执行记录进化:处理 trace 模式归纳、proposal 生成、知识更新审批与 skill 规则沉淀。 |
Mission: turn .claude/traces/trace.md into approved updates of .skillmanager/.skills/ (never write skill source files under .claude/skills/ mirrors).
Trigger: user input origin evolve (or equivalent intent).
| Need | See |
|---|---|
| Full proposal examples | EXAMPLES.md |
| Evidence requirements (Rule 1) | SKILL_MEMORY.md#rule-1-evidence-based-proposals |
| Attribution decision tree (Rule 2) | SKILL_MEMORY.md#rule-2-attribution-decision-tree |
| Append / Merge / Retire operations (Rule 3) | SKILL_MEMORY.md#rule-3-append--merge--retire |
| User approval policy (Rule 4) | SKILL_MEMORY.md#rule-4-user-approval-required-for-every-write |
| Format & capacity compliance (Rule 5) | SKILL_MEMORY.md#rule-5-format--capacity-compliance |
| Common pitfalls | SKILL_MEMORY.md#pitfalls |
| When to update this skill | ITERATION_GUIDE.md |
The scoring/buffer subsystem and the hand-written IDP path were retired. A trace entry is now written ONLY when the model wrote auto-memory during the session — a memory-snapshot ledger record. Pure code sessions produce no trace entry.
Hook-generated fields: timestamp, type, validated, pipeline_run_id, memory_snapshots.
Lifecycle: status (pending/processed/expired/invalid), validated (_/true/false/pending-pipeline/invalid).
Memory snapshots are the sole learning source. memory_snapshots: <N> counts embedded <!-- MEMORY slug:… type:… -->…<!-- /MEMORY --> subblocks — verbatim copies of Claude Code auto-memory files the model wrote (type is feedback/project/reference; personal user memories are filtered out before capture). type: on the TRACE line is the dominant snapshot type (feedback > project > reference). These are raw material, not conclusions: distilling them into rules is your job in Step 2/3. Treat feedback content as the strongest evidence (an explicit rule the user gave), and always verify a snapshot's claim against current code/skills before proposing (snapshots are point-in-time copies and may have drifted).
Retired fields (legacy entries only): score, score_breakdown, modules, correction, mode, skills, error_cause, fix_approach, user_feedback, lesson. schema:1-3 entries may still carry these; read them if present but do not expect or require them on schema:4.
Step 1 Read & Triage -> Step 2 Identify Patterns -> Step 3 Generate Proposals -> Step 4 User Approval -> Step 5 Write & Mark Processed -> Step 6 Calibrate (optional)
Acquire .trace_lock (overwrite if stale). Apply lifecycle transitions: pending with stale validated -> expired; pending-pipeline past expiry -> invalid.
Schema version gate: the current trace schema is 4. Entries without a schema tag are treated as schema 1 (legacy). schema:1-3 entries may carry now-retired fields (score/modules/correction/experience fields); read them if present but never require them. Accept schema:1 through schema:4. If any entry has schema:N where N > 4, abort and report "Unsupported trace schema version N. Update origin-evolve."
Read trace.md, keep pending only, then exclude entries with validated:pending-pipeline from proposal candidates until they are finalized to true / false or expire to invalid. Since schema:4 entries only exist because the model captured memory, treat any entry with a feedback memory snapshot as sufficient evidence to act on — do not gate it behind a minimum count. If no pending entry carries a memory snapshot (and no legacy correction signal exists), suggest waiting.
Compute three diagnostic counts across .skillmanager/.skills/*/SKILL_MEMORY.md and include in the analysis summary:
Non-zero counts indicate prior attribution or merge errors and should inform Step 2 proposal generation.
Sort priority:
validated:pending-pipeline from the priority queue; they are runtime-in-flight, not proposal evidence.validated:false (a rejected pipeline result — something went wrong, highest signal)feedback-type memory snapshot (an explicit user rule — high-confidence raw material)validated:true + memory snapshot (validated context worth distilling)memory_snapshots >= 1 with project/reference snapshots onlycorrection signal, by recencyMemory-snapshot distillation is the primary (and now essentially only) learning path. For each entry with memory_snapshots >= 1, read the <!-- MEMORY --> subblock content and distill it into a candidate rule yourself — the snapshot IS the raw material. Per snapshot:
feedback type → the content is already a rule the user gave ("X 场景必须用 Y" + why). Treat it as a single-trace-sufficient signal: one feedback snapshot can justify a proposal, because it is an explicit user directive, not an inferred pattern. Distill it into the target skill's SKILL_MEMORY.md (single-skill) or GLOBAL_SKILL_MEMORY.md (cross-skill), following existing rule format (rule + Why + How to apply).project type → context/decision. Use to inform proposals, rarely a rule on its own.reference type → external-resource pointer. Route to the relevant skill's reference notes if durable.SKILL_MEMORY.md/GLOBAL_SKILL_MEMORY.md for an equivalent rule; if present, propose an update/merge, not a duplicate.feedback snapshots about the same skill/topic, merge them into one coherent rule rather than N fragments.Cross-skill overlap signal — the Step 1 diagnostic counts (non-zero) still flag prior attribution/merge errors worth reviewing.
Note: the former code-statistics patterns (correction cluster / module hotspot / complexity concentration) were retired along with the scoring subsystem — schema:4 entries carry no
modules/score/correctiondata. Only legacy schema:1-3 entries could still support them; do not expect them on new data.
For each pattern, produce a proposal containing:
Pre-write check: capacity headroom; for Retire, grep evidence that anchors are absent from current code.
When snapshot content and anchor evidence disagree on which skill owns a rule, present BOTH candidate skills in Step 4 for user choice.
Present proposals one at a time:
[RETIRED] effectRejection records an EVOLVE_REJECTION entry with pattern name, reason, and future scope effect.
Atomic write (temp + rename). Replace analyzed entries with one audit line:
<!-- PROCESSED ts:{ISO8601} entries:{N} proposals:{M} -->
Delete .trace_lock in finally block.
The score-weight calibration step was retired with the scoring subsystem (schema:4 has no dimensions to tune). If snapshot capture itself seems mis-scoped — e.g. too many low-value project snapshots, or feedback rules never landing — that is a hook/config issue (memory_dir_pattern, excluded types), not something to calibrate here; note it for the user instead.
code_pipeline code-pipeline 功能开发流程编排 Step1需求拆分 Step2约束冻结 Step3模块实现 Step4依赖闭合 Step5验收 verdict 多模块 复杂系统 子pipeline
bootstrap castflow install init setup update submodule .castflow bootstrap.py scaffold CLAUDE.md Phase0 language cf_manifest cold start Phase5 skill-creator module skill NOT merge skill meta-spec
new skill create skill edit skill rewrite skill skill eval benchmark skill YAML frontmatter description trigger tuning skill quality skill iter ITERATION_GUIDE NOT bootstrap