add-configuration
БесплатноБез исполняемых скриптовНе проверенUse when adding new configuration fields to the Configuration interface for combat conditions, buff stacks, or other build parameters used in damage…
от aclinia★ 46 звёзд на GitHubОб этом скилле
Adding Configuration Fields
Overview
Configuration fields control combat conditions, buff stacks, and other build parameters that affect damage calculations. They are persisted in SaveData and editable via the Configuration tab UI.
When to Use
- Adding a new toggle (boolean) or numeric parameter for damage calculations
- Adding conditional combat states (e.g., "has X recently", "enemy has Y")
- Adding stack counts for buffs/debuffs
- Adding enemy stat overrides
Project File Locations
| Purpose | File Path |
|---|---|
| Configuration interface & defaults | src/tli/core.ts |
| Zod validation schema | src/lib/schemas/config.schema.ts |
| Configuration tab UI | src/components/configuration/ConfigurationTab.tsx |
| Calculation usage | src/tli/calcs/offense.ts (and other calcs files) |
Implementation Checklist
1. Add Field to Configuration Interface (src/tli/core.ts)
Add the field to the Configuration interface with a default comment:
Boolean field (default false):
// default to false
newFieldEnabled: boolean;
Required number field (has a sensible non-undefined default):
// default to 1
numThings: number;
Optional number field (undefined means "use calculated default/max"):
// default to max
someStacks?: number;
2. Add Default Value to DEFAULT_CONFIGURATION (src/tli/core.ts)
Add the matching default in DEFAULT_CONFIGURATION:
// Boolean → false, Required number → the default, Optional number → undefined
newFieldEnabled: false,
numThings: 1,
someStacks: undefined,
3. Add Schema Validation (src/lib/schemas/config.schema.ts)
Add to ConfigurationPageSchema using the d alias for defaults. The pattern depends on the field type:
Boolean:
newFieldEnabled: z.boolean().catch(d.newFieldEnabled),
Required number:
numThings: z.number().catch(d.numThings),
Optional number:
someStacks: z.number().optional().catch(d.someStacks),
The satisfies z.ZodType<Configuration> at the end of the schema ensures the schema stays in sync with the interface — a type error will occur if you miss a field or get the type wrong.
4. Add UI Controls (src/components/configuration/ConfigurationTab.tsx)
The configuration tab uses a 2-column grid: grid-cols-[auto_auto] with label on the left, control on the right.
NumberInput field (required number):
<label className="text-right text-zinc-50">
Field Label
<InfoTooltip text="Description of what this does. Defaults to X." />
</label>
<NumberInput
value={config.numThings}
onChange={(v) => onUpdate({ numThings: v ?? 1 })}
min={1}
/>
NumberInput field (optional number, undefined = max/default):
<label className="text-right text-zinc-50">
Stack Count
<InfoTooltip text="Defaults to max" />
</label>
<NumberInput
value={config.someStacks}
onChange={(v) => onUpdate({ someStacks: v })}
min={0}
/>
Checkbox field (boolean):
<label className="text-right text-zinc-50">Field Label</label>
<input
type="checkbox"
checked={config.newFieldEnabled}
onChange={(e) => onUpdate({ newFieldEnabled: e.target.checked })}
className="h-4 w-4 rounded border-zinc-600 bg-zinc-800 accent-amber-500"
/>
Checkbox with conditional child NumberInput (boolean toggle + optional stacks):
<label className="text-right text-zinc-50">Has Effect</label>
<input
type="checkbox"
checked={config.hasEffect}
onChange={(e) => onUpdate({ hasEffect: e.target.checked })}
className="h-4 w-4 rounded border-zinc-600 bg-zinc-800 accent-amber-500"
/>
{config.hasEffect && (
<>
<label className="text-right text-zinc-50">
Effect Stacks
<InfoTooltip text="Defaults to max" />
</label>
<NumberInput
value={config.effectStacks}
onChange={(v) => onUpdate({ effectStacks: v })}
min={0}
/>
</>
)}
Conditionally rendered field (only show when loadout has something):
{hasPactspirit("Some Pactspirit", loadout) && (
<>
<label className="text-right text-zinc-50">
Some Stacks
<InfoTooltip text="Defaults to max" />
</label>
<NumberInput
value={config.someStacks}
onChange={(v) => onUpdate({ someStacks: v })}
min={0}
max={6}
/>
</>
)}
5. Use in Calculations (if applicable)
Access the field via the config parameter in calculation functions:
// In src/tli/calcs/offense.ts or related files
const numActiveTangles = config.numActiveTangles;
6. Verify
pnpm typecheck
pnpm check
pnpm test
Field Type Decision Guide
| Scenario | Interface Type | Default | Schema |
|---|---|---|---|
| On/off toggle | boolean |
false |
z.boolean().catch(d.x) |
| Count with known default | number |
the value | z.number().catch(d.x) |
| Count where undefined = "use max |
Установить add-configuration в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл add-configuration?
Use when adding new configuration fields to the Configuration interface for combat conditions, buff stacks, or other build parameters used in damage calculations (project)
Как установить скилл add-configuration?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл add-configuration запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic