Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Writing self-loop for surveys: run the strict section-quality gate, then rewrite only the failing `sections/*.md` files until the report is PASS. **Trigger**: writer self-loop, writing loop, quality gate loop, rewrite failing sections, 自循环, 反复改到 PASS. **Use when**: per-section files exist but C5 is FAIL/BLOCKED (thin sections, missing leads/front matter, citation-scope violations, generator voice).
.claude/skills/willoscar-writer-selfloop/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-07 | ✗→✓ | ▲ Improved | 97% | 0% |
| case-08 | ✗→✓ | ▲ Improved | 262% | 0% |
| case-13 | ✗→✓ | ▲ Improved | 417% | 0% |
| case-16 | ✗→✓ | ▲ Improved | 246% | 0% |
| case-18 | ✗→✓ | ▲ Improved | 163% | 0% |
Purpose: make writing converge without rewriting the whole paper.
This is the writing self-healing loop:
Treat the gate as a router, not as a reason to rewrite everything.
If you do not run the helper script, you can still execute this skill by reading sections/*.md + packs and writing output/WRITER_SELFLOOP_TODO.md manually in the same PASS/FAIL style.
Mission: make the draft converge by fixing only failing units and routing issues upstream when needed.
Do:
Avoid:
Mission: connect a visible writing failure to the earliest upstream fix.
Do:
Avoid:
textYou are the writing manager for a survey draft. Your job is to make the draft converge by fixing only what fails, and by routing issues to the earliest responsible artifact. Rules: - If a section fails because the evidence is thin or out-of-scope pressure is high, do NOT pad prose. Route upstream to evidence-selfloop (notes/bindings/packs) and unblock the substrate. - If a section fails because the prose is templated (narration openers, slide navigation, repeated disclaimer spam), rewrite locally. - Never change citation keys during rewrites; keep scope local. Working style: - small, auditable edits - one failing file at a time - every fix either (a) improves argument moves, or (b) restores paper voice
sections/ + sections/sections_manifest.jsonl)sections/sections_manifest.jsonl (expected files + allowed citations)sections/*.md (the actual prose units)outline/writer_context_packs.jsonl (preferred per-H3 pack)outline/evidence_bindings.jsonlcitations/ref.bibOptional routing context:
output/EVIDENCE_SELFLOOP_TODO.md (if evidence gaps are already known)outline/subsection_briefs.jsonl, outline/chapter_briefs.jsonloutput/WRITER_SELFLOOP_TODO.md (report-class; always written)1) Run the gate
sections/sections_manifest.jsonl and the actual sections/*.md files.2) Read the TODO report
output/WRITER_SELFLOOP_TODO.md and identify the failing file paths.outline/writer_context_packs.jsonl.outline/subsection_briefs.jsonl; for chapter-level context (leads/throughlines), consult outline/chapter_briefs.jsonl.3) Triage (writing vs evidence)
Route upstream (run evidence-selfloop) when:
output/EVIDENCE_SELFLOOP_TODO.md already indicates missing anchors/comparisons for the same subsectionoutline/writer_context_packs.jsonl is too thin to satisfy argument moves without guessingoutline/evidence_bindings.jsonlRewrite locally when:
4) Use the right playbook for the failing file type
sections/abstract.md, sections/S<sec_id>.md for Intro/Related Work, sections/discussion.md, sections/conclusion.md): use front-matter-writer.sections/S<sec_id>_lead.md): use chapter-lead-writer.sections/S<sub_id>.md): use subsection-writer (draft) or subsection-polisher (local fix).5) Keep scope + citations stable
citations/ref.bib.outline/evidence_bindings.jsonl (prefer subsection-first).6) Rerun the gate until PASS
After PASS (merge-aware voice safety):
style-harmonizer -> opener-variator ->section-logic-polisher -> paragraph-curator -> evaluation-anchor-checker -> final argument-selfloop snapshot -> optional transition-weaver -> section-merger -> post-merge-voice-gate.
post-merge-voice-gate FAILs with source: transitions, transitioninsertion was explicitly enabled; fix outline/transitions.md and re-merge.
After PASS (mandatory style hygiene for all survey-family profiles):
output/WRITER_SELFLOOP_TODO.md and read ## Style Smells.style-harmonizer on the listed sections/*.md files.overview narration, then runopener-variator on the listed files.
Two limitations ...), run limitation-weaver on the listed files.evaluation-anchor-checker on thesettled H3 files, then regenerate the argument/manifest snapshot.
tension_statement + thesis from the pack to rewrite paragraph 1 (end with the thesis).comparison_cards to write explicit A-vs-B contrast sentences.evaluation_anchor_minimal / protocol snippets to add task/metric/constraint context.Narration opener -> content claim:
This subsection surveys ...Slide navigation -> argument bridge:
Next, we move from X to Y.Having established X, we can now examine how Y changes the trade-offs under comparable protocols.Meta \"survey should\" -> literature-facing observation:
Therefore, survey comparisons should ...Across reported protocols, ... varies, which makes ... fragile unless ...Disclaimer spam -> one policy paragraph + local caveat only when needed:
Stop and route upstream if:
The writer gate emits short issue codes. Treat them as routers and stop trying to pad prose around missing evidence.
First classify failures:
evidence-selfloop).Quick map (common codes):
missing_sections_manifest, empty_sections_manifest, sections_missing_files: run subsection-writer (create missing files + refresh manifest).sections_h3_has_headings: remove headings; H3 bodies are body-only.sections_intro_*, sections_related_work_*: rewrite front matter via front-matter-writer (dense positioning + one methodology note).sections_h3_too_few_paragraphs, sections_h3_too_short: if the pack is rich, expand by executing contrasts + eval anchor + limitation; if the pack is thin, route to evidence-selfloop.sections_h3_missing_contrast: add explicit A-vs-B using comparison_cards; if cards are missing, route to evidence-selfloop (briefs/packs).sections_h3_missing_eval_anchor, sections_h3_missing_cited_numeric: add minimal protocol context (task/metric/constraint) in the same paragraph; if unknown, route upstream or weaken the claim.sections_h3_missing_limitation: add a subsection-specific limitation; if none exists in the pack, route upstream.sections_h3_narration_template_opener, sections_h3_slide_narration, sections_contains_pipeline_voice: rewrite openers/bridges to paper voice (no navigation commentary).sections_h3_evidence_policy_disclaimer_spam: delete repeats; keep evidence policy once in front matter.sections_cites_missing_in_bib: rerun citation-verifier (do not invent keys).sections_cites_outside_mapping: rewrite to in-scope OR fix mapping/bindings (C2/C4) and rebuild packs; do not patch in the merged draft.sections_h3_sparse_citations: if scope allows, plan adds via citation-diversifier then apply via citation-injector; if scope is too tight, expand mapping/bindings upstream.uv run python .codex/skills/writer-selfloop/scripts/run.py --workspace <workspace>--workspace <dir>--unit-id <U###>--inputs <semicolon-separated>--outputs <semicolon-separated>--checkpoint <C#>sections/*.md:uv run python .codex/skills/writer-selfloop/scripts/run.py --workspace <workspace>| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-12 | pass→pass | 5,584 | 2,316 | -59% | 1 | 1 | 0% | 1,008 | 2,964 | +194% | 0 | 0 | — |
case-01 | fail→fail | 4,400 | 5,912 | +34% | 1 | 1 | 0% | 231 | 2,934 | +1170% | 0 | 0 | — |
case-02 | fail→fail | 4,334 | 5,608 | +29% | 1 | 1 | 0% | 198 | 2,915 | +1372% | 0 | 0 | — |
case-03 | fail→fail | 4,975 | 5,515 | +11% | 1 | 1 | 0% | 235 | 2,823 | +1101% | 0 | 0 | — |
case-04 | fail→fail | 5,613 | 4,515 | -20% | 1 | 1 | 0% | 992 | 2,787 | +181% | 0 | 0 | — |
case-05 | fail→fail | 27,989 | 5,358 | -81% | 1 | 1 | 0% | 122 | 2,830 | +2220% | 0 | 0 | — |
case-06 | fail→fail | 6,902 | 5,837 | -15% | 1 | 1 | 0% | 625 | 2,818 | +351% | 0 | 0 | — |
case-07 | fail→pass | 10,136 | 6,065 | -40% | 1 | 1 | 0% | 1,875 | 3,699 | +97% | 0 | 0 | — |
case-08 | fail→pass | 6,879 | 8,252 | +20% | 1 | 1 | 0% | 1,045 | 3,778 | +262% | 0 | 0 | — |
case-09 | pass→pass | 7,451 | 5,805 | -22% | 1 | 1 | 0% | 1,030 | 3,494 | +239% | 0 | 0 | — |
case-10 | pass→pass | 13,945 | 7,393 | -47% | 1 | 1 | 0% | 1,879 | 3,906 | +108% | 0 | 0 | — |
case-11 | fail→fail | 3,459 | 2,608 | -25% | 1 | 1 | 0% | 518 | 3,053 | +489% | 0 | 0 | — |
case-13 | fail→pass | 3,587 | 2,631 | -27% | 1 | 1 | 0% | 594 | 3,071 | +417% | 0 | 0 | — |
case-14 | fail→fail | 7,877 | 4,025 | -49% | 1 | 1 | 0% | 1,465 | 3,223 | +120% | 0 | 0 | — |
case-15 | pass→pass | 11,108 | 5,226 | -53% | 1 | 1 | 0% | 1,811 | 3,581 | +98% | 0 | 0 | — |
case-16 | fail→pass | 6,485 | 3,493 | -46% | 1 | 1 | 0% | 941 | 3,253 | +246% | 0 | 0 | — |
case-17 | fail→fail | 6,154 | 5,062 | -18% | 1 | 1 | 0% | 990 | 3,596 | +263% | 0 | 0 | — |
case-18 | fail→pass | 7,502 | 5,025 | -33% | 1 | 1 | 0% | 1,253 | 3,295 | +163% | 0 | 0 | — |
case-19 | pass→pass | 7,502 | 2,869 | -62% | 1 | 1 | 0% | 1,043 | 3,169 | +204% | 0 | 0 | — |
case-20 | fail→fail | 9,365 | 3,849 | -59% | 1 | 1 | 0% | 1,315 | 3,173 | +141% | 0 | 0 | — |
case-21 | fail→pass | 7,214 | 3,658 | -49% | 1 | 1 | 0% | 1,066 | 3,246 | +205% | 0 | 0 | — |
case-22 | pass→pass | 9,914 | 3,104 | -69% | 1 | 1 | 0% | 1,529 | 3,234 | +112% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted, and 16 counted toward the lift figure. The other 6 produced results that are not comparable between the two arms, so they are excluded from the headline rather than averaged into it. The headline lift of +27 percentage points is the difference between those two pass rates over the 16 comparable cases. 2 cases got worse with the skill loaded, and they are included in that figure.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.