# Craft Factory State

> Crafting factory states. DSL for building test state.

- Skill: `attac-t/craft-factory-state` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add attac-t/craft-factory-state`
- Raw SKILL.md: https://api.skillmd.com/api/skills/attac-t/craft-factory-state/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: attac-t (https://skillmd.com/u/attac-t)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/attac-t/craft-factory-state

---


# Skill: Craft Factory State

> "Factories are a DSL for building state."

## The Standard

1. **States Over Arrays**: Use expressive methods, not inline arrays.
2. **Chain for Composition**: Multiple states combine to tell a story.
3. **Name by Intent**: `revised()` not `withRevisionCount(1)`.

## The Anti-Patterns

| Don't                 | Do                          | Why           |
|-----------------------|-----------------------------|---------------|
| Inline arrays         | Named states                | Readability   |
| Generic names         | Intent-revealing names      | Clarity       |
| Deep nesting in tests | `withDeepHierarchy()` state | Encapsulation |
| Repeat setup          | Extract to state            | DRY           |

## Real-World Examples

See [examples.md](examples.md).

