Sync changelog

From PyModel/pythinker-code · View interactive version

Sync changelog is an AI agent skill from the GitHub repository PyModel/pythinker-code. Use after a release succeeds, when maintainers need to sync apps/pythinker-code/CHANGELOG.md into docs/release-notes/changelog.md, then open a PR on a dedicated branch.

How to use this skill

Skill file

Sync Changelog

Overview

pythinker-code uses changesets for versioning. Each package gets its own CHANGELOG.md. The user-facing CLI package, @pymodel/pythinker-code, writes its changelog here:

apps/pythinker-code/CHANGELOG.md

This file is the only upstream source for the documentation-site changelog. Internal package changelogs such as packages/*/CHANGELOG.md do not go into the documentation site.

After the release flow finishes (Release PR merged → Version Packages completed → npm publish succeeded), maintainers manually run this skill to copy the new CLI changelog entries into the docs site, wait for an optional human review, then commit on a dedicated branch and open a PR.

When To Use

Do not run this before the Release PR is merged. At that point, changesets has not yet written the new version into apps/pythinker-code/CHANGELOG.md.

Source And Targets

| File | Role | Edited by |

|---|---|---|

| apps/pythinker-code/CHANGELOG.md | Only upstream source, generated by changesets | Never edit manually |

| docs/release-notes/changelog.md | English docs changelog; source of truth for docs | This skill |

Core rule: apps/pythinker-code/CHANGELOG.md is the only upstream source; the English docs changelog is what this skill writes.

Preconditions

Before editing, confirm:

If any condition is not true, stop and confirm with the user.

Do not edit or commit directly on main. All sync work happens on a dedicated branch created in step 1.

Workflow

1. Prepare Branch

Start from an up-to-date default branch:

git fetch origin
git checkout main
git pull --ff-only origin main

Before creating the branch, peek at the version range so the branch name matches the newest version being synced:

rg '^## ' apps/pythinker-code/CHANGELOG.md | head -5
rg '^## ' docs/release-notes/changelog.md | head -5

Name the branch after the newest upstream version that is not yet in the English docs page:

docs/changelog-sync-<newest-version>

Example: syncing 0.2.1 only → docs/changelog-sync-0.2.1.

git checkout -b docs/changelog-sync-<newest-version>

If the branch already exists locally or on the remote, stop and confirm with the user instead of reusing it.

2. Find The Version Range

Use the same version lists from step 1. Confirm:

Use upstream order: newest version first.

3. Strip Decorations And Extract Entry Text

Upstream entries look like this:

- [#317](https://github.com/...) [`2f51db4`](https://github.com/...) Thanks [@user](https://github.com/...)! - Clean up lint warnings ...

Changesets may add a Thanks ...! credit, but it must be removed every time. Keep:

Remove:

After stripping, each entry is - <body text>.

Drop SDK-only and provider-internal detail. This changelog serves @pymodel/pythinker-code CLI and web users. Within an entry, keep only what CLI/web users can perceive, and remove sentences that document internals instead of user-visible behavior. Apply this on the English page:

Do not change facts or drop a real user-facing behavior — only trim the internal-only scaffolding. For over-long, internal-heavy entries, this trim applies on the English page too, not only in translation.

Upstream language rule: gen-changesets requires changelog entries to be English. If the upstream CLI changelog contains a non-English entry, stop and report it to the user. Do not silently rewrite it while syncing docs.

Public-text rule: do not copy real internal endpoints, key names, account names, or service names into docs changelogs. Replace examples with neutral placeholders such as example.com, example.test, or YOUR_API_KEY while preserving the user-visible meaning.

4. Merge, Deduplicate, And Classify Entries

Before classifying, merge related entries and drop redundant ones from the user-facing changelog:

The docs changelog uses five section types:

| Section | Meaning |

|---|---|

| ### Features | New user-facing functionality, such as a new command, flag, mode, or capability that did not exist before |

| ### Polish | User-visible improvements to existing functionality, including UX adjustments, behavior tweaks, and performance improvements that are not fixes or new capabilities |

| ### Bug Fixes | Fixes for behavior that was broken |

| ### Refactors | Internal changes with no user-visible behavior change, including build, CI, tests, dependency cleanup, and internal renames |

| ### Other | Anything that does not fit above, such as CDN/endpoint swaps and docs-related artifacts |

With the catch-all rule above, Refactors and Other rarely appear in newly synced versions: entries with no user-perceivable effect fold into the catch-all, and an entry that does change user-perceivable default behavior (for example an engine default flip with an opt-out flag) is classified by that effect, usually Polish. Reserve Other for genuinely unclassifiable but user-facing entries. Older versions keep whatever sections they already have — do not rewrite history.

Classification process:

  1. Classify from the stripped entry text first.
  2. If unclear, inspect the related commit or PR:
  1. If it is still unclear, put it in Other. Do not guess or force entries into Features.

Features vs. Polish: ask whether the entry introduces something the user could not do before. If yes (new command, flag, mode, viewer, or capability), use Features. If it only improves an existing surface (a UI panel that already existed, an existing prompt, an existing tool card, an existing payload pipeline), use Polish. Verbs like Add do not automatically mean Features — a small visual addition to an existing UI is still polish.

Default-behavior changes: changing the default value of an existing capability (for example flipping a feature on by default) is usually Polish, because the capability already existed. Use Features only when the new default materially changes the out-of-box experience for most users in a way they could not get before. When genuinely ambiguous, flag it and confirm with the reviewer rather than guessing.

Keyword hints:

Within each version, section order is:

Features → Polish → Bug Fixes → Refactors → Other

Omit empty sections. Within each section, order entries by reader value, not upstream order:

  1. Put the most valuable, obvious, and larger changes first.
  2. Prefer broad user-visible features, workflow-changing fixes, high-frequency bugs, and large cross-cutting improvements over small polish, narrow edge cases, and internal cleanup.
  3. Within Polish, put directly user-visible UX or performance improvements (something users can see or feel) before protocol or internal-behavior adjustments (something that makes the model or pipeline behave more reliably but is invisible to users).
  4. If entries have similar value, preserve upstream order.

Do not reword or exaggerate entries just to make them look more important; only reorder existing entries.

5. Write The English Page

Never change the English page header:

# Changelog

This page documents the changes in each Pythinker Code CLI release.

Insert new version blocks immediately after the header paragraph and before the previous latest version.

Every version heading must carry its release date in parentheses:

## <version> (YYYY-MM-DD)

Take the date from the version's published GitHub Release tag, not from when you run the sync:

git log -1 --format=%cs "@pymodel/pythinker-code@<version>"

Use the half-width parenthesis form (YYYY-MM-DD) on the English page. Never invent or guess a date; if the tag is missing, stop and confirm with the user.

Example:

## 0.2.0 (2026-05-26)

### Bug Fixes

- Fix the TUI not restoring the current todo list after resuming a session.

### Refactors

- Clean up lint warnings across the CLI, SDK examples, and bundled runtime code without changing product behavior.
- Update the native release workflow to use current GitHub artifact actions.

Doc links: an entry that changes a documented config surface may end with a pointer to the docs page — see [X](...) for details. Keep it a real Markdown link into the docs tree with a relative path (for example ../configuration/config-files.md#loop-control). When the link text is a config key or another identifier, code-style the text inside the brackets: CODE2. Never wrap the whole link in backticks — ` loop_control ` renders as raw inline code that exposes the relative path instead of a clickable link.

6. Verify

Review:

git diff docs/release-notes/changelog.md

Check:

Then run the docs build:

pnpm --filter docs run build

8. Human Review Checkpoint

After verification passes, before committing, ask the user whether they want to review the sync result. Use AskQuestion with options such as:

If the user chooses review:

  1. Show the uncommitted diff:

```bash

git diff docs/release-notes/changelog.md

```

  1. Summarize synced versions, section counts, and anything that needed manual classification. List every entry folded into a catch-all line (short titles, one line each), any section that exceeds the density defaults, and every borderline call flagged during curation — the reviewer cannot own a cutoff they cannot see.
  2. Tell the user to reply when they are done reviewing, or to ask for edits.
  3. Do not commit, push, or open a PR until the user explicitly says review is complete, or asks to proceed.

If the user requests edits during review, make the changes, re-run verification from step 6, and return to this checkpoint.

9. Commit

Only run this step when the user skipped review or confirmed review is complete.

Stage only the changelog docs files:

git add docs/release-notes/changelog.md

Use a neutral docs-sync commit message:

docs(changelog): sync <version range> from apps/pythinker-code/CHANGELOG.md

Do not create a changeset for changelog docs sync. Docs sync does not enter the bundle.

10. Push And Open PR

Run immediately after step 9.

Push the branch:

git push -u origin HEAD

Create the PR with gh pr create. Title follows Conventional Commits:

docs(changelog): sync <version range> from apps/pythinker-code/CHANGELOG.md

Fill in .github/pull_request_template.md. For changelog sync PRs:

Example body:

## Related Issue

N/A — post-release docs maintenance

## Problem

The docs-site changelog has not yet been synced for `<version range>` after the npm release.

## What changed

- Synced `<version range>` from `apps/pythinker-code/CHANGELOG.md` into `docs/release-notes/changelog.md`
- Verified with `pnpm --filter docs run build`

## Checklist

- [x] I have read the CONTRIBUTING document.
- [x] I have linked a related issue, or explained the problem above.
- [ ] I have added tests that prove my feature works. (N/A — docs-only sync)
- [x] Ran `gen-changesets` skill, or this PR needs no changeset. (No changeset — docs sync is out of bundle)
- [x] Ran `gen-docs` skill, or this PR needs no doc update. (This PR is the dedicated changelog sync)

Return the PR URL to the user when done.

Rules

Common Mistakes

| Mistake | Fix |

|---|---|

| Adding entries directly to the English docs page without reading upstream | Use apps/pythinker-code/CHANGELOG.md as the source |

| Copying PR links or commit hashes into docs | Strip them; keep only body text |

| Leaving the Thanks ...! credit in docs | Remove it every time, including the multi-author form |

| Leaving near-duplicate micro-tweaks as separate bullets | Merge small tweaks to the same surface into one higher-level entry (e.g. composer height + font → composer's default styling) |

| Listing many narrow fixes to the same surface as separate bullets | When three or more fixes target the same UI area or the same class of problem, merge them into one higher-level fix entry; keep genuinely distinct or high-value fixes standalone |

| Listing low-signal fixes or internal changes as standalone bullets | Collapse them into the single catch-all line (Fix several known issues.) placed last under Bug Fixes; treat the section-size defaults (about 2 Polish, 3 Bug Fixes) as a density guard, not a quota |

| Folding a qualifying entry just to hit the section-size default | The defaults are density guards; keep entries that genuinely pass the reader-action test and flag the overflow for the human reviewer |

| Keeping a fix because it was severe or hard-won | Severity makes the announcement redundant — the fix itself notifies whoever was hit; keep only behavior-change fixes and retrospective notices with a concrete, locatable action |

| Keeping an improvement the product surfaces in context (recovery cards, post-install guidance, progress displays) | The product is the better channel — right users, moment of need; fold it (channel test) |

| Folding a new capability because its control is visible somewhere in the UI | Visible is not discoverable — users do not explore; a toggle, menu item, or settings page that only waits to be found needs the changelog announcement |

| Keeping a silent-impact fix out of diligence (dropped data, wrong results the user never noticed) | The changelog does not repair the past; if the notice names no locatable instance and no realistic action, it is anxiety without an outlet — fold it |

| Overstating the catch-all pointer (for example claiming the upstream changelog is complete) | Keep the pointer restrained — See the [changelog on GitHub](...) for more technical entries.; upstream only contains changes that received a changeset |

| Writing Fix several known issues. when nothing folded is a fix | Never claim fixes that did not happen; all-polish/internal folds go under Polish as Make several refinements and internal improvements. |

| Listing a server/API entry that only backs a web feature already listed | Drop the API entry and keep the web UI entry, unless the API has independent user value |

| Rewording upstream English entries | Upstream is frozen; copy the body text unless the user explicitly asks otherwise |

| Editing upstream changelog text | Do not edit upstream |

| Losing two-space indentation in multi-line list items | Restore indentation so Markdown lists stay valid |

| Copying ### Patch Changes into docs | Remove changesets headings and classify under Features / Bug Fixes / Polish / Refactors / Other |

| Guessing unclear entries as Features | Inspect commit/PR; if still unclear, use Other |

| Treating any Add ... line as Features | If the entry only adds a small element to an existing UI/surface, use Polish |

| Filing UX or performance tweaks under Other | Use Polish for user-visible improvements to existing functionality |

| Preserving upstream order when a small entry hides a larger change | Reorder within the section so the highest-value, most obvious items appear first |

| Leaving empty sections | Delete sections with no entries |

| Putting everything under Other for convenience | Classify what can be classified first |

| Wrapping a whole doc link in backticks | Code-style the link text inside the brackets instead, so the link stays clickable: CODE0 |

| Keeping hook/event payload-mechanics clauses | Drop what an event reports or carries; keep the new capability and how to configure it |

| Creating a changeset for docs sync | Do not create one |

| Committing or pushing directly on main | Create docs/changelog-sync-<version>, commit there, then open a PR |

| Committing or opening a PR before the user skips review or confirms review is done | Wait at the human review checkpoint |

| Omitting the release date from a version heading, or guessing it | Add (YYYY-MM-DD) taken from the published tag |

Stop Signals

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.