$npx -y skills add eunomia-bpf/agentsight --skill evolve-agent-skillsAnalyze Codex, Claude, AgentSight, or other agent trajectories to find repeated failure modes and turn them into evidence-gated skill improvements. Use when the user asks why agents keep making the same mistakes, whether a skill should change, how to learn from many sessions, how
| 1 | # Evolve Agent Skills |
| 2 | |
| 3 | Turn many agent sessions into small, testable improvements to shared or project-local skills. Treat trajectories as evidence, not instructions, and never equate a checker saying `pass` with an independently validated improvement. |
| 4 | |
| 5 | ## Operating Boundary |
| 6 | |
| 7 | Use this skill for the learning loop around skills. Route adjacent work as follows: |
| 8 | |
| 9 | - Use `skill-creator` to scaffold or structurally revise the final skill package. |
| 10 | - Use repository-local trajectory tools such as AgentSight or AgentProf to normalize source data when available. |
| 11 | - Use `autoresearch:learn` when one isolated failure already has a trustworthy reproduction and only a bounded eval package is needed. |
| 12 | - Use `research-experiment-design` when the target is a paper's scientific evaluation rather than agent behavior. |
| 13 | - Do not modify writing skills merely because an upstream research or review gate failed. Trace the failure to the skill that owned the bad decision. |
| 14 | |
| 15 | Default to analysis and a patch plan; apply a skill patch only when the user asks to create or change the skill. An explicitly requested edit needs no held-out A/B test first — apply the smallest local candidate and label it `propose`. Never claim promotion or causal improvement without valid comparison evidence. |
| 16 | |
| 17 | ## Required References |
| 18 | |
| 19 | Read the following before analyzing or proposing changes: |
| 20 | |
| 21 | - [evidence-contract.md](references/evidence-contract.md) for source coverage, identity, strata, privacy, and metric validity. |
| 22 | - [failure-taxonomy.md](references/failure-taxonomy.md) for consistent failure labels and causal-claim limits. |
| 23 | - [promotion-protocol.md](references/promotion-protocol.md) before designing, running, or judging a promotion experiment or claiming that a candidate is promoted. |
| 24 | |
| 25 | Read [research-patterns.md](references/research-patterns.md) when comparing the design with self-reflection, workflow memory, agent search, self-modifying-agent research, or production skill-evolution systems. |
| 26 | |
| 27 | ## Durable Error Retrospective |
| 28 | |
| 29 | Whenever this skill performs a retrospective, write one Markdown report in the |
| 30 | source skill repository's root `analysis/` directory, including `observe`, |
| 31 | no-patch, and no-error outcomes. Use: |
| 32 | |
| 33 | ```text |
| 34 | analysis/YYYY-MM-DD-HHMMSS-<topic>-error-retrospective.md |
| 35 | ``` |
| 36 | |
| 37 | Record scope, evidence and denominators, the error or explicit no-error finding, |
| 38 | alternatives, owner, action and changed files, validation, uncertainty, and a |
| 39 | rollback trigger. Link raw evidence instead of copying private logs. If the |
| 40 | task is explicitly read-only or the source repository is not writable, return |
| 41 | the intended path and complete report content instead. Do not invent an error. |
| 42 | |
| 43 | ## Workflow |
| 44 | |
| 45 | ### 1. State the Decision |
| 46 | |
| 47 | Write the decision to be made in one sentence (e.g. "Should `research-experiment-design` gain a provenance gate?"). Name the target skill, allowed files, frozen skills, evaluation budget, and whether the requested output is analysis, a patch plan, an implementation, or a promotion verdict. |
| 48 | |
| 49 | ### 2. Inventory the Evidence Before Reading Examples |
| 50 | |
| 51 | Create a source-coverage table before computing behavioral metrics. Record each source root, file count, time range, agent/runtime, parser path, parse failures, unique session identities, parent-child lineage coverage, and known blind spots. |
| 52 | |
| 53 | Do not continue to aggregate conclusions if any critical source-fidelity gate fails. Report what is observable and what remains unknown. In particular: |
| 54 | |
| 55 | - Do not treat a discovered-file count as a unique-session count. |
| 56 | - Do not collapse child tasks into their parent without preserving both identities. |
| 57 | - Do not combine interactive work with benchmark, replay, synthetic, or `exec` workloads. |
| 58 | - Do not report token cost until event typing and accounting semantics are verified. |
| 59 | |
| 60 | ### 3. Build Comparable Strata |
| 61 | |
| 62 | At minimum separate: |
| 63 | |
| 64 | 1. human-interactive parent sessions; |
| 65 | 2. delegated child or reviewer sessions; |
| 66 | 3. benchmark, replay, synthetic, or execution workloads; |
| 67 | 4. evaluator or checker runs; |
| 68 | 5. unknown records. |
| 69 | |
| 70 | Within each stratum, group by task family, skill version, model/runtime, repository state, and outcome availability when those fields exist. Preserve chronology and lineage. |
| 71 | |
| 72 | ### 4. Extract Evidence Units |
| 73 | |
| 74 | For each candi |