nw-ab-critique-dimensi…
Review dimensions for validating agent quality - template compliance, safety, testing, and priority validation
Algebra-driven API design with monoids, semigroups, and interpreters via algebraic equations
$ npx -y skills add nWave-ai/nWave --skill nw-fp-algebra-driven-design --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/nw-fp-algebra-driven-designContext preview
The summary Claude sees to decide when to auto-load this skill.
Algebra-driven API design with monoids, semigroups, and interpreters via algebraic equations
name: nw-fp-algebra-driven-design agent: nw-functional-software-crafter description: Algebra-driven API design with monoids, semigroups, and interpreters via algebraic equations user-invocable: false disable-model-invocation: true
Algebraic thinking for API design. Discover the right API before implementing by specifying rules (equations) that operations must satisfy.
Cross-references: [fp-principles](../nw-fp-principles/SKILL.md) | [fp-domain-modeling](../nw-fp-domain-modeling/SKILL.md) | [fp-usable-design](../nw-fp-usable-design/SKILL.md)
---
[STARTER]
Code is the wrong abstraction level for design. Starting with data structures inherits unnecessary constraints.
---
[STARTER]
1. **Start with scope, not implementation.** Don't decide data structures upfront. 2. **Define observations first.** How do users extract information? Observations define equality: two values equal if no observation distinguishes them. Gives enormous implementation freedom. 3. **Add operations incrementally.** For each new operation, immediately write rules connecting it to existing ones. This web of rules IS the design. 4. **Let messy rules signal problems.** Complex rules mean coarse building blocks. Decompose until each rule is nearly trivial. 5. **Generalize aggressively.** Remove unnecessary type constraints. If most operations don't inspect contained values, parameterize over them.
---
[STARTER] -> [ADVANCED]
Recurring patterns in software. Recognizing them unlocks known rules and capabilities.
**What**: Type with one merge operation where grouping doesn't matter. **Rule**: `(a merge b) merge c = a merge (b merge c)` (associativity) **When**: Combining things where parenthesization shouldn't matter. **Examples**: String concatenation | config merging | min/max.
**What**: Combinable Value with a default element inert under combination. **Rules**: Associativity + `default merge x = x` and `x merge default = x` **When**: Safe defaults | fold operations | "nothing happened yet" values. **Examples**: `(+, 0)` | `(*, 1)` | `(concat, [])` | `(and, true)`. **Design signal**: If you find an associative operation, look for a default element. Finding one enables fold/reduce over collections.
**What**: Combinable Value where merging is also order-independent and idempotent. **When**: Conflict resolution | eventually-consistent systems | CRDTs. **Example**: Status tracker with `seen < failed < completed` uses `max` as merge.
**What**: Container type where you can transform contents without changing structure. Preserves identity and composition. **When**: Operations that work on data shape rather than values inside. **Design signal**: If most operations are agnostic to contained type, you likely have this.
**What**: Container where you can combine contents element-wise and fill with uniform values. **When**: Combining containers holding different content types.
**What**: Combinable Value with Default where every element has an inverse that cancels it. **When**: Undo operations | spatial transformations. **Example**: Clockwise/counter-clockwise rotation are inverses; horizontal flip is its own inverse.
---
[INTERMEDIATE]
Three categories, eight properties:
**Clarity** (communicates well):
**Economy** (no waste):
**Safety** (prevents mistakes):
---
[INTERMEDIATE]
Complex rules mean coarse building blocks. Split operations with many parameters into smaller, orthogonal ones. If a rule ignores some parameters, those should be separate operations.
Algebraic manipulation reveals contradictions before code is written. Requiring order-independence while returning an ordered list is a contradiction. Fix: use unordered collection.
When multiple observations share traversal logic, find one observation from which all others derive. Simplifies entire rule set.
When you have a "both" operation (parallel composition), look for its symmetric "either" counterpart. Symmetry discovers functionality not explicitly requested but inevitably needed.
---
[INTERMEDIATE]
1. **Build naive implementation**: Implement each operation as direct data constructor. Obviously correct because it mirrors the spec exactly. 2. **Discover all rules**: Feed naive implementation to a tool that enumerates well-typed expressions and finds observational equalities. Discovers specified AND emergent rules. 3. **Freeze as reg
AI agents that guide you from idea to working code, with human judgment at every gate. nWave runs inside Claude Code. It breaks feature delivery into seven waves (discover, diverge, discuss, design, devops, distill, deliver).
Repo: nWave-ai/nWave
Review dimensions for validating agent quality - template compliance, safety, testing, and priority validation
Review dimensions for validating agent quality - template compliance, safety, testing, and priority validation
Review dimensions for acceptance test quality - happy path bias, GWT compliance, business language purity, coverage completeness, walking skeleton…
Detailed 5-phase workflow for creating agents - from requirements analysis through validation and iterative refinement
5-layer testing approach for agent validation including adversarial testing, security validation, and prompt injection resistance
Architectural style selection decision matrices, trade-off analysis, structural enforcement rules, and combination patterns. Load when choosing or evaluating…