section-drafter
Dispatches N writer agents in parallel, one per H2 section, each receiving an isolated context with section spec + style references + research brief slice. Writes each section to workspace/{task}/sections/{N}.json conforming to section.schema.json. Critical Build phase step. Use after outline-architect produces outline.json.
XuanRanL · 已有静态检查记录
安装与使用
运行命令前先阅读来源与依赖说明。复制命令不会自动安装或执行。
npx skills add XuanRanL/loamwright-SEO-Skill --skill section-drafter技能说明
name: section-drafter description: Dispatches N writer agents in parallel, one per H2 section, each receiving an isolated context with section spec + style references + research brief slice. Writes each section to workspace/{task}/sections/{N}.json conforming to section.schema.json. Critical Build phase step. Use after outline-architect produces outline.json. allowed-tools: [Read, Write, Task]
Section Drafter (Parallel Dispatcher)
This skill is a dispatcher, not a writer. It spawns N parallel writer agents (one per H2), each writing one section in isolation, then collects results.
References section is NOT dispatched (ownership contract, 2026-07-07)
The outline's final ## References section gets no writer: the fact-checker
builds its content (citations.json) and finalize-references-signature renders it.
Do NOT spawn a writer for it and do NOT hand-create a sections/NN_references.md
placeholder — assemble.py auto-appends the ## References stub when no section
file supplies one, and section_completeness_check exempts the References outline
entry (reported in exempt_indices[]). Before 2026-07-07 every batch operator had
to rediscover the hand-made placeholder just to pass the completeness gate.
Inputs
outline.json(N sections to write)angle.json(title, hook, format_id, modifiers)research.json(overall research)research-brief.json(filtered quotes & stats, per H2) — OPTIONAL: produced only by an out-of-band head-of-research run; the normal runner flow has writers reading research.json directly (wiring status documented 2026-07-06 in agents/head-of-research.md)projects/{slug}/brand-voice.mdORbrand-config.json.voice_pair
Output
workspace/{task_id}/sections/{NN}_{slug}.md — one file per non-References
outline section, where NN = the zero-padded ZERO-BASED outline index
(outline index 0 → 00_...; section_completeness_check diffs the numeric
prefixes against outline.sections[].index verbatim — a 1-based prefix reads
as "section 0 missing + phantom section N" and fails the gate; 2026-07-19).
Legacy JSON form sections/{0..N-1}.json per schemas/section.schema.json
is still accepted by assemble.py.
Writers emit PLAIN headings (## Title, never ## Title {#anchor}): the
anchor_id in each dispatched section_spec is assembly metadata — assembly
computes canonical anchors from heading text, and a writer-copied anchor
desynchronized the TOC + duplicated the Conclusion on 2026-07-19 (both now
machine-corrected in anchor_link_builder/assemble, but the contract stands).
Parallel dispatch pattern
tasks = []
for section in outline.sections:
# Slice research relevant to this H2
research_slice = filter_research_for_section(research_brief, section.h2, section.section_intent)
# Context summary of OTHER sections (≤800 words; not full draft)
context_summary = summarize_others(outline.sections, exclude_index=section.index, max_words=800)
tasks.append({
"subagent_type": "writer",
# section_spec.anchor_id is ASSEMBLY metadata — tell the writer to
# ignore it for heading text (plain `## H2`, no {#anchor}); see Output.
"section_spec": section,
"context_summary": context_summary,
"title": angle.title,
"hook": angle.hook,
"format_id": angle.format_id,
"modifiers": angle.modifiers,
"primary_keyword": brief.primary_keyword,
"secondary_keywords": brief.secondary_keywords,
"research_brief_relevant_section": research_slice,
"quotes_and_stats_bank": filter_bank(research_brief, section),
"voice_pair": brand.voice_default.pair,
# v5.1 image-slot wiring (audit 2026-05-25 — writers omit or rename
# [IMAGE-SLOT-X] placeholders when they don't receive slot_id names).
# Load image-prompts.json and match slot_id to section by outline
# image_slots[].position or by sections[].image_slot boolean order.
# Writer receives the EXACT slot_id string to embed; no guessing.
"image_slot_info": _match_image_slot_to_section(
outline.get("image_slots", []),
image_prompts, # loaded from workspace image-prompts.json
section,
),
# Returns None when this section has no allocated image, or:
# {"slot_id": "hps-vs-led", "position": "in_section_4",
# "description": "Side-by-side HPS vs LED...", "is_featured": false}
# Writer MUST embed [IMAGE-SLOT-{slot_id}] at the indicated position.
# v5.0 Stage C wiring (audit 2026-05-22 found this was missing — writers
# produce generic content even when seo-blog detected local_mode=true).
# ALL four fields below MUST be passed; agents/writer.md expects them.
"local_mode": brief.get("local_mode", False),
"location_anchor": brief.get("location_anchor"), # null when local_mode=false
"locality_signals_required": (
6 if brief.get("local_mode")
and section.get("block_type") == "unique_per_locality"
else 0
),
"local_article_pattern": (
(business_context or {}).get("location", {}).get("local_article_pattern")
if brief.get("local_mode") else None
),
# v3.36.0 company-facts wiring (audit 2026-07-06 — three writers/optimizers
# invented the agency's OWN tenure in one batch because nothing supplied the
# real numbers). Writers may state company self-facts (tenure / team size /
# clients served) ONLY from this block; the deterministic brand-fact-check
# stage hard-fails contradictions against business-context.company.
# v3.38.3: the same block gates EXPERIENCE ANECDOTES — a writer may narrate
# a first-person event ("we printed N units for a client in Q1") ONLY when
# that experience exists here or in the research brief; a fabricated
# anecdote c
阅读完整来源 ↗