Skip to content
Development
Skill

/learn

Knowledge compiler. Extracts patterns, decisions, and anti-patterns from completed campaigns and evolve cycles, then compiles them into structured wiki pages that integrate with existing knowledge rather than appending isolated files. Implements flush→compile→lint pipeline.

From plugin
citadel
92748 skills7 agents

Claude Code

$ npx -y skills add SethGammon/Citadel --skill learn --agent claude-code

SKILL.md

learn.SKILL.md
name: learn
license: MIT
description: >-
  Knowledge compiler. Extracts patterns, decisions, and anti-patterns from
  completed campaigns and evolve cycles, then compiles them into structured wiki
  pages that integrate with existing knowledge rather than appending isolated
  files. Implements flush→compile→lint pipeline. Auto-triggered by /postmortem
  and /evolve Phase 6.
user-invocable: true
auto-trigger: false
trigger_keywords:
  - learn
  - extract patterns
  - learn from that
  - save what worked
  - patterns from campaign
last-updated: 2026-05-07

/learn — Knowledge Compiler

Orientation

**Use when:** You have a completed campaign or evolve cycle and want to compile its findings into the project's growing knowledge wiki — so future sessions start smarter, not from scratch.

**Don't use when:** You want a structured incident analysis first (use `/postmortem` — run it before `/learn`); you haven't finished any campaigns (nothing to compile); you want a context transfer only (use `/session-handoff`).

**Key difference from appending:** `/learn` doesn't create isolated per-campaign files. It integrates new findings into existing wiki pages — updating evidence lists, raising confidence where a pattern is confirmed again, and flagging contradictions. A wiki is a compiler; a log is an interpreter.

Invocation Forms

/learn                              — most recently completed campaign
/learn {slug}                       — specific campaign by slug
/learn {file-path}                  — specific campaign file path
/learn --from-evolve {target}       — compile from /evolve pattern library
/learn --from-evolve {target} --cycle {n}  — specific evolve cycle only
/learn --lint                       — lint-only pass (no new extraction)
/learn --compile                    — re-compile staging area into wiki (no new extraction)
/learn --memory                     — compile semantic memory blocks from planning artifacts
/learn --doc-sync                   — process doc-sync queue into .planning/doc-sync/latest.md

Inputs

1. A campaign slug, file path, evolve target, or "most recent" resolution 2. Corresponding postmortem in `.planning/postmortems/` (optional) 3. `.planning/telemetry/audit.jsonl` filtered to this campaign (optional) 4. For `--from-evolve`: `.planning/evolve/{target}/pattern-library.md`

Protocol

Step 1: RESOLVE TARGET

**If `/learn` (no argument):**

  • Glob `.planning/campaigns/completed/*.md` or `.planning/campaigns/*.md`

where `Status: completed`

  • Sort by modification time descending, take most recent
  • If none found: "No completed campaigns found. Run /learn after a campaign completes." Stop.

**If `/learn {slug}`:**

  • Search `.planning/campaigns/` for a file whose name contains `{slug}`
  • Check `.planning/campaigns/completed/` if not found in active
  • If still not found: "No campaign found matching '{slug}'."

**If `/learn --from-evolve {target}`:**

  • Read `.planning/evolve/{target}/pattern-library.md` — this is the source
  • If `--cycle {n}`: filter to sections beginning with `## Cycle {n}` only
  • If file not found: "No evolve pattern library for '{target}'." Stop.

**If `/learn --doc-sync`:** Run:

node hooks_src/doc-sync.js

Then review `.planning/doc-sync/latest.md`. Stop after reporting the queue count, files surfaced, skipped deleted files, and report path. Do not run campaign extraction unless the user separately asks for it.

**If `/learn --lint`, `/learn --compile`, or `/learn --memory`:** Skip to Step 4, 5, or 5.5 respectively.

Step 2: GATHER SOURCES

For campaign-based runs only (skip for `--from-evolve`):

**Campaign file (required):**

  • Full content — direction, phases, Decision Log, circuit breaker activations

**Postmortem (optional):**

  • Search `.planning/postmortems/` for files matching `*{slug}*`
  • If not found: note "Postmortem not found — proceeding without it" and continue

**Audit telemetry (optional):**

  • Read last 200 lines of `.planning/telemetry/audit.jsonl`
  • Filter entries that match the campaign slug or its active period
  • If none: note "No audit telemetry found for this campaign"

Step 3: FLUSH

Extract raw findings and write to staging.

**For campaign sources:**

Extract four categories:

**A. Successful Patterns** — approaches that demonstrably worked (phases completed without rework, postmortem positives, no reverts). Per pattern: `name`, `mechanism` (what caused success), `evidence` (phase/commit/entry), `topic` (infer from subject matter), `applicability`.

**B. Anti-patterns** — what was tried and failed (rework phases, circuit breaker trips, quality gate blocks, reverts). Per pattern: `name`, `what-was-tried`, `failure-mode`, `evidence`, `topic`, `avoidance`.

**C. Key Decisions** — from Decision Log or inferred from phase descriptions. Per decision: `what`, `rationale`, `outcome` (completed or rework).

**D. Quality Rule Candidates** — only generate if: specific regex, applies to a specific file pattern, occurred more than once or was severe. Per candidate: regex, file pattern, trigger message, confidence (`high`/`medium`/`low` — skip `low`).

**For evolve sources:**

Parse the pattern library's sections. For each pattern record:

  • `name`: section heading
  • `mechanism`: "**Mechanism:**" field
  • `delta`: "**Delta:**" field
  • `topic`: infer from "**Axis class:**" (e.g., `orientation_precision` → `skill-orientation`)
  • `applies-to`: "**Applies to:**" field
  • `confidence`: "**Confidence:**" field
  • `evidence`: source file + cycle number

**Staging write:**

Create `.planning/wiki/_staging/` if it does not exist. Write staged findings to `.planning/wiki/_staging/{source-slug}-{timestamp}.jsonl` — one JSON record per finding (newline-delimited).

If zero findings are extractable: write staging file with a single `{"type":"empty","source":"{slug}"}` record and note "Campaign may have been too brief."

Step 4: COMPILE

Integrate staged findings into wiki pages.

Create `.planning/wiki/` if i

Read more
@sethgammon
Ships withcitadel

An open-source operating layer for Claude Code and OpenAI Codex. Citadel routes requests, preserves repository state between sessions, coordinates parallel work, applies repository safeguards, and records evidence and handoffs around the coding agent you

92748 skills7 agents
Get the whole plugin

Stars on GitHub

Momentum

stars in total
927
Star history of SethGammon/Citadel on GitHub, a chart by star-history.com

Other skills on citadel.

architect

architect

Given a PRD, produces an implementation architecture: file tree, component breakdown, data model, and a phased build plan with…

@sethgammon@sethgammonInstall Skill
archon

archon

Autonomous multi-session campaign agent. Decomposes large work into phases, delegates to sub-agents, reviews output, and…

@sethgammon@sethgammonInstall Skill
ascii-diagram

ascii-diagram

Generate perfectly aligned ASCII diagrams — architecture, flow, sequence, box-and-arrow. Uses a programmatic character-grid…

@sethgammon@sethgammonInstall Skill
autopilot

autopilot

Intake-to-delivery pipeline. Processes pending items from .planning/intake/: briefs new ideas, executes approved work through…

@sethgammon@sethgammonInstall Skill
cost

cost

Deep cost exploration and transparency. Shows real token usage, session costs, campaign spend, burn rates, and model breakdown.…

@sethgammon@sethgammonInstall Skill
create-app

create-app

End-to-end app creation from a single description. Five tiers: blank project, guided, templated, fully generated, or feature…

@sethgammon@sethgammonInstall Skill

More skills from other plugins.

brainstorming
Auto-invoked

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…

@obra@obraInstall Skill
ask-matt

ask-matt

Ask which skill or flow fits your situation. A router over the skills in this repo.

skills10d309k
@mattpocock@mattpocockInstall Skill
accessibility
Auto-invoked

accessibility

Design, implement, and audit accessible UI to WCAG 2.2 Level AA across Web, iOS, and Android — semantic ARIA roles and labels,…

ecc11d293k
@affaan-m@affaan-mInstall Skill
compiler-commit

compiler-commit

Use when you want to verify compiler changes and commit with the correct convention. Runs tests, lint, and format, then commits…

react1d252k
@facebook@facebookInstall Skill

Questions about learn.

Which coding agents can use learn?
learn installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.