prepare-release · diff
git:20260420.ec5e3a6 to git:20260426.5179de0
89 added, 82 removed. Audit A to A.
What this update changes in the checks
No check changed: every fixed check gives the same answer before and after this update.
A tripped check is a label, not a verdict: read the matched text and the lines below. This week's updates that newly trip a check.
---
name: prepare-release
- description: "Use this skill whenever preparing agentsmesh for an npm release — whether first publish, patch, minor, or major. Triggers on: 'prepare release', 'ready to publish', 'ship version', 'release prep', 'get this to npm', 'bump version', 'cut a release', 'what's needed to publish'. Runs a strict ordered checklist: test suite health → timing hardening → CI/CD presence → community health files → changesets → CHANGELOG quality → package contents → README badges → final gate → generate to targets. Do not skip this or work from memory — execute every phase in order and fix gaps before moving on."
+ description: "Use this skill whenever preparing agentsmesh for an npm release — whether first publish, patch, minor, or major. Triggers on: 'prepare release', 'ready to publish', 'ship version', 'release prep', 'get this to npm', 'bump version', 'cut a release', 'what's needed to publish'. Runs a strict ordered checklist: test suite health → timing hardening → CI/CD presence → community health files → changeset entry → package contents → README badges → final gate → generate to targets. Releases are driven by changesets — never hand-edit `package.json` `version` or `CHANGELOG.md`. Do not skip phases or work from memory; execute every phase in order and fix gaps before moving on."
---
# Prepare Release
You are acting as the release engineer for agentsmesh. Your job is to get the repo into a state that is safe, honest, and ready for `npm publish`. Work through each phase in order. Do not mark a phase complete until you have verified it, not just assumed it.
- ## How publishing works
+ ## Releases are changesets-driven — read this first
- Publishing is fully automated via changesets. The flow is:
+ Every user-facing change ships through a changeset. **Do not** hand-edit `package.json` `version` or `CHANGELOG.md` — both are generated by `changeset version` and any manual edit will be silently overwritten the next time the release PR rebases. The skill exists to make sure the changeset is honest, the CI gates are green, and the publish workflow is actually wired up.
- 1. All phases below pass locally
- 2. Commit the pending `.changeset/*.md` file and push to `master`
- 3. `publish.yml` triggers — changesets/action detects pending changesets and **opens a "chore: version packages" PR** that bumps `package.json` and updates `CHANGELOG.md`
- 4. Review and **merge the version PR** → `publish.yml` triggers again — changesets/action sees no pending changesets, runs `pnpm release` (`pnpm build && changeset publish`), and publishes to npm via npm trusted publishing
- 5. GitHub creates a Release and tag automatically
+ The flow:
- Prerequisites in GitHub repo settings:
- - **Settings → Actions → General → Workflow permissions**: enable "Allow GitHub Actions to create and approve pull requests"
- - **npm package settings → Trusted publishers**: add this repository/workflow for the `agentsmesh` package so GitHub Actions OIDC can publish without `NPM_TOKEN`
+ 1. All gates below pass locally.
+ 2. A `.changeset/<slug>.md` file describes the change with a `patch | minor | major` bump and a user-facing summary. Commit it.
+ 3. Push to `master` (or merge a feature branch into `master`).
+ 4. `publish.yml` triggers — `changesets/action` detects the pending changeset and **opens a "chore: version packages" PR** that bumps `package.json` and rewrites `CHANGELOG.md`.
+ 5. Review the version PR — confirm the bump and the rendered CHANGELOG section match intent. Edit the changeset summary or add a new changeset (then re-push) if the rendered output is wrong; never edit `package.json`/`CHANGELOG.md` directly on the version PR.
+ 6. Merge the version PR → `publish.yml` runs again, sees no pending changesets, executes `pnpm release` (`pnpm build && changeset publish`), and publishes to npm via npm trusted publishing. GitHub creates the Release and tag automatically.
+ Prerequisites in repo settings:
+
+ - **Settings → Actions → General → Workflow permissions**: enable "Allow GitHub Actions to create and approve pull requests".
+ - **npm package settings → Trusted publishers**: this repository + `.github/workflows/publish.yml` must be listed for the `agentsmesh` package so OIDC can publish without `NPM_TOKEN`.
+ - **Secrets**: `CODECOV_TOKEN` for the coverage badge.
+
+ If any of those are missing, fix them now — a green local gate cannot rescue a misconfigured publish workflow.
+
---
## Phase 1 — Test Suite Health
Run the full suite and confirm everything is green before touching anything else.
```bash
pnpm test
```
If there are failures, fix them first. Do not proceed with a red suite.
Then run typecheck and lint:
```bash
pnpm typecheck
pnpm lint
```
All three must be clean.
### Watch test timing (known CI risk)
The watch tests are timing-sensitive and reliably flake on CI runners slower than a developer laptop. Before declaring the suite healthy, check these specific timeouts in the watch tests:
| File | What to check | Safe CI value |
|------|--------------|---------------|
| `tests/unit/cli/commands/watch.test.ts` | `vi.waitFor` timeout args | ≥ 3000 ms |
| `tests/unit/cli/commands/watch.test.ts` | idle stability `setTimeout` | ≥ 2000 ms |
| `tests/integration/watch.integration.test.ts` | startup `waitForFile` timeout | ≥ 15000 ms |
| `tests/integration/watch.integration.test.ts` | post-change `setTimeout` | ≥ 1500 ms |
| `tests/e2e/watch.e2e.test.ts` | startup `setTimeout` | ≥ 3000 ms |
| `tests/e2e/watch.e2e.test.ts` | post-change `setTimeout` | ≥ 1500 ms |
Also verify `vitest.config.ts` has global guards:
```ts
testTimeout: 15_000,
hookTimeout: 10_000,
```
If any of these are missing or too low, update them now. The watch debounce is 300 ms plus generate time; tight timeouts that work on a fast local machine will fail on a 2-core CI runner.
---
## Phase 2 — CI/CD Workflows
Check that both workflow files exist and are correct:
- - `.github/workflows/ci.yml` — runs on every push and PR to `master`
- - `.github/workflows/publish.yml` — runs changesets publish flow on push to `master`
+ - `.github/workflows/ci.yml` — runs on every push and PR to `master`.
+ - `.github/workflows/publish.yml` — runs the changesets release flow on push to `master`.
### ci.yml must include these steps in order
1. `pnpm install --frozen-lockfile`
- 2. `pnpm audit --prod --audit-level=high` — catches high/critical vulns in production deps only
+ 2. `pnpm audit --prod --audit-level=high` — catches high/critical vulns in production deps only.
3. `pnpm lint`
4. `pnpm typecheck`
- 5. `pnpm test`
- 6. `pnpm test:coverage` with Codecov upload (`fail_ci_if_error: false` so fork PRs don't break)
- 7. `pnpm build`
- 8. `pnpm test:e2e` — must come after build; e2e runs `dist/cli.js`
+ 5. `pnpm build` — must come **before** any test job that includes integration files which exec `dist/cli.js` (e.g. `import.integration.test.ts`, `watch.integration.test.ts`, `generate-process-lock.integration.test.ts`).
+ 6. `pnpm test` — full unit + integration suite.
+ 7. `pnpm test:e2e` — must come after build (it self-builds via `pnpm build && vitest run --config vitest.e2e.config.ts`); never run e2e in parallel with another build because they share `dist/`.
+ 8. Coverage job (separate matrix entry): `pnpm test:coverage` with Codecov upload (`fail_ci_if_error: false` so fork PRs don't break).
- Use Node 22 + pnpm 10 + `cache: pnpm` in `setup-node`. Never run e2e in parallel with build — they share `dist/`. Both workflows must have `FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true` at the job level to suppress the Node 20 deprecation warning.
+ The quality matrix must include `ubuntu-latest` × Node 20/22/24, `macos-latest` × Node 22, and `windows-latest` × Node 22. Use pnpm 10 + `cache: pnpm` in `setup-node`. Both workflows must set `FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true` at the job level to suppress the Node 20 deprecation warning.
### publish.yml must use changesets/action@v1 and trigger on push to master
```yaml
on:
push:
branches: [master]
concurrency:
group: release
cancel-in-progress: false
jobs:
release:
runs-on: ubuntu-latest
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
permissions:
contents: write
pull-requests: write
id-token: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: pnpm/action-setup@v4
with:
version: 10
- uses: actions/setup-node@v4
with:
- node-version: 22
+ node-version: 24
cache: pnpm
registry-url: "https://registry.npmjs.org"
- - name: Upgrade npm for trusted publishing
- run: npm install -g npm@latest
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Create release PR or publish
uses: changesets/action@v1
with:
publish: pnpm release
title: "chore: version packages"
commit: "chore: version packages"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
```
- The job needs `id-token: write` for npm trusted publishing/provenance and `pull-requests: write` to create the version PR. If either file is missing or malformed, create/fix it now.
+ The job needs `id-token: write` for npm trusted publishing/provenance and `pull-requests: write` to create the version PR. If either workflow file is missing or malformed, fix it now.
---
## Phase 3 — Community Health Files
These must exist. Check each one:
| File | Minimum content |
|------|----------------|
| `SECURITY.md` | Supported versions table, private advisory link, response SLA |
- | `CONTRIBUTING.md` | Prerequisites, dev commands, TDD rule, commit format, PR checklist |
+ | `CONTRIBUTING.md` | Prerequisites, dev commands, TDD rule, commit format, **changeset requirement**, PR checklist |
| `.github/ISSUE_TEMPLATE/bug_report.yml` | version, node, repro, expected behavior fields |
| `.github/ISSUE_TEMPLATE/feature_request.yml` | problem + solution fields |
| `.github/ISSUE_TEMPLATE/config.yml` | `blank_issues_enabled: false`, security advisory link |
- | `.github/pull_request_template.md` | type-of-change checklist, TDD + CI + changeset checkboxes |
+ | `.github/pull_request_template.md` | type-of-change checklist; **must include a "changeset added" checkbox** alongside TDD + CI |
If any are missing, create them. Keep them short and factual — no marketing copy.
---
- ## Phase 4 — Changesets Setup
+ ## Phase 4 — Changeset Entry (the only place release notes are authored)
- Verify changesets is configured correctly:
+ Verify changesets is wired:
- 1. `.changeset/config.json` exists with `"access": "public"` and `"baseBranch": "master"`
- 2. `@changesets/cli` is in `devDependencies` in `package.json`
+ 1. `.changeset/config.json` exists with `"access": "public"` and `"baseBranch": "master"`.
+ 2. `@changesets/cli` is in `devDependencies`.
3. `package.json` has these scripts:
```json
"changeset": "changeset",
"version": "changeset version",
"release": "pnpm build && changeset publish"
```
- 4. Lockfile is up to date (`pnpm install` has been run)
+ 4. Lockfile is current (`pnpm install` has been run).
- ### Changeset for this release
+ ### Author the changeset for this release
- If there is no pending changeset file in `.changeset/` (nothing other than `config.json`):
+ Run:
```bash
pnpm changeset
```
- Follow the prompts: select the bump type (patch/minor/major), write a one-line user-facing summary. Commit the resulting `.changeset/*.md` file. The `publish.yml` workflow will consume it on the next push to `master`.
-
- If a changeset already exists, confirm it describes the changes accurately before proceeding.
+ Or write the file directly at `.changeset/<slug>.md` using this format:
+ ```markdown
---
+ 'agentsmesh': minor
+ ---
- ## Phase 5 — CHANGELOG
+ <one-paragraph user-facing summary, then optional follow-up paragraphs grouping
+ Added / Changed / Fixed / Removed material if the release spans many themes>
+ ```
- Open `CHANGELOG.md`. The entry for the version being released must:
+ **Bump rules**:
- - Have the real date (`YYYY-MM-DD`), not `TBD`
- - Cover every major user-facing addition since the previous release
- - Be written for users, not for commit archaeology — describe the capability, not the implementation
+ - `major` — breaking changes to the CLI flags, canonical schema, public API surface, or generated artifact contract that an existing user could rely on. Write a migration paragraph.
+ - `minor` — new targets, new canonical features, new public exports, new commands, new flags that are additive. New runtime platform support also goes here.
+ - `patch` — bug fixes, doc-only changes, internal refactors with no user-visible behavior change, dependency bumps that don't change behavior.
- ### Required sections for a first-ever release
+ **Quality bar for the summary** (this paragraph becomes the CHANGELOG entry, so write it like a CHANGELOG entry, not like a commit message):
- Group under clear subheadings:
+ - Lead with the capability, not the file path. `Native Windows support is now first-class.` not `Added windows-path-safety.ts.`
+ - Quote the user-visible artifact (`agentsmesh import --from windsurf`, `installs.yaml`, `.changeset/<slug>.md`) so the entry is greppable.
+ - If multiple themes ship together, group them as separate paragraphs — Added / Changed / Fixed / Removed framing inside one summary is fine, headings inside the changeset body are not (they'd nest inside `### Minor Changes` after rendering).
+ - If the change is purely internal, state that explicitly (`Internal-only:` prefix) and use `patch`.
- - **CLI commands** — one line per command: what it does, key flags
- - **Supported targets** — comma-separated list
- - **Canonical features** — rules, commands, agents, skills, mcp, hooks, ignore, permissions
- - **Config** — describe `agentsmesh.yaml`, `agentsmesh.local.yaml`, `../../`, `.lock`
- - **Extends** — local and remote forms with example syntax
- - **Link rebasing** — one sentence on what it does
- - **Collaboration** — lock file, `check`, `merge`
+ ### Verify before commit
- For subsequent releases (patch/minor/major), follow Keep a Changelog format with Added / Changed / Fixed / Removed sections.
+ ```bash
+ pnpm exec changeset status
+ ```
+ Confirm the bump type and the package list match intent. Then `git add .changeset/<slug>.md` and commit alongside the work it describes (one PR, one or more changesets, no orphan changesets and no orphan code).
+
+ **Do not** edit `package.json` `version` or `CHANGELOG.md` in this commit. Both are generated by the version PR.
+
---
- ## Phase 6 — Package Contents
+ ## Phase 5 — Package Contents
Run a dry-run pack and inspect what would be published:
```bash
pnpm pack --dry-run
```
- The tarball must contain **only**:
-
- ```
- CHANGELOG.md
- dist/cli.js
- dist/cli.js.map
- LICENSE
- package.json
- README.md
- ```
-
- Source files, test files, fixtures, `../../`, `docs/`, `tasks/`, and `tsconfig.json` must not appear. The `files` field in `package.json` controls this — it should be:
+ The tarball must contain only what `package.json` `files` declares plus the always-included files (`package.json`, `README.md`, `LICENSE` if present alongside). Source files, test files, fixtures, `.agentsmesh/`, `docs/`, `tasks/`, and `tsconfig.json` must not appear. The `files` field should be:
```json
- "files": ["dist", "README.md", "CHANGELOG.md", "LICENSE"]
+ "files": ["dist", "schemas", "README.md", "CHANGELOG.md", "LICENSE"]
```
- If unexpected files appear in the pack output, add them to `.npmignore` or tighten the `files` field.
+ If unexpected files appear, tighten `files` or add a `.npmignore` entry. Re-run `pnpm pack --dry-run` until the manifest is clean.
---
- ## Phase 7 — README Badges
+ ## Phase 6 — README Badges
The README must have these four badges immediately after the `# AgentsMesh` heading:
```markdown
[](https://github.com/sampleXbro/agentsmesh/actions/workflows/ci.yml)
[](https://www.npmjs.com/package/agentsmesh)
[](https://codecov.io/gh/sampleXbro/agentsmesh)
[](LICENSE)
```
- The CI badge will show "passing" once the first CI run completes. The npm version badge shows the published version; it will display correctly once the package is on the registry. Coverage requires a `CODECOV_TOKEN` secret set in GitHub repo settings.
+ The npm version badge will pick up the new tag once `changeset publish` runs. Coverage requires `CODECOV_TOKEN` to be set as a repo secret.
---
- ## Phase 8 — Final Gate
+ ## Phase 7 — Final Gate
- Run the full test suite one more time with coverage to confirm nothing was broken by the release prep changes:
+ Run the full test suite one more time with coverage to confirm nothing broke since Phase 1:
```bash
pnpm test
pnpm typecheck
pnpm lint
pnpm test:coverage
pnpm build
```
Coverage thresholds are set in `vitest.config.ts`:
```
lines: 90%, functions: 90%, branches: 84%
```
If coverage drops below threshold, the CI run will fail. Either add missing tests or, if coverage dropped because of legitimately untestable I/O code, add the file to the `coverage.exclude` list in `vitest.config.ts` with a comment explaining why.
---
- ## Phase 9 — Generate to All Targets
+ ## Phase 8 — Generate to All Targets
Once all phases pass, sync the canonical config to every configured target:
```bash
node dist/cli.js generate
```
- This rewrites to Claude Code, Cursor, Copilot, Gemini CLI, Cline, Codex CLI, Windsurf, Continue, and Junie in their native formats. Verify the lock file updates cleanly with no unexpected diffs. Commit any changes.
+ Then verify the lock file is in sync:
+ ```bash
+ node dist/cli.js generate --check
+ ```
+
+ If `generate --check` reports drift, commit it as part of the changeset commit (or as a separate `chore(generate): refresh target artifacts` commit, whichever the repo's recent history prefers). Never push a release with a dirty lock.
+
---
## Output
After all phases, produce a release readiness report:
```markdown
- ## Release Readiness — agentsmesh v{version}
+ ## Release Readiness — agentsmesh (changeset: <slug>, bump: patch|minor|major)
| Phase | Status | Notes |
|-------|--------|-------|
| Test suite | ✓/✗ | |
| Watch timing | ✓/✗ | |
| CI workflows | ✓/✗ | |
| Community files | ✓/✗ | |
- | Changesets | ✓/✗ | |
- | CHANGELOG | ✓/✗ | |
+ | Changeset entry | ✓/✗ | |
| Package contents | ✓/✗ | |
| README badges | ✓/✗ | |
| Final gate | ✓/✗ | |
| Generated to targets | ✓/✗ | |
### Remaining actions before publish
- - [ ] Ensure "Allow GitHub Actions to create and approve pull requests" is enabled in repo Settings → Actions → General
- - [ ] Ensure npm package trusted publisher settings point to this repository and `.github/workflows/publish.yml`
- - [ ] Ensure `CODECOV_TOKEN` secret is set (for coverage badge)
- - [ ] Push to master → changesets/action opens the "chore: version packages" PR
- - [ ] Review and merge the version PR → changesets/action publishes to npm automatically
+ - [ ] "Allow GitHub Actions to create and approve pull requests" enabled in repo Settings → Actions → General
+ - [ ] npm trusted-publisher mapping points at this repository and `.github/workflows/publish.yml`
+ - [ ] `CODECOV_TOKEN` repo secret is set
+ - [ ] Push the changeset commit → action opens the "chore: version packages" PR
+ - [ ] Review the rendered CHANGELOG section + bump in the version PR; merge → action publishes to npm
```
---
## Principles
- - **Fix, don't skip.** If a phase has a gap, close it before moving to the next phase. A partial release prep is worse than no prep.
+ - **Changesets are the only release-notes authoring surface.** If you find yourself opening `CHANGELOG.md` or bumping `package.json` `version`, stop — write a changeset instead.
+ - **Fix, don't skip.** If a phase has a gap, close it before moving on. A partial release prep is worse than no prep.
- **Verify, don't assume.** Read the actual files. Run the actual commands. Don't report a phase as done because you think it was done earlier.
- - **Users first.** Changelog entries describe what users can now do, not what commits were merged.
- - **Lockfile is truth.** The lock file after `generate` must be clean. If it is dirty, there is a mismatch between canonical and generated — investigate before shipping.
+ - **Users first.** Changeset summaries describe what users can now do, not what commits were merged.
+ - **Lockfile is truth.** `generate --check` must report in sync before the changeset commit. If it is dirty, there is a mismatch between canonical and generated — investigate before shipping.
+