Skill & Pipeline Standard (Codex CLI + Claude Code)
Core idea: Make pipelines that can "guide humans / guide models"—each skill is a semantic execution unit that knows what to do, how to do it, when it's done, and what NOT to do.
Design Principles
Traditional problem: Research pipelines are either black-box scripts (hard to debug) or loose documentation (requires human judgment at runtime).
Our solution: Skills-first + decomposed pipeline + evidence-first.
Semantic Skills: Each skill is not a function, but a guided execution unit:
inputs / outputs: explicit dependencies and artifacts
acceptance: completion criteria (e.g., "each subsection maps to >=8 papers")
notes: how to do it, edge cases, common mistakes
guardrail: what NOT to do (e.g., NO PROSE in C2-C4)
Decomposed Pipeline: 6 checkpoints (C0→C5), ~40+ atomic units (varies by pipeline; LaTeX adds a few), dependencies explicit in UNITS.csv
Evidence-First: C2-C4 enforce building evidence substrate first, C5 writes prose
Design Goals:
- Reusable: Same skill works across pipelines—no rewriting logic
- Guided: Newcomers/models follow
acceptance + notes—no guessing
- Constrained:
guardrail prevents executors from going off-rails
- Locatable: Failures point to specific skill + artifact—fix and resume
This repo is meant to work well across:
- OpenAI Codex (Codex CLI / IDE)
- Anthropic Claude Code (Claude Code CLI)
The goal is LLM-first semantic work + deterministic helper scripts, with a clear artifact contract (UNITS.csv) and explicit human checkpoints (DECISIONS.md).
0) Activation contract (skills-first UX)
This repo is meant to be driven by natural-language prompts (not “run this python command”).
Authoring rule of thumb:
- A user should be able to say one sentence (e.g., “给我写一个 agent 的 latex-survey”) and the agent can route to a pipeline, create a workspace, and start executing units.
- When you change a pipeline or add new skills, keep the “one-liner” prompts in
README.md and SKILL_INDEX.md up to date.
- Default HITL: keep a single human approval checkpoint for survey-like pipelines (C2: scope+outline). If you add more checkpoints, justify why.
0b) Workspace contract (what must exist)
Workspaces should be auditable and self-contained. Standard artifacts:
STATUS.md: current progress summary
PIPELINE.lock.md: the selected pipeline (single source of truth)
GOAL.md: topic/scope seed (used to draft queries + decisions)
UNITS.csv: execution contract (unit deps + acceptance + status)
CHECKPOINTS.md: checkpoint standards
DECISIONS.md: human sign-offs (checkboxes like Approve C2)
1) Skill bundle contract (Anthropic-style)
Each skill is a folder under .codex/skills/<skill>/ and must include:
SKILL.md (required): YAML front matter + operational instructions
scripts/ (optional): deterministic helpers (scaffold/compile/validate)
references/ (optional): deeper docs, checklists (avoid bloating SKILL.md)
assets/ (optional): templates, schemas, fixtures
Progressive disclosure (recommended)
- YAML front matter: only
name + description (for discovery/routing).
SKILL.md body: the workflow + checklists + guardrails.
- Scripts/resources: loaded only when the workflow calls for them.
Description field (routing-friendly)
To make discovery reliable across tools, prefer a multi-line description with explicit triggers and guardrails:
description: |
<one-line summary>.
**Trigger**: <keywords (EN/中文), comma-separated>.
**Use when**: <when this skill is the right next step>.
**Skip if**: <when not to use>.
**Network**: <none|required|optional + offline fallback>.
**Guardrail**: <NO PROSE / checkpoints / invariants>.
2) Script policy (deterministic helpers only)
Borrowing the best pattern from Anthropic’s skills repos:
- Scripts are treated as black-box helpers.
- Always run scripts with
--help first (do not ingest source unless necessary).
- Scripts should be used for:
- scaffolding (create directories/files/templates)
- validation (format/schema checks)
- compilation (LaTeX build, QA reports)
- deterministic transforms (MD→LaTeX conversion, dedupe/ranking)
Authoring rule (skills-first):
- The primary workflow must be readable and executable from
SKILL.md alone (LLM-first). If a script exists, treat it as optional validation/scaffolding, not the main instruction path.
- Avoid writing skills that require users to run
python .../run.py as step 1; prefer “write/inspect artifacts” first, then offer scripts as an optional deterministic check.
Avoid scripts that “replace” semantic work (taxonomy/outline/notes/writing). If a script exists for those, it must be clearly labeled bootstrap only and the workflow must still require LLM refinement before marking a unit DONE.
2a) Role-based prompting (Anthropic-style, prompt-level guidance)
When a skill is semantic (structure, writing, editing), prefer role cards over “pipeline narration”.
Why:
- Role cards reduce ambiguity (“what am I trying to accomplish?”) without forcing templates (“how do I phrase it?”).
- They make skills composable: each skill owns one cognitive job and hands off a clean artifact.
Core roles (survey pipelines)
- Outline Architect (C2, 规划专家): designs a paper-like ToC (few, thick sections) and ensures every H3 is writeable (has a real comparison lens, not a topic bucket).
- Evidence Curator (C3/C4, 证据策展): turns papers/notes into contrastable evidence (claims, evaluation anchors, limitations) and exposes gaps early (so writing does not become padding).
- Section Author (C5, 小节内容专家): executes argument coverage (thesis + contrasts + protocol/evaluation anchoring + limitations) with in-scope citations; avoids “outline narration” and any fixed paragraph macro.
- Coherence Editor (C5, 章节衔接/结构编辑): connects sections (chapter leads, transitions) and removes generator voice without changing claims/citations.
- Consistency Reviewer (C5, 审稿视角/一致性审计): audits for scope drift, citation hygiene, and claim->evidence plausibility; routes upstream instead of “writing around” missing evidence.
Role card template (recommended in writing/structure skills)
Include a short ## Role cards section with 2–4 roles. Each role should state:
- Mission (one sentence)
- Do (2–4 bullets; concrete actions)
- Avoid (2–4 bullets; high-signal failure smells)
Guideline:
- Role cards should guide decisions and argument moves, not provide reusable sentence templates.
2b) Paper Voice Contract (writing-stage skills)
When a skill writes/edits prose (C5), prefer a "paper voice" contract over brittle style rules:
- No outline narration: avoid
This subsection ..., In this subsection, we ..., Next, we move ... (rewrite as content claims + argument bridges).
- Evidence policy once: keep abstract/fulltext limitations in one short front-matter paragraph; don't repeat "abstract-only" disclaimers in every H3.
- Light signposting: avoid repeating a literal opener label across many subsections (e.g.,
Key takeaway:); vary opener phrasing and cadence.
- No count-based opener slots: avoid repeatedly starting sections with "Two limitations..." / "Three takeaways..." (reads templated); integrate caveats naturally or vary syntax.
- Soft academic tone: calm, understated; avoid hype (
clearly, obviously, breakthrough) and "PPT speaker notes".
- Coherence without rigidity: use connectors (contrast/causal/extension) as needed, but don't force every paragraph to start with
However/Moreover.
- Controlled citation scope: subsection-first by default; allow chapter-scoped reuse; treat bibkeys mapped to >=
queries.md:global_citation_min_subsections subsections (A150++ default 4) as cross-cutting/global (allowed_bibkeys_global) to reduce brittle writer BLOCKED loops.
Generator voice anti-patterns (forbidden)
Planner talk (construction notes leaking into prose):
- ❌ "After X, Y makes the bridge explicit via..."
- ❌ "This paragraph turns the tension into a concrete comparison"
- ❌ "The following subsection synthesizes..."
- ✅ Instead: write the content directly (e.g., "Y addresses X by...")
Template stems (repetitive survey-guidance phrases):
- ❌ "Taken together, these approaches..." (limit ≤2 per draft)
- ❌ "This survey should..." (limit ≤1 per draft)
- ❌ "Two limitations..." / "The key point is that..." as repeated cross-section sentence slots
- ❌ "This run demonstrates..." (avoid entirely)
- ✅ Instead: vary synthesis openers (decision-first, tension-first, evidence-first)
Meta-guidance phrasing (talking about the paper instead of doing research):
- ❌ "We organize this section as follows..."
- ❌ "The remainder of this survey..."
- ❌ "Our contribution is to survey..."
- ✅ Instead: state findings/contrasts directly
Implementation bias:
- Prefer skill guidance + auditor warnings with examples over brittle hard blocks.
- Exception: the
writer-selfloop section gate may treat a few generator-voice patterns as BLOCKING when they
reliably correlate with hollow/templated prose (e.g., narration openers, slide navigation, repeated evidence-policy disclaimers).
The fix is still a semantic rewrite (content claim + argument bridge), not code tweaks.
2c) "NO PROSE" Definition (C2-C4 guardrail)
C2-C4 outputs must be structured, non-narrative to prevent "middle-state leakage" where planning notes accidentally become final prose.
Allowed formats:
- ✅ Bullets, short phrases, JSONL fields, tables, schemas
- ✅ Structured keys (e.g.,
thesis, contrast_hook, paragraph_plan)
- ✅ Citation keys without narrative embedding (e.g.,
[@smith2023] in lists)
Forbidden patterns:
- ❌ Narrative paragraphs or prose sentences
- ❌ Semicolon-enumerated construction notes (e.g., "mechanism; data; evaluation")
- ❌ Meta-phrases about transformation (e.g., "turning X into Y", "bridging A to B")
- ❌ Template phrases (e.g., "Taken together", "This subsection will")
- ❌ Planner talk (e.g., "After establishing X, we move to Y")
18 skills enforce this: subsection-briefs, evidence-draft, evidence-binder, anchor-sheet, writer-context-pack, claim-matrix-rewriter, table-schema, chapter-briefs, transition-weaver (output only), and others in C2-C4.
Rationale: Intermediate artifacts are writing substrate, not drafts. Prose generation happens only in C5 after human approval.
2d) Refinement markers (*.refined.ok)
Some semantic artifacts are often bootstrapped by helper scripts (or generated quickly on first pass). In strict runs, we treat these as scaffolds until an explicit refinement marker exists.
Why:
- Prevents “bootstrap outputs” from silently passing into downstream writing (a major source of hollow/templated prose).
- Creates an auditable, low-friction signal that the artifact was actually reviewed/refined.
- Also doubles as a freeze marker so scripts don’t overwrite refined work.
How:
- After you manually refine an artifact and it passes the skill checklist, create an empty marker file next to it (same folder).
- The strict quality gate blocks until the marker exists (when the pipeline profile is
arxiv-survey*).
Common markers for arxiv-survey*:
outline/subsection_briefs.refined.ok
outline/chapter_briefs.refined.ok
outline/evidence_bindings.refined.ok
outline/evidence_drafts.refined.ok
outline/anchor_sheet.refined.ok
outline/writer_context_packs.refined.ok
Guardrail:
- Do not create a refinement marker until the artifact is subsection-specific (no repeated tensions, no generic axis bundles) and contains no placeholders.
3) Pipeline/Units contract (repo-specific)
Single source of truth
UNITS.csv is the execution contract (one row = one deliverable with acceptance criteria).
pipelines/*.pipeline.md defines the pipeline intent and checkpoints, and points to the concrete templates/UNITS.*.csv.
- If a pipeline doc and its units template diverge, the inconsistency is a bug and must be resolved by syncing them.
Checkpoints & no-prose rule
- Checkpoints are enforced via
DECISIONS.md approvals (- [ ] Approve C*).
- Units with
owner=HUMAN block until the corresponding checkbox is ticked.
- Convention: use
human-checkpoint as the skill for owner=HUMAN units (keeps semantics explicit; no scripts required).
- Prose writing is only allowed after the required approval (survey default:
C2).
Checkpoint approval workflow
DECISIONS.md structure (per checkpoint):
## C2: Structure Approval
**Workspace**: `<current-workspace-name>`
**Artifacts to review**: outline/outline.yml, outline/mapping.tsv, outline/coverage_report.md
- [ ] Approve C2 (outline scope + H2/H3 structure + paper coverage)
Self-check requirement: Each checkpoint block must show the current workspace path to prevent stale approvals.
Approval semantics:
- Unchecked (
- [ ]): blocks all downstream units with owner=HUMAN dependency
- Checked (
- [x]): unblocks C5 prose writing (for C2) or downstream stages
4) “LLM-first” execution model (recommended)
For semantic units:
- Follow the referenced skill’s
Procedure and write the listed outputs directly.
- Only mark
DONE when acceptance criteria are satisfied and outputs exist.
- If you use helper scripts to scaffold, treat the outputs as starting points, not final.
For deterministic units (retrieval/dedupe/compile/format checks):
- Use scripts under the skill’s
scripts/ folder.
5) Quality Gate Standards (pipeline-auditor)
Deterministic checks (all must pass for PASS status):
| Check |
Threshold |
Rationale |
| Placeholder leakage |
0 occurrences |
No ..., TODO, [placeholder], <...> in final draft |
| Outline alignment |
Exact match |
H3 count/order must match outline/outline.yml |
| Template phrase repetition |
"Taken together" ≤2, "survey should" ≤1 |
Avoid survey-guidance stems |
| Evidence-policy disclaimer spam |
≤1 paragraph |
State abstract/fulltext limitations once in front matter |
| Pipeline voice leakage |
0 occurrences |
No "This run", "This pipeline", "This workspace" |
| Synthesis stem repetition |
Varied openers |
No more than 2 H3s starting with same synthesis pattern |
| Meta survey-guidance phrasing |
0 occurrences |
No "We organize this section as", "The remainder of" |
| Numeric claim context |
≥80% coverage |
Claims with numbers must include task/metric/constraint context |
| Citation health |
0 undefined/duplicate keys |
All [@key] must exist in citations/ref.bib |
| Evidence binding compliance |
100% in-scope |
Citations must stay within outline/evidence_bindings.jsonl allowed set |
Report-class skills contract:
6) JSONL Interface Schema (cross-skill contracts)
Survey pipelines treat outline/outline.yml as the ID source of truth. All C2-C4 JSONL artifacts should use those ids directly so downstream skills do not rely on best-effort joins.
If you have legacy artifacts (mixed field names / @BibKey prefixes), run schema-normalizer (NO PROSE) to normalize in-place and write output/SCHEMA_NORMALIZATION_REPORT.md.
Standardized field names (recommended minimum):
| Field |
Type |
Required |
Format |
Used by |
section_id |
string |
Yes (H2-level) |
from outline/outline.yml (e.g., "3") |
chapter-briefs, writer-context-pack, section leads |
sub_id |
string |
Yes (H3-level) |
from outline/outline.yml (e.g., "3.1") |
subsection-briefs, evidence-* , writer-context-pack |
section_title |
string |
Yes when section_id present |
from outline/outline.yml |
most outline/evidence/writing artifacts |
title |
string |
Yes when sub_id present |
from outline/outline.yml |
most outline/evidence/writing artifacts |
citations |
array |
Optional |
["smith2023", "jones2024"] (raw bibkeys; no @) |
evidence-draft, anchor-sheet, writer-context-pack |
evidence_ids |
array |
Optional |
["E-P0001-…", "E-P0042-…"] |
evidence-binder, evidence-draft |
paper_id |
string |
Yes (paper-level) |
stable id from papers/core_set.csv (e.g., P0042) |
paper-notes, section-mapper |
Citation key format:
- In JSONL:
"citations": ["smith2023"] (no @ prefix)
- In Markdown:
[@smith2023] (with @ prefix)
- In BibTeX:
@article{smith2023, ...} (entry key)
Required vs optional fields per artifact type (survey pipeline):
- Briefs (
outline/subsection_briefs.jsonl): sub_id, title, section_id, section_title, rq, thesis, axes, paragraph_plan.
- Chapter briefs (
outline/chapter_briefs.jsonl): section_id, section_title, subsections[] (sub_id, title), throughline, lead_paragraph_plan.
- Evidence bindings (
outline/evidence_bindings.jsonl): sub_id, title, plus bibkeys/mapped_bibkeys (raw keys), evidence_ids.
- Evidence packs (
outline/evidence_drafts.jsonl): sub_id, title (and section_id/section_title recommended); nested blocks should use raw citations.
- Anchor sheet (
outline/anchor_sheet.jsonl): sub_id, title (and section_id/section_title recommended); anchors carry raw citations.
- Writer context packs (
outline/writer_context_packs.jsonl): sub_id, title, section_id, section_title; allowed_bibkeys_*; trimmed anchors/comparisons/limitations carry raw citations.
7) Minimal authoring checklist
New skill
New pipeline
8) Cross-tool compatibility (.claude + .codex)
Codex discovers skills under .codex/skills/. For Claude Code, keep .claude/skills/ pointing at the same set (symlink or copy).
Repo helper: python scripts/validate_repo.py checks pipeline↔template↔skill alignment.
9) Offline-first conventions (optional)
When network is unreliable/unavailable, prefer “record now, verify later” and keep the run auditable:
- Citations:
citations/verified.jsonl may include verification_status=offline_generated (recorded but not yet verified). Later, rerun citation-verifier online to upgrade to verified.
- Fulltext: default surveys can run with
queries.md evidence_mode: abstract. If you need fulltext, put PDFs under papers/pdfs/ and run pdf-text-extractor with --local-pdfs-only.
1---2name: 2478-skills-standard-dea829383description: Skill & Pipeline Standard (Codex CLI + Claude Code)4---5# Skill & Pipeline Standard (Codex CLI + Claude Code)67> **Core idea**: Make pipelines that can "guide humans / guide models"—each skill is a **semantic execution unit** that knows what to do, how to do it, when it's done, and what NOT to do.89---1011## Design Principles1213**Traditional problem**: Research pipelines are either black-box scripts (hard to debug) or loose documentation (requires human judgment at runtime).1415**Our solution**: **Skills-first + decomposed pipeline + evidence-first**.16171. **Semantic Skills**: Each skill is not a function, but a **guided execution unit**:18 - `inputs / outputs`: explicit dependencies and artifacts19 - `acceptance`: completion criteria (e.g., "each subsection maps to >=8 papers")20 - `notes`: how to do it, edge cases, common mistakes21 - `guardrail`: what NOT to do (e.g., **NO PROSE** in C2-C4)22232. **Decomposed Pipeline**: 6 checkpoints (C0→C5), ~40+ atomic units (varies by pipeline; LaTeX adds a few), dependencies explicit in `UNITS.csv`243. **Evidence-First**: C2-C4 enforce building evidence substrate first, C5 writes prose2526**Design Goals**:27- **Reusable**: Same skill works across pipelines—no rewriting logic28- **Guided**: Newcomers/models follow `acceptance` + `notes`—no guessing29- **Constrained**: `guardrail` prevents executors from going off-rails30- **Locatable**: Failures point to specific skill + artifact—fix and resume3132---3334This repo is meant to work well across:35- OpenAI Codex (Codex CLI / IDE)36- Anthropic Claude Code (Claude Code CLI)3738The goal is **LLM-first semantic work + deterministic helper scripts**, with a clear artifact contract (`UNITS.csv`) and explicit human checkpoints (`DECISIONS.md`).3940## 0) Activation contract (skills-first UX)4142This repo is meant to be driven by **natural-language prompts** (not “run this python command”).4344Authoring rule of thumb:45- A user should be able to say one sentence (e.g., “给我写一个 agent 的 latex-survey”) and the agent can route to a pipeline, create a workspace, and start executing units.46- When you change a pipeline or add new skills, keep the “one-liner” prompts in `README.md` and `SKILL_INDEX.md` up to date.47- Default HITL: keep a single human approval checkpoint for survey-like pipelines (C2: scope+outline). If you add more checkpoints, justify why.4849## 0b) Workspace contract (what must exist)5051Workspaces should be auditable and self-contained. Standard artifacts:52- `STATUS.md`: current progress summary53- `PIPELINE.lock.md`: the selected pipeline (single source of truth)54- `GOAL.md`: topic/scope seed (used to draft queries + decisions)55- `UNITS.csv`: execution contract (unit deps + acceptance + status)56- `CHECKPOINTS.md`: checkpoint standards57- `DECISIONS.md`: human sign-offs (checkboxes like `Approve C2`)5859## 1) Skill bundle contract (Anthropic-style)6061Each skill is a folder under `.codex/skills/<skill>/` and must include:62- `SKILL.md` (required): YAML front matter + operational instructions63- `scripts/` (optional): deterministic helpers (scaffold/compile/validate)64- `references/` (optional): deeper docs, checklists (avoid bloating `SKILL.md`)65- `assets/` (optional): templates, schemas, fixtures6667### Progressive disclosure (recommended)68691. **YAML front matter**: only `name` + `description` (for discovery/routing).702. **`SKILL.md` body**: the workflow + checklists + guardrails.713. **Scripts/resources**: loaded only when the workflow calls for them.7273### Description field (routing-friendly)7475To make discovery reliable across tools, prefer a multi-line `description` with explicit triggers and guardrails:7677```yaml78description: |79 <one-line summary>.80 **Trigger**: <keywords (EN/中文), comma-separated>.81 **Use when**: <when this skill is the right next step>.82 **Skip if**: <when not to use>.83 **Network**: <none|required|optional + offline fallback>.84 **Guardrail**: <NO PROSE / checkpoints / invariants>.85```8687## 2) Script policy (deterministic helpers only)8889Borrowing the best pattern from Anthropic’s `skills` repos:90- Scripts are treated as **black-box helpers**.91- Always run scripts with `--help` first (do not ingest source unless necessary).92- Scripts should be used for:93 - scaffolding (create directories/files/templates)94 - validation (format/schema checks)95 - compilation (LaTeX build, QA reports)96 - deterministic transforms (MD→LaTeX conversion, dedupe/ranking)9798Authoring rule (skills-first):99- The primary workflow must be readable and executable from `SKILL.md` alone (LLM-first). If a script exists, treat it as **optional validation/scaffolding**, not the main instruction path.100- Avoid writing skills that *require* users to run `python .../run.py` as step 1; prefer “write/inspect artifacts” first, then offer scripts as an optional deterministic check.101102**Avoid** scripts that “replace” semantic work (taxonomy/outline/notes/writing). If a script exists for those, it must be clearly labeled **bootstrap only** and the workflow must still require LLM refinement before marking a unit `DONE`.103104## 2a) Role-based prompting (Anthropic-style, prompt-level guidance)105106When a skill is semantic (structure, writing, editing), prefer **role cards** over “pipeline narration”.107108Why:109- Role cards reduce ambiguity (“what am I trying to accomplish?”) without forcing templates (“how do I phrase it?”).110- They make skills composable: each skill owns one cognitive job and hands off a clean artifact.111112### Core roles (survey pipelines)113114- **Outline Architect** (C2, 规划专家): designs a paper-like ToC (few, thick sections) and ensures every H3 is *writeable* (has a real comparison lens, not a topic bucket).115- **Evidence Curator** (C3/C4, 证据策展): turns papers/notes into *contrastable evidence* (claims, evaluation anchors, limitations) and exposes gaps early (so writing does not become padding).116- **Section Author** (C5, 小节内容专家): executes argument coverage (thesis + contrasts + protocol/evaluation anchoring + limitations) with in-scope citations; avoids “outline narration” and any fixed paragraph macro.117- **Coherence Editor** (C5, 章节衔接/结构编辑): connects sections (chapter leads, transitions) and removes generator voice without changing claims/citations.118- **Consistency Reviewer** (C5, 审稿视角/一致性审计): audits for scope drift, citation hygiene, and claim->evidence plausibility; routes upstream instead of “writing around” missing evidence.119120### Role card template (recommended in writing/structure skills)121122Include a short `## Role cards` section with 2–4 roles. Each role should state:123- Mission (one sentence)124- Do (2–4 bullets; concrete actions)125- Avoid (2–4 bullets; high-signal failure smells)126127Guideline:128- Role cards should guide *decisions* and *argument moves*, not provide reusable sentence templates.129130## 2b) Paper Voice Contract (writing-stage skills)131132When a skill writes/edits prose (C5), prefer a "paper voice" contract over brittle style rules:133134- **No outline narration**: avoid `This subsection ...`, `In this subsection, we ...`, `Next, we move ...` (rewrite as content claims + argument bridges).135- **Evidence policy once**: keep abstract/fulltext limitations in one short front-matter paragraph; don't repeat "abstract-only" disclaimers in every H3.136- **Light signposting**: avoid repeating a literal opener label across many subsections (e.g., `Key takeaway:`); vary opener phrasing and cadence.137- **No count-based opener slots**: avoid repeatedly starting sections with "Two limitations..." / "Three takeaways..." (reads templated); integrate caveats naturally or vary syntax.138- **Soft academic tone**: calm, understated; avoid hype (`clearly`, `obviously`, `breakthrough`) and "PPT speaker notes".139- **Coherence without rigidity**: use connectors (contrast/causal/extension) as needed, but don't force every paragraph to start with `However/Moreover`.140- **Controlled citation scope**: subsection-first by default; allow chapter-scoped reuse; treat bibkeys mapped to >= `queries.md:global_citation_min_subsections` subsections (A150++ default 4) as cross-cutting/global (`allowed_bibkeys_global`) to reduce brittle writer BLOCKED loops.141142### Generator voice anti-patterns (forbidden)143144**Planner talk** (construction notes leaking into prose):145- ❌ "After X, Y makes the bridge explicit via..."146- ❌ "This paragraph turns the tension into a concrete comparison"147- ❌ "The following subsection synthesizes..."148- ✅ Instead: write the content directly (e.g., "Y addresses X by...")149150**Template stems** (repetitive survey-guidance phrases):151- ❌ "Taken together, these approaches..." (limit ≤2 per draft)152- ❌ "This survey should..." (limit ≤1 per draft)153- ❌ "Two limitations..." / "The key point is that..." as repeated cross-section sentence slots154- ❌ "This run demonstrates..." (avoid entirely)155- ✅ Instead: vary synthesis openers (decision-first, tension-first, evidence-first)156157**Meta-guidance phrasing** (talking about the paper instead of doing research):158- ❌ "We organize this section as follows..."159- ❌ "The remainder of this survey..."160- ❌ "Our contribution is to survey..."161- ✅ Instead: state findings/contrasts directly162163Implementation bias:164- Prefer **skill guidance + auditor warnings with examples** over brittle hard blocks.165- Exception: the `writer-selfloop` section gate may treat a few generator-voice patterns as **BLOCKING** when they166 reliably correlate with hollow/templated prose (e.g., narration openers, slide navigation, repeated evidence-policy disclaimers).167 The fix is still a semantic rewrite (content claim + argument bridge), not code tweaks.168169## 2c) "NO PROSE" Definition (C2-C4 guardrail)170171C2-C4 outputs must be **structured, non-narrative** to prevent "middle-state leakage" where planning notes accidentally become final prose.172173**Allowed formats:**174- ✅ Bullets, short phrases, JSONL fields, tables, schemas175- ✅ Structured keys (e.g., `thesis`, `contrast_hook`, `paragraph_plan`)176- ✅ Citation keys without narrative embedding (e.g., `[@smith2023]` in lists)177178**Forbidden patterns:**179- ❌ Narrative paragraphs or prose sentences180- ❌ Semicolon-enumerated construction notes (e.g., "mechanism; data; evaluation")181- ❌ Meta-phrases about transformation (e.g., "turning X into Y", "bridging A to B")182- ❌ Template phrases (e.g., "Taken together", "This subsection will")183- ❌ Planner talk (e.g., "After establishing X, we move to Y")184185**18 skills enforce this**: subsection-briefs, evidence-draft, evidence-binder, anchor-sheet, writer-context-pack, claim-matrix-rewriter, table-schema, chapter-briefs, transition-weaver (output only), and others in C2-C4.186187**Rationale**: Intermediate artifacts are **writing substrate**, not drafts. Prose generation happens only in C5 after human approval.188189## 2d) Refinement markers (`*.refined.ok`)190191Some semantic artifacts are often *bootstrapped* by helper scripts (or generated quickly on first pass). In strict runs, we treat these as **scaffolds** until an explicit refinement marker exists.192193Why:194- Prevents “bootstrap outputs” from silently passing into downstream writing (a major source of hollow/templated prose).195- Creates an auditable, low-friction signal that the artifact was actually reviewed/refined.196- Also doubles as a freeze marker so scripts don’t overwrite refined work.197198How:199- After you manually refine an artifact and it passes the skill checklist, create an empty marker file next to it (same folder).200- The strict quality gate blocks until the marker exists (when the pipeline profile is `arxiv-survey*`).201202Common markers for `arxiv-survey*`:203- `outline/subsection_briefs.refined.ok`204- `outline/chapter_briefs.refined.ok`205- `outline/evidence_bindings.refined.ok`206- `outline/evidence_drafts.refined.ok`207- `outline/anchor_sheet.refined.ok`208- `outline/writer_context_packs.refined.ok`209210Guardrail:211- Do not create a refinement marker until the artifact is subsection-specific (no repeated tensions, no generic axis bundles) and contains no placeholders.212213## 3) Pipeline/Units contract (repo-specific)214215### Single source of truth216217- `UNITS.csv` is the execution contract (one row = one deliverable with acceptance criteria).218- `pipelines/*.pipeline.md` defines the pipeline intent and checkpoints, and points to the concrete `templates/UNITS.*.csv`.219- If a pipeline doc and its units template diverge, **the inconsistency is a bug** and must be resolved by syncing them.220221### Checkpoints & no-prose rule222223- Checkpoints are enforced via `DECISIONS.md` approvals (`- [ ] Approve C*`).224- Units with `owner=HUMAN` block until the corresponding checkbox is ticked.225- Convention: use `human-checkpoint` as the `skill` for `owner=HUMAN` units (keeps semantics explicit; no scripts required).226- Prose writing is only allowed after the required approval (survey default: `C2`).227228### Checkpoint approval workflow229230**DECISIONS.md structure** (per checkpoint):231```markdown232## C2: Structure Approval233234**Workspace**: `<current-workspace-name>`235**Artifacts to review**: outline/outline.yml, outline/mapping.tsv, outline/coverage_report.md236237- [ ] Approve C2 (outline scope + H2/H3 structure + paper coverage)238```239240**Self-check requirement**: Each checkpoint block must show the current workspace path to prevent stale approvals.241242**Approval semantics**:243- Unchecked (`- [ ]`): blocks all downstream units with `owner=HUMAN` dependency244- Checked (`- [x]`): unblocks C5 prose writing (for C2) or downstream stages245246## 4) “LLM-first” execution model (recommended)247248For semantic units:249- Follow the referenced skill’s `Procedure` and write the listed outputs directly.250- Only mark `DONE` when acceptance criteria are satisfied and outputs exist.251- If you use helper scripts to scaffold, treat the outputs as **starting points**, not final.252253For deterministic units (retrieval/dedupe/compile/format checks):254- Use scripts under the skill’s `scripts/` folder.255256## 5) Quality Gate Standards (pipeline-auditor)257258**Deterministic checks** (all must pass for PASS status):259260| Check | Threshold | Rationale |261|-------|-----------|-----------|262| Placeholder leakage | 0 occurrences | No `...`, `TODO`, `[placeholder]`, `<...>` in final draft |263| Outline alignment | Exact match | H3 count/order must match `outline/outline.yml` |264| Template phrase repetition | "Taken together" ≤2, "survey should" ≤1 | Avoid survey-guidance stems |265| Evidence-policy disclaimer spam | ≤1 paragraph | State abstract/fulltext limitations once in front matter |266| Pipeline voice leakage | 0 occurrences | No "This run", "This pipeline", "This workspace" |267| Synthesis stem repetition | Varied openers | No more than 2 H3s starting with same synthesis pattern |268| Meta survey-guidance phrasing | 0 occurrences | No "We organize this section as", "The remainder of" |269| Numeric claim context | ≥80% coverage | Claims with numbers must include task/metric/constraint context |270| Citation health | 0 undefined/duplicate keys | All `[@key]` must exist in `citations/ref.bib` |271| Evidence binding compliance | 100% in-scope | Citations must stay within `outline/evidence_bindings.jsonl` allowed set |272273**Report-class skills contract**:274- All report skills (evidence-selfloop, writer-selfloop, argument-selfloop, section-logic-polisher, global-reviewer, pipeline-auditor, artifact-contract-auditor, latex-compile-qa) **must write output regardless of PASS/FAIL**.275- Self-loop reports are the *gate interface* (the agent should treat them as “fix plan + unblock signal”):276 - `evidence-selfloop` → `output/EVIDENCE_SELFLOOP_TODO.md`277 - `writer-selfloop` → `output/WRITER_SELFLOOP_TODO.md`278 - `argument-selfloop` → `output/ARGUMENT_SELFLOOP_TODO.md` (and its intermediate ledgers: `output/SECTION_ARGUMENT_SUMMARIES.jsonl`, `output/ARGUMENT_SKELETON.md`)279 - `deliverable-selfloop` → `output/DELIVERABLE_SELFLOOP_TODO.md` (for non-survey deliverables: snapshot/tutorial/synthesis/review)280 In all of them, `- Status: PASS` is the only unblock signal.281- Standard report structure:282 ```markdown283 - Status: PASS | FAIL284285 ## Summary286 <one-line verdict>287288 ## Warnings289 <actionable issues with line numbers/examples>290291 ## Details292 <per-check breakdown>293 ```294- Rationale: Self-healing loop requires failure information to be persisted (see RC2 in PIPELINE_DIAGNOSIS_AND_IMPROVEMENT.md).295296## 6) JSONL Interface Schema (cross-skill contracts)297298Survey pipelines treat `outline/outline.yml` as the ID source of truth. All C2-C4 JSONL artifacts should use those ids directly so downstream skills do not rely on best-effort joins.299300If you have legacy artifacts (mixed field names / `@BibKey` prefixes), run `schema-normalizer` (NO PROSE) to normalize in-place and write `output/SCHEMA_NORMALIZATION_REPORT.md`.301302**Standardized field names** (recommended minimum):303304| Field | Type | Required | Format | Used by |305|-------|------|----------|--------|---------|306| `section_id` | string | Yes (H2-level) | from `outline/outline.yml` (e.g., `"3"`) | chapter-briefs, writer-context-pack, section leads |307| `sub_id` | string | Yes (H3-level) | from `outline/outline.yml` (e.g., `"3.1"`) | subsection-briefs, evidence-* , writer-context-pack |308| `section_title` | string | Yes when `section_id` present | from `outline/outline.yml` | most outline/evidence/writing artifacts |309| `title` | string | Yes when `sub_id` present | from `outline/outline.yml` | most outline/evidence/writing artifacts |310| `citations` | array | Optional | `["smith2023", "jones2024"]` (raw bibkeys; no `@`) | evidence-draft, anchor-sheet, writer-context-pack |311| `evidence_ids` | array | Optional | `["E-P0001-…", "E-P0042-…"]` | evidence-binder, evidence-draft |312| `paper_id` | string | Yes (paper-level) | stable id from `papers/core_set.csv` (e.g., `P0042`) | paper-notes, section-mapper |313314**Citation key format**:315- In JSONL: `"citations": ["smith2023"]` (no `@` prefix)316- In Markdown: `[@smith2023]` (with `@` prefix)317- In BibTeX: `@article{smith2023, ...}` (entry key)318319**Required vs optional fields per artifact type** (survey pipeline):320- Briefs (`outline/subsection_briefs.jsonl`): `sub_id`, `title`, `section_id`, `section_title`, `rq`, `thesis`, `axes`, `paragraph_plan`.321- Chapter briefs (`outline/chapter_briefs.jsonl`): `section_id`, `section_title`, `subsections[]` (`sub_id`, `title`), `throughline`, `lead_paragraph_plan`.322- Evidence bindings (`outline/evidence_bindings.jsonl`): `sub_id`, `title`, plus `bibkeys`/`mapped_bibkeys` (raw keys), `evidence_ids`.323- Evidence packs (`outline/evidence_drafts.jsonl`): `sub_id`, `title` (and `section_id/section_title` recommended); nested blocks should use raw `citations`.324- Anchor sheet (`outline/anchor_sheet.jsonl`): `sub_id`, `title` (and `section_id/section_title` recommended); anchors carry raw `citations`.325- Writer context packs (`outline/writer_context_packs.jsonl`): `sub_id`, `title`, `section_id`, `section_title`; `allowed_bibkeys_*`; trimmed anchors/comparisons/limitations carry raw `citations`.326327328## 7) Minimal authoring checklist329330### New skill331332- [ ] Has `SKILL.md` with `name` + `description`.333- [ ] Declares clear **Inputs / Outputs** and **Acceptance criteria**.334- [ ] If scripts exist: they are deterministic and safe; `SKILL.md` explains when to use them.335- [ ] If outputs JSONL: follows standardized field names from section 6.336337### New pipeline338339- [ ] `pipelines/<name>.pipeline.md` has YAML front matter with `units_template`.340- [ ] Every `required_skills` listed in the pipeline appears in the units template CSV.341- [ ] Units template references only existing skill folders.342- [ ] All `target_artifacts` are produced by at least one unit (no orphaned declarations).343344## 8) Cross-tool compatibility (.claude + .codex)345346Codex discovers skills under `.codex/skills/`. For Claude Code, keep `.claude/skills/` pointing at the same set (symlink or copy).347348Repo helper: `python scripts/validate_repo.py` checks pipeline↔template↔skill alignment.349350## 9) Offline-first conventions (optional)351352When network is unreliable/unavailable, prefer “record now, verify later” and keep the run auditable:353- Citations: `citations/verified.jsonl` may include `verification_status=offline_generated` (recorded but not yet verified). Later, rerun `citation-verifier` online to upgrade to verified.354- Fulltext: default surveys can run with `queries.md` `evidence_mode: abstract`. If you need fulltext, put PDFs under `papers/pdfs/` and run `pdf-text-extractor` with `--local-pdfs-only`.