@clickminded/coauthor-cli 0.0.22 → 0.0.24

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.
@@ -1,274 +0,0 @@
1
- ---
2
- name: coauthor
3
- description: Use the CoAuthor Agent CLI for project/workflow operations instead of browser routes, curl, or direct database access. Applies when inspecting or advancing CoAuthor projects, operations, exports, publishing, tokens, or workflow status.
4
- ---
5
-
6
- This skill guides agent use of the CoAuthor CLI.
7
-
8
- ## CLI First
9
-
10
- - Prefer `coauthor` CLI commands for CoAuthor project and workflow work.
11
- - Do not drive browser routes, hand-written `curl`, or direct database edits when a CLI command covers the task.
12
- - Use the built-in production base URL (`https://tools.clickminded.com/coauthor`) by default. Do not point the CLI at `localhost` or start a local dev server unless the user explicitly asks to test local changes.
13
- - For local development only, pass an explicit one-off override such as `--base-url http://localhost:3000/coauthor` or `COAUTHOR_BASE_URL=http://localhost:3000/coauthor` for mounted dev, or `--base-url http://localhost:3000` for a root-mounted app.
14
- - Use `--json` for machine-readable output and parse fields from that output.
15
- - Use `--wait` for commands that start asynchronous work when the user expects the operation to finish.
16
- - Let the default bounded briefing review run before outline/draft generation. Use `--briefing-mode strict` when the user explicitly wants a stronger brief gate, and answer or relay `data.clarification_questions` if the CLI returns `status: "needs_clarification"`.
17
- - Treat `status: "credits_exhausted"` or `paused_credits_exhausted` as a saved, recoverable Starter pause. Do not ask a Starter user to add an API key: Starter cannot use BYOK. Report `reset_at`, `allowance`, `used`, `held`, and `remaining` from the response, then resume with `coauthor workflow resume <project-id> --wait --json` after credits reset.
18
- - Treat `status: "requires_key"` or `paused_requires_key` as a saved, recoverable Pro pause. Tell the user which `required_providers` are compatible, have them add the key in CoAuthor AI settings, then resume with `coauthor workflow resume <project-id> --wait --json`. Never ask them to paste a key into chat or the terminal.
19
- - Treat `coauthor_access_required` as an entitlement failure. Project and workflow commands remain blocked until CoAuthor access is restored; `coauthor auth status` and `coauthor auth logout` remain safe recovery commands.
20
- - Use normal `coauthor auth logout` so remote revocation is confirmed before local credentials are removed. If it fails, report that the credential was preserved for retry; never use `--local-only` unless the user explicitly accepts leaving the remote token potentially active.
21
- - Treat `entitlement_sync_unavailable` as a temporary Drip verification failure. Do not retry writes or credit-spending work in a loop. Read-only inspection may remain available while login and scheduled reconciliation retry verification.
22
- - Treat `status: "blocked_by_research"` as an actionable blocked state. Use the returned `recovery_commands` instead of retrying blindly.
23
- - Treat `status: "research_running_stale"` or `data.diagnostic.code: "research_running_stale"` as a stale research run. Inspect `coauthor research structured <project-id> --json` and use the returned next commands instead of retrying blindly.
24
- - Treat `status: "research_structuring"` or `data.diagnostic.code: "research_structuring"` as a normal transition after raw research completes. Keep waiting or resume toward draft; do not rewind or generate a draft until project state reaches `research_structured`.
25
- - If `coauthor research status <project-id> --json` returns `data.diagnostic.code: "research_run_state_mismatch"`, report the mismatch and use the returned recovery commands.
26
- - `coauthor workflow run <project-id> --target draft --wait` should not be treated as complete until the CLI reports draft completion, a key pause, terminal failure, `research_running_stale`, or `timed_out`.
27
- - For images, run `coauthor image list <project-id> --json` and pass an existing placeholder with `coauthor image generate <project-id> --placeholder-id <placeholder-id> --json`. Draft generation creates placeholders.
28
- - Use `coauthor credits <project-id> --json` to check credit allowance, pending credits, and remaining credits.
29
- - Use `coauthor share <project-id> --json` to mint or fetch the project's public share URL (`share_url`). Safe to call repeatedly: it returns the existing token instead of minting a new one.
30
- - Use `coauthor models list` to see user-visible planning and writing models. Use `--planning-model <id>` for outline/research-plan/workflow planning overrides and `--writing-model <id>` for draft/thread/workflow writing overrides; do not use a global `--model`.
31
- - Use `coauthor models preferences show|set` to inspect or update saved planning/writing preferences. Internal structuring models are not exposed through the CLI.
32
- - After a timeout, interruption, network error, or unclear result, check operation status before retrying.
33
- - `contract approve`, `outline approve`, and `research-plan approve` approve the saved artifact when `--data` is omitted. Pass `--data` only when intentionally approving a replacement payload.
34
-
35
- ## Draft-Stage Mutation Guard
36
-
37
- CoAuthor artifacts form a dependency chain: contract/brief -> outline -> research plan -> research -> draft. Saving or approving an upstream artifact after a draft exists can deliberately rewind the project and mark every downstream artifact stale, even though the saved draft version still exists.
38
-
39
- - Before any `contract save|approve`, `outline save|generate|approve`, or `research-plan save|generate|approve` on an existing project, inspect `coauthor workflow status <project-id> --json`. Also inspect `coauthor draft status <project-id> --json` when the project may already have reached drafting.
40
- - Treat `draft_generated` and `editing` as an upstream-artifact lock. While in either state, make requested prose or document changes with `coauthor draft save`; do not mirror draft changes back into the contract, outline, or research plan as a cleanup, bookkeeping, or finalization step.
41
- - Do not run an upstream `save`, `generate`, or `approve` command after `draft save` merely to record constraints discovered during editing. That command order can hide the draft in the web app by rewinding the project to an earlier stage.
42
- - Change an upstream artifact after drafting only when the user explicitly asks to revise the premise, structure, or research inputs and understands that CoAuthor must regenerate the downstream chain. Before the change, preserve the current document with `coauthor draft get <project-id> --format json --json`. Then complete the regeneration with `coauthor workflow run <project-id> --target draft --wait --json`; do not leave the project at an intermediate stale checkpoint.
43
- - After ordinary draft editing, finish with read-only verification such as `coauthor draft get`, `coauthor draft status`, or `coauthor workflow status`.
44
-
45
- ## Plans, Models, And Credits
46
-
47
- - Starter includes 2,500 credits per monthly subscription-anniversary period. It supports the full user-visible model list, but it cannot store or use customer provider keys. When its credits reach zero, work pauses until the next reset.
48
- - Pro includes 6,000 credits per monthly subscription-anniversary period. It also supports the full model list. CoAuthor uses included credits first, then can continue with a compatible configured provider key.
49
- - Model selection and BYOK are separate. A missing user key must never disable a supported model while included credits remain.
50
- - `coauthor credits <project-id> --json` reports the current plan, included allowance, used and held credits, remaining credits, and reset time. Do not infer a reset from a WooCommerce renewal event; periods derive from the original subscription start.
51
- - `byok_not_allowed` means the current plan cannot create, validate, or use provider keys. Starter users may delete keys retained from a previous Pro subscription, but those keys stay inactive until Pro access returns.
52
- - Device tokens do not grant CoAuthor access by themselves. A previously issued token can remain valid while project commands return `coauthor_access_required`; it becomes usable again if access is restored before the token expires or is revoked.
53
- - Drip tags alone determine customer access and plan. Subscription observations are diagnostic and set anniversary timing only: every status is retained, only an `active` observation can promote an anchor, and renewals do not reset credits.
54
- - A genuine later active resubscription starts new anniversary periods for work authorized on or after its start; historical periods and earlier work remain attached to the previous subscription.
55
- - The Supabase `admins` table is the canonical admin source. Admins bypass customer access and quota checks across web, billing, workers, and the agent API.
56
-
57
- ## Project Briefing
58
-
59
- - For simple starts, use `coauthor project create --title "..." --topic "prose brief" --audience "target reader" --json`.
60
- - When you know the editorial contract fields, prefer `coauthor project create --contract '<json>' --json` instead of cramming structured data into `--topic`.
61
- - Keep `--topic` as a plain prose brief. Do not pass JSON through `--topic`.
62
- - `--contract` accepts a JSON object. All fields are optional; omitted fields are normalized to defaults. Prefer including at least `topic`, `target_audience`, `core_promise`, and either `angle` or `additional_editorial_guidance` when known.
63
- - Top-level `--title`, `--topic`, and `--audience` can still be used with `--contract`; they fill missing project title, contract topic, or contract audience fields.
64
- - Editorial contract schema:
65
-
66
- ```ts
67
- {
68
- topic?: string
69
- angle?: string
70
- target_audience?: string
71
- core_promise?: string
72
- format?: string
73
- reading_commitment?: null | {
74
- kind: "preset" | "custom"
75
- preset_id?: null | "quick_read" | "balanced_post" | "deep_dive"
76
- source: "user_explicit" | "user_choice" | "assistant_inferred" | "system_default"
77
- }
78
- length_guidance?: {
79
- min_words?: number | null
80
- target_words?: number | null
81
- max_words?: number | null
82
- }
83
- audience_knowledge_assumptions?: string
84
- desired_reader_experience?: string
85
- structure_preferences?: string[]
86
- must_include?: string[]
87
- must_avoid?: string[]
88
- non_negotiables?: string[]
89
- evidence_expectations?: string[]
90
- citation_expectations?: string[]
91
- liked_examples?: string[]
92
- rejected_examples?: string[]
93
- additional_editorial_guidance?: string
94
- editorial_profile?: {
95
- tone?: "light" | "balanced" | "serious"
96
- form?: "essay" | "listicle" | "guide" | "case_study" | "analysis" | "mixed"
97
- depth?: "scannable" | "standard" | "deep"
98
- humor?: "none" | "low" | "medium" | "high"
99
- section_length?: "adaptive" | "mostly_short" | "mostly_long" | "mixed"
100
- cadence?: "tight" | "moderate" | "expansive"
101
- notes?: string
102
- }
103
- canonical_entities?: Array<{
104
- actor_key?: string
105
- character_name?: string
106
- role_title?: string
107
- description?: string
108
- aliases?: string[]
109
- must_preserve?: boolean
110
- }>
111
- outline_seed?: Array<{
112
- id?: string
113
- heading?: string
114
- intent?: string
115
- must_include_points?: string[]
116
- required_actor_keys?: string[]
117
- notes?: string
118
- }>
119
- style_rules?: string[]
120
- must_not_change?: string[]
121
- structure_preference?: string
122
- confidence_notes?: string
123
- }
124
- ```
125
-
126
- - Use `reading_commitment.kind: "preset"` with a preset id for quick length choices; use `"custom"` with explicit `length_guidance` when the user gives a custom range.
127
- - Use top-level `canonical_entities`, `outline_seed`, `style_rules`, `must_not_change`, `structure_preference`, and `confidence_notes`. A legacy nested `handoff` object may be normalized, but top-level fields are clearer for agents.
128
- - Field guidance:
129
- - `topic`: The concrete subject or assignment. Include the search keyword, product, debate, or source brief if that is the true starting point.
130
- - `angle`: The editorial thesis or framing. Use this to explain what makes this piece different from a generic article on the same topic.
131
- - `target_audience`: Who the piece is for, including their sophistication, context, objections, and buying or reading intent.
132
- - `core_promise`: The reader outcome. Phrase it as what the reader will understand, decide, or be able to do after reading.
133
- - `format`: Human-readable format label, such as `blog post`, `guide`, `listicle`, `case study`, or `long-form SEO comparison guide`.
134
- - `reading_commitment`: Use a preset when the user picked or implied a length tier. Use `custom` plus `length_guidance` when the user gave a specific range.
135
- - `length_guidance`: Word-count bounds. Use positive integers or `null`; keep `min_words <= target_words <= max_words` when known.
136
- - `audience_knowledge_assumptions`: What the reader already knows, so the draft does not over-explain or under-explain.
137
- - `desired_reader_experience`: How the finished piece should feel to read, such as fast and scannable, authoritative and comprehensive, funny but informative, or practical and no-fluff.
138
- - `structure_preferences`: List of preferred sections, ordering, comparison/table requirements, intro/conclusion instructions, or other structural choices.
139
- - `must_include`: Specific points, keywords, URLs, products, claims, examples, or sections that must appear.
140
- - `must_avoid`: Things to leave out, weak arguments, banned phrasings, unsupported claims, or misleading positioning.
141
- - `non_negotiables`: Hard constraints that would make the draft wrong if violated. Use this for stricter requirements than ordinary `must_avoid` guidance.
142
- - `evidence_expectations`: What kind of support the argument needs, such as official docs, pricing pages, public data, examples, or completed research.
143
- - `citation_expectations`: Which claims need links or citations, preferred source types, and any source URLs that should be used.
144
- - `liked_examples`: URLs, titles, patterns, or descriptions of examples to emulate.
145
- - `rejected_examples`: URLs, titles, patterns, or descriptions of examples to avoid.
146
- - `additional_editorial_guidance`: Any important prose brief that does not fit another field, including voice, pacing, product positioning, or inherited brief details.
147
- - `editorial_profile`: Structured style controls. Use `notes` for nuance that enum values cannot capture.
148
- - `canonical_entities`: Stable names for products, people, companies, characters, or concepts that must be referred to consistently. `actor_key` is the stable snake-case id used by `outline_seed.required_actor_keys`.
149
- - `outline_seed`: Suggested section plan. Use `required_actor_keys` to tie sections to entries in `canonical_entities`.
150
- - `style_rules`: Reusable sentence-level or formatting rules, such as short paragraphs, markdown tables, direct second person, or no academic hedging.
151
- - `must_not_change`: Facts, names, positioning statements, URLs, or product limitations that must survive editing unchanged.
152
- - `structure_preference`: A one-string summary of the overall structure. Use `structure_preferences` for the detailed list.
153
- - `confidence_notes`: Explain what the contract was based on and where uncertainty remains.
154
- - Real saved contract examples from the database, compacted for agent reuse:
155
-
156
- Deep SEO comparison guide:
157
-
158
- ```json
159
- {
160
- "topic": "Write a comprehensive long-form SEO comparison guide targeting the keyword \"mailchimp alternatives\" for ClickMinded Newsletter Generator.",
161
- "angle": "Satisfy standard Mailchimp alternatives search intent, then show the category-aware distinction between email sending platforms and newsletter production workflows.",
162
- "target_audience": "Busy founders, creators, consultants, solo marketers, agency owners, and small marketing teams evaluating Mailchimp competitors.",
163
- "core_promise": "Help readers choose the right Mailchimp alternative by use case while making clear that ClickMinded may be the better fix when the real bottleneck is newsletter production.",
164
- "format": "long-form SEO comparison guide",
165
- "reading_commitment": { "kind": "custom", "preset_id": null, "source": "user_explicit" },
166
- "length_guidance": { "min_words": 3200, "target_words": 3700, "max_words": 4200 },
167
- "desired_reader_experience": "Comprehensive, practical, fair, and category-aware.",
168
- "structure_preferences": ["Preserve the existing article structure and heading flow.", "Expand comparison depth for every platform."],
169
- "must_include": ["Primary keyword \"mailchimp alternatives\" in the H1, intro, one H2 or H3, and conclusion naturally.", "Cover MailerLite, Brevo, Kit, ActiveCampaign, beehiiv, Substack, Klaviyo, Omnisend, Constant Contact, Drip, and Campaign Monitor."],
170
- "must_avoid": ["Do not make ClickMinded sound like an ESP or Mailchimp replacement.", "Do not imply ClickMinded handles list management, deliverability, automations, forms, ecommerce, analytics, compliance management, or sending."],
171
- "non_negotiables": ["The article must satisfy search intent for \"mailchimp alternatives\" before pitching ClickMinded.", "The ClickMinded positioning must be category-accurate and honest."],
172
- "evidence_expectations": ["Use completed research and official pricing/features sources.", "Qualify pricing as current at time of writing."],
173
- "citation_expectations": ["Use current source links for pricing/features, especially official sources.", "Include the ClickMinded product page and CTA URLs exactly as required."],
174
- "editorial_profile": { "tone": "balanced", "form": "guide", "depth": "deep", "humor": "none", "section_length": "adaptive", "cadence": "moderate", "notes": "Long-form SEO comparison guide; practical, fair, and category-aware." },
175
- "canonical_entities": [
176
- { "actor_key": "clickminded_newsletter_generator", "character_name": "ClickMinded Newsletter Generator", "role_title": "AI newsletter generator and production workflow", "description": "A newsletter production layer. It is not an ESP.", "aliases": ["ClickMinded Newsletter Generator", "ClickMinded"], "must_preserve": true },
177
- { "actor_key": "mailchimp", "character_name": "Mailchimp", "role_title": "Email marketing platform / ESP", "description": "Email marketing software for list management, sending, automations, forms, templates, analytics, and related ESP functions.", "aliases": ["Mailchimp"], "must_preserve": true }
178
- ],
179
- "outline_seed": [
180
- { "id": "intro_quick_comparison", "heading": "The Best Mailchimp Alternatives in 2026", "intent": "Satisfy core search intent quickly and clarify replacement versus production workflow.", "must_include_points": ["Primary keyword in H1 and intro", "Clarify that some tools replace Mailchimp and ClickMinded complements it by solving production"], "required_actor_keys": ["mailchimp", "clickminded_newsletter_generator"], "notes": "" }
181
- ],
182
- "style_rules": ["Use Markdown headings and tables where helpful.", "Keep ClickMinded category-accurate and honest."],
183
- "must_not_change": ["ClickMinded is not an ESP.", "ClickMinded direct integrations: Mailchimp, GoHighLevel, Kit."],
184
- "structure_preference": "Preserve the same 10-section structure from the existing draft while expanding depth and word count.",
185
- "confidence_notes": "Based on a saved draft expansion request and a successful research run."
186
- }
187
- ```
188
-
189
- Search-intent listicle with examples:
190
-
191
- ```json
192
- {
193
- "topic": "A long-form SEO comparison/listicle article targeting \"mailchimp alternatives\" for ClickMinded Newsletter Generator.",
194
- "angle": "Compare email platforms by the expected criteria, then add the insight that switching ESPs does not solve the weekly newsletter production problem.",
195
- "target_audience": "Busy founders, creators, consultants, solo marketers, and small teams evaluating email marketing platforms.",
196
- "core_promise": "Help readers choose the right Mailchimp alternative while showing when newsletter production is the real bottleneck.",
197
- "format": "blog post",
198
- "reading_commitment": { "kind": "preset", "preset_id": "balanced_post", "source": "user_explicit" },
199
- "structure_preferences": ["Use an SEO-friendly H1 such as \"The Best Mailchimp Alternatives in 2026\".", "Include a quick comparison table before the detailed reviews."],
200
- "must_include": ["Primary keyword: mailchimp alternatives.", "ClickMinded Newsletter Generator product page: https://www.clickminded.com/products/newsletter/"],
201
- "must_avoid": ["Do not claim ClickMinded replaces Mailchimp for list management, deliverability, automations, forms, ecommerce, or sending.", "Do not use generic AI hype or imply a one-prompt ChatGPT-style wrapper."],
202
- "non_negotiables": ["The article must satisfy the \"Mailchimp alternatives\" search intent first.", "The ClickMinded pitch must be honest and category-accurate."],
203
- "citation_expectations": ["Include useful source links inline for competitor information and pricing claims.", "Use SERP references as structure/gap examples."],
204
- "liked_examples": ["Zapier alternatives posts for skimmable structure and practical recommendations.", "MailerLite comparison page for direct competitor positioning."],
205
- "rejected_examples": ["Thin SEO listicles that merely paraphrase feature pages without judgment.", "Vendor pages that pretend their tool is best for every use case."],
206
- "editorial_profile": { "tone": "balanced", "form": "essay", "depth": "standard", "humor": "low", "section_length": "adaptive", "cadence": "moderate", "notes": "Satisfy search intent first, then make the production-workflow insight feel obvious." },
207
- "style_rules": ["Use short paragraphs.", "Use clear H2s/H3s matching search intent."],
208
- "must_not_change": ["ClickMinded is not an ESP.", "ClickMinded direct integrations: Mailchimp, GoHighLevel, Kit."],
209
- "structure_preference": "Comparison/listicle with a strategic bridge section and a dedicated ClickMinded companion-workflow section.",
210
- "confidence_notes": "Created from ClickMinded product context and SERP research."
211
- }
212
- ```
213
-
214
- Persuasive opinion essay:
215
-
216
- ```json
217
- {
218
- "topic": "Whether people are justified in pressuring or shaming wealthy individuals into spending their money differently",
219
- "angle": "Directly address readers who complain about billionaire spending, then pivot to the deeper diagnosis: external locus of control and projected helplessness.",
220
- "target_audience": "Politically engaged readers who follow wealth and inequality debates and know the standard talking points.",
221
- "core_promise": "Readers get a confrontational but empowering argument: policing billionaire spending is often emotional, the exploitation narrative is weaker than it looks, and the better answer is to build agency.",
222
- "format": "blog post",
223
- "reading_commitment": { "kind": "preset", "preset_id": "balanced_post", "source": "user_explicit" },
224
- "length_guidance": { "min_words": 1200, "target_words": 1500, "max_words": 1800 },
225
- "must_include": ["Confrontational second-person opening hook about outrage at billionaire spending.", "Name external locus of control explicitly.", "Central reframe: stop outsourcing your sense of agency to what someone else does with their money."],
226
- "must_avoid": ["Do not turn this into a money-printing, COVID-spending, or MMT thread.", "Do not use the word communism or slippery-slope-to-communism phrasing.", "Do not soften, hedge, or both-sides the core argument."],
227
- "citation_expectations": ["Cost of a single NYC subway station.", "Annual US Medicare cost and approximate Elon Musk net worth for scale comparison.", "Rolex foundation ownership and limits on public profit claims."],
228
- "editorial_profile": { "tone": "balanced", "form": "essay", "depth": "standard", "humor": "low", "section_length": "adaptive", "cadence": "moderate", "notes": "Reasoned and persuasive; do not make it a pure political rant or strawman the opposing view." },
229
- "style_rules": ["Confident first-person or direct second-person OK.", "No hedge-everything academic tone.", "Use concrete scale comparisons rather than abstract moralizing."]
230
- }
231
- ```
232
-
233
- ## Safety
234
-
235
- - Never print access tokens, publish tokens, service-role keys, cookies, or authorization headers.
236
- - Never ask the user to paste Anthropic, OpenAI, or Gemini provider API keys into chat or the terminal; key entry belongs in CoAuthor AI settings.
237
- - Pass tokens through environment variables or secret-backed CLI options only; do not paste them into prompts, logs, or shell history.
238
- - Treat publish/export operations as live side effects.
239
- - Require explicit user intent before live publish/export.
240
- - Include `--yes` only when the user has clearly approved the live publish/export action.
241
-
242
- ## Workflow
243
-
244
- 1. Identify the project, operation, or export target.
245
- 2. Run the relevant `coauthor` command with `--json`.
246
- 3. Add `--wait` when starting or advancing asynchronous work.
247
- 4. If anything is uncertain, query workflow/research/draft status and report the current state.
248
- 5. For live publish/export, confirm explicit user intent, then run with `--yes`.
249
-
250
- ## Chat Transcript
251
-
252
- Use `coauthor chat show <project-id> --json` to retrieve the workspace chat transcript, especially after long chat responses that may be truncated in terminal capture.
253
-
254
- When using `coauthor chat <project-id> --stage draft --json`, treat the returned text as a workspace chat response, not a saved draft document. The CLI returns `draft_saved: false` and `transcript_command` when applicable. Use `coauthor draft get <project-id> --format markdown --json` only for a saved generated draft.
255
-
256
- ## Editing a Draft
257
-
258
- Two ways to change a generated draft. Both work whichever editor the user has opened the draft in.
259
-
260
- - **Revise by instruction (prose changes):** `coauthor draft revise <project-id> --instruction "Make the intro two sentences" --wait --json`. CoAuthor's own editor rewrites the draft in the project's voice and returns `data.groups`, each with `before_markdown` and `after_markdown`. Review every group against the brief before applying: `coauthor draft revision apply <project-id> <revision-id> --json`, keep only some with `--accept g1,g2` or `--reject g3`, or drop it with `coauthor draft revision discard <project-id> <revision-id> --json`. Only one revision can be open on a draft; an unresolved one blocks the user's browser saves, so always apply or discard it. If `--wait` returns `still_running`, run `coauthor draft revision show <project-id> <revision-id> --json` again. `revise_unavailable` means this account cannot revise by instruction yet; use a direct edit.
261
- - **Direct edit (exact text you already have):** `coauthor draft get <project-id> --format json --json`, edit nodes inside `data.content` (keep node ids and `imagePlaceholder` nodes), write `{"document_id": ..., "expected_base_version": <data.version_number>, "expected_content_hash": <data.content_hash, if present>, "content": <edited doc>}` to a file, then `coauthor draft save <project-id> --data @payload.json --json`. Never send markdown as `content`.
262
- - On `stale_draft`, re-read with `draft get` and reapply your edit; never retry the same payload. On `user_recently_editing`, the user is typing in the browser: wait or ask them, and pass `--force` only if they agree.
263
-
264
- ## Draft Export
265
-
266
- Use `coauthor draft get <project-id> --format markdown --json` when the user needs a finished draft in Markdown. Generated images are resolved into Markdown image URLs when available.
267
-
268
- Use `coauthor draft get <project-id> --format html --json` when the user needs HTML with resolved image tags.
269
-
270
- Use `coauthor draft get <project-id> --format text --json` when the user needs plain text with image URL references.
271
-
272
- Use `coauthor draft get <project-id> --format json --json` or omit `--format` when the user needs the raw editor document JSON.
273
-
274
- Use `coauthor export wordpress <project-id> --yes --slug <slug> --json` to export a saved draft to WordPress. If more than one WordPress connection exists, pass `--connection-id <id>`.