migrate-waniwani-sdk-0.22-to-0.23
Skill18 starsChanged 8 days agoMITView on GitHub
Migrate a project from @waniwani/sdk 0.22.x to 0.23.x and auto-apply its breaking change: withWaniwani's captureTelemetry option and the CaptureTelemetryOptions type are removed in favour of captureIntent / CaptureIntentOptions, and every wrapped tool advertises one optional `intent` string instead of the nested `telemetry` object, so tools/list snapshots and tests that pass `telemetry` in tool arguments change. Trigger when the user is on @waniwani/sdk 0.22.x and wants to move to 0.23, asks to migrate to 0.23, or hits a type error on `captureTelemetry` / `CaptureTelemetryOptions` after bumping @waniwani/sdk.
In this repository28 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- agent-browserSkill
- copySkill
- deploy-prodSkill
- linear-oneshotSkill
- project-planningSkill
- project-updateSkill
- pull-requestSkill
- wani-code-reviewSkill
- create-flow-appSkill
- frontend-designSkill
- knowledge-baseSkill
- release-migrationSkill
- transfer-to-kitSkill
- translationsSkill
- visualize-flowSkill
- audit-trackingSkill
- instrument-trackingSkill
- migrate-waniwani-sdk-0.15-to-0.16Skill
- migrate-waniwani-sdk-0.16-to-0.17Skill
- migrate-waniwani-sdk-0.17-to-0.18Skill
- migrate-waniwani-sdk-0.18-to-0.19Skill
- migrate-waniwani-sdk-0.19-to-0.20Skill
- migrate-waniwani-sdk-0.23-to-0.24Skill
- migrate-waniwani-sdk-0.24-to-0.25Skill
- migrate-waniwani-sdk-0.25-to-1.0Skill
- waniwani-sdkSkill
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 86
Only tests that inspect a wrapped tool's advertised schema or pass the injected argument themselves need this.
≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Migrate @waniwani/sdk 0.22 → 0.23
A self-contained migration for the single hop from 0.22.x to 0.23.x. It covers only that jump; for other version boundaries use the matching migrate-waniwani-sdk-<from>-to-<to> skill, or the general procedure in the SDK's changelog.
Precondition: the project is on @waniwani/sdk@0.22.x. If it is on an older version, migrate up to 0.22 first; if it is already on 0.23+, there is nothing to do here.
What 0.23 changes
withWaniwani adds one argument to every tool it wraps so the calling model can say why the user came. In 0.22 that argument was a nested telemetry object ({ intent, context }) the model was asked to fill after every user message. In 0.23 it is one optional string, sent only on the model's first call to the app:
"intent": {
"type": "string",
"description": "Brief summary of what the user wants and what prompted it, in their words. Send only on your first call to this app."
}The shape follows OpenAI's plugin guidelines, which allow "a brief, task-specific user intent field" and rule out broad contextual fields and accumulated conversation context.
Breaking, and visible to tsc:
| 0.22 | 0.23 |
withWaniwani(server, { captureTelemetry }) | withWaniwani(server, { captureIntent }) |
import type { CaptureTelemetryOptions } from "@waniwani/sdk/mcp" | import type { CaptureIntentOptions } from "@waniwani/sdk/mcp" |
There is no deprecated alias. In plain JavaScript a leftover captureTelemetry is ignored and capture stays on, so search for it even when nothing fails to compile.
Behavior changes, not visible to tsc:
tools/list. Each wrapped tool lists anintentstring instead of atelemetryobject. Snapshot tests of tool schemas change.- Tool call arguments. A test that calls a wrapped tool with
telemetry: { intent }should passintent: "..."instead. A leftovertelemetrykey is stripped by schema validation, except on a tool whose schema is.strict(), which rejects the call. - Tools with their own
intentargument are left alone in 0.23 and record nothing. In 0.22 they got atelemetryargument beside it. - Tools with their own
telemetryargument gain theintentstring in 0.23. Their owntelemetrystill reaches the handler unchanged.
Untouched: the tool.called event still records the captured value under properties.telemetry ({ intent } for plain tools, { intent, context } copied from a flow's own arguments); flow tools keep their intent / context arguments and their schema; { tools, omitPII } mean the same thing under captureIntent; handlers never see the injected argument.
Procedure
- Bump the dependency.
bun add @waniwani/sdk@^0.23.0 - Collect the call sites.
bun run typecheck rg "captureTelemetry|CaptureTelemetryOptions" -l rg "telemetry:\s*\{" -l - Apply rewrites 1 and 2 below.
- Verify, which is the completion check.
bun run typecheck && bun test - Report which files each rewrite touched, and whether the app is listed in a reviewed directory (see "Ship it").
Rewrite 1: captureTelemetry becomes captureIntent
A rename of the option and its type. The value keeps its shape: true, false, or { tools?, omitPII? }.
// Before
import { withWaniwani, type CaptureTelemetryOptions } from "@waniwani/sdk/mcp";
const capture: CaptureTelemetryOptions = { omitPII: true };
await withWaniwani(server, { captureTelemetry: capture });
// After
import { withWaniwani, type CaptureIntentOptions } from "@waniwani/sdk/mcp";
const capture: CaptureIntentOptions = { omitPII: true };
await withWaniwani(server, { captureIntent: capture });Apps built with @waniwani/kit set this under tracking in waniwani.config.ts. Rename it there the same way once the app is on a kit release whose TrackingOptions names captureIntent.
Rewrite 2: tests that see the injected argument
Only tests that inspect a wrapped tool's advertised schema or pass the injected argument themselves need this.
// Before
expect(Object.keys(listed.inputSchema.properties)).toEqual(["plan", "telemetry"]);
await client.callTool({
name: "get_quote",
arguments: { plan: "premium", telemetry: { intent: "Compare home insurance" } },
});
// After
expect(Object.keys(listed.inputSchema.properties)).toEqual(["intent", "plan"]);
await client.callTool({
name: "get_quote",
arguments: { plan: "premium", intent: "Compare home insurance" },
});Assertions on the recorded event keep working: the value is still at properties.telemetry.intent. A properties.telemetry.context from a plain tool no longer appears; only flows send context.
Ship it
The argument is optional, so a published app keeps working without resubmission. A directory that reviews apps (the ChatGPT app directory) shows the tool metadata from your last submission until you submit a new version, so resubmit to move reviewers onto the 0.23 shape. The argument collects free text about the user's goal: mention it in the app's privacy policy, or pass captureIntent: false.
Common mistakes
- Keeping
captureTelemetryin JavaScript. Nothing fails; the option is ignored and capture runs with defaults. Rename it. - Adding
contextback to a plain tool. There is no separate context argument. What prompted the request is part of the oneintentsentence. - Reading
input.intentas the user's intent on a plain tool. The injected value is stripped frominputand recorded underproperties.telemetry.intent. A plain tool'sinput.intentis its own argument. - Skipping the verify step. A clean
bun run typecheckplus greenbun testis the definition of done.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

