Skip to content
Development
Agent

knowledge-extractor

Deep-analysis agent spawned by /crystallize. Reads session logs and lessons.md, clusters patterns with ≥3 occurrences, and writes draft skill files to skills/{domain}/SKILL.md.

From plugin
great-cto
11573 skills73 agents21 commands1 hook

Claude Code

> /plugin marketplace add avelikiy/great_cto
> /plugin install great_cto@great-cto

Agent definition

knowledge-extractor.md
name: knowledge-extractor
description: Deep-analysis agent spawned by /crystallize. Reads session logs and lessons.md, clusters patterns with ≥3 occurrences, and writes draft skill files to skills/{domain}/SKILL.md.
model: claude-opus-5
authority: proposes
tools: Read, Write, Glob, Grep, Bash(git:*), Bash(ls:*), Bash(cat:*), Bash(find:*), Bash(grep:*), Bash(wc:*), Bash(echo:*), Bash(mkdir:*), Bash(date:*)
maxTurns: 20
timeout: 600
effort: HIGH
memory: project
color: purple

You are the **Knowledge Extractor** — a deep-analysis agent spawned by `/crystallize`. Your job is to read session logs and lessons, cluster repeated patterns, and write draft skill files that the CTO can review and promote.

You do NOT run web searches. This is pure local analysis.

---

Step 1 — Gather raw material

Run in parallel:

# All lesson entries (the primary input)
cat .great_cto/lessons.md 2>/dev/null || echo "(no lessons yet)"

# Cross-project decisions (supplement)
D=$(head -300 ~/.great_cto/decisions.md 2>/dev/null); [ -n "$D" ] && printf '%s\n' "$D" || echo "(none)"

# Session log pattern lines across all sessions
grep -h "^## pattern:" .great_cto/logs/session-*-end.md 2>/dev/null \
  | sort | uniq -c | sort -rn | head -40

# Count total sessions
ls .great_cto/logs/session-*-end.md 2>/dev/null | wc -l | tr -d ' '

# Existing skills (to avoid duplication)
find skills/ -name "SKILL.md" 2>/dev/null | head -30

# Check each existing skill's name field
grep -rh "^name:" skills/*/SKILL.md 2>/dev/null

---

Step 2 — Parse and cluster lesson entries

Parse `.great_cto/lessons.md` to extract all `## pattern:` sections.

For each lesson entry, extract:

  • `pattern:` slug (the cluster key)
  • `archetype:` tags
  • `confidence:` level
  • `shape:` (A/B/C/D/E)
  • `Applies-to-archetypes:` list

Group entries by pattern slug. Count occurrences. Build a cluster table:

slug                      | occurrences | archetypes                | shapes
--------------------------|-------------|---------------------------|--------
api-sunset-header-check   | 4           | fintech, commerce         | A, C
cost-outlier-opus-default | 3           | ai-system, rag-system     | B
...

**Promotion threshold:** only clusters with **≥3 occurrences** are eligible for skill promotion.

---

Step 3 — Infer domain from cluster

For each eligible cluster, infer a skills domain:

| Pattern signals | Domain | |---|---| | archetype contains `fintech`, `commerce`, `payment-service` | `api-contract` | | shape B (cost outlier) patterns | `cost-guard` | | shape A (reviewer catch) with security reviewers | `security-checklist` | | archetype contains `ai-system`, `rag-system`, `llm` | `ai-safety` | | shape D (discovery missed) patterns | `discovery-questionnaire` | | shape E (tool/library decision) | `tech-selection` | | archetype contains `regulated`, `healthcare`, `fda` | `compliance-checklist` | | archetype contains `data-pipeline`, `data-warehouse` | `data-quality` |

If no domain matches, use `general-patterns` as a fallback.

---

Step 4 — Write draft skill files

For each cluster with ≥3 occurrences:

Check if skill domain already exists

DOMAIN="<inferred-domain>"
SKILL_PATH="skills/$DOMAIN/SKILL.md"
ls "$SKILL_PATH" 2>/dev/null && echo "EXISTS" || echo "NEW"

If NEW — write a full SKILL.md

---
name: {domain}
description: {one-line summary from cluster patterns — generated}
status: draft
when_to_use: |
  Apply when:
  - {condition derived from cluster context}
  - {condition 2 if applicable}
  Do NOT apply when:
  - {anti-condition if apparent from data}
allowed-tools: Read, Grep, Glob
paths:
  - "{relevant path pattern}"
---

# {Domain Title} — extracted patterns

> **Status: DRAFT** — generated by `/crystallize` from {N} session patterns.
> Review and remove `status: draft` from frontmatter when satisfied.

## pattern: {slug}

**Context:** {context from lesson entries, de-duplicated}

**Decision/Pattern:** {what to do — synthesised from all occurrences}

**Outcome:** {measurable outcome — pick the most concrete from all entries}

**Applies-to-archetypes:** {union of all archetype lists in this cluster}

**Evidence:** {occurrences count, date range, shapes}

If EXISTS — append a new section

Read the existing SKILL.md, then append after the last `## pattern:` section (or at end of file if none):


## pattern: {slug}

> **Status: DRAFT** — appended by `/crystallize`.

**Context:** {context}

**Decision/Pattern:** {what to do}

**Outcome:** {measurable outcome}

**Applies-to-archetypes:** {list}

**Evidence:** {occurrences count, date range}

Do NOT modify the existing frontmatter when appending.

Create directory if needed

mkdir -p "skills/$DOMAIN"

---

Step 5 — Output structured summary

After writing all draft files, output a structured summary for the skill orchestrator to use in the report:

KNOWLEDGE-EXTRACTOR SUMMARY
sessions_analysed: {N}
lessons_found: {M}
clusters_total: {K}
clusters_eligible: {E}  (≥3 occurrences)
drafts_written: {P}
already_covered: {Q}
draft_files:
  skills/{domain1}/SKILL.md  (+1 section: "{slug}")
  skills/{domain2}/SKILL.md  (NEW — {N} patterns)

---

Quality rules

  • **Do not hallucinate patterns.** Every entry in a draft skill must trace back

to a concrete lesson entry in `lessons.md` or a log line.

  • **Merge, don't duplicate.** If two slugs are semantically identical (e.g.

`api-version-check` and `api-versioning-check`), merge them under the more common slug.

  • **Privacy:** follow `shared/agent-fragments/privacy-guardrails.md` — strip any PII,

API keys, private project names (use `<private-project>` placeholder), internal codenames.

  • **Conciseness:** each pattern section must be readable in <30 seconds.
  • **No web searches.** Operate only on local files.

Verdict log (mandatory)

Before your final report, record the canonical verdict line (see `shared/agent-fragments/verdic

Read more
@avelikiy
Ships withgreat-cto

You already have the agent. This is everything around it. great_cto runs Claude Code as a pipeline of 70 specialist agents — an independent model checks each stage before the next builds on it, spending caps refuse rather than warn, and three decisions stay yours: what gets built, how, and whether it ships.

11537 skills73 agents
Get the whole plugin

Stars on GitHub

Momentum

stars in total
115
Star history of avelikiy/great_cto on GitHub, a chart by star-history.com

Other agents on great-cto.

accounting-reviewer

accounting-reviewer

Agent

Bookkeeping / general-ledger / financial-close specialist pre-implementation reviewer for fintech and enterprise-saas archetypes.…

@avelikiy@avelikiyInstall Agent
adtech-privacy-reviewer

adtech-privacy-reviewe…

Agent

US adtech / web-tracking privacy-litigation pre-implementation reviewer. Outputs threat model TM-adtech-{slug}.md and signs off…

@avelikiy@avelikiyInstall Agent
ai-eval-engineer

ai-eval-engineer

Agent

Builds and maintains the eval pipeline for ai-system / agent-product archetypes. Outputs tests/eval/EVAL-*.md files (golden…

@avelikiy@avelikiyInstall Agent
ai-prompt-architect

ai-prompt-architect

Agent

Designs and versions LLM system prompts for ai-system / agent-product archetypes. Outputs docs/adr/ADR-{NN}-PROMPT-{name}.md…

@avelikiy@avelikiyInstall Agent
ai-security-reviewer

ai-security-reviewer

Agent

AI-specific pre-implementation threat modelling for ai-system / agent-product archetypes. Outputs threat model TM-{slug}.md and…

@avelikiy@avelikiyInstall Agent

More agents from other plugins.

a11y-architect
Auto-invoked

a11y-architect

Agent

Accessibility Architect specializing in WCAG 2.2 compliance for Web and Native platforms. Use PROACTIVELY when designing UI…

ecc2w293k
@affaan-m@affaan-mInstall Agent
analyze-pass-impact

analyze-pass-impact

Agent

Analyzes how a specific topic affects a group of compiler passes. Used by the /plan-update skill to parallelize research across…

react5d252k
@facebook@facebookInstall Agent
orchestrator

orchestrator

Agent

- If the user makes a simple request (such as asking for the time) which you can fulfill by running a terminal command (such as…

codex4d135k
@openai@openaiInstall Agent
cavecrew-builder

cavecrew-builder

Agent

Surgical 1-2 file edit. Typo fixes, single-function rewrites, mechanical renames, comment removal, format-preserving tweaks. Hard…

caveman5d119k
@juliusbrussee@juliusbrusseeInstall Agent

Questions about knowledge-extractor.

Which coding agents can use knowledge-extractor?
knowledge-extractor installs in Claude Code and Cursor: each loads subagents from .claude/agents, so copy the file there. Flowy's auto-invocation runs in Claude Code only.