core/boolean-preference

Generates paired set and toggle Redux actions with reducer registration for boolean preference fields.

6|6|Updated Jun 29, 2026
One-click install
npx skills add https://github.com/intent-hq/cloudlands-fe --skill core-boolean-preference-intent-hq
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: core/boolean-preference
Source: https://github.com/intent-hq/cloudlands-fe/tree/main/.agents/skills/themis/core/boolean-preference
Command: npx skills add https://github.com/intent-hq/cloudlands-fe --skill core-boolean-preference-intent-hq

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @augmentcode/themis, typed-redux-saga.

What problem does it solve? Hand-written setX and toggleX action pairs for boolean settings drift apart over time, forcing duplicate reducer boilerplate and independent test coverage for each action. This Skill standardizes boolean preference state management with a single factory that keeps both actions consistent and namespaced. ## Core Features & Use Cases - Paired Action Generation: createBooleanPreference emits a setAction and toggleAction with namespaced action types derived from the slice name. - Type-Safe Field Constraint: The field parameter is constrained at the type level to keys whose value is strictly boolean, so TypeScript rejects non-boolean fields at compile time. - Composable Reducer Registration: The register(builder) method adds both reducer cases and returns the same builder, so multiple preferences chain onto one createReducer call. - Use Case: When adding a darkMode flag to a settings slice, use this Skill to generate setDarkMode and toggleDarkMode actions, register both reducer cases, and optionally pair them with a local-storage persistence saga. ## Quick Start Ask the AI to add a boolean preference to a Redux slice using createBooleanPreference with paired set and toggle actions registered on the reducer builder.

Frequently Asked Questions about core/boolean-preference

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

FAQPage Schema
How do I add a boolean preference to a Redux slice in TypeScript?▼

Call createBooleanPreference with the slice name, a boolean field key, and set/toggle action names, then invoke register() on your createReducer builder. Destructure the generated setAction and toggleAction for dispatching.

How to combine multiple boolean preferences in one reducer?▼

Chain the register() calls because each one returns the same builder with two cases added. For example, darkMode.register(compactMode.register(createReducer(initialState))) wires both preferences into a single reducer.

Why does dispatching my toggle action not change the state?▼

The reducer was never given the generated handlers because register() was not called on the builder. Without registration the action creators exist but no reducer case handles them, so dispatch becomes a silent no-op.

Can createBooleanPreference target a non-boolean state field?▼

No. The field parameter is constrained to BooleanFieldKey<S>, so TypeScript rejects any key whose value is not strictly boolean at compile time. Widening with as any is unsafe because the runtime handler writes a boolean to that property.

How do I persist a boolean preference to local storage?▼

Pair the generated actions with a redux-saga that uses takeEvery on both the set and toggle actions, reads the current value via a selector, and writes it through a safe local-storage helper following the core/local-storage pattern.