|
| 1 | +--- |
| 2 | +name: cms-changelog-sync |
| 3 | +description: >- |
| 4 | + Sync ComfyUI release notes to Strapi CMS: LLM-simplify English changelog for |
| 5 | + in-app popup, translate to zh/ja/ko/fr/ru/es in staging, push drafts to CMS. |
| 6 | + Use when updating changelog/index.mdx for CMS, running cms:prepare/cms:sync, |
| 7 | + Strapi release-notes, published-versions.json, CMS staging, simplifying |
| 8 | + release notes for the notification popup, or cms:publish to go live. |
| 9 | +--- |
| 10 | + |
| 11 | +# CMS Changelog Sync |
| 12 | + |
| 13 | +Push **draft** release notes to Strapi (`release-notes` content type). Docs changelog stays full; CMS uses **gitignored staging** with popup-sized copy. |
| 14 | + |
| 15 | +## Architecture |
| 16 | + |
| 17 | +``` |
| 18 | +changelog/index.mdx ← docs source of truth (do not shorten for CMS) |
| 19 | + │ |
| 20 | + ▼ pnpm cms:prepare:en / cms:prepare |
| 21 | +.github/scripts/cms/staging/ |
| 22 | + en/changelog/index.mdx ← LLM-simplified popup EN |
| 23 | + {zh,ja,ko,fr,ru,es}/… ← translated from simplified EN |
| 24 | + │ |
| 25 | + ▼ pnpm cms:sync |
| 26 | +Strapi CMS (draft only) → manual Publish → published-versions.json |
| 27 | +``` |
| 28 | + |
| 29 | +**Never** edit docs `zh/changelog/` for CMS. **Never** auto-publish in Strapi. |
| 30 | + |
| 31 | +## Environment (`.env.local`) |
| 32 | + |
| 33 | +| Variable | Used by | Notes | |
| 34 | +|----------|---------|-------| |
| 35 | +| `TRANSLATE_API_KEY` | prepare | Same as `pnpm translate` | |
| 36 | +| `TRANSLATE_API_BASE_URL` | prepare | e.g. `https://api.deepseek.com` | |
| 37 | +| `TRANSLATE_API_MODEL` | prepare | e.g. `deepseek-v4-pro` | |
| 38 | +| `CMS_BASE_URL` | sync, delete-drafts | e.g. `https://cms.comfy.org` | |
| 39 | +| `CMS_API_TOKEN` | sync, delete-drafts | Strapi API token | |
| 40 | +| `CMS_PROJECT` | optional | Default `comfyui`; also `--project cloud` on CLI | |
| 41 | + |
| 42 | +CI: `CMS_BASE_URL` / `TRANSLATE_API_BASE_URL` → GitHub **Variables**; tokens → **Secrets**. |
| 43 | + |
| 44 | +## Simplification rules (EN popup) |
| 45 | + |
| 46 | +Prompt: `.github/scripts/cms/cms-simplify-prompt.ts` |
| 47 | +Config: `.github/scripts/cms/cms-config.json` → `simplify` |
| 48 | + |
| 49 | +| Rule | Value | |
| 50 | +|------|-------| |
| 51 | +| Total bullets per version | **3–5** (`max_bullets_total: 5`) | |
| 52 | +| Section headings max | **2** (`max_sections: 2`) | |
| 53 | +| Words per version | ~60–120 | |
| 54 | +| Bullet format | `[**Name**](pr_url): 5–12 word function` | |
| 55 | +| PR links | **Keep** when source has them; never invent URLs | |
| 56 | +| Sections allowed | `**New Open-Source Model Support**`, `**Partner Node Updates**` only | |
| 57 | +| Drop | Bug fixes, performance, Load3D, UI, internal refactors | |
| 58 | + |
| 59 | +Example staging output: |
| 60 | + |
| 61 | +```markdown |
| 62 | +**New Open-Source Model Support** |
| 63 | +* [**Depth Anything 3**](https://github.com/Comfy-Org/ComfyUI/pull/13853): Monocular depth estimation model |
| 64 | + |
| 65 | +**Partner Node Updates** |
| 66 | +* [**Kling V3-Turbo**](https://github.com/Comfy-Org/ComfyUI/pull/14528): Text-to-video generation model |
| 67 | +``` |
| 68 | + |
| 69 | +Sync adds header: `# ComfyUI vX.Y.Z` via `format-cms-content.ts`. |
| 70 | + |
| 71 | +## Projects (comfyui + cloud) |
| 72 | + |
| 73 | +**Default: both projects** on `cms:prepare`, `cms:sync`, and `cms:publish`. Same changelog content; Strapi `project` field and CMS header differ (`# ComfyUI` vs `# Cloud`). |
| 74 | + |
| 75 | +| Project | Staging path | CMS header | |
| 76 | +|---------|--------------|------------| |
| 77 | +| `comfyui` | `staging/{locale}/…` | `# ComfyUI vX.Y.Z` | |
| 78 | +| `cloud` | `staging/cloud/{locale}/…` | `# Cloud vX.Y.Z` | |
| 79 | + |
| 80 | +Prepare runs LLM once on comfyui, then **copies staging to cloud**. Sync/publish push both to Strapi. |
| 81 | + |
| 82 | +Single project only: `--project cloud` or `CMS_PROJECT=cloud`. |
| 83 | + |
| 84 | +Mark a version **high** attention: |
| 85 | + |
| 86 | +```bash |
| 87 | +pnpm cms:set-attention -- cloud v0.24.0 high --save |
| 88 | +``` |
| 89 | + |
| 90 | +## Commands |
| 91 | + |
| 92 | +| Command | Action | |
| 93 | +|---------|--------| |
| 94 | +| `pnpm cms:prepare:en` | Simplify EN → staging (comfyui + cloud copy) | |
| 95 | +| `pnpm cms:prepare` | Simplify EN + translate all locales (both projects) | |
| 96 | +| `pnpm cms:preview -- v0.25.1` | Dry-run Strapi push (both projects) | |
| 97 | +| `pnpm cms:sync -- v0.25.1` | Push/update **drafts** (both projects) | |
| 98 | +| `pnpm cms:publish -- v0.25.1` | Publish + refresh `published-versions.json` (both) | |
| 99 | +| `pnpm cms:set-attention -- cloud v0.24.0 high` | Set attention low/high in Strapi | |
| 100 | +| `pnpm cms:delete-drafts --preview` | List deletable Strapi drafts | |
| 101 | +| `pnpm cms:delete-drafts` | Delete drafts (keeps published) | |
| 102 | + |
| 103 | +Flags (after `--`): |
| 104 | + |
| 105 | +- `--force` — re-simplify/re-translate even if staging has the version |
| 106 | +- `--preview` / `--dry-run` — no API writes |
| 107 | +- `--project cloud` — single project only (default = both) |
| 108 | +- `v0.25.1` — explicit version(s) |
| 109 | + |
| 110 | +Env: |
| 111 | + |
| 112 | +- `CMS_SYNC_ALL=1` — include already-published versions (backfill) |
| 113 | +- Without it, local default = **all unpublished EN versions** per `published-versions.json` |
| 114 | + |
| 115 | +Requires **Bun**. Loads `.env.local` automatically. |
| 116 | + |
| 117 | +## Standard workflow |
| 118 | + |
| 119 | +### New release version |
| 120 | + |
| 121 | +1. Add full `<Update>` block to `changelog/index.mdx` (docs quality — unchanged). |
| 122 | +2. **English first** — review popup copy before translating: |
| 123 | + |
| 124 | + ```bash |
| 125 | + pnpm cms:prepare:en -- --force v0.25.1 |
| 126 | + ``` |
| 127 | + |
| 128 | + Inspect: `.github/scripts/cms/staging/en/changelog/index.mdx` |
| 129 | + |
| 130 | +3. **Translate** after EN approved: |
| 131 | + |
| 132 | + ```bash |
| 133 | + pnpm cms:prepare -- v0.25.1 |
| 134 | + ``` |
| 135 | + |
| 136 | +4. **Push drafts**: |
| 137 | + |
| 138 | + ```bash |
| 139 | + pnpm cms:preview -- v0.25.1 |
| 140 | + pnpm cms:sync -- v0.25.1 |
| 141 | + ``` |
| 142 | + |
| 143 | +5. **Publish** after review (CLI or Strapi admin): |
| 144 | + |
| 145 | + ```bash |
| 146 | + pnpm cms:publish --preview -- v0.25.1 |
| 147 | + pnpm cms:publish -- v0.25.1 |
| 148 | + # published-versions.json is refreshed automatically — commit if changed |
| 149 | + ``` |
| 150 | + |
| 151 | +6. Commit `.github/scripts/cms/published-versions.json` after publish (auto-refreshed by `cms:publish`). |
| 152 | + |
| 153 | +### Catch up all unpublished versions locally |
| 154 | + |
| 155 | +```bash |
| 156 | +pnpm cms:prepare:en -- --force # all unpublished EN |
| 157 | +pnpm cms:prepare -- --force # then all locales |
| 158 | +pnpm cms:preview |
| 159 | +pnpm cms:sync |
| 160 | +``` |
| 161 | + |
| 162 | +### After prompt or config changes |
| 163 | + |
| 164 | +Re-run with `--force`. Staging without `--force` **skips** existing `<Update>` blocks. |
| 165 | + |
| 166 | +## Version selection logic |
| 167 | + |
| 168 | +| Context | Versions processed | |
| 169 | +|---------|-------------------| |
| 170 | +| Local, no args | EN not in `published-versions.json` (≥ `min_version` 0.21.0) | |
| 171 | +| Local + `CMS_SYNC_ALL=1` | All ≥ min_version | |
| 172 | +| Explicit `v0.25.1` | That version only | |
| 173 | +| CI (`CMS_SYNC_BEFORE` / `CMS_SYNC_AFTER`) | New/changed `<Update>` blocks in git diff only | |
| 174 | + |
| 175 | +`cms:sync` skips locales already published per registry. Published EN in CMS is never overwritten. |
| 176 | + |
| 177 | +## Key files |
| 178 | + |
| 179 | +| Path | Role | |
| 180 | +|------|------| |
| 181 | +| `changelog/index.mdx` | Full docs EN changelog | |
| 182 | +| `.github/scripts/cms/staging/` | CMS content (gitignored) | |
| 183 | +| `.github/scripts/cms/cms-config.json` | Locales, min version, simplify limits | |
| 184 | +| `.github/scripts/cms/published-versions.json` | Published registry (commit after Strapi publish) | |
| 185 | +| `.github/scripts/cms/prepare-cms-changelog.ts` | Prepare pipeline | |
| 186 | +| `.github/scripts/cms/sync-to-strapi.ts` | Strapi draft sync | |
| 187 | +| `.github/scripts/cms/publish-cms-drafts.ts` | Draft → published | |
| 188 | +| `.github/scripts/cms/delete-cms-drafts.ts` | Clean bad drafts | |
| 189 | +| `.github/workflows/cms-changelog-sync.yml` | CI: prepare → preview → sync on main | |
| 190 | + |
| 191 | +## Agent checklist |
| 192 | + |
| 193 | +When user asks to update CMS release notes: |
| 194 | + |
| 195 | +- [ ] Confirm `changelog/index.mdx` has the new `<Update>` block |
| 196 | +- [ ] Run `pnpm cms:prepare:en` (with `--force` if redoing); show staging EN for review |
| 197 | +- [ ] Wait for user approval before `pnpm cms:prepare` (translations) |
| 198 | +- [ ] Run `pnpm cms:preview` then `pnpm cms:sync` |
| 199 | +- [ ] Remind: Strapi publish is manual; then `--write` on published-versions |
| 200 | +- [ ] Do **not** commit staging/ (gitignored) |
| 201 | +- [ ] Do **not** shorten docs changelog for CMS — staging is separate |
| 202 | +- [ ] Do **not** run bulk `CMS_SYNC_ALL` prepare/sync without user consent (many API calls) |
| 203 | + |
| 204 | +## Troubleshooting |
| 205 | + |
| 206 | +| Issue | Fix | |
| 207 | +|-------|-----| |
| 208 | +| Only one version simplified | Old behavior was latest-only; now defaults to unpublished. Use `CMS_SYNC_ALL=1` for all. | |
| 209 | +| Staging skipped | Version already exists — add `--force` | |
| 210 | +| Strapi VERSION shows `-` | Bulk sync bug: `version` field null; delete drafts and re-sync | |
| 211 | +| Delete draft 500 | Use `pnpm cms:delete-drafts` (locale-only DELETE, not `status=draft`) | |
| 212 | +| `English base draft missing` on locale sync | Ensure EN draft exists first; sync creates EN before other locales | |
| 213 | +| Background prepare still running | `pkill -f prepare-cms-changelog.ts` | |
| 214 | + |
| 215 | +## Related skills |
| 216 | + |
| 217 | +- **`docs-i18n-translate`** — Mintlify docs ja/zh/ko (`pnpm translate`) |
| 218 | +- **`docs-i18n-review`** — translation quality review (`pnpm translate:review`) |
| 219 | + |
| 220 | +## Docs vs CMS (do not confuse) |
| 221 | + |
| 222 | +| | Docs site | CMS popup | |
| 223 | +|--|-----------|-----------| |
| 224 | +| Source | `changelog/index.mdx` | `staging/en/…` | |
| 225 | +| Length | Full detail | 3–5 bullets | |
| 226 | +| i18n | `zh/changelog/` etc. | `staging/zh/` etc. | |
| 227 | +| Deploy | Mintlify | Strapi draft → publish | |
0 commit comments