@clickminded/coauthor-cli 0.0.81 → 0.0.82
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/dist/commands.js
CHANGED
|
@@ -2076,6 +2076,22 @@ function revisionMessage(artifact, data) {
|
|
|
2076
2076
|
if (diff.reordered === true)
|
|
2077
2077
|
lines.push('Sections were reordered.');
|
|
2078
2078
|
}
|
|
2079
|
+
const notApplied = getResponseValue(data, 'not_applied');
|
|
2080
|
+
if (Array.isArray(notApplied) && notApplied.length > 0) {
|
|
2081
|
+
lines.push(`Not applied (${notApplied.length}):`);
|
|
2082
|
+
for (const entry of notApplied) {
|
|
2083
|
+
const record = entry && typeof entry === 'object' && !Array.isArray(entry) ? entry : {};
|
|
2084
|
+
const request = typeof record.request === 'string' ? record.request : JSON.stringify(entry);
|
|
2085
|
+
const reason = typeof record.reason === 'string' && record.reason ? ` (${record.reason})` : '';
|
|
2086
|
+
lines.push(`- ${request}${reason}`);
|
|
2087
|
+
}
|
|
2088
|
+
}
|
|
2089
|
+
const plan = getResponseValue(data, 'research_plan');
|
|
2090
|
+
if (plan && typeof plan === 'object' && !Array.isArray(plan) && plan.stale === true) {
|
|
2091
|
+
const missing = plan.sections_without_tasks;
|
|
2092
|
+
const names = Array.isArray(missing) ? missing.filter((name) => typeof name === 'string') : [];
|
|
2093
|
+
lines.push(`The research plan is out of date${names.length ? ` (no tasks for: ${names.join('; ')})` : ''}. After approving the outline, run: coauthor research-plan generate <project-id> --json`);
|
|
2094
|
+
}
|
|
2079
2095
|
lines.push(`Review it with: coauthor ${artifact} show <project-id> --json, then approve with: coauthor ${artifact} approve <project-id> --json`);
|
|
2080
2096
|
return lines.join('\n');
|
|
2081
2097
|
}
|
|
@@ -3872,7 +3888,7 @@ function commandHelp(command) {
|
|
|
3872
3888
|
'Usage: coauthor outline <show|generate|revise|save|approve> <project-id> [--feedback "..."] [--data <json|@file>] [--planning-model <id>] [--json]',
|
|
3873
3889
|
'',
|
|
3874
3890
|
'generate creates an outline without approving it (data.sections). show returns the saved outline (data.artifact).',
|
|
3875
|
-
'revise --feedback: CoAuthor rewrites the outline from your feedback, saves it (not approved), and returns data.diff.',
|
|
3891
|
+
'revise --feedback: CoAuthor rewrites the outline from your feedback, saves it (not approved), and returns data.diff and data.not_applied (requested changes it did not make, with reasons).',
|
|
3876
3892
|
'save replaces it with the complete list {"sections":[...]}; omitted sections are removed. approve approves the saved outline.',
|
|
3877
3893
|
].join('\n'),
|
|
3878
3894
|
'research-plan': [
|
package/package.json
CHANGED
package/skills/coauthor/SKILL.md
CHANGED
|
@@ -33,7 +33,7 @@ Typical timing: brief and outline under a minute; research and draft 3–10 minu
|
|
|
33
33
|
**Profile first.** A writer profile carries the voice, writer and business context, and image style, and a project keeps its profile for good. Run `coauthor profile list --json`. With one profile, omit `--profile`. With several, pick the one that fits the request (for example the company blog vs a personal newsletter) and ask the user if it isn't clear.
|
|
34
34
|
**Sources.** If the user gave you documents to work from (PDF, .txt, .md), add each before research: `coauthor source add <id> <file> --json` (up to 5; see `references/brief-and-contract.md`). Put source URLs in the brief instead.
|
|
35
35
|
2. **Brief review.** `coauthor brief review <id> --json`. CoAuthor critiques the brief and returns `data.verdict`, `data.concerns`, and `data.questions`, each with `why`, the `field` it changes, and `answerable_by`. Answer the `agent` questions from your context; take `human` ones (opinions, private business facts, numbers, risk tolerance) to the user in one message, or, if they asked not to be interrupted, answer them as assumptions. Write `{"answers":[{"question","answer","source":"agent|user|assumption"}]}` to a file (add `"apply_suggested_patch": <data.suggested_patch>` if its suggestions are good) and run `coauthor brief answer <id> --data @answers.json --json`. Repeat once if the verdict was `needs_answers`, then approve: `coauthor contract approve <id> --json`. Log what you assumed: `coauthor log add <id> --kind assumption --message "..." --json`.
|
|
36
|
-
3. **Outline checkpoint.** `coauthor outline generate <id> --json` (this does not approve it; sections are in `data.sections`). Review it as the user's editor: every section serves the core promise, must-includes are covered, the order builds, nothing is generic, repeated, or unsupported. Find problems; a bare approval is the exception. Send all your changes in one request: `coauthor outline revise <id> --feedback "Merge sections 3 and 4. Replace the conclusion with a one-week checklist." --json`. It saves the revision and returns `data.diff` (added, removed, renamed, changed, reordered); check the diff matches what you asked, and revise again (at most twice) if not. For exact wording you already have, `coauthor outline save <id> --data @outline.json --json` with the complete `{"sections":[...]}` instead. Then `coauthor outline approve <id> --json` and log it (`coauthor log add <id> --message "Approved the outline after …" --json`). If the user asked to see the outline, show it to them here and wait.
|
|
36
|
+
3. **Outline checkpoint.** `coauthor outline generate <id> --json` (this does not approve it; sections are in `data.sections`). Review it as the user's editor: every section serves the core promise, must-includes are covered, the order builds, nothing is generic, repeated, or unsupported. Find problems; a bare approval is the exception. Send all your changes in one request: `coauthor outline revise <id> --feedback "Merge sections 3 and 4. Replace the conclusion with a one-week checklist." --json`. It saves the revision and returns `data.diff` (added, removed, renamed, changed, reordered); check the diff matches what you asked, and revise again (at most twice) if not. `data.not_applied` lists any requested change CoAuthor did not make, each with `request` and `reason`; resend those with clearer wording or tell the user why they were left out. When `data.research_plan.stale` is true (the outline changed after a research plan was made; `sections_without_tasks` lists sections it does not cover), run `coauthor research-plan generate <id> --json` after approving the outline instead of approving the old plan. For exact wording you already have, `coauthor outline save <id> --data @outline.json --json` with the complete `{"sections":[...]}` instead. Then `coauthor outline approve <id> --json` and log it (`coauthor log add <id> --message "Approved the outline after …" --json`). If the user asked to see the outline, show it to them here and wait.
|
|
37
37
|
4. **Research-plan checkpoint.** `coauthor research-plan generate <id> --json` (tasks in `data.research_tasks`). Check every section has a task, every claim that needs proof points at the right sources (including URLs the user gave you), and deep research is used only where it matters. Fix it with `coauthor research-plan revise <id> --feedback "Add a task for the checklist section. Use https://… as a required source for the limits section." --json` and check `data.diff`, then `coauthor research-plan approve <id> --json` and log it.
|
|
38
38
|
5. **Research and draft.** `COAUTHOR_CLI_WAIT_TIMEOUT_MS=540000 coauthor workflow run <id> --target draft --wait --json`. It is done when the message says the draft completed (`data.draft_status.project_state` is `draft_generated`); ignore the stale `data.workflow.status`. On `timed_out`: `coauthor workflow resume <id> --target draft --wait --json`.
|
|
39
39
|
6. **Quality pass.** CoAuthor already checks each new draft against the brief and for consistency, and fixes what it can: must-include items, non-negotiables, tables vs their sections, "see the table" references, unsourced "most readers" claims, FAQ answers that defer, and links (cut-short or malformed URLs, dead pages, citations that open a page about something else). Whatever is still open is in `quality_check.unresolved` of `coauthor draft status <id> --json` (and `post-details show`), and the completion message says how many. Fix those first. Then `coauthor draft get <id> --format markdown --json` and read `data.markdown` in full. Check it against the brief's must-include, must-avoid, and non-negotiables. Look for: notes about the research process ("the retrieved sources do not…"), invented "checked <date>" lines, numbered lists that restart at 1, garbled `*`, `_`, or code spans, literal `[ ]` in checklists, the same caveat repeated across sections, claims without a source or cited to a page that doesn't support them, contradictions, and a messy Sources list (generic titles like "Google", duplicate entries). Fix them in step 8.
|
|
@@ -22,6 +22,7 @@ Every failure prints JSON on stderr with `ok: false`, `error` (a readable messag
|
|
|
22
22
|
| `draft_exists` | `brief answer` on a project that already has a draft. | Edit the draft instead. `--force` only if the user wants to restart from the brief (the draft is regenerated). |
|
|
23
23
|
| `downstream_exists` | `outline revise` or `research-plan revise` after research ran. | Same: edit the draft, or `--force` to restart from that stage with the user's OK. |
|
|
24
24
|
| `outline_generation_failed` | `outline generate` (or `workflow run`/`advance` reaching the outline) couldn't produce an outline. Nothing was saved; the current outline is unchanged. | Retry once after a minute. If it fails again, tell the user; never write a generic outline yourself and approve it. |
|
|
25
|
+
| `research_plan_stale` | `research-plan approve` on a plan made before the outline changed, with no tasks for some current sections. | `coauthor research-plan generate <id> --json`, review it, then approve. |
|
|
25
26
|
| `revision_invalid` | CoAuthor's revision referenced sections that don't exist. | Run `revise` again with feedback that names sections by their current headings. |
|
|
26
27
|
| `stale_draft` | The draft changed after you read it. | Re-read with `draft get`, reapply your edit, save. |
|
|
27
28
|
| `user_recently_editing` | The user saved in the browser in the last 90 seconds. | Wait, or ask them. `--force` only with their OK. |
|
|
@@ -35,7 +35,7 @@ Typical timing: brief and outline under a minute; research and draft 3–10 minu
|
|
|
35
35
|
**Profile first.** A writer profile carries the voice, writer and business context, and image style, and a project keeps its profile for good. Run `coauthor profile list --json`. With one profile, omit `--profile`. With several, pick the one that fits the request (for example the company blog vs a personal newsletter) and ask the user if it isn't clear.
|
|
36
36
|
**Sources.** If the user gave you documents to work from (PDF, .txt, .md), add each before research: `coauthor source add <id> <file> --json` (up to 5; see `references/brief-and-contract.md`). Put source URLs in the brief instead.
|
|
37
37
|
2. **Brief review.** `coauthor brief review <id> --json`. CoAuthor critiques the brief and returns `data.verdict`, `data.concerns`, and `data.questions`, each with `why`, the `field` it changes, and `answerable_by`. Answer the `agent` questions from your context; take `human` ones (opinions, private business facts, numbers, risk tolerance) to the user in one message, or, if they asked not to be interrupted, answer them as assumptions. Write `{"answers":[{"question","answer","source":"agent|user|assumption"}]}` to a file (add `"apply_suggested_patch": <data.suggested_patch>` if its suggestions are good) and run `coauthor brief answer <id> --data @answers.json --json`. Repeat once if the verdict was `needs_answers`, then approve: `coauthor contract approve <id> --json`. Log what you assumed: `coauthor log add <id> --kind assumption --message "..." --json`.
|
|
38
|
-
3. **Outline checkpoint.** `coauthor outline generate <id> --json` (this does not approve it; sections are in `data.sections`). Review it as the user's editor: every section serves the core promise, must-includes are covered, the order builds, nothing is generic, repeated, or unsupported. Find problems; a bare approval is the exception. Send all your changes in one request: `coauthor outline revise <id> --feedback "Merge sections 3 and 4. Replace the conclusion with a one-week checklist." --json`. It saves the revision and returns `data.diff` (added, removed, renamed, changed, reordered); check the diff matches what you asked, and revise again (at most twice) if not. For exact wording you already have, `coauthor outline save <id> --data @outline.json --json` with the complete `{"sections":[...]}` instead. Then `coauthor outline approve <id> --json` and log it (`coauthor log add <id> --message "Approved the outline after …" --json`). If the user asked to see the outline, show it to them here and wait.
|
|
38
|
+
3. **Outline checkpoint.** `coauthor outline generate <id> --json` (this does not approve it; sections are in `data.sections`). Review it as the user's editor: every section serves the core promise, must-includes are covered, the order builds, nothing is generic, repeated, or unsupported. Find problems; a bare approval is the exception. Send all your changes in one request: `coauthor outline revise <id> --feedback "Merge sections 3 and 4. Replace the conclusion with a one-week checklist." --json`. It saves the revision and returns `data.diff` (added, removed, renamed, changed, reordered); check the diff matches what you asked, and revise again (at most twice) if not. `data.not_applied` lists any requested change CoAuthor did not make, each with `request` and `reason`; resend those with clearer wording or tell the user why they were left out. When `data.research_plan.stale` is true (the outline changed after a research plan was made; `sections_without_tasks` lists sections it does not cover), run `coauthor research-plan generate <id> --json` after approving the outline instead of approving the old plan. For exact wording you already have, `coauthor outline save <id> --data @outline.json --json` with the complete `{"sections":[...]}` instead. Then `coauthor outline approve <id> --json` and log it (`coauthor log add <id> --message "Approved the outline after …" --json`). If the user asked to see the outline, show it to them here and wait.
|
|
39
39
|
4. **Research-plan checkpoint.** `coauthor research-plan generate <id> --json` (tasks in `data.research_tasks`). Check every section has a task, every claim that needs proof points at the right sources (including URLs the user gave you), and deep research is used only where it matters. Fix it with `coauthor research-plan revise <id> --feedback "Add a task for the checklist section. Use https://… as a required source for the limits section." --json` and check `data.diff`, then `coauthor research-plan approve <id> --json` and log it.
|
|
40
40
|
5. **Research and draft.** `COAUTHOR_CLI_WAIT_TIMEOUT_MS=540000 coauthor workflow run <id> --target draft --wait --json`. It is done when the message says the draft completed (`data.draft_status.project_state` is `draft_generated`); ignore the stale `data.workflow.status`. On `timed_out`: `coauthor workflow resume <id> --target draft --wait --json`.
|
|
41
41
|
6. **Quality pass.** CoAuthor already checks each new draft against the brief and for consistency, and fixes what it can: must-include items, non-negotiables, tables vs their sections, "see the table" references, unsourced "most readers" claims, FAQ answers that defer, and links (cut-short or malformed URLs, dead pages, citations that open a page about something else). Whatever is still open is in `quality_check.unresolved` of `coauthor draft status <id> --json` (and `post-details show`), and the completion message says how many. Fix those first. Then `coauthor draft get <id> --format markdown --json` and read `data.markdown` in full. Check it against the brief's must-include, must-avoid, and non-negotiables. Look for: notes about the research process ("the retrieved sources do not…"), invented "checked <date>" lines, numbered lists that restart at 1, garbled `*`, `_`, or code spans, literal `[ ]` in checklists, the same caveat repeated across sections, claims without a source or cited to a page that doesn't support them, contradictions, and a messy Sources list (generic titles like "Google", duplicate entries). Fix them in step 8.
|
|
@@ -741,6 +741,7 @@ Every failure prints JSON on stderr with `ok: false`, `error` (a readable messag
|
|
|
741
741
|
| `draft_exists` | `brief answer` on a project that already has a draft. | Edit the draft instead. `--force` only if the user wants to restart from the brief (the draft is regenerated). |
|
|
742
742
|
| `downstream_exists` | `outline revise` or `research-plan revise` after research ran. | Same: edit the draft, or `--force` to restart from that stage with the user's OK. |
|
|
743
743
|
| `outline_generation_failed` | `outline generate` (or `workflow run`/`advance` reaching the outline) couldn't produce an outline. Nothing was saved; the current outline is unchanged. | Retry once after a minute. If it fails again, tell the user; never write a generic outline yourself and approve it. |
|
|
744
|
+
| `research_plan_stale` | `research-plan approve` on a plan made before the outline changed, with no tasks for some current sections. | `coauthor research-plan generate <id> --json`, review it, then approve. |
|
|
744
745
|
| `revision_invalid` | CoAuthor's revision referenced sections that don't exist. | Run `revise` again with feedback that names sections by their current headings. |
|
|
745
746
|
| `stale_draft` | The draft changed after you read it. | Re-read with `draft get`, reapply your edit, save. |
|
|
746
747
|
| `user_recently_editing` | The user saved in the browser in the last 90 seconds. | Wait, or ask them. `--force` only with their OK. |
|