add-hero-trait
hero-trait-mods.tsにヒーローの特性MODを実装する際に、特性の説明を読み解き、MODのファクトリーを作成し、スタックや設定を追加して、計算エンジンと連携させる一連の作業を支援するSkill。
📜 元の英語説明(参考)
Use when adding hero trait mod implementations in hero-trait-mods.ts - guides reading trait descriptions, creating mod factories, adding stackables/config, and wiring up the calculation engine (project)
🇯🇵 日本人クリエイター向け解説
hero-trait-mods.tsにヒーローの特性MODを実装する際に、特性の説明を読み解き、MODのファクトリーを作成し、スタックや設定を追加して、計算エンジンと連携させる一連の作業を支援するSkill。
※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。
下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o add-hero-trait.zip https://jpskill.com/download/9217.zip && unzip -o add-hero-trait.zip && rm add-hero-trait.zip
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/9217.zip -OutFile "$d\add-hero-trait.zip"; Expand-Archive "$d\add-hero-trait.zip" -DestinationPath $d -Force; ri "$d\add-hero-trait.zip"
完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。
💾 手動でダウンロードしたい(コマンドが難しい人向け)
- 1. 下の青いボタンを押して
add-hero-trait.zipをダウンロード - 2. ZIPファイルをダブルクリックで解凍 →
add-hero-traitフォルダができる - 3. そのフォルダを
C:\Users\あなたの名前\.claude\skills\(Win)または~/.claude/skills/(Mac)へ移動 - 4. Claude Code を再起動
⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。
🎯 このSkillでできること
下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。
📦 インストール方法 (3ステップ)
- 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
- 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
- 3. 展開してできたフォルダを、ホームフォルダの
.claude/skills/に置く- · macOS / Linux:
~/.claude/skills/ - · Windows:
%USERPROFILE%\.claude\skills\
- · macOS / Linux:
Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。
詳しい使い方ガイドを見る →- 最終更新
- 2026-05-18
- 取得日時
- 2026-05-18
- 同梱ファイル
- 1
📖 Skill本文(日本語訳)
※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。
Hero Trait Mod の追加
概要
Hero trait は、src/tli/hero/hero-trait-mods.ts 内の mod ファクトリーとして実装されています。各ファクトリーはレベルインデックス (0-4) を受け取り、Mod オブジェクトの配列を返します。src/data/hero-trait/hero-traits.ts 内の trait の説明は、生成する mod と値の信頼できる情報源です。
使用場面
- まだ
heroTraitModFactoriesに存在しない hero trait を実装する場合 - hero trait のメカニズムの計算サポートを追加する場合
ステップ 0: Trait の説明を読む
常にここから始めてください。 src/data/hero-trait/hero-traits.ts で trait を調べ、その affix フィールドを読んでください。これにより、以下が決まります。
- 作成する mod とそのタイプ
- レベルごとの値 (レベル 1-5 に対して
(v1/v2/v3/v4/v5)としてフォーマット) - プレイヤーのバフか敵のデバフか ("敵が受けるダメージ" =
isEnemyDebuff: true) - スタックするかどうかと、最大スタック数
- アクティベーションの条件
プロジェクトファイルの場所
| 目的 | ファイルパス |
|---|---|
| Trait の説明 (信頼できる情報源) | src/data/hero-trait/hero-traits.ts |
| Trait mod ファクトリー | src/tli/hero/hero-trait-mods.ts |
| Mod の型定義 | src/tli/mod.ts |
| スタック可能な型 | src/tli/mod.ts (Stackables) |
| 条件の型 | src/tli/mod.ts (Conditions) |
| 設定インターフェースとデフォルト | src/tli/core.ts |
| 設定スキーマ | src/lib/schemas/config.schema.ts |
| 設定 UI | src/components/configuration/ConfigurationTab.tsx |
| 計算エンジン | src/tli/calcs/offense.ts |
実装チェックリスト
1. Mod ファクトリーの追加 (src/tli/hero/hero-trait-mods.ts)
heroTraitModFactories にエントリを追加します。キーは、hero-traits.ts 内の trait の name フィールドと正確に一致する必要があります (型は HeroTraitName です)。
定数 mod (レベルスケーリングなし):
"Trait Name": () => [
{ type: "SomeFlag" },
{ type: "DmgPct", value: 20, dmgModType: "cold", addn: true, cond: "some_condition" },
],
レベルスケーリングされた mod:
"Trait Name": (i) => [
{ type: "FrostbiteEffPct", value: [65, 90, 110, 130, 150][i] },
],
スタック可能な mod (スタックごとのスケーリング):
"Trait Name": (i) => [
{
type: "DmgPct",
value: [8, 10, 12, 15, 18][i],
dmgModType: "cold",
addn: true,
isEnemyDebuff: true,
per: { stackable: "dance_of_frost", limit: 4 },
},
],
コメント形式を使用して、同じ hero の他の trait の近くにファクトリーを配置します。
// Frostfire Gemma: Frostbitten Heart (#2)
2. 新しい Mod タイプの追加 (必要な場合、src/tli/mod.ts)
Trait に ModDefinitions にない mod タイプが必要な場合は、それを追加します。
interface ModDefinitions {
// ... 既存のタイプ ...
NewModType: { value: number }; // またはフラグ mod の場合はオブジェクト
}
3. 新しいスタック可能の追加 (必要な場合、src/tli/mod.ts)
Trait にスタックごとのメカニズムがある場合は、スタック可能を Stackables に追加します。
export const Stackables = [
// ... 既存の値 ...
// hero-specific
"stalker",
"twisted_spacetime",
"dance_of_frost", // 他の hero 固有のスタック可能の近くに追加
// ...
] as const;
4. 新しい条件の追加 (必要な場合、src/tli/mod.ts)
Trait に条件付きのアクティベーションがある場合は、Conditions に追加します。
export const Conditions = [
// ... 既存の値 ...
"frostbitten_heart_is_active",
"new_condition_name", // ここに追加
] as const;
次に、src/tli/calcs/offense.ts の filterModsByCond でそれを結び付けます (.with() チェーン)。
5. 設定フィールドの追加 (必要な場合)
Trait がユーザー設定可能な値 (スタック数、トグルなど) を導入する場合は、/add-configuration スキルを使用するか、次の手順に従ってください。
a. Configuration インターフェースへの追加 (src/tli/core.ts):
// hero 固有の設定セクション
// デフォルトは 0
danceOfFrostStacks?: number;
b. デフォルトを DEFAULT_CONFIGURATION に追加 (src/tli/core.ts):
danceOfFrostStacks: undefined,
c. スキーマフィールドの追加 (src/lib/schemas/config.schema.ts):
danceOfFrostStacks: z.number().optional().catch(d.danceOfFrostStacks),
d. UI コントロールの追加 (src/components/configuration/ConfigurationTab.tsx):
<label className="text-right text-zinc-50">
Dance of Frost Stacks
<InfoTooltip text="Frostfire Gemma: Dance of Frost trait stacks" />
</label>
<NumberInput
value={config.danceOfFrostStacks}
onChange={(v) => onUpdate({ danceOfFrostStacks: v })}
min={0}
/>
他の hero 固有の設定フィールド ( frostbittenHeartIsActive の後) の近くに配置します。
6. 計算エンジンでの結び付け (src/tli/calcs/offense.ts)
スタック可能な場合: resolveModsForOffenseSkill で normalize() 呼び出しを追加します。
normalize("dance_of_frost", config.danceOfFrostStacks ?? 0);
他の hero 固有の正規化 ( pushErika1、pushYouga2 など) の近くに配置します。
条件の場合: filterModsByCond で .with() ケースを追加します。
.with("new_condition_name", () => config.newConditionField)
7. 検証
pnpm typecheck
pnpm test
pnpm check
一般的な Trait パターン
| パターン | Trait の例 | 実装 |
|---|---|---|
| 単純な定数バフ | Frostbitten Heart | () => [{ type: "DmgPct", ... }] |
| レベルスケーリングされた値 | Deepfreeze | (i) => [{ ..., value: [v1,v2,v3,v4,v5][i] }] |
| 設定によるスタックごと | Dance of Frost | per: { stackable: "x", limit: N } + config + normalize |
| 条件付きアクティベーション | Frostbitten Heart | cond: "condition_name" + config boolean |
| フラグ mod (メカニズムを有効にする) | Wind Stalker | { type: "WindStalker" } (オブジェクト mod) |
| 上限のオーバーライド | Deepfreeze | { type: "MaxFrostbiteRatingLimitOverride", value: X } |
よくある間違い
| 間違い | 修正 |
|---|---|
| 最初に trait の説明を読まない | 常に src/data/hero-trait/hero-traits.ts で affix フィールドを確認してください |
| 説明を読まずに値を推測する | 値は affix の (v1/v2/v3/v4/v5) 形式から取得されます |
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開
Adding Hero Trait Mods
Overview
Hero traits are implemented as mod factories in src/tli/hero/hero-trait-mods.ts. Each factory takes a level index (0-4) and returns an array of Mod objects. The trait's description in src/data/hero-trait/hero-traits.ts is the source of truth for what mods and values to produce.
When to Use
- Implementing a hero trait that isn't yet in
heroTraitModFactories - Adding calculation support for a hero trait's mechanics
Step 0: Read the Trait Description
Always start here. Look up the trait in src/data/hero-trait/hero-traits.ts and read its affix field. This determines:
- What mods to create and their types
- The per-level values (formatted as
(v1/v2/v3/v4/v5)for levels 1-5) - Whether it's a player buff or enemy debuff ("damage taken by the enemy" =
isEnemyDebuff: true) - Whether it stacks and the max stack count
- Any conditions for activation
Project File Locations
| Purpose | File Path |
|---|---|
| Trait descriptions (source of truth) | src/data/hero-trait/hero-traits.ts |
| Trait mod factories | src/tli/hero/hero-trait-mods.ts |
| Mod type definitions | src/tli/mod.ts |
| Stackable types | src/tli/mod.ts (Stackables) |
| Condition types | src/tli/mod.ts (Conditions) |
| Configuration interface & defaults | src/tli/core.ts |
| Configuration schema | src/lib/schemas/config.schema.ts |
| Configuration UI | src/components/configuration/ConfigurationTab.tsx |
| Calculation engine | src/tli/calcs/offense.ts |
Implementation Checklist
1. Add Mod Factory (src/tli/hero/hero-trait-mods.ts)
Add an entry to heroTraitModFactories. The key must match the trait's name field in hero-traits.ts exactly (it's typed as HeroTraitName).
Constant mods (no level scaling):
"Trait Name": () => [
{ type: "SomeFlag" },
{ type: "DmgPct", value: 20, dmgModType: "cold", addn: true, cond: "some_condition" },
],
Level-scaled mods:
"Trait Name": (i) => [
{ type: "FrostbiteEffPct", value: [65, 90, 110, 130, 150][i] },
],
Stackable mods (per-stack scaling):
"Trait Name": (i) => [
{
type: "DmgPct",
value: [8, 10, 12, 15, 18][i],
dmgModType: "cold",
addn: true,
isEnemyDebuff: true,
per: { stackable: "dance_of_frost", limit: 4 },
},
],
Place the factory near other traits for the same hero, using the comment format:
// Frostfire Gemma: Frostbitten Heart (#2)
2. Add New Mod Types (if needed, src/tli/mod.ts)
If the trait needs a mod type not in ModDefinitions, add it:
interface ModDefinitions {
// ... existing types ...
NewModType: { value: number }; // or object for flag mods
}
3. Add New Stackable (if needed, src/tli/mod.ts)
If the trait has a per-stack mechanic, add a stackable to Stackables:
export const Stackables = [
// ... existing values ...
// hero-specific
"stalker",
"twisted_spacetime",
"dance_of_frost", // Add near other hero-specific stackables
// ...
] as const;
4. Add New Condition (if needed, src/tli/mod.ts)
If the trait has a conditional activation, add to Conditions:
export const Conditions = [
// ... existing values ...
"frostbitten_heart_is_active",
"new_condition_name", // Add here
] as const;
Then wire it up in filterModsByCond in src/tli/calcs/offense.ts (the .with() chain).
5. Add Configuration Field (if needed)
If the trait introduces a user-configurable value (stack count, toggle, etc.), use the /add-configuration skill or follow these steps:
a. Add to Configuration interface (src/tli/core.ts):
// hero-specific config section
// default to 0
danceOfFrostStacks?: number;
b. Add default to DEFAULT_CONFIGURATION (src/tli/core.ts):
danceOfFrostStacks: undefined,
c. Add schema field (src/lib/schemas/config.schema.ts):
danceOfFrostStacks: z.number().optional().catch(d.danceOfFrostStacks),
d. Add UI control (src/components/configuration/ConfigurationTab.tsx):
<label className="text-right text-zinc-50">
Dance of Frost Stacks
<InfoTooltip text="Frostfire Gemma: Dance of Frost trait stacks" />
</label>
<NumberInput
value={config.danceOfFrostStacks}
onChange={(v) => onUpdate({ danceOfFrostStacks: v })}
min={0}
/>
Place near other hero-specific config fields (after frostbittenHeartIsActive).
6. Wire Up in Calculation Engine (src/tli/calcs/offense.ts)
For stackables: Add a normalize() call in resolveModsForOffenseSkill:
normalize("dance_of_frost", config.danceOfFrostStacks ?? 0);
Place near other hero-specific normalizations (near pushErika1, pushYouga2, etc.).
For conditions: Add a .with() case in filterModsByCond:
.with("new_condition_name", () => config.newConditionField)
7. Verify
pnpm typecheck
pnpm test
pnpm check
Common Trait Patterns
| Pattern | Example Trait | Implementation |
|---|---|---|
| Simple constant buff | Frostbitten Heart | () => [{ type: "DmgPct", ... }] |
| Level-scaled value | Deepfreeze | (i) => [{ ..., value: [v1,v2,v3,v4,v5][i] }] |
| Per-stack with config | Dance of Frost | per: { stackable: "x", limit: N } + config + normalize |
| Conditional activation | Frostbitten Heart | cond: "condition_name" + config boolean |
| Flag mod (enables mechanic) | Wind Stalker | { type: "WindStalker" } (object mod) |
| Override limit | Deepfreeze | { type: "MaxFrostbiteRatingLimitOverride", value: X } |
Common Mistakes
| Mistake | Fix |
|---|---|
| Not reading the trait description first | Always check src/data/hero-trait/hero-traits.ts for the affix field |
| Guessing values instead of reading description | Values come from the (v1/v2/v3/v4/v5) format in the affix |
Missing isEnemyDebuff: true |
"damage taken by the enemy" = enemy debuff, not player buff |
Forgetting limit on per-stackable |
"stacks up to N times" needs limit: N |
Not adding normalize() for new stackables |
Per-stackable mods won't resolve without normalize() in offense.ts |
| Placing config UI in wrong section | Hero-specific config goes near other hero fields |
| Trait name doesn't match data | Key must exactly match name in hero-traits.ts (typed as HeroTraitName) |