nw-design-patterns

7 agentic design patterns with decision tree for choosing the right pattern for each agent type

322 stars

Best use case

nw-design-patterns is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

7 agentic design patterns with decision tree for choosing the right pattern for each agent type

Teams using nw-design-patterns should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/nw-design-patterns/SKILL.md --create-dirs "https://raw.githubusercontent.com/nWave-ai/nWave/main/nWave/skills/nw-design-patterns/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/nw-design-patterns/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How nw-design-patterns Compares

Feature / Agentnw-design-patternsStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

7 agentic design patterns with decision tree for choosing the right pattern for each agent type

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# Agentic Design Patterns

## Pattern Decision Tree

```
Is the agent doing a single focused task?
  YES -> Does it need self-evaluation?
    YES -> Reflection
    NO  -> ReAct (default for most agents)
  NO -> Is it coordinating multiple agents?
    YES -> Are tasks independent?
      YES -> Parallel Orchestration
      NO  -> Are tasks sequential with dependencies?
        YES -> Sequential Orchestration
        NO  -> Hierarchical (supervisor + workers)
    NO -> Is it routing to one of several specialists?
      YES -> Router
      NO  -> Does it need structured task decomposition?
        YES -> Planning
        NO  -> ReAct (default)
```

## 1. ReAct (Reason + Act)

General-purpose agents needing tool calling and iterative problem-solving.

**Loop**: Reason -> Select/execute action -> Observe result -> Repeat until done.
**When**: Default pattern. Most specialist agents.
**Examples**: software-crafter, researcher, troubleshooter.

## 2. Reflection

Agent must evaluate and iteratively improve its own output.

**Loop**: Generate -> Review against criteria -> Identify gaps -> Refine -> Validate threshold met.
**When**: Quality-critical outputs where first-draft insufficient (code review, architecture review, agent validation).
**Examples**: agent-builder-reviewer, solution-architect-reviewer, software-crafter-reviewer.

## 3. Router

Request classified and delegated to exactly one specialist.

**Loop**: Analyze request -> Classify -> Select specialist -> Delegate.
**When**: Task dispatching, single path execution. Low overhead, fast routing.
**Examples**: workflow-dispatcher, task-router.

## 4. Planning

Complex tasks requiring structured decomposition before execution.

**Loop**: Decompose into sub-tasks -> Sequence -> Allocate resources -> Execute with checkpoints.
**When**: Multi-step implementations, migrations, large refactoring.
**Examples**: project-planner, migration-coordinator.

## 5. Sequential Orchestration

Linear workflows with clear dependencies between stages.

**Structure**: Agent1 -> Output1 -> Agent2 -> Output2 -> Agent3 -> Result
**When**: Pipeline workflows where each stage transforms previous output.
**Example**: nWave waves: DISCUSS -> DESIGN -> DEVOPS -> DISTILL -> DELIVER.

## 6. Parallel Orchestration

Multiple independent analyses needed simultaneously.

**Structure**: Supervisor -> [Worker1, Worker2, Worker3] (concurrent) -> Aggregate results.
**When**: Independent analyses, multi-aspect reviews, parallel risk assessment.
**Example**: Multi-reviewer code review, parallel security + performance + correctness analysis.

## 7. Hierarchical

Supervisor coordinates multiple worker agents dynamically.

**Structure**: Supervisor manages workers, routing tasks and aggregating results.
**When**: Complex coordination where routing depends on intermediate results.
**Example**: feature-coordinator supervising frontend/backend/database/testing specialists.

## Pattern Combinations

- **ReAct + Reflection**: Reason/act then self-review (most reviewer agents)
- **Planning + Sequential**: Decompose then execute pipeline (devop)
- **Router + Hierarchical**: Route to supervisor who coordinates workers

## Choosing for nWave Agents

| Agent Role | Pattern | Rationale |
|-----------|---------|-----------|
| Specialist (single domain) | ReAct | Tool-using, iterative task completion |
| Reviewer (-reviewer suffix) | Reflection | Must self-evaluate and iterate on critique |
| Wave orchestrator | Sequential | Clear dependency chain between phases |
| Multi-agent coordinator | Hierarchical | Dynamic task routing to specialists |
| Task dispatcher | Router | Classification and single-path delegation |

Related Skills

nw-ux-web-patterns

322
from nWave-ai/nWave

Web UI design patterns for product owners. Load when designing web application interfaces, writing web-specific acceptance criteria, or evaluating responsive designs.

nw-ux-tui-patterns

322
from nWave-ai/nWave

Terminal UI and CLI design patterns for product owners. Load when designing command-line tools, interactive terminal applications, or writing CLI-specific acceptance criteria.

nw-ux-emotional-design

322
from nWave-ai/nWave

Emotional design and delight patterns for product owners. Load when designing onboarding flows, empty states, first-run experiences, or evaluating the emotional quality of an interface.

nw-ux-desktop-patterns

322
from nWave-ai/nWave

Desktop application UI patterns for product owners. Load when designing native or cross-platform desktop applications, writing desktop-specific acceptance criteria, or evaluating panel layouts and keyboard workflows.

nw-test-design-mandates

322
from nWave-ai/nWave

Four design mandates for acceptance tests - hexagonal boundary enforcement, business language abstraction, user journey completeness, walking skeleton strategy, and pure function extraction

nw-security-by-design

322
from nWave-ai/nWave

Security design principles, STRIDE threat modeling, OWASP Top 10 architectural mitigations, and secure patterns. Load when designing systems or reviewing architecture for security.

nw-sd-patterns

322
from nWave-ai/nWave

Core distributed systems patterns - load balancing, caching, sharding, consistent hashing, message queues, rate limiting, CDN, Bloom filters, ID generation, replication, conflict resolution, CAP theorem

nw-sd-patterns-advanced

322
from nWave-ai/nWave

Advanced distributed patterns - event sourcing, CQRS, saga, stream processing, append-only log, exactly-once delivery, sequencer, double-entry ledger, erasure coding, order book, watermarks

nw-fp-usable-design

322
from nWave-ai/nWave

Naming conventions, API ergonomics, and usability patterns for functional code

nw-fp-algebra-driven-design

322
from nWave-ai/nWave

Algebra-driven API design with monoids, semigroups, and interpreters via algebraic equations

nw-domain-driven-design

322
from nWave-ai/nWave

Strategic and tactical DDD patterns, bounded context discovery, context mapping, aggregate design rules, and decision frameworks for when to apply DDD

nw-design

322
from nWave-ai/nWave

Designs system architecture with C4 diagrams and technology selection. Routes to the right architect based on design scope (system, domain, application, or full stack). Two interaction modes: guide (collaborative Q&A) or propose (architect presents options with trade-offs).