- drafting.yml: add {character_profiles} in PASS 0, PASS 3 character state
extraction, rag_write for character-state asset (enables butterfly effect
in draft mode), document for character-state file, conditional_skills
- character_sheet.yml: add rag_write step writing voice-sig-{slug} asset
so auto-import can pick up completed character sheets from RagMemory
- book_chapter.yml: package hint now detects new characters from PASS 3
Character State (spawns character_sheet tasks) and detects Permanent:YES
changes (spawns character_update tasks)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
205 lines
8.6 KiB
YAML
205 lines
8.6 KiB
YAML
name: drafting
|
||
description: "Write one chapter in draft-only mode — continuity check, draft prompt, draft, character state extraction, then stop. No editorial pipeline."
|
||
debug: true
|
||
system: agent_prompt
|
||
|
||
requires:
|
||
- genre_name
|
||
- genre_audience
|
||
- prose_style
|
||
- chapter_target_words
|
||
- chapter_ref
|
||
- chapter_number
|
||
|
||
conditional_skills:
|
||
- path: guides/YAFictionGuide.md
|
||
genre_contains:
|
||
- "YA"
|
||
- "Young Adult"
|
||
- path: guides/RomanceFictionGuide.md
|
||
genre_contains:
|
||
- "Romance"
|
||
- "Contemporary Romance"
|
||
- path: guides/SciFiFictionGuide.md
|
||
genre_contains:
|
||
- "Science Fiction"
|
||
- "Sci-Fi"
|
||
- "SciFi"
|
||
- "Science-Fiction"
|
||
|
||
agent_prompt:
|
||
- "= identity.md"
|
||
- "agent.rag.json"
|
||
|
||
sections:
|
||
- agent
|
||
- project
|
||
- rag
|
||
- skills
|
||
- deliverables
|
||
- message
|
||
- instructions
|
||
|
||
steps:
|
||
- type: think
|
||
hint: |
|
||
PASS 0 — BIBLE, CONTINUITY, AND DRAFT PROMPT
|
||
|
||
GENRE: {genre_name} | AUDIENCE: {genre_audience}
|
||
PROSE STYLE GUIDE: {prose_style}
|
||
TARGET CHAPTER LENGTH: ~{chapter_target_words} words
|
||
|
||
CONTINUITY GUARDRAILS:
|
||
- Use ONLY the outline / character bible and the immediately previous chapter for continuity.
|
||
- Ignore future chapters, editorial reviews, roundtables, polish drafts, and any non-chapter artifacts.
|
||
- Never pull facts from a deliverable whose filename indicates a later chapter than {chapter_ref}.
|
||
|
||
⚠️ CRITICAL: Your task name tells you EXACTLY which chapter to write.
|
||
Look at the CURRENT MESSAGE — write THAT chapter and ONLY that chapter.
|
||
Do NOT write Chapter 1 unless the message explicitly says "Chapter 1".
|
||
|
||
STEP 1 — READ THE OUTLINE / CHARACTER BIBLE:
|
||
Look at PROJECT DELIVERABLES for the outline file.
|
||
Extract and record:
|
||
- protagonist and supporting cast names
|
||
- world rules / constraints
|
||
- this chapter's summary, emotional beat, and closing hook from the outline
|
||
If no outline/bible is available, use the character names and project details
|
||
from the task description above — be CONSISTENT throughout the book.
|
||
|
||
CHARACTER VOICE PROFILES (pre-extracted):
|
||
{character_profiles}
|
||
|
||
If this block is empty, search PROJECT DELIVERABLES for the outline file containing
|
||
"## Voice Signatures" and copy those profiles here. PASS 1 must write every character
|
||
to their voice profile without exception.
|
||
|
||
STEP 2 — FIND THE PREVIOUS CHAPTER:
|
||
Look at PROJECT DELIVERABLES for the chapter that comes BEFORE this one.
|
||
If no previous chapter exists (this IS Chapter 1), skip to STEP 4.
|
||
|
||
STEP 3 — QUOTE THE ENDING:
|
||
Copy the LAST 2–3 sentences of the previous chapter here, word for word.
|
||
Label them: "PREVIOUS CHAPTER ENDED WITH: ..."
|
||
Your new chapter MUST pick up from this exact moment.
|
||
|
||
STEP 4 — BUILD THE DRAFT PROMPT:
|
||
Write the exact drafting prompt for the next pass. That prompt must include:
|
||
- CHAPTER: Exact chapter number and title
|
||
- POV CHARACTER: Whose perspective are we in?
|
||
- FIRST LINE: The exact opening sentence, continuing from the previous ending
|
||
- EMOTIONAL ARC: What does the protagonist feel at start vs end?
|
||
- CHAPTER GOAL: What plot event MUST happen here?
|
||
- KEY BEATS: 3–5 numbered scene beats that will form the chapter
|
||
- CLOSING HOOK: Exact last image or line that makes readers continue
|
||
- Reminders about continuity, prose style, and target length
|
||
|
||
STEP 5 — CHECK LIVE CHARACTER STATE (if available):
|
||
Look in your RAG context for an asset called [character-state].
|
||
If it exists — this is WHERE and WHO each character is RIGHT NOW.
|
||
It OVERRIDES any outline predictions about character state.
|
||
Record as "LIVE CHARACTER STATE:" for use in PASS 1.
|
||
|
||
LOCATION CONTINUITY CHECK (perform this if [character-state] is present):
|
||
Does this chapter's outline place any character at a location inconsistent
|
||
with their Location field in [character-state]?
|
||
If conflict found — FLAG before drafting:
|
||
"LOCATION CONFLICT: [char] is at [state-location] per last chapter but outline
|
||
places them at [outline-location]. Resolve by opening in transit or adjusting."
|
||
|
||
Also note any Active obligations, Open loops, or Known secrets from [character-state]
|
||
that should be honored or advanced in this chapter.
|
||
Check RAG for [world-state] — current NPC attitudes and faction memory.
|
||
If present, record as "LIVE WORLD STATE:". NPCs listed there behave per their attitude.
|
||
|
||
Stop here. Output ONLY the draft prompt. Do NOT write chapter prose yet.
|
||
|
||
- type: think
|
||
model: power
|
||
hint: |
|
||
PASS 1 — WRITE THE DRAFT
|
||
|
||
Use the draft prompt below as your exact writing brief:
|
||
|
||
{steps[0].text}
|
||
|
||
Requirements:
|
||
- Start with the FIRST LINE you planned — make it continue naturally from the previous chapter
|
||
- If the draft prompt contains a line starting with "LOCKED PREVIOUS CHAPTER HOOK:",
|
||
your FIRST LINE MUST directly resolve that hook
|
||
- If the draft prompt contains "AUTHOR'S INTENT:", treat it as a binding directive
|
||
- Follow the KEY BEATS in order, but write with full scene depth
|
||
- All character names must be consistent with the bible/outline
|
||
- Every dialogue exchange must be tight and voice-distinct
|
||
- Show, don't tell — externalize emotion through action, detail, and dialogue
|
||
- Every scene beat moves the story forward OR reveals character
|
||
- End with the CLOSING HOOK you planned
|
||
- Match the prose style guide: {prose_style}
|
||
- Target length: {chapter_target_words} words — write the FULL chapter, not a summary
|
||
- ⚠️ DO NOT stop early. If under {chapter_target_words} words, continue with interiority,
|
||
sensory detail, extended dialogue beats, and transitions until hitting the target.
|
||
|
||
VOICE ANTI-PATTERNS — FORBIDDEN ON EVERY PAGE:
|
||
- Do NOT open with the "didn't just X; it Y" construction. Use varied openers.
|
||
- Thematic contrast appears max ONCE per scene as metaphor — not every paragraph.
|
||
- Do NOT label an emotion already shown through action or dialogue.
|
||
- Do NOT count or reference chapter numbers in the prose. "Five chapters of..." is an AI fingerprint.
|
||
- Each character must have at least ONE verbal imperfection per scene they appear in.
|
||
|
||
Output ONLY the draft chapter text.
|
||
Start directly with the chapter title and opening line. No commentary, no "Pass 1" label.
|
||
|
||
- type: document
|
||
filename: "chapter-{chapter_ref}"
|
||
|
||
- type: think
|
||
hint: |
|
||
PASS 3 — CHARACTER + WORLD STATE EXTRACTION
|
||
|
||
You have just completed the chapter draft. Extract structured state for continuity tracking.
|
||
Write in compact format — this content is stored as a RAG asset read by the NEXT chapter.
|
||
Every character who appeared must have an entry.
|
||
|
||
OUTPUT FORMAT — write this EXACTLY, filling in real values:
|
||
|
||
# Character State: {chapter_ref}
|
||
|
||
## [Character Name]
|
||
Location: [specific location — building, floor, city — no vague "nearby"]
|
||
Physical: [injuries, fatigue, notable physical state, or "no injuries"]
|
||
Emotional: [dominant emotion at chapter end; what they carry into next chapter]
|
||
Active obligations: [debts/promises owed — format: "owes [person] [what] (Ch[N]) — UNPAID/PAID"]
|
||
Open loops: [unresolved conflicts — format: "[parties] [issue] (Ch[N]) — UNRESOLVED/RESOLVED"]
|
||
Known secrets: [info this character has that others don't — "knows [what] — [who does NOT know]"]
|
||
Arc: [XX%] — [one sentence: what permanently changed, or "no change"]
|
||
Permanent: [YES if something permanently changed (death, power gained/lost, relationship changed); NO otherwise]
|
||
|
||
(Repeat for EVERY named character who appeared in this chapter)
|
||
|
||
# World State: {chapter_ref}
|
||
|
||
## NPC Memory
|
||
- [NPC Name] ([faction/location]): [ATTITUDE] — [what happened] — [behavioral consequence]
|
||
|
||
## Faction Attitudes
|
||
- [Faction name]: [current attitude toward protagonists] — [reason]
|
||
|
||
## Active World Events
|
||
- [Event]: [status and expected timeline]
|
||
|
||
CRITICAL: Keep total output under 3500 characters. Be precise and specific.
|
||
Do NOT write prose — only the structured data above.
|
||
|
||
- type: rag_write
|
||
asset_id: "character-state"
|
||
max_chars: 4000
|
||
|
||
- type: document
|
||
filename: "character-state-{chapter_ref}"
|
||
|
||
- type: close
|
||
rag_update: true
|
||
|
||
adjudication:
|
||
enabled: false
|