pantheon-opencode 1.0.0

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 (128) hide show
  1. package/AGENTS.md +37 -0
  2. package/LICENSE +21 -0
  3. package/README.md +1013 -0
  4. package/bin/pantheon-init.mjs +183 -0
  5. package/commands/pantheon-audit.md +25 -0
  6. package/commands/pantheon-bg.md +10 -0
  7. package/commands/pantheon-consolidate.md +11 -0
  8. package/commands/pantheon-deepwork.md +128 -0
  9. package/commands/pantheon-doc.md +10 -0
  10. package/commands/pantheon-focus.md +9 -0
  11. package/commands/pantheon-forget.md +58 -0
  12. package/commands/pantheon-hash.md +11 -0
  13. package/commands/pantheon-optimize.md +79 -0
  14. package/commands/pantheon-remember.md +44 -0
  15. package/commands/pantheon-search.md +48 -0
  16. package/commands/pantheon-status.md +71 -0
  17. package/commands/pantheon-todo.md +11 -0
  18. package/commands/pantheon.md +49 -0
  19. package/docs/AGENT-MCP.md +194 -0
  20. package/docs/ARCHITECTURE.md +384 -0
  21. package/docs/BRANCH-PROTECTION.md +142 -0
  22. package/docs/INDEX.md +81 -0
  23. package/docs/INSTALLATION.md +217 -0
  24. package/docs/MCP.md +238 -0
  25. package/docs/MEMORY.md +471 -0
  26. package/docs/MIGRATION-MEMORY-BANK.md +139 -0
  27. package/docs/PLATFORMS.md +5 -0
  28. package/docs/QUICKSTART.md +49 -0
  29. package/docs/README.md +18 -0
  30. package/docs/RELEASING.md +256 -0
  31. package/docs/SETUP.md +5 -0
  32. package/docs/UPGRADING.md +41 -0
  33. package/docs/mcp-recommendations.md +439 -0
  34. package/docs/mcp-tools.md +156 -0
  35. package/docs/mcp-user-guide.md +204 -0
  36. package/docs/persistence-mcp.md +111 -0
  37. package/package.json +72 -0
  38. package/pantheon.schema.json +158 -0
  39. package/scripts/__init__.py +0 -0
  40. package/scripts/_pantheon_paths.py +68 -0
  41. package/scripts/check-version-consistency.sh +23 -0
  42. package/scripts/code_mode_server.py +202 -0
  43. package/scripts/doctor.mjs +763 -0
  44. package/scripts/generate-prompts.sh +222 -0
  45. package/scripts/generate-routing-docs.mjs +104 -0
  46. package/scripts/hash_verify.py +192 -0
  47. package/scripts/init-pantheon-mcp.sh +118 -0
  48. package/scripts/install/agents-md.mjs +214 -0
  49. package/scripts/install/health-check.mjs +196 -0
  50. package/scripts/install/migrate.mjs +209 -0
  51. package/scripts/install/opencode.mjs +645 -0
  52. package/scripts/install/shared.mjs +655 -0
  53. package/scripts/install/venv.mjs +116 -0
  54. package/scripts/install-mcp.mjs +885 -0
  55. package/scripts/install.mjs +26 -0
  56. package/scripts/manifest.mjs +622 -0
  57. package/scripts/mcp_persistence_server.py +459 -0
  58. package/scripts/mcp_resources_server.py +206 -0
  59. package/scripts/memory_cache.py +78 -0
  60. package/scripts/memory_mcp_server.py +605 -0
  61. package/scripts/paths.py +64 -0
  62. package/scripts/prune_context.py +72 -0
  63. package/scripts/release-bundle.mjs +109 -0
  64. package/scripts/scrub-secrets.py +282 -0
  65. package/scripts/scrub_secrets.py +281 -0
  66. package/scripts/test-context-compression.sh +166 -0
  67. package/scripts/themis_heuristic_scan.py +287 -0
  68. package/scripts/todo_enforcer.py +242 -0
  69. package/scripts/uninstall.mjs +1057 -0
  70. package/scripts/validate-routing.mjs +160 -0
  71. package/scripts/validate_agent_frontmatter.py +226 -0
  72. package/scripts/versioning.mjs +254 -0
  73. package/skills-lock.json +16 -0
  74. package/src/agents/aphrodite.md +162 -0
  75. package/src/agents/apollo.md +109 -0
  76. package/src/agents/athena.md +226 -0
  77. package/src/agents/demeter.md +146 -0
  78. package/src/agents/gaia.md +82 -0
  79. package/src/agents/hephaestus.md +105 -0
  80. package/src/agents/hermes.md +302 -0
  81. package/src/agents/iris.md +99 -0
  82. package/src/agents/mnemosyne.md +226 -0
  83. package/src/agents/nyx.md +87 -0
  84. package/src/agents/prometheus.md +199 -0
  85. package/src/agents/talos.md +93 -0
  86. package/src/agents/themis.md +187 -0
  87. package/src/agents/zeus.md +209 -0
  88. package/src/instructions/agent-return-format.instructions.md +26 -0
  89. package/src/instructions/backend-standards.instructions.md +45 -0
  90. package/src/instructions/documentation-standards.instructions.md +53 -0
  91. package/src/instructions/frontend-standards.instructions.md +46 -0
  92. package/src/instructions/memory-protocol.instructions.md +67 -0
  93. package/src/instructions/yagni.instructions.md +21 -0
  94. package/src/instructions/zeus-anti-stall.instructions.md +72 -0
  95. package/src/instructions/zeus-communication-rules.instructions.md +15 -0
  96. package/src/instructions/zeus-council-synthesis.instructions.md +105 -0
  97. package/src/instructions/zeus-timeout-retry.instructions.md +127 -0
  98. package/src/mcp/_pantheon_paths.py +67 -0
  99. package/src/mcp/code_mode_server.py +202 -0
  100. package/src/mcp/init-pantheon-mcp.sh +118 -0
  101. package/src/mcp/install-mcp.mjs +885 -0
  102. package/src/mcp/mcp_persistence_server.py +458 -0
  103. package/src/mcp/mcp_resources_server.py +205 -0
  104. package/src/mcp/memory_mcp_server.py +604 -0
  105. package/src/mcp/requirements-mcp-core.txt +5 -0
  106. package/src/mcp/requirements-mcp.txt +5 -0
  107. package/src/plugin.ts +19 -0
  108. package/src/plugins/tui/dist/tui.js +143 -0
  109. package/src/plugins/tui/dist/tui.tsx +144 -0
  110. package/src/plugins/tui/package.json +32 -0
  111. package/src/plugins/tui/src/index.tsx +144 -0
  112. package/src/plugins/tui/tsdown.config.ts +22 -0
  113. package/src/routing.yml +499 -0
  114. package/src/skills/README.md +230 -0
  115. package/src/skills/agent-coordination/SKILL.md +95 -0
  116. package/src/skills/artifact-management/SKILL.md +118 -0
  117. package/src/skills/auto-continue/SKILL.md +280 -0
  118. package/src/skills/code-review-checklist/SKILL.md +139 -0
  119. package/src/skills/context-compression/SKILL.md +861 -0
  120. package/src/skills/git-workflow-and-versioning/SKILL.md +32 -0
  121. package/src/skills/incremental-implementation/SKILL.md +27 -0
  122. package/src/skills/memory-bank/SKILL.md +165 -0
  123. package/src/skills/orchestration-workflow/SKILL.md +311 -0
  124. package/src/skills/security-hardening/SKILL.md +36 -0
  125. package/src/skills/session-goal/SKILL.md +138 -0
  126. package/src/skills/spec-driven-development/SKILL.md +23 -0
  127. package/src/skills/tdd-with-agents/SKILL.md +170 -0
  128. package/src/skills/visual-review-pipeline/SKILL.md +200 -0
@@ -0,0 +1,499 @@
1
+ # routing.yml — Canonical Routing Source for Pantheon
2
+ # Version: 1.0 — Agent routing, delegation rules, and handoff contracts
3
+ version: 1.0
4
+
5
+ # Primary Delegation Flow
6
+ # ```mermaid
7
+ # flowchart LR
8
+ # Z[Zeus] --> A[Athena] --> AP[Apollo]
9
+ # Z --> H[Hermes] --> T[Themis]
10
+ # Z --> PH[Aphrodite] --> T
11
+ # Z --> D[Demeter] --> T
12
+ # Z --> R[Prometheus]
13
+ # Z --> HE[Hephaestus]
14
+ # Z --> N[Nyx]
15
+ # Z --> G[Gaia]
16
+ # Z --> I[Iris] --> M[Mnemosyne]
17
+ # Z --> M
18
+ # Z -.-> TA[Talos]
19
+ # T --> I
20
+ # T --> M
21
+ # ```
22
+ # Removed agents: argus, chiron, echo (merged/deprecated)
23
+
24
+ # AGENT REGISTRY — 14 active agents
25
+ agents:
26
+ zeus:
27
+ role: "Central orchestrator"
28
+ model_tier: default
29
+ reasoning_effort: medium
30
+ user_invocable: true
31
+ can_delegate: true
32
+ can_receive_delegation: true
33
+ capabilities:
34
+ - orchestration
35
+ - delegation
36
+ - context_conservation
37
+ - context_compression
38
+ - phase_management
39
+ - quality_gate_enforcement
40
+ - memory_recall
41
+ - pantheon_resources
42
+ - pantheon_code_mode
43
+ - pantheon_deepwork
44
+ subagent_can_delegate_to:
45
+ - athena
46
+ - apollo
47
+ - hermes
48
+ - aphrodite
49
+ - demeter
50
+ - themis
51
+ - prometheus
52
+ - hephaestus
53
+ - nyx
54
+ - gaia
55
+ - iris
56
+ - mnemosyne
57
+ - talos
58
+ skills:
59
+ - agent-coordination
60
+ - session-goal
61
+ - artifact-management
62
+ - context-compression
63
+ - auto-continue
64
+ - internet-search
65
+ - orchestration-workflow
66
+ - wisdom-accumulation
67
+
68
+ athena:
69
+ role: "Strategic planner"
70
+ model_tier: premium
71
+ reasoning_effort: high
72
+ user_invocable: true
73
+ can_delegate: true
74
+ can_receive_delegation: true
75
+ capabilities:
76
+ - strategic_planning
77
+ - tdd_planning
78
+ - architectural_design
79
+ - root_cause_analysis
80
+ - risk_assessment
81
+ - memory_recall
82
+ - pantheon_resources
83
+ subagent_can_delegate_to:
84
+ - apollo
85
+ skills:
86
+ - codemap
87
+ - init-deep
88
+ - interview
89
+ - metis-gap-analysis
90
+ - plan-architecture
91
+
92
+ apollo:
93
+ role: "Investigation scout"
94
+ model_tier: fast
95
+ reasoning_effort: low
96
+ user_invocable: false
97
+ can_delegate: false
98
+ can_receive_delegation: true
99
+ capabilities:
100
+ - codebase_discovery
101
+ - pattern_discovery
102
+ - dependency_research
103
+ - parallel_search
104
+ - codemap_generation
105
+ - memory_search
106
+ - pantheon_resources
107
+ subagent_can_delegate_to: []
108
+ skills:
109
+ - internet-search
110
+ - codemap
111
+
112
+ hermes:
113
+ role: "Backend specialist"
114
+ model_tier: default
115
+ reasoning_effort: medium
116
+ user_invocable: true
117
+ can_delegate: true
118
+ can_receive_delegation: true
119
+ capabilities:
120
+ - backend_implementation
121
+ - api_development
122
+ - service_layer
123
+ - async_programming
124
+ - obsolete_lib_detection
125
+ - memory_store
126
+ - pantheon_code_mode
127
+ skills:
128
+ - api-design-patterns
129
+ - cache-strategy
130
+ - database-optimization
131
+ - fastapi-async-patterns
132
+ - file-prompts
133
+ - quality-gate
134
+ - simplify
135
+ - streaming-patterns
136
+ - test-architecture
137
+ - tdd-with-agents
138
+
139
+ aphrodite:
140
+ role: "Frontend specialist"
141
+ model_tier: default
142
+ reasoning_effort: medium
143
+ user_invocable: true
144
+ can_delegate: false
145
+ can_receive_delegation: true
146
+ capabilities:
147
+ - frontend_implementation
148
+ - ui_component_design
149
+ - accessibility_audit
150
+ - responsive_design
151
+ - deprecated_npm_detection
152
+ - memory_store
153
+ - pantheon_resources_memory_bank
154
+ skills:
155
+ - frontend-analyzer
156
+ - nextjs-seo-optimization
157
+ - quality-gate
158
+ - simplify
159
+ - tdd-with-agents
160
+
161
+ demeter:
162
+ role: "Database specialist"
163
+ model_tier: default
164
+ reasoning_effort: medium
165
+ user_invocable: true
166
+ can_delegate: false
167
+ can_receive_delegation: true
168
+ capabilities:
169
+ - database_migration
170
+ - schema_design
171
+ - query_optimization
172
+ - n_plus_one_prevention
173
+ - index_strategy
174
+ - memory_store
175
+ - memory_recall
176
+ skills:
177
+ - database-migration
178
+ - database-optimization
179
+ - quality-gate
180
+ - cache-strategy
181
+ - simplify
182
+
183
+ themis:
184
+ role: "Quality gate"
185
+ model_tier: premium
186
+ reasoning_effort: high
187
+ user_invocable: true
188
+ can_delegate: true
189
+ can_receive_delegation: true
190
+ capabilities:
191
+ - code_review
192
+ - security_audit
193
+ - test_coverage_validation
194
+ - quality_gate
195
+ - dead_code_detection
196
+ - deprecation_audit
197
+ - memory_search
198
+ - pantheon_resources
199
+ subagent_can_delegate_to:
200
+ - mnemosyne
201
+ skills:
202
+ - code-review-checklist
203
+ - quality-gate
204
+ - security-audit-pro
205
+ - tdd-with-agents
206
+ - mcp-security
207
+
208
+ prometheus:
209
+ role: "Infrastructure specialist"
210
+ model_tier: default
211
+ reasoning_effort: medium
212
+ user_invocable: true
213
+ can_delegate: false
214
+ can_receive_delegation: true
215
+ capabilities:
216
+ - infrastructure_as_code
217
+ - docker_configuration
218
+ - ci_cd_pipelines
219
+ - deployment_strategy
220
+ - container_optimization
221
+ - pantheon_code_mode
222
+ - memory_store
223
+ skills:
224
+ - docker-best-practices
225
+ - agent-observability
226
+
227
+ hephaestus:
228
+ role: "AI pipelines"
229
+ model_tier: default
230
+ reasoning_effort: medium
231
+ user_invocable: true
232
+ can_delegate: false
233
+ can_receive_delegation: true
234
+ capabilities:
235
+ - rag_pipeline_design
236
+ - langchain_workflow
237
+ - vector_store_integration
238
+ - embedding_strategy
239
+ - ai_workflow_composition
240
+ - memory_search
241
+ skills:
242
+ - rag-pipelines
243
+ - mcp-server-development
244
+ - quality-gate
245
+ - agent-evaluation
246
+ - conversational-ai-design
247
+ - prompt-improver
248
+
249
+ nyx:
250
+ role: "Observability"
251
+ model_tier: fast
252
+ reasoning_effort: low
253
+ user_invocable: true
254
+ can_delegate: false
255
+ can_receive_delegation: true
256
+ capabilities:
257
+ - opentelemetry_setup
258
+ - token_cost_tracking
259
+ - agent_performance_analytics
260
+ - alerting
261
+ - monitoring_dashboards
262
+ - pantheon_resources_routing
263
+ skills:
264
+ - agent-evaluation
265
+ - agent-observability
266
+ - token-audit
267
+
268
+ gaia:
269
+ role: "Remote sensing"
270
+ model_tier: default
271
+ reasoning_effort: high
272
+ user_invocable: true
273
+ can_delegate: false
274
+ can_receive_delegation: true
275
+ capabilities:
276
+ - satellite_imagery_analysis
277
+ - spectral_indices
278
+ - land_cover_classification
279
+ - change_detection
280
+ - scientific_literature_review
281
+ - pantheon_resources
282
+ skills:
283
+ - remote-sensing-analysis
284
+ - internet-search
285
+
286
+ iris:
287
+ role: "GitHub operations"
288
+ model_tier: fast
289
+ reasoning_effort: low
290
+ user_invocable: true
291
+ can_delegate: false
292
+ can_receive_delegation: true
293
+ capabilities:
294
+ - branch_management
295
+ - pull_request_creation
296
+ - issue_tracking
297
+ - release_management
298
+ - changelog_generation
299
+ - pantheon_resources
300
+ subagent_can_delegate_to:
301
+ - mnemosyne
302
+ skills:
303
+ - artifact-management
304
+
305
+ mnemosyne:
306
+ role: "Memory bank"
307
+ model_tier: fast
308
+ reasoning_effort: low
309
+ user_invocable: true
310
+ can_delegate: true
311
+ can_receive_delegation: true
312
+ capabilities:
313
+ - memory_bank_management
314
+ - artifact_persistence
315
+ - adr_writing
316
+ - project_initialization
317
+ - sprint_documentation
318
+ - context_compression
319
+ - memory_store
320
+ - memory_recall
321
+ - pantheon_resources_memory_bank
322
+ subagent_can_delegate_to: []
323
+ skills:
324
+ - artifact-management
325
+ - handoff
326
+ - task-system
327
+ - context-compression
328
+
329
+ talos:
330
+ role: "Hotfix agent"
331
+ model_tier: fast
332
+ reasoning_effort: low
333
+ user_invocable: true
334
+ can_delegate: false
335
+ can_receive_delegation: true
336
+ capabilities:
337
+ - rapid_repair
338
+ - css_fix
339
+ - typo_correction
340
+ - minor_bug_fix
341
+ - escalation_detection
342
+ - pantheon_code_mode
343
+ subagent_can_delegate_to: []
344
+ skills:
345
+ - simplify
346
+
347
+ # AUTO-CONTINUE CONFIGURATION
348
+ # Checkpoint and heartbeat settings for autonomous sessions
349
+ auto_continue:
350
+ checkpoint_script: ".pantheon/code-mode/checkpoint-session.sh"
351
+ heartbeat_interval: 5
352
+ idle:
353
+ warning: 60
354
+ stall: 120
355
+ pause: 300
356
+
357
+ # DELEGATION RULES
358
+ # Implicit default: any agent can delegate to apollo for codebase discovery.
359
+ # Overrides are listed in agent subagent_can_delegate_to fields above.
360
+ # See instructions/zeus-timeout-retry.instructions.md for timeout/retry defaults.
361
+ # INTENT GATE — Heuristic request classification (zero LLM)
362
+ # Zeus classifies the request BEFORE delegating to the correct agent.
363
+ # Patterns are matched by keyword, not LLM call.
364
+ intent_gate:
365
+ fix:
366
+ patterns: ["bug", "error", "crash", "broken", "fail", "wrong", "incorrect"]
367
+ target: talos
368
+ research:
369
+ patterns: ["how", "what", "why", "where", "find", "search", "lookup", "documentation"]
370
+ target: apollo
371
+ investigate:
372
+ patterns: ["compare", "vs", "trade.?off", "should", "which", "risk", "impact"]
373
+ target: athena
374
+ plan:
375
+ patterns: ["plan", "roadmap", "architecture", "design", "proposal", "strategy"]
376
+ target: athena
377
+ implement:
378
+ patterns: []
379
+ target: hermes # default fallback
380
+
381
+ delegation:
382
+ zeus:
383
+ - target: athena
384
+ - target: apollo
385
+ - target: hermes
386
+ - target: aphrodite
387
+ - target: demeter
388
+ - target: themis
389
+ - target: prometheus
390
+ - target: hephaestus
391
+ - target: nyx
392
+ - target: gaia
393
+ - target: iris
394
+ - target: mnemosyne
395
+ - target: talos
396
+
397
+ # Delegation conventions (documentation only — not programmatically enforced):
398
+ # - Implementers → themis for code review
399
+ # - Themis → zeus (blockers/escalation) or mnemosyne (documentation)
400
+ # - Others → zeus or athena as appropriate
401
+
402
+ # HANDOFF DEFINITIONS — named contracts for delegation
403
+ handoffs:
404
+ zeus:
405
+ compress_context:
406
+ label: "🗜️ Compress Context"
407
+ description: "Compress completed subtask_summaries and archive IMPL/REVIEW artifacts after Themis approval"
408
+ agent: mnemosyne
409
+ prompt: "Compress completed phase artifacts (Level 2): create ZZ-phase{N}-context.md with priority-scored entries, write compressed entries to 01-active-context.md (priority-aware, budget-allocated), archive IMPL/REVIEW to 02-progress-log.md, update _xref/index.md cross-references."
410
+
411
+ # PLATFORM TOOL MAPPINGS
412
+ platforms:
413
+ opencode:
414
+ display_name: "OpenCode"
415
+ tools:
416
+ delegate_agent: "agent"
417
+ delegate_subagent: "task"
418
+ ask_user: "question"
419
+ search_codebase: "grep"
420
+ search_files: "glob"
421
+ read_file: "read"
422
+ run_bash: "bash"
423
+ web_fetch: "webfetch"
424
+ web_search: "websearch"
425
+ capabilities:
426
+ - agent_delegation
427
+ - subagent_delegation
428
+ - bash_execution
429
+ - web_fetch
430
+ - web_search
431
+
432
+ vscode:
433
+ display_name: "VS Code (GitHub Copilot)"
434
+ tools:
435
+ delegate_agent: "agent"
436
+ delegate_subagent: "task"
437
+ ask_user: "vscode/askQuestions"
438
+ search_codebase: "search/codebase"
439
+ search_usages: "search/usages"
440
+ search_files: "search/fileSearch"
441
+ search_text: "search/textSearch"
442
+ search_changes: "search/changes"
443
+ list_directory: "search/listDirectory"
444
+ read_file: "read/readFile"
445
+ read_problems: "read/problems"
446
+ edit_file: "edit/editFiles"
447
+ run_terminal: "execute/runInTerminal"
448
+ test_failure: "execute/testFailure"
449
+ get_terminal_output: "execute/getTerminalOutput"
450
+ web_fetch: "web/fetch"
451
+ browser_open: "browser/openBrowserPage"
452
+ browser_navigate: "browser/navigatePage"
453
+ browser_read: "browser/readPage"
454
+ browser_click: "browser/clickElement"
455
+ browser_type: "browser/typeInPage"
456
+ browser_hover: "browser/hoverElement"
457
+ browser_drag: "browser/dragElement"
458
+ browser_dialog: "browser/handleDialog"
459
+ browser_screenshot: "browser/screenshotPage"
460
+ capabilities:
461
+ - agent_delegation
462
+ - subagent_delegation
463
+ - file_editing
464
+ - terminal_execution
465
+ - web_fetch
466
+ - browser_automation
467
+
468
+ # ARTIFACT LIFECYCLE
469
+ # See skill: artifact-management for full lifecycle rules.
470
+ # Summary: PLAN, IMPL, REVIEW, DISC → .pantheon/memory-bank/.tmp/ (ephemeral, sprint-scoped).
471
+ # ADR → .pantheon/memory-bank/_notes/ (permanent). Subtask → inline, no artifact.
472
+
473
+ # MODEL FALLBACK CHAINS
474
+ # When an agent's primary model is rate-limited (429) or unavailable,
475
+ # the platform should attempt the next model in the chain.
476
+ # Chain pattern: Primary → Secondary → Emergency
477
+ # These chains are advisory — the platform's model routing determines
478
+ # actual fallback behavior at runtime.
479
+ fallback_chains:
480
+ premium_agents:
481
+ primary: "anthropic/claude-sonnet-4-20250514"
482
+ secondary: "openai/gpt-5.1"
483
+ emergency: "deepseek/deepseek-v4-pro"
484
+
485
+ default_agents:
486
+ primary: "anthropic/claude-sonnet-4-20250514"
487
+ secondary: "openai/gpt-4o"
488
+ emergency: "deepseek/deepseek-v4-pro"
489
+
490
+ fast_agents:
491
+ primary: "deepseek/deepseek-v4-pro"
492
+ secondary: "anthropic/claude-haiku-4-20250514"
493
+ emergency: "openai/gpt-4o-mini"
494
+
495
+ agent_overrides:
496
+ gaia:
497
+ primary: "anthropic/claude-sonnet-4-20250514"
498
+ secondary: "openai/gpt-4o"
499
+ emergency: "deepseek/deepseek-v4-pro"