Skip to main content

api-change

Run the full API change workflow after modifying types in smelter-api. Generates schemas, TypeScript types, and verifies everything is in sync.

来源信息

仓库
software-mansion/smelter
最近来源活动
2026年6月30日 11:05
检测到的 SKILL.md 语言
英语
星标
732
分支
46

安装方式

默认使用会先检查来源的 Prompt;你也可以切换为直接命令,或下载本地副本。

检查来源文件

决定是否安装前,请先阅读 SKILL.md,以及 SkillsMP 当前展示的配套文件。

正在显示 SKILL.md

SKILL.md
来源说明 · 只读预览
name
api-change
description
Run the full API change workflow after modifying types in smelter-api. Generates schemas, TypeScript types, and verifies everything is in sync.
disable-model-invocation
false
allowed-tools
Bash, Read, Grep, Glob
Run the API change workflow. All steps must pass before the change is considered complete. ## Steps 1. **Register new routes in OpenAPI spec** If a new route was added, ensure it is listed in the `#[openapi(paths(...))]` macro in `tools/src/bin/generate_from_types.rs`. Each route handler function must be referenced there for it to appear in the generated OpenAPI specification. 2. **Generate JSON schemas from Rust types** Run: `cargo run -p tools --bin generate_from_types` This generates `tools/schemas/scene.schema.json` and `tools/schemas/api_types.schema.json`. 3. **Generate TypeScript types from schemas** Run in `./ts`: `pnpm run generate-types` This generates `ts/smelter/src/api.generated.ts`. 4. **Build the TypeScript SDK to verify compatibility** Run in `./ts`: `pnpm i && pnpm build:all` 5. **Show a summary of all generated/changed files** so the user can review what was affected. 6. **Try to update SDK**: Update TypeScript SDK code if the generated types require manual adaptation. In most cases you will need to: - add/modify type in `ts/smelter` package e.g. `ts/smelter/src/types/input.ts` - add/modify mapping in `ts/smelter-core` package e.g. `ts/smelter-core/src/api/input.ts`. In most cases it will be just switching snake case to camel case, but consider if there are more idiomatic alternatives. - add/modify type in `ts/smelter-node/src/api.ts`. - add/modify type in `ts/smelter-web-client/src/api.ts`. Inform user if it's not obvious how the changes should be adapted.
在 GitHub 查看