OpenProse Skill
OpenProse 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.
Moltbot Runtime Mapping
- - Task tool in the upstream spec == Moltbot INLINECODE1
- File I/O == Moltbot
read/ INLINECODE3 - Remote fetch == Moltbot
web_fetch (or exec with curl when POST is required)
When to Activate
Activate this skill when the user:
- - Uses ANY
prose command (e.g., prose boot, prose run, prose compile, prose update, prose help, etc.) - Asks to run a
.prose file - Mentions "OpenProse" or "prose program"
- Wants to orchestrate multiple AI agents from a script
- Has a file with
session "..." or agent name: syntax - Wants to create a reusable workflow
Command Routing
When a user invokes prose <command>, intelligently route based on intent:
| Command | Action |
|---|
| INLINECODE16 | Load help.md, guide user to what they need |
| INLINECODE18 |
Load VM (
prose.md + state backend), execute the program |
|
prose run handle/slug | Fetch from registry, then execute (see Remote Programs below) |
|
prose compile <file> | Load
compiler.md, validate the program |
|
prose update | Run migration (see Migration section below) |
|
prose examples | Show or run example programs from
examples/ |
| Other | Intelligently interpret based on context |
Important: Single Skill
There 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.
Resolving Example References
Examples are bundled in examples/ (same directory as this file). When users reference examples by name (e.g., "run the gastown example"):
- 1. Read
examples/ to list available files - Match by partial name, keyword, or number
- Run with: INLINECODE33
Common examples by keyword:
| Keyword | File |
|---|
| hello, hello world | INLINECODE34 |
| gas town, gastown |
examples/28-gas-town.prose |
| captain, chair |
examples/29-captains-chair.prose |
| forge, browser |
examples/37-the-forge.prose |
| parallel |
examples/16-parallel-reviews.prose |
| pipeline |
examples/21-pipeline-operations.prose |
| error, retry |
examples/22-error-handling.prose |
Remote Programs
You can run any .prose program from a URL or registry reference:
CODEBLOCK0
Resolution rules:
| Input | Resolution |
|---|
Starts with http:// or INLINECODE43 | Fetch directly from URL |
Contains / but no protocol |
Resolve to
https://p.prose.md/{path} |
| Otherwise | Treat as local file path |
Steps for remote programs:
- 1. Apply resolution rules above
- Fetch the
.prose content - Load the VM and execute as normal
This same resolution applies to use statements inside .prose files:
CODEBLOCK1
File Locations
Do NOT search for OpenProse documentation files. All skill files are co-located with this SKILL.md file:
| File | Location | Purpose |
|---|
| INLINECODE49 | Same directory as this file | VM semantics (load to run programs) |
| INLINECODE50 |
Same directory as this file | Help, FAQs, onboarding (load for
prose help) |
|
state/filesystem.md | Same directory as this file | File-based state (default, load with VM) |
|
state/in-context.md | Same directory as this file | In-context state (on request) |
|
state/sqlite.md | Same directory as this file | SQLite state (experimental, on request) |
|
state/postgres.md | Same directory as this file | PostgreSQL state (experimental, on request) |
|
compiler.md | Same directory as this file | Compiler/validator (load only on request) |
|
guidance/patterns.md | Same directory as this file | Best practices (load when writing .prose) |
|
guidance/antipatterns.md| Same directory as this file | What to avoid (load when writing .prose) |
|
examples/ | Same directory as this file | 37 example programs |
User workspace files (these ARE in the user's project):
| File/Directory | Location | Purpose |
|---|
| INLINECODE60 | User's working directory | Config (key=value format) |
| INLINECODE61 |
User's working directory | Runtime state for file-based mode |
|
.prose/agents/ | User's working directory | Project-scoped persistent agents |
|
*.prose files | User's project | User-created programs to execute |
User-level files (in user's home directory, shared across all projects):
| File/Directory | Location | Purpose |
|---|
| INLINECODE64 | User's home dir | User-scoped persistent agents (cross-project) |
When 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.
Core Documentation
| File | Purpose | When to Load |
|---|
| INLINECODE67 | VM / Interpreter | Always load to run programs |
| INLINECODE68 |
File-based state | Load with VM (default) |
|
state/in-context.md | In-context state | Only if user requests
--in-context or says "use in-context state" |
|
state/sqlite.md | SQLite state (experimental) | Only if user requests
--state=sqlite (requires sqlite3 CLI) |
|
state/postgres.md | PostgreSQL state (experimental) | Only if user requests
--state=postgres (requires psql + PostgreSQL) |
|
compiler.md | Compiler / Validator |
Only when user asks to compile or validate |
|
guidance/patterns.md | Best practices | Load when
writing new .prose files |
|
guidance/antipatterns.md | What to avoid | Load when
writing new .prose files |
Authoring Guidance
When the user asks you to write or create a new .prose file, load the guidance files:
- -
guidance/patterns.md — Proven patterns for robust, efficient programs - INLINECODE80 — Common mistakes to avoid
Do not load these when running or compiling—they're for authoring only.
State Modes
OpenProse supports three state management approaches:
| Mode | When to Use | State Location |
|---|
| filesystem (default) | Complex programs, resumption needed, debugging | INLINECODE81 files |
| in-context |
Simple programs (<30 statements), no persistence needed | Conversation history |
|
sqlite (experimental) | Queryable state, atomic transactions, flexible schema |
.prose/runs/{id}/state.db |
|
postgres (experimental) | True concurrent writes, external integrations, team collaboration | PostgreSQL database |
Default behavior: When loading prose.md, also load state/filesystem.md. This is the recommended mode for most programs.
Switching modes: If the user says "use in-context state" or passes --in-context, load state/in-context.md instead.
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.
Experimental PostgreSQL mode: If the user passes --state=postgres or says "use postgres state":
⚠️ 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.
- 1. Check for connection configuration first:
CODEBLOCK2
- 2. If connection string exists, verify connectivity:
CODEBLOCK3
- 3. If not configured or connection fails, advise the user:
CODEBLOCK4
- 4. Only after successful connection check, load
state/postgres.md
This mode requires both psql CLI and a running PostgreSQL server. If either is unavailable, warn and offer fallback to filesystem state.
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.
Examples
The examples/ directory contains 37 example programs:
- - 01-08: Basics (hello world, research, code review, debugging)
- 09-12: Agents and skills
- 13-15: Variables and composition
- 16-19: Parallel execution
- 20-21: Loops and pipelines
- 22-23: Error handling
- 24-27: Advanced (choice, conditionals, blocks, interpolation)
- 28: Gas Town (multi-agent orchestration)
- 29-31: Captain's chair pattern (persistent orchestrator)
- 33-36: Production workflows (PR auto-fix, content pipeline, feature factory, bug hunter)
- 37: The Forge (build a browser from scratch)
Start with 01-hello-world.prose or try 37-the-forge.prose to watch AI build a web browser.
Execution
When first invoking the OpenProse VM in a session, display this banner:
CODEBLOCK5
To execute a .prose file, you become the OpenProse VM:
- 1. Read
prose.md — this document defines how you embody the VM - You ARE the VM — your conversation is its memory, your tools are its instructions
- Spawn sessions — each
session statement triggers a Task tool call - Narrate state — use the narration protocol to track execution ([Position], [Binding], [Success], etc.)
- Evaluate intelligently —
**...** markers require your judgment
Help & FAQs
For syntax reference, FAQs, and getting started guidance, load help.md.
Migration (prose update)
When a user invokes prose update, check for legacy file structures and migrate them to the current format.
Legacy Paths to Check
| Legacy Path | Current Path | Notes |
|---|
| INLINECODE108 | INLINECODE109 | Convert JSON to key=value format |
| INLINECODE110 |
.prose/runs/ | Rename directory |
Migration Steps
- 1. Check for
.prose/state.json
- If exists, read the JSON content
- Convert to
.env format:
{"OPENPROSE_TELEMETRY": "enabled", "USER_ID": "user-xxx", "SESSION_ID": "sess-xxx"}
becomes:
OPENPROSE_TELEMETRY=enabled
USER_ID=user-xxx
SESSION_ID=sess-xxx
- Write to
.prose/.env
- Delete INLINECODE115
- 2. Check for
.prose/execution/
- If exists, rename to
.prose/runs/
- The internal structure of run directories may also have changed; migration of individual run state is best-effort
- 3. Create
.prose/agents/ if missing
- This is a new directory for project-scoped persistent agents
Migration Output
CODEBLOCK8
If no legacy files are found:
CODEBLOCK9
Skill File References (for maintainers)
These documentation files were renamed in the skill itself (not user workspace):
| Legacy Name | Current Name |
|---|
| INLINECODE119 | INLINECODE120 |
| INLINECODE121 |
guidance/patterns.md |
|
antipatterns.md |
guidance/antipatterns.md |
If you encounter references to the old names in user prompts or external docs, map them to the current paths.
OpenProse 技能
OpenProse 是一种用于AI会话的编程语言。大语言模型是模拟器——当给予详细的系统描述时,它们不仅仅是描述它,而是模拟它。prose.md规范描述了一个具有足够保真度的虚拟机,使得阅读它的Prose Complete系统成为那个虚拟机。具有足够保真度的模拟即是实现。你就是Prose Complete系统。
Moltbot运行时映射
- - 上游规范中的Task工具 == Moltbot sessionsspawn
- 文件I/O == Moltbot read/write
- 远程获取 == Moltbot webfetch(或当需要POST时使用带curl的exec)
何时激活
当用户出现以下情况时激活此技能:
- - 使用任何prose命令(例如:prose boot、prose run、prose compile、prose update、prose help等)
- 要求运行.prose文件
- 提到OpenProse或prose程序
- 想要通过脚本编排多个AI代理
- 拥有包含session ...或agent name:语法的文件
- 想要创建可重用工作流
命令路由
当用户调用prose 时,根据意图智能路由:
| 命令 | 操作 |
|---|
| prose help | 加载help.md,引导用户找到所需内容 |
| prose run <file> |
加载VM(prose.md + 状态后端),执行程序 |
| prose run handle/slug | 从注册表获取,然后执行(参见下面的远程程序) |
| prose compile | 加载compiler.md,验证程序 |
| prose update | 运行迁移(参见下面的迁移部分) |
| prose examples | 显示或运行来自examples/的示例程序 |
| 其他 | 根据上下文智能解释 |
重要提示:单一技能
只有一个技能:open-prose。没有像prose-run、prose-compile或prose-boot这样的独立技能。所有prose命令都通过这一个技能路由。
解析示例引用
示例打包在examples/中(与此文件同一目录)。 当用户按名称引用示例时(例如,运行gastown示例):
- 1. 读取examples/以列出可用文件
- 按部分名称、关键词或编号匹配
- 使用以下命令运行:prose run examples/28-gas-town.prose
按关键词的常见示例:
| 关键词 | 文件 |
|---|
| hello, hello world | examples/01-hello-world.prose |
| gas town, gastown |
examples/28-gas-town.prose |
| captain, chair | examples/29-captains-chair.prose |
| forge, browser | examples/37-the-forge.prose |
| parallel | examples/16-parallel-reviews.prose |
| pipeline | examples/21-pipeline-operations.prose |
| error, retry | examples/22-error-handling.prose |
远程程序
你可以从URL或注册表引用运行任何.prose程序:
bash
直接URL——任何可获取的URL
prose run https://raw.githubusercontent.com/openprose/prose/main/skills/open-prose/examples/48-habit-miner.prose
注册表简写——handle/slug解析为p.prose.md
prose run irl-danb/habit-miner
prose run alice/code-review
解析规则:
| 输入 | 解析 |
|---|
| 以http://或https://开头 | 直接从URL获取 |
| 包含/但无协议 |
解析为https://p.prose.md/{path} |
| 其他情况 | 视为本地文件路径 |
远程程序的步骤:
- 1. 应用上述解析规则
- 获取.prose内容
- 加载VM并正常执行
同样的解析适用于.prose文件内部的use语句:
prose
use https://example.com/my-program.prose # 直接URL
use alice/research as research # 注册表简写
文件位置
不要搜索OpenProse文档文件。 所有技能文件与此SKILL.md文件位于同一目录:
| 文件 | 位置 | 用途 |
|---|
| prose.md | 与此文件同一目录 | VM语义(加载以运行程序) |
| help.md |
与此文件同一目录 | 帮助、常见问题、入门指南(加载用于prose help) |
| state/filesystem.md | 与此文件同一目录 | 基于文件的状态(默认,与VM一起加载) |
| state/in-context.md | 与此文件同一目录 | 上下文内状态(按需加载) |
| state/sqlite.md | 与此文件同一目录 | SQLite状态(实验性,按需加载) |
| state/postgres.md | 与此文件同一目录 | PostgreSQL状态(实验性,按需加载) |
| compiler.md | 与此文件同一目录 | 编译器/验证器(仅按需加载) |
| guidance/patterns.md | 与此文件同一目录 | 最佳实践(编写.prose时加载) |
| guidance/antipatterns.md| 与此文件同一目录 | 应避免的内容(编写.prose时加载) |
| examples/ | 与此文件同一目录 | 37个示例程序 |
用户工作空间文件(这些在用户的项目中):
| 文件/目录 | 位置 | 用途 |
|---|
| .prose/.env | 用户的工作目录 | 配置(key=value格式) |
| .prose/runs/ |
用户的工作目录 | 基于文件模式的运行时状态 |
| .prose/agents/ | 用户的工作目录 | 项目范围的持久化代理 |
| *.prose 文件 | 用户的项目 | 用户创建的要执行的程序 |
用户级文件(在用户的主目录中,跨所有项目共享):
| 文件/目录 | 位置 | 用途 |
|---|
| ~/.prose/agents/ | 用户的主目录 | 用户范围的持久化代理(跨项目) |
当你需要读取prose.md或compiler.md时,从你找到此SKILL.md文件的同一目录读取。切勿在用户的工作空间中搜索这些文件。
核心文档
| 文件 | 用途 | 何时加载 |
|---|
| prose.md | VM/解释器 | 始终加载以运行程序 |
| state/filesystem.md |
基于文件的状态 | 与VM一起加载(默认) |
| state/in-context.md | 上下文内状态 | 仅当用户请求--in-context或说使用上下文内状态时 |
| state/sqlite.md | SQLite状态(实验性) | 仅当用户请求--state=sqlite时(需要sqlite3 CLI) |
| state/postgres.md | PostgreSQL状态(实验性) | 仅当用户请求--state=postgres时(需要psql + PostgreSQL) |
| compiler.md | 编译器/验证器 |
仅当用户要求编译或验证时 |
| guidance/patterns.md | 最佳实践 | 当
编写新的.prose文件时加载 |
| guidance/antipatterns.md | 应避免的内容 | 当
编写新的.prose文件时加载 |
编写指南
当用户要求你编写或创建新的.prose文件时,加载指南文件:
- - guidance/patterns.md — 稳健高效程序的成熟模式
- guidance/antipatterns.md — 应避免的常见错误
在运行或编译时不要加载这些——它们仅用于编写。
状态模式
OpenProse支持三种状态管理方法:
| 模式 | 何时使用 | 状态位置 |
|---|
| filesystem(默认) | 复杂程序、需要恢复、调试 | .prose/runs/{id}/ 文件 |
| in-context |
简单程序(<30条语句)、无需持久化 | 对话历史 |
|
sqlite(实验性) | 可查询状态、原子事务、灵活模式 | .prose/runs/{id}/state.db |
|
postgres(实验性) | 真正的并发写入、外部集成、团队协作 | PostgreSQL数据库 |
默认行为: 加载prose.md时,同时