Skip to content

memorysaver/agentic-engineering-patterns

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Agentic Engineering Patterns

A Claude Code plugin for building software products with AI agents — from raw idea to shipped MVP.

Why This Exists

Traditional software development bottlenecks on human coding time. Process design optimizes "how to make people write code faster."

When agents can execute dozens of tasks in parallel, that bottleneck vanishes. A new one takes its place:

Agent execution capacity is near-infinite. Specification quality is not.

Vague specs don't slow down a human — they ask a colleague and adjust. Vague specs paralyze agents — they guess, diverge, and produce incompatible code across parallel sessions. The cost of ambiguity scales with parallelism.

This inverts the entire design logic:

Traditional:    plan roughly → adjust as you go → ship
                (optimizes for human coding speed)

Agentic:        invest heavily in spec precision → parallel execution → ship
                (optimizes for agent execution quality)

Every skill in this plugin serves that logic. The time you spend in /envision and /map pays back exponentially when agents build in parallel without asking questions.

The Mental Model

The workflow separates thinking from doing:

┌─────────────────────────────────────────────────────────────────┐
│                                                                 │
│   CONTROL PLANE  (human decides what to build)                  │
│                                                                 │
│   You + AI collaborate on high-leverage decisions:              │
│   goals, decomposition, architecture, priorities, feedback      │
│                                                                 │
│   ┌──────────┐    ┌──────────┐    ┌──────────┐                 │
│   │ /envision │───►│  /map    │───►│ /reflect │──┐              │
│   │          │    │          │    │          │  │              │
│   │ what to  │    │ how to   │    │ what we  │  │              │
│   │ build    │    │ break it │    │ learned  │  │              │
│   │          │    │ down     │    │          │  │              │
│   └──────────┘    └──────────┘    └──────────┘  │              │
│        ▲                │              │         │              │
│        └────────────────┼──────────────┘         │              │
│                         │  feedback loop         │              │
│                         ▼                        │              │
│                  ┌────────────┐                   │              │
│                  │ /dispatch  │  picks stories    │              │
│                  │            │  from the map,    │              │
│                  │ what to    │  creates OpenSpec │              │
│                  │ work on    │  changes          │              │
│                  │ next       │                   │              │
│                  └─────┬──────┘                   │              │
│                        │                         │              │
└────────────────────────┼─────────────────────────┼──────────────┘
                         │                         │
          story specs    │    status + cost flow up │
          flow down      │                         │
                         ▼                         │
┌──────────────────────────────────────────────────┼──────────────┐
│                                                  │              │
│   EXECUTION PLANE  (agents build it)             │              │
│                                                                 │
│   Agents receive precise specs, work in isolation,              │
│   produce PRs. They don't decide what to build.                 │
│                                                                 │
│   ┌──────────┐    ┌──────────┐    ┌──────────┐    ┌─────────┐  │
│   │ /design  │───►│ /launch  │───►│  /build  │───►│  /wrap  │  │
│   │          │    │          │    │          │    │         │  │
│   │ refine   │    │ spawn    │    │ implement│    │ archive │  │
│   │ the spec │    │ agent    │    │ + test   │    │ + update│  │
│   │          │    │          │    │ + PR     │    │ status  │  │
│   └──────────┘    └──────────┘    └──────────┘    └─────────┘  │
│                                                                 │
│   (repeat per story — multiple stories run in parallel)         │
│                                                                 │
└─────────────────────────────────────────────────────────────────┘

Agents don't talk to each other. They communicate through structured artifacts — context documents, story specs, interface contracts, signal files. The harness coordinates everything. This is a production system design, not a chatroom-style agent swarm.

The Three Plugins

Each plugin implements one layer of the mental model.

1. Product Context — the persistent map

Captures the "what and why" of the entire product in a single product-context.yaml — committed to git, versioned, and machine-parseable.

/envision                        /map                            /reflect
    │                               │                               │
    ▼                               ▼                               ▼
Opportunity Brief               System Map                      Classify feedback:
"should we build this?"         "modules + interfaces"          bug → fix story
    │                               │                           refinement → next layer
    ▼                               ▼                           discovery → update map
Context Document                Story Graph                     shift → re-envision
"what exactly to build,         "layered work items,                │
 for whom, within               execution slices"                   │
 what constraints"                  │                               │
    │                               ▼                               │
    │                           Agent Topology                      │
    │                           "roles + contracts"                 │
    │                               │                               │
    └───────────────┬───────────────┘                               │
                    │                                               │
                    ▼                                               │
               /dispatch                                            │
               "pick next story,          ◄─────────────────────────┘
                create OpenSpec change,     (new stories feed back
                route to /design"            into the dispatch queue)
                    │
                    ▼
              /design → /launch → /build → /wrap

All sections live in one product-context.yaml file — opportunity, product, architecture, stories (with state machine), topology, layer gates, cost tracking, and a semantic changelog.

Why this exists: Without a product-level map, each feature is designed in isolation. Agents build incompatible pieces. Module boundaries are implicit. The YAML makes the whole system visible, machine-readable, and git-versioned before any code is written.

2. Feature Lifecycle — the execution cycle

Takes one story from the map and turns it into a merged PR. /dispatch picks the story; the two-session model executes it:

MAIN SESSION (you + AI)                WORKSPACE SESSION (agent alone)
━━━━━━━━━━━━━━━━━━━━━━                ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

/dispatch
  pick story from YAML
  create OpenSpec change
         │
/design
  refine the spec
  (or skip if well-specified) ────►   /build
         │                              init tracking + jj change stack
/launch                                 implement each task
  create jj workspace                   code review (+ evaluator loop)
  bootstrap agent             ◄────     create PR, handle review
  optional: spawn evaluator             merge
         │                                     │
/wrap    ◄─────────────────────────────────────┘
  archive OpenSpec change
  update story status in YAML
  check layer gate
  suggest /reflect

Why two sessions: Design needs human judgment — you decide direction, scope, tradeoffs. Implementation is mechanical — the agent follows the spec, implements, tests, publishes. Separating them lets the agent work autonomously for hours while you do other things.

Why jj (not git): Changes are mutable until published. No staging area. Auto-rebase when editing earlier changes. jj workspace add gives each agent an isolated working copy with no extra disk space. The agent generates rough code, then cleans up with split/squash — a natural post-generation step.

3. Project Setup — the one-time foundation

Gets your machine and project ready. Run once.

/onboard                             /scaffold
    │                                    │
    ▼                                    ▼
Verify tools                         Scaffold monorepo
(jj, bun, git, gh,                   (Better-T-Stack: frontend,
 claude, openspec,                    backend, database, auth,
 tmux, cmux)                         API layer, addons)
    │                                    │
    ▼                                    ▼
Install plugins                      Initialize OpenSpec
(superpowers, agent-browser,         (explore/propose/apply/archive
 frontend-design, mgrep)             commands for spec-driven dev)

The Feedback Loop

The workflow is a loop, not a line. After shipping features, /reflect classifies what you learned:

                    ┌──────────────────────────────────┐
                    │                                  │
     ┌──────────── │ ◄── opportunity shift             │
     │              │      (back to /envision)          │
     │              │                                  │
     │  ┌───────── │ ◄── discovery                     │
     │  │           │      (update /envision or /map)   │
     │  │           │                                  │
     │  │  ┌────── │ ◄── refinement                    │
     │  │  │        │      (new story in next layer)    │
     │  │  │        │                                  │
     │  │  │  ┌─── │ ◄── bug                           │
     │  │  │  │     │      (fix story, back to /design) │
     │  │  │  │     │                                  │
     │  │  │  │     └──────────────────────────────────┘
     │  │  │  │              /reflect
     ▼  ▼  ▼  ▼
  Each feedback type routes to the right phase.
  The product context evolves. The cycle continues.

Design Principles

These aren't rules we invented — they're patterns extracted from Anthropic's engineering research on long-running agent harnesses:

Spec precision over implementation speed. Time invested in unambiguous specs pays back exponentially across parallel agents. A 10-minute conversation in /envision saves hours of agent confusion.

Walking skeleton first. Build the thinnest end-to-end path (Layer 0) before going deep into any module. Validate the architecture at minimum cost. Going deep before proving the skeleton works is the most expensive mistake.

Every harness component earns its place. Sprint contracts, verification JSON, signal files, evaluator agents — each exists because of a specific failure mode observed in practice. As models improve, stress-test each component and remove what's no longer needed.

Generator-evaluator separation. Agents praise their own work even when it's mediocre. A separate evaluator agent, calibrated toward skepticism, catches problems the builder missed. This is the single most durable pattern from Anthropic's research.

Getting Started

New to this plugin?

/onboard

Installs prerequisites, verifies tools, configures recommended plugins.

Have a product idea?

/envision  →  /map  →  /scaffold

Validate the opportunity, decompose into stories, scaffold the project.

Ready to build a feature?

/dispatch  →  /design  →  /launch  →  /build  →  /wrap

Pick a story from the map, spec it, spawn the agent, let it build, archive when merged.

Shipped something? Close the loop:

/reflect

Classify feedback, update the product context, plan the next iteration.

All Skills

Skill Plugin Purpose
/envision product-context Opportunity brief + context document
/map product-context System map + story graph + agent topology
/dispatch product-context Pick next story + create OpenSpec change
/reflect product-context Classify feedback + update context
/onboard project-setup Verify tools + install plugins
/scaffold project-setup Scaffold monorepo + initialize OpenSpec
/design agentic-development-workflow Explore + propose + review a feature
/launch agentic-development-workflow Spawn workspace + optional evaluator
/build agentic-development-workflow Implement → test → PR → merge
/wrap agentic-development-workflow Archive + cleanup + suggest reflect
/jj-ref agentic-development-workflow jj command reference (on-demand)

Inspired By

License

MIT

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors