adding-mod-parsers — adding-mod-parsers install adding-mod-parsers, torchlight-of-building, community, adding-mod-parsers install, ide skills, template-based mod string parsing, mod string conversion for calculation engines, Claude Code, Cursor, Windsurf

v1.0.0
GitHub

About this Skill

Essential for Calculation Engine Agents processing game mod strings and stat systems. Adding-mod-parsers is a template-based system for converting raw mod strings into typed Mod objects used by calculation engines.

Features

Uses a template-based system for pattern matching
Supports adding new mod string patterns
Extends existing mod types to handle new variants
Adds new mod types to the calculation engine
Utilizes Mod type definitions from src/tli/mod.ts
Enables parser template customization

# Core Topics

aclinia aclinia
[0]
[0]
Updated: 3/8/2026

Agent Capability Analysis

The adding-mod-parsers skill by aclinia is an open-source community AI agent skill for Claude Code and other IDE workflows, helping agents execute tasks with better context, repeatability, and domain-specific guidance. Optimized for adding-mod-parsers install, template-based mod string parsing, mod string conversion for calculation engines.

Ideal Agent Persona

Essential for Calculation Engine Agents processing game mod strings and stat systems.

Core Value

Enables robust parsing of raw mod strings into typed Mod objects using a template-based pattern matching system. Provides structured data conversion for calculation engines handling complex stat modifications and variant patterns.

Capabilities Granted for adding-mod-parsers

Converting raw mod strings to typed objects
Extending existing mod types with new variants
Adding support for new mod string patterns
Integrating mod parsing into calculation pipelines

! Prerequisites & Limits

  • Requires mod type definitions in src/tli/mod.ts
  • Template-based system may need pattern updates for new formats
  • Dependent on calculation engine integration
Labs Demo

Browser Sandbox Environment

⚡️ Ready to unleash?

Experience this Agent in a zero-setup browser environment powered by WebContainers. No installation required.

Boot Container Sandbox

adding-mod-parsers

Install adding-mod-parsers, an AI agent skill for AI agent workflows and automation. Works with Claude Code, Cursor, and Windsurf with one-command setup.

SKILL.md
Readonly

Adding Mod Parsers

Overview

The mod parser converts raw mod strings (e.g., "+10% all stats") into typed Mod objects used by the calculation engine. It uses a template-based system for pattern matching.

When to Use

  • Adding support for new mod string patterns
  • Extending existing mod types to handle new variants
  • Adding new mod types to the engine

Project File Locations

PurposeFile Path
Mod type definitionssrc/tli/mod.ts
Parser templatessrc/tli/mod-parser/templates.ts
Enum registrationssrc/tli/mod-parser/enums.ts
Calculation handlerssrc/tli/calcs/offense.ts
Testssrc/tli/mod-parser.test.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:

typescript
1interface ModDefinitions { 2 // ... existing types ... 3 NewModType: { value: number; someField: string }; 4}

2. Add Template in templates.ts

Templates use a DSL for pattern matching. Do not add comments to templates.ts - the template string itself is self-documenting.

typescript
1t("{value:dec%} all stats").output((c) => ({ 2 type: "StatPct", 3 value: c.value, 4 statModType: "all", 5})), 6t("{value:dec%} {statModType:StatWord}") 7 .enum("StatWord", StatWordMapping) 8 .output((c) => ({ type: "StatPct", value: c.value, statModType: c.statModType })), 9t("{value:dec%} [additional] [{modType:DmgModType}] damage").output((c) => ({ 10 type: "DmgPct", 11 value: c.value, 12 dmgModType: c.modType ?? "global", 13 addn: c.additional !== undefined, 14})), 15t("{value:dec%} attack and cast speed").outputMany([ 16 spec((c) => ({ type: "AspdPct", value: c.value, addn: false })), 17 spec((c) => ({ type: "CspdPct", value: c.value, addn: false })), 18]),

Template capture types:

TypeMatchesExample 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
{name:?int}Optional-sign integer (matches with or without +/-)"5"5, "+5"5, "-3"-3
{name:?dec}Optional-sign decimal"21.5"21.5, "+21.5"21.5
{name:?int%}Optional-sign integer percent"30%"30, "+30%"30
{name:?dec%}Optional-sign decimal percent"96%"96, "+96%"96
{name:EnumType}Enum lookup{dmgType:DmgChunkType}

Signed vs Unsigned vs Optional-sign Types:

  • Use unsigned (dec%, int) when input NEVER has + or - (e.g., "8% additional damage applied to Life")
  • Use signed (+dec%, +int) when input ALWAYS has + or - (e.g., "+25% additional damage")
  • Use optional-sign (?dec%, ?int) when input MAY OR MAY NOT have a sign — this avoids needing two separate templates for signed/unsigned variants
  • Signed types will NOT match unsigned inputs, and unsigned will NOT match signed inputs
  • Prefer ?dec% over two separate dec%/+dec% templates when the same mod can appear with or without a sign

Optional syntax:

  • [additional] - Optional literal, sets c.additional?: true
  • [{modType:DmgModType}] - Optional capture, sets c.modType?: DmgModType
  • {(effect|damage)} - Alternation (regex-style)

3. Add Enum Mapping (if needed)

If you need custom word → value mapping, add to enums.ts:

typescript
1export const StatWordMapping: Record<string, string> = { 2 strength: "str", 3 dexterity: "dex", 4 intelligence: "int", 5}; 6 7registerEnum("StatWord", ["strength", "dexterity", "intelligence"]);

4. Add Handler in offense.ts (if new mod type)

If you added a new mod type, add handling in calculateOffense() or relevant helper:

typescript
1case "NewModType": { 2 break; 3}

For existing mod types with new variants (like adding statModType: "all"), update existing handlers to also filter for the new variant:

typescript
1const flat = sumByValue( 2 statMods.filter((m) => m.statModType === statType || m.statModType === "all"), 3);

5. Add Tests

Add test cases in src/tli/mod_parser.test.ts:

typescript
1test("parse percentage all stats", () => { 2 const result = parseMod("+10% all stats"); 3 expect(result).toEqual([ 4 { 5 type: "StatPct", 6 statModType: "all", 7 value: 10, 8 }, 9 ]); 10});

6. Verify

bash
1pnpm test src/tli/mod_parser.test.ts 2pnpm typecheck 3pnpm check

Template Ordering

IMPORTANT: More specific patterns must come before generic ones in allParsers array.

typescript
1// Good: specific before generic 2t("{value:dec%} all stats").output(...), // Specific 3t("{value:dec%} {statModType:StatWord}").output(...), // Generic 4 5// Bad: generic would match first and fail on "all stats"

Examples

Simple Value Parser (Signed)

Input: "+10% all stats" (starts with +)

typescript
1t("{value:+dec%} all stats").output((c) => ({ 2 type: "StatPct", 3 value: c.value, 4 statModType: "all", 5})),

Simple Value Parser (Unsigned)

Input: "8% additional damage applied to Life" (no sign)

typescript
1t("{value:dec%} additional damage applied to life").output((c) => ({ 2 type: "DmgPct", 3 value: c.value, 4 dmgModType: "global", 5 addn: true, 6})),

Parser with Condition (Signed)

Input: "+40% damage if you have Blocked recently"

typescript
1t("{value:+dec%} damage if you have blocked recently").output((c) => ({ 2 type: "DmgPct", 3 value: c.value, 4 dmgModType: "global", 5 addn: false, 6 cond: "has_blocked_recently", 7})),

Parser with Per-Stackable (Signed in "deals" position)

Input: "Deals +1% additional damage to an enemy for every 2 points of Frostbite Rating the enemy has"

Note: The + appears AFTER "deals", so use {value:+dec%}:

typescript
1t("deals {value:+dec%} additional damage to an enemy for every {amt:int} points of frostbite rating the enemy has") 2 .output((c) => ({ 3 type: "DmgPct", 4 value: c.value, 5 dmgModType: "global", 6 addn: true, 7 per: { stackable: "frostbite_rating", amt: c.amt }, 8 })),

Multi-Output Parser (Signed)

Input: "+6% attack and cast speed"

typescript
1t("{value:+dec%} [additional] attack and cast speed").outputMany([ 2 spec((c) => ({ type: "AspdPct", value: c.value, addn: c.additional !== undefined })), 3 spec((c) => ({ type: "CspdPct", value: c.value, addn: c.additional !== undefined })), 4]),

Flat Stat Parser (Signed)

Input: "+166 Max Mana"

typescript
1t("{value:+dec} max mana").output((c) => ({ type: "MaxMana", value: c.value })),

Optional-Sign Parser

Input: "12.5% Sealed Mana Compensation for Spirit Magus Skills" OR "+12.5% Sealed Mana Compensation for Spirit Magus Skills"

Use ?dec% when the same mod string can appear with or without a +/- sign, avoiding the need for two separate templates:

typescript
1t("{value:?dec%} sealed mana compensation for spirit magus skills").output( 2 (c) => ({ type: "SealedManaCompPct", value: c.value, addn: false, skillType: "spirit_magus" }), 3),

No-Op Parser (Recognized but produces no mods)

Input: "Energy Shield starts to Charge when Blocking"

Use outputNone() when a mod string should be recognized (not flagged as unparsed) but has no effect on calculations:

typescript
1t("energy shield starts to charge when blocking").outputNone(),

Common Mistakes

MistakeFix
Using dec% for input with + prefixUse +dec% for inputs like "+25% damage", or ?dec% if sign is optional
Using +dec% for input without signUse dec% for inputs like "8% damage applied to life", or ?dec% if sign is optional
Two templates for signed/unsigned variants of the same modUse ?dec% to match both in a single template
Template doesn't match input caseTemplates are matched case-insensitively; input is normalized to lowercase
Missing type field in output mapperInclude type: "ModType" in the returned object — contextual typing from the Mod discriminated union handles narrowing
Handler doesn't account for new variantUpdate offense.ts to handle new values (e.g., statModType === "all")
Generic template before specificMove specific templates earlier in allParsers array

Data Flow

Raw string: "+10% all stats"
    ↓ normalize (lowercase, trim)
"10% all stats"
    ↓ template matching (allParsers)
{ type: "StatPct", value: 10, statModType: "all" }
    ↓ calculateStats() in offense.ts
Applied to str, dex, int calculations

FAQ & Installation Steps

These questions and steps mirror the structured data on this page for better search understanding.

? Frequently Asked Questions

What is adding-mod-parsers?

Essential for Calculation Engine Agents processing game mod strings and stat systems. Adding-mod-parsers is a template-based system for converting raw mod strings into typed Mod objects used by calculation engines.

How do I install adding-mod-parsers?

Run the command: npx killer-skills add aclinia/torchlight-of-building/adding-mod-parsers. It works with Cursor, Windsurf, VS Code, Claude Code, and 19+ other IDEs.

What are the use cases for adding-mod-parsers?

Key use cases include: Converting raw mod strings to typed objects, Extending existing mod types with new variants, Adding support for new mod string patterns, Integrating mod parsing into calculation pipelines.

Which IDEs are compatible with adding-mod-parsers?

This skill is compatible with Cursor, Windsurf, VS Code, Trae, Claude Code, OpenClaw, Aider, Codex, OpenCode, Goose, Cline, Roo Code, Kiro, Augment Code, Continue, GitHub Copilot, Sourcegraph Cody, and Amazon Q Developer. Use the Killer-Skills CLI for universal one-command installation.

Are there any limitations for adding-mod-parsers?

Requires mod type definitions in src/tli/mod.ts. Template-based system may need pattern updates for new formats. Dependent on calculation engine integration.

How To Install

  1. 1. Open your terminal

    Open the terminal or command line in your project directory.

  2. 2. Run the install command

    Run: npx killer-skills add aclinia/torchlight-of-building/adding-mod-parsers. The CLI will automatically detect your IDE or AI agent and configure the skill.

  3. 3. Start using the skill

    The skill is now active. Your AI agent can use adding-mod-parsers immediately in the current project.

Related Skills

Looking for an alternative to adding-mod-parsers or another community skill for your workflow? Explore these related open-source skills.

View All

widget-generator

Logo of f
f

f.k.a. Awesome ChatGPT Prompts. Share, discover, and collect prompts from the community. Free and open source — self-host for your organization with complete privacy.

149.6k
0
AI

flags

Logo of vercel
vercel

flags is a Next.js feature management skill that enables developers to efficiently add or modify framework feature flags, streamlining React application development.

138.4k
0
Browser

zustand

Logo of lobehub
lobehub

The ultimate space for work and life — to find, build, and collaborate with agent teammates that grow with you. We are taking agent harness to the next level — enabling multi-agent collaboration, effortless agent team design, and introducing agents as the unit of work interaction.

72.8k
0
AI

data-fetching

Logo of lobehub
lobehub

The ultimate space for work and life — to find, build, and collaborate with agent teammates that grow with you. We are taking agent harness to the next level — enabling multi-agent collaboration, effortless agent team design, and introducing agents as the unit of work interaction.

72.8k
0
AI