# Craft Expectation Chain

> Crafting expectation chains. Fluent assertions without traps.

- Skill: `attac-t/craft-expectation-chain` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add attac-t/craft-expectation-chain`
- Raw SKILL.md: https://api.skillmd.com/api/skills/attac-t/craft-expectation-chain/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-expectation-chain

---


# Skill: Craft Expectation Chain

> "Chains compose. Nesting doesn't."

## The Standard

1. **One Subject, Many Assertions**: Chain assertions on the same value.
2. **`and()` for New Subjects**: Switch subjects explicitly.
3. **Break Nested Collections**: `->each->` allows ONE assertion. No deeper.

## The Anti-Patterns

| Don't                            | Do                    | Why              |
|----------------------------------|-----------------------|------------------|
| `->each->prop->each->`           | Separate expectations | Proxy limitation |
| Multiple `expect()` for same value | Chain assertions    | Fluency          |
| Implicit subject switches        | Use `->and()`         | Clarity          |

## Real-World Examples

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

