pantheon-opencode 1.0.0 → 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 +24 -13
  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
package/README.md CHANGED
@@ -7,11 +7,11 @@
7
7
  <p align="center">
8
8
  <a href="CHANGELOG.md"><img src="https://img.shields.io/badge/version-v1.0.0-blue" alt="Version"></a>
9
9
  <a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue" alt="License"></a>
10
- <a href="docs/platforms/"><img src="https://img.shields.io/badge/platforms-vscode|opencode|claude|cursor|windsurf|cline|continue-green" alt="Platforms"></a>
10
+ <a href="docs/platforms/"><img src="https://img.shields.io/badge/platforms-opencode-green" alt="Platforms"></a>
11
11
  <a href="agents/README.md"><img src="https://img.shields.io/badge/agents-14-purple" alt="Agents"></a>
12
12
  <a href="skills/README.md"><img src="https://img.shields.io/badge/skills-14-orange" alt="Skills"></a>
13
13
  <a href="commands/"><img src="https://img.shields.io/badge/commands-14-red" alt="Commands"></a>
14
- <a href="docs/platforms/"><img src="https://img.shields.io/badge/built%20with-copilot|opencode|claude|cursor|windsurf|cline|continue-8250DF" alt="Built with"></a>
14
+ <a href="docs/platforms/"><img src="https://img.shields.io/badge/built%20with-opencode-8250DF" alt="Built with"></a>
15
15
  <a href="https://github.com/ils15/pantheon/actions"><img src="https://img.shields.io/github/actions/workflow/status/ils15/pantheon/ci.yml?branch=main&label=CI" alt="CI"></a>
16
16
  <a href="https://github.com/ils15/pantheon/actions"><img src="https://img.shields.io/github/actions/workflow/status/ils15/pantheon/release.yml?branch=main&label=release" alt="Release"></a>
17
17
  </p>
@@ -20,7 +20,7 @@
20
20
 
21
21
  Stop settling for generalist single-agent coding. Pantheon's conductor-delegate architecture dispatches expert agents with isolated context windows — parallel execution, zero context bleed, and quality gates that block anything below 80% coverage.
22
22
 
23
- Supports **VS Code Copilot**, **OpenCode**, **Claude Code**, **Cursor**, **Windsurf**, **Cline**, and **Continue.dev**.
23
+ Supports **OpenCode** multi-agent orchestration for your editor.
24
24
 
25
25
  ---
26
26
 
@@ -51,13 +51,7 @@ Supports **VS Code Copilot**, **OpenCode**, **Claude Code**, **Cursor**, **Winds
51
51
  | 🔌 **MCP User Guide** | [docs/mcp-user-guide.md](docs/mcp-user-guide.md) — adding custom MCP servers |
52
52
  | 🗂️ **MCP Tiers** | `.pantheon/tiers.json` — 4-tier MCP selection (none/essential/recommended/full) |
53
53
  | ⚡ **Quick Start** | [docs/QUICKSTART.md](docs/QUICKSTART.md) |
54
- | 🖥️ **VS Code** | [docs/platforms/vscode.md](docs/platforms/vscode.md) |
55
54
  | ⚡ **OpenCode** | [docs/platforms/opencode.md](docs/platforms/opencode.md) |
56
- | 🤖 **Claude Code** | [docs/platforms/claude.md](docs/platforms/claude.md) |
57
- | 🔧 **Cursor** | [docs/platforms/cursor.md](docs/platforms/cursor.md) |
58
- | 🌊 **Windsurf** | [docs/platforms/windsurf.md](docs/platforms/windsurf.md) |
59
- | 🤖 **Cline** | [docs/platforms/cline.md](docs/platforms/cline.md) |
60
- | 🔄 **Continue.dev** | [docs/platforms/continue.md](docs/platforms/continue.md) |
61
55
 
62
56
  ---
63
57
 
@@ -194,26 +188,18 @@ flowchart TD
194
188
  - **OpenCode** — Pantheon v1.0 is OpenCode-only. [Installation guide](docs/INSTALLATION.md).
195
189
 
196
190
  ```bash
197
- # 1. Clone the repo
198
- git clone https://github.com/ils15/pantheon.git
199
- cd pantheon
200
- npm install
201
-
202
- # 2. Install Pantheon (choose your mode)
203
- npm run install:lite # agents + skills + instructions only (no MCP, no deps)
204
- npm run install:full # everything: agents + skills + MCP servers + venv
205
- npm run install:runtime # just MCP infrastructure (if agents already installed)
206
-
207
- # 3. Open your editor and test
208
- # OpenCode: @zeus in chat
209
- # Claude Code: @zeus
210
- # Cursor: @zeus in Agent mode
211
- # VS Code: @zeus in Copilot Chat
212
- # Cline: @zeus
213
- # Windsurf: @zeus in Cascade
191
+ # Install Pantheon globally
192
+ npx pantheon-opencode init
193
+
194
+ # (Optional) Install MCP servers + skills + TUI plugin
195
+ npm run setup
196
+
197
+ # Launch OpenCode with background subagents
198
+ export OPENCODE_EXPERIMENTAL_BACKGROUND_SUBAGENTS=true
199
+ opencode
214
200
  ```
215
201
 
216
- > **Lite vs Full:** `install:lite` is fast (~5s) and installs only the agent files. `install:full` also creates a Python venv and installs MCP servers (includes `pantheon-memory` for vector search and `pantheon-persistence` for KV cache). Choose lite if you just want the agents without MCP infrastructure.
202
+ > **Minimal vs Full:** `npx pantheon-opencode init --no-mcp` installs only agents (~2s). `npx pantheon-opencode init` (without `--no-mcp`) also creates a Python venv and installs MCP servers (includes `pantheon-memory` for vector search and `pantheon-persistence` for KV cache).
217
203
 
218
204
  ---
219
205
 
@@ -472,7 +458,7 @@ subscription (OpenCode Go, Copilot Pro, Claude Pro, etc.).
472
458
  ### /forge — Model Presets
473
459
 
474
460
  Pantheon ships with **`/forge`** — a model configuration command that applies named presets from
475
- `platform/forge.json`. Each preset maps 4 tiers to concrete models across all 14 agents.
461
+ `built-in presets`. Each preset maps 4 tiers to concrete models across all 14 agents.
476
462
 
477
463
  **Usage:**
478
464
  ```
@@ -503,43 +489,36 @@ Pantheon ships with **`/forge`** — a model configuration command that applies
503
489
 
504
490
  > 🤔 = thinking habilitado
505
491
 
506
- See `platform/forge.json` for full preset definitions and `docs/platforms/` for per-platform setup guides.
492
+ Built-in presets available (opencode-go, deepseek-flash, etc.) and `docs/platforms/` for per-platform setup guides.
507
493
 
508
494
  ---
509
495
 
510
496
  ## Quick Start
511
497
 
512
- ### 1. Choose your platform
498
+ ### 1. Install Pantheon
513
499
 
514
- Pantheon supports OpenCode. Pick the one that matches your editor:
500
+ Pantheon runs on **OpenCode**. Install it globally:
515
501
 
516
- - **VS Code Copilot** — native `.agent.md` files, full subagent orchestration, lifecycle hooks
517
- - **OpenCode** — config-based agent loading, permission blocks, tool mapping adapter
518
- - **Claude Code** — CLI-based, agent handoff workflow, skills via markdown rules
519
- - **Cursor** — `.mdc` rules with `alwaysApply` and `globs` for Agent mode
520
- - **Windsurf** — markdown agent definitions with workflow support (preview)
521
- - **Cline** — custom agent definitions with skills via instruction files
522
- - **Continue.dev** — IDE-agnostic rule-based agent configuration with markdown skills
502
+ ```bash
503
+ npx pantheon-opencode init
504
+ ```
523
505
 
524
- > Follow the [Platform Setup Guides](docs/platforms/) for your chosen platform.
506
+ For MCP servers (memory, persistence):
525
507
 
526
- ### 2. Set up the framework
508
+ ```bash
509
+ npm run setup
510
+ ```
527
511
 
528
- Installation varies by platform, but generally involves:
512
+ ### 2. Launch OpenCode
529
513
 
530
514
  ```bash
531
- git clone https://github.com/ils15/pantheon.git
532
- cd pantheon
533
-
534
- # Optional: install dependencies for sync/install tools
535
- npm install
515
+ export OPENCODE_EXPERIMENTAL_BACKGROUND_SUBAGENTS=true
516
+ opencode
536
517
  ```
537
518
 
538
- Then run the platform-specific installer from the guides above.
539
-
540
519
  ### 3. Run your first feature
541
520
 
542
- Once agents are loaded in your editor, invoke the orchestrator:
521
+ Once agents are loaded, invoke the orchestrator:
543
522
 
544
523
  ```
545
524
  @zeus: Implement JWT authentication with refresh tokens and rate limiting
@@ -555,24 +534,25 @@ Zeus will:
555
534
 
556
535
  ## Commands
557
536
 
558
- Pantheon provides slash commands via OpenCode. On other platforms (Copilot, Cursor, Claude Code), use natural language with the agent name.
559
-
560
- | Command | Agent | Description |
561
- |---------|-------|-------------|
562
- | `/pantheon` | zeus | Multi-perspective synthesis (Council) via inline agents |
563
- | `/pantheon-install` | zeus | Sync + install + verify pipeline with `--tier` (none/essential/recommended/full), `--backup`, `--detect`, `--dry-run` |
564
- | `/pantheon-update` | iris | Version bump + changelog + git tag + GitHub Release |
565
- | `/pantheon-deepwork` | zeus | Heavy multi-phase task with persisted checkpoints |
566
- | `/pantheon-reflect` | zeus | Analyze repeated work friction, suggest improvements |
567
- | `/pantheon-focus` | zeus | Pin a session goal |
568
- | `/pantheon-sketch` | athena | Turn rough idea into spec |
569
- | `/pantheon-audit` | themis | Code review + security audit |
570
- | `/pantheon-optimize` | zeus | Context optimization & token audit |
571
- | `/pantheon-metamorphosis` | zeus | Intelligent refactoring with TDD |
572
- | `/pantheon-status` | zeus | Show system health and agent status |
573
- | `/cancel` | zeus | Stop auto-continuation |
574
-
575
- > **Multi-platform note:** Commands are native to OpenCode. On VS Code Copilot, use `@agent-name` in chat. On Cursor/Claude Code, describe the task in natural language.
537
+ Type these in the OpenCode chat:
538
+
539
+ | Command | Description |
540
+ |---------|-------------|
541
+ | `/pantheon` | Multi-perspective synthesis (Council) via inline agents |
542
+ | `/pantheon-audit` | Code review + security audit |
543
+ | `/pantheon-bg` | List background tasks |
544
+ | `/pantheon-consolidate` | Consolidate memory |
545
+ | `/pantheon-deepwork` | Heavy multi-phase task with persisted checkpoints |
546
+ | `/pantheon-doc` | Generate documentation |
547
+ | `/pantheon-focus` | Pin a session goal |
548
+ | `/pantheon-forget` | Compress/consolidate memories |
549
+ | `/pantheon-hash` | Hash edit verification |
550
+ | `/pantheon-optimize` | Context optimization & token audit |
551
+ | `/pantheon-remember` | Store in memory |
552
+ | `/pantheon-search` | Search memory |
553
+ | `/pantheon-status` | Show system health and agent status |
554
+ | `/pantheon-todo` | Create and maintain task list |
555
+
576
556
 
577
557
  ### TUI Sidebar Plugin (OpenCode) — Temporarily Disabled
578
558
 
@@ -682,20 +662,14 @@ pantheon/
682
662
  │ ├── README.md
683
663
  │ └── dynamic/ * generated prompts
684
664
 
685
- ├── platform/ — platform-specific configurations
665
+ ├── platform/ — OpenCode-only configuration
686
666
  │ ├── optimize-context.sh * context optimization script
687
- ├── copilot/ * VS Code Copilot configs
688
- │ ├── opencode/ * OpenCode configs
689
- │ ├── claude/ * Claude Code configs & agents
690
- │ ├── cursor/ * Cursor rules
691
- │ ├── windsurf/ * Windsurf configs
692
- │ ├── continue/ * Continue.dev rules
693
- │ ├── cline/ * Cline configs
694
- │ └── _template/ * template for new platforms
667
+ └── opencode/ * OpenCode configs
695
668
 
696
669
  ├── scripts/ — tooling, automation & lifecycle hooks
697
- │ ├── install.mjs * multi-platform installer
698
- │ ├── sync-platforms.mjs * agent format sync engine
670
+ │ ├── postinstall.mjs * npm post-install hook
671
+ │ ├── doctor.mjs * health check CLI
672
+
699
673
  │ ├── validate-sync.mjs * sync integrity check
700
674
  │ └── hooks/ * agent lifecycle hooks (10 .sh scripts)
701
675
  │ ├── audit-imports.sh
@@ -709,7 +683,7 @@ pantheon/
709
683
  │ ├── validate-talos-scope.sh
710
684
  │ └── validate-tool-safety.sh
711
685
 
712
- ├── commands/ # 19 interaction commands
686
+ ├── commands/ # 14 interaction commands
713
687
  │ ├── cancel.md
714
688
  │ ├── pantheon-audit.md
715
689
  │ ├── pantheon-deepwork.md
@@ -729,14 +703,8 @@ pantheon/
729
703
  │ ├── PLATFORMS.md — platform comparison
730
704
  │ ├── RELEASING.md — versioning & release process
731
705
  │ ├── INDEX.md — documentation index
732
- │ ├── platforms/ — platform-specific setup guides
733
- │ │ ├── vscode.md
734
- │ │ ├── opencode.md
735
- │ │ ├── claude.md
736
- │ │ ├── cursor.md
737
- │ │ ├── windsurf.md
738
- │ │ ├── cline.md
739
- │ │ └── continue.md
706
+ │ ├── platforms/ — OpenCode configuration guide
707
+ │ │ └── opencode.md
740
708
  │ └── memory-bank/ — project memory (Mnemosyne's domain)
741
709
  │ ├── 00-project.md * project overview
742
710
  │ ├── 01-active-context.md * current sprint focus (priority file)
@@ -745,7 +713,7 @@ pantheon/
745
713
  │ └── _tasks/ * sprint task records
746
714
 
747
715
  ├── template/ — project templates
748
- │ ├── CLAUDE.md
716
+
749
717
  │ └── README.md
750
718
 
751
719
  ├── logs/ — agent session audit logs
@@ -892,12 +860,6 @@ Create IMPLEMENTATION_SUMMARY.md with what we did
892
860
  3. Reference relevant agents in the skill body
893
861
  4. Invoke `@mnemosyne Update README skills table and count`
894
862
 
895
- ### Adding a new platform
896
-
897
- 1. Create `platform/<name>/` with platform-specific configs
898
- 2. Add a setup guide to `docs/platforms/<name>.md`
899
- 3. Extend `scripts/install.mjs` and `scripts/sync-platforms.mjs`
900
-
901
863
  ---
902
864
 
903
865
  ## Security & Privacy
@@ -930,16 +892,13 @@ The `.opencode/plugins/pantheon-hooks.ts` plugin bridges these shell scripts to
930
892
  ## FAQ
931
893
 
932
894
  **How much does this cost?**
933
- You need an existing subscription for your AI coding editor (Copilot, Claude Pro, Cursor
934
- Pro, or OpenCode). Pantheon itself is free and open-source (MIT).
895
+ You need an existing subscription for your AI coding editor (OpenCode). Pantheon itself is free and open-source (MIT).
935
896
 
936
- **Can I use this outside VS Code?**
937
- Yes — OpenCode supported (VS Code, OpenCode, Claude Code, Cursor, Windsurf, Cline, Continue.dev). See
938
- [Platform Setup Guides](docs/platforms/).
897
+ **Can I use this outside OpenCode?**
898
+ NoPantheon v1.0 is OpenCode-only. It uses OpenCode's native agent system, permission blocks, and MCP integration.
939
899
 
940
900
  **How are platform configs synced?**
941
- Edit `agents/*.agent.md` (the canonical format), then run `npm run sync`.
942
- The sync engine transforms agents into every platform's native format.
901
+ Edit `src/agents/*.agent.md` (the canonical format), then run the sync script to update platform copies.
943
902
 
944
903
  **Can I override Themis's code review?**
945
904
  You can proceed past the review gate even if Themis flags issues — except test coverage.
@@ -986,16 +945,9 @@ Pantheon draws from the broader multi-agent landscape while diverging in key way
986
945
  | [CHANGELOG.md](CHANGELOG.md) | Release history |
987
946
  | [docs/INSTALLATION.md](docs/INSTALLATION.md) | Generic installation guide |
988
947
  | [docs/platforms/](docs/platforms/) | Platform-specific setup guides (OpenCode) |
989
- | [docs/platforms/vscode.md](docs/platforms/vscode.md) | VS Code setup |
990
- | [docs/platforms/opencode.md](docs/platforms/opencode.md) | OpenCode setup |
991
- | [docs/platforms/claude.md](docs/platforms/claude.md) | Claude Code setup |
992
- | [docs/platforms/cursor.md](docs/platforms/cursor.md) | Cursor setup |
993
- | [docs/platforms/windsurf.md](docs/platforms/windsurf.md) | Windsurf setup |
994
- | [docs/platforms/cline.md](docs/platforms/cline.md) | Cline setup |
995
- | [docs/platforms/continue.md](docs/platforms/continue.md) | Continue.dev setup |
948
+ | [docs/platforms/opencode.md](docs/platforms/opencode.md) | OpenCode setup guide |
996
949
  | [agents/README.md](agents/README.md) | Agent directory |
997
950
  | [skills/README.md](skills/README.md) | Skill directory |
998
- | [docs/platforms/](docs/platforms/) | Per-platform setup guides |
999
951
  | [docs/mcp-tools.md](docs/mcp-tools.md) | Canonical MCP tool registry |
1000
952
  | [docs/mcp-user-guide.md](docs/mcp-user-guide.md) | Adding custom MCP servers |
1001
953
  | [docs/mcp-recommendations.md](docs/mcp-recommendations.md) | Recommended MCP servers per project type |
@@ -1,39 +1,36 @@
1
1
  #!/usr/bin/env node
2
+ /**
3
+ * pantheon-init.mjs — Pantheon OpenCode CLI entry point
4
+ *
5
+ * Usage: npx pantheon-opencode init [options]
6
+ *
7
+ * Thin CLI wrapper that parses arguments and delegates to
8
+ * installOpenCode() from scripts/install/opencode.mjs.
9
+ */
2
10
  import fs from 'fs';
3
11
  import path from 'path';
4
12
  import { fileURLToPath } from 'url';
5
- import { homedir, platform } from 'os';
6
- import { execSync } from 'child_process';
7
13
 
8
14
  const __dirname = path.dirname(fileURLToPath(import.meta.url));
9
15
  const ROOT = path.resolve(__dirname, '..');
10
- const CFG = path.join(homedir(), '.config', 'opencode');
16
+
17
+ const REQUIRED_NODE_MAJOR = 18;
18
+ if (parseInt(process.versions.node.split('.')[0], 10) < REQUIRED_NODE_MAJOR) {
19
+ console.error(`❌ Node.js >= ${REQUIRED_NODE_MAJOR} required (current: ${process.versions.node})`);
20
+ process.exit(1);
21
+ }
11
22
 
12
23
  function printUsage() {
13
- console.log('Pantheon Orchestrator — Multi-agent orchestration platform');
24
+ console.log('Pantheon OpenCode — Multi-agent orchestration platform');
14
25
  console.log('');
15
26
  console.log('Usage:');
16
- console.log(' npx pantheon-orchestrator init # Install globally');
17
- console.log(' npx pantheon-orchestrator init --project # Install in project');
18
- console.log(' npx pantheon-orchestrator init --dry-run # Preview only');
19
- console.log(' npx pantheon-orchestrator init --no-mcp # Skip MCP + venv');
20
- console.log(' npx pantheon-orchestrator init --force # Overwrite + recreate venv');
21
- console.log(' npx pantheon-orchestrator --help # Show this help');
22
- }
23
-
24
- function getPkgVersion() {
25
- try {
26
- const p = path.join(ROOT, 'package.json');
27
- return JSON.parse(fs.readFileSync(p, 'utf8')).version || '?';
28
- } catch { return '?'; }
29
- }
30
-
31
- function getAgentList() {
32
- const agentsDir = path.resolve(ROOT, 'src', 'agents');
33
- if (!fs.existsSync(agentsDir)) return [];
34
- return fs.readdirSync(agentsDir)
35
- .filter(f => f.endsWith('.md') && f !== 'README.md')
36
- .map(f => f.replace('.md', ''));
27
+ console.log(' npx pantheon-opencode init # Install globally');
28
+ console.log(' npx pantheon-opencode init --project # Install in project');
29
+ console.log(' npx pantheon-opencode init --dry-run # Preview only');
30
+ console.log(' npx pantheon-opencode init --no-mcp # Skip MCP + venv');
31
+ console.log(' npx pantheon-opencode init --force # Overwrite + recreate venv');
32
+ console.log(' npx pantheon-opencode init --doctor # Run health check after install');
33
+ console.log(' npx pantheon-opencode --help # Show this help');
37
34
  }
38
35
 
39
36
  async function main() {
@@ -47,132 +44,56 @@ async function main() {
47
44
  const isDryRun = args.includes('--dry-run');
48
45
  const skipMCP = args.includes('--no-mcp');
49
46
  const forceReinstall = args.includes('--force');
50
- const base = isProject
51
- ? path.join(process.cwd(), '.opencode')
52
- : CFG;
53
-
54
- const version = getPkgVersion();
55
- console.log(`Pantheon Orchestrator v${version} — ${isDryRun ? 'DRY RUN' : 'Installing...'}`);
56
- if (forceReinstall && !isDryRun) console.log(' 🔄 Force mode — overwriting existing files + recreating venv');
57
- console.log(`Target: ${base}${isProject ? ' (project-local)' : ' (global)'}`);
58
- console.log('');
59
-
60
- // Force: delete old venv to force clean install
61
- if (forceReinstall && !isDryRun) {
62
- const venvPath = path.join(base, '.venv');
63
- if (fs.existsSync(venvPath)) {
64
- fs.rmSync(venvPath, { recursive: true, force: true });
65
- }
66
- }
67
-
68
- // 1. Agents
69
- console.log(' Agents:');
70
- const agentList = getAgentList();
71
- let count = 0;
72
- for (const agent of agentList) {
73
- const s = path.join(ROOT, 'src', 'agents', `${agent}.md`);
74
- const d = path.join(base, 'agents', `${agent}.md`);
75
- if (fs.existsSync(s)) {
76
- if (!isDryRun) {
77
- fs.mkdirSync(path.join(base, 'agents'), { recursive: true });
78
- fs.copyFileSync(s, d);
79
- }
80
- count++;
81
- }
82
- }
83
- console.log(` ${count} agent files → ${isDryRun ? '(preview)' : `${base}/agents/`}`);
47
+ const runDoctor = args.includes('--doctor');
84
48
 
85
- // 2. Skills
86
- console.log(' Skills:');
87
- const skillsSrc = path.resolve(ROOT, 'src', 'skills');
88
- if (fs.existsSync(skillsSrc)) {
89
- const skills = fs.readdirSync(skillsSrc).filter(f => fs.statSync(path.join(skillsSrc, f)).isDirectory());
90
- if (!isDryRun) {
91
- for (const skill of skills) {
92
- const s = path.join(skillsSrc, skill);
93
- const d = path.join(base, 'skills', skill);
94
- fs.cpSync(s, d, { recursive: true, force: true });
95
- }
96
- }
97
- console.log(` ${skills.length} skills → ${isDryRun ? '(preview)' : `${base}/skills/`}`);
98
- }
49
+ const components = ['agents', 'skills', 'instructions', 'commands', 'plugins'];
50
+ if (!skipMCP) components.push('runtime');
99
51
 
100
- // 3. Instructions
101
- console.log(' Instructions:');
102
- const instrSrc = path.resolve(ROOT, 'src', 'instructions');
103
- if (fs.existsSync(instrSrc)) {
104
- const instrs = fs.readdirSync(instrSrc).filter(f => f.endsWith('.instructions.md'));
105
- if (!isDryRun) {
106
- fs.mkdirSync(path.join(base, 'instructions'), { recursive: true });
107
- for (const f of instrs) {
108
- fs.copyFileSync(path.join(instrSrc, f), path.join(base, 'instructions', f));
109
- }
110
- }
111
- console.log(` ${instrs.length} files → ${isDryRun ? '(preview)' : `${base}/instructions/`}`);
112
- }
52
+ // Version info
53
+ let version = '?';
54
+ try {
55
+ const pkgPath = path.join(ROOT, 'package.json');
56
+ version = JSON.parse(fs.readFileSync(pkgPath, 'utf8')).version || '?';
57
+ } catch { /* use default */ }
113
58
 
114
- // 4. Commands
115
- console.log(' Commands:');
116
- const cmdSrc = path.resolve(ROOT, 'commands');
117
- if (fs.existsSync(cmdSrc)) {
118
- const cmds = fs.readdirSync(cmdSrc).filter(f => f.endsWith('.md'));
119
- if (!isDryRun) {
120
- fs.mkdirSync(path.join(base, 'commands'), { recursive: true });
121
- for (const f of cmds) {
122
- fs.copyFileSync(path.join(cmdSrc, f), path.join(base, 'commands', f));
123
- }
124
- }
125
- console.log(` ${cmds.length} commands → ${isDryRun ? '(preview)' : `${base}/commands/`}`);
126
- }
127
-
128
- // 5. TUI plugin
129
- console.log(' TUI Plugin:');
130
- const tuiSrc = path.resolve(ROOT, 'src', 'plugins', 'tui');
131
- if (fs.existsSync(tuiSrc)) {
132
- if (!isDryRun) {
133
- fs.cpSync(tuiSrc, path.join(base, 'plugins', 'pantheon-tui'), { recursive: true, force: true });
134
- const tuiJson = path.join(base, 'tui.json');
135
- const tuiConfig = { $schema: 'https://opencode.ai/tui.json', plugin: ['plugins/pantheon-tui'] };
136
- fs.writeFileSync(tuiJson, JSON.stringify(tuiConfig, null, 2));
137
- }
138
- console.log(` Plugin → ${isDryRun ? '(preview)' : `${base}/plugins/pantheon-tui/`}`);
139
- console.log(` tui.json → ${isDryRun ? '(preview)' : `${base}/tui.json`}`);
140
- }
59
+ console.log(`Pantheon OpenCode v${version} — ${isDryRun ? 'DRY RUN' : 'Installing...'}`);
60
+ console.log('');
141
61
 
142
- // 6. AGENTS.md
143
- const agentsMd = path.resolve(ROOT, 'AGENTS.md');
144
- if (fs.existsSync(agentsMd) && !isDryRun) {
145
- fs.copyFileSync(agentsMd, path.join(base, 'AGENTS.md'));
62
+ try {
63
+ const { installOpenCode } = await import('../scripts/install/opencode.mjs');
64
+ const target = isProject ? process.cwd() : undefined;
65
+ installOpenCode(target, isDryRun, forceReinstall, components);
66
+ } catch (err) {
67
+ console.error(`❌ Installation failed:\n${err.stack}`);
68
+ process.exit(1);
146
69
  }
147
70
 
148
- // 7. .venv + MCP servers (skip if --no-mcp)
149
- if (!skipMCP && !isDryRun) {
71
+ if (runDoctor && !isDryRun) {
150
72
  console.log('');
151
- console.log(' MCP Servers + .venv...');
152
- const installScript = path.resolve(ROOT, 'scripts', 'install.mjs');
153
- if (fs.existsSync(installScript)) {
154
- try {
155
- execSync(`node "${installScript}" "${base}"`, { stdio: 'inherit', cwd: ROOT });
156
- } catch (e) {
157
- console.log(' ⚠️ MCP install issue (non-fatal):', e.message.split('\n')[0]);
158
- }
73
+ console.log(' Running health check...');
74
+ try {
75
+ const { spawnSync } = await import('child_process');
76
+ const doctorScript = path.join(ROOT, 'scripts', 'doctor.mjs');
77
+ spawnSync(process.execPath, [doctorScript], { stdio: 'inherit', cwd: ROOT });
78
+ } catch {
79
+ console.log(' ⚠️ Could not run doctor.mjs');
159
80
  }
160
81
  }
161
82
 
162
- // 8. Done
163
83
  console.log('');
164
84
  console.log('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━');
165
- console.log(` ✅ Pantheon Orchestrator v${version} installed!`);
85
+ console.log(` ✅ Pantheon OpenCode v${version} installed!`);
166
86
  console.log('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━');
167
87
  console.log('');
168
88
  console.log(' Next steps:');
169
- console.log(' 1. Enable background subagents:');
170
- console.log(' echo \'export OPENCODE_EXPERIMENTAL_BACKGROUND_SUBAGENTS=true\' >> ~/.zshrc');
171
- console.log(' 2. Launch OpenCode:');
172
- console.log(' source ~/.zshrc && opencode');
173
- console.log(' 3. Test background delegation:');
174
- console.log(' @zeus, dispatch 2 apollo in parallel to research');
89
+ console.log(' 1. Verify installation:');
90
+ console.log(' npx pantheon-opencode doctor');
91
+ console.log(' 2. Launch your AI coding tool (OpenCode, Claude Code, Cursor, etc.)');
92
+ console.log(' 3. Invoke agents with @agent-name in chat');
93
+ console.log(' 4. For project-local install:');
94
+ console.log(' npx pantheon-opencode init --project');
175
95
  console.log('');
96
+
176
97
  return;
177
98
  }
178
99
 
@@ -180,4 +101,4 @@ async function main() {
180
101
  process.exit(1);
181
102
  }
182
103
 
183
- main().catch(err => { console.error('Error:', err.message); process.exit(1); });
104
+ main().catch(err => { console.error('Error:', err.stack); process.exit(1); });
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  description: "Audit: heuristic scan (zero LLM) + Themis review. Usage: /pantheon-audit [--light|--full|--plan]"
3
- agent: "themis"
3
+ agent: "zeus"
4
4
  ---
5
5
  # /pantheon-audit — Quality & Security Audit
6
6