companion-preset-category-file

Creates and wires enum-based preset category files into the presets.ts aggregator of Companion modules.

Updated May 19, 2026
One-click install
npx skills add https://github.com/digitaldrummerj/bitfocus-companion-skills --skill companion-preset-category-file-digitaldrummerj
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: companion-preset-category-file
Source: https://github.com/digitaldrummerj/bitfocus-companion-skills/tree/main/plugins/companion-preset-category-file
Command: npx skills add https://github.com/digitaldrummerj/bitfocus-companion-skills --skill companion-preset-category-file-digitaldrummerj

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Adding a new logical preset category to a split-file Bitfocus Companion module requires creating a correctly typed preset file and wiring it into the presets.ts aggregator, where mistakes in union types, spreads, or imports cause TypeScript build failures. ## Core Features & Use Cases - Preset Category File Template: Provides a complete enum-based preset file pattern with typed PresetId enums, factory functions, and button preset structures. - Aggregator Wiring: Documents the exact steps to import, call, union-type, and spread a new category into presets.ts. - Instance vs Static Forms: Explains when a preset factory needs the module instance for dynamic data such as config values. - Use Case: When building a Companion module and you need a brand-new preset category (for example, recording controls), follow the recipe to create src/presets/preset-recording.ts, wire it into presets.ts, and verify with a clean TypeScript build. ## Quick Start Ask the agent to create a new preset category file for your Companion module and wire it into the presets.ts aggregator using the enum-based preset ID pattern.

Frequently Asked Questions about companion-preset-category-file

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

FAQPage Schema
How do I add a new preset category to a Bitfocus Companion module?▼

Create a new src/presets/preset-{category}.ts file exporting a PresetId enum and a GetPresets factory, then import it in presets.ts, call the factory, add the enum to the union type, and spread the result into the combined presets object.

How do I wire a preset file into the presets.ts aggregator?▼

Import the enum and factory with a .js extension, call the factory inside GetPresetList storing the typed result, add the enum to the mapped union type, spread the result into the presets object, and return it cast as CompanionPresetDefinitions.

When should I not create a new preset category file?▼

Do not create a new file when the preset belongs to an existing category. Instead, open the existing preset-{category}.ts file, add the new enum member and preset definition directly, with no aggregator changes needed.

Why use enum-based preset IDs instead of string keys in Companion presets?▼

Enum-based preset IDs let TypeScript catch duplicate IDs at compile time, enable IDE rename-refactoring across the codebase, and let the aggregator union type enforce that every enum member is covered in the combined object.

Why does my Companion module build fail after adding a preset category?▼

Build failures usually come from adding the spread without the union type entry (or vice versa), missing .js extensions on ESM imports, or forgetting the as CompanionPresetDefinitions cast on the returned presets object.