Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Guides adding a new setting item to Project Graph, covering the Zod schema in Settings.tsx and the icon in SettingsIcons.tsx.
Use this skill ↓32% 96%+64 ptsof test cases passed
Passed 24 of 25 test cases with the skill, and 8 of 25 without it.
3 of 3 safety checks passed
6 agent runs
1 forkA fork is a copy of this skill that someone made so they could edit it for their own use. The original doesn't change.
本技能指导如何在 Project Graph 项目中创建新的设置项。
创建新设置项需要完成以下 5 个步骤:
在 app/src/core/service/Settings.tsx 文件的 settingsSchema 对象中添加新的设置项定义。
支持的 Zod 类型:
z.boolean().default(false) - 布尔值开关z.number().min(x).max(y).default(z) - 数字(可添加 .int() 限制为整数)z.string().default("") - 字符串z.union([z.literal("option1"), z.literal("option2")]).default("option1") - 枚举选择z.tuple([z.number(), z.number(), z.number(), z.number()]).default([0,0,0,0]) - 元组(如颜色 RGBA)示例:
// 布尔值设置
enableNewFeature: z.boolean().default(false),
// 数字范围设置(带滑块)
newSliderValue: z.number().min(0).max(100).int().default(50),
// 枚举选择设置
newMode: z.union([z.literal("mode1"), z.literal("mode2")]).default("mode1"),
在 app/src/core/service/SettingsIcons.tsx 文件的 settingsIcons 对象中添加对应的图标。
步骤:
lucide-react 导入合适的图标组件Next to this one in the catalogue, plus more from the same author.