| name | draft |
| description | Assemble a project's research artefacts into an evidence-grounded IMRaD draft whose hero is a claims↔evidence ledger, then self-audit. The seam between the DOING track (/investigate, /analyze) and the PUBLISHING track (science-writing). /draft ASSEMBLES, it never fabricates — every claim it writes traces to a real artefact (a figure, a number, a citation, a trail outcome, a /study or /survey card); any claim without support is FLAGGED for the human, never invented. Auto-discovers atlas artefacts (study/survey/investigation/analysis) and the git decision trail, builds the ledger + a grounded outline + scaffold prose with [NEEDS:] placeholders, and writes a deliverable draft.md plus a META-view (ledger + outline + audit) in the atlas. The prose is SCAFFOLD to verify, not a finished paper. Use when the user runs /draft or asks to draft / write up / assemble a paper / manuscript / write-up from their results. Next track: science-writing (/check-claims, /verify-citations, /peer-review). |
/draft — assemble the evidence-grounded scaffold
The fourth stage of the research arc — find (/prior-art) → understand
(/study) → do (/investigate, /analyze) → show (/present) — sits at
the seam to the publishing track. /investigate and /analyze produce results
but no manuscript; science-writing audits a draft but never autogenerates.
/draft fills the gap: it assembles a draft from what the project already
produced, with a claims↔evidence ledger as its hero — and it never
fabricates.
The stance, stated plainly: every claim /draft writes must trace to a real
artefact — a figure, a number, a citation, a trail outcome, a /study or
/survey card. A claim with no support is FLAGGED for the human (status
UNSUPPORTED, or a [NEEDS: ...] placeholder in the prose), never invented.
It does not invent numbers, citations, or results. The drafted prose is
explicitly SCAFFOLD — provisional, self-audited text to verify, not a
finished paper. The page's primary value is the ledger + a grounded outline; the
prose is the by-product. The page is the artefact — keep the chat output
minimal.
Steps
1. Resolve — gather the artefacts and establish the spine
$ARGUMENTS is a project (repo/dir) and/or explicit artefact paths, with an
optional venue/format. Auto-discover what the project produced in the atlas, and
read the decision trail from its git log.
PROJ="${ARGUMENTS:-$(git rev-parse --show-toplevel 2>/dev/null || pwd)}"
STAMP=$(date '+%Y-%m-%d %H:%M'); TS=$(date +%Y%m%d-%H%M%S)
SLUG=$(basename "$PROJ" | tr '[:upper:]' '[:lower:]' | tr -cs 'a-z0-9' '-' | sed 's/^-//;s/-$//' | cut -c1-60)
OUT="$HOME/.anu/atlas/drafts/$SLUG"; mkdir -p "$OUT/history"
ls ~/.anu/atlas/papers ~/.anu/atlas/surveys ~/.anu/atlas/investigations ~/.anu/atlas/analyses 2>/dev/null
git -C "$PROJ" log -n 200 --format='%H%x1f%cI%x1f%s%x1f%b%x1e' 2>/dev/null
Read every artefact that exists. Establish the spine before spending the
workflow:
- the question — the
Goal: trailer / the /study problem.
- the contribution — confirmed and upheld hypotheses (from the
investigation), or the analysis headline.
- related work — the
/survey (or the /study lineage/neighbors).
- results — the analysis findings + figures, the investigation verdicts.
If too little exists, say so and stop. /draft assembles a draft; it cannot
manufacture a paper. If there is no investigation, no analysis, and no trail
outcome — no results to write up — tell the user what is missing (run
/investigate or /analyze first) and do not run the workflow. A draft of
nothing is worse than none.
2. Run the workflow
Call the Workflow tool with:
scriptPath: ~/.local/share/anu/plugins/draft/skills/draft/workflow.js (expand ~ to the real home dir)
args:
{
"project": "<abs path to PROJ>",
"venue": "<e.g. NeurIPS / generic>",
"artifacts": { "study": <obj or null>, "survey": <obj or null>, "investigation": <obj or null>, "analysis": <obj or null> },
"trail": [<parsed trailer commits, or the raw git-log text>],
"generatedAt": STAMP
}
Wait for it to complete. It runs Inventory → Outline → Draft → Audit →
Synthesize and returns the draft scaffold as one JSON object (the ledger,
outline, per-section prose, audit, abstract, readiness, coverage). The workflow
does not write draft.md — the SKILL assembles it from sections[].prose.
3. Persist — assemble draft.md and render the META-view
Assemble the deliverable markdown from sections[].prose under IMRaD headings
(title, the scaffold abstract, then each section in order), and write it to the
project:
[ -f "$OUT/draft.json" ] && mv "$OUT/draft.json" "$OUT/history/$TS.json"
python3 ~/.local/share/anu/plugins/draft/skills/draft/render.py "$OUT/draft.json" "$OUT/index.html"
open "$OUT/index.html"
The atlas index.html is the META-view: the claims↔evidence ledger
(UNSUPPORTED rows flagged and sorted to top), coverage counts, the IMRaD outline
with missing-evidence flags, the self-audit, the scaffold abstract, and the
readiness lists. draft.md in the project is the editable deliverable.
4. Report — the human worklist, then the next track
Report tersely:
- the
<project>/draft.md path (the deliverable) and the atlas page path.
- the ledger coverage — X/Y claims grounded (and how many weak / unsupported).
- the flagged-for-human items — the
UNSUPPORTED claims and the [NEEDS: ...]
placeholders, plus any high-severity audit issues. This is the human worklist:
what must be supplied or verified before the scaffold is a paper.
Then point at the next track — once the human has filled the gaps, the
science-writing plugin takes over: /check-claims (do the citations support
the claims), /verify-citations (are the references real), /peer-review (the
reviewer's read). /draft assembled the scaffold; science-writing audits the
manuscript.
Rules
- Assemble, never fabricate. Every claim traces to a real artefact; a claim
with no support is flagged
UNSUPPORTED, never invented. Never write a number,
citation, statistic, or result not present in the artefacts. This is the whole
point of the plugin.
- The drafted prose is scaffold to verify, not a finished paper. Say so on
the page and in the report.
[NEEDS: ...] placeholders are honest, not a
failure.
- Never edit
template.html / render.py per run — fixed by design; all per-run
content lives in draft.json. Same contract as /map, /study,
/investigate.
- Frame claims as bounded — "tested X, observed Z" / "nearest is X, differs
in Y" — never a blanket "novel" / "proven" / "SOTA". The audit flags overclaim.
- Pure black-and-white minimal output; the page is the artefact, the chat output
stays minimal.
- History accumulates in
$OUT/history/; never delete it — it is how a draft is
diffed as the project's evidence grows.