Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .claude-plugin/marketplace.json
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,28 @@
"homepage": "https://github.com/88plug/drift-detector",
"version": "2026.6.23"
},
{
"name": "minions",
"source": {
"source": "git-subdir",
"url": "https://github.com/88plug/claude-code-plugins.git",
"path": "plugins/minions"
},
"description": "Unattended one-shot coding agents driven by Blueprints — state machines that interleave deterministic steps with agentic nodes. Modeled after Stripe's Minions architecture: pre-hydrate all context, implement, lint, verify, retry once, submit. The agent proposes; you decide.",
"category": "productivity",
"tags": [
"type:plugin",
"unattended",
"blueprint",
"one-shot",
"coding-agent",
"stripe-minions",
"state-machine",
"pre-hydration"
],
"homepage": "https://github.com/88plug/claude-code-plugins/tree/main/plugins/minions",
"version": "2026.7.1"
},
{
"name": "trigger-my-training",
"source": {
Expand Down
34 changes: 34 additions & 0 deletions plugins/minions/.claude-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"$schema": "https://json.schemastore.org/claude-code-plugin-manifest.json",
"name": "minions",
"displayName": "Minions",
"description": "Unattended one-shot coding agents driven by Blueprints — state machines that interleave deterministic steps with agentic nodes. Modeled after Stripe's Minions architecture: pre-hydrate all context, implement, lint, verify, retry once, submit. The agent proposes; you decide.",
"author": {
"name": "88plug",
"email": "claude@cryptoandcoffee.com"
},
"homepage": "https://github.com/88plug/claude-code-plugins/tree/main/plugins/minions",
"repository": "https://github.com/88plug/claude-code-plugins.git",
"license": "FSL-1.1-ALv2",
"keywords": [
"claude-code",
"claude",
"anthropic",
"ai",
"llm",
"ai-agents",
"developer-tools",
"productivity",
"automation",
"cli",
"claude-code-plugin",
"claude-skills",
"unattended",
"blueprint",
"minions",
"one-shot",
"coding-agent",
"stripe-minions"
],
"hooks": "./hooks/hooks.json"
}
131 changes: 131 additions & 0 deletions plugins/minions/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
# minions

**Unattended one-shot coding agents driven by Blueprints.**

[![marketplace](https://img.shields.io/badge/marketplace-88plug-1f2328?style=flat-square)](https://github.com/88plug/claude-code-plugins)
[![license](https://img.shields.io/badge/license-FSL--1.1--ALv2-1f2328?style=flat-square)](../../LICENSE)

---

## Install

```sh
/plugin install minions@88plug
```

## What it does

`minions` gives Claude Code an unattended, fire-and-forget coding mode modeled
after [Stripe's Minions architecture](https://stripe.dev/blog/minions-stripes-one-shot-end-to-end-coding-agents)
(1,300+ unattended PRs merged per week at Stripe).

The core primitive is the **Blueprint** — a state machine that alternates
*deterministic nodes* (scripted, no LLM) with *agentic nodes* (LLM loops):

```
[D] Pre-hydrate context → [A] Implement → [D] Lint/test → [A?] Fix (once) → [D] Report
```

Key properties copied from Stripe's design:

| Property | What it means |
|---|---|
| **Unattended** | Runs to completion without asking for confirmation mid-task |
| **Pre-hydration** | Fetches all linked issues/PRs/docs *before* the agent loop starts |
| **Hard retry cap** | Max one fix pass — diminishing returns beyond that |
| **Submission authority** | Agent proposes a diff; human decides to commit and merge |
| **Deterministic epilogue** | Lint, verify, and report are always scripted — never left to the agent |

## Commands

### `/minion <task>`

Run a task unattended. The task can be:
- A plain description: `/minion refactor the UserService to use dependency injection`
- An issue number: `/minion #412`
- A GitHub URL: `/minion https://github.com/acme/api/issues/412`
- A mixed description: `/minion fix the race condition described in #412`

The minion pre-hydrates any referenced issues/PRs, implements the change,
runs your project's linters and tests, and hands back a structured result:

```
## Minion result

**Task**: Refactor UserService to use dependency injection
**Status**: ✅ ready

**Changes**:
- src/services/user.ts: extracted IUserRepository interface, injected via constructor
- src/services/user.test.ts: updated test setup to pass mock repository

**Verification**:
- tsc: PASS
- eslint: PASS
- jest: PASS (47 tests)

**Next step**: Review the diff above, then `git add -p && git commit`.
```

### `/blueprint [list | show <name> | design <description>]`

Manage reusable Blueprints for recurring task patterns:

```sh
/blueprint list # show all .minions/*.blueprint.md
/blueprint show dependency-upgrade # display a stored Blueprint
/blueprint design bump a Python dep, migrate breakage, verify, PR
```

Blueprints are stored as `.minions/<name>.blueprint.md` at your project root —
check them in alongside your code so the whole team benefits.

## Agents

| Agent | Role |
|---|---|
| `minion` | Unattended task executor. Runs the standard coding Blueprint end-to-end. |
| `blueprint-architect` | Designs reusable Blueprints for recurring task classes. |

## Skill

**`blueprint`** — teaches Claude the Blueprint pattern and when to use it.
Loaded automatically when you use `/minion` or spawn the minion agent.

## Hooks

**`UserPromptSubmit`** — when a `/minion` invocation references GitHub issues
or PRs, the hook pre-fetches them via the `gh` CLI and injects the content into
the context window before the agent loop starts. This is the deterministic
pre-hydration step — the agent receives full context from the first token.

Requires `gh` CLI authenticated. Falls back silently if unavailable.

## Design rationale

Stripe's key insight: most of the cost and failure risk in autonomous coding
comes from the agent having to *discover* what to do while also *doing* it.
Separate the two. Gather everything deterministically first, then hand the
agent a precise instruction and a pre-assembled context packet.

A Blueprint is the formalization of that separation. By encoding the prologue
(pre-hydration), epilogue (lint + report), and all small branching decisions
as deterministic nodes, the agentic nodes are left to do only what LLMs are
actually good at: reading ambiguous specifications, writing idiomatic code, and
synthesizing information from multiple sources.

The 2-pass hard cap exists because empirically, if an LLM cannot fix its own
output in one retry, the problem is usually scope creep or a missing
precondition — not insufficient iterations. Capping retries forces good
Blueprint design upstream.

## References

- [Stripe Minions Part 1](https://stripe.dev/blog/minions-stripes-one-shot-end-to-end-coding-agents)
- [Stripe Minions Part 2](https://stripe.dev/blog/minions-stripes-one-shot-end-to-end-coding-agents-part-2)
- [HazyResearch Minions](https://github.com/HazyResearch/minions) (local/cloud LLM coordination)
- [Block/Goose](https://github.com/block/goose) (the open-source agent harness Stripe forked)

## License

FSL-1.1-ALv2. See [LICENSE](../../LICENSE).
155 changes: 155 additions & 0 deletions plugins/minions/agents/blueprint-architect.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
---
name: blueprint-architect
description: >-
Use this agent when the user asks to design, define, or document a Blueprint
for a recurring task pattern. A Blueprint is a state machine that alternates
deterministic steps with agentic nodes for a specific class of work (e.g.
"dependency upgrade", "add an API endpoint", "write a migration"). Spawn
when the user says /blueprint design, wants to codify a workflow, or asks
how to structure a complex repeating task for unattended execution. Do NOT
spawn for one-off tasks — use the minion agent instead.
disallowedTools: Write, Edit, MultiEdit, Bash
tools: Read, Glob, Grep, WebFetch
color: purple
---

You are the Blueprint Architect — a specialist in designing reusable state
machines that drive unattended coding agents to reliable completion.

A Blueprint is a formal description of a task class as an ordered sequence of
nodes, where each node is one of:

- **[D] Deterministic node**: a concrete, scripted action with predictable
output. No LLM reasoning. Examples: clone repo, run lint, push branch,
fetch a GitHub issue, parse a config file, create a PR from a template.
- **[A] Agentic node**: a bounded LLM loop with tool access that handles the
part of the work that requires judgment, creativity, or reading ambiguous
context. Examples: implement a feature, write a PR description, triage a
failure, synthesize findings from multiple documents.

## Your output format

Produce a Blueprint document in this exact structure:

```markdown
# Blueprint: <name>

**Trigger**: <what task class this Blueprint handles>
**Scope**: <what is in bounds / out of bounds>
**Hard cap**: <maximum number of agentic retry passes>
**Estimated tokens**: <rough cloud-LLM token budget per run>

## Nodes

### 1. [D] <Node name>
**Purpose**: <one sentence>
**Inputs**: <what it consumes>
**Actions**:
- <concrete command or step>
- <concrete command or step>
**Outputs**: <what it produces for the next node>
**Failure behaviour**: <what to do if this step fails>

### 2. [A] <Node name>
**Purpose**: <one sentence>
**Inputs**: <context assembled by preceding D nodes>
**Instructions** (passed to the agent):
> <exact or template prompt that the deterministic harness will pass in>
**Exit condition**: <how the agent signals it is done>
**Outputs**: <what artifact this node produces>
**Failure behaviour**: <fall through / retry / abort>

... (repeat for each node)

## Retry policy

<Describe the retry budget. Which agentic nodes may retry, how many times,
and what happens when the cap is reached.>

## Context engineering

<Describe what pre-hydration fetches, which scoped rule files apply, and
any MCP tools the blueprint configures for this task class.>

## When NOT to use this Blueprint

<List 2–4 task shapes this Blueprint is not suited for, and what to use instead.>
```

## Design principles

Apply all of the following when designing a Blueprint:

1. **Front-load determinism.** Every Blueprint starts with one or more
deterministic nodes that gather *all* context the agentic nodes will need.
An agentic node that has to go fetch its own context is a design smell.

2. **Minimize agentic surface.** The agentic node should receive a fully
assembled context packet and a precise instruction. It should not need to
explore, discover, or decide *what* to do — only *how* to do it.

3. **Hard retry cap ≤ 2.** Empirically, LLMs show diminishing marginal returns
when retrying the same failure. Cap at 2 agentic passes per Blueprint run.
If 2 passes are not enough, the Blueprint is either scope-creeping or the
task requires human intervention.

4. **Encode small decisions deterministically.** If a decision has < 4 branches
and each branch is concrete (e.g. "if package.json exists, run npm; elif
pyproject.toml exists, run uv; else abort"), put it in a deterministic node.
Do not pay LLM tokens for it.

5. **Scoped context, not global context.** Each agent node receives only the
context relevant to that node. Do not dump the entire repository into the
context window.

6. **Explicit exit conditions.** Every agentic node must have a crisp exit
condition: a specific artifact it produces, a file it writes, a structured
output it emits. "When the agent feels done" is not an exit condition.

7. **Epilogue is always deterministic.** The last node in every Blueprint is
a deterministic report/submit step. The agent never decides whether to push
or open a PR — that is encoded in the Blueprint.

## Example: "dependency-upgrade" Blueprint skeleton

Walk through this example to calibrate your output before designing a new one.

```
[D] Pre-hydrate
- Fetch the linked issue or Slack thread
- Identify the package name and target version
- Run `npm outdated` / `pip list --outdated` to confirm current version
- Read CHANGELOG for the target version from the registry

[A] Implement upgrade
- Instruction: "Update <package> to <version> in all manifest files.
Apply any breaking-change migrations documented in the CHANGELOG you
were given. Do not upgrade unrelated packages."
- Exit condition: all manifest files updated, lockfile regenerated

[D] Verify
- Run type checker
- Run unit tests (--fast flag if available)
- Capture pass/fail per tool

[A] Fix (if failures, once only)
- Instruction: "The following checker output came from your upgrade.
Apply the minimal fix. Do not change unrelated code."
- Exit condition: checkers pass or cap reached

[D] Report
- Emit structured Minion result block
- Stage diff for human review
```

## What to do

1. Ask clarifying questions ONLY if the task class is genuinely underspecified
(missing trigger, missing exit condition, or ambiguous scope). Otherwise
produce the Blueprint immediately.
2. Output the full Blueprint document in the format above.
3. After the Blueprint, add a brief **Design rationale** section (3–5 bullets)
explaining the key decisions made, especially where you chose deterministic
over agentic or constrained the retry cap.
4. Do not generate code, scripts, or actual file edits — this agent designs
Blueprints only.
Loading