cowriter 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +283 -0
- package/assets/cowriter-header.png +0 -0
- package/frontend/app/api/cowriter/codex/route.ts +65 -0
- package/frontend/app/api/cowriter/cover/route.ts +45 -0
- package/frontend/app/api/cowriter/events/hub.ts +24 -0
- package/frontend/app/api/cowriter/events/route.ts +77 -0
- package/frontend/app/api/cowriter/route.ts +83 -0
- package/frontend/app/api/cowriter/selection/route.ts +69 -0
- package/frontend/app/api/cowriter/selection/store.ts +27 -0
- package/frontend/app/globals.css +274 -0
- package/frontend/app/layout.tsx +14 -0
- package/frontend/app/page.tsx +1554 -0
- package/frontend/components/ui.tsx +66 -0
- package/frontend/lib/highlight.ts +53 -0
- package/frontend/lib/markdown.ts +47 -0
- package/frontend/lib/project.ts +335 -0
- package/frontend/lib/skills.ts +15 -0
- package/frontend/lib/turndown-plugin-gfm.d.ts +5 -0
- package/frontend/lib/types.ts +143 -0
- package/frontend/lib/utils.ts +6 -0
- package/frontend/lib/writing-skills.json +58 -0
- package/frontend/next-env.d.ts +6 -0
- package/frontend/next.config.js +10 -0
- package/frontend/package.json +44 -0
- package/frontend/postcss.config.mjs +7 -0
- package/frontend/tsconfig.json +22 -0
- package/package.json +62 -0
- package/scripts/cowriter-ai.mjs +1126 -0
- package/templates/init/.codex/skills/cowriter/SKILL.md +273 -0
- package/templates/init/.codex/skills/cowriter/references/actions.md +52 -0
- package/templates/init/.codex/skills/cowriter/references/character-voice.md +23 -0
- package/templates/init/.codex/skills/cowriter/references/context-priming.md +15 -0
- package/templates/init/.codex/skills/cowriter/references/continuity-review.md +22 -0
- package/templates/init/.codex/skills/cowriter/references/import-existing.md +16 -0
- package/templates/init/.codex/skills/cowriter/references/onboarding.md +45 -0
- package/templates/init/.codex/skills/cowriter/references/project-model.md +45 -0
- package/templates/init/.codex/skills/cowriter/references/prose-diagnostics.md +33 -0
- package/templates/init/.codex/skills/cowriter/references/prose-review.md +22 -0
- package/templates/init/.codex/skills/cowriter/references/scene-planning.md +28 -0
- package/templates/init/.codex/skills/cowriter/references/state-updates.md +22 -0
- package/templates/init/.codex/skills/cowriter/references/title-brainstorming.md +27 -0
- package/templates/init/.cowriter/project.yaml +3 -0
- package/templates/init/.cowriter/reports/.gitkeep +1 -0
- package/templates/init/AGENTS.md +79 -0
- package/templates/init/chapters/001-opening.md +0 -0
- package/templates/init/characters/primary-character.yaml +6 -0
- package/templates/init/outline.yaml +4 -0
- package/templates/init/story.yaml +8 -0
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# Cowriter Book Project
|
|
2
|
+
|
|
3
|
+
This folder is a Cowriter book project. Keep manuscript and story materials
|
|
4
|
+
as the center of gravity.
|
|
5
|
+
|
|
6
|
+
Use the Cowriter workspace from the app repo:
|
|
7
|
+
|
|
8
|
+
```sh
|
|
9
|
+
npx cowriter info -o json
|
|
10
|
+
npx cowriter inspect -o json
|
|
11
|
+
npx cowriter serve --open
|
|
12
|
+
npx cowriter upgrade
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Durable files:
|
|
16
|
+
|
|
17
|
+
- `chapters/*.md` for manuscript chapters.
|
|
18
|
+
- `story.yaml` for title, synopsis, setting, themes, genre, tone, perspective,
|
|
19
|
+
and continuity.
|
|
20
|
+
- `characters/*.yaml` for character records.
|
|
21
|
+
- `outline.yaml` for outline beats.
|
|
22
|
+
- `.cowriter/project.yaml` for project metadata.
|
|
23
|
+
|
|
24
|
+
You should edit these files directly. Do not hold accepted manuscript or
|
|
25
|
+
story-bible changes in chat, and do not require action JSON for normal writing
|
|
26
|
+
edits.
|
|
27
|
+
|
|
28
|
+
Ask one onboarding question at a time. Wait for the writer's answer before
|
|
29
|
+
asking the next question; do not bundle premise, protagonist, setting, ending,
|
|
30
|
+
and folder questions into one turn unless the writer explicitly asks for a
|
|
31
|
+
checklist.
|
|
32
|
+
|
|
33
|
+
If the localhost Cowriter workspace is not open in Codex Browser, or it is
|
|
34
|
+
open on a different port, tell the writer to run
|
|
35
|
+
`npx cowriter serve --open` from the book folder and open the reported
|
|
36
|
+
localhost URL. Do not start the long-running serve process yourself unless the
|
|
37
|
+
writer explicitly asks.
|
|
38
|
+
|
|
39
|
+
The workspace publishes current manuscript selection context for the served book.
|
|
40
|
+
If the writer asks about selected text and that text is not already available in
|
|
41
|
+
chat or file context, use the selection API when it would materially improve the
|
|
42
|
+
response:
|
|
43
|
+
|
|
44
|
+
```sh
|
|
45
|
+
curl -sS "$COWRITER_URL/api/cowriter/selection"
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
The response includes `selection.selectedText`, chapter metadata, range,
|
|
49
|
+
surrounding text, and `updatedAt`, or `selection: null` when nothing useful is
|
|
50
|
+
selected. Treat the endpoint as optional context, not a required step for every
|
|
51
|
+
request.
|
|
52
|
+
|
|
53
|
+
When discussing a specific manuscript passage with the writer, call the
|
|
54
|
+
Cowriter highlight API so the web UI selects that passage. Derive
|
|
55
|
+
`COWRITER_URL` from `cowriter info -o json` at `app.url`, then call:
|
|
56
|
+
|
|
57
|
+
```sh
|
|
58
|
+
curl -sS -X POST "$COWRITER_URL/api/cowriter/codex" \
|
|
59
|
+
-H 'content-type: application/json' \
|
|
60
|
+
--data '{"command":"highlight","text":"exact passage text","chapterPath":"chapters/001-opening.md"}'
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Use `occurrence` when the same passage appears more than once. If the UI is not
|
|
64
|
+
open or the passage is not found, continue the writing conversation normally.
|
|
65
|
+
|
|
66
|
+
Save approved changes as you go. When the writer accepts a manuscript or
|
|
67
|
+
story-material change, immediately edit the relevant `chapters/*.md`,
|
|
68
|
+
`story.yaml`, `characters/*.yaml`, or `outline.yaml` file, then inspect the
|
|
69
|
+
project to confirm it changed. The Cowriter web workspace watches these
|
|
70
|
+
files and reloads automatically.
|
|
71
|
+
|
|
72
|
+
Commit at sensible creative checkpoints: after accepted onboarding material, a
|
|
73
|
+
scene/chapter draft or revision pass, a stable continuity/story-bible update,
|
|
74
|
+
before switching task types, and before pausing or ending a work session.
|
|
75
|
+
Before committing, run `git status --short`, review the relevant diff, and
|
|
76
|
+
stage only Cowriter book files for the completed writing unit. Saving and
|
|
77
|
+
committing are separate responsibilities.
|
|
78
|
+
|
|
79
|
+
Write YAML and markdown with 80 character line wraps.
|
|
File without changes
|