extensions/open-prose/skills/prose/examples/README.md
These examples demonstrate workflows using OpenProse's full feature set.
| File | Description |
|---|---|
01-hello-world.prose | Simplest possible program - a single session |
02-research-and-summarize.prose | Research a topic, then summarize findings |
03-code-review.prose | Multi-perspective code review pipeline |
04-write-and-refine.prose | Draft content and iteratively improve it |
05-debug-issue.prose | Step-by-step debugging workflow |
06-explain-codebase.prose | Progressive exploration of a codebase |
07-refactor.prose | Systematic refactoring workflow |
08-blog-post.prose | End-to-end content creation |
| File | Description |
|---|---|
09-research-with-agents.prose | Custom agents with model selection |
10-code-review-agents.prose | Specialized reviewer agents |
11-skills-and-imports.prose | External skill imports |
12-secure-agent-permissions.prose | Agent permissions and access control |
| File | Description |
|---|---|
13-variables-and-context.prose | let/const bindings, context passing |
14-composition-blocks.prose | Named blocks, do blocks |
15-inline-sequences.prose | Arrow operator chains |
| File | Description |
|---|---|
16-parallel-reviews.prose | Basic parallel execution |
17-parallel-research.prose | Named parallel results |
18-mixed-parallel-sequential.prose | Combined parallel and sequential patterns |
19-advanced-parallel.prose | Join strategies, failure policies |
| File | Description |
|---|---|
20-fixed-loops.prose | repeat, for-each, parallel for patterns |
| File | Description |
|---|---|
21-pipeline-operations.prose | map, filter, reduce, pmap transformations |
| File | Description |
|---|---|
22-error-handling.prose | try/catch/finally patterns |
23-retry-with-backoff.prose | Resilient API calls with retry/backoff |
| File | Description |
|---|---|
24-choice-blocks.prose | AI-selected branching |
25-conditionals.prose | if/elif/else patterns |
26-parameterized-blocks.prose | Reusable blocks with arguments |
27-string-interpolation.prose | Dynamic prompts with {var} syntax |
| File | Description |
|---|---|
28-gas-town.prose | Multi-agent orchestration ("Kubernetes for agents") with 7 worker roles, patrols, convoys, and GUPP propulsion |
29-captains-chair.prose | Full captain's chair pattern: coordinating agent dispatches subagents for all work, with parallel research, critic review cycles, and checkpoint validation |
30-captains-chair-simple.prose | Minimal captain's chair: core pattern without complexity |
31-captains-chair-with-memory.prose | Captain's chair with retrospective analysis and session-to-session learning |
| File | Description |
|---|---|
33-pr-review-autofix.prose | Automated PR review with fix suggestions |
34-content-pipeline.prose | End-to-end content creation pipeline |
35-feature-factory.prose | Feature implementation automation |
36-bug-hunter.prose | Systematic bug detection and analysis |
37-the-forge.prose | Build a browser from scratch |
38-skill-scan.prose | Skill discovery and analysis |
| File | Description |
|---|---|
39-architect-by-simulation.prose | Design systems through simulated implementation phases with serial handoffs and persistent architect |
| File | Description |
|---|---|
40-rlm-self-refine.prose | Recursive refinement until quality threshold - the core RLM pattern |
41-rlm-divide-conquer.prose | Hierarchical chunking for inputs beyond context limits |
42-rlm-filter-recurse.prose | Filter-then-process for needle-in-haystack tasks |
43-rlm-pairwise.prose | O(n^2) pairwise aggregation for relationship mapping |
| File | Description |
|---|---|
44-run-endpoint-ux-test.prose | Concurrent agents testing the /run API endpoint |
45-plugin-release.prose | OpenProse plugin release workflow (this repo) |
46-workflow-crystallizer.prose | Reflective: observes thread, extracts workflow, writes .prose |
47-language-self-improvement.prose | Meta-level 2: analyzes .prose corpus to evolve the language itself |
48-habit-miner.prose | Mines AI session logs for patterns, generates .prose automations |
The architect-by-simulation pattern is for designing systems by "implementing" them through reasoning. Instead of writing code, each phase produces specification documents that the next phase builds upon.
Key principles:
# The core pattern
agent architect:
model: opus
persist: true
prompt: "Design by simulating implementation"
# Create master plan with phases
let plan = session: architect
prompt: "Break feature into design phases"
# User reviews the plan BEFORE the pipeline runs
input user_approval: "User reviews plan and approves"
# Execute phases serially with handoffs
for phase_name, index in phases:
let handoff = session: phase-executor
prompt: "Execute phase {index}"
context: previous_handoffs
# Architect synthesizes after each phase
resume: architect
prompt: "Synthesize learnings from phase {index}"
context: handoff
# Synthesize all handoffs into final spec
output spec = session: architect
prompt: "Synthesize all handoffs into final spec"
See example 39 for the full implementation.
The captain's chair is an orchestration paradigm where a coordinating agent (the "captain") dispatches specialized subagents for all execution. The captain never writes code directly—only plans, coordinates, and validates.
Key principles:
# The core pattern
agent captain:
model: opus
prompt: "Coordinate but never execute directly"
agent executor:
model: sonnet
prompt: "Execute assigned tasks precisely"
agent critic:
model: sonnet
prompt: "Review work and find issues"
# Captain plans
let plan = session: captain
prompt: "Break down this task"
# Parallel execution with criticism
parallel:
work = session: executor
context: plan
review = session: critic
context: plan
# Captain validates
output result = session: captain
prompt: "Validate and integrate"
context: { work, review }
See examples 29-31 for full implementations.
Recursive Language Models (RLMs) are a paradigm for handling inputs far beyond context limits. The key insight: treat the prompt as an external environment that the LLM can symbolically interact with, chunk, and recursively process.
Why RLMs matter:
Key patterns:
# The core RLM pattern: recursive block with scope isolation
block process(data, depth):
# Base case
if **data is small** or depth <= 0:
output session "Process directly"
context: data
# Recursive case: chunk and fan out
let chunks = session "Split into logical chunks"
context: data
parallel for chunk in chunks:
do process(chunk, depth - 1) # Recursive call
# Aggregate results (fan in)
output session "Synthesize partial results"
OpenProse advantages for RLMs:
execution_id, preventing variable collisionsparallel for enables concurrent processing at each recursion level| reduce) and explicit context passingSee examples 40-43 for full implementations.
Ask Claude to run any example:
Run the code review example from the OpenProse examples
Or reference the file directly:
Execute examples/03-code-review.prose
# Comments
session "prompt" # Simple session
let x = session "..." # Variable binding
const y = session "..." # Immutable binding
agent name:
model: sonnet # haiku, sonnet, opus
prompt: "System prompt"
skills: ["skill1", "skill2"]
permissions:
read: ["*.md"]
bash: deny
parallel: # Basic parallel
a = session "A"
b = session "B"
parallel ("first"): # Race - first wins
parallel ("any", count: 2): # Wait for N successes
parallel (on-fail: "continue"): # Don't fail on errors
repeat 3: # Fixed iterations
session "..."
for item in items: # For-each
session "..."
parallel for item in items: # Parallel for-each
session "..."
loop until **condition** (max: 10): # Unbounded with AI condition
session "..."
items | map: # Transform each
session "..."
items | filter: # Keep matching
session "..."
items | reduce(acc, x): # Accumulate
session "..."
items | pmap: # Parallel transform
session "..."
try:
session "..."
catch as err:
session "..."
finally:
session "..."
session "..."
retry: 3
backoff: "exponential" # none, linear, exponential
throw "message" # Raise error
if **condition**:
session "..."
elif **other condition**:
session "..."
else:
session "..."
choice **criteria**:
option "Label A":
session "..."
option "Label B":
session "..."
block name(param): # Define with parameters
session "... {param} ..."
do name("value") # Invoke with arguments
let x = session "Get value"
session "Use {x} in prompt" # Single-line
session """ # Multi-line
Multi-line prompt with {x}
"""
See compiler.md in the skill directory for the complete language specification.