@cyanheads/mcp-ts-core 0.9.14 → 0.9.15

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.
Files changed (47) hide show
  1. package/AGENTS.md +559 -0
  2. package/CLAUDE.md +3 -2
  3. package/README.md +4 -4
  4. package/changelog/0.9.x/0.9.15.md +52 -0
  5. package/changelog/template.md +1 -1
  6. package/dist/core/context.d.ts +18 -2
  7. package/dist/core/context.d.ts.map +1 -1
  8. package/dist/core/context.js +4 -0
  9. package/dist/core/context.js.map +1 -1
  10. package/dist/linter/rules/enrichment-rules.d.ts +13 -4
  11. package/dist/linter/rules/enrichment-rules.d.ts.map +1 -1
  12. package/dist/linter/rules/enrichment-rules.js +92 -4
  13. package/dist/linter/rules/enrichment-rules.js.map +1 -1
  14. package/dist/linter/rules/schema-rules.d.ts +4 -0
  15. package/dist/linter/rules/schema-rules.d.ts.map +1 -1
  16. package/dist/linter/rules/schema-rules.js +2 -2
  17. package/dist/linter/rules/schema-rules.js.map +1 -1
  18. package/dist/linter/rules/tool-rules.d.ts.map +1 -1
  19. package/dist/linter/rules/tool-rules.js.map +1 -1
  20. package/dist/mcp-server/tools/utils/toolDefinition.d.ts +40 -0
  21. package/dist/mcp-server/tools/utils/toolDefinition.d.ts.map +1 -1
  22. package/dist/mcp-server/tools/utils/toolDefinition.js.map +1 -1
  23. package/dist/mcp-server/tools/utils/toolHandlerFactory.d.ts.map +1 -1
  24. package/dist/mcp-server/tools/utils/toolHandlerFactory.js +35 -7
  25. package/dist/mcp-server/tools/utils/toolHandlerFactory.js.map +1 -1
  26. package/package.json +5 -3
  27. package/scripts/build-changelog.ts +3 -1
  28. package/scripts/check-skills-sync.ts +42 -8
  29. package/skills/add-app-tool/SKILL.md +2 -2
  30. package/skills/add-export/SKILL.md +2 -2
  31. package/skills/add-service/SKILL.md +2 -2
  32. package/skills/add-tool/SKILL.md +30 -2
  33. package/skills/api-context/SKILL.md +4 -2
  34. package/skills/api-linter/SKILL.md +27 -3
  35. package/skills/design-mcp-server/SKILL.md +2 -2
  36. package/skills/git-wrapup/SKILL.md +22 -15
  37. package/skills/maintenance/SKILL.md +8 -7
  38. package/skills/orchestrations/workflows/maintenance-release.md +1 -1
  39. package/skills/polish-docs-meta/SKILL.md +1 -1
  40. package/skills/polish-docs-meta/references/agent-protocol.md +2 -2
  41. package/skills/polish-docs-meta/references/readme.md +3 -3
  42. package/skills/setup/SKILL.md +5 -10
  43. package/templates/AGENTS.md +2 -1
  44. package/templates/CLAUDE.md +2 -1
  45. package/templates/_.mcpbignore +2 -0
  46. package/templates/changelog/template.md +1 -1
  47. package/templates/package.json +2 -1
@@ -4,7 +4,7 @@ description: >
4
4
  Investigate, adopt, and verify dependency updates — with special handling for `@cyanheads/mcp-ts-core`. Captures what changed, understands why, cross-references against the codebase, adopts framework improvements, syncs project skills, and runs final checks. Supports two entry modes: run the full flow end-to-end, or review updates you already applied.
5
5
  metadata:
6
6
  author: cyanheads
7
- version: "2.4"
7
+ version: "2.5"
8
8
  audience: external
9
9
  type: workflow
10
10
  ---
@@ -78,7 +78,7 @@ Scan specifically for:
78
78
  | Config changes | New env vars, renamed keys, changed defaults |
79
79
  | Linter rules | New definition-lint rules that may now flag existing tools/resources |
80
80
  | New or materially-changed skills | Note new skills or workflow changes (renamed steps, new checklist items) worth surfacing at end-of-run. Don't auto-invoke — some skills (e.g. `security-pass`) are user-triggered. The per-version changelog entries (e.g. 0.6.14 calling out `skills/security-pass/ (v1.0)`) name what changed. |
81
- | New template-scaffolded files | Compare `templates/` in the package against the project root. Files that `init` would create for a new project but don't exist in this project are adoption candidates — create them with project-specific values (version, name, description, env vars from `server.json`). Examples: `manifest.json`, `.mcpbignore`, `.codex-plugin/`, `.claude-plugin/`. Skip files the project has intentionally opted out of (documented in CLAUDE.md or a code comment). |
81
+ | New template-scaffolded files | Compare `templates/` in the package against the project root. Files that `init` would create for a new project but don't exist in this project are adoption candidates — create them with project-specific values (version, name, description, env vars from `server.json`). Examples: `manifest.json`, `.mcpbignore`, `.codex-plugin/`, `.claude-plugin/`. Skip files the project has intentionally opted out of (documented in CLAUDE.md/AGENTS.md or a code comment). |
82
82
  | Changelog `agent-notes` | Read `agent-notes` frontmatter from each new per-version changelog file — these carry release-specific adoption instructions for downstream consumers (new files to create, fields to populate, one-time migration steps). Apply them alongside other adoption work in Step 6. |
83
83
 
84
84
  Cross-reference each finding against the server's code. Collect adoption opportunities for Step 6.
@@ -103,7 +103,8 @@ Procedure:
103
103
  - If missing in project `skills/`, copy the full directory
104
104
  - If present, compare `metadata.version` — replace if the package version is newer
105
105
  - If the local version is equal or newer, skip (local override)
106
- 3. Do not touch skills in `skills/` that don't exist in the package (server-specific)
106
+ 3. Leave skills in `skills/` that lack `metadata.audience: external` untouched they're server-specific or sourced elsewhere, not framework-managed.
107
+ 4. **Prune framework skills deleted upstream.** A skill in `skills/` that *carries* `metadata.audience: external` but is **absent** from the package was removed upstream (e.g. `migrate-mcp-ts-template`, removed in 0.9.12) and lingers because sync was previously add/update-only. Delete it from `skills/` (and from the agent mirrors in Phase B). The `audience: external` marker is the provenance: it scopes the prune to framework-managed skills, so a server's own skills — which never carry it — are never touched. Before deleting, scan the skill for local edits worth keeping; if any exist, reconcile or surface them rather than discarding silently.
107
108
 
108
109
  **Skill diffs are adoption signal, not just sync output.** After replacing files in `skills/`, run `git diff skills/` to read what changed. Updated skill bodies describe new patterns, refined workflows, or new conventions — apply them to the codebase in Step 6 the same way you'd apply a framework API addition. The file copy is the *trigger*, not the work. The work is what the updated skill now says to do.
109
110
 
@@ -122,7 +123,7 @@ The `setup` skill instructs consumers to copy `skills/*` into their agent's skil
122
123
  For each agent directory that exists:
123
124
 
124
125
  1. For every directory in project `skills/`, copy it into the agent dir (overwrite on match, add if missing)
125
- 2. Do **not** delete skills in the agent dir that aren't in project `skills/` — they may be general-purpose skills sourced elsewhere (e.g., `code-security`, `cloudflare`, `changelog`)
126
+ 2. Do **not** delete skills in the agent dir that aren't in project `skills/` — they may be general-purpose skills sourced elsewhere (e.g., `code-security`, `cloudflare`, `changelog`). **Exception:** a framework skill pruned in Phase A step 4 — delete that same-named directory from each agent dir too. Match by the specific name you just removed, never by a blanket "absent from `skills/`" sweep (which would catch the externally-sourced skills above).
126
127
 
127
128
  If no agent directory exists, skip Phase B — the project hasn't opted in to per-agent skill copies.
128
129
 
@@ -154,7 +155,7 @@ Scripts in `scripts/` that aren't present in the package directory are project-s
154
155
  |:--|:--|
155
156
  | `templates/changelog/template.md` | `changelog/template.md` |
156
157
 
157
- Apply the same compare-and-overwrite logic. Add new entries here only when a template is explicitly documented as pristine in the framework's CLAUDE.md or its own header.
158
+ Apply the same compare-and-overwrite logic. Add new entries here only when a template is explicitly documented as pristine in the framework's CLAUDE.md/AGENTS.md or its own header.
158
159
 
159
160
  If the consumer customized a framework script or pristine reference (against guidance), the overwrite discards those changes. After the sync runs, diff `scripts/` and the affected template paths to surface replacements — review before committing. If a specific local customization needs to be preserved, revert that file using your git tools.
160
161
 
@@ -181,7 +182,7 @@ The consumer opted into the framework; its templates, skills, scripts, linter ru
181
182
 
182
183
  | ❌ Not a valid reason to defer | ✅ Valid reason to defer |
183
184
  |:-------------------------------|:-------------------------|
184
- | "Larger change than fits this pass" | Code-commented or `CLAUDE.md`-documented local override that intentionally diverges from the framework convention |
185
+ | "Larger change than fits this pass" | Code-commented or `CLAUDE.md`/`AGENTS.md`-documented local override that intentionally diverges from the framework convention |
185
186
  | "Marginal benefit / leaving as-is" | Breaking change with multiple migration paths that need user input |
186
187
  | "Per-tool refactor — worth doing as a focused follow-up" | Feature genuinely doesn't apply (the surface doesn't exist in this server) |
187
188
  | "Existing helper has rich domain messages we'd lose" | — (port the messages onto the framework path) |
@@ -221,7 +222,7 @@ Present a concise numbered summary to the user:
221
222
  3. **Features adopted** — new framework APIs now in use
222
223
  4. **Skills synced** — added/updated with versions (Phase A) and agent directories refreshed (Phase B)
223
224
  5. **New/changed skills available** — skills that appeared in Phase A for the first time or had materially-changed step sequences. Frame as "consider running when the time is right" rather than immediate actions; the user decides when to invoke them.
224
- 6. **Open decisions** — genuinely ambiguous items only. Valid: breaking changes with multiple migration paths needing user input, framework changes that conflict with a code-commented or `CLAUDE.md`-documented local override, third-party adoptions where cost/benefit is close. **Not valid:** framework adoptions deferred for scope, effort, or marginal-benefit reasoning — those were already adopted in Step 6 and belong under "Features adopted." If this section is empty, that's the expected outcome of a clean framework upgrade.
225
+ 6. **Open decisions** — genuinely ambiguous items only. Valid: breaking changes with multiple migration paths needing user input, framework changes that conflict with a code-commented or `CLAUDE.md`/`AGENTS.md`-documented local override, third-party adoptions where cost/benefit is close. **Not valid:** framework adoptions deferred for scope, effort, or marginal-benefit reasoning — those were already adopted in Step 6 and belong under "Features adopted." If this section is empty, that's the expected outcome of a clean framework upgrade.
225
226
  7. **Status** — rebuild / devcheck / test results
226
227
 
227
228
  ## Checklist
@@ -133,7 +133,7 @@ Each sub-agent reads BOTH `skills/git-wrapup/SKILL.md` AND `skills/release-and-p
133
133
  - No bypass → Phase 4 runs serially, orchestrator-driven, one target at a time
134
134
  - No npm publish involved (private only) → non-issue
135
135
 
136
- **Commit structure.** Version bump rides with the change that warrants it. For a maintenance pass with a single cohesive change shape (e.g. just dep updates, or just one framework adoption), that's **one commit** subject can lead with the version (e.g. `feat: 0.5.2 — adopt new error factories, framework ^0.9.6`). For a maintenance pass containing multiple distinct concerns, split into per-concern commits with the version bump folded into the headline-change commit, not a separate ceremonial release commit.
136
+ **Commit structure.** Group the work by concern, then land the release artifacts (version bumps + changelog + regenerated `docs/tree.md`/`server.json`/`manifest.json`) as a `chore(release): <version> <theme>` commit on top same model as `git-wrapup` Step 7. A single-concern pass (just dep updates, or one framework adoption) is one work commit plus the release commit; a pass spanning multiple distinct concerns splits into per-concern work commits with the release commit last. Regenerated meta-drift is release-artifact-shaped — it rides in the release commit, never carved out as its own.
137
137
 
138
138
  **Tag annotations are for end users.** Internal dev cleanup (lockfile refreshes, linter fixes, build config) belongs in the commit body, not the tag annotation.
139
139
 
@@ -4,7 +4,7 @@ description: >
4
4
  Finalize documentation and project metadata for a ship-ready MCP server. Use after implementation is complete, tests pass, and devcheck is clean. Safe to run at any stage — each step checks current state and only acts on what still needs work.
5
5
  metadata:
6
6
  author: cyanheads
7
- version: "2.4"
7
+ version: "2.5"
8
8
  audience: external
9
9
  type: workflow
10
10
  ---
@@ -71,11 +71,11 @@ These sections should remain intact unless you have a specific reason to change
71
71
  - **Core Rules** — universal to all servers built on the framework
72
72
  - **Errors section** — "handlers throw, framework catches" is universal
73
73
  - **Imports section** — keep unless the alias convention was changed
74
- - **Framework reference pointer** — the line directing agents to `node_modules/@cyanheads/mcp-ts-core/CLAUDE.md`
74
+ - **Framework reference pointer** — the line directing agents to `node_modules/@cyanheads/mcp-ts-core/CLAUDE.md` (or `AGENTS.md`)
75
75
 
76
76
  ## Pitfalls
77
77
 
78
- - Don't duplicate the full framework CLAUDE.md into the project file. The project file covers server-specific conventions; the framework file covers the API. The pointer at the top connects them.
78
+ - Don't duplicate the full framework CLAUDE.md/AGENTS.md into the project file. The project file covers server-specific conventions; the framework file covers the API. The pointer at the top connects them.
79
79
  - Don't remove `## Core Rules` even if it seems obvious — agents read this fresh each session.
80
80
  - Don't add implementation details that change frequently. The agent protocol file should be stable — update it when the server's shape changes, not on every commit.
81
81
  - Don't assume this is a one-time pass. The protocol file should be revisited whenever the server's surface area changes (tools added/removed, new services, config changes).
@@ -20,7 +20,7 @@ Framework badge ← solo spotlight row — `Built on @cy
20
20
  ## Configuration ← env var table + `.env.example` pointer
21
21
  ## Running the server ← dev, production, Workers/Docker
22
22
  ## Project structure ← directory/purpose table
23
- ## Development guide ← link to CLAUDE.md, key rules
23
+ ## Development guide ← link to CLAUDE.md/AGENTS.md, key rules
24
24
  ## Contributing ← brief
25
25
  ## License ← one line
26
26
  ```
@@ -471,12 +471,12 @@ Directory/purpose table orienting contributors to the codebase.
471
471
 
472
472
  ### Development Guide
473
473
 
474
- Brief — link to CLAUDE.md for full details. State 3-4 key rules. **Include the "validate → normalize → never fabricate" bullet** — it's the canonical anti-hallucination convention for external API wrappers and reinforces the framework's `no fabricated signal` principle.
474
+ Brief — link to CLAUDE.md/AGENTS.md for full details. State 3-4 key rules. **Include the "validate → normalize → never fabricate" bullet** — it's the canonical anti-hallucination convention for external API wrappers and reinforces the framework's `no fabricated signal` principle.
475
475
 
476
476
  ```markdown
477
477
  ## Development guide
478
478
 
479
- See [`CLAUDE.md`](./CLAUDE.md) for development guidelines and architectural rules. The short version:
479
+ See [`CLAUDE.md`/`AGENTS.md`](./CLAUDE.md) for development guidelines and architectural rules. The short version:
480
480
 
481
481
  - Handlers throw, framework catches — no `try/catch` in tool logic
482
482
  - Use `ctx.log` for request-scoped logging, `ctx.state` for tenant-scoped storage
@@ -4,7 +4,7 @@ description: >
4
4
  Post-init orientation for an MCP server built on @cyanheads/mcp-ts-core. Use after running `@cyanheads/mcp-ts-core init` to understand the project structure, conventions, and skill sync model. Also use when onboarding to an existing project for the first time.
5
5
  metadata:
6
6
  author: cyanheads
7
- version: "1.7"
7
+ version: "1.8"
8
8
  audience: external
9
9
  type: workflow
10
10
  ---
@@ -15,14 +15,9 @@ This skill assumes `bunx @cyanheads/mcp-ts-core init [name]` has already run. Th
15
15
 
16
16
  ## Agent Protocol File
17
17
 
18
- The init CLI generates both `CLAUDE.md` and `AGENTS.md` with the same purpose. Keep one authoritative file for the agent you actually use:
18
+ The init CLI generates both `CLAUDE.md` and `AGENTS.md` with identical content — `CLAUDE.md` is read by Claude Code, `AGENTS.md` by Codex, Cursor, Windsurf, and other agents. **Keep both.** Shipping both keeps the project agent-agnostic, and they're cheap to hold in sync: edit one, then `cp CLAUDE.md AGENTS.md` (the framework keeps its own pair byte-identical the same way, enforced by `check-docs-sync`). Only delete one if you're certain the project will never be opened by the other family of agents.
19
19
 
20
- - **Claude Code** keep `CLAUDE.md`, delete `AGENTS.md`
21
- - **All other agents** (Codex, Cursor, Windsurf, etc.) — keep `AGENTS.md`, delete `CLAUDE.md`
22
-
23
- Both files serve the same purpose: project-specific agent instructions. Prefer committing one authoritative copy rather than trying to keep both in sync by hand.
24
-
25
- For the full framework docs, read `node_modules/@cyanheads/mcp-ts-core/CLAUDE.md` once per session. It contains the exports catalog, tool/resource/prompt contracts, error codes, context API, and common import patterns.
20
+ For the full framework docs, read `node_modules/@cyanheads/mcp-ts-core/CLAUDE.md` (or its identical twin `AGENTS.md`) once per session. It contains the exports catalog, tool/resource/prompt contracts, error codes, context API, and common import patterns.
26
21
 
27
22
  ## Project Structure
28
23
 
@@ -155,12 +150,12 @@ Skip or reorder as the project calls for it. The agent protocol's "What's Next?"
155
150
 
156
151
  ## Checklist
157
152
 
158
- - [ ] Agent protocol file selectedone authoritative file kept (`CLAUDE.md` or `AGENTS.md`), the other deleted
153
+ - [ ] Agent protocol files keptboth `CLAUDE.md` and `AGENTS.md` present and in sync (or the unused one deliberately deleted)
159
154
  - [ ] `bun install` run
160
155
  - [ ] Dependencies updated (`bun update --latest`)
161
156
  - [ ] Git repo initialized and initial commit made (`chore: scaffold from @cyanheads/mcp-ts-core`)
162
157
  - [ ] Substituted server name verified in `package.json`, agent protocol file, and `server.json`
163
- - [ ] Framework docs read (`node_modules/@cyanheads/mcp-ts-core/CLAUDE.md`)
158
+ - [ ] Framework docs read (`node_modules/@cyanheads/mcp-ts-core/CLAUDE.md` or `AGENTS.md`)
164
159
  - [ ] Unused echo definitions cleaned up (and unregistered from `src/index.ts`)
165
160
  - [ ] Skills copied to agent directory (`cp -R skills/* .claude/skills/` or equivalent)
166
161
  - [ ] Project structure understood (definitions directories, entry point)
@@ -309,7 +309,8 @@ When you complete a skill's checklist, check the boxes and add a completion time
309
309
  | `npm run devcheck` | Lint + format + typecheck + security + changelog sync |
310
310
  | `bun run audit:refresh` | Delete `bun.lock`, reinstall, and re-run `bun audit`. Use when `devcheck` flags a transitive advisory — Bun's `update` is sticky on transitive resolutions, so the advisory may be a stale-lockfile false positive. If it survives the refresh, it's real. |
311
311
  | `npm run tree` | Generate directory structure doc |
312
- | `npm run format` | Auto-fix formatting |
312
+ | `npm run format` | Auto-fix formatting (safe fixes only) |
313
+ | `npm run format:unsafe` | Also apply Biome's unsafe autofixes — review the diff; they can change behavior |
313
314
  | `npm test` | Run tests |
314
315
  | `npm run start:stdio` | Production mode (stdio) |
315
316
  | `npm run start:http` | Production mode (HTTP) |
@@ -309,7 +309,8 @@ When you complete a skill's checklist, check the boxes and add a completion time
309
309
  | `npm run devcheck` | Lint + format + typecheck + security + changelog sync |
310
310
  | `bun run audit:refresh` | Delete `bun.lock`, reinstall, and re-run `bun audit`. Use when `devcheck` flags a transitive advisory — Bun's `update` is sticky on transitive resolutions, so the advisory may be a stale-lockfile false positive. If it survives the refresh, it's real. |
311
311
  | `npm run tree` | Generate directory structure doc |
312
- | `npm run format` | Auto-fix formatting |
312
+ | `npm run format` | Auto-fix formatting (safe fixes only) |
313
+ | `npm run format:unsafe` | Also apply Biome's unsafe autofixes — review the diff; they can change behavior |
313
314
  | `npm test` | Run tests |
314
315
  | `npm run start:stdio` | Production mode (stdio) |
315
316
  | `npm run start:http` | Production mode (HTTP) |
@@ -1,6 +1,8 @@
1
1
  .env*
2
2
  .mcpregistry_*
3
3
  .claude/
4
+ .agents/
5
+ skills/
4
6
  Dockerfile
5
7
  bun.lock
6
8
  bunfig.toml
@@ -43,7 +43,7 @@ security: false
43
43
  name the symbol, state what changed, stop. Use a second sentence only when
44
44
  it carries weight. If a bullet feels long, it is.
45
45
 
46
- Cut: mechanism walkthroughs (those belong in JSDoc, AGENTS.md, or the
46
+ Cut: mechanism walkthroughs (those belong in JSDoc, CLAUDE.md/AGENTS.md, or the
47
47
  relevant skill), ceremonial framings ("This release introduces…",
48
48
  backwards-compat paragraphs), file-by-file test enumerations, internal
49
49
  implementation notes. Prefer code/symbol names over English re-explanations.
@@ -26,7 +26,8 @@
26
26
  "audit:refresh": "rm -f bun.lock && bun install && bun audit",
27
27
  "tree": "tsx scripts/tree.ts",
28
28
  "list-skills": "tsx scripts/list-skills.ts",
29
- "format": "biome check --write --unsafe .",
29
+ "format": "biome check --write .",
30
+ "format:unsafe": "biome check --write --unsafe .",
30
31
  "lint:mcp": "tsx scripts/lint-mcp.ts",
31
32
  "lint:packaging": "tsx scripts/lint-packaging.ts",
32
33
  "bundle": "npm run build && npx -y @anthropic-ai/mcpb pack . dist/{{PACKAGE_NAME}}.mcpb",