agent-wiki-compare-out…
Compare successful and failed normalized agent trajectories to derive evidence-backed agent-wiki guidelines. Use when Codex has…
Read a normalized Claude Code trajectory JSON and write an episodic summary page to wiki-twobatch/summaries/. Use when summarizing one or more saved trajectories into the agent wiki.
Claude Code
$ npx -y skills add AgentToolkit/altk-evolve --skill agent-wiki-summarize --agent claude-code
Codex
$ npx skills add AgentToolkit/altk-evolve --skill agent-wiki-summarize -a codex -y
Cursor
$ npx skills add AgentToolkit/altk-evolve --skill agent-wiki-summarize -a cursor -y
Gemini CLI
$ npx skills add AgentToolkit/altk-evolve --skill agent-wiki-summarize -a gemini-cli -y
GitHub Copilot
$ npx skills add AgentToolkit/altk-evolve --skill agent-wiki-summarize -a github-copilot -y
OpenCode
$ npx skills add AgentToolkit/altk-evolve --skill agent-wiki-summarize -a opencode -y
Windsurf
$ npx skills add AgentToolkit/altk-evolve --skill agent-wiki-summarize -a windsurf -y
name: agent-wiki-summarize description: Read a normalized Claude Code trajectory JSON and write an episodic summary page to wiki-twobatch/summaries/. Use when summarizing one or more saved trajectories into the agent wiki.
Witness one session at a time. For each normalized trajectory JSON, author a 1–3 paragraph narrative + key turns + (when present) a classification of each recalled guideline as `followed | ignored | contradicted` with an evidence quote.
This is the per-trajectory **witness** pass of the `agent-wiki` family. It writes one page per session and tail-calls the bookkeeping `catalog` subcommand so indexes stay fresh.
A path that is either:
Default if no path is given: `trajectories/normalized`.
Use `Glob` to enumerate `*.json`. Accept either a single file, a flat dir of files, or a `normalized/` root with `<label>/items/` subdirs.
`Glob wiki-twobatch/summaries/*.md` so you can skip-if-exists per session without re-doing LLM work. Skip is the default; pass `--rewrite` (forwarded to the helper below) to overwrite.
Read the file. The fields you need:
If `wiki-twobatch/summaries/<session_id>.md` already exists and the user did not request `--rewrite`, skip to the next file.
Otherwise synthesize a summary as a JSON object:
{
"session_id": "<from JSON>",
"slug": "<optional; for splitting a long session into multiple arc-summaries (e.g. 'arc1-token-savings'). When present, filename becomes <sid>__<slug>.md and frontmatter gains `arc:` plus a `sibling_summaries:` list of co-summaries from the same session.>",
"agent": "<from JSON, default 'claude-code'>",
"model": "<from JSON>",
"goal": "<one short sentence describing what the user asked for>",
"outcome": "success | partial | failure",
"duration_seconds": <number from JSON>,
"tools_used": ["<from stats.top_tools, name only>", "..."],
"narrative": "<1-3 paragraphs: what happened, what worked, what didn't>",
"key_turns": ["<one short bullet per pivotal step>", "..."],
"normalized_path": "<path to the JSON, relative to repo root>",
"transcript_path": "<from source.transcript_path>",
"recalled_guidelines": [
{
"id": "<12-hex-char id of the guideline that was used in this session>",
"title": "<a short label, 3-7 words>",
"status": "followed | ignored | harmful | contradicted",
"evidence": "<verbatim quote ≤200 chars; required for followed/harmful/contradicted>"
}
]
}Rules of thumb:
The `recalled_guidelines` field captures **every wiki guideline the agent saw in this session**. Scan the trajectory for the agent reading guideline files from a wiki dir — `<wiki-root>/guidelines/<slug>__<gid>.md` or `<wiki-root>/guidelines/<slug>__cluster.md` — either via the `Read` tool or via Bash `cat`/`less`/`grep`. Extract each file's id from its YAML frontmatter (`id: <12-hex>`) so the row links to the wiki's `_id_index.json`.
Don't double-count: if the agent reads the same guideline file twice, emit one row.
You judge the status from **trajectory evidence**, not the agent's self-report:
produced the intended result. Required `evidence`: a verbatim quote showing the agent applied the rule (citation, paraphrase that triggered a tool call, or a tool call whose form matches the guideline's prescription).
it. No `evidence` needed; default for guidelines that landed in context without effect.
wasted tool calls, wrong path, retracted decision, or surfaced a wrong answer that had to be corrected. Required `evidence`: a verbatim quote showing the bad outcome that followed application.
the opposite (disagreed with the rule). Required `evidence`: a verbatim quote where the agent's action contradicts the guideline's prescription.
Default to `ignored` when uncertain. Don't assign `followed` or `harmful` without a verbatim evidence quote — those carry signal value only when backed by trajectory text.
echo '<json>' | uv run python explorations/agent-wiki/skills/scripts/build_agent_wiki.py render-summary
Add `--rewrite` to overwrite an existing page. The helper:
one next to the nearest `.git/` ancestor).
After processing all input files, run *
Evolve helps AI agents learn from experience. It turns past trajectories into reusable guidelines that help agents complete future tasks, without changing model weights.
Compare successful and failed normalized agent trajectories to derive evidence-backed agent-wiki guidelines. Use when Codex has…
Read all atomic guidelines in wiki-twobatch/guidelines/ and propose themed clusters that group near-duplicates. Writes cluster…
Consult an agent-wiki for guidelines relevant to the task at hand. The wiki itself documents how to retrieve from it (AGENTS.md).…
Read a normalized Claude Code trajectory JSON and extract reusable guidelines into wiki-twobatch/guidelines/. Use when mining…
Ingest one or more agent trajectories (raw bob/claude traces or normalized JSON) into an agent-wiki end-to-end — convert,…
Read a normalized Claude Code trajectory JSON and produce a wiki-resident SKILL.md page that future agents can invoke. Use when a…
You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…
Ask which skill or flow fits your situation. A router over the skills in this repo.