logic-sandwich
Logic Sandwich
Use this skill when a high-level module has too much mixed detail in one method and you want to preserve the module's role as an orchestrator.
Typical triggers:
- a top-level class method is reading input, making detailed decisions, and mutating collaborators all in one block
- you want to move detail out of a mediator/orchestrator without changing behavior
- a method should read more like "gather state -> decide intent -> apply intent"
- you are working in a deep-modules codebase where top-level files should stay simple and high-level
Goal
Refactor toward three layers:
- Top layer: gather state from the world
- Middle layer: compute a pure intent or action
- Bottom layer: apply the intent with side effects
More from danielbush/skills
nullables
Guide for implementing James Shore's Nullables pattern and A-Frame architecture for testing without mocks. Use when implementing or refactoring code to follow patterns of: (1) Separating logic, infrastructure, and application layers, (2) Creating testable infrastructure with create/createNull factory methods, (3) Writing narrow, sociable, state-based tests without mocks, (4) Implementing value objects, (5) Building infrastructure wrappers that use embedded stubs, or (6) Designing dependency injection through static factory methods.
15work-tracker
Create and manage work items, tickets, and tracking artifacts in a project's work/ directory. Also handles session continuity, summarisation, and searching past work. Supports unsupervised tickets — self-contained work items queued for autonomous agent execution. Use when the human wants to: create/move/scan work items, review the backlog, summarise a session, recall past work, continue from a previous session ('where were we', 'let's continue'), or queue work for an unsupervised agent. Bootstraps work/ on first use.
15nullables-test
Write illustrative tests for code that follows the Nullables pattern. Verifies the class under test is ready (all HARDWIRED_INFRA replaced by INJECTED_INFRA, every dependency has .createNull), then writes narrow, sociable, state-based tests using .createNull(). Tests should illustrate the system's concepts and architecture, not just achieve coverage. Use after applying the nullables-refactor skill, or when writing tests for code that already uses DUAL_FACTORY.
13nullables-refactor
Analyze a file and produce a refactoring plan to apply the Nullables pattern. Classifies code by side-effect boundary (PURE, IN_MEMORY, OUTSIDE_WORLD), identifies HARDWIRED_INFRA, recommends INFRASTRUCTURE_WRAPPER or NULLABLE_CLASS conversion, checks DUAL_FACTORY and CREATE_BOUNDARY_RULE compliance, and decides on DELAYED_INSTANTIATION. Use when asked to refactor a file or module to follow the nullables pattern.
13effect-ts
>
7nullable-architecture
Use when refactoring code or writing tests in the Nullables style: choose between `new`, `.create()`, and `.createNull()`, introduce infrastructure wrappers at the environment boundary, add behavior simulation and output tracking, and write narrow, sociable, example-driven, state-based tests without mocks or spies.
5