Skip to content

Commit 0080098

Browse files
Smrutiranjan Patriclaude
andcommitted
style: remove em-dashes across source and docs
Replace cosmetic em-dashes (an "AI tell" the humanizer itself strips) with plain hyphens throughout comments, docstrings, display copy, prompts, and all Markdown docs. Functional em-dashes are intentionally preserved: the humanizer's detection regex and the test inputs that verify em-dash stripping. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent a52b9c0 commit 0080098

35 files changed

Lines changed: 331 additions & 331 deletions

CLAUDE.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ A self-correcting, autonomous writing system (books, articles, and more). Intera
55

66
## Start every session here
77

8-
1. Read **`resume.md`** the session log: what happened last time and the next step.
9-
2. Read **`plan.md`** the authoritative spec (architecture, memory, nodes, state machine,
8+
1. Read **`resume.md`** - the session log: what happened last time and the next step.
9+
2. Read **`plan.md`** - the authoritative spec (architecture, memory, nodes, state machine,
1010
learning, production, model routing, CLI).
1111

1212
## End every session

CONTRIBUTING.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ pip install -e ".[dev]" # editable install + pytest + ruff
1919

2020
### Optional: context compression (headroom)
2121

22-
Headroom is optional the app runs fine without it.
22+
Headroom is optional - the app runs fine without it.
2323

2424
- **Linux / macOS:** `pip install -e ".[headroom]"` (prebuilt Rust wheels).
2525
- **Windows:** there is no Windows wheel for current versions; install the last
@@ -36,7 +36,7 @@ cp .env.example .env # Windows: copy .env.example .env
3636
# add your OPENROUTER_API_KEY
3737
```
3838

39-
You do **not** need a key to develop or run the tests see fake mode below.
39+
You do **not** need a key to develop or run the tests - see fake mode below.
4040

4141
## Running tests
4242

@@ -46,7 +46,7 @@ pytest
4646

4747
The suite runs fully offline. Tests that exercise the pipeline use **fake mode**
4848
(`BOOK_AGENT_FAKE=1`), where every LLM node returns deterministic placeholder
49-
output no network, no key. You can drive the whole app this way too:
49+
output - no network, no key. You can drive the whole app this way too:
5050

5151
```bash
5252
BOOK_AGENT_FAKE=1 python book.py new --abstract "test" --pick 1
@@ -62,17 +62,17 @@ ruff check . # lint
6262
ruff format . # format
6363
```
6464

65-
A `.pre-commit-config.yaml` is provided run `pre-commit install` to lint on commit.
65+
A `.pre-commit-config.yaml` is provided - run `pre-commit install` to lint on commit.
6666

6767
## Conventions
6868

6969
- **`plan.md`** is the architecture/spec source of truth; **`resume.md`** is the running
7070
dev journal (newest entry on top). Durable decisions go in `plan.md`, not `resume.md`.
71-
- Keep nodes deterministic LLM calls see `plan.md` §4. Don't add agentic behavior.
71+
- Keep nodes deterministic LLM calls - see `plan.md` §4. Don't add agentic behavior.
7272
- Network/IO is best-effort: degrade gracefully, never crash the pipeline on a fetch error.
7373
- All numeric thresholds are tunable config (`config/settings.yaml`), not hard-coded.
7474
- Cross-platform: use `pathlib`, avoid shelling out, and don't assume a POSIX or Windows path
75-
layout. CI runs the suite on all three OSes keep it green.
75+
layout. CI runs the suite on all three OSes - keep it green.
7676

7777
## Submitting changes
7878

@@ -85,9 +85,9 @@ A `.pre-commit-config.yaml` is provided — run `pre-commit install` to lint on
8585

8686
A 60-second map (full detail in `plan.md` and the README's Architecture section):
8787

88-
- `src/book_agent/orchestrator.py` durable on-disk state machine (the brain *is* the checkpoint).
89-
- `nodes.py` / `prompts.py` / `schemas.py` the LLM nodes, their prompts, and structured outputs.
90-
- `llm.py` OpenRouter wrapper (retry/backoff, timeout, repair, headroom compression).
91-
- `brain.py` / `store.py` markdown filesystem layout + SQLite/FTS canon & graph.
92-
- `shell.py` / `cli.py` / `ui.py` Rich TUI, one-shot CLI, shared UI helpers.
93-
- `export.py` pdf · epub · html · docx · txt · md renderers.
88+
- `src/book_agent/orchestrator.py` - durable on-disk state machine (the brain *is* the checkpoint).
89+
- `nodes.py` / `prompts.py` / `schemas.py` - the LLM nodes, their prompts, and structured outputs.
90+
- `llm.py` - OpenRouter wrapper (retry/backoff, timeout, repair, headroom compression).
91+
- `brain.py` / `store.py` - markdown filesystem layout + SQLite/FTS canon & graph.
92+
- `shell.py` / `cli.py` / `ui.py` - Rich TUI, one-shot CLI, shared UI helpers.
93+
- `export.py` - pdf · epub · html · docx · txt · md renderers.

README.md

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
/_/ |_\____/_____/_/ |_/ /_/
1515
</pre>
1616

17-
### an autonomous writing studio books, articles & more
17+
### an autonomous writing studio - books, articles & more
1818

1919
[![CI](https://github.com/vikast908/WritingAgent/actions/workflows/ci.yml/badge.svg)](https://github.com/vikast908/WritingAgent/actions/workflows/ci.yml)
2020
[![Python](https://img.shields.io/badge/python-3.10%2B-blue?style=flat-square)](https://www.python.org/)
@@ -34,28 +34,28 @@
3434

3535
## What it does
3636

37-
Writing Agent is a self-correcting, autonomous writing system that takes a topic and produces a publication-ready manuscript drafting, critiquing, humanising, and revising in a loop until the work meets quality standards.
37+
Writing Agent is a self-correcting, autonomous writing system that takes a topic and produces a publication-ready manuscript - drafting, critiquing, humanising, and revising in a loop until the work meets quality standards.
3838

39-
- **Books** multi-chapter narratives with memory, continuity audits, and front/back matter
40-
- **Articles** long-form editorial pieces with research, citations, and editorial angles
41-
- **Self-correction** write → critique → revise → humanise → commit, up to a cap, then escalate
42-
- **Quality guardrails** hard rules against AI slop baked into every prompt
43-
- **Context compression** [headroom-ai](https://github.com/chopratejas/headroom) runs by default; 60–95% fewer tokens, same output quality
39+
- **Books** - multi-chapter narratives with memory, continuity audits, and front/back matter
40+
- **Articles** - long-form editorial pieces with research, citations, and editorial angles
41+
- **Self-correction** - write → critique → revise → humanise → commit, up to a cap, then escalate
42+
- **Quality guardrails** - hard rules against AI slop baked into every prompt
43+
- **Context compression** - [headroom-ai](https://github.com/chopratejas/headroom) runs by default; 60–95% fewer tokens, same output quality
4444

4545
---
4646

4747
## Setup
4848

4949
**Requirements:** Python 3.10+ · runs on **Linux · macOS · Windows** · an [OpenRouter API key](https://openrouter.ai/) (free tier works). No API key is needed to install, run the tests, or try the offline demo.
5050

51-
### 1 Clone
51+
### 1 - Clone
5252

5353
```bash
5454
git clone https://github.com/vikast908/WritingAgent.git
5555
cd WritingAgent
5656
```
5757

58-
### 2 Create & activate a virtualenv
58+
### 2 - Create & activate a virtualenv
5959

6060
<table>
6161
<tr><th>Linux / macOS</th><th>Windows (PowerShell)</th></tr>
@@ -79,23 +79,23 @@ python -m venv .venv
7979
> **Windows note:** if PowerShell blocks the activate script, run once:
8080
> `Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass`, then re-activate.
8181
82-
### 3 Install
82+
### 3 - Install
8383

8484
```bash
8585
pip install -e . # core (all platforms)
8686
pip install -e ".[dev]" # + pytest + ruff (for development)
8787
```
8888

89-
### 4 (optional) context compression via headroom
89+
### 4 - (optional) context compression via headroom
9090

91-
Headroom is optional the app runs fine without it and degrades gracefully.
91+
Headroom is optional - the app runs fine without it and degrades gracefully.
9292

9393
| Platform | Command |
9494
|---|---|
95-
| **Linux / macOS** | `pip install -e ".[headroom]"` prebuilt Rust wheels, installs cleanly |
96-
| **Windows** | `pip install -e ".[headroom]"` then `pip install --only-binary=:all: --no-deps "headroom-ai==0.10.17"` current versions have no Windows wheel, so we use the last pure-Python release (skips the `litellm` dep, whose long paths break installs without long-path support) |
95+
| **Linux / macOS** | `pip install -e ".[headroom]"` - prebuilt Rust wheels, installs cleanly |
96+
| **Windows** | `pip install -e ".[headroom]"` then `pip install --only-binary=:all: --no-deps "headroom-ai==0.10.17"` - current versions have no Windows wheel, so we use the last pure-Python release (skips the `litellm` dep, whose long paths break installs without long-path support) |
9797

98-
### 5 Add your API key
98+
### 5 - Add your API key
9999

100100
<table>
101101
<tr><th>Linux / macOS</th><th>Windows (PowerShell)</th></tr>
@@ -145,7 +145,7 @@ python book.py export --format pdf
145145

146146
The TUI shows a **live dashboard** while writing (progress, current stage, elapsed time, live token count), **tab-autocompletes** commands and arguments, and remembers history across sessions. Add `--plain` (or set `NO_COLOR`) for unstyled output.
147147

148-
### Try it offline first no API key (fake mode)
148+
### Try it offline first - no API key (fake mode)
149149

150150
Every node returns deterministic placeholder output, so you can verify the full pipeline, state machine, and exports without a key or any token spend.
151151

@@ -230,20 +230,20 @@ Draft → Critic (approve | revise | escalate)
230230

231231
| Command | Effect |
232232
|---|---|
233-
| `/mode article` | Write a long-form article sections, angles, citations |
234-
| `/mode book` | Write a full book chapters, canon, consolidation (default) |
233+
| `/mode article` | Write a long-form article - sections, angles, citations |
234+
| `/mode book` | Write a full book - chapters, canon, consolidation (default) |
235235

236236
### Core commands
237237

238238
| Command | What it does |
239239
|---|---|
240-
| `new --abstract "..."` | Start a project picks angles/directions, builds outline/TOC |
240+
| `new --abstract "..."` | Start a project - picks angles/directions, builds outline/TOC |
241241
| `run` | Drive the pipeline: draft → critique → humanise → commit |
242242
| `status` | Show phase, section/chapter progress, pending escalations |
243243
| `review --chapter N --instruction "..."` | Answer an escalation; `run` resumes from that point |
244244
| `read [--chapter N] [--summary] [--manuscript]` | Read any section, summary, or the full manuscript |
245245
| `export [--format <fmt>]` | Export (interactive picker if format omitted) |
246-
| `memory` | Inspect canon characters, timeline, entity graph |
246+
| `memory` | Inspect canon - characters, timeline, entity graph |
247247
| `skills` | Browse learned craft skills and efficacy scores |
248248
| `list` | All projects with type and phase |
249249
| `delete [--yes]` | Permanently delete a project |
@@ -253,7 +253,7 @@ Draft → Critic (approve | revise | escalate)
253253

254254
| Slash | What it does |
255255
|---|---|
256-
| `/update [description]` | Describe your changes AI reviews and advises on next steps |
256+
| `/update [description]` | Describe your changes - AI reviews and advises on next steps |
257257
| `/mode [book\|article]` | Show or set writing mode |
258258
| `/use <project>` | Set active project (no `--book-id` needed on follow-up commands) |
259259
| `/books` · `/list` | List all projects with type and phase |
@@ -270,7 +270,7 @@ Draft → Critic (approve | revise | escalate)
270270
```bash
271271
export --format pdf # paginated A5 PDF (via xhtml2pdf)
272272
export --format epub # EPUB with NCX/Nav TOC (via ebooklib)
273-
export --format docx # Word document (via pandoc must be on PATH)
273+
export --format docx # Word document (via pandoc - must be on PATH)
274274
export --format html # self-contained HTML with embedded CSS
275275
export --format txt # clean plain text (Markdown stripped)
276276
export --format md # raw Markdown with title header
@@ -285,7 +285,7 @@ Just type `export` for an interactive picker.
285285
| Feature | Setting | Default |
286286
|---|---|:---:|
287287
| Web research per section (DuckDuckGo) | `use_researcher` | ✅ on |
288-
| Humanizer strips AI tells | `humanize` | ✅ on |
288+
| Humanizer - strips AI tells | `humanize` | ✅ on |
289289
| Headroom context compression | `use_headroom` | ✅ on |
290290
| SVG diagram generation (per section) | `use_images` | ✅ on |
291291
| Semantic skill retrieval (embeddings) | `use_embeddings` | off |
@@ -294,26 +294,26 @@ Just type `export` for an interactive picker.
294294

295295
Toggle any feature live in the TUI: `/set use_researcher false`
296296

297-
**Reliability:** every LLM call retries transient errors (429/5xx/timeouts) with exponential backoff and a request timeout, and fails fast on auth/bad-request. Run state is written atomically and is **resumable** a crash mid-run never double-commits a chapter or corrupts the project. Token usage is reported at the end of each run.
297+
**Reliability:** every LLM call retries transient errors (429/5xx/timeouts) with exponential backoff and a request timeout, and fails fast on auth/bad-request. Run state is written atomically and is **resumable** - a crash mid-run never double-commits a chapter or corrupts the project. Token usage is reported at the end of each run.
298298

299299
---
300300

301301
## Writing Quality Guardrails
302302

303-
Hard rules baked into **every** writer, humaniser, and critic prompt not optional:
303+
Hard rules baked into **every** writer, humaniser, and critic prompt - not optional:
304304

305-
**No AI slop** 24 explicit bans:
305+
**No AI slop** - 24 explicit bans:
306306
- Verbs: `delve`, `leverage`, `utilize`, `foster`, `elevate`, `transform`, `unlock`
307307
- Adjectives: `robust`, `pivotal`, `comprehensive`, `nuanced`, `groundbreaking`
308308
- Transitions: `furthermore`, `moreover`, `in conclusion`, `it's worth noting`
309309
- Structure: no em-dashes, no scare quotes, no bullet-point padding
310310

311-
**No fabrications** no invented stats, quotes, or attributions
311+
**No fabrications** - no invented stats, quotes, or attributions
312312

313-
**Humanizer pass** 11 specific rewrite rules applied after every commit:
313+
**Humanizer pass** - 11 specific rewrite rules applied after every commit:
314314
removes inflated significance, symbolic language, weak construction verbs, synonym cycling, filler openers, AI transition phrases; varies sentence rhythm
315315

316-
**Critic blocks on slop** the critic returns `revise` (not `approve`) if any banned pattern appears, forcing a rewrite before commit
316+
**Critic blocks on slop** - the critic returns `revise` (not `approve`) if any banned pattern appears, forcing a rewrite before commit
317317

318318
---
319319

@@ -326,7 +326,7 @@ Tool outputs, research results, skill context, conversation history
326326
327327
headroom (CacheAligner → ContentRouter → SmartCrusher / CodeCompressor)
328328
329-
LLM (60–95% fewer tokens same answers)
329+
LLM (60–95% fewer tokens - same answers)
330330
```
331331

332332
Disable if needed: `/set use_headroom false`
@@ -340,7 +340,7 @@ When `use_images` is on, every section/chapter gets a generated diagram saved to
340340
- **860 × 520 px** canvas, publication-quality
341341
- Flowcharts, concept maps, timelines, comparison tables, process loops
342342
- Accent palette: `#4f8ef7` (blue) · `#34c98a` (green) · `#ff6719` (orange) · `#a78bfa` (purple)
343-
- Arrowhead markers, labelled nodes with actual topic concepts not placeholders
343+
- Arrowhead markers, labelled nodes with actual topic concepts - not placeholders
344344
- Routed to DeepSeek Flash (not the reasoning model) so all tokens go to SVG output
345345

346346
---
@@ -398,7 +398,7 @@ Test the full pipeline without any API calls:
398398
$env:BOOK_AGENT_FAKE=1; python book.py new --abstract "test" --pick 1; python book.py run
399399
```
400400

401-
Every node returns valid placeholder output lets you verify the pipeline loop, state machine, and exports locally.
401+
Every node returns valid placeholder output - lets you verify the pipeline loop, state machine, and exports locally.
402402

403403
---
404404

@@ -416,15 +416,15 @@ Every node returns valid placeholder output — lets you verify the pipeline loo
416416

417417
## Platform support
418418

419-
WRITING AGENT is **cross-platform** Linux, macOS, and Windows and CI runs the full
419+
WRITING AGENT is **cross-platform** - Linux, macOS, and Windows - and CI runs the full
420420
test suite on all three (Ubuntu · macOS · Windows) across Python 3.10–3.13 on every push.
421421

422422
| Concern | How it stays portable |
423423
|---|---|
424424
| Filesystem | `pathlib` everywhere; atomic writes via `os.replace`; ids validated/confined |
425425
| Console | Rich auto-detects the terminal and degrades; `--plain` / `NO_COLOR` for no styling; UTF-8 is forced on legacy Windows code pages |
426426
| Export links | clickable `file://` URIs built with `Path.as_uri()` (valid on Windows too) |
427-
| Compression | `headroom` is an optional extra with a platform marker real wheels on Linux/macOS, the pure-Python fallback on Windows |
427+
| Compression | `headroom` is an optional extra with a platform marker - real wheels on Linux/macOS, the pure-Python fallback on Windows |
428428
| External tools | `pandoc` is only needed for **DOCX** export (install separately and put on `PATH`); a clear error is shown if it's missing. All other formats are pure-Python. |
429429

430430
Per-OS install, activation, and offline-demo commands are in [Setup](#setup) and [Quick Start](#quick-start) above.
@@ -444,7 +444,7 @@ Per-OS install, activation, and offline-demo commands are in [Setup](#setup) and
444444

445445
## Contributing
446446

447-
Contributions welcome see **[CONTRIBUTING.md](CONTRIBUTING.md)** for the full guide.
447+
Contributions welcome - see **[CONTRIBUTING.md](CONTRIBUTING.md)** for the full guide.
448448

449449
```bash
450450
git clone https://github.com/vikast908/WritingAgent.git && cd WritingAgent

SECURITY.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ own machine. A few properties are worth understanding:
1818
The app reads it only to call OpenRouter.
1919
- **LLM-driven command execution:** the TUI's conversational assistant can propose
2020
commands that run automatically. Destructive/config commands (`delete`, `/user`,
21-
`/set`) are **blocked** from auto-execution the human must type them. Project/user
21+
`/set`) are **blocked** from auto-execution - the human must type them. Project/user
2222
ids are validated and deletes are confined to the brain directory.
2323
- **Generated content:** manuscripts and SVG diagrams come from an LLM. Exported HTML is
2424
sanitized (script/iframe/event handlers stripped), but treat generated output as

config/models.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ nodes:
88
writer: deepseek/deepseek-v4-pro # prose quality
99
consolidation: deepseek/deepseek-v4-pro # global reasoning across the whole book
1010
toc: deepseek/deepseek-v4-flash
11-
critic: deepseek/deepseek-v4-flash # independent judge a different model than the writer
11+
critic: deepseek/deepseek-v4-flash # independent judge - a different model than the writer
1212
summarizer: deepseek/deepseek-v4-flash # chapter summaries + canon extraction
1313
production: deepseek/deepseek-v4-flash # front/back matter + assembly
1414
learner: deepseek/deepseek-v4-flash # distill skills from a finished book

0 commit comments

Comments
 (0)