hani-q/qstack / skills/qstack-model-the-domain
qstack-model-the-domain
VerifiedReplace scattered domain assumptions with the smallest structure that removes invalid states and branching. Use when booleans have to be kept in sync, the same rule is validated at several call sites, a branch grows with every new case, or an invalid state can be represented at all.
Model the domain
Encode the real domain in a structure instead of distributing it across booleans, conditionals, loose parameters, and lifecycle checks.
Find the missing shape
- Trace the states, transitions, invariants, ownership, and dominant access paths in the current code.
- Locate repeated shape assumptions, synchronized booleans, growing branches, ad hoc mutation, and phase-named modules that repeat the same domain rules.
- Choose the smallest structure that removes those problems. Candidates include a state machine, typed model, discriminated union, registry, lookup table, reducer, command/event model, queue, cache, index, graph, normalized collection, or one module that owns a coherent body of domain knowledge.
- Compare the proposed shape with the current one. It must delete branches, duplicated rules, invalid states, or lifecycle risk. Extra indirection alone is not a benefit.
- Leave clear, local, stable code alone when no structure materially improves it. Three explicit statements can be better than a premature abstraction.
State the invariant the model enforces, the access patterns it serves, the invalid states it removes, and the migration boundary. Design work does not authorize implementation beyond the user's request. Assess compatibility and migration before changing a public API or persisted shape. Design alone does not authorize commits, pushes, publishing, deployment, or external messages.
Adapted from Lauren Tan's PStack
principle-model-the-domain
at commit 60c641e4fad674784b30abcf9f8915dea39df38d under the MIT License.
See third-party notices.
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack." | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |