用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/420company/artemis --skill typegen命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
基于 SOC 职业分类
| name | typegen |
| description | Run Sanity TypeGen and troubleshoot type generation issues. |
I'll help you generate TypeScript types from your Sanity schema.
npm run typegen
# or
npx sanity schema extract && npx sanity typegen generate
Check Configuration
typegen config in sanity.cli.ts (recommended)sanity-typegen.json, suggest migrating to sanity.cli.tstypegen script is in package.json (for manual workflows)Run TypeGen
Troubleshoot Issues
sanity-typegen.json to sanity.cli.ts| Issue | Solution |
|---|---|
| "No schema found" | Fix path glob in sanity.cli.ts typegen config |
| "Query not typed" | Wrap in defineQuery() or groq template |
| Types outdated | Re-run after schema/query changes, or enable automatic generation |
| Import errors | Check sanity.types.ts output path |
Using sanity-typegen.json | Migrate config to sanity.cli.ts (deprecated) |
Configure TypeGen in sanity.cli.ts:
// sanity.cli.ts
import { defineCliConfig } from 'sanity/cli'
export default defineCliConfig({
typegen: {
enabled: true, // Auto-generate during sanity dev/build
path: "./src/**/*.{ts,tsx,js,jsx,astro,svelte,vue}",
schema: "schema.json",
generates: "./sanity.types.ts",
overloadClientMethods: true,
},
})
"Run typegen" "Fix my TypeGen configuration" "Why are my types not updating?" "Enable automatic type generation"