meta-paper-write (Meta-Skill)
Draft a long LaTeX manuscript by orchestrating paper-specific skills and
bounded LLM synthesis. The pipeline now leads with explicit experiment
design + placeholder figures/tables + citation provenance audit so the
deliverable can be reviewed for academic rigor, not just length.
DAG (in order):
paper_collect — extracts topic, mode, language, target length,
audience, and reference count from the same turn without pausing for a
form. Missing facts are marked as assumptions so first-pass paper
requests complete inline.
paper_preferences — expand the collected facts into a planning
contract.
search_papers — sends a clean academic query to Crossref, Brave,
and Tavily; backend-specific academic filtering stays with each engine.
refbib — paper-refbib-stub now extracts eprint/doi
from arXiv/DOI URLs and tags each entry with note = {source: <domain>}
so downstream gates can classify provenance without re-fetching.
source_pack — curates unique, relevant, verifiable references and
emits a machine-readable usable count against the integer citation target.
source_readiness_gate — deterministically blocks before experiment
design or drafting when the curated primary references cannot meet the
target, reporting a concrete found/required count.
experiment_design — decides how many figures and tables the
paper needs based on RQs, hypotheses, analysis dimensions, and the
target page budget. Every figure/table is tied to an RQ or analysis
dimension; no decorative artefacts.
figure_placeholders — render LaTeX \fbox{\parbox{...}}
placeholder figure environments for each entry in FIGURE_PLAN. Zero
matplotlib dependency.
table_placeholders — render LaTeX \begin{tabular} placeholder
tables for each entry in TABLE_PLAN. Cells contain ---/<TBD>;
no fabricated numbers.
analysis_outline — bind every figure/table id to a Discussion
subsection that names potential findings + threats to validity, and
covers every ANALYSIS_DIMENSION.
outline — paper outline that ties Method to experiment design
and Results to the figure/table plan.
citation_plan — assigns concrete cite keys from refbib to
claims; cannot invent keys.
writing_plan + section authors — the explicit FULL_MANUSCRIPT path
converts the user's page target into section-level target_words and
citation budgets before prose is written; section authors obey that plan.
final_manuscript_package — the lower-latency compact path still
writes a complete, target-sized MANUSCRIPT_TEX with the
figure/table/analysis blocks inlined verbatim, plus REFERENCES_BIB
containing only the entries actually cited.
- Sanitize, materialize, and preflight — persist the manuscript under
the runtime-owned run directory, then compare language-aware content units
with TARGET_PAGES. An undersized draft receives one bounded substantive
expansion; a strict second gate must pass before compilation.
citation_map — strict markdown audit table:
Cite Key | Cited Times | Title | URL/DOI/arXiv | Source Quality
with INVALID / UNUSED / WEAK detection. Inlined into the final
deliverable AND queryable per-run via
opensquilla skills meta runs show.
- Citation and publication gates — deterministically read the numeric
citation_map SUMMARY; blocks when cited keys are below CITATION_TARGET,
INVALID > 0, a cited source is WEAK, or the sanitized artifact violates
publication rules. They never trust an LLM verdict or a fixed citation
count.
- Compile probe and bounded page repair — run the real
XeLaTeX/BibTeX cycle and count pages with
pypdf. A measured shortfall gets
one final substantive expansion and one recompile. The runtime permits only
the fixed precompile and page-shortfall repair ids and rejects citation,
document-boundary, external-input, forced-page, and spacing commands.
- Final gates /
compile_pdf / publish / delivery — re-run sanitizer,
length, and publication checks. An unchanged successful probe is reused by
input fingerprint; a changed manuscript is recompiled once and must meet
TARGET_PAGES before publish_artifact can run.
Removed from the previous version:
paper_mode (llm_classify) — superseded by paper_collect
experiment (skill_exec → paper-experiment-stub, fake CSV) —
superseded by experiment_design (real plan, not data). The
bundled paper-experiment-stub skill was deleted with this rewrite.
plot (skill_exec → paper-plot-stub, matplotlib line chart) —
superseded by figure_placeholders (zero-dependency LaTeX). The
bundled paper-plot-stub skill was deleted with this rewrite.
The default path is COMPACT_SKELETON and ends with a compiled PDF without
section-by-section drafting. Explicit full/PDF/long-form requests use
FULL_MANUSCRIPT. If the topic is missing, paper_clarify pauses and asks the
user before generation continues. The compiler refuses to synthesize a degraded
PDF when the manuscript contract is missing.
1---2name: meta-paper-write3description: Create a new academic paper or LaTeX manuscript through a citation-aware drafting and validation DAG; explicit full/PDF requests include artifact compilation. Do not use for repairing an existing manuscript, generic research reports, slides, or plotting.4---5
6# meta-paper-write (Meta-Skill)
7
8Draft a long LaTeX manuscript by orchestrating paper-specific skills and
9bounded LLM synthesis. The pipeline now leads with explicit experiment
10design + placeholder figures/tables + citation provenance audit so the
11deliverable can be reviewed for academic rigor, not just length.
12
13DAG (in order):
14
151. **`paper_collect`** — extracts topic, mode, language, target length,
16 audience, and reference count from the same turn without pausing for a
17 form. Missing facts are marked as assumptions so first-pass paper
18 requests complete inline.
192. **`paper_preferences`** — expand the collected facts into a planning
20 contract.
213. **`search_papers`** — sends a clean academic query to Crossref, Brave,
22 and Tavily; backend-specific academic filtering stays with each engine.
234. **`refbib`** — `paper-refbib-stub` now extracts ``eprint``/``doi``
24 from arXiv/DOI URLs and tags each entry with ``note = {source: <domain>}``
25 so downstream gates can classify provenance without re-fetching.
265. **`source_pack`** — curates unique, relevant, verifiable references and
27 emits a machine-readable usable count against the integer citation target.
286. **`source_readiness_gate`** — deterministically blocks before experiment
29 design or drafting when the curated primary references cannot meet the
30 target, reporting a concrete found/required count.
317. **`experiment_design`** — **decides** how many figures and tables the
32 paper needs based on RQs, hypotheses, analysis dimensions, and the
33 target page budget. Every figure/table is tied to an RQ or analysis
34 dimension; no decorative artefacts.
358. **`figure_placeholders`** — render LaTeX ``\fbox{\parbox{...}}``
36 placeholder figure environments for each entry in FIGURE_PLAN. Zero
37 matplotlib dependency.
389. **`table_placeholders`** — render LaTeX ``\begin{tabular}`` placeholder
39 tables for each entry in TABLE_PLAN. Cells contain ``---``/``<TBD>``;
40 no fabricated numbers.
4110. **`analysis_outline`** — bind every figure/table id to a Discussion
42 subsection that names potential findings + threats to validity, and
43 covers every ANALYSIS_DIMENSION.
4411. **`outline`** — paper outline that ties Method to experiment design
45 and Results to the figure/table plan.
4612. **`citation_plan`** — assigns concrete cite keys from `refbib` to
47 claims; cannot invent keys.
4813. **`writing_plan` + section authors** — the explicit FULL_MANUSCRIPT path
49 converts the user's page target into section-level `target_words` and
50 citation budgets before prose is written; section authors obey that plan.
5114. **`final_manuscript_package`** — the lower-latency compact path still
52 writes a complete, target-sized MANUSCRIPT_TEX with the
53 figure/table/analysis blocks inlined verbatim, plus REFERENCES_BIB
54 containing only the entries actually cited.
5515. **Sanitize, materialize, and preflight** — persist the manuscript under
56 the runtime-owned run directory, then compare language-aware content units
57 with TARGET_PAGES. An undersized draft receives one bounded substantive
58 expansion; a strict second gate must pass before compilation.
5916. **`citation_map`** — strict markdown audit table:
60 ``Cite Key | Cited Times | Title | URL/DOI/arXiv | Source Quality``
61 with INVALID / UNUSED / WEAK detection. Inlined into the final
62 deliverable AND queryable per-run via
63 ``opensquilla skills meta runs show``.
6417. **Citation and publication gates** — deterministically read the numeric
65 `citation_map SUMMARY`; blocks when cited keys are below `CITATION_TARGET`,
66 INVALID > 0, a cited source is WEAK, or the sanitized artifact violates
67 publication rules. They never trust an LLM verdict or a fixed citation
68 count.
6918. **Compile probe and bounded page repair** — run the real
70 XeLaTeX/BibTeX cycle and count pages with `pypdf`. A measured shortfall gets
71 one final substantive expansion and one recompile. The runtime permits only
72 the fixed `precompile` and `page-shortfall` repair ids and rejects citation,
73 document-boundary, external-input, forced-page, and spacing commands.
7419. **Final gates / `compile_pdf` / publish / delivery** — re-run sanitizer,
75 length, and publication checks. An unchanged successful probe is reused by
76 input fingerprint; a changed manuscript is recompiled once and must meet
77 TARGET_PAGES before `publish_artifact` can run.
78
79Removed from the previous version:
80
81- `paper_mode` (llm_classify) — superseded by `paper_collect`
82- `experiment` (skill_exec → `paper-experiment-stub`, fake CSV) —
83 superseded by `experiment_design` (real plan, not data). The
84 bundled `paper-experiment-stub` skill was deleted with this rewrite.
85- `plot` (skill_exec → `paper-plot-stub`, matplotlib line chart) —
86 superseded by `figure_placeholders` (zero-dependency LaTeX). The
87 bundled `paper-plot-stub` skill was deleted with this rewrite.
88
89The default path is COMPACT_SKELETON and ends with a compiled PDF without
90section-by-section drafting. Explicit full/PDF/long-form requests use
91FULL_MANUSCRIPT. If the topic is missing, `paper_clarify` pauses and asks the
92user before generation continues. The compiler refuses to synthesize a degraded
93PDF when the manuscript contract is missing.