OpenWriterControle/novel/.opencode/command/init.md
cclohmar 4b9a535d6c
Some checks are pending
Create Release / Check if Version Bump PR Merged (push) Waiting to run
Create Release / Create Git Tag and GitHub Release (push) Blocked by required conditions
Post-Merge Version Bump / Check if Version Bump Needed (push) Waiting to run
Post-Merge Version Bump / Create Version Bump PR (push) Blocked by required conditions
docs(novel): switch the pack to the container-vault layout
One Obsidian vault holds every book; each book is a subfolder and is the opencode
workspace. The pack is shared at the vault root and inherited by walking up, so a
book no longer gets its own .opencode copy:

- SCHEMA §1 rewritten: container vault -> book folders, shared .opencode + docs
- init.md: scaffolds only the book (AGENTS.md, DATA/, 01/), checks that a shared
  pack is reachable, and no longer copies agent/command files into the project
- PACK-NOTES: layout diagram + a headless section documenting the deny-based
  permission model
2026-10-16 23:36:04 +01:00

176 lines
6.7 KiB
Markdown

---
description: "Initialize a new novel project — interactive scaffolding wizard"
---
# /init — Project Scaffolding
Initializes a new novel/series project with the OpenNovelWriter structure.
## Concept: one vault, one folder per book
All books live as folders inside one container vault (e.g. "Novels"). A book folder
**is** the workspace: the author creates the folder, opens it as the opencode
workspace, and runs `/init` THERE.
`/init` scaffolds **into the current directory** — it does NOT create a nested
subfolder. The folder's name is the project name; the "series title" question below
is metadata (and may differ from the folder name).
The agent pack (`.opencode/`) is **shared and inherited** from the vault root.
Never create a copy inside a book folder.
## Workflow
Run the wizard **interactively**. The first question determines the language;
all further questions are asked in that language.
### Step 0: Confirm the workspace
The current directory IS the book's workspace. Confirm the folder name with the
author (it is the project/series name). Do NOT create a subfolder — scaffold
directly into the current directory.
Then confirm the **shared pack is reachable**: an `.opencode/` directory must exist
in an ancestor directory (the container vault root). opencode finds it by walking
up. If there is none, STOP and tell the author to set up the shared pack — never
seed a local `.opencode/` in the book folder.
### Step 1: Ask the writing language (always first)
> "Which language will you write in? (e.g. Deutsch, English, Português)"
The author answers. From now on you ask **all** questions and produce **all**
content in that language. Map the language to its ISO code in
`.opencode/languages.yaml`.
### Step 2: Strategic questions (in the chosen language)
Ask these questions one at a time. Record the answers:
1. **Basic plot / premise** — the most important question:
> "Tell me the basic plot — what is the story about? What is to come?"
The author describes the story in a few sentences. This is the SEED: you will
use it to pre-fill the world wiki and timeline, and to start building the world.
2. **Series title** (for metadata; defaults to the folder/workspace name)
3. **Sequel or standalone?**
- Sequel → "How many books are planned?" (creates `01` … `NN`)
- Standalone → only `01`
4. **Publication languages** (multiple allowed; default: the writing language)
5. **Genre** (fantasy, sci-fi, mystery, …)
6. **Target audience / age** (children, young adult, adult)
7. **Author** (name)
8. *(optional)* **Target chapter length** (characters per chapter, if the author has one)
### Step 3: Generate the structure
Scaffold **into the current directory** (the workspace/vault the author already
created and named):
```
. (the book folder inside the container vault)
├── AGENTS.md (this book's metadata; from the template)
├── 01/ (one per book, numbered; title optional, renamed later)
│ ├── DE/ (one folder per publication language, ISO code)
│ ├── EN/
│ └── images/
│ ├── prompts/ (image prompts, one .md per image)
│ └── generated/ (generated image files)
├── 02/ … (if a sequel)
├── DATA/
│ ├── wiki.yaml.md
│ ├── timeline.yaml.md
│ ├── glossary.yaml.md
│ └── style.md
├── README.md
```
`.opencode/` is deliberately **absent** here — the pack is shared at the vault root.
- **Book folders:** numbers only (`01`, `02`). Titles are added later by renaming.
- **Language folders:** ISO codes only (`DE`, `EN`, `PT`).
- **Images:** each book gets `images/prompts/` and `images/generated/`.
- **Chapter files:** create NONE yet. They are created when writing.
### Step 4: Populate the DATA files
- **`wiki.yaml.md`** → `meta:` block with the answers from Step 2 (title, author,
canonical, languages, genre, audience). Also fill `concept.premise:` with the
basic plot from Step 2, question 1.
- **`timeline.yaml.md`** → `story:` MUST be seeded with the premise as the first
entry. Do NOT leave it empty. Example:
```yaml
story:
- event: "PREMISE from Step 2 question 1"
# date optional; add `book: 1` if a sequel
```
`history:` stays empty.
- **`glossary.yaml.md`** → empty `terms:` list.
- **`style.md`** → placeholder with a note that the StyleAnalyst will extract the
voice from sample chapters later.
**Verification (mandatory):** before finishing, re-read the generated
`timeline.yaml.md` and confirm `story:` contains the premise. If it is empty,
fill it before proceeding.
### Step 5: Generate AGENTS.md + README.md
- **`AGENTS.md`** → from the answers: canonical language, publication languages,
genre, audience, structure note (references `docs/SCHEMA.md`).
- **`README.md`** → human-readable project overview.
### Step 6: Finish
Report to the author:
```
Project "[Title]" created.
Structure:
- 0N books (numbers; add titles by renaming)
- languages: DE, EN
- DATA/ with wiki, timeline, glossary, style
The premise has been seeded into the world wiki and timeline.
Next steps:
1. Open the project in Obsidian.
2. Start telling the story right away:
"Write Chapter 001: [what should happen]".
(The world builds itself in the background as you write.)
```
### Step 7: Hand over to the author
After reporting, remind the author that the world is built **in the background** —
they do not need to answer world-building questions. They can simply start
telling the story:
```
You can start telling the story right away — I'll build the world in the
background as we go.
Just say: "Write Chapter 001: [what should happen]".
```
Do NOT offer an interactive world-building questionnaire. If the author wants to
define the world up front, they will say so — otherwise, infer it from the story
as chapters are written.
## Rules
- Scaffold INTO the current directory (the workspace/vault) — never create a nested
`[Series Title]/` subfolder. The vault's own name is the project name.
- The FIRST question is ALWAYS the writing language; everything after is in that language.
- The SECOND question is ALWAYS the basic plot/premise — it is the seed for the world.
- The premise MUST be written into BOTH `wiki.yaml.md` (`concept.premise`) AND
`timeline.yaml.md` (`story:` first entry). Never leave `story:` empty.
- Book/language folders ALWAYS as number resp. ISO code — never force a title.
- YAML keys English, values in the canonical language (see SCHEMA §4).
- No chapter files during init — they are created when writing.
- NEVER copy the agent/command files into the book folder. The pack is shared and
inherited from the vault root; a local `.opencode/` forks the agents and drifts
out of date.