adding-mod-parsers

Convert raw mod strings into typed Mod objects using template-based parsing.

40|29|Updated Nov 26, 2025
One-click install
npx skills add https://github.com/aclinia/torchlight-of-building --skill adding-mod-parsers
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: adding-mod-parsers
Source: https://github.com/aclinia/torchlight-of-building/tree/main/.claude/skills/adding-mod-parsers
Command: npx skills add https://github.com/aclinia/torchlight-of-building --skill adding-mod-parsers

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps developers convert raw mod strings (e.g., "+10% all stats") into typed Mod objects that the calculation engine can use, ensuring type safety and consistent parsing.

Core Features & Use Cases

  • Template-based parsing patterns guide the pattern matching for mod strings.
  • Guidance across project locations: mod type definitions, parser templates, enum mappings, calculation handlers, and tests.
  • Use Case: Add support for a new mod string pattern or a new mod type and verify the implementation with existing tests.

Quick Start

Follow the checklist to add a new mod parser by updating templates.ts, mod.ts, enums.ts, and offense.ts, then run tests.

Frequently Asked Questions about adding-mod-parsers

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I parse game mod strings into typed objects?

To parse game mod strings into typed objects, use template-based parsing patterns to convert raw mod strings like "+10% all stats" into typed Mod objects. This ensures type safety and drives a reliable parsing pipeline for your calculation engine.

How do I add support for a new game mod pattern in TypeScript?

To add support for a new game mod pattern, update the parser templates in templates.ts, add type definitions in mod.ts, map values in enums.ts, implement calculation handlers in offense.ts, and verify the implementation with tests in mod-parser.test.ts.

What is template-based parsing for game mods?

Template-based parsing for game mods is a mechanism where predefined templates guide the pattern matching for raw mod strings. This approach converts strings into typed Mod objects that the calculation engine can safely and consistently process.

How do I ensure type safety when extending mod parsers?

To ensure type safety when extending mod parsers, convert raw mod strings into typed Mod objects using defined templates and enum mappings. This typed pipeline guarantees that the calculation engine receives consistent and validated data structures.

What files do I need to update to add a new mod type?

To add a new mod type, you need to update five key files: src/tli/mod.ts for type definitions, src/tli/mod-parser/templates.ts for patterns, src/tli/mod-parser/enums.ts for mappings, src/tli/calcs/offense.ts for calculations, and src/tli/mod-parser.test.ts for tests.

How do I test a newly added mod parser pattern?

To test a newly added mod parser pattern, run the existing tests located in src/tli/mod-parser.test.ts after updating your templates, type definitions, enums, and calculation handlers. This verifies that the new pattern integrates correctly with the parsing pipeline.