@respeak/recap 0.3.0 → 0.5.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/skill/SKILL.md ADDED
@@ -0,0 +1,120 @@
1
+ ---
2
+ name: recap-docs-sync
3
+ description: Sync a repo's docs folder to its Recap project with the @respeak/recap CLI. Use when publishing or updating product documentation, checking whether local docs match what's live (docs.respeak.io), or before/after editing Markdown under a docs folder that contains a sync.json.
4
+ ---
5
+
6
+ <!-- Generated by `recap skill` from @respeak/recap v{{RECAP_VERSION}}. Do not edit by hand — run `npx @respeak/recap skill --update` to refresh from the CLI (the source of truth). -->
7
+
8
+ # Recap docs sync (`recap` CLI)
9
+
10
+ Publish a repo's Markdown docs to Recap with the `@respeak/recap` CLI, run via
11
+ `npx` — nothing to install.
12
+
13
+ ## Prerequisites
14
+
15
+ - A docs folder containing `sync.json` (plus `en/`, optional other languages like
16
+ `de/`, and `media/` for images).
17
+ - An org API key (`rd_…`) from the Recap dashboard under **API Keys**.
18
+
19
+ Authentication — either works:
20
+
21
+ - `export RECAP_API_KEY=rd_…` (preferred for a shell session), **or**
22
+ - pass `--api-key rd_…` on any command.
23
+
24
+ The target defaults to `https://docs.respeak.io`. For local dev, add
25
+ `--url http://localhost:3000`.
26
+
27
+ ## Workflow: always `diff` before `push`
28
+
29
+ **1. Check for drift — read-only, safe to run anytime:**
30
+
31
+ ```bash
32
+ npx @respeak/recap diff ./docs
33
+ ```
34
+
35
+ Reports structural drift, per-article content changes (with the file path),
36
+ unresolved cross-links, media differences, and project-metadata changes. A clean
37
+ repo prints **"Local and remote are IN SYNC."** — trust it as a pre-push gate.
38
+
39
+ - `--verbose` prints the exact text that changed for each article.
40
+ - `--exit-code` exits `1` when drift is found (use this to gate automation).
41
+
42
+ **2. Publish — declarative, mutates the project:**
43
+
44
+ ```bash
45
+ npx @respeak/recap push ./docs
46
+ ```
47
+
48
+ ⚠️ **`push` is declarative by default: any chapter or article NOT in `sync.json`
49
+ is DELETED on the server.** Always `diff` first and read what would be removed.
50
+ `push --dry-run` is identical to `diff`. Push prints a summary including an
51
+ `images:` line so you can confirm media uploaded.
52
+
53
+ ### Granular / additive push
54
+
55
+ When you only changed part of the docs, or your local folder is a partial copy,
56
+ scope the push so nothing else is touched:
57
+
58
+ ```bash
59
+ # Push one article (chapter-slug/article-slug). Additive — deletes nothing.
60
+ npx @respeak/recap push ./docs --only getting-started/installation
61
+
62
+ # Push a whole chapter (all its articles). Additive.
63
+ npx @respeak/recap push ./docs --only getting-started
64
+
65
+ # Push everything but never delete remote items missing locally.
66
+ npx @respeak/recap push ./docs --no-prune
67
+ ```
68
+
69
+ `--only` selectors are `chapter-slug` or `chapter-slug/article-slug` (the slugs
70
+ from `sync.json`); pass several to push a set. Both `--only` and `--no-prune`
71
+ are **additive**: only the upserts happen, and remote items absent from the
72
+ payload are left alone. Cross-links still resolve against the full doc set, so a
73
+ scoped push won't break links to pages it didn't send. A selector that matches
74
+ nothing in `sync.json` fails loudly.
75
+
76
+ To remove something from the server (the additive counterpart to `--only`):
77
+
78
+ ```bash
79
+ npx @respeak/recap rm ./docs --only old-chapter # delete a chapter (articles cascade)
80
+ npx @respeak/recap rm ./docs --only guides/deprecated # delete one article (all languages)
81
+ ```
82
+
83
+ `rm` reads only `project_slug` from `sync.json`, so the targets need not still
84
+ exist locally — run it after deleting the files. It confirms before deleting
85
+ (`-y` skips the prompt).
86
+
87
+ ## Behaviors worth remembering
88
+
89
+ - Content is **Markdown**; the CLI and server convert it to the editor format.
90
+ Custom blocks are supported: `:::note` / `:::warning` / `:::tip`, `:::steps`
91
+ (each `###` = a step), `:::tabs` with `::tab{title="…"}`, and
92
+ `<details><summary>…</summary>…</details>`.
93
+ - Cross-links between docs use repo-relative `.md` paths (e.g.
94
+ `[x](../other/page.md)`); they're rewritten to public slug URLs at sync.
95
+ Unresolved links are reported by both `diff` and `push`.
96
+ - `keywords`: omitting the field preserves existing keywords; `"keywords": []`
97
+ clears them.
98
+ - Each language is a separate article entry sharing one `slug`. Sending only
99
+ `en` entries will delete the other languages.
100
+
101
+ ## Exact flags
102
+
103
+ This skill covers the workflow and the gotchas. For the authoritative,
104
+ version-accurate option list, ask the CLI directly:
105
+
106
+ ```bash
107
+ npx @respeak/recap diff --help
108
+ npx @respeak/recap push --help
109
+ npx @respeak/recap rm --help
110
+ ```
111
+
112
+ ## Keeping this skill current
113
+
114
+ This file is generated from the `@respeak/recap` package, which is the single
115
+ source of truth. After upgrading the CLI, refresh it:
116
+
117
+ ```bash
118
+ npx @respeak/recap skill --update # rewrite .claude/skills/recap/SKILL.md from the CLI
119
+ npx @respeak/recap skill --check # exit 1 if the local copy has drifted
120
+ ```