一键导入
fix-prep
Fix route mismatches found by `bun run prep`. Run when the OpenAPI spec changes and SDK routes need updating.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Fix route mismatches found by `bun run prep`. Run when the OpenAPI spec changes and SDK routes need updating.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | fix-prep |
| description | Fix route mismatches found by `bun run prep`. Run when the OpenAPI spec changes and SDK routes need updating. |
| disable-model-invocation | false |
| allowed-tools | Bash, Read, Edit, Write, Grep, Glob, Task |
Run bun run prep (or bun run prep:staging if the user passed staging) and parse the output. Identify:
If prep passes with no errors, skip Steps 2–5 and proceed directly to Step 6 (description leak scan). Always run Step 6 regardless of whether prep passed or failed.
For each phantom route:
src/namespaces/holders.ts) to see the current implementationopenapi/polymarket.json) for the correct path, checking if:
src/generated/polymarket.ts for the operation ID and parameter schemaFor each unimplemented route:
/holders/* → holders.ts, /trader/* → trader.ts)src/types/index.ts:
OperationQuery<"operation_id"> and remove manual field definitions that are now covered by the generated typessrc/types/index.ts for any new schemas (e.g. export type NewType = Schemas["NewType"])src/types/index.ts, extending OperationQuery<"operation_id"> for query params and adding path params as explicit fields with address: string patternthis.get<ResponseType>(venue, path, { params: query })Run bun run prep again. It must pass with zero errors (exit code 0). If it fails, repeat from Step 2.
Even when prep passes, OpenAPI description and summary fields can leak internal implementation details. Public SDK consumers should see what an endpoint does, not how it is built.
Scan all files in openapi/ and report any description/summary text that reveals:
TODO, FIXME, HACK, XXX, "deprecated but…", or apologies/explanations aimed at internal readersDo not enumerate the specific forbidden terms in this file — .claude/ is committed to git and naming the project's stack here would itself be the leak. Generate the term list at scan time from your general knowledge of the categories above.
For each spec file, restrict matches to lines containing "description" or "summary" (avoids false positives in schema names) using ripgrep with a case-insensitive regex assembled from the categories above. Iterate over openapi/polymarket.json, openapi/webhooks.json, openapi/ws.json, openapi/ws-alerts.json.
For each match, report:
description/summary stringoperationId or schema key)Group findings by spec file. Do not silently rewrite the spec — these files are auto-fetched by bun run fetch-specs and will be overwritten on next run.
Spec descriptions originate in the backend repo (/Users/quantum/Documents/GitHub/struct-backend). Hand the report to the user and offer to:
bun run fetch-specs once the backend change is deployed to refresh the local specIf no leaks are found, say so explicitly.
src/types/index.tsSchemas["TypeName"] from src/types/helpers.tsasync methodName(params: ParamsType, venue?: Venue): Promise<HttpResponse<ResponseType>>const { pathParam, ...query } = params{ params: { ...params } }encodeURIComponent() for path params in template literals