gepa-evolve-inline
Skill0 starsChanged 6 days agoMITView on GitHub
Use when the user wants to evolve / improve / refine a skill but does NOT have ANTHROPIC_API_KEY or `claude auth login` set up. Triggers on "evolve skill", "improve this skill", "skill ko better banao", "iss skill mein dikkat hai", "regenerate skill X", "skill evolve karo", "is skill ka GEPA chalao". The active Claude Code session itself does the reflection — no headless `claude` spawn, no API key needed.
- Reads credentials
In this repository174 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- ad-ci-readinessSkill
- ad-pre-pushSkill
- accessibilitySkill
- agent-evalSkill
- agent-harness-constructionSkill
- agentic-engineeringSkill
- agent-introspection-debuggingSkill
- agent-sortSkill
- ai-first-engineeringSkill
- ai-regression-testingSkill
- api-connector-builderSkill
- architecture-decision-recordsSkill
- article-writingSkill
- automation-audit-opsSkill
- autonomous-agent-harnessSkill
- autonomous-loopsSkill
- backend-patternsSkill
- benchmarkSkill
- blueprintSkill
- brand-voiceSkill
- browser-qaSkill
- bun-runtimeSkill
- canary-watchSkill
- cavemanSkill
- ckSkill
- claude-devfleetSkill
- click-path-auditSkill
- codebase-onboardingSkill
- code-tourSkill
- coding-standardsSkill
- content-engineSkill
- content-hash-cache-patternSkill
- context-budgetSkill
- continuous-agent-loopSkill
- continuous-learningSkill
- continuous-learning-v2Skill
- cost-aware-llm-pipelineSkill
- councilSkill
- crosspostSkill
- ad-harnessSkill
- ad-state-migrateSkill
- ad-tui-devSkill
- agent-daemon-memorySkill
- big-feature-flowSkill
- bootstrap-daemonSkill
- bug-flowSkill
- engine-upgradeSkill
- feature-flowSkill
- harness-troubleshootSkill
- orchestrate-teamSkill
- release-flowSkill
- session-closeSkill
- skill-authorSkill
- skill-installerSkill
- dashboard-builderSkill
- database-migrationsSkill
- deep-researchSkill
- deployment-patternsSkill
- The first 60 shown.
The file
Show its rules and text
We split this skill into the rules it gives an agent
16 rules. About 0 are common, 6 are distinctive, and 10 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈6
Distinctive · estimate
This author's own choices. Worth a look.
10
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 21
Run the CLI flag that lists skills needing evolution (no auth needed):
- Very specific: line 38
If candidates is empty → tell the user "no skills currently meet the threshold of ≥3 failures in 30 days.
- Distinctive: line 40
If the user named a skill explicitly (e.g.
- Very specific: line 64
If the export reports no execution traces → STOP.
- Very specific: line 68
Use Read to load:
- Distinctive: line 97
Keep this honest. If only 3 failures and they're each different root causes — say "insufficient data to propose a confident change."
- Very specific: line 103
Add a new step to ## Procedure addressing failure mode #1
- Very specific: line 104
Add a new entry to ## Anti-patterns for the recurring trap
- Very specific: line 106
Add a ## Examples block covering the failed scenario
- Very specific: line 108
Write the full revised SKILL.md (frontmatter + body) to a temporary file, then queue it:
- Very specific: line 114
Never write into .agent-daemon/proposed/ by hand: ad writes the proposal (with the checksum of today's SKILL.md and of yours), and ad …
- Distinctive: line 116
Put the reasoning in your reply instead of the file:
- Distinctive: line 162
Skipping export-traces and reading SQLite directly: Use the CLI flag — it sanitises + caps results.
- Very specific: line 164
Hallucinating failure modes from <5 traces: If failure_count < 3, the heuristic threshold isn't even met.
- Distinctive: line 165
Confidence theater: If the traces are noisy or contradictory, say so.
- Very specific: line 202
After ad review accepts, the change becomes a new version in ~/.agent-daemon/skills/<name>/, is written to the copy hosts load …
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
GEPA inline — the no-API skill evolution path
The normal ad evolve <skill> command spawns a headless claude CLI to do reflection + variant generation. That needs auth (claude auth login or ANTHROPIC_API_KEY). This skill is the no-auth alternative: you (the active Claude Code session) ARE the LLM. You read the traces, reflect, and write the proposal yourself.
The output is the same: a proposal queued with ad skill propose, which the user reviews via ad review (a diff, then a typed accept).
Phase 1 — Find candidates
Run the CLI flag that lists skills needing evolution (no auth needed):
ad evolve --list-candidates --jsonOutput is JSON of the form:
{
"candidates": [
{ "skill_name": "debug-triage", "failure_count": 5 },
{ "skill_name": "deploy-ops", "failure_count": 3 }
]
}If candidates is empty → tell the user "no skills currently meet the threshold of ≥3 failures in 30 days. Nothing to evolve." STOP.
If the user named a skill explicitly (e.g. "evolve skill debug-triage"), use that one directly — skip the listing.
Phase 2 — Export traces
Tell the CLI to dump execution traces for the chosen skill:
ad evolve <skill-name> --export-tracesThis writes JSONL to <cwd>/.agent-daemon/skill-traces/<skill-name>.jsonl. One line per execution. Each line:
{
"id": 12,
"session_id": "abc-123",
"skill_name": "debug-triage",
"succeeded": false,
"failure_reason": "guidance was unclear when the bug was in a third-party dep",
"trigger_text": "the build is broken on CI but works locally",
"created_at": "2026-05-15T14:32:00Z"
}If the export reports no execution traces → STOP. Tell the user "skill has never been executed (or executions weren't recorded). Run the skill a few times first."
Phase 3 — Read traces + current SKILL.md
Use Read to load:
- The traces JSONL — every line is a trace
- The current skill body at
skills/<bucket>/<skill-name>/SKILL.md(try buckets:daemon,engineering,productivity, then flat)
Group traces by outcome:
- Failures —
succeeded: false. Read eachfailure_reasoncarefully. What does the skill body NOT explain that the user needed? - Successes —
succeeded: true. What patterns made these work?
Phase 4 — Reflect
In your own context (no separate spawn), produce a written analysis. Structure:
### Failure modes observed
1. **<mode 1 name>** (N occurrences) — <one sentence: what was the agent missing?>
Evidence: "<failure_reason quote>" (session abc-123)
2. **<mode 2 name>** (M occurrences) — ...
### Success patterns
- <pattern that consistently worked, with brief example>
- <another pattern>
### Root cause hypothesis
<2-3 sentences: which part of the current SKILL.md body is causing the failures? Is the procedure ambiguous? Are anti-patterns missing? Is the scope wrong?>Keep this honest. If only 3 failures and they're each different root causes — say "insufficient data to propose a confident change."
Phase 5 — Propose a variant
Based on the reflection, draft a modified SKILL.md. Only change what the reflection justifies. Don't refactor for style. Common targeted changes:
- Add a new step to
## Procedureaddressing failure mode #1 - Add a new entry to
## Anti-patternsfor the recurring trap - Broaden the
description:line if triggers are missing the failure cases - Add a
## Examplesblock covering the failed scenario
Write the full revised SKILL.md (frontmatter + body) to a temporary file, then queue it:
ad skill propose <skill> --file <path to the revised SKILL.md> --origin gepa-inlineNever write into .agent-daemon/proposed/ by hand: ad writes the proposal (with the checksum of today's SKILL.md and of yours), and ad review refuses a file whose checksums don't match (a check against damage, not a signature: the user reviewing the diff is the gate).
Put the reasoning in your reply instead of the file:
# Proposed via inline GEPA (active session)
**Skill:** <skill-name>
**Queued:** <the path ad skill propose printed>
**Mode:** inline (no headless claude spawn, no API cost)
**Source traces:** <N> (failures: <F>, successes: <S>)
## Reflection summary
<paste the reflection from Phase 4>
## Changes from baseline
- <bullet — what changed and why>
- <bullet>
## Review
To accept this proposal:
```bash
ad reviewad review shows the diff against today's SKILL.md; the user's typed accept applies it and publishes it to every host ad's memory is installed in (ad skill undo <skill> reverts).
## Phase 6 — Surface to user + log
In your final assistant response:
1. **Summary** — "Reflected on N traces (F failures, S successes). Identified <root cause hypothesis>."
2. **Path** — the path `ad skill propose` printed
3. **Next step** — "Run `ad review` to accept or reject."
Append a log line to `.agent-daemon/gepa-inline-log.jsonl`:
```bash
echo '{"ts":"<ISO>","skill":"<name>","traces":N,"failures":F,"proposal":"<path>","mode":"inline"}' >> .agent-daemon/gepa-inline-log.jsonlAnti-patterns
- Skipping export-traces and reading SQLite directly. Use the CLI flag — it sanitises + caps results. Direct DB access can produce stale or partial data.
- Proposing a complete rewrite when reflection only justifies one change. Targeted edits get accepted; full rewrites get rejected for being too risky.
- Hallucinating failure modes from <5 traces. If
failure_count < 3, the heuristic threshold isn't even met. Tell the user the sample is too small. - Confidence theater. If the traces are noisy or contradictory, say so. "No confident proposal — failures appear unrelated to skill body" is a valid outcome.
- Forgetting the log line. Log every inline run, even rejections. The pipeline uses the log to detect repeated futile evolutions and skip them next time.
Examples
Example 1: clear failure mode
User: "evolve skill debug-triage"
Phase 1: --list-candidates shows debug-triage with 5 failures.
Phase 2: export traces → 5 failures, 12 successes.
Phase 3: read traces. All 5 failures mention "the bug was in a third-party dep, the skill didn't help."
Phase 4: reflect → root cause: skill assumes the bug is in user code; needs a "is it a dependency bug?" phase.
Phase 5: propose adding a new Phase 1.5 "Check if it's a dep" with a 3-step procedure.
Phase 6: surface + log.
Example 2: insufficient data
User: "evolve skill seed-data"
Phase 1: --list-candidates doesn't include seed-data.
Phase 2: export traces anyway (user asked) → only 2 failures.
Phase 3: read traces. Both failures are different root causes.
Phase 4: reflect → "2 failures, 2 different root causes — insufficient signal."
Final response: "Only 2 failures in 30d, both with different root causes. Not enough signal for a confident proposal. Suggest waiting for more data or running the skill in more scenarios."
Skip Phase 5 entirely.
Verification
ls -lt .agent-daemon/proposed/ | head -3 # latest proposal at top
ad status # surface in queued proposals
ad review # user reviewsAfter ad review accepts, the change becomes a new version in ~/.agent-daemon/skills/<name>/, is written to the copy hosts load (.claude/skills/<name>), and the next session loads it. ad skill history <name> lists versions; ad skill undo <name> reverts.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

