Autonovel drafting
Skill DukeTwoCan/autonovel-agent-skills/skills/creative/autonovel-drafting
Collaboration-first Agent Skills pipeline for planning, drafting, revising, reviewing, and exporting long-form fiction.
npx -y skills add DukeTwoCan/autonovel-agent-skills --skill autonovel-draftingAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- 22 days oldThe repository was created 22 days ago. New is not bad, but a brand new repository carrying a familiar-sounding name is the shape a typosquat arrives in, and there has been no time for anyone else to find a problem with it.
- 1 stars1 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
Autonovel Phase 2 — sequential chapter drafting from the act+scene outline. Each chapter is drafted, gated by mechanical slop detectors, manuscript-repetition scan, and a sentence-grading pass; flagged spans are surgically rewritten in place (see references/surgical-rewrite.md). State.json tracks chapters_drafted / chapters_total and the calibration window. Hands off to autonovel-revision when all chapters complete and the novel-level score has been recorded.
The file declares its own license as MIT. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.
SKILL.md
11.8 KB, as published. Nobody here has run it
Autonovel — Phase 2 (Drafting)
Draft each chapter in sequence from the scene-level outline. Per-chapter loop: draft → mechanical gates → surgical rewrite loop → grading gate (see references/surgical-rewrite.md).
When to use this skill
- State.json shows
"phase": "drafting" - Foundation complete; outline.md has scene-level beats; world/characters/voice/canon all present
chapters_drafted < chapters_total(or chapters_total is 0 and we need to count from outline)
Prerequisites
!`cd "$AUTONOVEL_WORKSPACE/$NOVEL_SLUG" && ls -la outline.md world.md characters.md voice.md canon.md`
!`cat "$AUTONOVEL_WORKSPACE/$NOVEL_SLUG/state.json"`
If any foundation file is missing, hand back to autonovel-foundation.
Workflow
Step 1 — Resolve the next chapter
Read chapters_drafted + 1 as the next chapter number. New foundations already
carry chapters_total. For a legacy drafting state where it is zero, count the
validated outline headings for the loop bound; the first atomic checkpoint
persists that derived count. Do not edit state.json by hand.
Step 2 — Draft loop
For each chapter index N from chapters_drafted + 1 to chapters_total:
a. Compile and build context for chapter N. At the start of every chapter, run the deterministic preflight before spending a model call:
python ${HERMES_SKILL_DIR}/lib/validation.py preflight "$AUTONOVEL_WORKSPACE/$NOVEL_SLUG" --chapter N
Nonzero exit means the accepted foundation does not contain a safe drafting packet for this chapter. Report the returned issue codes and stop this chapter; the command does not mutate state. After preflight, re-run the task-specific resolver (unchanged inputs use its fingerprint cache):
python ${HERMES_SKILL_DIR}/../autonovel/lib/genre_resolver.py compile --state "$AUTONOVEL_WORKSPACE/$NOVEL_SLUG/state.json" --workspace "$AUTONOVEL_WORKSPACE/$NOVEL_SLUG" --task drafting.chapter
Read:
outline.md— get the scene-beat section for chapter Nworld.md,characters.md,voice.md,canon.md— fullchapters/ch_{N-1:02d}.mdif N > 1 — get the last 1000 words for continuity (prose texture and immediate scene state; NOT a source of facts — see the STORY STATE block below, which replaces re-reading older chapters for facts)references/chapter-prompt.md(THIS SKILL's reference dir) — get the chapter draft templategenre_context/story-contract.md— the persistent story-specific genre promisesgenre_context/compiled/drafting.md— the bounded static drafting packetgenre_context/compiled/evaluation-chapter.md— the profile-compliance and semantic genre-slop criteria used by Gate 4genre_context/resolved.json— selected-pack metadata and the generated pattern-bundle pointer used by the mechanical scanprofilefrom state.json — rating, exclusions, and content tags to match against the outline coverage map; do not reopen source pack Markdown from Drafting- STORY STATE block (if
story_state/facts.jsonexists — see references/fact-extraction.md for how it's populated):!`python3 ${HERMES_SKILL_DIR}/lib/story_state.py query "$AUTONOVEL_WORKSPACE/$NOVEL_SLUG/story_state/facts.json" {N} <characters-in-this-beat>`<characters-in-this-beat>= the entity keys of characters named in chapter N's outline beat (space-separated CLI args). Include the returned facts and participating characters in{GENRE_DRAFTING_BLOCK}rather than duplicating a separate story-state block. Budget: this story-state portion must stay <= 1.5k tokens; this cap does not include or truncate the story contract or compiled drafting packet. If the query runs longer, narrow the subject list further to only the characters actually on-page in this beat rather than the full cast. Ifstory_state/facts.jsondoes not exist yet, skip this block — it is created on the first chapter's fact-extraction step (references/fact-extraction.md).
Assemble {GENRE_DRAFTING_BLOCK} in this order:
genre_context/story-contract.md.genre_context/compiled/drafting.md.- The exact profile line: primary genre and primary engine, all positive tags, content tags, shape, and pitch.
- The active rating's full rating definition from
${HERMES_SKILL_DIR}/../autonovel/references/ratings.md, followed by every exclusion as a literalNEVER includerequirement. - This chapter's content-tag coverage assignments.
- Current story-state facts and the participating characters for this chapter.
Insert that single block into references/chapter-prompt.md. The story
contract and compiled packet are authoritative static sources; append only the
chapter-specific requirements above. Never read craft.md, beats.md,
slop.md, guardrails.md, or any other source pack Markdown directly here.
b. Generate the chapter. Fill the chapter-prompt template with the assembled context. Target word count from outline (typically 3000-5000 words per chapter). The agent does the LLM work directly using Hermes's loop.
c. Write to chapters/ch_{N:02d}.md.
Run the hard chapter validator immediately. A voice-calibration echo or invalid
artifact must be fixed before the broader quality loop. The validator also
enforces the outline's word-count target with a ±15% tolerance; a
chapter.word_count issue requires expanding or tightening the chapter before
any quality score or checkpoint. Put every scene-level insertion or cut needed
for that repair into one patch document and apply it once with
lib/chapter_patch.py; do not make one file-edit call per paragraph:
python ${HERMES_SKILL_DIR}/lib/validation.py chapter "$AUTONOVEL_WORKSPACE/$NOVEL_SLUG" --chapter N
d. Mechanical slop scan:
!`python3 ${HERMES_SKILL_DIR}/lib/slop_detect.py "$AUTONOVEL_WORKSPACE/$NOVEL_SLUG/chapters/ch_{N:02d}.md" --genre-context "$AUTONOVEL_WORKSPACE/$NOVEL_SLUG/genre_context/resolved.json"`
Also run the manuscript-wide repetition scan (cheap, pure Python). Pass
world.md, characters.md, canon.md, and the story contract as canonical
references; never pass voice.md:
!`python3 ${HERMES_SKILL_DIR}/lib/slop_ngrams.py "$AUTONOVEL_WORKSPACE/$NOVEL_SLUG/chapters" --canonical-reference "$AUTONOVEL_WORKSPACE/$NOVEL_SLUG/world.md" --canonical-reference "$AUTONOVEL_WORKSPACE/$NOVEL_SLUG/characters.md" --canonical-reference "$AUTONOVEL_WORKSPACE/$NOVEL_SLUG/canon.md" --canonical-reference "$AUTONOVEL_WORKSPACE/$NOVEL_SLUG/genre_context/story-contract.md"`
Get the full breakdown (not just the score) with the same resolved patterns — the surgical rewrite loop needs the matched spans, not the number:
from genre_patterns import load_patterns_from_resolved
from slop_detect import find_spans, slop_report
genre_patterns = load_patterns_from_resolved(
"$AUTONOVEL_WORKSPACE/$NOVEL_SLUG/genre_context/resolved.json"
)
spans = find_spans(chapter_text, genre_patterns=genre_patterns)
report = slop_report(chapter_text, genre_patterns=genre_patterns)
Use genre_context/compiled/evaluation-chapter.md for the accompanying
profile-compliance and semantic genre-slop review. For selected genre patterns,
an error finding blocks Gate 1 only when its total hits exceed max_count.
Always report warning findings, but never let them block Gate 1.
e. Enforce (five gates — see references/surgical-rewrite.md):
Acceptance requires ALL FIVE gates:
- Mechanical scan clean — slop_detect findings within the zero-tolerance/bounded limits classified in references/surgical-rewrite.md (Acceptance section).
- Manuscript repetition clean for THIS chapter — no
blocking_findingsentry from slop_ngrams has an occurrence in the current chapter. Keepwarninganddomainfindings in the report, but do not rewrite them. - Sentence-grading gate — grading_gate() passes (references/sentence-grading.md).
- Profile compliance — no excluded-tag subject matter, no scene
exceeding
profile.rating(references/quality-rubric.md's Profile compliance section). - Reveal-budget compliance — list every new story fact first disclosed in
the chapter and cite the exact
May revealclause or scene-cardRevealcell that authorizes it. Any uncited fact or anyMust withholddisclosure blocks acceptance.
Flow:
-
Run all five gates for the initial audit. If any gate fails, collect every current blocker into the bounded surgical process: two batch rewrite rounds for the chapter, then one deterministic cut/merge pass. Never multiply the budget by the number of spans.
warninganddomainrepetition findings do not enter the rewrite batch. -
All five gates pass → compute the 1-10 trend score ONCE on the final text, run fact extraction, then let the validator record the score and progress in one atomic checkpoint:
python ${HERMES_SKILL_DIR}/lib/validation.py checkpoint "$AUTONOVEL_WORKSPACE/$NOVEL_SLUG" --chapter N --status accepted --score <score>Commit only after the command returns
checkpointed: true. -
Chapter cannot converge after the bounded cleanup → preserve the draft and checkpoint it explicitly without a passing score:
python ${HERMES_SKILL_DIR}/lib/validation.py checkpoint "$AUTONOVEL_WORKSPACE/$NOVEL_SLUG" --chapter N --status needs_attention --note "<remaining blocking findings>"Continue only after
checkpointed: true. Never write progress fields or the attention queue directly.
Step 3 — When all chapters drafted
- Concatenate the chapter files in numeric order to a temporary manuscript
file, then run the contextual scan to compute the novel-level score:
!python3 ${HERMES_SKILL_DIR}/lib/slop_detect.py "$AUTONOVEL_WORKSPACE/$NOVEL_SLUG/manuscript-draft.md" --genre-context "$AUTONOVEL_WORKSPACE/$NOVEL_SLUG/genre_context/resolved.json"
Remove the temporary file after recording the score.
2. Record via `record_score(s, "novel", <score>)`.
3. Update state.json `phase` to `"revision"`.
4. Commit. Hand off to `autonovel-revision`.
## Handoff
Invoke `autonovel-revision` when all chapters drafted.
## Library utilities
- `lib/slop_detect.py` — mechanical slop detection and full breakdown via `slop_report` (no LLM)
- `lib/slop_ngrams.py` — manuscript-wide repeated-phrase scan (no LLM)
- `lib/grading.py` — sentence-grading parse + deterministic acceptance gate
- `lib/state.py` — state.json management
- `lib/story_state.py` — story-state ledger: entities, facts with validity
intervals, foreshadow tracking, STORY STATE query block (no LLM; mirrored
into this skill's `lib/` in Module A3 — canonical source is
`autonovel/lib/story_state.py`)
## See also
- `references/chapter-prompt.md` — the chapter draft template
- `references/surgical-rewrite.md` — the enforcement loop and the five acceptance gates
- `references/sentence-grading.md` — the sentence-grading pass
- `references/retry-policy.md` — how to checkpoint a chapter after bounded cleanup
- `references/quality-rubric.md` — how to interpret the 1-10 trend score
- `references/fact-extraction.md` — post-acceptance fact extraction into the story-state ledger