nullables-refactor
Nullables Refactor
Analyze a file and produce a step-by-step refactoring plan to make OUTSIDE_WORLD code nullable.
Vocabulary
This skill uses terms from references/vocabulary.md. Key terms: PURE, IN_MEMORY, OUTSIDE_WORLD, INFRASTRUCTURE_WRAPPER, NULLABLE_CLASS, HARDWIRED_INFRA, INJECTED_INFRA, CREATE_BOUNDARY_RULE, DUAL_FACTORY, EMBEDDED_STUB, NULLABLE, FACTORY_OBJECT, DELAYED_INSTANTIATION, CONFIGURABLE_RESPONSE, OUTPUT_TRACKING, VALUE_OBJECT.
How We Break Down The World
Code is classified by where its side effects reach:
| Category | Side effects | Nullable treatment needed? | Examples |
|---|---|---|---|
| PURE | None | No | Computations, transformations, formatters |
| IN_MEMORY | Mutates things passed in or held in memory | No | DOM manipulation, mutable data structures, in-memory state |
| OUTSIDE_WORLD | Crosses the process boundary (I/O) | Yes | Network calls, disk access, database queries, environment reads |
The nullables pattern specifically targets OUTSIDE_WORLD code. PURE and IN_MEMORY code is fine as-is.
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.
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.
5jcodemunch
Code search and exploration using jcodemunch-mcp via `bunx mcporter`. TRIGGER when: reading code, exploring a codebase, looking up functions/classes/symbols, finding where something is defined or used, understanding how files relate, navigating unfamiliar code, checking what depends on something, investigating imports, tracing call chains, orienting on a repo, answering 'how does X work', 'where is X defined', 'what calls X', 'what would break if I change X', 'show me the code for X', searching across multiple files or repos, or any task that benefits from symbol-aware code intelligence beyond simple grep. Prefer this over raw file reads when exploring code structure, relationships, or usage patterns.
3