pantheon-opencode 1.0.1 → 1.0.6

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.
Files changed (72) hide show
  1. package/README.md +61 -109
  2. package/bin/pantheon-init.mjs +57 -136
  3. package/commands/pantheon-audit.md +1 -1
  4. package/commands/pantheon-deepwork.md +32 -81
  5. package/commands/pantheon-reflect.md +16 -0
  6. package/commands/pantheon-status.md +1 -1
  7. package/commands/pantheon-verify.md +17 -0
  8. package/opencode.json +25 -0
  9. package/package.json +20 -9
  10. package/scripts/ci-validate-yaml.py +19 -0
  11. package/scripts/doctor.mjs +10 -65
  12. package/scripts/install/opencode.mjs +69 -6
  13. package/scripts/install/shared.mjs +39 -13
  14. package/scripts/manifest.mjs +5 -30
  15. package/scripts/postinstall.mjs +47 -0
  16. package/scripts/release-bundle.mjs +2 -2
  17. package/scripts/uninstall.mjs +5 -5
  18. package/scripts/validate-routing.mjs +19 -16
  19. package/scripts/versioning.mjs +12 -1
  20. package/skills-lock.json +9 -2
  21. package/src/agents/aphrodite.md +15 -57
  22. package/src/agents/apollo.md +9 -48
  23. package/src/agents/athena.md +17 -54
  24. package/src/agents/demeter.md +10 -47
  25. package/src/agents/gaia.md +7 -40
  26. package/src/agents/hephaestus.md +9 -52
  27. package/src/agents/hermes.md +17 -52
  28. package/src/agents/iris.md +8 -45
  29. package/src/agents/mnemosyne.md +12 -47
  30. package/src/agents/nyx.md +8 -45
  31. package/src/agents/prometheus.md +11 -49
  32. package/src/agents/talos.md +6 -45
  33. package/src/agents/themis.md +10 -35
  34. package/src/agents/zeus.md +5 -7
  35. package/src/mcp/mcp_resources_server.py +2 -0
  36. package/src/plugins/tui/dist/tui.tsx +203 -93
  37. package/src/plugins/tui/src/index.tsx +203 -93
  38. package/src/routing.yml +33 -93
  39. package/src/skills/clonedeps/SKILL.md +45 -0
  40. package/src/skills/codemap/SKILL.md +47 -0
  41. package/src/skills/loop-engineering/SKILL.md +51 -0
  42. package/src/skills/reflect/SKILL.md +49 -0
  43. package/src/skills/simplify/SKILL.md +39 -0
  44. package/src/skills/verification-planning/SKILL.md +52 -0
  45. package/src/skills/worktrees/SKILL.md +43 -0
  46. package/commands/pantheon-bg.md +0 -10
  47. package/commands/pantheon-consolidate.md +0 -11
  48. package/commands/pantheon-doc.md +0 -10
  49. package/commands/pantheon-hash.md +0 -11
  50. package/commands/pantheon-todo.md +0 -11
  51. package/docs/AGENT-MCP.md +0 -194
  52. package/docs/ARCHITECTURE.md +0 -384
  53. package/docs/BRANCH-PROTECTION.md +0 -142
  54. package/docs/INDEX.md +0 -81
  55. package/docs/INSTALLATION.md +0 -217
  56. package/docs/MCP.md +0 -238
  57. package/docs/MEMORY.md +0 -471
  58. package/docs/MIGRATION-MEMORY-BANK.md +0 -139
  59. package/docs/PLATFORMS.md +0 -5
  60. package/docs/QUICKSTART.md +0 -49
  61. package/docs/README.md +0 -18
  62. package/docs/RELEASING.md +0 -256
  63. package/docs/SETUP.md +0 -5
  64. package/docs/UPGRADING.md +0 -41
  65. package/docs/mcp-recommendations.md +0 -439
  66. package/docs/mcp-tools.md +0 -156
  67. package/docs/mcp-user-guide.md +0 -204
  68. package/docs/persistence-mcp.md +0 -111
  69. package/scripts/init-pantheon-mcp.sh +0 -118
  70. package/scripts/install.mjs +0 -26
  71. package/src/instructions/documentation-standards.instructions.md +0 -53
  72. package/src/mcp/init-pantheon-mcp.sh +0 -118
@@ -1,217 +0,0 @@
1
- # Pantheon Installation Guide — v1.0 (OpenCode)
2
-
3
- Pantheon v1.0 is **OpenCode-only**. It installs globally via `npx pantheon init` and works across all your projects.
4
-
5
- ## Prerequisites
6
-
7
- - **OpenCode v1.18.4+** — [Install OpenCode](https://opencode.ai/docs/install)
8
- - **Node.js 18+** — for `npx pantheon init`
9
- - **Python 3.11+** — for MCP servers (optional, `npm run install`)
10
- - **Git** — for version detection in TUI sidebar
11
-
12
- ## Quick Install
13
-
14
- ```bash
15
- # 1. Install Pantheon agents globally
16
- npx pantheon init
17
-
18
- # 2. (Optional) Install MCP servers + skills + TUI plugin
19
- npm run install
20
-
21
- # 3. Enable background subagents
22
- # Add to ~/.zshrc or ~/.bashrc:
23
- export OPENCODE_EXPERIMENTAL_BACKGROUND_SUBAGENTS=true
24
-
25
- # 4. Launch OpenCode with background subagents
26
- opencode
27
- ```
28
-
29
- ## Install Modes
30
-
31
- | Mode | Command | Installs | Time | Dependencies |
32
- |------|---------|----------|------|-------------|
33
- | **Agents only** 🟢 | `npx pantheon init` | agents + commands | ~2s | None |
34
- | **Full** 🔵 | `npx pantheon init && npm run install` | agents + MCPs + skills + TUI | ~60s | Python 3.11+ |
35
- | **Runtime** 🟡 | `npm run install` | MCP servers + venv | ~30s | Python 3.11+ |
36
-
37
- ```bash
38
- # Agents only — just the agent rules, no Python dependencies
39
- npx pantheon init
40
-
41
- # Full setup — agents + MCP servers (memory, persistence, resources)
42
- npx pantheon init
43
- npm run install
44
-
45
- # Add MCP servers to an existing agents-only install
46
- npm run install
47
- ```
48
-
49
- ## Global vs Project-Local
50
-
51
- By default, `npx pantheon init` installs agents **globally** to `~/.config/opencode/agents/`. This makes Pantheon available in all your projects.
52
-
53
- For project-local installation (e.g., team-shared config):
54
-
55
- ```bash
56
- npx pantheon init --project
57
- ```
58
-
59
- This installs to `.opencode/agents/` in the current project directory.
60
-
61
- ## Background Subagents
62
-
63
- Pantheon v1.0 supports **native OpenCode background delegation**. This allows dispatching up to 5 agents in parallel.
64
-
65
- **Requirement:** Set the environment variable before launching OpenCode:
66
-
67
- ```bash
68
- export OPENCODE_EXPERIMENTAL_BACKGROUND_SUBAGENTS=true
69
- opencode
70
- ```
71
-
72
- Or use the provided npm script:
73
-
74
- ```bash
75
- npm run start
76
- ```
77
-
78
- **How it works:**
79
-
80
- ```javascript
81
- // Dispatch a background task — returns immediately
82
- task(background=true, subagent_type="apollo", prompt="...")
83
- // → { task_id: "ses_xxx", state: "running" }
84
-
85
- // Collect results later
86
- task_status(task_id="ses_xxx", wait=true)
87
- // → { state: "completed", task_result: "..." }
88
- ```
89
-
90
- **Which agents run in background:**
91
-
92
- | Agent | Background? | Why |
93
- |-------|------------|-----|
94
- | Apollo, Hermes, Aphrodite, Demeter, Hephaestus, Prometheus | ✅ Yes | Independent, long-running work |
95
- | Athena, Themis | ❌ No | Need full session context |
96
- | Talos, Iris, Nyx, Mnemosyne, Gaia | ❌ No | Quick operations |
97
-
98
- ## TUI Sidebar Plugin
99
-
100
- Pantheon includes a TUI sidebar plugin showing:
101
-
102
- ```
103
- Pantheon v1.0.0
104
- ⎇ main
105
- ▶ Sessions (N total)
106
- ▶ Commands (11)
107
- ▶ Agents (14)
108
- ▶ Config — MCPs, Compaction
109
- ▶ Memory — Entry count
110
- ```
111
-
112
- The plugin is installed automatically during `npm run install`. It appears in the right sidebar of OpenCode TUI.
113
-
114
- ## Commands
115
-
116
- Type these in the OpenCode chat:
117
-
118
- | Command | Description |
119
- |---------|-------------|
120
- | `/pantheon` | Council synthesis |
121
- | `/pantheon-status` | System status |
122
- | `/pantheon-audit` | Full audit |
123
- | `/pantheon-bg` | List background tasks |
124
- | `/pantheon-deepwork` | Deep work mode |
125
- | `/pantheon-focus` | Focus on scope |
126
- | `/pantheon-optimize` | Optimize memory bank |
127
- | `/pantheon-doc` | Generate docs |
128
- | `/pantheon-remember` | Memory store/recall |
129
- | `/pantheon-search` | Memory search |
130
- | `/pantheon-forget` | Compress memories |
131
-
132
- ## Verification
133
-
134
- After installation, verify everything works:
135
-
136
- ```bash
137
- # 1. Check agents are installed
138
- ls ~/.config/opencode/agents/
139
- # Should show 14 .md files
140
-
141
- # 2. Check MCP servers
142
- ls ~/.config/opencode/scripts/
143
-
144
- # 3. Launch OpenCode with background subagents
145
- export OPENCODE_EXPERIMENTAL_BACKGROUND_SUBAGENTS=true
146
- opencode
147
-
148
- # 4. Test background delegation
149
- # Type: @zeus, task(background=true, subagent_type="apollo", prompt="test")
150
- ```
151
-
152
- ## Troubleshooting
153
-
154
- | Problem | Solution |
155
- |---------|----------|
156
- | Agents not found | Run `npx pantheon init` again |
157
- | MCP servers not starting | Check Python 3.11+, run `npm run install` |
158
- | Background delegation not available | Set `OPENCODE_EXPERIMENTAL_BACKGROUND_SUBAGENTS=true` before launching OpenCode |
159
- | TUI sidebar not showing | Check `~/.config/opencode/tui.json` has `"plugins/pantheon-tui"` |
160
- | Plugin not loading | Ensure `~/.config/opencode/plugins/pantheon-tui/dist/tui.tsx` exists |
161
-
162
- ## Installation Flow
163
-
164
- ```mermaid
165
- flowchart LR
166
- A["npx pantheon init"] --> B{"--project?"}
167
- B -->|No| C["~/.config/opencode/agents/ (global)"]
168
- B -->|Yes| D[".opencode/agents/ (project-local)"]
169
- C --> E["npm run install"]
170
- D --> E
171
- E --> F["MCP servers + skills + TUI"]
172
- F --> G["export OPENCODE_EXPERIMENTAL_BACKGROUND_SUBAGENTS=true"]
173
- G --> H["opencode"]
174
- H --> I["🚀 Pantheon v1.0 ready"]
175
- ```
176
-
177
- ## Background Delegation Flow
178
-
179
- ```mermaid
180
- sequenceDiagram
181
- participant Z as Zeus
182
- participant A as Apollo (bg)
183
- participant D as Demeter (bg)
184
- participant T as Themis (sync)
185
-
186
- Z->>+A: task(background=true, "discover")
187
- Z->>+D: task(background=true, "schema")
188
- Note over Z: Max 5 concurrent
189
-
190
- A-->>Z: task_status(wait=true) → result
191
- D-->>Z: task_status(wait=true) → result
192
-
193
- Z->>+T: task("review")
194
- Note over T: Athena/Themis NEVER background
195
- T-->>-Z: review complete
196
- ```
197
-
198
- ## TUI Sidebar Layout
199
-
200
- ```mermaid
201
- block-beta
202
- columns 1
203
- block["Pantheon v1.0.0"]
204
- block("⎇ main")
205
- end
206
- block Sessions["▶ Sessions (N total)"]
207
- end
208
- block Commands["▶ Commands (11)"]
209
- end
210
- block Agents["▶ Agents (14)"]
211
- end
212
- block Config["▶ Config"]
213
- end
214
- block Memory["▶ Memory"]
215
- end
216
- end
217
- ```
package/docs/MCP.md DELETED
@@ -1,238 +0,0 @@
1
- # Pantheon MCP Servers
2
-
3
- Pantheon provides 3 built-in MCP (Model Context Protocol) servers that enhance
4
- AI agent capabilities with persistent memory, resource discovery, and
5
- confined script execution. All three are local Python servers that auto-start
6
- with OpenCode.
7
-
8
- ---
9
-
10
- ## Server Comparison
11
-
12
- | Server | Tools | Resources | Purpose |
13
- |--------|-------|-----------|---------|
14
- | **pantheon-resources** | — | 3 static + 5 templates | Agent discovery, skills, routing, deepwork plans, memory-bank |
15
- | **pantheon-code-mode** | 1 | 1 static + 1 template | Confined script execution from `.pantheon/code-mode/` |
16
- | **pantheon-memory** | 14 | 2 static | Persistent memory with semantic search, recall, knowledge graph |
17
-
18
- ---
19
-
20
- ## Quick Start
21
-
22
- Add to your platform config (e.g., `opencode.json` or `.mcp.json`):
23
-
24
- ```json
25
- {
26
- "mcpServers": {
27
- "pantheon-resources": {
28
- "command": "python3",
29
- "args": ["scripts/mcp_resources_server.py"]
30
- },
31
- "pantheon-code-mode": {
32
- "command": "python3",
33
- "args": ["scripts/code_mode_server.py"]
34
- },
35
- "pantheon-memory": {
36
- "command": "python3",
37
- "args": ["scripts/memory_mcp_server.py"]
38
- }
39
- }
40
- }
41
- ```
42
-
43
- Restart your MCP client. The servers auto-start and connect.
44
-
45
- ### Permission Tiers
46
-
47
- In `opencode.json`, set auto-approve levels:
48
-
49
- ```json
50
- "permission": {
51
- "mcp": {
52
- "pantheon-resources": "allow",
53
- "pantheon-code-mode": "ask",
54
- "pantheon-memory": "allow"
55
- }
56
- }
57
- ```
58
-
59
- - **pantheon-resources** → `allow` (read-only, same trust boundary as repo)
60
- - **pantheon-code-mode** → `ask` (script execution needs explicit confirmation)
61
- - **pantheon-memory** → `allow` (read/write within agent sandbox)
62
-
63
- ---
64
-
65
- ## pantheon-resources
66
-
67
- **Script:** `scripts/mcp_resources_server.py`
68
-
69
- Read-only resource server exposing Pantheon framework metadata. No tools, only
70
- resources and resource templates accessible via `pantheon://` URIs.
71
-
72
- ### Static Resources
73
-
74
- | URI | Description |
75
- |-----|-------------|
76
- | `pantheon://routing` | Full content of `routing.yml` — canonical delegation rules, handoff contracts, agent registry |
77
- | `pantheon://agents` | List of all 14 Pantheon agents with roles from YAML frontmatter |
78
- | `pantheon://skills` | List of all Pantheon skills with descriptions |
79
-
80
- ### Resource Templates (Parameterized URIs)
81
-
82
- | URI Template | Description |
83
- |-------------|-------------|
84
- | `pantheon://agents/{agent_name}` | Content of a single agent file by name (case-insensitive) |
85
- | `pantheon://deepwork/{slug}` | `PLAN.md` content for a deepwork task slug |
86
- | `pantheon://deepwork/{slug}/status` | `STATUS.md` content for a deepwork task (or default IN_PROGRESS) |
87
- | `pantheon://memory-bank/{path}` | Content of a file within `.pantheon/memory-bank/` by relative path (path traversal blocked) |
88
- | `pantheon://skills/{name}` | Content of a skill's `SKILL.md` file by name |
89
-
90
- ### Usage
91
-
92
- ```python
93
- # Read via MCP resource URI
94
- read_mcp_resource(server="pantheon-resources", uri="pantheon://agents")
95
- read_mcp_resource(server="pantheon-resources", uri="pantheon://routing")
96
- read_mcp_resource(server="pantheon-resources", uri="pantheon://skills/hermes")
97
- ```
98
-
99
- ### Good For
100
-
101
- - Discovering which agents exist and their roles
102
- - Reading routing/delegation rules during orchestration
103
- - Loading skill instructions on demand
104
- - Checking deepwork plan status
105
- - Reading memory-bank files by path
106
-
107
- ---
108
-
109
- ## pantheon-code-mode
110
-
111
- **Script:** `scripts/code_mode_server.py`
112
-
113
- Confined script execution server. Runs `.sh` and `.py` scripts from
114
- `.pantheon/code-mode/` with a 30-second timeout.
115
-
116
- ### Tool
117
-
118
- | Tool | Description |
119
- |------|-------------|
120
- | `execute_code_script(script_name)` | Execute a script from `.pantheon/code-mode/` and return output |
121
-
122
- ### Resources
123
-
124
- | URI | Description |
125
- |-----|-------------|
126
- | `pantheon://code-mode/scripts` | List all available code-mode scripts |
127
- | `pantheon://code-mode/scripts/{name}` | View script content by name |
128
-
129
- ### Security Rules
130
-
131
- - Only `.sh` and `.py` files are allowed
132
- - Scripts must live in `.pantheon/code-mode/`
133
- - 30-second execution timeout
134
- - Permission tier set to `ask` (requires user confirmation)
135
- - Path traversal outside `.pantheon/code-mode/` is blocked
136
-
137
- ### How to Create a Script
138
-
139
- Create a `.sh` or `.py` file in `.pantheon/code-mode/`:
140
-
141
- ```bash
142
- #!/bin/bash
143
- # .pantheon/code-mode/deploy.sh
144
- echo "Deploying..."
145
- npm run build
146
- ```
147
-
148
- Then run it from an agent:
149
-
150
- ```
151
- execute_code_script("deploy.sh")
152
- ```
153
-
154
- ### Usage by Agent
155
-
156
- | Agent | Use Case |
157
- |-------|----------|
158
- | **zeus** | Automated orchestration sequences (build → test → deploy) |
159
- | **prometheus** | Docker builds, CI/CD pipelines, deployment scripts |
160
- | **hermes** | Test runner, lint automation |
161
- | **talos** | Hotfix automation, batch fixes |
162
-
163
- ---
164
-
165
- ## pantheon-memory
166
-
167
- **Script:** `scripts/memory_mcp_server.py`
168
-
169
- Persistent, multi-strategy memory server using ChromaDB + sentence-transformers
170
- (all-MiniLM-L6-v2) for local embeddings. Provides 14 tools and 2 resources.
171
-
172
- ### Tools (14)
173
-
174
- | Tool | Description |
175
- |------|-------------|
176
- | `memory_store` | Store a memory entry with metadata (category, agent, session, importance, links) |
177
- | `memory_search` | Search with dense vector similarity + freshness decay + importance boost |
178
- | `memory_recall` | Auto-recall: context → relevant memories as formatted prompt injection |
179
- | `memory_compress` | Compress oldest entries into summarized form (DCP-style range compression) |
180
- | `memory_expand` | Restore a compressed entry back to detailed form |
181
- | `memory_consolidate` | Merge duplicate/similar entries (cosine similarity threshold) |
182
- | `memory_delete` | Permanently delete a specific memory entry by ID |
183
- | `memory_update` | Update content and/or metadata of an existing entry |
184
- | `memory_link` | Create a bidirectional relationship between two entries |
185
- | `memory_traverse` | Walk the knowledge graph from an entry, following links up to max_depth |
186
- | `memory_verify` | Verify a claim: check entry exists and validate freshness |
187
- | `memory_sessions` | List all unique session IDs with entry count and latest timestamp |
188
- | `memory_export` | Export memories as formatted markdown, optionally scoped to a session |
189
- | `memory_cleanup` | Delete test/old sessions (prefix minimum 3 characters) |
190
-
191
- ### Resources
192
-
193
- | URI | Description |
194
- |-----|-------------|
195
- | `pantheon://memory/sessions` | List all sessions with entry counts and timestamps |
196
- | `pantheon://memory/status` | Memory server statistics: total entries, session count, disk usage |
197
-
198
- ### Tech Stack
199
-
200
- | Component | Implementation |
201
- |-----------|---------------|
202
- | Vector DB | ChromaDB `PersistentClient` → `~/.pantheon/memory/chroma.sqlite3` |
203
- | Embeddings | `sentence-transformers/all-MiniLM-L6-v2` (~80MB, offline, one-time download) |
204
- | Freshness decay | 30-day half-life (exponential, Shokunin-inspired) |
205
- | Compression | DCP-style range compression (deterministic, not LLM-based) |
206
- | Fusion scoring | Dense similarity + freshness boost + importance boost |
207
-
208
- ### Full Documentation
209
-
210
- See `docs/MEMORY.md` for complete usage guide with examples for all 14 tools.
211
-
212
- ---
213
-
214
- ## When to Use Which Server
215
-
216
- | Need | Server |
217
- |------|--------|
218
- | Read routing.yml, agent list, skill files | pantheon-resources |
219
- | Check deepwork plan or status | pantheon-resources (`pantheon://deepwork/{slug}`) |
220
- | Read memory-bank files | pantheon-resources (`pantheon://memory-bank/{path}`) |
221
- | Run a shell/Python script safely | pantheon-code-mode |
222
- | Store an important fact across sessions | pantheon-memory |
223
- | Find relevant past decisions | pantheon-memory |
224
- | Link related memories into a graph | pantheon-memory |
225
- | Auto-recall context at session start | pantheon-memory |
226
- | Export session memories as markdown | pantheon-memory |
227
-
228
- ---
229
-
230
- ## Troubleshooting
231
-
232
- | Symptom | Likely Cause | Fix |
233
- |---------|-------------|-----|
234
- | Server not found | Not in MCP config | Add to `opencode.json` → `mcp` or `.mcp.json` |
235
- | Connection refused | Python env issue | Verify `python3` has required deps (`chromadb`, `sentence-transformers`, `fastmcp`) |
236
- | `memory_recall` returns empty | No entries stored yet | First call `memory_store` with some content |
237
- | Code-mode script not found | Wrong path | Script must be in `.pantheon/code-mode/` |
238
- | Path traversal error | Invalid URI segment | Use flat filenames for `pantheon://memory-bank/{path}` (no nested `../`) |