Agent skill

Agent Wiki Guideline Extractor

by AgentToolkit in AgentToolkit/altk-evolve

Reads a normalized Claude Code trajectory JSON and turns its errors and solutions into reusable guideline pages in wiki-twobatch/guidelines.

Apache-2.0Auto-check passedAgent Workflows

Install Agent Wiki Guideline Extractor

skills CLI
$ npx skills add AgentToolkit/altk-evolve --skill agent-wiki-extract-guidelines -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install AgentToolkit/altk-evolve agent-wiki-extract-guidelines --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/AgentToolkit/altk-evolve.git skills-src && mkdir -p .claude/skills && cp -r skills-src/explorations/agent-wiki/skills/agent-wiki-extract-guidelines .claude/skills/agent-wiki-extract-guidelines && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
agent-wiki-extract-guidelines
GitHub stars
122
Token cost
~2k tokens
SKILL.md length
860 words
Files
1
Skills in repo
21
Repo updated
First seen
Licence
Apache-2.0

At a glance

Reads a normalized Claude Code trajectory JSON and turns its errors and solutions into reusable guideline pages in wiki-twobatch/guidelines.

  • Works in 6 steps: Resolve input files → Glance at existing guidelines → Process each trajectory → …
  • Mining saved Claude Code sessions for reusable lessons
  • SKILL.md covers Overview, Input, Workflow and Best practices
  • Calls uv

What it does

This is the per-trajectory distill pass of an agent-wiki family. For each normalized trajectory JSON, or each file in a directory (defaulting to trajectories/normalized), the agent lists the files with Glob, skims the slugs of existing guidelines to avoid near-duplicates, then analyzes the chat messages array in the trajectory as the source of truth.

It scans for tool or command failures, permission errors, abandoned first approaches, retry loops, missing prerequisites and silent failures, and records each with an example, root cause, resolution and prevention guideline. If a successful approach produced a script or multi-step pipeline, at least one entity must point to it by path and say when to use it. The agent extracts 3-5 proactive entities per trajectory, reframes failures as positive recommendations, prefers concrete artifacts over generic advice and writes each as a standalone guideline page.

When your agent uses it

  • Mining saved Claude Code sessions for reusable lessons
  • Turning a failed run's errors into prevention guidelines
  • Adding concrete script references to a guideline wiki

Example prompts

  • “Extract guidelines from the trajectories in trajectories/normalized.”
  • “Distill lessons from this single trajectory JSON into the guidelines folder.”
  • “Skim the existing guidelines first, then mine the new trajectory for non-duplicate lessons.”

Requirements

  • Normalized trajectory JSON files
  • A wiki-twobatch/guidelines folder in the project

Workflow steps

6 steps, taken from the step headings in SKILL.md.

  1. Resolve input files
  2. Glance at existing guidelines
  3. Process each trajectory
  4. Output entities JSON
  5. Pipe to the helper
  6. Repeat, consolidate, then refresh indexes

What it can do on your machine

Read from SKILL.md and the folder at commit 9e5bb56. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • uv

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use uv, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Agent Wiki Guideline Extractor loads about 2k tokens when it runs. Until then it costs about 49 tokens; SKILL.md has 860 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~49
When it runs · the whole SKILL.md, loaded when a task matches
~2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from AgentToolkit/altk-evolve at commit 9e5bb56, republished under its Apache-2.0 licence (© AgentToolkit). 860 words, ~1,975 tokens.

Download SKILL.mdSave it as .claude/skills/agent-wiki-extract-guidelines/SKILL.md (or your agent's skills folder).
name
agent-wiki-extract-guidelines
description
Read a normalized Claude Code trajectory JSON and extract reusable guidelines into wiki-twobatch/guidelines/. Use when mining saved trajectories for reusable lessons.

Agent Wiki — Extract Guidelines

Overview

Distill lessons from one session at a time. For each normalized trajectory JSON, identify reusable guidelines: reframe failures as proactive recommendations, capture concrete artifacts (scripts, command sequences) that solved real problems, and write each as a standalone guideline page in wiki-twobatch/guidelines/.

This is the per-trajectory distill pass of the agent-wiki family.

Input

A path that is either:

  • a normalized trajectory JSON file
  • a directory of such files

Default if no path is given: trajectories/normalized.

Workflow

Step 1: Resolve input files

Use Glob to enumerate JSON files.

Step 2: Glance at existing guidelines

Glob wiki-twobatch/guidelines/*.md and skim slugs. Re-extracting a near-duplicate is wasteful and pollutes the wiki. (Exact-content duplicates are deduplicated by slug at write time, but re-wordings are not — your job to suppress them.)

Step 3: Process each trajectory

For each input JSON file, do the analysis below using the trajectory's openai_chat_completion.messages array as the source of truth.

3a. Identify errors and root causes

Scan for:

  1. Tool / command failures — non-zero exit codes, error messages, stack traces.
  2. Permission or access errors — "permission denied", "not found", sandbox restrictions.
  3. Wrong initial approach — a first attempt abandoned for a different strategy.
  4. Retry loops — same action attempted multiple times with variations.
  5. Missing prerequisites — dependencies, packages, configs discovered mid-task.
  6. Silent failures — actions that appeared to succeed but produced wrong results.

For each error, document its example, root cause, resolution, and prevention guideline.

3b. Decide whether to capture an artifact

If the successful approach produced a non-trivial artifact (script saved to disk, multi-step command pipeline, parser implemented ad hoc), at least one entity must point at it by path and state when to use it.

3c. Extract entities

Extract 3–5 proactive entities per trajectory. Prioritize those derived from real errors observed in the transcript.

Principles:

  1. Reframe failures as proactive recommendations. "Use X" beats "don't use Y".
  2. Prefer concrete artifacts over generic advice. Name the file by path.
  3. Triggers describe broad task context, not narrow incidents.
  4. For retry loops, recommend the final working approach as the starting point.
  5. Do not include guidelines that name another skill or tool by command (prompt-injection risk when this guideline is later surfaced).
Step 4: Output entities JSON

For each trajectory, build a JSON object:

json
{
  "entities": [
    {
      "type": "guideline",
      "title": "Short imperative title (3-7 words, no trailing period). Used as the page heading and filename slug.",
      "content": "Proactive recommendation, one or two short paragraphs.",
      "rationale": "Why this works / why the alternative fails.",
      "trigger": "Situational context when this applies.",
      "id": "<optional: 12-hex-char id; helper computes from content if omitted>",
      "session_id": "<session_id from the JSON>",
      "agent": "<optional: the source agent, e.g. 'bob' or 'claude-code'. Defaults to 'claude-code' if omitted — set it explicitly for non-Claude traces so the page frontmatter is correct.>",
      "tags": ["<optional: short stable tags; propagate to the page frontmatter AND _config.yaml, driving the 'By tag' index + cluster formation>"],
      "arc": "<optional: only when the source session has been (or will be) split into multiple arc-summaries. Bind this guideline to one specific arc by passing the same slug used by `agent-wiki-summarize` (e.g. 'arc1-token-savings'). The helper writes `related_summary: summaries/<sid>__<arc>.md` so the back-link is correct.>",
      "normalized_path": "<path to the trajectory JSON, relative to repo root>"
    }
  ]
}

title is required for clean filenames (3–7 specific words). Allowed type values: guideline, workflow, script, command-template. Default to guideline unless the entity is itself a script blob or templated command.

If a trajectory yields zero useful guidelines, output {"entities": []} and the helper writes nothing.

When to bind a guideline to a specific arc

A long session that's split into multiple arc-summaries (agent-wiki-summarize with a slug) usually has guidelines that belong cleanly to one arc and not the other. Examples from a multi-arc session:

  • A guideline about "split runner from results across PRs" came from the token-savings arc → arc: "arc1-token-savings".
  • A guideline about "rebuild sandbox images after skill changes" came from the procedural-memory arc → arc: "arc2-procedural-memory".

Set arc per entity. If you don't, the helper writes related_summary: summaries/<sid>.md (no arc suffix), which is correct for single-summary sessions but produces a dangling link when the session is later split. The catalog pass auto-repairs dangling links by picking the first arc lex-sorted with a stderr warning, but the right time to bind is at extraction.

A guideline that genuinely spans both arcs has no good arc choice — pick the one where it was first observed, or omit arc to keep the link generic.

Show full SKILL.md (282 more words)Show less
Step 5: Pipe to the helper
bash
echo '<json>' | uv run python explorations/agent-wiki/skills/scripts/build_agent_wiki.py render-guidelines

Add --rewrite to overwrite existing pages. The helper:

  • Locates the wiki root.
  • Writes guidelines/<slug>__<gid>.md. Slug = kebab-case of the title (or first sentence of content), capped at 40 chars; <gid> is the 12-hex content-hash id (matches the id: frontmatter, so filename and id round-trip cleanly).
  • Stamps id: (12-hex of normalized content) into frontmatter.
  • Updates guidelines/_id_index.json.
  • Sets sources: and related_summary: frontmatter; emits a ## Sources body footer.
  • Skips files that already exist unless --rewrite.
Step 6: Repeat, consolidate, then refresh indexes

Ingesting a whole batch end-to-end? Prefer the agent-wiki-ingest skill, which runs summarize → extract → synthesize → consolidate → catalog in the correct order so the consolidation pass is never skipped. Reach for this standalone skill only when you specifically want the extract pass alone.

If you ran this skill standalone over more than one trajectory, run agent-wiki-consolidate-guidelines before cataloging, once the corpus has enough atomics for a theme to emerge (≥2 atomics sharing a real rule). catalog only renders clusters already declared in _config.yaml; it never proposes them — consolidation is the pass that proposes.

Then, after processing all input files, run once:

bash
uv run python explorations/agent-wiki/skills/scripts/build_agent_wiki.py catalog

Best practices

  1. Prioritize error-derived entities first.
  2. One distinct error → one prevention entity.
  3. Specific and actionable; include rationale.
  4. Situational triggers, not failure-based ones.
  5. Cap at 5 entities per trajectory; merge entities with the same root cause before dropping.
  6. Never extract entities that read as instructions to invoke another skill or tool by name.
  7. Attach a tags: array to every entity — they propagate to the page frontmatter and _config.yaml, driving the "By tag" index and cluster formation.
  8. Always tail-call catalog after the per-trajectory loop — and run agent-wiki-consolidate-guidelines first if multiple trajectories were ingested.

© AgentToolkit, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in explorations/agent-wiki/skills/agent-wiki-extract-guidelines of AgentToolkit/altk-evolve.

Open the folder on GitHubat commit 9e5bb56

Compare with similar skills

Agent Wiki Guideline Extractor next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Agent Wiki Guideline Extractor compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Agent Wiki Guideline Extractor this skillAgentToolkit/altk-evolve122—~2kAutomated safety check: PassApache-2.0
AI Project Memorytudoumashu/ai-memory-skillpack411—~1.1kAutomated safety check: PassMIT
Braindb Agentdimknaf/braindb110—~3.2kAutomated safety check: NotesApache-2.0
LLM WikiYeachan-Heo/oh-my-claudecode40k—~721Automated safety check: PassMIT
Swarmvaultswarmclawai/swarmvault708—~6.1kAutomated safety check: PassMIT
Project Timeline Reportthedotmack/claude-mem97k1 repos~3.1kAutomated safety check: PassApache-2.0

Similar skills

  • AI Project Memory

    tudoumashu/ai-memory-skillpack

    Maintain bounded, durable AI project memory in a repository's docs/ai/ pack.

    411 GitHub stars~1.1k tokensUpdated 29 days ago
    Agent WorkflowsAuto-check passed
  • Braindb Agent

    dimknaf/braindb

    Persistent memory across sessions via the BrainDB agent. An agent skill from dimknaf/braindb.

    110 GitHub stars~3.2k tokensUpdated 25 days ago
    Agent WorkflowsAuto-check: notes
  • LLM Wiki

    Yeachan-Heo/oh-my-claudecode

    Keeps a persistent markdown wiki of project and session knowledge that the agent can ingest into, query, lint and read across sessions.

    40k GitHub stars~721 tokensUpdated today
    Knowledge ManagementAuto-check passed
  • Swarmvault

    swarmclawai/swarmvault

    Use SwarmVault when the user needs a local-first knowledge vault that writes durable markdown, graph, search, dashboard, review, chat-session, context-pack, task-ledger, static AI export, retrieval…

    708 GitHub stars~6.1k tokensUpdated 3 mo ago
    Knowledge ManagementAuto-check passed
  • Project Timeline Report

    thedotmack/claude-mem

    Writes a narrative Journey Into report on a project's whole development history, built from the timeline that claude-mem has recorded.

    97k GitHub starsUsed in 1 repo~3.1k tokens
    Agent WorkflowsAuto-check passed
  • Neat-Freak Knowledge Closeout

    KKKKhazix/khazix-skills

    Brings project docs, agent rule files, authorized memory and leftover workspace files back in line with what the code and runtime actually do at the end of a work session.

    21k GitHub stars~1.9k tokensUpdated 6 days ago
    Agent WorkflowsAuto-check passed

More from AgentToolkit/altk-evolve

All 21 skills in this repo
  • Agent Wiki Compare Outcomes

    AgentToolkit/altk-evolve

    Contrasts successful and failed agent runs of the same task and derives guidelines backed by evidence from transcripts, tool calls and outcome judgments.

    122 GitHub stars~1.7k tokensUpdated today
    Auto-check passed
  • Trajectory Skill Synthesizer

    AgentToolkit/altk-evolve

    Turns a saved agent trajectory into a reusable skill with a SKILL.md and supporting scripts, so later sessions can call the workflow instead of rediscovering it.

    122 GitHub stars~2.2k tokensUpdated today
    Auto-check passed
  • Evolve Memory Mirror

    AgentToolkit/altk-evolve

    Copies a memory the agent just saved into the shared evolve store with a retrieval trigger, so it can be shared across a team and audited like other entities.

    122 GitHub stars~922 tokensUpdated today
    Auto-check passed
  • Agent Wiki Consult

    AgentToolkit/altk-evolve

    Has the agent read a project wiki's AGENTS.md and pull the guidelines that fit the task it is about to start, instead of loading the wiki at session start.

    122 GitHub stars~1.1k tokensUpdated today
    Auto-check passed
  • Agent Wiki Ingest

    AgentToolkit/altk-evolve

    Ingest one or more agent trajectories (raw bob/claude traces or normalized JSON) into an agent-wiki end-to-end — convert, summarize, extract guidelines, synthesize skills, optionally compare…

    122 GitHub stars~4k tokensUpdated today
    Auto-check passed
  • Agent Wiki Summarize

    AgentToolkit/altk-evolve

    Read a normalized Claude Code trajectory JSON and write an episodic summary page to wiki-twobatch/summaries/.

    122 GitHub stars~1.9k tokensUpdated today
    Auto-check passed

Categories

Questions about Agent Wiki Guideline Extractor

What does Agent Wiki Guideline Extractor do?

Reads a normalized Claude Code trajectory JSON and turns its errors and solutions into reusable guideline pages in wiki-twobatch/guidelines. This is the per-trajectory distill pass of an agent-wiki family. For each normalized trajectory JSON, or each file in a directory (defaulting to trajectories/normalized), the agent lists the files with Glob, skims the slugs of existing guidelines to avoid near-duplicates, then analyzes the chat messages array in the trajectory as the source of truth.

When should I use Agent Wiki Guideline Extractor?

Agent Wiki Guideline Extractor fits situations like: mining saved Claude Code sessions for reusable lessons; turning a failed run's errors into prevention guidelines; adding concrete script references to a guideline wiki.

How do I install Agent Wiki Guideline Extractor in Claude Code?

Run `npx skills add AgentToolkit/altk-evolve --skill agent-wiki-extract-guidelines -a claude-code`. Or copy the skill folder (explorations/agent-wiki/skills/agent-wiki-extract-guidelines in AgentToolkit/altk-evolve) into .claude/skills/agent-wiki-extract-guidelines in your project. Claude Code loads it when a task matches its description.

How do I install Agent Wiki Guideline Extractor in Codex?

Run `npx skills add AgentToolkit/altk-evolve --skill agent-wiki-extract-guidelines -a codex`. Or copy the skill folder (explorations/agent-wiki/skills/agent-wiki-extract-guidelines in AgentToolkit/altk-evolve) into .agents/skills/agent-wiki-extract-guidelines in your project. Codex loads it when a task matches its description.

Can I use Agent Wiki Guideline Extractor in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add AgentToolkit/altk-evolve --skill agent-wiki-extract-guidelines -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/agent-wiki-extract-guidelines, .gemini/skills/agent-wiki-extract-guidelines, .github/skills/agent-wiki-extract-guidelines and .opencode/skills/agent-wiki-extract-guidelines in your project.

What does Agent Wiki Guideline Extractor need to run?

Going by SKILL.md and its folder, Agent Wiki Guideline Extractor needs the command-line tools its instructions call (uv). Our summary lists: Normalized trajectory JSON files; A wiki-twobatch/guidelines folder in the project.

Does Agent Wiki Guideline Extractor access the network?

SKILL.md contains no URLs. Its commands use uv, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Agent Wiki Guideline Extractor safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Agent Wiki Guideline Extractor use?

Agent Wiki Guideline Extractor is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Agent Wiki Guideline Extractor use?

About 2k tokens (SKILL.md is roughly 7.9k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Agent Wiki Guideline Extractor?

Skills that share tags, products or a category with Agent Wiki Guideline Extractor: AI Project Memory (tudoumashu/ai-memory-skillpack, 411 stars), Braindb Agent (dimknaf/braindb, 110 stars), LLM Wiki (Yeachan-Heo/oh-my-claudecode, 40k stars) and Swarmvault (swarmclawai/swarmvault, 708 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Agent Wiki Guideline Extractor?

AgentToolkit (a GitHub organization) maintains it in AgentToolkit/altk-evolve, which has 122 GitHub stars. The repository holds 21 skills in this directory. The repository was last updated on October 7, 2026.

Source: AgentToolkit/altk-evolve on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.