adding-support-mod-parsers
БесплатноБез исполняемых скриптовНе проверенUse when adding support mod parsers to convert support skill affix strings to typed SupportMod objects - guides the template-based parsing pattern (project)
от aclinia★ 46 звёзд на GitHubОб этом скилле
Adding Support Mod Parsers
Overview
Support mod parsers convert raw support skill affix strings (e.g., "+15% additional damage for the supported skill") into typed SupportMod objects at runtime. Unlike active/passive skills which use level-scaling factories, support skills parse their affixes directly using templates.
When to Use
- Adding support for new support skill affix patterns
- Extending support mod parsing to handle new variants
Project File Locations
| Purpose | File Path |
|---|---|
| Support mod templates | src/tli/skills/support-mod-templates.ts |
| Mod type definitions | src/tli/mod.ts |
| SupportMod type | src/tli/core.ts |
| Template/spec helpers | src/tli/mod-parser/ |
| Calculation handlers | src/tli/calcs/offense.ts |
Implementation Checklist
1. Check if Mod Type Exists
Look in src/tli/mod.ts under ModDefinitions. If the mod type doesn't exist, add it first (see adding-mod-parsers skill).
2. Add Template in support-mod-templates.ts
Templates use the same DSL as the main mod parser:
// In allSupportParsers array
t("{value:dec%} additional damage for the supported skill").output(
(c) => ({
type: "DmgPct",
value: c.value,
dmgModType: "global",
addn: true,
}),
),
Template capture types:
| Type | Matches | Example Input → Output |
|---|---|---|
{name:int} |
Unsigned integer | "5" → 5 |
{name:dec} |
Unsigned decimal | "21.5" → 21.5 |
{name:int%} |
Unsigned integer percent | "30%" → 30 |
{name:dec%} |
Unsigned decimal percent | "96%" → 96 |
{name:+int} |
Signed integer (requires + or -) |
"+5" → 5, "-3" → -3 |
{name:+dec} |
Signed decimal (requires + or -) |
"+21.5" → 21.5 |
{name:+int%} |
Signed integer percent | "+30%" → 30, "-15%" → -15 |
{name:+dec%} |
Signed decimal percent | "+96%" → 96 |
Signed vs Unsigned Types:
- Use unsigned (
dec%,int) when input does NOT start with+or-(e.g.,"0.8% additional damage") - Use signed (
+dec%,+int) when input STARTS with+or-(e.g.,"+19.8% additional damage") - Signed types will NOT match unsigned inputs, and vice versa
- IMPORTANT: Some support skills have signed inputs, others have unsigned - you may need BOTH templates (see examples below)
Optional syntax:
[additional]- Optional literal, setsc.additional?: true(effect|damage)- Alternation (regex-style)\\(and\\)- Escaped parentheses for literal matching
3. SupportMod Structure
Each parsed mod is wrapped in SupportMod:
interface SupportMod {
mod: Mod;
}
The parseSupportAffix function handles this wrapping:
return mods.map((mod) => ({ mod }));
4. No-Op Parsers (Informational Text)
Use outputNone() when a mod string should be recognized (not flagged as unparsed) but has no effect on calculations:
t("always attempts to trigger the supported skill. interval: {_:dec}s").outputNone(),
t("automatically use the supported attack skill to continuously attack the nearest enemy within {_:int}m while standing still").outputNone(),
IMPORTANT: Use outputNone(), NOT outputMany([]). Both work but outputNone() is the correct API for this purpose.
5. Multi-Output Parsers
For affixes that produce multiple mods:
t("{value:dec%} additional attack and cast speed for the supported skill")
.outputMany([
spec((c) => ({ type: "AspdPct", value: c.value, addn: true })),
spec((c) => ({ type: "CspdPct", value: c.value, addn: true })),
]),
6. Add a Test
Add a test case to src/tli/skills/support-mod-templates.test.ts using the example input string given to you:
test("parse <skill name> <description of what it parses>", () => {
const result = parseSupportAffixes([
"<exact input string from the skill data>",
]);
expect(result).toEqual([
[
{
mod: {
type: "<ModType>",
// ... expected mod properties
},
},
],
]);
});
7. Verify
Run tests to ensure parsing works:
pnpm test
pnpm typecheck
pnpm check
Examples
Damage Mod with BOTH Signed and Unsigned Variants
Some support skills use +{value}% templates (e.g., Increased Area) while others use {value}% (e.g., Haunt). You need BOTH templates:
Inputs:
"+19.8% additional damage for the supported skill"(Increased Area - signed)"0.8% additional damage for the supported skill"(Haunt - unsigned)
// Signed version (e.g., "+19.8% additional damage...")
t("{value:+dec%} additional damage for the supported skill").output(
(c) => ({ type: "DmgPct", value: c.value, dmgModType: "global", addn: true }),
),
// Unsigned version (e.g., "0.8% additional damage...")
t("{value:dec%} additional damage for the supported skill").output(
Установить adding-support-mod-parsers в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл adding-support-mod-parsers?
Use when adding support mod parsers to convert support skill affix strings to typed SupportMod objects - guides the template-based parsing pattern (project)
Как установить скилл adding-support-mod-parsers?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл adding-support-mod-parsers запускает скрипты?
Нет, скилл состоит только из инструкций (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