Skip to content

Commit adbd4ae

Browse files
kravetsonexadezv
andcommitted
feat(skills): gramio-upgrade skill + migrations.json source of truth
Add a standalone `gramio-upgrade` skill that upgrades a project across gramio/@Gramio versions: detect installed versions, build a dependency- ordered plan of required changes, apply edits, verify, then suggest the new features the bump unlocks. Single source of truth: public/migrations.json (per-package, bilingual, breaking/deprecated/new/fixes + peer bumps + layer ordering). A generator (scripts/build-migrations.mjs, `bun run build:migrations`) fans it out to: - skills/gramio-upgrade/MIGRATIONS.md — lean agent view (required changes + new-feature titles, no code) - docs/guides/upgrading.md (+ ru) — full human view with <UpgradePicker/> - detect-versions.mjs: resolve installed vs latest, deep-link each upgrade to /guides/upgrading; --json pastes into the picker for a whole-project plan - UpgradePicker.vue: by-package + paste-CLI-output modes; reads /migrations.json - /generate-changelog now authors migrations.json + runs the generator - CI (skills.yml): `build:migrations --check` blocks drift co-authored-by: kravetsone <xadezv@gmail.com>
1 parent 3b986e1 commit adbd4ae

16 files changed

Lines changed: 3891 additions & 2 deletions

File tree

.claude/skills/generate-changelog/SKILL.md

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
name: generate-changelog
3-
description: Generate changelog pages from gramiojs org patches using ghlog CLI. Tracks last-seen commit SHAs per repo via --since-map for precise incremental updates. Also updates docs and skills to reflect changes.
3+
description: Generate changelog pages from gramiojs org patches using ghlog CLI. Tracks last-seen commit SHAs per repo via --since-map for precise incremental updates. Also updates docs and skills to reflect changes, and maintains the per-package GramIO upgrade data (public/migrations.json) that generates the upgrade skill, the upgrading guide, and the version picker.
44
allowed-tools: Read, Write, Edit, Bash, Glob, Grep
55
metadata:
66
internal: true
@@ -284,11 +284,54 @@ If a notable new feature was added, create or update `skills/examples/<name>.ts`
284284
- `skills/plugins/` — Update plugin guides if plugin behavior changed
285285
- `skills/metadata.json` — Bump the version number and date
286286
287+
#### Update the upgrade data (`public/migrations.json`) — MANDATORY
288+
289+
The `gramio-upgrade` skill, the `docs/guides/upgrading.md` page (EN + RU), and the `<UpgradePicker />` widget are all generated from **one source of truth: `public/migrations.json`**. You author the JSON here — **reusing the migration content you already wrote for the changelog page** (do not re-derive it) — then run the generator. Never hand-edit the derived files (`skills/gramio-upgrade/MIGRATIONS.md`, the generated block in `docs/guides/upgrading.md` / `docs/ru/guides/upgrading.md`); they'll be overwritten.
290+
291+
For **every package that had a version bump this run** (the same set you covered in steps 5–6):
292+
293+
1. Open `public/migrations.json`. Find `packages["<name>"]` (create it if the package is new — give it `repo`, a `layer` for dependency ordering: `1` types/composer/schema-parser/wrappergram, `2` contexts/files/format/keyboards/callback-data/storage*, `3` gramio, `4` plugins, `5` tooling/create-gramio — and an empty `entries: []`).
294+
2. **Prepend** a new entry to that package's `entries` array (newest first):
295+
296+
```json
297+
{
298+
"from": "<installed-before>",
299+
"to": "<new-version>",
300+
"date": "YYYY-MM-DD",
301+
"changelog": "/changelogs/YYYY-MM-DD",
302+
"pendingPublish": false,
303+
"upgradeStraightTo": null,
304+
"peerBumps": ["@gramio/types ^10"],
305+
"notes": [{ "en": "…", "ru": "…" }],
306+
"breaking": [
307+
{
308+
"en": { "title": "…", "desc": "…" },
309+
"ru": { "title": "…", "desc": "…" },
310+
"before": "old code (optional)",
311+
"after": "new code (optional)"
312+
}
313+
],
314+
"deprecated": [],
315+
"new": [],
316+
"fixes": []
317+
}
318+
```
319+
320+
Rules for the entry:
321+
- **Bilingual:** every `breaking`/`deprecated`/`new`/`fixes` item and every `notes` line needs both `en` and `ru` (write natural Russian, like the RU changelog — don't translate mechanically). `before`/`after` code stays language-agnostic (write it once).
322+
- Omit/empty any bucket that doesn't apply. `from: null` for a brand-new package's first release. Keep snippets short and runnable (camelCase `ctx` getters, `format\`\``, no `any`, no `ctx.payload`).
323+
- **Pending publish (step 5a):** set `"pendingPublish": true` if the version is tagged but not yet on npm.
324+
- **WIP rule (step 5b):** `to` must be the version whose SHA you saved, not a half-finished trailing commit.
325+
- **Known-bad release:** if there's an immediate follow-up fix (like `@gramio/scenes` 0.7.0 → 0.7.1), set `"upgradeStraightTo": "0.7.1"` and add a `fixes` item saying so.
326+
3. Run **`bun run build:migrations`** to regenerate `skills/gramio-upgrade/MIGRATIONS.md` and the generated blocks in both `upgrading.md` pages. Then `bun run build:migrations -- --check` should report "in sync".
327+
287328
**Checklist before moving on from this step:**
288329
- [ ] Every new plugin doc page has a corresponding `skills/plugins/<name>.md`
289330
- [ ] Every new standalone doc page has a corresponding `skills/references/<name>.md`
290331
- [ ] Notable new features have examples in `skills/examples/`
291332
- [ ] Changed plugin behavior is reflected in existing `skills/plugins/` files
333+
- [ ] Every package version bump this run has a bilingual entry in `public/migrations.json`
334+
- [ ] `bun run build:migrations` was run and `-- --check` is green (derived files in sync)
292335
- [ ] `skills/metadata.json` version and date are bumped
293336
294337
For each update, keep a record of what file was changed and why for the final report.

.github/workflows/skills.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ on:
55
paths:
66
- "skills/**"
77
- "tests/**"
8+
- "public/migrations.json"
9+
- "scripts/build-migrations.mjs"
810
- "tsconfig.skills.json"
911
- "package.json"
1012
- "bun.lock"
@@ -13,6 +15,8 @@ on:
1315
paths:
1416
- "skills/**"
1517
- "tests/**"
18+
- "public/migrations.json"
19+
- "scripts/build-migrations.mjs"
1620
- "tsconfig.skills.json"
1721
- "package.json"
1822
- "bun.lock"
@@ -32,6 +36,9 @@ jobs:
3236
- name: Install modules
3337
run: bun install --frozen-lockfile
3438

39+
- name: Verify upgrade docs are generated from public/migrations.json
40+
run: bun run build:migrations -- --check
41+
3542
- name: Typecheck skill examples
3643
run: bun run check:skills
3744

CLAUDE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ skills/ # User-land AI skills (installed via `npx skills
3636
references/ # 18 deep-dive API reference docs
3737
plugins/ # 6 plugin guides
3838
gramio-pick-username/ # /gramio-pick-username — suggest and check Telegram bot usernames
39+
gramio-upgrade/ # /gramio-upgrade — upgrade a project across gramio/@gramio versions; MIGRATIONS.md ledger maintained by /generate-changelog
3940
.claude/skills/ # Internal doc skills (metadata.internal: true)
4041
.cursor/rules/ # Cursor editor rules
4142
.github/copilot-instructions.md # GitHub Copilot instructions

0 commit comments

Comments
 (0)