@bastani/atomic 0.8.24-alpha.2 → 0.8.24-alpha.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/README.md +2 -1
- package/dist/builtin/intercom/CHANGELOG.md +12 -0
- package/dist/builtin/intercom/package.json +1 -1
- package/dist/builtin/mcp/CHANGELOG.md +12 -0
- package/dist/builtin/mcp/package.json +1 -1
- package/dist/builtin/subagents/CHANGELOG.md +16 -0
- package/dist/builtin/subagents/README.md +132 -21
- package/dist/builtin/subagents/package.json +1 -1
- package/dist/builtin/subagents/prompts/parallel-context-build.md +4 -2
- package/dist/builtin/subagents/prompts/parallel-handoff-plan.md +3 -1
- package/dist/builtin/subagents/skills/subagent/SKILL.md +49 -11
- package/dist/builtin/subagents/src/agents/agent-management.ts +79 -16
- package/dist/builtin/subagents/src/agents/agents.ts +47 -16
- package/dist/builtin/subagents/src/agents/chain-serializer.ts +114 -0
- package/dist/builtin/subagents/src/extension/schemas.ts +139 -3
- package/dist/builtin/subagents/src/runs/background/async-execution.ts +92 -6
- package/dist/builtin/subagents/src/runs/background/async-status.ts +11 -1
- package/dist/builtin/subagents/src/runs/background/run-status.ts +4 -1
- package/dist/builtin/subagents/src/runs/background/subagent-runner.ts +529 -32
- package/dist/builtin/subagents/src/runs/foreground/chain-execution.ts +361 -118
- package/dist/builtin/subagents/src/runs/foreground/execution.ts +75 -7
- package/dist/builtin/subagents/src/runs/foreground/subagent-executor.ts +33 -0
- package/dist/builtin/subagents/src/runs/shared/acceptance.ts +611 -0
- package/dist/builtin/subagents/src/runs/shared/chain-outputs.ts +101 -0
- package/dist/builtin/subagents/src/runs/shared/dynamic-fanout.ts +293 -0
- package/dist/builtin/subagents/src/runs/shared/parallel-utils.ts +29 -1
- package/dist/builtin/subagents/src/runs/shared/pi-args.ts +11 -0
- package/dist/builtin/subagents/src/runs/shared/structured-output.ts +79 -0
- package/dist/builtin/subagents/src/runs/shared/subagent-prompt-runtime.ts +52 -2
- package/dist/builtin/subagents/src/runs/shared/workflow-graph.ts +206 -0
- package/dist/builtin/subagents/src/shared/formatters.ts +2 -2
- package/dist/builtin/subagents/src/shared/settings.ts +53 -4
- package/dist/builtin/subagents/src/shared/types.ts +226 -0
- package/dist/builtin/subagents/src/shared/utils.ts +2 -1
- package/dist/builtin/subagents/src/slash/slash-commands.ts +41 -3
- package/dist/builtin/subagents/src/tui/render.ts +152 -34
- package/dist/builtin/web-access/CHANGELOG.md +12 -0
- package/dist/builtin/web-access/package.json +1 -1
- package/dist/builtin/workflows/CHANGELOG.md +12 -0
- package/dist/builtin/workflows/package.json +1 -1
- package/dist/builtin/workflows/skills/create-spec/SKILL.md +1 -1
- package/dist/builtin/workflows/src/tui/stage-chat-view.ts +0 -1
- package/dist/core/slash-commands.d.ts.map +1 -1
- package/dist/core/slash-commands.js +1 -0
- package/dist/core/slash-commands.js.map +1 -1
- package/dist/core/system-prompt.d.ts.map +1 -1
- package/dist/core/system-prompt.js +4 -3
- package/dist/core/system-prompt.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +1 -1
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/docs/usage.md +1 -0
- package/docs/workflows.md +173 -0
- package/node_modules/@earendil-works/pi-tui/README.md +779 -0
- package/node_modules/@earendil-works/pi-tui/dist/autocomplete.d.ts +54 -0
- package/node_modules/@earendil-works/pi-tui/dist/autocomplete.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/autocomplete.js +632 -0
- package/node_modules/@earendil-works/pi-tui/dist/autocomplete.js.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/box.d.ts +22 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/box.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/box.js +104 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/box.js.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/cancellable-loader.d.ts +22 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/cancellable-loader.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/cancellable-loader.js +35 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/cancellable-loader.js.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/editor.d.ts +249 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/editor.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/editor.js +1857 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/editor.js.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/image.d.ts +28 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/image.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/image.js +89 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/image.js.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/input.d.ts +37 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/input.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/input.js +378 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/input.js.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/loader.d.ts +31 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/loader.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/loader.js +69 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/loader.js.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/markdown.d.ts +96 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/markdown.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/markdown.js +644 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/markdown.js.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/select-list.d.ts +50 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/select-list.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/select-list.js +159 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/select-list.js.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/settings-list.d.ts +50 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/settings-list.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/settings-list.js +185 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/settings-list.js.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/spacer.d.ts +12 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/spacer.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/spacer.js +23 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/spacer.js.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/text.d.ts +19 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/text.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/text.js +89 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/text.js.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/truncated-text.d.ts +13 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/truncated-text.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/truncated-text.js +51 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/truncated-text.js.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/editor-component.d.ts +39 -0
- package/node_modules/@earendil-works/pi-tui/dist/editor-component.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/editor-component.js +2 -0
- package/node_modules/@earendil-works/pi-tui/dist/editor-component.js.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/fuzzy.d.ts +16 -0
- package/node_modules/@earendil-works/pi-tui/dist/fuzzy.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/fuzzy.js +110 -0
- package/node_modules/@earendil-works/pi-tui/dist/fuzzy.js.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/index.d.ts +23 -0
- package/node_modules/@earendil-works/pi-tui/dist/index.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/index.js +32 -0
- package/node_modules/@earendil-works/pi-tui/dist/index.js.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/keybindings.d.ts +193 -0
- package/node_modules/@earendil-works/pi-tui/dist/keybindings.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/keybindings.js +174 -0
- package/node_modules/@earendil-works/pi-tui/dist/keybindings.js.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/keys.d.ts +184 -0
- package/node_modules/@earendil-works/pi-tui/dist/keys.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/keys.js +1173 -0
- package/node_modules/@earendil-works/pi-tui/dist/keys.js.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/kill-ring.d.ts +28 -0
- package/node_modules/@earendil-works/pi-tui/dist/kill-ring.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/kill-ring.js +44 -0
- package/node_modules/@earendil-works/pi-tui/dist/kill-ring.js.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/native-modifiers.d.ts +3 -0
- package/node_modules/@earendil-works/pi-tui/dist/native-modifiers.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/native-modifiers.js +53 -0
- package/node_modules/@earendil-works/pi-tui/dist/native-modifiers.js.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/stdin-buffer.d.ts +50 -0
- package/node_modules/@earendil-works/pi-tui/dist/stdin-buffer.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/stdin-buffer.js +361 -0
- package/node_modules/@earendil-works/pi-tui/dist/stdin-buffer.js.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/terminal-image.d.ts +90 -0
- package/node_modules/@earendil-works/pi-tui/dist/terminal-image.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/terminal-image.js +366 -0
- package/node_modules/@earendil-works/pi-tui/dist/terminal-image.js.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/terminal.d.ts +113 -0
- package/node_modules/@earendil-works/pi-tui/dist/terminal.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/terminal.js +472 -0
- package/node_modules/@earendil-works/pi-tui/dist/terminal.js.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/tui.d.ts +227 -0
- package/node_modules/@earendil-works/pi-tui/dist/tui.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/tui.js +1106 -0
- package/node_modules/@earendil-works/pi-tui/dist/tui.js.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/undo-stack.d.ts +17 -0
- package/node_modules/@earendil-works/pi-tui/dist/undo-stack.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/undo-stack.js +25 -0
- package/node_modules/@earendil-works/pi-tui/dist/undo-stack.js.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/utils.d.ts +84 -0
- package/node_modules/@earendil-works/pi-tui/dist/utils.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/utils.js +1029 -0
- package/node_modules/@earendil-works/pi-tui/dist/utils.js.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/word-navigation.d.ts +25 -0
- package/node_modules/@earendil-works/pi-tui/dist/word-navigation.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/word-navigation.js +96 -0
- package/node_modules/@earendil-works/pi-tui/dist/word-navigation.js.map +1 -0
- package/node_modules/@earendil-works/pi-tui/native/darwin/prebuilds/darwin-arm64/darwin-modifiers.node +0 -0
- package/node_modules/@earendil-works/pi-tui/native/darwin/prebuilds/darwin-x64/darwin-modifiers.node +0 -0
- package/node_modules/@earendil-works/pi-tui/native/win32/prebuilds/win32-arm64/win32-console-mode.node +0 -0
- package/node_modules/@earendil-works/pi-tui/native/win32/prebuilds/win32-x64/win32-console-mode.node +0 -0
- package/node_modules/@earendil-works/pi-tui/package.json +47 -0
- package/node_modules/get-east-asian-width/index.d.ts +60 -0
- package/node_modules/get-east-asian-width/index.js +30 -0
- package/node_modules/get-east-asian-width/license +9 -0
- package/node_modules/get-east-asian-width/lookup-data.js +21 -0
- package/node_modules/get-east-asian-width/lookup.js +138 -0
- package/node_modules/get-east-asian-width/package.json +71 -0
- package/node_modules/get-east-asian-width/readme.md +65 -0
- package/node_modules/get-east-asian-width/utilities.js +24 -0
- package/node_modules/marked/LICENSE.md +44 -0
- package/node_modules/marked/README.md +106 -0
- package/node_modules/marked/bin/main.js +282 -0
- package/node_modules/marked/bin/marked.js +15 -0
- package/node_modules/marked/lib/marked.cjs +2211 -0
- package/node_modules/marked/lib/marked.cjs.map +7 -0
- package/node_modules/marked/lib/marked.d.cts +728 -0
- package/node_modules/marked/lib/marked.d.ts +728 -0
- package/node_modules/marked/lib/marked.esm.js +2189 -0
- package/node_modules/marked/lib/marked.esm.js.map +7 -0
- package/node_modules/marked/lib/marked.umd.js +2213 -0
- package/node_modules/marked/lib/marked.umd.js.map +7 -0
- package/node_modules/marked/man/marked.1 +111 -0
- package/node_modules/marked/man/marked.1.md +92 -0
- package/node_modules/marked/marked.min.js +69 -0
- package/node_modules/marked/package.json +111 -0
- package/package.json +9 -1
package/docs/usage.md
CHANGED
|
@@ -55,6 +55,7 @@ Type `/` in the editor to open command completion. Extensions can register custo
|
|
|
55
55
|
| `/reload` | Reload keybindings, extensions, skills, prompts, and context files |
|
|
56
56
|
| `/hotkeys` | Show all keyboard shortcuts |
|
|
57
57
|
| `/changelog` | Display version history |
|
|
58
|
+
| `/exit` | Exit Atomic |
|
|
58
59
|
| `/quit` | Quit Atomic |
|
|
59
60
|
|
|
60
61
|
## Message Queue
|
package/docs/workflows.md
CHANGED
|
@@ -30,6 +30,7 @@ Use a workflow when a task should be repeatable, inspectable, resumable, or spli
|
|
|
30
30
|
- [Quick Start](#quick-start)
|
|
31
31
|
- [Built-in Workflows](#built-in-workflows)
|
|
32
32
|
- [When to Use Workflows](#when-to-use-workflows)
|
|
33
|
+
- [Workflow Starter Patterns](#workflow-starter-patterns)
|
|
33
34
|
- [Atomic vs Claude Code Dynamic Workflows](#atomic-vs-claude-code-dynamic-workflows)
|
|
34
35
|
- [Workflow Locations](#workflow-locations)
|
|
35
36
|
- [Workflow Configuration](#workflow-configuration)
|
|
@@ -382,6 +383,177 @@ If the task is only deterministic TypeScript with no LLM/session stage, use a sc
|
|
|
382
383
|
| Track one-off work without saving a workflow file | direct `workflow({ task })`, `workflow({ tasks })`, or `workflow({ chain })` calls |
|
|
383
384
|
| Make a workflow robust | design the stage graph, context handoffs, artifacts, validation gates, model fallbacks, and human approval points before coding |
|
|
384
385
|
|
|
386
|
+
## Workflow Starter Patterns
|
|
387
|
+
|
|
388
|
+
When a workflow is larger than a single tracked task, start by choosing a small control-flow pattern before writing prompts. Naming the pattern keeps the stage graph understandable, makes validation gates explicit, and helps reviewers see why work is split across model sessions.
|
|
389
|
+
|
|
390
|
+
These patterns are composable. For example, a migration workflow might use **fan-out-and-synthesize** to fix many call sites, then **adversarial verification** to review each patch, and finally **loop until done** while tests still fail.
|
|
391
|
+
|
|
392
|
+
| Pattern | Use it when | Atomic shape |
|
|
393
|
+
|---|---|---|
|
|
394
|
+
| **Classify-and-act** | Inputs arrive in different categories and each category needs a different path, model, tool set, or output format. | `ctx.task("classify")` → deterministic branch → category-specific `ctx.task`, `ctx.chain`, `ctx.parallel`, or child `ctx.workflow(...)`. |
|
|
395
|
+
| **Fan-out-and-synthesize** | The task can be split into many independent slices that benefit from clean context windows. | `ctx.parallel([...])` with separate artifacts → synthesis barrier that reads the artifacts and merges the answer. |
|
|
396
|
+
| **Adversarial verification** | Outputs need independent checking against a rubric, security rule, factual source, or acceptance contract. | Worker stage(s) → fresh-context verifier stage(s) → reducer that accepts, rejects, or asks for repair. |
|
|
397
|
+
| **Generate-and-filter** | You need many candidate ideas, plans, names, fixes, or hypotheses before selecting the best few. | Generator fan-out → dedupe/filter stage → optional verifier/judge → final shortlist. |
|
|
398
|
+
| **Tournament** | The whole task is subjective or approach-sensitive, and comparative judgment is more reliable than absolute scoring. | Several agents attempt the same task → pairwise judges compare results → bracket reducer returns winners. |
|
|
399
|
+
| **Loop until done** | The amount of work is unknown up front, such as finding all failures, mining repeated issues, or iterating until checks pass. | Bounded loop with an explicit stop condition, progress ledger, per-iteration artifacts, and a max-iteration escape hatch. |
|
|
400
|
+
|
|
401
|
+
### Pattern diagrams
|
|
402
|
+
|
|
403
|
+
#### 1. Classify-and-act
|
|
404
|
+
|
|
405
|
+
```text
|
|
406
|
+
┌─ 1 Classify-and-act ────────────────────────────────────┐
|
|
407
|
+
│ │
|
|
408
|
+
│ ┌───────┐ │
|
|
409
|
+
│ ╭──▸│agent A│ │
|
|
410
|
+
│ │ └───────┘ │
|
|
411
|
+
│ ┌────┐ ┌──────────┐ │ ┌───────┐ │
|
|
412
|
+
│ │task│─▸│classifier│───┼──▸│agent B│ ◂ chosen │
|
|
413
|
+
│ └────┘ └──────────┘ │ └───────┘ │
|
|
414
|
+
│ │ ┌───────┐ │
|
|
415
|
+
│ ╰──▸│agent C│ │
|
|
416
|
+
│ └───────┘ │
|
|
417
|
+
│ │
|
|
418
|
+
└──────────────────────────────────────────────────────────┘
|
|
419
|
+
```
|
|
420
|
+
|
|
421
|
+
Best practices:
|
|
422
|
+
- Make the classifier return a structured category and confidence, not free-form prose.
|
|
423
|
+
- Keep each action branch isolated with the minimum tools and context it needs.
|
|
424
|
+
- Add a fallback or human-input branch for low-confidence classifications.
|
|
425
|
+
|
|
426
|
+
#### 2. Fan-out-and-synthesize
|
|
427
|
+
|
|
428
|
+
```text
|
|
429
|
+
┌─ 2 Fan-out-and-synthesize ──────────────────────────────┐
|
|
430
|
+
│ │
|
|
431
|
+
│ ┌───────┐ │
|
|
432
|
+
│ ╭▸│agent 1│──╮ │
|
|
433
|
+
│ │ └───────┘ │ │
|
|
434
|
+
│ │ ┌───────┐ │ │
|
|
435
|
+
│ ├▸│agent 2│──┤ │
|
|
436
|
+
│ ┌────┐ │ └───────┘ │ ┌───────┐ ┌──────────┐ │
|
|
437
|
+
│ │task│──┤ ┌───────┐ ├▸│barrier│─▸│synthesize│ │
|
|
438
|
+
│ └────┘ ├▸│agent 3│──┤ └───────┘ └──────────┘ │
|
|
439
|
+
│ │ └───────┘ │ │
|
|
440
|
+
│ │ ┌───────┐ │ │
|
|
441
|
+
│ ╰▸│agent 4│──╯ │
|
|
442
|
+
│ └───────┘ │
|
|
443
|
+
│ │
|
|
444
|
+
└──────────────────────────────────────────────────────────┘
|
|
445
|
+
```
|
|
446
|
+
|
|
447
|
+
Best practices:
|
|
448
|
+
- Partition by files, sources, claims, candidates, or work items that can be evaluated independently.
|
|
449
|
+
- Save each branch to a separate artifact and pass paths with `reads` instead of inlining all branch output.
|
|
450
|
+
- Treat synthesis as a barrier: it waits for every branch, deduplicates, resolves conflicts, and cites evidence.
|
|
451
|
+
|
|
452
|
+
#### 3. Adversarial verification
|
|
453
|
+
|
|
454
|
+
```text
|
|
455
|
+
┌─ 3 Adversarial verification ────────────────────────────┐
|
|
456
|
+
│ │
|
|
457
|
+
│ │
|
|
458
|
+
│ ┌──────────┐ │
|
|
459
|
+
│ ├────────────────▸│verifier A│ │
|
|
460
|
+
│ │ └──────────┘ │
|
|
461
|
+
│ ┌──────┐ │ ┌──────────┐ │
|
|
462
|
+
│ │worker│◂────┼────────────────▸│verifier B│ │
|
|
463
|
+
│ └──────┘ │ └──────────┘ │
|
|
464
|
+
│ │ ┌──────────┐ │
|
|
465
|
+
│ ├────────────────▸│verifier C│ │
|
|
466
|
+
│ └──────────┘ │
|
|
467
|
+
│ │
|
|
468
|
+
└──────────────────────────────────────────────────────────┘
|
|
469
|
+
```
|
|
470
|
+
|
|
471
|
+
Best practices:
|
|
472
|
+
- Give verifiers fresh context and a concrete rubric with pass/fail evidence requirements.
|
|
473
|
+
- Separate production from judgment to reduce self-preferential bias.
|
|
474
|
+
- Ask verifiers to find blockers, not to rewrite the candidate unless repair is explicitly their role.
|
|
475
|
+
|
|
476
|
+
#### 4. Generate-and-filter
|
|
477
|
+
|
|
478
|
+
```text
|
|
479
|
+
┌─ 4 Generate-and-filter ─────────────────────────────────┐
|
|
480
|
+
│ │
|
|
481
|
+
│ │
|
|
482
|
+
│ ┌─────┐ ┌────┐ ┌────┐ │
|
|
483
|
+
│ │gen A│──▸│idea│───╮ ╭──▸│best│ │
|
|
484
|
+
│ └─────┘ └────┘ │ │ └────┘ │
|
|
485
|
+
│ ┌─────┐ ┌────┐ │ ┌──────┐ │ ┌────┐ │
|
|
486
|
+
│ │gen B│──▸│idea│───┼─▸│filter│────┼──▸│best│ │
|
|
487
|
+
│ └─────┘ └────┘ │ └──────┘ │ └────┘ │
|
|
488
|
+
│ ┌─────┐ ┌────┐ │ │ ┌╌╌╌╌╌╌╌╌╌┐ │
|
|
489
|
+
│ │gen C│──▸│idea│───╯ ╰──▸╎discarded╎ │
|
|
490
|
+
│ └─────┘ └────┘ └╌╌╌╌╌╌╌╌╌┘ │
|
|
491
|
+
│ │
|
|
492
|
+
└──────────────────────────────────────────────────────────┘
|
|
493
|
+
```
|
|
494
|
+
|
|
495
|
+
Best practices:
|
|
496
|
+
- Generate more candidates than you need, then filter hard by an explicit rubric.
|
|
497
|
+
- Dedupe before judging so near-identical candidates do not dominate the shortlist.
|
|
498
|
+
- Use this for exploration, naming, design options, hypotheses, and lightweight eval ideas.
|
|
499
|
+
|
|
500
|
+
#### 5. Tournament
|
|
501
|
+
|
|
502
|
+
```text
|
|
503
|
+
┌─ 5 Tournament ──────────────────────────────────────────┐
|
|
504
|
+
│ │
|
|
505
|
+
│ ┌─────────┐ │
|
|
506
|
+
│ │attempt A│──╮ ┌───────┐ │
|
|
507
|
+
│ └─────────┘ ├─▸│judge 1│───╮ │
|
|
508
|
+
│ ┌─────────┐ │ └───────┘ │ │
|
|
509
|
+
│ │attempt B│──╯ │ ┌─────┐ ┌──────┐ │
|
|
510
|
+
│ └─────────┘ ├──▸│final│─▸│winner│ │
|
|
511
|
+
│ ┌─────────┐ │ └─────┘ └──────┘ │
|
|
512
|
+
│ │attempt C│──╮ ┌───────┐ │ │
|
|
513
|
+
│ └─────────┘ ├─▸│judge 2│───╯ │
|
|
514
|
+
│ ┌─────────┐ │ └───────┘ │
|
|
515
|
+
│ │attempt D│──╯ │
|
|
516
|
+
│ └─────────┘ │
|
|
517
|
+
│ │
|
|
518
|
+
└──────────────────────────────────────────────────────────┘
|
|
519
|
+
```
|
|
520
|
+
|
|
521
|
+
Best practices:
|
|
522
|
+
- Use pairwise comparison when absolute scores are noisy or subjective.
|
|
523
|
+
- Randomize or balance presentation order where possible to reduce order bias.
|
|
524
|
+
- Keep the judge rubric short and require rationale tied to observable criteria.
|
|
525
|
+
|
|
526
|
+
#### 6. Loop until done
|
|
527
|
+
|
|
528
|
+
```text
|
|
529
|
+
┌─ 6 Loop until done ─────────────────────────────────────┐
|
|
530
|
+
│ │
|
|
531
|
+
│ yes, spawn another │
|
|
532
|
+
│ ╭────────────────╮ │
|
|
533
|
+
│ ▾ │ │
|
|
534
|
+
│ ┌─────┐ ┌─────────────┐ no ┌────┐ │
|
|
535
|
+
│ │agent│─────▸│new findings?│──────▸│done│ │
|
|
536
|
+
│ └─────┘ └─────────────┘ └────┘ │
|
|
537
|
+
│ │
|
|
538
|
+
└──────────────────────────────────────────────────────────┘
|
|
539
|
+
```
|
|
540
|
+
|
|
541
|
+
Best practices:
|
|
542
|
+
- Define both success and escape conditions before the loop starts.
|
|
543
|
+
- Keep a durable ledger of attempted work, findings, failures, and validation evidence.
|
|
544
|
+
- Bound loops by iterations, budget, or convergence criteria so they fail inspectably instead of drifting.
|
|
545
|
+
|
|
546
|
+
### Choosing a starter pattern
|
|
547
|
+
|
|
548
|
+
- Pick **classify-and-act** when routing correctness matters more than breadth.
|
|
549
|
+
- Pick **fan-out-and-synthesize** when the work divides cleanly into independent slices.
|
|
550
|
+
- Pick **adversarial verification** when the main risk is a plausible but wrong answer.
|
|
551
|
+
- Pick **generate-and-filter** when the output quality depends on exploring a large option space.
|
|
552
|
+
- Pick **tournament** when multiple whole-solution strategies should compete under one rubric.
|
|
553
|
+
- Pick **loop until done** when the workflow should continue until evidence says it is finished, not until a preselected number of stages completes.
|
|
554
|
+
|
|
555
|
+
Record the selected pattern in your spec or workflow README, then adapt the diagram to the actual stage graph. If the final design does not resemble any starter pattern, explain why in the workflow's design notes.
|
|
556
|
+
|
|
385
557
|
## Atomic vs Claude Code Dynamic Workflows
|
|
386
558
|
|
|
387
559
|
Claude Code Dynamic Workflows and Atomic are trying to solve a similar class of problem: important software engineering work is too large for one agent pass, so the system should split the job into stages, run agents in parallel, verify the result, and keep enough state to finish long-running work.
|
|
@@ -1438,6 +1610,7 @@ Before implementing or shipping a non-trivial workflow, answer these questions:
|
|
|
1438
1610
|
|
|
1439
1611
|
- **Purpose and fit:** What concrete outcome should the workflow produce? Is the task naturally multi-stage, parallel, resumable, or reusable? What is out of scope?
|
|
1440
1612
|
- **Inputs:** Which values should be declared as inputs? What is the narrowest schema type? Which defaults are safe?
|
|
1613
|
+
- **Starter pattern:** Which [workflow starter pattern](#workflow-starter-patterns) best matches the task, and where does the actual design intentionally diverge?
|
|
1441
1614
|
- **Stage decomposition:** For each stage, what question does it answer, what context does it need, what output should it return, and what model/tool/MCP requirements does it have?
|
|
1442
1615
|
- **Information flow:** For every edge between stages, is `previous` enough, or should the handoff use structured returns, files, `reads`, `output`, or `outputMode`?
|
|
1443
1616
|
- **Output contract:** Which outputs should be declared with `.output(...)`, which stage/task/child results should `.run()` return for those keys, and what runtime type must each value have? If another workflow may call this workflow as a child, which non-default outputs should the parent rely on?
|