@cyanheads/mcp-ts-core 0.9.10 → 0.9.11

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.
package/CLAUDE.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # Developer Protocol
2
2
 
3
3
  **Package:** `@cyanheads/mcp-ts-core`
4
- **Version:** 0.9.10
4
+ **Version:** 0.9.11
5
5
  **Engines:** Bun ≥1.3.0, Node ≥24.0.0
6
6
  **MCP SDK:** `@modelcontextprotocol/sdk` ^1.29.0
7
7
  **Zod:** ^4.4.3
@@ -540,6 +540,7 @@ security: false # optional, default fals
540
540
  | `summary` | yes | Rollup index line. ≤350 chars, no markdown, single line. Write like a GitHub Release title. |
541
541
  | `breaking` | no (default `false`) | Flags releases with breaking changes. Renders as `· ⚠️ Breaking` badge in the rollup. Agents running the `maintenance` skill read this to prioritize review. |
542
542
  | `security` | no (default `false`) | Flags releases with security fixes. Renders as `· 🛡️ Security` badge in the rollup so users can triage upgrade urgency. Pairs with the `## Security` body section. |
543
+ | `agent-notes` | no | Free-form adoption notes for downstream `maintenance` agents — new files to create, fields to populate, skills to re-run, one-time migration steps. Not rendered in `CHANGELOG.md`; consumed only by agents running the `maintenance` skill on consumer projects. Omit when there's nothing to say. |
543
544
 
544
545
  Badge order when both set: `· ⚠️ Breaking · 🛡️ Security`. Summary > 350 chars or malformed boolean fails `changelog:check`.
545
546
 
package/README.md CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  <div align="center">
7
7
 
8
- [![Version](https://img.shields.io/badge/Version-0.9.10-blue.svg?style=flat-square)](./CHANGELOG.md) [![License](https://img.shields.io/badge/License-Apache%202.0-orange.svg?style=flat-square)](./LICENSE) [![MCP Spec](https://img.shields.io/badge/MCP%20Spec-2025--11--25-8A2BE2.svg?style=flat-square)](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/main/docs/specification/2025-11-25/changelog.mdx)
8
+ [![Version](https://img.shields.io/badge/Version-0.9.11-blue.svg?style=flat-square)](./CHANGELOG.md) [![License](https://img.shields.io/badge/License-Apache%202.0-orange.svg?style=flat-square)](./LICENSE) [![MCP Spec](https://img.shields.io/badge/MCP%20Spec-2025--11--25-8A2BE2.svg?style=flat-square)](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/main/docs/specification/2025-11-25/changelog.mdx)
9
9
 
10
10
  [![MCP SDK](https://img.shields.io/badge/MCP%20SDK-^1.29.0-green.svg?style=flat-square)](https://modelcontextprotocol.io/) [![TypeScript](https://img.shields.io/badge/TypeScript-^6.0.3-3178C6.svg?style=flat-square)](https://www.typescriptlang.org/) [![Bun](https://img.shields.io/badge/Bun-v1.3.0%2B-blueviolet.svg?style=flat-square)](https://bun.sh/)
11
11
 
package/biome.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "$schema": "https://biomejs.dev/schemas/2.4.15/schema.json",
2
+ "$schema": "https://biomejs.dev/schemas/2.4.16/schema.json",
3
3
  "vcs": {
4
4
  "enabled": true,
5
5
  "clientKind": "git",
@@ -0,0 +1,38 @@
1
+ ---
2
+ summary: "code-simplifier skill, orchestrations skill restructure, init --help flag, MCPB user_config default guidance"
3
+ breaking: false
4
+ security: false
5
+ agent-notes: |
6
+ New external skill `code-simplifier` — Phase A skill sync picks it up; consumers with synced skill dirs
7
+ get the new directory under `skills/code-simplifier/` and (per Phase B) under their agent skill dirs.
8
+ Internal skill `multi-server-orchestration` replaced by `orchestrations` with `workflows/` references.
9
+ External-audience skills only — no consumer action required for the orchestrations rename.
10
+ Skill version bumps: polish-docs-meta 2.2 → 2.3, report-issue-framework 1.6 → 1.7, git-wrapup 1.0 → 1.1.
11
+ polish-docs-meta 2.3 adds MCPB `user_config` placeholder default guidance — consumers with `manifest.json`
12
+ should audit optional `user_config` entries referenced as `${user_config.X}` in `mcp_config.env`:
13
+ set `"default": ""` when not `required: true`, and pair env-backed strict validators (`z.email()`,
14
+ `z.url()`, `.regex()`) with a `z.preprocess` that strips `${...}` placeholders to `undefined`.
15
+ ---
16
+
17
+ # 0.9.11 — 2026-05-28
18
+
19
+ ## Added
20
+
21
+ - **`skills/code-simplifier/`** — new external skill for post-session code review and cleanup against `git diff`. Modernizes syntax, consolidates duplication, aligns changes with the existing codebase. Includes framework-specific transformations for tool/resource/prompt definitions, the `ctx` pattern, error factories, and idioms.
22
+ - **`mcp-ts-core init --help`** / **`-h`** — explicit help flag for the init subcommand. Unknown flags now error out with usage hint instead of being silently treated as the project name.
23
+ - **`templates/AGENTS.md`** and **`templates/CLAUDE.md`** — `tool-defs-analysis`, `code-simplifier`, `git-wrapup`, `release-and-publish`, `migrate-mcp-ts-template`, and `api-linter` added to the skills tables.
24
+
25
+ ## Changed
26
+
27
+ - **`skills/orchestrations/`** replaces **`skills/multi-server-orchestration/`** — restructured into intent-based workflow routing under `workflows/`: `greenfield-build.md`, `maintenance-release.md`, `field-test-fix.md`, `fix-wrapup-release.md`. Single source for universal rules, orchestrator posture, and sub-agent strategy. Sub-agent fanout is now an optional capability; workflows run linearly when fanout isn't available. Internal audience.
28
+ - **`skills/polish-docs-meta/SKILL.md`** v2.2 → v2.3 — MCPB `user_config` placeholder default guidance. Hosts pass the literal `${user_config.X}` string through when an optional field is blank without a `default`, crashing strict validators (`z.email()`, `z.url()`, `.regex()`) at lazy config load. Pair with `z.preprocess` to strip placeholders to `undefined` server-side.
29
+ - **`skills/report-issue-framework/SKILL.md`** v1.6 → v1.7 — pre-flight step added for documentation/contract requests. Audit `src/`, `docs/`, and `skills/` (external-audience skills are the public contract) plus public exports before filing duplicates.
30
+ - **`skills/git-wrapup/SKILL.md`** v1.0 → v1.1 — minor cleanup; the orchestrator-spawn paragraph is gone (orchestrations skill owns that flow now).
31
+ - **`changelog/template.md`**, **`AGENTS.md`**, **`CLAUDE.md`** — `agent-notes` frontmatter field documented.
32
+ - **Dependency bumps:**
33
+ - `@biomejs/biome` 2.4.15 → 2.4.16
34
+ - `@cloudflare/workers-types` ^4.20260527.1 → ^4.20260528.1
35
+
36
+ ## Removed
37
+
38
+ - **`skills/multi-server-orchestration/`** — replaced by `skills/orchestrations/`. Internal audience; no consumer action required.
package/dist/cli/init.js CHANGED
@@ -46,8 +46,10 @@ function printUsage() {
46
46
  @cyanheads/mcp-ts-core v${PACKAGE_JSON.version}
47
47
 
48
48
  Usage:
49
- mcp-ts-core init [name] Scaffold a new MCP server project
50
- mcp-ts-core --help Show this help message
49
+ mcp-ts-core init [name] Scaffold a new MCP server project
50
+ Without [name], scaffolds in place (upgrade flow)
51
+ mcp-ts-core --help, -h Show this help message
52
+ mcp-ts-core init --help Show init help (same output)
51
53
 
52
54
  Examples:
53
55
  bunx @cyanheads/mcp-ts-core init my-mcp-server
@@ -55,7 +57,18 @@ function printUsage() {
55
57
  }
56
58
  // ── Init command ──────────────────────────────────────────────────────
57
59
  function init() {
58
- const name = process.argv.slice(3).find((a) => !a.startsWith('--'));
60
+ const args = process.argv.slice(3);
61
+ if (args.includes('--help') || args.includes('-h')) {
62
+ printUsage();
63
+ process.exit(0);
64
+ }
65
+ const name = args.find((a) => !a.startsWith('-'));
66
+ const unknownFlags = args.filter((a) => a.startsWith('-') && a !== name);
67
+ if (unknownFlags.length > 0) {
68
+ console.error(` Error: unknown flag(s): ${unknownFlags.join(', ')}`);
69
+ console.error(` Run "bunx @cyanheads/mcp-ts-core init --help" for usage.`);
70
+ process.exit(1);
71
+ }
59
72
  const dest = name ? join(process.cwd(), name) : process.cwd();
60
73
  const packageName = name ?? basename(dest);
61
74
  if (name) {
@@ -1 +1 @@
1
- {"version":3,"file":"init.js","sourceRoot":"","sources":["../../src/cli/init.ts"],"names":[],"mappings":";AACA;;;;GAIG;AAEH,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAClG,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACvE,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EAAE,CAAC,CAAC;QAC3C,CAAC;QACD,OAAO,CAAC,GAAG,CAAC,OAAO,IAAI,EAAE,eAAe,CAAC,CAAC;QAC1C,OAAO,CAAC,GAAG,CAAC,OAAO,IAAI,sDAAsD,CAAC,CAAC;QAC/E,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;QAC7B,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;QAC5B,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;QAC/B,OAAO,CAAC,GAAG,CAAC,oEAAoE,CAAC,CAAC;QAClF,OAAO,CAAC,GAAG,EAAE,CAAC;IAChB,CAAC;AACH,CAAC"}
@@ -1,4 +1,4 @@
1
- {"level":40,"time":1779856368095,"env":"testing","version":"0.9.10","pid":42668,"transport":"http","requestId":"K0H0F-OGJCX","timestamp":"2026-05-27T04:32:48.095Z","operation":"TransportManager.start","component":"HttpTransportSetup","msg":"MCP_ALLOWED_ORIGINS is not set — CORS is wildcard for CLI clients; browser Origin headers are restricted to loopback. Set MCP_ALLOWED_ORIGINS for production deployments accepting remote browser origins."}
2
- {"level":40,"time":1779856369836,"env":"testing","version":"0.9.10","pid":42668,"transport":"http","requestId":"K0H0F-OGJCX","timestamp":"2026-05-27T04:32:48.095Z","operation":"TransportManager.start","component":"HttpTransportSetup","sessionId":"not-a-real-session-1779856369835","msg":"Session validation failed - invalid or hijacked session"}
3
- {"level":50,"time":1779856373661,"env":"testing","version":"0.0.0-test","pid":42886,"requestId":"S73IT-N51J4","timestamp":"2026-05-27T04:32:53.660Z","operation":"HandleToolRequest","critical":false,"errorCode":-32005,"originalErrorType":"McpError","finalErrorType":"McpError","sessionId":"d403b6f5b5a1acd6bef09780d848eb07995f35133a797a95095b91d16ad63d5f","toolName":"scoped_echo","tenantId":"authz-tenant","auth":{"sub":"authz-user","scopes":["tool:other:read"],"clientId":"authz-client","tenantId":"authz-tenant","token":"[REDACTED]"},"errorData":{"sessionId":"d403b6f5b5a1acd6bef09780d848eb07995f35133a797a95095b91d16ad63d5f","toolName":"scoped_echo","requestId":"S73IT-N51J4","timestamp":"2026-05-27T04:32:53.660Z","tenantId":"authz-tenant","operation":"HandleToolRequest","auth":{"sub":"authz-user","scopes":["tool:other:read"],"clientId":"authz-client","tenantId":"authz-tenant","token":"[REDACTED]"},"originalErrorName":"McpError","originalMessage":"Insufficient permissions.","originalStack":"McpError: Insufficient permissions.\n at forbidden (/Users/casey/Developer/github/mcp-ts-core/dist/types-global/errors.js:84:58)\n at withRequiredScopes (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/auth/lib/authUtils.js:68:15)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/utils/toolHandlerFactory.js:146:17)\n at executeToolHandler (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:231:34)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:126:43)\n at processTicksAndRejections (native:7:39)"},"stack":"McpError: Insufficient permissions.\n at handleError (/Users/casey/Developer/github/mcp-ts-core/dist/utils/internal/error-handler/errorHandler.js:170:23)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/utils/toolHandlerFactory.js:184:26)\n at executeToolHandler (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:231:34)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:126:43)\n at processTicksAndRejections (native:7:39)","msg":"Error in tool:scoped_echo: Insufficient permissions."}
4
- {"level":50,"time":1779856373668,"env":"testing","version":"0.0.0-test","pid":42886,"requestId":"2Z3AI-0NEMI","timestamp":"2026-05-27T04:32:53.668Z","operation":"HandleToolRequest","critical":false,"errorCode":-32005,"originalErrorType":"McpError","finalErrorType":"McpError","sessionId":"f6f091b254ded43dfd3db766e8ea167db6d7ba526bad1931f50f0ffc40f5a2e4","toolName":"scoped_echo","tenantId":"authz-tenant","auth":{"sub":"authz-user","scopes":["openid","email","profile","offline_access"],"clientId":"authz-client","tenantId":"authz-tenant","token":"[REDACTED]"},"errorData":{"sessionId":"f6f091b254ded43dfd3db766e8ea167db6d7ba526bad1931f50f0ffc40f5a2e4","toolName":"scoped_echo","requestId":"2Z3AI-0NEMI","timestamp":"2026-05-27T04:32:53.668Z","tenantId":"authz-tenant","operation":"HandleToolRequest","auth":{"sub":"authz-user","scopes":["openid","email","profile","offline_access"],"clientId":"authz-client","tenantId":"authz-tenant","token":"[REDACTED]"},"originalErrorName":"McpError","originalMessage":"Insufficient permissions.","originalStack":"McpError: Insufficient permissions.\n at forbidden (/Users/casey/Developer/github/mcp-ts-core/dist/types-global/errors.js:84:58)\n at withRequiredScopes (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/auth/lib/authUtils.js:68:15)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/utils/toolHandlerFactory.js:146:17)\n at executeToolHandler (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:231:34)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:126:43)\n at processTicksAndRejections (native:7:39)"},"stack":"McpError: Insufficient permissions.\n at handleError (/Users/casey/Developer/github/mcp-ts-core/dist/utils/internal/error-handler/errorHandler.js:170:23)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/utils/toolHandlerFactory.js:184:26)\n at executeToolHandler (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:231:34)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:126:43)\n at processTicksAndRejections (native:7:39)","msg":"Error in tool:scoped_echo: Insufficient permissions."}
1
+ {"level":40,"time":1779956716339,"env":"testing","version":"0.9.11","pid":76049,"transport":"http","requestId":"EACCT-Y4LMQ","timestamp":"2026-05-28T08:25:16.338Z","operation":"TransportManager.start","component":"HttpTransportSetup","msg":"MCP_ALLOWED_ORIGINS is not set — CORS is wildcard for CLI clients; browser Origin headers are restricted to loopback. Set MCP_ALLOWED_ORIGINS for production deployments accepting remote browser origins."}
2
+ {"level":40,"time":1779956718301,"env":"testing","version":"0.9.11","pid":76049,"transport":"http","requestId":"EACCT-Y4LMQ","timestamp":"2026-05-28T08:25:16.338Z","operation":"TransportManager.start","component":"HttpTransportSetup","sessionId":"not-a-real-session-1779956718301","msg":"Session validation failed - invalid or hijacked session"}
3
+ {"level":50,"time":1779956722195,"env":"testing","version":"0.0.0-test","pid":76158,"requestId":"ECEQK-LVQKS","timestamp":"2026-05-28T08:25:22.194Z","operation":"HandleToolRequest","critical":false,"errorCode":-32005,"originalErrorType":"McpError","finalErrorType":"McpError","sessionId":"6547e6baaa135b55387e4c255263a97c3e7f60f4fbd5c857ff617cb6ca12cd3b","toolName":"scoped_echo","tenantId":"authz-tenant","auth":{"sub":"authz-user","scopes":["tool:other:read"],"clientId":"authz-client","tenantId":"authz-tenant","token":"[REDACTED]"},"errorData":{"sessionId":"6547e6baaa135b55387e4c255263a97c3e7f60f4fbd5c857ff617cb6ca12cd3b","toolName":"scoped_echo","requestId":"ECEQK-LVQKS","timestamp":"2026-05-28T08:25:22.194Z","tenantId":"authz-tenant","operation":"HandleToolRequest","auth":{"sub":"authz-user","scopes":["tool:other:read"],"clientId":"authz-client","tenantId":"authz-tenant","token":"[REDACTED]"},"originalErrorName":"McpError","originalMessage":"Insufficient permissions.","originalStack":"McpError: Insufficient permissions.\n at forbidden (/Users/casey/Developer/github/mcp-ts-core/dist/types-global/errors.js:84:58)\n at withRequiredScopes (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/auth/lib/authUtils.js:68:15)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/utils/toolHandlerFactory.js:146:17)\n at executeToolHandler (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:231:34)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:126:43)\n at processTicksAndRejections (native:7:39)"},"stack":"McpError: Insufficient permissions.\n at handleError (/Users/casey/Developer/github/mcp-ts-core/dist/utils/internal/error-handler/errorHandler.js:170:23)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/utils/toolHandlerFactory.js:184:26)\n at executeToolHandler (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:231:34)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:126:43)\n at processTicksAndRejections (native:7:39)","msg":"Error in tool:scoped_echo: Insufficient permissions."}
4
+ {"level":50,"time":1779956722206,"env":"testing","version":"0.0.0-test","pid":76158,"requestId":"UNG2U-T5S05","timestamp":"2026-05-28T08:25:22.206Z","operation":"HandleToolRequest","critical":false,"errorCode":-32005,"originalErrorType":"McpError","finalErrorType":"McpError","sessionId":"5295c3e009a2eb3a65f7e9baea247dada1dbc892b814d05012e110c1ed291259","toolName":"scoped_echo","tenantId":"authz-tenant","auth":{"sub":"authz-user","scopes":["openid","email","profile","offline_access"],"clientId":"authz-client","tenantId":"authz-tenant","token":"[REDACTED]"},"errorData":{"sessionId":"5295c3e009a2eb3a65f7e9baea247dada1dbc892b814d05012e110c1ed291259","toolName":"scoped_echo","requestId":"UNG2U-T5S05","timestamp":"2026-05-28T08:25:22.206Z","tenantId":"authz-tenant","operation":"HandleToolRequest","auth":{"sub":"authz-user","scopes":["openid","email","profile","offline_access"],"clientId":"authz-client","tenantId":"authz-tenant","token":"[REDACTED]"},"originalErrorName":"McpError","originalMessage":"Insufficient permissions.","originalStack":"McpError: Insufficient permissions.\n at forbidden (/Users/casey/Developer/github/mcp-ts-core/dist/types-global/errors.js:84:58)\n at withRequiredScopes (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/auth/lib/authUtils.js:68:15)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/utils/toolHandlerFactory.js:146:17)\n at executeToolHandler (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:231:34)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:126:43)\n at processTicksAndRejections (native:7:39)"},"stack":"McpError: Insufficient permissions.\n at handleError (/Users/casey/Developer/github/mcp-ts-core/dist/utils/internal/error-handler/errorHandler.js:170:23)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/utils/toolHandlerFactory.js:184:26)\n at executeToolHandler (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:231:34)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:126:43)\n at processTicksAndRejections (native:7:39)","msg":"Error in tool:scoped_echo: Insufficient permissions."}
@@ -1,2 +1,2 @@
1
- {"level":50,"time":1779856373661,"env":"testing","version":"0.0.0-test","pid":42886,"requestId":"S73IT-N51J4","timestamp":"2026-05-27T04:32:53.660Z","operation":"HandleToolRequest","critical":false,"errorCode":-32005,"originalErrorType":"McpError","finalErrorType":"McpError","sessionId":"d403b6f5b5a1acd6bef09780d848eb07995f35133a797a95095b91d16ad63d5f","toolName":"scoped_echo","tenantId":"authz-tenant","auth":{"sub":"authz-user","scopes":["tool:other:read"],"clientId":"authz-client","tenantId":"authz-tenant","token":"[REDACTED]"},"errorData":{"sessionId":"d403b6f5b5a1acd6bef09780d848eb07995f35133a797a95095b91d16ad63d5f","toolName":"scoped_echo","requestId":"S73IT-N51J4","timestamp":"2026-05-27T04:32:53.660Z","tenantId":"authz-tenant","operation":"HandleToolRequest","auth":{"sub":"authz-user","scopes":["tool:other:read"],"clientId":"authz-client","tenantId":"authz-tenant","token":"[REDACTED]"},"originalErrorName":"McpError","originalMessage":"Insufficient permissions.","originalStack":"McpError: Insufficient permissions.\n at forbidden (/Users/casey/Developer/github/mcp-ts-core/dist/types-global/errors.js:84:58)\n at withRequiredScopes (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/auth/lib/authUtils.js:68:15)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/utils/toolHandlerFactory.js:146:17)\n at executeToolHandler (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:231:34)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:126:43)\n at processTicksAndRejections (native:7:39)"},"stack":"McpError: Insufficient permissions.\n at handleError (/Users/casey/Developer/github/mcp-ts-core/dist/utils/internal/error-handler/errorHandler.js:170:23)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/utils/toolHandlerFactory.js:184:26)\n at executeToolHandler (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:231:34)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:126:43)\n at processTicksAndRejections (native:7:39)","msg":"Error in tool:scoped_echo: Insufficient permissions."}
2
- {"level":50,"time":1779856373668,"env":"testing","version":"0.0.0-test","pid":42886,"requestId":"2Z3AI-0NEMI","timestamp":"2026-05-27T04:32:53.668Z","operation":"HandleToolRequest","critical":false,"errorCode":-32005,"originalErrorType":"McpError","finalErrorType":"McpError","sessionId":"f6f091b254ded43dfd3db766e8ea167db6d7ba526bad1931f50f0ffc40f5a2e4","toolName":"scoped_echo","tenantId":"authz-tenant","auth":{"sub":"authz-user","scopes":["openid","email","profile","offline_access"],"clientId":"authz-client","tenantId":"authz-tenant","token":"[REDACTED]"},"errorData":{"sessionId":"f6f091b254ded43dfd3db766e8ea167db6d7ba526bad1931f50f0ffc40f5a2e4","toolName":"scoped_echo","requestId":"2Z3AI-0NEMI","timestamp":"2026-05-27T04:32:53.668Z","tenantId":"authz-tenant","operation":"HandleToolRequest","auth":{"sub":"authz-user","scopes":["openid","email","profile","offline_access"],"clientId":"authz-client","tenantId":"authz-tenant","token":"[REDACTED]"},"originalErrorName":"McpError","originalMessage":"Insufficient permissions.","originalStack":"McpError: Insufficient permissions.\n at forbidden (/Users/casey/Developer/github/mcp-ts-core/dist/types-global/errors.js:84:58)\n at withRequiredScopes (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/auth/lib/authUtils.js:68:15)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/utils/toolHandlerFactory.js:146:17)\n at executeToolHandler (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:231:34)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:126:43)\n at processTicksAndRejections (native:7:39)"},"stack":"McpError: Insufficient permissions.\n at handleError (/Users/casey/Developer/github/mcp-ts-core/dist/utils/internal/error-handler/errorHandler.js:170:23)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/utils/toolHandlerFactory.js:184:26)\n at executeToolHandler (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:231:34)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:126:43)\n at processTicksAndRejections (native:7:39)","msg":"Error in tool:scoped_echo: Insufficient permissions."}
1
+ {"level":50,"time":1779956722195,"env":"testing","version":"0.0.0-test","pid":76158,"requestId":"ECEQK-LVQKS","timestamp":"2026-05-28T08:25:22.194Z","operation":"HandleToolRequest","critical":false,"errorCode":-32005,"originalErrorType":"McpError","finalErrorType":"McpError","sessionId":"6547e6baaa135b55387e4c255263a97c3e7f60f4fbd5c857ff617cb6ca12cd3b","toolName":"scoped_echo","tenantId":"authz-tenant","auth":{"sub":"authz-user","scopes":["tool:other:read"],"clientId":"authz-client","tenantId":"authz-tenant","token":"[REDACTED]"},"errorData":{"sessionId":"6547e6baaa135b55387e4c255263a97c3e7f60f4fbd5c857ff617cb6ca12cd3b","toolName":"scoped_echo","requestId":"ECEQK-LVQKS","timestamp":"2026-05-28T08:25:22.194Z","tenantId":"authz-tenant","operation":"HandleToolRequest","auth":{"sub":"authz-user","scopes":["tool:other:read"],"clientId":"authz-client","tenantId":"authz-tenant","token":"[REDACTED]"},"originalErrorName":"McpError","originalMessage":"Insufficient permissions.","originalStack":"McpError: Insufficient permissions.\n at forbidden (/Users/casey/Developer/github/mcp-ts-core/dist/types-global/errors.js:84:58)\n at withRequiredScopes (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/auth/lib/authUtils.js:68:15)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/utils/toolHandlerFactory.js:146:17)\n at executeToolHandler (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:231:34)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:126:43)\n at processTicksAndRejections (native:7:39)"},"stack":"McpError: Insufficient permissions.\n at handleError (/Users/casey/Developer/github/mcp-ts-core/dist/utils/internal/error-handler/errorHandler.js:170:23)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/utils/toolHandlerFactory.js:184:26)\n at executeToolHandler (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:231:34)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:126:43)\n at processTicksAndRejections (native:7:39)","msg":"Error in tool:scoped_echo: Insufficient permissions."}
2
+ {"level":50,"time":1779956722206,"env":"testing","version":"0.0.0-test","pid":76158,"requestId":"UNG2U-T5S05","timestamp":"2026-05-28T08:25:22.206Z","operation":"HandleToolRequest","critical":false,"errorCode":-32005,"originalErrorType":"McpError","finalErrorType":"McpError","sessionId":"5295c3e009a2eb3a65f7e9baea247dada1dbc892b814d05012e110c1ed291259","toolName":"scoped_echo","tenantId":"authz-tenant","auth":{"sub":"authz-user","scopes":["openid","email","profile","offline_access"],"clientId":"authz-client","tenantId":"authz-tenant","token":"[REDACTED]"},"errorData":{"sessionId":"5295c3e009a2eb3a65f7e9baea247dada1dbc892b814d05012e110c1ed291259","toolName":"scoped_echo","requestId":"UNG2U-T5S05","timestamp":"2026-05-28T08:25:22.206Z","tenantId":"authz-tenant","operation":"HandleToolRequest","auth":{"sub":"authz-user","scopes":["openid","email","profile","offline_access"],"clientId":"authz-client","tenantId":"authz-tenant","token":"[REDACTED]"},"originalErrorName":"McpError","originalMessage":"Insufficient permissions.","originalStack":"McpError: Insufficient permissions.\n at forbidden (/Users/casey/Developer/github/mcp-ts-core/dist/types-global/errors.js:84:58)\n at withRequiredScopes (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/auth/lib/authUtils.js:68:15)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/utils/toolHandlerFactory.js:146:17)\n at executeToolHandler (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:231:34)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:126:43)\n at processTicksAndRejections (native:7:39)"},"stack":"McpError: Insufficient permissions.\n at handleError (/Users/casey/Developer/github/mcp-ts-core/dist/utils/internal/error-handler/errorHandler.js:170:23)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/utils/toolHandlerFactory.js:184:26)\n at executeToolHandler (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:231:34)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:126:43)\n at processTicksAndRejections (native:7:39)","msg":"Error in tool:scoped_echo: Insufficient permissions."}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cyanheads/mcp-ts-core",
3
- "version": "0.9.10",
3
+ "version": "0.9.11",
4
4
  "mcpName": "io.github.cyanheads/mcp-ts-core",
5
5
  "description": "Agent-native TypeScript framework for building MCP servers. Declarative definitions with auth, multi-backend storage, OpenTelemetry, and first-class support for Bun/Node/Cloudflare Workers.",
6
6
  "main": "dist/core/index.js",
@@ -167,9 +167,9 @@
167
167
  "yaml": "2.9.0"
168
168
  },
169
169
  "devDependencies": {
170
- "@biomejs/biome": "2.4.15",
170
+ "@biomejs/biome": "2.4.16",
171
171
  "@cloudflare/vitest-pool-workers": "^0.16.10",
172
- "@cloudflare/workers-types": "^4.20260527.1",
172
+ "@cloudflare/workers-types": "^4.20260528.1",
173
173
  "@duckdb/node-api": "^1.5.3-r.2",
174
174
  "@hono/otel": "^1.1.2",
175
175
  "@opentelemetry/exporter-metrics-otlp-http": "^0.218.0",
@@ -0,0 +1,130 @@
1
+ ---
2
+ name: code-simplifier
3
+ description: >
4
+ Post-session code review and cleanup against a working tree of changes. Analyzes `git diff` to simplify, consolidate, and align changed code with the existing codebase — modernize syntax, remove unnecessary complexity, consolidate duplicated logic, catch efficiency issues. Use after a substantive working session, or when asked to clean up, simplify, reduce slop, consolidate, modernize, tighten up, or de-slop code. For `@cyanheads/mcp-ts-core` projects, includes specific transformations for tool/resource/prompt definitions, the ctx pattern, error factories, and framework idioms.
5
+ metadata:
6
+ author: cyanheads
7
+ version: "1.0"
8
+ audience: external
9
+ type: workflow
10
+ ---
11
+
12
+ # Code Simplifier
13
+
14
+ Post-session cleanup pass. Reviews what changed, understands how it fits the existing codebase, and makes targeted improvements — modernizing syntax, removing unnecessary complexity, consolidating duplicated logic, catching efficiency issues. Prioritizes codebase cohesion over local perfection.
15
+
16
+ ## Core philosophy
17
+
18
+ **Every change must earn its keep.** A simplification that doesn't meaningfully improve clarity, correctness, or cohesion is noise. Don't refactor for refactoring's sake. Don't create new files, abstractions, or utilities unless they solve a demonstrated problem. If the existing code works and is readable, leave it alone. The goal is a cohesive codebase, not a pristine one.
19
+
20
+ ## Procedure
21
+
22
+ ### Phase 1: Identify changes
23
+
24
+ Run `git diff` (or `git diff HEAD` if changes are staged) to see what changed. If there are no git changes, review the most recently modified files from the current session.
25
+
26
+ ### Phase 2: Understand the surrounding codebase
27
+
28
+ Don't review changes in isolation. Before any modifications:
29
+
30
+ 1. **Read the full files** containing changes — not just the diff hunks. Understand imports, surrounding logic, module structure.
31
+ 2. **Identify the project language(s)** and select the relevant transformation rules. Discard inapplicable rules.
32
+ 3. **Survey adjacent code** — shared utilities, sibling modules, common patterns. You need to know what already exists before deciding something is missing. For mcp-ts-core projects, check `src/utils/` for project utilities, `src/errors/` for error handling, and `node_modules/@cyanheads/mcp-ts-core/` for framework exports.
33
+
34
+ ### Phase 3: Review
35
+
36
+ Evaluate the changes across these dimensions. Not every dimension applies to every diff — skip what's irrelevant.
37
+
38
+ #### Codebase cohesion
39
+
40
+ - **Reuse** — Search for existing utilities, helpers, and patterns that could replace newly-written code. For mcp-ts-core projects, prefer `import from '@cyanheads/mcp-ts-core/utils'` over hand-rolled equivalents — pagination helpers, schema builders, retry primitives, and OTel attribute constants are framework-provided.
41
+ - **Consolidation** — Flag copy-paste-with-variation: near-duplicate code blocks that should be unified. Only unify if the shared abstraction is genuinely simpler than the duplicated code.
42
+ - **Consistency** — Check that new code follows the same patterns as the rest of the codebase: naming conventions, error handling style, import patterns, type annotation style. Normalize toward the better variant when the project is inconsistent.
43
+ - **Stringly-typed code** — Flag raw strings where constants, string-union types, branded types, or framework attribute constants already exist. For mcp-ts-core projects, the `ATTR_*` constants in `@cyanheads/mcp-ts-core/utils` should replace raw OTel attribute keys.
44
+
45
+ #### Code quality
46
+
47
+ - **Redundant state** — State that duplicates existing state, cached values that could be derived.
48
+ - **Unnecessary complexity** — Deep nesting that could be guard clauses, premature abstractions, over-engineered solutions to simple problems.
49
+ - **Dead code** — Unreachable branches, unused variables, commented-out code, exports that nothing imports.
50
+ - **Defensive code for impossible states** — Guards for cases the type system or framework already prevents. Drop them.
51
+ - **Outdated patterns** — Verbose or legacy syntax where modern equivalents exist. See the transformation tables below.
52
+
53
+ #### Efficiency
54
+
55
+ - **Redundant work** — Repeated computations, duplicate file reads, duplicate network/API calls, N+1 query patterns.
56
+ - **Missed concurrency** — Independent async operations run sequentially that could run in parallel with `Promise.all` / `Promise.allSettled`.
57
+ - **No-op updates** — State/store updates inside loops or event handlers that fire unconditionally. Add change-detection so downstream consumers aren't notified when nothing changed.
58
+ - **TOCTOU** — Pre-checking file/resource existence before operating on it. Operate directly and handle the error instead.
59
+ - **Overly broad operations** — Reading entire files when only a portion is needed, loading all items when filtering for one.
60
+
61
+ #### mcp-ts-core-specific
62
+
63
+ - **Error throwing patterns** — Prefer framework error factories (`McpError`, `validationError`, `notFound`, `httpErrorFromResponse`) over raw `throw new Error()`. Tool handlers should throw — the framework catches, classifies, and instruments.
64
+ - **Error codes** — `InvalidParams` only for malformed JSON-RPC params shape. `ValidationError` for domain validation. `NotFound` for missing entities. Don't conflate them.
65
+ - **Ctx usage** — Use `ctx.log`, `ctx.state`, `ctx.elicit`, `ctx.sample` — don't reach for global loggers, request-scoped storage, or sampling APIs directly. The `ctx` pattern carries tenant scope and OTel context.
66
+ - **Zod schemas** — Every tool input/output field needs `.describe()`. Zod 4 requires `z.record(z.string(), z.string())` not `z.record(z.string())`. Use `.optional()` rather than `.nullish()` unless null is semantically distinct from absent.
67
+ - **Tool annotations** — `readOnlyHint`, `idempotentHint`, `openWorldHint` should reflect reality. A read-only tool with `readOnlyHint: false` gives clients the wrong picture.
68
+ - **`exactOptionalPropertyTypes` boundaries** — If a downstream type insists on the field being present-or-not-present (not present-as-undefined), use a mapped widening type at the boundary. The pattern is documented in the framework.
69
+ - **`format()` ↔ `structuredContent` parity** — Different MCP clients forward different surfaces. Tests should assert both surfaces carry equivalent data.
70
+
71
+ ### Phase 4: Apply transformations
72
+
73
+ 1. **Filter findings ruthlessly.** If a finding is a false positive or not worth the churn, skip it. Don't argue with yourself about borderline cases — move on.
74
+ 2. **Transform incrementally** — one category of change at a time (modernize syntax, then reduce nesting, then consolidate).
75
+ 3. **Verify equivalence** — all functionality, types, and public interfaces must remain unchanged.
76
+ 4. **Keep the diff minimal.** Only touch lines that have a real reason to change. Don't reformat untouched code, add comments to code you didn't modify, or "improve" things that are already fine.
77
+
78
+ When done, briefly summarize what was fixed or confirm the code was already clean.
79
+
80
+ ## Common transformations
81
+
82
+ The tables below cover TypeScript and Python. For other languages, apply analogous principles: prefer modern idioms, reduce nesting, eliminate dead code, follow project conventions.
83
+
84
+ ### TypeScript (modern ESM, TS 5.x+)
85
+
86
+ | Before | After | Why |
87
+ | --- | --- | --- |
88
+ | `const x: Foo = { ... } as Foo` | `const x = { ... } satisfies Foo` | Type-checked without assertion |
89
+ | `let resource = acquire(); try { ... } finally { release(resource) }` | `using resource = acquire()` | Explicit resource disposal (TS 5.2+) |
90
+ | `if (x !== null && x !== undefined)` | `if (x != null)` | Idiomatic null/undefined check |
91
+ | `arr.filter(x => x !== null) as T[]` | `arr.filter((x): x is T => x != null)` | Type-safe filtering, no cast |
92
+ | `export { foo } from './foo/index.js'` | Direct imports at call sites | Avoid barrel re-exports inside the package; barrel exports are for public APIs only |
93
+ | `async function f() { const a = await x(); const b = await y(); }` | `const [a, b] = await Promise.all([x(), y()])` | Parallel when independent |
94
+ | `obj.x !== undefined ? obj.x : fallback` | `obj.x ?? fallback` | Nullish coalescing |
95
+ | `if (a) { if (b) { if (c) { ... } } }` | Guard clauses with early returns | Reduce nesting |
96
+ | `try { risky() } catch (e: any) { ... }` | `try { risky() } catch (e: unknown) { ... }` | Type-safe error handling |
97
+ | `enum Status { A, B, C }` | `const Status = { A: 'A', B: 'B', C: 'C' } as const` | Prefer const objects for numeric enums; string enums are acceptable |
98
+ | `function f(a: string, b: string, c: string, d?: string)` | `function f(opts: FnOptions)` | Options object when >3 params |
99
+ | `throw new Error('Bad input')` (in a tool handler) | `throw validationError('Bad input', { field: 'x' })` | Use framework error factories so the framework can classify and instrument |
100
+ | `const ATTR_KEY = 'mcp.tool.name'` | `import { ATTR_MCP_TOOL_NAME } from '@cyanheads/mcp-ts-core/utils'` | Use framework attribute constants |
101
+
102
+ ### Python (3.12+)
103
+
104
+ | Before | After | Why |
105
+ | --- | --- | --- |
106
+ | `Optional[str]` | `str \| None` | Modern union syntax (3.10+) |
107
+ | `List[str]`, `Dict[str, int]` | `list[str]`, `dict[str, int]` | Built-in generics (3.9+) |
108
+ | `if x == 0: ... elif x == 1: ... elif x == 2: ...` | `match x: case 0: ... case 1: ...` | Structural pattern matching (3.10+) |
109
+ | `class Config: def __init__(self, a, b, c): self.a = a ...` | `@dataclass class Config: a: str; b: int; c: float` | Less boilerplate, built-in eq/repr |
110
+ | `results = []; for item in items: results.append(transform(item))` | `results = [transform(item) for item in items]` | Idiomatic comprehension |
111
+ | `f = open('x'); try: ... finally: f.close()` | `with open('x') as f: ...` | Context manager for resources |
112
+ | `line = f.readline(); while line: process(line); line = f.readline()` | `while (line := f.readline()): process(line)` | Walrus operator where it reduces duplication |
113
+ | `"Hello " + name + "!"` | `f"Hello {name}!"` | f-string over concatenation |
114
+ | `except Exception as e: pass` | `except SpecificError as e: log(e)` | Catch specific, never bare except/pass |
115
+ | `from module import *` | `from module import specific_name` | Explicit imports only |
116
+ | `TypeAlias = Union[A, B, C]` | `type ABC = A \| B \| C` | `type` statement (3.12+) |
117
+ | Sequential `await` for independent I/O | `await asyncio.gather(a(), b())` | Parallel when independent |
118
+
119
+ ## When NOT to simplify
120
+
121
+ Leave code alone when:
122
+
123
+ - **It works and is readable.** "I would have written it differently" is not a reason to change it.
124
+ - **The change is cosmetic.** Renaming a variable from `data` to `result` isn't worth the churn.
125
+ - **Intentional verbosity for debugging.** Verbose code may exist to make stack traces or logging clearer.
126
+ - **Performance-critical paths.** A less readable version may exist for measured performance reasons — check before simplifying.
127
+ - **API compatibility.** Don't change public function signatures, export shapes, or return types that callers depend on. For mcp-ts-core projects, the public surface includes tool input/output schemas exposed via MCP — changing them is a breaking change to the server's MCP surface.
128
+ - **Tests.** Don't DRY up test code aggressively — test readability and isolation matter more than deduplication.
129
+ - **Type workarounds.** Sometimes an `as` cast or `# type: ignore` exists because of a genuine type system limitation — verify before removing.
130
+ - **The abstraction isn't proven.** Don't create a shared utility for two similar blocks of code. Wait until there are three, and even then only if the abstraction is genuinely simpler than the duplication.
@@ -4,7 +4,7 @@ description: >
4
4
  Land working-tree changes as a versioned release commit with an annotated tag — version bump, changelog, regenerate derived artifacts, verify, commit, tag. Stops at "committed and tagged locally" — no push, no publish. The release-and-publish skill picks up from here. Distilled from the git_wrapup_instructions protocol.
5
5
  metadata:
6
6
  author: cyanheads
7
- version: "1.0"
7
+ version: "1.1"
8
8
  audience: external
9
9
  type: workflow
10
10
  ---
@@ -35,8 +35,6 @@ Every item must be true before starting wrapup. Committing means releasing — a
35
35
 
36
36
  If any gate is red, fix it before proceeding. This skill re-verifies build + tests in step 6, but starting wrapup on a broken tree wastes the version number and creates a revert-or-amend situation.
37
37
 
38
- After all gates pass, spawn dedicated agents to handle the wrapup (this skill) and publish (`release-and-publish`). These are separate agents from the ones that did the editing work.
39
-
40
38
  ## Steps
41
39
 
42
40
  ### 1. Review the diff