Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

add-mod-resolver

БесплатноБез исполняемых скриптовНе проверен

Use when adding new push* resolver functions inside resolveModsForOffenseSkill to handle mod-based combat mechanics like tangles, debuffs, or conditional…

acliniaот aclinia★ 46 звёзд на GitHub

Об этом скилле

Adding Mod Resolvers

Overview

Mod resolvers are push* functions defined inside resolveModsForOffenseSkill in src/tli/calcs/offense.ts. They read from the mods array (and optionally config, prenormMods, resourcePool, defenses) and push new derived mods based on game mechanics. Each resolver handles one mechanic (e.g., frostbite, numbed, tangles, infiltrations).

When to Use

  • Adding a new combat mechanic that derives mods from existing mods or configuration
  • Adding conditional damage bonuses based on presence of a flag mod (e.g., IsTangle, WindStalker)
  • Adding enemy debuff calculations (e.g., numbed stacks, frostbite, frail)
  • Adding buff/aura effect calculations with effect multipliers

Project File Locations

Purpose File Path
Resolver function location src/tli/calcs/offense.ts (inside resolveModsForOffenseSkill)
Mod type definitions src/tli/mod.ts (ModDefinitions interface)
Configuration interface & defaults src/tli/core.ts (Configuration, DEFAULT_CONFIGURATION)
Mod helper utilities src/tli/calcs/mod-utils.ts
Tests src/tli/calcs/offense.test.ts

Architecture

applyModFilters preprocesses all mods into four groups:

  • mods — non-per mods without condThreshold or resolvedCond (ready to use immediately)
  • prenormMods — all mods without resolvedCond (source for per-stackable normalization)
  • condThresholdMods — non-per mods with condThreshold (pushed back by normalize() when threshold is met)
  • resolvedCondMods — mods with resolvedCond (pushed back by individual push* resolvers when condition is met)

IMPORTANT: Mods with a per field are filtered into prenormMods only — they do NOT appear in mods. The per field (from ModBase) triggers automatic per-stackable normalization via normalize(). If a mod needs custom resolver logic (e.g., applying an effect multiplier before scaling by stacks), do NOT use per on the mod type. Instead, store the scaling info in a custom field (e.g., perFervorAmt: number) so the mod stays in mods and the resolver can find it via filterMods().

resolveModsForOffenseSkill then runs a sequence of push* resolver functions that push new derived mods into mods via pm(). Each push* function is a closure that captures:

  • mods: Mod[] — the shared mutable array of resolved mods
  • prenormMods — mods needing per-stackable normalization
  • condThresholdMods — mods held back until their stackable threshold is evaluated by normalize()
  • resolvedCondMods — mods held back until their resolved condition is evaluated by a push* resolver
  • config: Configuration — user-configured combat parameters
  • resourcePool — stats, mana, blessings, etc.
  • defenses — armor, evasion, resistances, etc.
  • loadout: Loadout — full parsed loadout
  • Helper functions: pm() (push mods), normalize() (normalize stackables), step() (dependency tracking)

The execution sequence begins with normalizeFromConfig(), which normalizes all stackables whose values come purely from config fields (e.g., level, num_enemies_nearby, enemy_numbed_stacks). This runs before pushStatNorms() and all other resolvers. Normalize calls whose values depend on mods, stats, defenses, or resourcePool remain in their respective push* functions or inline in the execution sequence.

Available Helpers

From closure (defined in resolveModsForOffenseSkill):

  • pm(...ms: Mod[]) — shorthand for mods.push(...ms)
  • normalize(stackable, value) — normalizes per-stackable mods from prenormMods and pushes satisfied condThresholdMods for that stackable
  • normalizeFromConfig() — calls normalize() for all stackables whose values come purely from config fields; called once at the start of the execution sequence before pushStatNorms()
  • step(stepName) — registers a step for dependency tracking (only needed if other steps depend on this one)
  • resolvedCondMods: Mod[] — mods with resolvedCond, separated out by applyModFilters; push matching ones into mods via pm() when the condition is met
  • condThresholdMods: Mod[] — non-per mods with condThreshold, separated out by applyModFilters; pushed back automatically by normalize() when their stackable threshold is met

From src/tli/calcs/mod-utils.ts:

  • modExists(mods, "ModType") — returns boolean, checks if any mod of that type exists
  • findMod(mods, "ModType") — returns first mod of type or undefined
  • filterMods(mods, "ModType") — returns all mods of type as ModT<T>[]
  • sumByValue(mods) — sums .value of all mods in array
  • calcEffMult(mods, "ModType") — calculates (1 + sum_of_inc) * product_of_addn multiplier
  • multModValue(mod, multiplier) — returns new mod with .value multiplied

Implementation Checklist

1. Ensure the Trigger Mod Type Exists

Check src/tli/mod.ts under ModDefinitions. If the flag mod (e.g., IsTangle) doesn't exist, add it

Полный SKILL.md на GitHub

Установить add-mod-resolver в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл add-mod-resolver?

Use when adding new push* resolver functions inside resolveModsForOffenseSkill to handle mod-based combat mechanics like tangles, debuffs, or conditional damage bonuses (project)

Как установить скилл add-mod-resolver?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл add-mod-resolver запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить add-mod-resolver с