Taxonomy Builder
Turn a core paper set into a 2+ level, mappable taxonomy that will drive the outline and paper-to-section mapping.
This is structure, not writing: avoid prose paragraphs and avoid “generic placeholder” buckets.
Role cards (prompt-level guidance)
Taxonomy Architect
- Mission: create a taxonomy that reads like a survey’s core chapters (few, thick buckets).
- Do: choose 3–4 top-level chapters by reader questions and decision-relevant axes.
- Avoid: keyword-only clusters, “Misc/Other”, and too many top-level buckets that would bloat the final ToC.
Mapping Sponsor
- Mission: keep the taxonomy mappable to real papers.
- Do: ensure each leaf can plausibly map to multiple papers (ideally ≥3); keep node names discriminative.
- Avoid: overlapping buckets whose boundaries are not explainable.
Scope Guardian
- Mission: encode what counts as in-scope at the taxonomy level.
- Do: bake boundary cues into descriptions (what belongs here, what does not).
- Avoid: relying on later prose to resolve scope drift.
When to use
- You have a
papers/core_set.csv and need a stable structure for a survey/snapshot.
- You want categories that are meaningful to readers (not just keyword clusters).
When not to use
- You already have an approved taxonomy that maps well to your target narrative (don’t churn it).
Inputs
papers/core_set.csv (required)
- Optional:
papers/papers_dedup.jsonl (to peek at abstracts/metadata)
- Optional:
DECISIONS.md (scope constraints)
Output
Workflow (heuristic)
Uses: papers/papers_dedup.jsonl, DECISIONS.md.
- Skim the core set and cluster by reader-relevant axes, not by surface keywords.
- For LLM agents, common axes: control loop/architecture, tool use, planning & reasoning, memory/RAG, multi-agent coordination, evaluation/benchmarks, safety/security, applications.
- Choose top-level nodes that feel like “chapters in a survey”, and keep a paper-like section budget:
- If you want a paper-like PDF with ~6–8 H2 sections total (see
ref/agent-surveys/STYLE_REPORT.md), remember the pipeline also adds fixed H2 sections (Introduction / Related Work / Discussion / Conclusion).
- In that case, aim for ~3–4 taxonomy-driven chapters (top-level nodes), not 8–12 tiny buckets.
- Deep surveys can go wider (e.g., 5–6 taxonomy chapters), but expect thinner writing unless you also expand evidence and writing budgets.
- For each top-level node, create 2–6 subtopics with clear inclusion cues (what belongs here, what doesn’t).
- Write a short description for every node:
- define what the bucket covers
- name 2–5 representative paper IDs (or recognizable lines of work) that belong here
- Sanity check:
- leaves aren’t too tiny (ideally ≥3 papers per leaf)
- names are mutually exclusive enough (some overlap is OK, confusion is not)
Quality checklist
Common failure modes (and fixes)
- Generic buckets (“Overview/Benchmarks/Open Problems”) → rename to content-based subtopics.
- Keyword clustering → reframe as design/evaluation questions a reader would ask.
- Too much overlap → tighten inclusion cues; split a bucket by mechanism vs evaluation vs safety.
- Too many top-level buckets → merge into fewer, thicker chapters; push fine-grained points into subsection bullets/axes instead of new H2 sections.
Helper script (optional)
Quick Start
python .codex/skills/taxonomy-builder/scripts/run.py --help
python .codex/skills/taxonomy-builder/scripts/run.py --workspace <workspace_dir>
All Options
--top-k <n>: number of candidate terms to consider
--min-freq <n>: minimum frequency threshold
Examples
- Generate a baseline taxonomy (then optionally refine):
python .codex/skills/taxonomy-builder/scripts/run.py --workspace <ws> --top-k 100 --min-freq 2
Notes
- The script generates a baseline 2-level taxonomy (topic-aware) and never overwrites non-placeholder work.
- In
pipeline.py --strict it will be blocked only if placeholder markers (TODO/TBD/FIXME/(placeholder)) remain.
Refinement marker (recommended; completion signal)
When you are satisfied with the taxonomy (and after C2 approval if applicable), create:
outline/taxonomy.refined.ok
This is an explicit "I reviewed/refined this" signal:
- makes it harder for a scaffold-y taxonomy to silently pass in strict runs
- documents that buckets were edited into reader-meaningful, mappable nodes
Troubleshooting
Common Issues
Issue: Quality gate blocks taxonomy_scaffold
Symptom:
output/QUALITY_GATE.md reports taxonomy contains TODO/placeholder text.
Causes:
- Helper script generated a scaffold, but taxonomy was not rewritten.
Solutions:
- Rewrite every node name + description to be domain-meaningful.
- Ensure ≥2 levels via
children.
- Remove generic buckets like “Overview/Benchmarks/Open Problems”.
Issue: Taxonomy has no depth (children missing)
Symptom:
- Quality gate reports “needs ≥2 levels”.
Causes:
- Only top-level nodes were created.
Solutions:
- Add 2–6 child nodes per top-level node, each with clear inclusion cues.
Recovery Checklist
1---2name: taxonomy-builder3description: Build a 2+ level taxonomy (`outline/taxonomy.yml`) from a core paper set and scope constraints, with short descriptions per node. **Trigger**: taxonomy, taxonomy builder, 分类, 主题树, taxonomy.yml. **Use when**: survey/snapshot 的结构阶段(NO PROSE),已有 `papers/core_set.csv`,需要生成可映射且读者友好的主题结构。 **Skip if**: 已经有批准过且可映射的 taxonomy(不要无意义重构)。 **Network**: none. **Guardrail**: 避免泛化占位桶;保持 2+ 层且每节点有具体描述。4---5
6# Taxonomy Builder
7
8Turn a core paper set into a **2+ level, mappable taxonomy** that will drive the outline and paper-to-section mapping.
9
10This is *structure*, not writing: avoid prose paragraphs and avoid “generic placeholder” buckets.
11
12## Role cards (prompt-level guidance)
13
14- **Taxonomy Architect**
15 - Mission: create a taxonomy that reads like a survey’s core chapters (few, thick buckets).
16 - Do: choose 3–4 top-level chapters by reader questions and decision-relevant axes.
17 - Avoid: keyword-only clusters, “Misc/Other”, and too many top-level buckets that would bloat the final ToC.
18
19- **Mapping Sponsor**
20 - Mission: keep the taxonomy mappable to real papers.
21 - Do: ensure each leaf can plausibly map to multiple papers (ideally ≥3); keep node names discriminative.
22 - Avoid: overlapping buckets whose boundaries are not explainable.
23
24- **Scope Guardian**
25 - Mission: encode what counts as in-scope at the taxonomy level.
26 - Do: bake boundary cues into descriptions (what belongs here, what does not).
27 - Avoid: relying on later prose to resolve scope drift.
28
29
30## When to use
31
32- You have a `papers/core_set.csv` and need a stable structure for a survey/snapshot.
33- You want categories that are meaningful to readers (not just keyword clusters).
34
35## When not to use
36
37- You already have an approved taxonomy that maps well to your target narrative (don’t churn it).
38
39## Inputs
40
41- `papers/core_set.csv` (required)
42- Optional: `papers/papers_dedup.jsonl` (to peek at abstracts/metadata)
43- Optional: `DECISIONS.md` (scope constraints)
44
45## Output
46
47- `outline/taxonomy.yml`
48
49## Workflow (heuristic)
50Uses: `papers/papers_dedup.jsonl`, `DECISIONS.md`.
51
52
531. Skim the core set and cluster by **reader-relevant axes**, not by surface keywords.
54 - For LLM agents, common axes: control loop/architecture, tool use, planning & reasoning, memory/RAG, multi-agent coordination, evaluation/benchmarks, safety/security, applications.
552. Choose top-level nodes that feel like “chapters in a survey”, and keep a **paper-like section budget**:
56 - If you want a paper-like PDF with ~6–8 H2 sections total (see `ref/agent-surveys/STYLE_REPORT.md`), remember the pipeline also adds fixed H2 sections (Introduction / Related Work / Discussion / Conclusion).
57 - In that case, aim for **~3–4 taxonomy-driven chapters** (top-level nodes), not 8–12 tiny buckets.
58 - Deep surveys can go wider (e.g., 5–6 taxonomy chapters), but expect thinner writing unless you also expand evidence and writing budgets.
593. For each top-level node, create 2–6 subtopics with **clear inclusion cues** (what belongs here, what doesn’t).
604. Write a short description for every node:
61 - define what the bucket covers
62 - name 2–5 representative paper IDs (or recognizable lines of work) that belong here
635. Sanity check:
64 - leaves aren’t too tiny (ideally ≥3 papers per leaf)
65 - names are mutually exclusive *enough* (some overlap is OK, confusion is not)
66
67## Quality checklist
68
69- [ ] `outline/taxonomy.yml` has ≥2 levels.
70- [ ] Every node has a `description` with concrete meaning (not “Papers and ideas centered on …” boilerplate).
71- [ ] Leaf nodes look mappable (not overly broad like “Misc/Other”).
72- [ ] Top-level nodes feel like chapters (avoid too many tiny buckets if you target a paper-like 6–8 H2 structure).
73
74## Common failure modes (and fixes)
75
76- **Generic buckets** (“Overview/Benchmarks/Open Problems”) → rename to content-based subtopics.
77- **Keyword clustering** → reframe as design/evaluation questions a reader would ask.
78- **Too much overlap** → tighten inclusion cues; split a bucket by mechanism vs evaluation vs safety.
79- **Too many top-level buckets** → merge into fewer, thicker chapters; push fine-grained points into subsection bullets/axes instead of new H2 sections.
80
81## Helper script (optional)
82
83### Quick Start
84
85- `python .codex/skills/taxonomy-builder/scripts/run.py --help`
86- `python .codex/skills/taxonomy-builder/scripts/run.py --workspace <workspace_dir>`
87
88### All Options
89
90- `--top-k <n>`: number of candidate terms to consider
91- `--min-freq <n>`: minimum frequency threshold
92
93### Examples
94
95- Generate a baseline taxonomy (then optionally refine):
96 - `python .codex/skills/taxonomy-builder/scripts/run.py --workspace <ws> --top-k 100 --min-freq 2`
97
98### Notes
99
100- The script generates a baseline 2-level taxonomy (topic-aware) and never overwrites non-placeholder work.
101- In `pipeline.py --strict` it will be blocked only if placeholder markers (TODO/TBD/FIXME/(placeholder)) remain.
102
103### Refinement marker (recommended; completion signal)
104
105When you are satisfied with the taxonomy (and after C2 approval if applicable), create:
106- `outline/taxonomy.refined.ok`
107
108This is an explicit "I reviewed/refined this" signal:
109- makes it harder for a scaffold-y taxonomy to silently pass in strict runs
110- documents that buckets were edited into reader-meaningful, mappable nodes
111
112## Troubleshooting
113
114### Common Issues
115
116#### Issue: Quality gate blocks `taxonomy_scaffold`
117
118**Symptom**:
119- `output/QUALITY_GATE.md` reports taxonomy contains `TODO`/placeholder text.
120
121**Causes**:
122- Helper script generated a scaffold, but taxonomy was not rewritten.
123
124**Solutions**:
125- Rewrite every node name + description to be domain-meaningful.
126- Ensure ≥2 levels via `children`.
127- Remove generic buckets like “Overview/Benchmarks/Open Problems”.
128
129#### Issue: Taxonomy has no depth (`children` missing)
130
131**Symptom**:
132- Quality gate reports “needs ≥2 levels”.
133
134**Causes**:
135- Only top-level nodes were created.
136
137**Solutions**:
138- Add 2–6 child nodes per top-level node, each with clear inclusion cues.
139
140### Recovery Checklist
141
142- [ ] `outline/taxonomy.yml` is valid YAML list.
143- [ ] At least one node has a non-empty `children` list.
144- [ ] No `TODO`/`(placeholder)` remains.