Skip to content
/

novel-writer-openspec

novel-writer-openspec · wordflowlab/novel-writer-openspec · ★ 29 · last commit 2025-10-24

Applies OpenSpec methodology to fiction writing to prevent character collapse and setting inconsistency in AI-assisted long-form novels.

Best whenCharacter consistency in long-form fiction is the same class of problem as API consistency in software — both benefit from a spec layer.
Skip ifWriting chapters without checking canonical specs first, Modifying character traits in-place without a delta change proposal
vs seeds
spec-kitbased novel tool, demonstrating active comparison between spec frameworks.
Primitive shape 1 total
Commands 1
00

Summary

Novel-Writer-OpenSpec — Summary

Novel-Writer-OpenSpec (published as novelspec on npm) is a domain port of OpenSpec methodology to fiction writing — specifically Chinese web novel (网络小说) creation. It applies OpenSpec's specs/ (confirmed settings) + changes/ (proposed changes) separation to manage novel world-building, character design, and chapter outlines as verifiable specifications with ADDED/MODIFIED/REMOVED delta tracking. The novelspec CLI provides init, validate, list, archive, and show commands, plus AI slash commands for Claude/Cursor/Windsurf. With 29 stars and TypeScript source, it is the most mature creative-writing application of spec-driven development in the corpus.

Compared to seeds: closest to openspec (same artifact structure, same delta format, same CLI conventions) applied to the fiction domain. No seed covers non-software domains. The key insight is that "character consistency" and "setting coherence" in long-form fiction are the same class of problem as "interface consistency" in software — both benefit from a spec layer that accumulates canonical state and tracks changes with explicit rationale.

01

Overview

Novel-Writer-OpenSpec — Overview

Origin

Published by wordflowlab (GitHub). October 2025. npm package: novelspec v0.2.4. TypeScript codebase with interactive CLI using @inquirer/core.

The README description (Chinese): "基于 OpenSpec 方法论的小说创作管理工具" — "Novel creation management tool based on OpenSpec methodology."

Philosophy

The core analogy:

  • Software interface spec → Novel character spec (姓名, 年龄, 性格 = name, age, personality)
  • Software API spec → Novel worldbuilding spec (魔法体系, 地理 = magic system, geography)
  • Software feature spec → Novel chapter outline spec

The tool solves the "character collapse" (人设崩塌) problem in AI-assisted long-form fiction: when writing across hundreds of chapters with AI, the AI forgets earlier character decisions. A spec layer gives the AI a persistent source of truth.

From README:

"Novel-Writer - 基于 Spec-Kit 的小说创作工具" — the same author built a spec-kit-based version first.

This is the OpenSpec-methodology version of that earlier Spec-Kit-based tool.

Directory Conventions

The tool uses novelspec/ instead of openspec/ as the root directory, mirroring the OpenSpec layout:

novelspec/
├── project.md          # Project conventions (创作原则、风格指南)
├── AGENTS.md           # AI assistant instructions
├── specs/              # Confirmed settings (唯一真相)
│   ├── characters/     # Character specs
│   ├── worldbuilding/  # World specs
│   └── outline/        # Story outline
└── changes/            # Change proposals
    └── archive/
chapters/               # Generated chapter content (output)

AI Integration

Supports: Claude Code, Cursor, Windsurf (via .claude/, .cursor/ directories in the repo).

02

Architecture

Novel-Writer-OpenSpec — Architecture

Distribution

  • Type: npm-package (novelspec)
  • Version: 0.2.4
  • Install: npm install -g novelspec

Runtime Requirements

  • Node.js (version not specified, likely >= 16)
  • npm

Repository Structure

novel-writer-openspec/
├── src/
│   ├── cli.ts           # CLI entry point
│   ├── commands/
│   │   ├── init.ts      # Interactive wizard
│   │   ├── validate.ts  # Spec format validation
│   │   ├── list.ts      # List changes/specs
│   │   ├── show.ts      # Show change details
│   │   └── archive.ts   # Archive + merge specs
│   ├── core/
│   │   ├── parser.ts
│   │   ├── validator.ts
│   │   └── template-manager.ts
│   └── utils/
│       └── file-ops.ts
├── templates/
│   ├── project.md.template
│   ├── AGENTS.md.template
│   ├── characters/      # Character spec templates
│   ├── worldbuilding/   # World spec templates
│   └── outline/         # Outline spec templates
├── .claude/             # Claude Code settings
├── .cursor/             # Cursor settings
└── openspec/            # The tool uses OpenSpec to manage itself

Key Dependency: @inquirer/core

The init command uses an elaborate TUI with ASCII art lettering, progress spinners, and multi-select tool selectors. This is the most visually sophisticated init experience in the batch.

Directory Convention Difference

Uses novelspec/ root instead of openspec/ — prevents collision with OpenSpec if both are used in the same project.

03

Components

Novel-Writer-OpenSpec — Components

CLI Binary: novelspec

Command Description
novelspec init <name> Interactive wizard: creates novelspec/ directory + all templates
novelspec validate <change-name> Validate change spec format
novelspec list List all changes (active + archived)
novelspec show <change-name> Show change details
novelspec archive <change-name> Archive change + merge delta specs into canonical

Validated Spec Format

The validator checks:

  • proposal.md contains Why/What/Impact sections
  • tasks.md uses checkbox format
  • spec files contain Requirement + Scenario structure
  • Every Requirement has at least one Scenario

AI Slash Commands

Command AI Tool Purpose
/novelspec-proposal Claude/Cursor/Windsurf Guide proposal creation

Templates (domain-specific)

Template Purpose
characters/spec.md.template Character definition skeleton
worldbuilding/spec.md.template World setting skeleton
outline/spec.md.template Chapter outline skeleton
project.md.template Project conventions skeleton
AGENTS.md.template AI assistant instructions

Spec Category Types

Category Content
characters/ 角色 (characters): name, age, personality, behavior patterns
worldbuilding/ 世界观 (world): magic systems, geography, factions, power levels
outline/ 大纲 (outline): chapter summaries for completed chapters

MCP Servers

None.

05

Prompts

Novel-Writer-OpenSpec — Prompts

Excerpt 1: Character spec template (domain-adapted OpenSpec format)

From README (example spec file):

# novelspec/specs/characters/protagonist/spec.md

## Purpose
主角陈凡的完整规格定义。

## Requirements

### Requirement: 基础设定
主角应该(SHALL)具有明确且一致的身份背景。

#### Scenario: 身份信息
- **WHEN** 主角出场或被提及
- **THEN** 姓名:陈凡
- **THEN** 年龄:25岁
- **THEN** 性格:理性、内向、善良但不圣母

### Requirement: 行为模式
主角在不同情境下应该(SHALL)展现一致的行为模式。

#### Scenario: 面对危险时
- **WHEN** 遇到生命威胁
- **THEN** 保持冷静,理性分析局势
- **THEN** 优先寻找逃生路线

Technique: Domain-adapted OpenSpec format. RFC 2119 SHALL keywords applied to character behavior rules. WHEN/THEN scenario format used for character response patterns. The AI reads this as a behavioral contract — "character SHALL behave consistently with these scenarios."


Excerpt 2: AGENTS.md template (AI working instructions)

From templates/AGENTS.md.template:

The AGENTS.md template instructs the AI to:

  1. Always check novelspec/specs/ before generating any character-related content
  2. Use delta format (ADDED/MODIFIED/REMOVED) when proposing character changes
  3. Verify no setting conflicts between proposed changes and canonical specs
  4. Mark proposed character changes as ## MODIFIED Requirements with full updated content

Technique: Passive context injection + behavioral mandate. The AI reads AGENTS.md at session start and follows the spec-checking protocol throughout the writing session.


Note

The init wizard (src/commands/init.ts) features ASCII art letter rendering (NOVELSPEC logo), progress spinners using custom frames, and an interactive multi-select AI tool picker with colored labels — the most elaborate interactive prompt in the batch.

09

Uniqueness

Novel-Writer-OpenSpec — Uniqueness

differs_from_seeds

Closest seed: openspec (same artifact structure: specs/, changes/, proposal.md, tasks.md, delta format, ADDED/MODIFIED/REMOVED sections, archive command). The architectural delta is a complete domain port to creative writing: spec categories are characters/, worldbuilding/, outline/ instead of software capabilities; the problem being solved is character consistency and setting coherence rather than API contracts and interface specifications. The CLI is renamed novelspec and uses novelspec/ root directory. No seed addresses non-software domains. The closest analogy in the corpus is how taskmaster-ai is often used for non-software task management even though it was designed for coding — but unlike that incidental usage, this is an intentional domain port with purpose-built templates and validation rules.

Positioning

Proof-of-concept that OpenSpec's core insight — "AI needs a spec layer to stay consistent" — applies equally to long-form fiction. The "character collapse" problem in AI-assisted Chinese web novel writing (AI forgets character traits established 50 chapters ago) is structurally identical to the "API drift" problem in AI-assisted software development. Both benefit from a canonical state file the AI reads before generating content.

Cross-Reference

The same author has a Spec-Kit-based version: https://github.com/wordflowlab/novel-writer — suggesting the author actively compared spec frameworks and found OpenSpec's delta format more suitable for novel evolution than Spec-Kit's gherkin-first approach.

Observable Failure Modes

  1. Chinese-only UX: the CLI output is Chinese — non-Chinese users will find the validation messages opaque
  2. No AI enforcement: unlike software specs that can be tested, there is no automated way to verify that generated chapters "comply" with specs — only human review can catch spec violations
  3. Outline/chapters split: chapter content lives in chapters/ outside novelspec/ — the AI must read both locations for full context
  4. Last commit Oct 2025: 7 months without updates. The npm package may not support current AI tool configurations.
04

Workflow

Novel-Writer-OpenSpec — Workflow

Project Initialization

novelspec init my-novel

Creates the full novelspec/ directory tree with domain-specific templates.

Story Writing Workflow

Phase Artifact Gate
1. Create change novelspec/changes/add-chapter-1-10/
2. Write proposal proposal.md (Why this arc, what changes)
3. Write specs specs/outline/spec.md, specs/characters/*.md
4. Write tasks tasks.md (chapter writing tasks)
5. Validate novelspec validate add-chapter-1-10 Format check
6. Use AI to write /novelspec-proposal or direct prompt Human review
7. Generate chapters Write to chapters/ directory
8. Archive novelspec archive add-chapter-1-10 Merge into canonical specs

Change Example (from README)

# novelspec/changes/add-chapter-11-20/proposal.md

## Why
前10章完成了主角入门,第11-20章需要通过宗门大比展现主角实力和成长。

## What Changes
- 新增第11-20章大纲规格
- 主角等级从炼气7层 → 炼气9层  
- 新增配角规格:天才弟子李剑、神秘导师云长老

## Impact
- 影响规格:specs/outline/spec.md(新增10章)
- 影响规格:specs/characters/protagonist/spec.md(等级更新)
- 影响规格:specs/characters/li-jian/spec.md(新增)

Spec Format Example (character)

### Requirement: 基础设定
主角应该(SHALL)具有明确且一致的身份背景。

#### Scenario: 身份信息
- **WHEN** 主角出场或被提及
- **THEN** 姓名:陈凡
- **THEN** 年龄:25岁
- **THEN** 性格:理性、内向、善良但不圣母

Approval Gates

Gate Type
novelspec validate format check auto-validator
Human review of proposal before writing file-review
06

Memory Context

Novel-Writer-OpenSpec — Memory & Context

State Storage

File-based in novelspec/ directory:

novelspec/
├── project.md                  # Project conventions (writing style, world rules)
├── AGENTS.md                   # AI instructions
├── specs/                      # CANONICAL STATE (唯一真相)
│   ├── characters/
│   │   ├── protagonist/spec.md   # Character contract
│   │   └── <name>/spec.md
│   ├── worldbuilding/
│   │   ├── magic-system/spec.md
│   │   └── geography/spec.md
│   └── outline/
│       └── completed-arcs/spec.md
└── changes/
    └── <arc-name>/             # Proposed changes (delta specs)
        ├── proposal.md
        ├── tasks.md
        └── specs/              # Delta specs (ADDED/MODIFIED/REMOVED)

chapters/                       # Generated chapter content (output artifacts)
├── volume-1/
│   ├── chapter-001.md
│   └── ...

Why File-Based Memory Matters for Fiction

Unlike software, fiction specs accumulate qualitative state:

  • Character power level history
  • Relationship development
  • World-building revelations made in previous chapters
  • Plot promises (Chekhov's guns) that must be honored

The novelspec/specs/ directory is the canonical "bible" — the AI always reads it before generating new content.

Cross-Session Continuity

When resuming writing after weeks, the AI reads specs/ to reconstruct the story state without re-reading all previous chapters.

Persistence

  • Scope: project (per novel)
  • Cross-session: Yes — spec files persist indefinitely
  • Compaction: no explicit mechanism; specs grow as story evolves
07

Orchestration

Novel-Writer-OpenSpec — Orchestration

Multi-Agent

No. Single-agent workflow throughout.

Orchestration Pattern

Sequential. Proposal → Specs → Tasks → Writing → Archive.

Isolation Mechanism

None. All edits in-place.

Multi-Model

No.

Execution Mode

Interactive-loop. Human drives the writing arc by arc, using the CLI to validate and archive each arc.

Prompt Chaining

Yes. The AI reads novelspec/specs/ before generating chapter content — the spec files act as persistent prompt context that chains across sessions.

Key Difference from Software SDDs

In software, the "implementation" (code) is separate from the "spec" (markdown). In fiction:

  • The "spec" is novelspec/specs/ (character/world bible)
  • The "implementation" is chapters/ (written prose)
  • The AI's task during implementation is to write prose consistent with the spec — an inherently creative generative task rather than deterministic code generation

The spec layer solves the "long-form AI consistency" problem, not a planning problem.

08

Ui Cli Surface

Novel-Writer-OpenSpec — UI & CLI Surface

Dedicated CLI Binary

Yes.

  • Binary: novelspec
  • Package: novelspec on npm
  • Version: 0.2.4

Init Wizard UX

The novelspec init command is the most elaborate interactive wizard in the batch:

  • ASCII art "NOVELSPEC" logo rendered using custom letter bitmap arrays
  • Animated progress spinner with custom frame sequence: ['░░░', '▒░░', '▒▒░', ...]
  • Multi-select AI tool picker with styled labels (primary/annotation)
  • Progressive setup flow: project name → AI tool selection → directory creation

Subcommands

Command Description
novelspec init <name> Interactive project setup wizard
novelspec validate <name> Format validation with structured output
novelspec list List active and archived changes
novelspec show <name> Show change details
novelspec archive <name> Archive change + merge specs

Validation Output

变更: add-chapter-1-10
──────────────────────────────────────────────────
格式验证:
✓ proposal.md 包含 Why/What/Impact
✓ tasks.md 使用任务清单格式
✓ specs/outline/spec.md 格式正确
✓ 所有 Requirement 至少一个 Scenario

验证结果: 通过

No Local UI

No web dashboard. All output is CLI.

AI Tool Integration

  • .claude/ — Claude Code integration
  • .cursor/ — Cursor integration

Language

Chinese-first UX (output messages in Chinese) with project mechanics following OpenSpec conventions. English speakers can use the tool but will see Chinese output messages.

Related frameworks

same archetype · same primary tool · same memory type

BMAD-METHOD ★ 48k

Provides a full agile delivery lifecycle with named expert-persona AI collaborators that elicit the human's best thinking rather…

Agent OS ★ 4.6k

Extracts implicit codebase conventions into token-efficient markdown standards files and injects them selectively into AI agent…

Claude Conductor ★ 367

Gives Claude Code a persistent, cross-linked, auto-analyzed documentation system so it retains codebase context across sessions.

Spec-Driver (Greenfield Spec-Driven Development) ★ 25

Prevents spec rot in AI-assisted development by making implementation changes flow back into evergreen, authoritative specs via…

Anthropic Knowledge Work Plugins ★ 16k

Role-specialized plugin bundles with live MCP connectors that turn Claude into a domain expert for enterprise knowledge workers.

Codex Integration for Claude Code (skill-codex) ★ 1.3k

Single Claude Code skill that handles Codex CLI invocation correctly (stdin blocking, thinking token suppression, session resume)…