[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-openclaw-openclaw-extensions-open-prose-skills-prose":3},{"error":4,"detail":5,"metadata":398,"markdownContent":400,"rawMarkdown":395},false,{"repo_full_name":6,"owner":7,"repo_name":7,"repo_forks":8,"skill_path":9,"repo_stars":10,"name":11,"category_id":12,"description":13,"file_tree":14,"skill_md_content":395,"skill_id":396,"skill_key":397},"openclaw/openclaw","openclaw",62448,"extensions/open-prose/skills/prose",323859,"prose",1,"OpenProse VM skill pack. Activate on any `prose` command, .prose files, or OpenProse mentions; orchestrates multi-agent workflows.",[15,20,24,28,57,61,300,316,320,363,371,375],{"name":16,"path":17,"size":18,"type":19},"LICENSE","extensions/open-prose/skills/prose/LICENSE",1066,"file",{"name":21,"path":22,"size":23,"type":19},"SKILL.md","extensions/open-prose/skills/prose/SKILL.md",15611,{"name":25,"path":26,"size":27,"type":19},"alt-borges.md","extensions/open-prose/skills/prose/alt-borges.md",7127,{"name":29,"path":30,"type":31,"children":32},"alts","extensions/open-prose/skills/prose/alts","folder",[33,37,41,45,49,53],{"name":34,"path":35,"size":36,"type":19},"arabian-nights.md","extensions/open-prose/skills/prose/alts/arabian-nights.md",8207,{"name":38,"path":39,"size":40,"type":19},"borges.md","extensions/open-prose/skills/prose/alts/borges.md",11547,{"name":42,"path":43,"size":44,"type":19},"folk.md","extensions/open-prose/skills/prose/alts/folk.md",10097,{"name":46,"path":47,"size":48,"type":19},"homer.md","extensions/open-prose/skills/prose/alts/homer.md",7596,{"name":50,"path":51,"size":52,"type":19},"kafka.md","extensions/open-prose/skills/prose/alts/kafka.md",11162,{"name":54,"path":55,"size":56,"type":19},"shared-appendix.md","extensions/open-prose/skills/prose/alts/shared-appendix.md",878,{"name":58,"path":59,"size":60,"type":19},"compiler.md","extensions/open-prose/skills/prose/compiler.md",82791,{"name":62,"path":63,"type":31,"children":64},"examples","extensions/open-prose/skills/prose/examples",[65,69,73,77,81,85,89,93,97,101,105,109,113,117,121,125,129,133,137,141,145,149,153,157,161,165,169,173,177,181,185,189,193,197,201,205,209,213,217,221,225,229,233,237,241,245,249,253,257,261,265,269,273],{"name":66,"path":67,"size":68,"type":19},"01-hello-world.prose","extensions/open-prose/skills/prose/examples/01-hello-world.prose",118,{"name":70,"path":71,"size":72,"type":19},"02-research-and-summarize.prose","extensions/open-prose/skills/prose/examples/02-research-and-summarize.prose",355,{"name":74,"path":75,"size":76,"type":19},"03-code-review.prose","extensions/open-prose/skills/prose/examples/03-code-review.prose",821,{"name":78,"path":79,"size":80,"type":19},"04-write-and-refine.prose","extensions/open-prose/skills/prose/examples/04-write-and-refine.prose",643,{"name":82,"path":83,"size":84,"type":19},"05-debug-issue.prose","extensions/open-prose/skills/prose/examples/05-debug-issue.prose",738,{"name":86,"path":87,"size":88,"type":19},"06-explain-codebase.prose","extensions/open-prose/skills/prose/examples/06-explain-codebase.prose",786,{"name":90,"path":91,"size":92,"type":19},"07-refactor.prose","extensions/open-prose/skills/prose/examples/07-refactor.prose",830,{"name":94,"path":95,"size":96,"type":19},"08-blog-post.prose","extensions/open-prose/skills/prose/examples/08-blog-post.prose",840,{"name":98,"path":99,"size":100,"type":19},"09-research-with-agents.prose","extensions/open-prose/skills/prose/examples/09-research-with-agents.prose",890,{"name":102,"path":103,"size":104,"type":19},"10-code-review-agents.prose","extensions/open-prose/skills/prose/examples/10-code-review-agents.prose",1040,{"name":106,"path":107,"size":108,"type":19},"11-skills-and-imports.prose","extensions/open-prose/skills/prose/examples/11-skills-and-imports.prose",888,{"name":110,"path":111,"size":112,"type":19},"12-secure-agent-permissions.prose","extensions/open-prose/skills/prose/examples/12-secure-agent-permissions.prose",1223,{"name":114,"path":115,"size":116,"type":19},"13-variables-and-context.prose","extensions/open-prose/skills/prose/examples/13-variables-and-context.prose",1918,{"name":118,"path":119,"size":120,"type":19},"14-composition-blocks.prose","extensions/open-prose/skills/prose/examples/14-composition-blocks.prose",1112,{"name":122,"path":123,"size":124,"type":19},"15-inline-sequences.prose","extensions/open-prose/skills/prose/examples/15-inline-sequences.prose",647,{"name":126,"path":127,"size":128,"type":19},"16-parallel-reviews.prose","extensions/open-prose/skills/prose/examples/16-parallel-reviews.prose",536,{"name":130,"path":131,"size":132,"type":19},"17-parallel-research.prose","extensions/open-prose/skills/prose/examples/17-parallel-research.prose",565,{"name":134,"path":135,"size":136,"type":19},"18-mixed-parallel-sequential.prose","extensions/open-prose/skills/prose/examples/18-mixed-parallel-sequential.prose",774,{"name":138,"path":139,"size":140,"type":19},"19-advanced-parallel.prose","extensions/open-prose/skills/prose/examples/19-advanced-parallel.prose",2347,{"name":142,"path":143,"size":144,"type":19},"20-fixed-loops.prose","extensions/open-prose/skills/prose/examples/20-fixed-loops.prose",670,{"name":146,"path":147,"size":148,"type":19},"21-pipeline-operations.prose","extensions/open-prose/skills/prose/examples/21-pipeline-operations.prose",1247,{"name":150,"path":151,"size":152,"type":19},"22-error-handling.prose","extensions/open-prose/skills/prose/examples/22-error-handling.prose",1304,{"name":154,"path":155,"size":156,"type":19},"23-retry-with-backoff.prose","extensions/open-prose/skills/prose/examples/23-retry-with-backoff.prose",1529,{"name":158,"path":159,"size":160,"type":19},"24-choice-blocks.prose","extensions/open-prose/skills/prose/examples/24-choice-blocks.prose",2932,{"name":162,"path":163,"size":164,"type":19},"25-conditionals.prose","extensions/open-prose/skills/prose/examples/25-conditionals.prose",3095,{"name":166,"path":167,"size":168,"type":19},"26-parameterized-blocks.prose","extensions/open-prose/skills/prose/examples/26-parameterized-blocks.prose",3135,{"name":170,"path":171,"size":172,"type":19},"27-string-interpolation.prose","extensions/open-prose/skills/prose/examples/27-string-interpolation.prose",3289,{"name":174,"path":175,"size":176,"type":19},"28-automated-pr-review.prose","extensions/open-prose/skills/prose/examples/28-automated-pr-review.prose",1390,{"name":178,"path":179,"size":180,"type":19},"28-gas-town.prose","extensions/open-prose/skills/prose/examples/28-gas-town.prose",48980,{"name":182,"path":183,"size":184,"type":19},"29-captains-chair.prose","extensions/open-prose/skills/prose/examples/29-captains-chair.prose",7921,{"name":186,"path":187,"size":188,"type":19},"30-captains-chair-simple.prose","extensions/open-prose/skills/prose/examples/30-captains-chair-simple.prose",1334,{"name":190,"path":191,"size":192,"type":19},"31-captains-chair-with-memory.prose","extensions/open-prose/skills/prose/examples/31-captains-chair-with-memory.prose",5001,{"name":194,"path":195,"size":196,"type":19},"33-pr-review-autofix.prose","extensions/open-prose/skills/prose/examples/33-pr-review-autofix.prose",4487,{"name":198,"path":199,"size":200,"type":19},"34-content-pipeline.prose","extensions/open-prose/skills/prose/examples/34-content-pipeline.prose",5286,{"name":202,"path":203,"size":204,"type":19},"35-feature-factory.prose","extensions/open-prose/skills/prose/examples/35-feature-factory.prose",7876,{"name":206,"path":207,"size":208,"type":19},"36-bug-hunter.prose","extensions/open-prose/skills/prose/examples/36-bug-hunter.prose",6368,{"name":210,"path":211,"size":212,"type":19},"37-the-forge.prose","extensions/open-prose/skills/prose/examples/37-the-forge.prose",37753,{"name":214,"path":215,"size":216,"type":19},"38-skill-scan.prose","extensions/open-prose/skills/prose/examples/38-skill-scan.prose",16754,{"name":218,"path":219,"size":220,"type":19},"39-architect-by-simulation.prose","extensions/open-prose/skills/prose/examples/39-architect-by-simulation.prose",9555,{"name":222,"path":223,"size":224,"type":19},"40-rlm-self-refine.prose","extensions/open-prose/skills/prose/examples/40-rlm-self-refine.prose",752,{"name":226,"path":227,"size":228,"type":19},"41-rlm-divide-conquer.prose","extensions/open-prose/skills/prose/examples/41-rlm-divide-conquer.prose",917,{"name":230,"path":231,"size":232,"type":19},"42-rlm-filter-recurse.prose","extensions/open-prose/skills/prose/examples/42-rlm-filter-recurse.prose",1209,{"name":234,"path":235,"size":236,"type":19},"43-rlm-pairwise.prose","extensions/open-prose/skills/prose/examples/43-rlm-pairwise.prose",1279,{"name":238,"path":239,"size":240,"type":19},"44-run-endpoint-ux-test.prose","extensions/open-prose/skills/prose/examples/44-run-endpoint-ux-test.prose",8423,{"name":242,"path":243,"size":244,"type":19},"45-plugin-release.prose","extensions/open-prose/skills/prose/examples/45-plugin-release.prose",4654,{"name":246,"path":247,"size":248,"type":19},"45-run-endpoint-ux-test-with-remediation.prose","extensions/open-prose/skills/prose/examples/45-run-endpoint-ux-test-with-remediation.prose",19296,{"name":250,"path":251,"size":252,"type":19},"46-run-endpoint-ux-test-fast.prose","extensions/open-prose/skills/prose/examples/46-run-endpoint-ux-test-fast.prose",4967,{"name":254,"path":255,"size":256,"type":19},"46-workflow-crystallizer.prose","extensions/open-prose/skills/prose/examples/46-workflow-crystallizer.prose",8043,{"name":258,"path":259,"size":260,"type":19},"47-language-self-improvement.prose","extensions/open-prose/skills/prose/examples/47-language-self-improvement.prose",10828,{"name":262,"path":263,"size":264,"type":19},"48-habit-miner.prose","extensions/open-prose/skills/prose/examples/48-habit-miner.prose",13580,{"name":266,"path":267,"size":268,"type":19},"49-prose-run-retrospective.prose","extensions/open-prose/skills/prose/examples/49-prose-run-retrospective.prose",6690,{"name":270,"path":271,"size":272,"type":19},"README.md","extensions/open-prose/skills/prose/examples/README.md",14568,{"name":274,"path":275,"type":31,"children":276},"roadmap","extensions/open-prose/skills/prose/examples/roadmap",[277,280,284,288,292],{"name":270,"path":278,"size":279,"type":19},"extensions/open-prose/skills/prose/examples/roadmap/README.md",960,{"name":281,"path":282,"size":283,"type":19},"iterative-refinement.prose","extensions/open-prose/skills/prose/examples/roadmap/iterative-refinement.prose",464,{"name":285,"path":286,"size":287,"type":19},"parallel-review.prose","extensions/open-prose/skills/prose/examples/roadmap/parallel-review.prose",522,{"name":289,"path":290,"size":291,"type":19},"simple-pipeline.prose","extensions/open-prose/skills/prose/examples/roadmap/simple-pipeline.prose",389,{"name":293,"path":294,"type":31,"children":295},"syntax","extensions/open-prose/skills/prose/examples/roadmap/syntax",[296],{"name":297,"path":298,"size":299,"type":19},"open-prose-syntax.prose","extensions/open-prose/skills/prose/examples/roadmap/syntax/open-prose-syntax.prose",5288,{"name":301,"path":302,"type":31,"children":303},"guidance","extensions/open-prose/skills/prose/guidance",[304,308,312],{"name":305,"path":306,"size":307,"type":19},"antipatterns.md","extensions/open-prose/skills/prose/guidance/antipatterns.md",23766,{"name":309,"path":310,"size":311,"type":19},"patterns.md","extensions/open-prose/skills/prose/guidance/patterns.md",20699,{"name":313,"path":314,"size":315,"type":19},"system-prompt.md","extensions/open-prose/skills/prose/guidance/system-prompt.md",7352,{"name":317,"path":318,"size":319,"type":19},"help.md","extensions/open-prose/skills/prose/help.md",6789,{"name":321,"path":322,"type":31,"children":323},"lib","extensions/open-prose/skills/prose/lib",[324,327,331,335,339,343,347,351,355,359],{"name":270,"path":325,"size":326,"type":19},"extensions/open-prose/skills/prose/lib/README.md",4425,{"name":328,"path":329,"size":330,"type":19},"calibrator.prose","extensions/open-prose/skills/prose/lib/calibrator.prose",6007,{"name":332,"path":333,"size":334,"type":19},"cost-analyzer.prose","extensions/open-prose/skills/prose/lib/cost-analyzer.prose",4884,{"name":336,"path":337,"size":338,"type":19},"error-forensics.prose","extensions/open-prose/skills/prose/lib/error-forensics.prose",6687,{"name":340,"path":341,"size":342,"type":19},"inspector.prose","extensions/open-prose/skills/prose/lib/inspector.prose",5470,{"name":344,"path":345,"size":346,"type":19},"profiler.prose","extensions/open-prose/skills/prose/lib/profiler.prose",15065,{"name":348,"path":349,"size":350,"type":19},"program-improver.prose","extensions/open-prose/skills/prose/lib/program-improver.prose",7774,{"name":352,"path":353,"size":354,"type":19},"project-memory.prose","extensions/open-prose/skills/prose/lib/project-memory.prose",3633,{"name":356,"path":357,"size":358,"type":19},"user-memory.prose","extensions/open-prose/skills/prose/lib/user-memory.prose",2759,{"name":360,"path":361,"size":362,"type":19},"vm-improver.prose","extensions/open-prose/skills/prose/lib/vm-improver.prose",6736,{"name":364,"path":365,"type":31,"children":366},"primitives","extensions/open-prose/skills/prose/primitives",[367],{"name":368,"path":369,"size":370,"type":19},"session.md","extensions/open-prose/skills/prose/primitives/session.md",18669,{"name":372,"path":373,"size":374,"type":19},"prose.md","extensions/open-prose/skills/prose/prose.md",36352,{"name":376,"path":377,"type":31,"children":378},"state","extensions/open-prose/skills/prose/state",[379,383,387,391],{"name":380,"path":381,"size":382,"type":19},"filesystem.md","extensions/open-prose/skills/prose/state/filesystem.md",12875,{"name":384,"path":385,"size":386,"type":19},"in-context.md","extensions/open-prose/skills/prose/state/in-context.md",12860,{"name":388,"path":389,"size":390,"type":19},"postgres.md","extensions/open-prose/skills/prose/state/postgres.md",33789,{"name":392,"path":393,"size":394,"type":19},"sqlite.md","extensions/open-prose/skills/prose/state/sqlite.md",17718,"---\nname: prose\ndescription: OpenProse VM skill pack. Activate on any `prose` command, .prose files, or OpenProse mentions; orchestrates multi-agent workflows.\nmetadata: { \"openclaw\": { \"emoji\": \"🪶\", \"homepage\": \"https://www.prose.md\" } }\n---\n\n# OpenProse Skill\n\nOpenProse is a programming language for AI sessions. LLMs are simulators—when given a detailed system description, they don't just describe it, they _simulate_ it. The `prose.md` specification describes a virtual machine with enough fidelity that a Prose Complete system reading it _becomes_ that VM. Simulation with sufficient fidelity is implementation. **You are the Prose Complete system.**\n\n## OpenClaw Runtime Mapping\n\n- **Task tool** in the upstream spec == OpenClaw `sessions_spawn`\n- **File I/O** == OpenClaw `read`/`write`\n- **Remote fetch** == OpenClaw `web_fetch` (or `exec` with curl when POST is required)\n\n## When to Activate\n\nActivate this skill when the user:\n\n- **Uses ANY `prose` command** (e.g., `prose boot`, `prose run`, `prose compile`, `prose update`, `prose help`, etc.)\n- Asks to run a `.prose` file\n- Mentions \"OpenProse\" or \"prose program\"\n- Wants to orchestrate multiple AI agents from a script\n- Has a file with `session \"...\"` or `agent name:` syntax\n- Wants to create a reusable workflow\n\n## Command Routing\n\nWhen a user invokes `prose \u003Ccommand>`, intelligently route based on intent:\n\n| Command                 | Action                                                        |\n| ----------------------- | ------------------------------------------------------------- |\n| `prose help`            | Load `help.md`, guide user to what they need                  |\n| `prose run \u003Cfile>`      | Load VM (`prose.md` + state backend), execute the program     |\n| `prose run handle/slug` | Fetch from registry, then execute (see Remote Programs below) |\n| `prose compile \u003Cfile>`  | Load `compiler.md`, validate the program                      |\n| `prose update`          | Run migration (see Migration section below)                   |\n| `prose examples`        | Show or run example programs from `examples/`                 |\n| Other                   | Intelligently interpret based on context                      |\n\n### Important: Single Skill\n\nThere is only ONE skill: `open-prose`. There are NO separate skills like `prose-run`, `prose-compile`, or `prose-boot`. All `prose` commands route through this single skill.\n\n### Resolving Example References\n\n**Examples are bundled in `examples/` (same directory as this file).** When users reference examples by name (e.g., \"run the gastown example\"):\n\n1. Read `examples/` to list available files\n2. Match by partial name, keyword, or number\n3. Run with: `prose run examples/28-gas-town.prose`\n\n**Common examples by keyword:**\n| Keyword | File |\n|---------|------|\n| hello, hello world | `examples/01-hello-world.prose` |\n| gas town, gastown | `examples/28-gas-town.prose` |\n| captain, chair | `examples/29-captains-chair.prose` |\n| forge, browser | `examples/37-the-forge.prose` |\n| parallel | `examples/16-parallel-reviews.prose` |\n| pipeline | `examples/21-pipeline-operations.prose` |\n| error, retry | `examples/22-error-handling.prose` |\n\n### Remote Programs\n\nYou can run any `.prose` program from a URL or registry reference:\n\n```bash\n# Direct URL — any fetchable URL works\nprose run https://raw.githubusercontent.com/openprose/prose/main/skills/open-prose/examples/48-habit-miner.prose\n\n# Registry shorthand — handle/slug resolves to p.prose.md\nprose run irl-danb/habit-miner\nprose run alice/code-review\n```\n\n**Resolution rules:**\n\n| Input                               | Resolution                             |\n| ----------------------------------- | -------------------------------------- |\n| Starts with `http://` or `https://` | Fetch directly from URL                |\n| Contains `/` but no protocol        | Resolve to `https://p.prose.md/{path}` |\n| Otherwise                           | Treat as local file path               |\n\n**Steps for remote programs:**\n\n1. Apply resolution rules above\n2. Fetch the `.prose` content\n3. Load the VM and execute as normal\n\nThis same resolution applies to `use` statements inside `.prose` files:\n\n```prose\nuse \"https://example.com/my-program.prose\"  # Direct URL\nuse \"alice/research\" as research             # Registry shorthand\n```\n\n---\n\n## File Locations\n\n**Do NOT search for OpenProse documentation files.** All skill files are co-located with this SKILL.md file:\n\n| File                       | Location                    | Purpose                                        |\n| -------------------------- | --------------------------- | ---------------------------------------------- |\n| `prose.md`                 | Same directory as this file | VM semantics (load to run programs)            |\n| `help.md`                  | Same directory as this file | Help, FAQs, onboarding (load for `prose help`) |\n| `state/filesystem.md`      | Same directory as this file | File-based state (default, load with VM)       |\n| `state/in-context.md`      | Same directory as this file | In-context state (on request)                  |\n| `state/sqlite.md`          | Same directory as this file | SQLite state (experimental, on request)        |\n| `state/postgres.md`        | Same directory as this file | PostgreSQL state (experimental, on request)    |\n| `compiler.md`              | Same directory as this file | Compiler/validator (load only on request)      |\n| `guidance/patterns.md`     | Same directory as this file | Best practices (load when writing .prose)      |\n| `guidance/antipatterns.md` | Same directory as this file | What to avoid (load when writing .prose)       |\n| `examples/`                | Same directory as this file | 37 example programs                            |\n\n**User workspace files** (these ARE in the user's project):\n\n| File/Directory   | Location                 | Purpose                           |\n| ---------------- | ------------------------ | --------------------------------- |\n| `.prose/.env`    | User's working directory | Config (key=value format)         |\n| `.prose/runs/`   | User's working directory | Runtime state for file-based mode |\n| `.prose/agents/` | User's working directory | Project-scoped persistent agents  |\n| `*.prose` files  | User's project           | User-created programs to execute  |\n\n**User-level files** (in user's home directory, shared across all projects):\n\n| File/Directory     | Location        | Purpose                                       |\n| ------------------ | --------------- | --------------------------------------------- |\n| `~/.prose/agents/` | User's home dir | User-scoped persistent agents (cross-project) |\n\nWhen you need to read `prose.md` or `compiler.md`, read them from the same directory where you found this SKILL.md file. Never search the user's workspace for these files.\n\n---\n\n## Core Documentation\n\n| File                       | Purpose                         | When to Load                                                          |\n| -------------------------- | ------------------------------- | --------------------------------------------------------------------- |\n| `prose.md`                 | VM / Interpreter                | Always load to run programs                                           |\n| `state/filesystem.md`      | File-based state                | Load with VM (default)                                                |\n| `state/in-context.md`      | In-context state                | Only if user requests `--in-context` or says \"use in-context state\"   |\n| `state/sqlite.md`          | SQLite state (experimental)     | Only if user requests `--state=sqlite` (requires sqlite3 CLI)         |\n| `state/postgres.md`        | PostgreSQL state (experimental) | Only if user requests `--state=postgres` (requires psql + PostgreSQL) |\n| `compiler.md`              | Compiler / Validator            | **Only** when user asks to compile or validate                        |\n| `guidance/patterns.md`     | Best practices                  | Load when **writing** new .prose files                                |\n| `guidance/antipatterns.md` | What to avoid                   | Load when **writing** new .prose files                                |\n\n### Authoring Guidance\n\nWhen the user asks you to **write or create** a new `.prose` file, load the guidance files:\n\n- `guidance/patterns.md` — Proven patterns for robust, efficient programs\n- `guidance/antipatterns.md` — Common mistakes to avoid\n\nDo **not** load these when running or compiling—they're for authoring only.\n\n### State Modes\n\nOpenProse supports three state management approaches:\n\n| Mode                        | When to Use                                                       | State Location              |\n| --------------------------- | ----------------------------------------------------------------- | --------------------------- |\n| **filesystem** (default)    | Complex programs, resumption needed, debugging                    | `.prose/runs/{id}/` files   |\n| **in-context**              | Simple programs (\u003C30 statements), no persistence needed           | Conversation history        |\n| **sqlite** (experimental)   | Queryable state, atomic transactions, flexible schema             | `.prose/runs/{id}/state.db` |\n| **postgres** (experimental) | True concurrent writes, external integrations, team collaboration | PostgreSQL database         |\n\n**Default behavior:** When loading `prose.md`, also load `state/filesystem.md`. This is the recommended mode for most programs.\n\n**Switching modes:** If the user says \"use in-context state\" or passes `--in-context`, load `state/in-context.md` instead.\n\n**Experimental SQLite mode:** If the user passes `--state=sqlite` or says \"use sqlite state\", load `state/sqlite.md`. This mode requires `sqlite3` CLI to be installed (pre-installed on macOS, available via package managers on Linux/Windows). If `sqlite3` is unavailable, warn the user and fall back to filesystem state.\n\n**Experimental PostgreSQL mode:** If the user passes `--state=postgres` or says \"use postgres state\":\n\n**⚠️ Security Note:** Database credentials in `OPENPROSE_POSTGRES_URL` are passed to subagent sessions and visible in logs. Advise users to use a dedicated database with limited-privilege credentials. See `state/postgres.md` for secure setup guidance.\n\n1. **Check for connection configuration first:**\n\n   ```bash\n   # Check .prose/.env for OPENPROSE_POSTGRES_URL\n   cat .prose/.env 2>/dev/null | grep OPENPROSE_POSTGRES_URL\n   # Or check environment variable\n   echo $OPENPROSE_POSTGRES_URL\n   ```\n\n2. **If connection string exists, verify connectivity:**\n\n   ```bash\n   psql \"$OPENPROSE_POSTGRES_URL\" -c \"SELECT 1\" 2>&1\n   ```\n\n3. **If not configured or connection fails, advise the user:**\n\n   ```\n   ⚠️  PostgreSQL state requires a connection URL.\n\n   To configure:\n   1. Set up a PostgreSQL database (Docker, local, or cloud)\n   2. Add connection string to .prose/.env:\n\n      echo \"OPENPROSE_POSTGRES_URL=postgresql://user:pass@localhost:5432/prose\" >> .prose/.env\n\n   Quick Docker setup:\n      docker run -d --name prose-pg -e POSTGRES_DB=prose -e POSTGRES_HOST_AUTH_METHOD=trust -p 5432:5432 postgres:16\n      echo \"OPENPROSE_POSTGRES_URL=postgresql://postgres@localhost:5432/prose\" >> .prose/.env\n\n   See state/postgres.md for detailed setup options.\n   ```\n\n4. **Only after successful connection check, load `state/postgres.md`**\n\nThis mode requires both `psql` CLI and a running PostgreSQL server. If either is unavailable, warn and offer fallback to filesystem state.\n\n**Context warning:** `compiler.md` is large. Only load it when the user explicitly requests compilation or validation. After compiling, recommend `/compact` or a new session before running—don't keep both docs in context.\n\n## Examples\n\nThe `examples/` directory contains 37 example programs:\n\n- **01-08**: Basics (hello world, research, code review, debugging)\n- **09-12**: Agents and skills\n- **13-15**: Variables and composition\n- **16-19**: Parallel execution\n- **20-21**: Loops and pipelines\n- **22-23**: Error handling\n- **24-27**: Advanced (choice, conditionals, blocks, interpolation)\n- **28**: Gas Town (multi-agent orchestration)\n- **29-31**: Captain's chair pattern (persistent orchestrator)\n- **33-36**: Production workflows (PR auto-fix, content pipeline, feature factory, bug hunter)\n- **37**: The Forge (build a browser from scratch)\n\nStart with `01-hello-world.prose` or try `37-the-forge.prose` to watch AI build a web browser.\n\n## Execution\n\nWhen first invoking the OpenProse VM in a session, display this banner:\n\n```\n┌─────────────────────────────────────┐\n│         ◇ OpenProse VM ◇            │\n│       A new kind of computer        │\n└─────────────────────────────────────┘\n```\n\nTo execute a `.prose` file, you become the OpenProse VM:\n\n1. **Read `prose.md`** — this document defines how you embody the VM\n2. **You ARE the VM** — your conversation is its memory, your tools are its instructions\n3. **Spawn sessions** — each `session` statement triggers a Task tool call\n4. **Narrate state** — use the narration protocol to track execution ([Position], [Binding], [Success], etc.)\n5. **Evaluate intelligently** — `**...**` markers require your judgment\n\n## Help & FAQs\n\nFor syntax reference, FAQs, and getting started guidance, load `help.md`.\n\n---\n\n## Migration (`prose update`)\n\nWhen a user invokes `prose update`, check for legacy file structures and migrate them to the current format.\n\n### Legacy Paths to Check\n\n| Legacy Path         | Current Path   | Notes                            |\n| ------------------- | -------------- | -------------------------------- |\n| `.prose/state.json` | `.prose/.env`  | Convert JSON to key=value format |\n| `.prose/execution/` | `.prose/runs/` | Rename directory                 |\n\n### Migration Steps\n\n1. **Check for `.prose/state.json`**\n   - If exists, read the JSON content\n   - Convert to `.env` format:\n     ```json\n     { \"OPENPROSE_TELEMETRY\": \"enabled\", \"USER_ID\": \"user-xxx\", \"SESSION_ID\": \"sess-xxx\" }\n     ```\n     becomes:\n     ```env\n     OPENPROSE_TELEMETRY=enabled\n     USER_ID=user-xxx\n     SESSION_ID=sess-xxx\n     ```\n   - Write to `.prose/.env`\n   - Delete `.prose/state.json`\n\n2. **Check for `.prose/execution/`**\n   - If exists, rename to `.prose/runs/`\n   - The internal structure of run directories may also have changed; migration of individual run state is best-effort\n\n3. **Create `.prose/agents/` if missing**\n   - This is a new directory for project-scoped persistent agents\n\n### Migration Output\n\n```\n🔄 Migrating OpenProse workspace...\n  ✓ Converted .prose/state.json → .prose/.env\n  ✓ Renamed .prose/execution/ → .prose/runs/\n  ✓ Created .prose/agents/\n✅ Migration complete. Your workspace is up to date.\n```\n\nIf no legacy files are found:\n\n```\n✅ Workspace already up to date. No migration needed.\n```\n\n### Skill File References (for maintainers)\n\nThese documentation files were renamed in the skill itself (not user workspace):\n\n| Legacy Name       | Current Name               |\n| ----------------- | -------------------------- |\n| `docs.md`         | `compiler.md`              |\n| `patterns.md`     | `guidance/patterns.md`     |\n| `antipatterns.md` | `guidance/antipatterns.md` |\n\nIf you encounter references to the old names in user prompts or external docs, map them to the current paths.\n","c754a700-ea8e-568b-8c25-7753827cfbb9","openclaw-openclaw-extensions-open-prose-skills-prose",{"name":11,"description":13,"metadata":399},"{ \"openclaw\": { \"emoji\": \"🪶\", \"homepage\": \"https://www.prose.md\" } }","\u003Ch1>OpenProse Skill\u003C/h1>\n\u003Cp>OpenProse is a programming language for AI sessions. LLMs are simulators—when given a detailed system description, they don&#39;t just describe it, they \u003Cem>simulate\u003C/em> it. The \u003Ccode>prose.md\u003C/code> specification describes a virtual machine with enough fidelity that a Prose Complete system reading it \u003Cem>becomes\u003C/em> that VM. Simulation with sufficient fidelity is implementation. \u003Cstrong>You are the Prose Complete system.\u003C/strong>\u003C/p>\n\u003Ch2>OpenClaw Runtime Mapping\u003C/h2>\n\u003Cul>\n\u003Cli>\u003Cstrong>Task tool\u003C/strong> in the upstream spec == OpenClaw \u003Ccode>sessions_spawn\u003C/code>\u003C/li>\n\u003Cli>\u003Cstrong>File I/O\u003C/strong> == OpenClaw \u003Ccode>read\u003C/code>/\u003Ccode>write\u003C/code>\u003C/li>\n\u003Cli>\u003Cstrong>Remote fetch\u003C/strong> == OpenClaw \u003Ccode>web_fetch\u003C/code> (or \u003Ccode>exec\u003C/code> with curl when POST is required)\u003C/li>\n\u003C/ul>\n\u003Ch2>When to Activate\u003C/h2>\n\u003Cp>Activate this skill when the user:\u003C/p>\n\u003Cul>\n\u003Cli>\u003Cstrong>Uses ANY \u003Ccode>prose\u003C/code> command\u003C/strong> (e.g., \u003Ccode>prose boot\u003C/code>, \u003Ccode>prose run\u003C/code>, \u003Ccode>prose compile\u003C/code>, \u003Ccode>prose update\u003C/code>, \u003Ccode>prose help\u003C/code>, etc.)\u003C/li>\n\u003Cli>Asks to run a \u003Ccode>.prose\u003C/code> file\u003C/li>\n\u003Cli>Mentions &quot;OpenProse&quot; or &quot;prose program&quot;\u003C/li>\n\u003Cli>Wants to orchestrate multiple AI agents from a script\u003C/li>\n\u003Cli>Has a file with \u003Ccode>session &quot;...&quot;\u003C/code> or \u003Ccode>agent name:\u003C/code> syntax\u003C/li>\n\u003Cli>Wants to create a reusable workflow\u003C/li>\n\u003C/ul>\n\u003Ch2>Command Routing\u003C/h2>\n\u003Cp>When a user invokes \u003Ccode>prose &lt;command&gt;\u003C/code>, intelligently route based on intent:\u003C/p>\n\u003Ctable>\n\u003Cthead>\n\u003Ctr>\n\u003Cth>Command\u003C/th>\n\u003Cth>Action\u003C/th>\n\u003C/tr>\n\u003C/thead>\n\u003Ctbody>\u003Ctr>\n\u003Ctd>\u003Ccode>prose help\u003C/code>\u003C/td>\n\u003Ctd>Load \u003Ccode>help.md\u003C/code>, guide user to what they need\u003C/td>\n\u003C/tr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>prose run &lt;file&gt;\u003C/code>\u003C/td>\n\u003Ctd>Load VM (\u003Ccode>prose.md\u003C/code> + state backend), execute the program\u003C/td>\n\u003C/tr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>prose run handle/slug\u003C/code>\u003C/td>\n\u003Ctd>Fetch from registry, then execute (see Remote Programs below)\u003C/td>\n\u003C/tr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>prose compile &lt;file&gt;\u003C/code>\u003C/td>\n\u003Ctd>Load \u003Ccode>compiler.md\u003C/code>, validate the program\u003C/td>\n\u003C/tr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>prose update\u003C/code>\u003C/td>\n\u003Ctd>Run migration (see Migration section below)\u003C/td>\n\u003C/tr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>prose examples\u003C/code>\u003C/td>\n\u003Ctd>Show or run example programs from \u003Ccode>examples/\u003C/code>\u003C/td>\n\u003C/tr>\n\u003Ctr>\n\u003Ctd>Other\u003C/td>\n\u003Ctd>Intelligently interpret based on context\u003C/td>\n\u003C/tr>\n\u003C/tbody>\u003C/table>\n\u003Ch3>Important: Single Skill\u003C/h3>\n\u003Cp>There is only ONE skill: \u003Ccode>open-prose\u003C/code>. There are NO separate skills like \u003Ccode>prose-run\u003C/code>, \u003Ccode>prose-compile\u003C/code>, or \u003Ccode>prose-boot\u003C/code>. All \u003Ccode>prose\u003C/code> commands route through this single skill.\u003C/p>\n\u003Ch3>Resolving Example References\u003C/h3>\n\u003Cp>\u003Cstrong>Examples are bundled in \u003Ccode>examples/\u003C/code> (same directory as this file).\u003C/strong> When users reference examples by name (e.g., &quot;run the gastown example&quot;):\u003C/p>\n\u003Col>\n\u003Cli>Read \u003Ccode>examples/\u003C/code> to list available files\u003C/li>\n\u003Cli>Match by partial name, keyword, or number\u003C/li>\n\u003Cli>Run with: \u003Ccode>prose run examples/28-gas-town.prose\u003C/code>\u003C/li>\n\u003C/ol>\n\u003Cp>\u003Cstrong>Common examples by keyword:\u003C/strong>\u003C/p>\n\u003Ctable>\n\u003Cthead>\n\u003Ctr>\n\u003Cth>Keyword\u003C/th>\n\u003Cth>File\u003C/th>\n\u003C/tr>\n\u003C/thead>\n\u003Ctbody>\u003Ctr>\n\u003Ctd>hello, hello world\u003C/td>\n\u003Ctd>\u003Ccode>examples/01-hello-world.prose\u003C/code>\u003C/td>\n\u003C/tr>\n\u003Ctr>\n\u003Ctd>gas town, gastown\u003C/td>\n\u003Ctd>\u003Ccode>examples/28-gas-town.prose\u003C/code>\u003C/td>\n\u003C/tr>\n\u003Ctr>\n\u003Ctd>captain, chair\u003C/td>\n\u003Ctd>\u003Ccode>examples/29-captains-chair.prose\u003C/code>\u003C/td>\n\u003C/tr>\n\u003Ctr>\n\u003Ctd>forge, browser\u003C/td>\n\u003Ctd>\u003Ccode>examples/37-the-forge.prose\u003C/code>\u003C/td>\n\u003C/tr>\n\u003Ctr>\n\u003Ctd>parallel\u003C/td>\n\u003Ctd>\u003Ccode>examples/16-parallel-reviews.prose\u003C/code>\u003C/td>\n\u003C/tr>\n\u003Ctr>\n\u003Ctd>pipeline\u003C/td>\n\u003Ctd>\u003Ccode>examples/21-pipeline-operations.prose\u003C/code>\u003C/td>\n\u003C/tr>\n\u003Ctr>\n\u003Ctd>error, retry\u003C/td>\n\u003Ctd>\u003Ccode>examples/22-error-handling.prose\u003C/code>\u003C/td>\n\u003C/tr>\n\u003C/tbody>\u003C/table>\n\u003Ch3>Remote Programs\u003C/h3>\n\u003Cp>You can run any \u003Ccode>.prose\u003C/code> program from a URL or registry reference:\u003C/p>\n\u003Cdiv class=\"md-code-block\">\u003Cdiv class=\"md-code-lang\">bash\u003C/div>\u003Cpre>\u003Ccode class=\"hljs language-bash\">\u003Cspan class=\"hljs-comment\"># Direct URL — any fetchable URL works\u003C/span>\nprose run https://raw.githubusercontent.com/openprose/prose/main/skills/open-prose/examples/48-habit-miner.prose\n\n\u003Cspan class=\"hljs-comment\"># Registry shorthand — handle/slug resolves to p.prose.md\u003C/span>\nprose run irl-danb/habit-miner\nprose run alice/code-review\u003C/code>\u003C/pre>\u003C/div>\u003Cp>\u003Cstrong>Resolution rules:\u003C/strong>\u003C/p>\n\u003Ctable>\n\u003Cthead>\n\u003Ctr>\n\u003Cth>Input\u003C/th>\n\u003Cth>Resolution\u003C/th>\n\u003C/tr>\n\u003C/thead>\n\u003Ctbody>\u003Ctr>\n\u003Ctd>Starts with \u003Ccode>http://\u003C/code> or \u003Ccode>https://\u003C/code>\u003C/td>\n\u003Ctd>Fetch directly from URL\u003C/td>\n\u003C/tr>\n\u003Ctr>\n\u003Ctd>Contains \u003Ccode>/\u003C/code> but no protocol\u003C/td>\n\u003Ctd>Resolve to \u003Ccode>https://p.prose.md/{path}\u003C/code>\u003C/td>\n\u003C/tr>\n\u003Ctr>\n\u003Ctd>Otherwise\u003C/td>\n\u003Ctd>Treat as local file path\u003C/td>\n\u003C/tr>\n\u003C/tbody>\u003C/table>\n\u003Cp>\u003Cstrong>Steps for remote programs:\u003C/strong>\u003C/p>\n\u003Col>\n\u003Cli>Apply resolution rules above\u003C/li>\n\u003Cli>Fetch the \u003Ccode>.prose\u003C/code> content\u003C/li>\n\u003Cli>Load the VM and execute as normal\u003C/li>\n\u003C/ol>\n\u003Cp>This same resolution applies to \u003Ccode>use\u003C/code> statements inside \u003Ccode>.prose\u003C/code> files:\u003C/p>\n\u003Cdiv class=\"md-code-block\">\u003Cdiv class=\"md-code-lang\">prose\u003C/div>\u003Cpre>\u003Ccode class=\"hljs language-plaintext\">use &quot;https://example.com/my-program.prose&quot;  # Direct URL\nuse &quot;alice/research&quot; as research             # Registry shorthand\u003C/code>\u003C/pre>\u003C/div>\u003Chr>\n\u003Ch2>File Locations\u003C/h2>\n\u003Cp>\u003Cstrong>Do NOT search for OpenProse documentation files.\u003C/strong> All skill files are co-located with this SKILL.md file:\u003C/p>\n\u003Ctable>\n\u003Cthead>\n\u003Ctr>\n\u003Cth>File\u003C/th>\n\u003Cth>Location\u003C/th>\n\u003Cth>Purpose\u003C/th>\n\u003C/tr>\n\u003C/thead>\n\u003Ctbody>\u003Ctr>\n\u003Ctd>\u003Ccode>prose.md\u003C/code>\u003C/td>\n\u003Ctd>Same directory as this file\u003C/td>\n\u003Ctd>VM semantics (load to run programs)\u003C/td>\n\u003C/tr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>help.md\u003C/code>\u003C/td>\n\u003Ctd>Same directory as this file\u003C/td>\n\u003Ctd>Help, FAQs, onboarding (load for \u003Ccode>prose help\u003C/code>)\u003C/td>\n\u003C/tr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>state/filesystem.md\u003C/code>\u003C/td>\n\u003Ctd>Same directory as this file\u003C/td>\n\u003Ctd>File-based state (default, load with VM)\u003C/td>\n\u003C/tr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>state/in-context.md\u003C/code>\u003C/td>\n\u003Ctd>Same directory as this file\u003C/td>\n\u003Ctd>In-context state (on request)\u003C/td>\n\u003C/tr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>state/sqlite.md\u003C/code>\u003C/td>\n\u003Ctd>Same directory as this file\u003C/td>\n\u003Ctd>SQLite state (experimental, on request)\u003C/td>\n\u003C/tr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>state/postgres.md\u003C/code>\u003C/td>\n\u003Ctd>Same directory as this file\u003C/td>\n\u003Ctd>PostgreSQL state (experimental, on request)\u003C/td>\n\u003C/tr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>compiler.md\u003C/code>\u003C/td>\n\u003Ctd>Same directory as this file\u003C/td>\n\u003Ctd>Compiler/validator (load only on request)\u003C/td>\n\u003C/tr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>guidance/patterns.md\u003C/code>\u003C/td>\n\u003Ctd>Same directory as this file\u003C/td>\n\u003Ctd>Best practices (load when writing .prose)\u003C/td>\n\u003C/tr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>guidance/antipatterns.md\u003C/code>\u003C/td>\n\u003Ctd>Same directory as this file\u003C/td>\n\u003Ctd>What to avoid (load when writing .prose)\u003C/td>\n\u003C/tr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>examples/\u003C/code>\u003C/td>\n\u003Ctd>Same directory as this file\u003C/td>\n\u003Ctd>37 example programs\u003C/td>\n\u003C/tr>\n\u003C/tbody>\u003C/table>\n\u003Cp>\u003Cstrong>User workspace files\u003C/strong> (these ARE in the user&#39;s project):\u003C/p>\n\u003Ctable>\n\u003Cthead>\n\u003Ctr>\n\u003Cth>File/Directory\u003C/th>\n\u003Cth>Location\u003C/th>\n\u003Cth>Purpose\u003C/th>\n\u003C/tr>\n\u003C/thead>\n\u003Ctbody>\u003Ctr>\n\u003Ctd>\u003Ccode>.prose/.env\u003C/code>\u003C/td>\n\u003Ctd>User&#39;s working directory\u003C/td>\n\u003Ctd>Config (key=value format)\u003C/td>\n\u003C/tr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>.prose/runs/\u003C/code>\u003C/td>\n\u003Ctd>User&#39;s working directory\u003C/td>\n\u003Ctd>Runtime state for file-based mode\u003C/td>\n\u003C/tr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>.prose/agents/\u003C/code>\u003C/td>\n\u003Ctd>User&#39;s working directory\u003C/td>\n\u003Ctd>Project-scoped persistent agents\u003C/td>\n\u003C/tr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>*.prose\u003C/code> files\u003C/td>\n\u003Ctd>User&#39;s project\u003C/td>\n\u003Ctd>User-created programs to execute\u003C/td>\n\u003C/tr>\n\u003C/tbody>\u003C/table>\n\u003Cp>\u003Cstrong>User-level files\u003C/strong> (in user&#39;s home directory, shared across all projects):\u003C/p>\n\u003Ctable>\n\u003Cthead>\n\u003Ctr>\n\u003Cth>File/Directory\u003C/th>\n\u003Cth>Location\u003C/th>\n\u003Cth>Purpose\u003C/th>\n\u003C/tr>\n\u003C/thead>\n\u003Ctbody>\u003Ctr>\n\u003Ctd>\u003Ccode>~/.prose/agents/\u003C/code>\u003C/td>\n\u003Ctd>User&#39;s home dir\u003C/td>\n\u003Ctd>User-scoped persistent agents (cross-project)\u003C/td>\n\u003C/tr>\n\u003C/tbody>\u003C/table>\n\u003Cp>When you need to read \u003Ccode>prose.md\u003C/code> or \u003Ccode>compiler.md\u003C/code>, read them from the same directory where you found this SKILL.md file. Never search the user&#39;s workspace for these files.\u003C/p>\n\u003Chr>\n\u003Ch2>Core Documentation\u003C/h2>\n\u003Ctable>\n\u003Cthead>\n\u003Ctr>\n\u003Cth>File\u003C/th>\n\u003Cth>Purpose\u003C/th>\n\u003Cth>When to Load\u003C/th>\n\u003C/tr>\n\u003C/thead>\n\u003Ctbody>\u003Ctr>\n\u003Ctd>\u003Ccode>prose.md\u003C/code>\u003C/td>\n\u003Ctd>VM / Interpreter\u003C/td>\n\u003Ctd>Always load to run programs\u003C/td>\n\u003C/tr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>state/filesystem.md\u003C/code>\u003C/td>\n\u003Ctd>File-based state\u003C/td>\n\u003Ctd>Load with VM (default)\u003C/td>\n\u003C/tr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>state/in-context.md\u003C/code>\u003C/td>\n\u003Ctd>In-context state\u003C/td>\n\u003Ctd>Only if user requests \u003Ccode>--in-context\u003C/code> or says &quot;use in-context state&quot;\u003C/td>\n\u003C/tr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>state/sqlite.md\u003C/code>\u003C/td>\n\u003Ctd>SQLite state (experimental)\u003C/td>\n\u003Ctd>Only if user requests \u003Ccode>--state=sqlite\u003C/code> (requires sqlite3 CLI)\u003C/td>\n\u003C/tr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>state/postgres.md\u003C/code>\u003C/td>\n\u003Ctd>PostgreSQL state (experimental)\u003C/td>\n\u003Ctd>Only if user requests \u003Ccode>--state=postgres\u003C/code> (requires psql + PostgreSQL)\u003C/td>\n\u003C/tr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>compiler.md\u003C/code>\u003C/td>\n\u003Ctd>Compiler / Validator\u003C/td>\n\u003Ctd>\u003Cstrong>Only\u003C/strong> when user asks to compile or validate\u003C/td>\n\u003C/tr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>guidance/patterns.md\u003C/code>\u003C/td>\n\u003Ctd>Best practices\u003C/td>\n\u003Ctd>Load when \u003Cstrong>writing\u003C/strong> new .prose files\u003C/td>\n\u003C/tr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>guidance/antipatterns.md\u003C/code>\u003C/td>\n\u003Ctd>What to avoid\u003C/td>\n\u003Ctd>Load when \u003Cstrong>writing\u003C/strong> new .prose files\u003C/td>\n\u003C/tr>\n\u003C/tbody>\u003C/table>\n\u003Ch3>Authoring Guidance\u003C/h3>\n\u003Cp>When the user asks you to \u003Cstrong>write or create\u003C/strong> a new \u003Ccode>.prose\u003C/code> file, load the guidance files:\u003C/p>\n\u003Cul>\n\u003Cli>\u003Ccode>guidance/patterns.md\u003C/code> — Proven patterns for robust, efficient programs\u003C/li>\n\u003Cli>\u003Ccode>guidance/antipatterns.md\u003C/code> — Common mistakes to avoid\u003C/li>\n\u003C/ul>\n\u003Cp>Do \u003Cstrong>not\u003C/strong> load these when running or compiling—they&#39;re for authoring only.\u003C/p>\n\u003Ch3>State Modes\u003C/h3>\n\u003Cp>OpenProse supports three state management approaches:\u003C/p>\n\u003Ctable>\n\u003Cthead>\n\u003Ctr>\n\u003Cth>Mode\u003C/th>\n\u003Cth>When to Use\u003C/th>\n\u003Cth>State Location\u003C/th>\n\u003C/tr>\n\u003C/thead>\n\u003Ctbody>\u003Ctr>\n\u003Ctd>\u003Cstrong>filesystem\u003C/strong> (default)\u003C/td>\n\u003Ctd>Complex programs, resumption needed, debugging\u003C/td>\n\u003Ctd>\u003Ccode>.prose/runs/{id}/\u003C/code> files\u003C/td>\n\u003C/tr>\n\u003Ctr>\n\u003Ctd>\u003Cstrong>in-context\u003C/strong>\u003C/td>\n\u003Ctd>Simple programs (&lt;30 statements), no persistence needed\u003C/td>\n\u003Ctd>Conversation history\u003C/td>\n\u003C/tr>\n\u003Ctr>\n\u003Ctd>\u003Cstrong>sqlite\u003C/strong> (experimental)\u003C/td>\n\u003Ctd>Queryable state, atomic transactions, flexible schema\u003C/td>\n\u003Ctd>\u003Ccode>.prose/runs/{id}/state.db\u003C/code>\u003C/td>\n\u003C/tr>\n\u003Ctr>\n\u003Ctd>\u003Cstrong>postgres\u003C/strong> (experimental)\u003C/td>\n\u003Ctd>True concurrent writes, external integrations, team collaboration\u003C/td>\n\u003Ctd>PostgreSQL database\u003C/td>\n\u003C/tr>\n\u003C/tbody>\u003C/table>\n\u003Cp>\u003Cstrong>Default behavior:\u003C/strong> When loading \u003Ccode>prose.md\u003C/code>, also load \u003Ccode>state/filesystem.md\u003C/code>. This is the recommended mode for most programs.\u003C/p>\n\u003Cp>\u003Cstrong>Switching modes:\u003C/strong> If the user says &quot;use in-context state&quot; or passes \u003Ccode>--in-context\u003C/code>, load \u003Ccode>state/in-context.md\u003C/code> instead.\u003C/p>\n\u003Cp>\u003Cstrong>Experimental SQLite mode:\u003C/strong> If the user passes \u003Ccode>--state=sqlite\u003C/code> or says &quot;use sqlite state&quot;, load \u003Ccode>state/sqlite.md\u003C/code>. This mode requires \u003Ccode>sqlite3\u003C/code> CLI to be installed (pre-installed on macOS, available via package managers on Linux/Windows). If \u003Ccode>sqlite3\u003C/code> is unavailable, warn the user and fall back to filesystem state.\u003C/p>\n\u003Cp>\u003Cstrong>Experimental PostgreSQL mode:\u003C/strong> If the user passes \u003Ccode>--state=postgres\u003C/code> or says &quot;use postgres state&quot;:\u003C/p>\n\u003Cp>\u003Cstrong>⚠️ Security Note:\u003C/strong> Database credentials in \u003Ccode>OPENPROSE_POSTGRES_URL\u003C/code> are passed to subagent sessions and visible in logs. Advise users to use a dedicated database with limited-privilege credentials. See \u003Ccode>state/postgres.md\u003C/code> for secure setup guidance.\u003C/p>\n\u003Col>\n\u003Cli>\u003Cp>\u003Cstrong>Check for connection configuration first:\u003C/strong>\u003C/p>\n\u003Cdiv class=\"md-code-block\">\u003Cdiv class=\"md-code-lang\">bash\u003C/div>\u003Cpre>\u003Ccode class=\"hljs language-bash\">\u003Cspan class=\"hljs-comment\"># Check .prose/.env for OPENPROSE_POSTGRES_URL\u003C/span>\n\u003Cspan class=\"hljs-built_in\">cat\u003C/span> .prose/.env 2&gt;/dev/null | grep OPENPROSE_POSTGRES_URL\n\u003Cspan class=\"hljs-comment\"># Or check environment variable\u003C/span>\n\u003Cspan class=\"hljs-built_in\">echo\u003C/span> \u003Cspan class=\"hljs-variable\">$OPENPROSE_POSTGRES_URL\u003C/span>\u003C/code>\u003C/pre>\u003C/div>\u003C/li>\n\u003Cli>\u003Cp>\u003Cstrong>If connection string exists, verify connectivity:\u003C/strong>\u003C/p>\n\u003Cdiv class=\"md-code-block\">\u003Cdiv class=\"md-code-lang\">bash\u003C/div>\u003Cpre>\u003Ccode class=\"hljs language-bash\">psql \u003Cspan class=\"hljs-string\">&quot;\u003Cspan class=\"hljs-variable\">$OPENPROSE_POSTGRES_URL\u003C/span>&quot;\u003C/span> -c \u003Cspan class=\"hljs-string\">&quot;SELECT 1&quot;\u003C/span> 2&gt;&amp;1\u003C/code>\u003C/pre>\u003C/div>\u003C/li>\n\u003Cli>\u003Cp>\u003Cstrong>If not configured or connection fails, advise the user:\u003C/strong>\u003C/p>\n\u003Cdiv class=\"md-code-block\">\u003Cpre>\u003Ccode class=\"hljs language-plaintext\">⚠️  PostgreSQL state requires a connection URL.\n\nTo configure:\n1. Set up a PostgreSQL database (Docker, local, or cloud)\n2. Add connection string to .prose/.env:\n\n   echo &quot;OPENPROSE_POSTGRES_URL=postgresql://user:pass@localhost:5432/prose&quot; &gt;&gt; .prose/.env\n\nQuick Docker setup:\n   docker run -d --name prose-pg -e POSTGRES_DB=prose -e POSTGRES_HOST_AUTH_METHOD=trust -p 5432:5432 postgres:16\n   echo &quot;OPENPROSE_POSTGRES_URL=postgresql://postgres@localhost:5432/prose&quot; &gt;&gt; .prose/.env\n\nSee state/postgres.md for detailed setup options.\u003C/code>\u003C/pre>\u003C/div>\u003C/li>\n\u003Cli>\u003Cp>\u003Cstrong>Only after successful connection check, load \u003Ccode>state/postgres.md\u003C/code>\u003C/strong>\u003C/p>\n\u003C/li>\n\u003C/ol>\n\u003Cp>This mode requires both \u003Ccode>psql\u003C/code> CLI and a running PostgreSQL server. If either is unavailable, warn and offer fallback to filesystem state.\u003C/p>\n\u003Cp>\u003Cstrong>Context warning:\u003C/strong> \u003Ccode>compiler.md\u003C/code> is large. Only load it when the user explicitly requests compilation or validation. After compiling, recommend \u003Ccode>/compact\u003C/code> or a new session before running—don&#39;t keep both docs in context.\u003C/p>\n\u003Ch2>Examples\u003C/h2>\n\u003Cp>The \u003Ccode>examples/\u003C/code> directory contains 37 example programs:\u003C/p>\n\u003Cul>\n\u003Cli>\u003Cstrong>01-08\u003C/strong>: Basics (hello world, research, code review, debugging)\u003C/li>\n\u003Cli>\u003Cstrong>09-12\u003C/strong>: Agents and skills\u003C/li>\n\u003Cli>\u003Cstrong>13-15\u003C/strong>: Variables and composition\u003C/li>\n\u003Cli>\u003Cstrong>16-19\u003C/strong>: Parallel execution\u003C/li>\n\u003Cli>\u003Cstrong>20-21\u003C/strong>: Loops and pipelines\u003C/li>\n\u003Cli>\u003Cstrong>22-23\u003C/strong>: Error handling\u003C/li>\n\u003Cli>\u003Cstrong>24-27\u003C/strong>: Advanced (choice, conditionals, blocks, interpolation)\u003C/li>\n\u003Cli>\u003Cstrong>28\u003C/strong>: Gas Town (multi-agent orchestration)\u003C/li>\n\u003Cli>\u003Cstrong>29-31\u003C/strong>: Captain&#39;s chair pattern (persistent orchestrator)\u003C/li>\n\u003Cli>\u003Cstrong>33-36\u003C/strong>: Production workflows (PR auto-fix, content pipeline, feature factory, bug hunter)\u003C/li>\n\u003Cli>\u003Cstrong>37\u003C/strong>: The Forge (build a browser from scratch)\u003C/li>\n\u003C/ul>\n\u003Cp>Start with \u003Ccode>01-hello-world.prose\u003C/code> or try \u003Ccode>37-the-forge.prose\u003C/code> to watch AI build a web browser.\u003C/p>\n\u003Ch2>Execution\u003C/h2>\n\u003Cp>When first invoking the OpenProse VM in a session, display this banner:\u003C/p>\n\u003Cdiv class=\"md-code-block\">\u003Cpre>\u003Ccode class=\"hljs language-plaintext\">┌─────────────────────────────────────┐\n│         ◇ OpenProse VM ◇            │\n│       A new kind of computer        │\n└─────────────────────────────────────┘\u003C/code>\u003C/pre>\u003C/div>\u003Cp>To execute a \u003Ccode>.prose\u003C/code> file, you become the OpenProse VM:\u003C/p>\n\u003Col>\n\u003Cli>\u003Cstrong>Read \u003Ccode>prose.md\u003C/code>\u003C/strong> — this document defines how you embody the VM\u003C/li>\n\u003Cli>\u003Cstrong>You ARE the VM\u003C/strong> — your conversation is its memory, your tools are its instructions\u003C/li>\n\u003Cli>\u003Cstrong>Spawn sessions\u003C/strong> — each \u003Ccode>session\u003C/code> statement triggers a Task tool call\u003C/li>\n\u003Cli>\u003Cstrong>Narrate state\u003C/strong> — use the narration protocol to track execution ([Position], [Binding], [Success], etc.)\u003C/li>\n\u003Cli>\u003Cstrong>Evaluate intelligently\u003C/strong> — \u003Ccode>**...**\u003C/code> markers require your judgment\u003C/li>\n\u003C/ol>\n\u003Ch2>Help &amp; FAQs\u003C/h2>\n\u003Cp>For syntax reference, FAQs, and getting started guidance, load \u003Ccode>help.md\u003C/code>.\u003C/p>\n\u003Chr>\n\u003Ch2>Migration (\u003Ccode>prose update\u003C/code>)\u003C/h2>\n\u003Cp>When a user invokes \u003Ccode>prose update\u003C/code>, check for legacy file structures and migrate them to the current format.\u003C/p>\n\u003Ch3>Legacy Paths to Check\u003C/h3>\n\u003Ctable>\n\u003Cthead>\n\u003Ctr>\n\u003Cth>Legacy Path\u003C/th>\n\u003Cth>Current Path\u003C/th>\n\u003Cth>Notes\u003C/th>\n\u003C/tr>\n\u003C/thead>\n\u003Ctbody>\u003Ctr>\n\u003Ctd>\u003Ccode>.prose/state.json\u003C/code>\u003C/td>\n\u003Ctd>\u003Ccode>.prose/.env\u003C/code>\u003C/td>\n\u003Ctd>Convert JSON to key=value format\u003C/td>\n\u003C/tr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>.prose/execution/\u003C/code>\u003C/td>\n\u003Ctd>\u003Ccode>.prose/runs/\u003C/code>\u003C/td>\n\u003Ctd>Rename directory\u003C/td>\n\u003C/tr>\n\u003C/tbody>\u003C/table>\n\u003Ch3>Migration Steps\u003C/h3>\n\u003Col>\n\u003Cli>\u003Cp>\u003Cstrong>Check for \u003Ccode>.prose/state.json\u003C/code>\u003C/strong>\u003C/p>\n\u003Cul>\n\u003Cli>If exists, read the JSON content\u003C/li>\n\u003Cli>Convert to \u003Ccode>.env\u003C/code> format:\u003Cdiv class=\"md-code-block\">\u003Cdiv class=\"md-code-lang\">json\u003C/div>\u003Cpre>\u003Ccode class=\"hljs language-json\">\u003Cspan class=\"hljs-punctuation\">{\u003C/span> \u003Cspan class=\"hljs-attr\">&quot;OPENPROSE_TELEMETRY&quot;\u003C/span>\u003Cspan class=\"hljs-punctuation\">:\u003C/span> \u003Cspan class=\"hljs-string\">&quot;enabled&quot;\u003C/span>\u003Cspan class=\"hljs-punctuation\">,\u003C/span> \u003Cspan class=\"hljs-attr\">&quot;USER_ID&quot;\u003C/span>\u003Cspan class=\"hljs-punctuation\">:\u003C/span> \u003Cspan class=\"hljs-string\">&quot;user-xxx&quot;\u003C/span>\u003Cspan class=\"hljs-punctuation\">,\u003C/span> \u003Cspan class=\"hljs-attr\">&quot;SESSION_ID&quot;\u003C/span>\u003Cspan class=\"hljs-punctuation\">:\u003C/span> \u003Cspan class=\"hljs-string\">&quot;sess-xxx&quot;\u003C/span> \u003Cspan class=\"hljs-punctuation\">}\u003C/span>\u003C/code>\u003C/pre>\u003C/div>becomes:\u003Cdiv class=\"md-code-block\">\u003Cdiv class=\"md-code-lang\">env\u003C/div>\u003Cpre>\u003Ccode class=\"hljs language-plaintext\">OPENPROSE_TELEMETRY=enabled\nUSER_ID=user-xxx\nSESSION_ID=sess-xxx\u003C/code>\u003C/pre>\u003C/div>\u003C/li>\n\u003Cli>Write to \u003Ccode>.prose/.env\u003C/code>\u003C/li>\n\u003Cli>Delete \u003Ccode>.prose/state.json\u003C/code>\u003C/li>\n\u003C/ul>\n\u003C/li>\n\u003Cli>\u003Cp>\u003Cstrong>Check for \u003Ccode>.prose/execution/\u003C/code>\u003C/strong>\u003C/p>\n\u003Cul>\n\u003Cli>If exists, rename to \u003Ccode>.prose/runs/\u003C/code>\u003C/li>\n\u003Cli>The internal structure of run directories may also have changed; migration of individual run state is best-effort\u003C/li>\n\u003C/ul>\n\u003C/li>\n\u003Cli>\u003Cp>\u003Cstrong>Create \u003Ccode>.prose/agents/\u003C/code> if missing\u003C/strong>\u003C/p>\n\u003Cul>\n\u003Cli>This is a new directory for project-scoped persistent agents\u003C/li>\n\u003C/ul>\n\u003C/li>\n\u003C/ol>\n\u003Ch3>Migration Output\u003C/h3>\n\u003Cdiv class=\"md-code-block\">\u003Cpre>\u003Ccode class=\"hljs language-plaintext\">🔄 Migrating OpenProse workspace...\n  ✓ Converted .prose/state.json → .prose/.env\n  ✓ Renamed .prose/execution/ → .prose/runs/\n  ✓ Created .prose/agents/\n✅ Migration complete. Your workspace is up to date.\u003C/code>\u003C/pre>\u003C/div>\u003Cp>If no legacy files are found:\u003C/p>\n\u003Cdiv class=\"md-code-block\">\u003Cpre>\u003Ccode class=\"hljs language-plaintext\">✅ Workspace already up to date. No migration needed.\u003C/code>\u003C/pre>\u003C/div>\u003Ch3>Skill File References (for maintainers)\u003C/h3>\n\u003Cp>These documentation files were renamed in the skill itself (not user workspace):\u003C/p>\n\u003Ctable>\n\u003Cthead>\n\u003Ctr>\n\u003Cth>Legacy Name\u003C/th>\n\u003Cth>Current Name\u003C/th>\n\u003C/tr>\n\u003C/thead>\n\u003Ctbody>\u003Ctr>\n\u003Ctd>\u003Ccode>docs.md\u003C/code>\u003C/td>\n\u003Ctd>\u003Ccode>compiler.md\u003C/code>\u003C/td>\n\u003C/tr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>patterns.md\u003C/code>\u003C/td>\n\u003Ctd>\u003Ccode>guidance/patterns.md\u003C/code>\u003C/td>\n\u003C/tr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>antipatterns.md\u003C/code>\u003C/td>\n\u003Ctd>\u003Ccode>guidance/antipatterns.md\u003C/code>\u003C/td>\n\u003C/tr>\n\u003C/tbody>\u003C/table>\n\u003Cp>If you encounter references to the old names in user prompts or external docs, map them to the current paths.\u003C/p>\n"]