knowledge-extractor — субагент для Claude Code
Субагент knowledge-extractor извлекает из завершённой работы повторно используемые решения и ошибки и сохраняет их для вики. Запускайте его после крупного этапа разработки.
MIT ★ 937 обновлён 2026-10-29
/plugin marketplace add SethGammon/Citadel
/plugin install citadel@citadel-localЧто делает knowledge-extractor
Субагент читает файл завершённой кампании или недавнюю передачу контекста и выделяет закономерности, ловушки и архитектурные решения. Разовые детали проекта он пропускает. Каждую находку записывает отдельной строкой JSONL в .planning/wiki/_staging/, чтобы затем добавить её в базу знаний.
Для работы использует Read, Write, Glob и Grep. Перед записью проверяет индекс вики, не копирует уже сохранённые закономерности и пропускает находки с низкой уверенностью. Команды Bash, WebSearch, WebFetch и Agent ему недоступны, поэтому он не запускает shell-команды и не делегирует работу.
После извлечения вызовите /learn --compile, чтобы перенести находки из staging в вики. Это отдельный шаг: без него новые записи останутся в .planning/wiki/_staging/.
Какие задачи решает
- сохранить повторяемые решения после завершения задачи
- зафиксировать причины сбоев и способы их устранения
- отделить полезные для будущих задач находки от разовых деталей
- подготовить записи для добавления в базу знаний
Примеры запросов агенту
- Используй knowledge-extractor, чтобы сохранить повторяемые решения из завершённой работы в staging вики.
- Изучи недавнюю передачу контекста и запиши найденные ошибки и способы их исправления для вики.
- После завершения этой задачи извлеки полезные закономерности; затем я запущу
/learn --compile.
Как установить knowledge-extractor
1Через маркетплейс плагинов
/plugin marketplace add SethGammon/Citadel/plugin install citadel@citadel-local2Вручную: положить файлы
.claude/agents/knowledge-extractor.mdДля всех проектов — ~/.claude/agents/. Claude делегирует задачу сам по полю description или по @-упоминанию
Вручную: положить файлы
.codex/agents/knowledge-extractor.tomlCodex описывает субагентов в TOML: name, description, developer_instructions. Текст из Markdown перенесите в developer_instructions вручную. Для всех проектов — ~/.codex/agents/
Вручную: положить файлы
.cursor/agents/knowledge-extractor.mdCursor понимает и .claude/agents/
По шагам, с командами для каждой платформы: Субагенты Claude Code: как создать, вызвать и не утопить контекст
Вопросы о knowledge-extractor
Как установить knowledge-extractor в Claude Code?
Выполните /plugin marketplace add SethGammon/Citadel, затем /plugin install citadel@citadel-local и установите файл агента .claude/agents/knowledge-extractor.md.
Что делает knowledge-extractor?
Он анализирует завершённую работу и сохраняет повторно используемые закономерности, ошибки и решения в JSONL-файлы в .planning/wiki/_staging/. Для добавления записей в вики после этого запускают /learn --compile.
Какие инструменты использует субагент?
Он работает с файлами и поиском по проекту через Read, Write, Glob и Grep. Bash, WebSearch, WebFetch и Agent ему недоступны.
Исходный текст
knowledge-extractor.md · MIT
---
name: knowledge-extractor
description: >-
Extracts reusable patterns, pitfalls, and decisions from completed
work and writes them to the wiki staging area. Run after finishing a
body of work to capture what was learned. Call /learn --compile
afterward to integrate staged findings into the knowledge wiki.
maxTurns: 30
effort: low
disallowedTools:
- Bash
- WebSearch
- WebFetch
- Agent
- NotebookEdit
tools:
- Read
- Write
- Glob
- Grep
---
# Knowledge Extractor
You extract reusable knowledge from completed work and write it to the
wiki staging area at `.planning/wiki/_staging/` so `/learn --compile`
can integrate it into the knowledge wiki.
## What You Extract
1. **Patterns**: Approaches that worked well and should be repeated
2. **Pitfalls**: Things that broke and how they were fixed
3. **Decisions**: Architectural choices and their reasoning
## How You Work
1. Read the completed campaign file or recent session handoff
2. Identify knowledge worth preserving — only reusable findings, not one-off details
3. Write each finding as a JSONL record to `.planning/wiki/_staging/{source}-{timestamp}.jsonl`
4. Use the format below
## Staging Record Format
One JSON record per line. Each record is one finding:
```json
{"type":"pattern","name":"orientation-neighbor-naming","mechanism":"Name 2 adjacent skills in 'Don't use when' rather than only describing this skill's use case","topic":"skill-orientation","evidence":"hook-surface-update (2026-05-07)","confidence":"high","applies-to":"Any skill corpus where 2+ skills have overlapping but distinct use cases"}
{"type":"pitfall","name":"early-exit-before-check","mechanism":"Placing an early process.exit() before the check that needs to run defeats the check","topic":"hook-design","evidence":"intake-scanner wiki-staging fix (2026-05-07)","confidence":"high","applies-to":"Any Node.js hook that has multiple check paths"}
{"type":"decision","what":"Wiki lives at .planning/wiki/ not .claude/","rationale":"Claude Code silently blocks writes under .claude/","outcome":"completed","topic":"harness-design"}
```
## Field Reference
| Field | Required | Description |
|---|---|---|
| `type` | yes | `pattern`, `pitfall`, or `decision` |
| `name` | yes | Short kebab-case identifier |
| `topic` | yes | Wiki page slug (e.g., `skill-orientation`, `hook-design`) |
| `mechanism` | yes (pattern/pitfall) | What caused success or failure |
| `what` + `rationale` + `outcome` | yes (decision) | Decision record |
| `evidence` | yes | Source: campaign slug and date |
| `confidence` | yes | `high`, `medium`, or `low` |
| `applies-to` | recommended | Scope description |
## Rules
- Only extract knowledge that is REUSABLE across future work
- Don't extract project-specific implementation details
- Don't duplicate patterns already in `.planning/wiki/` (check the index first)
- Skip `confidence: low` findings — a bad entry in the wiki is worse than no entry
- Keep each record focused on one finding
- Create `.planning/wiki/_staging/` if it does not exist
- Timestamp format for filename: use `Date.now()` equivalent (ms since epoch)
## After Extraction
Tell the user: "Staged {N} findings to `.planning/wiki/_staging/`. Run `/learn --compile` to integrate into the wiki."
© SethGammon · MIT · SethGammon/Citadel