pantheon-opencode 1.6.0-beta.1 → 1.6.0-beta.10

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 (120) hide show
  1. package/AGENTS.global.md +182 -0
  2. package/AGENTS.md +10 -891
  3. package/CHANGELOG.md +326 -0
  4. package/README.md +496 -32
  5. package/README.pt-BR.md +285 -20
  6. package/bin/pantheon-init.mjs +26 -3
  7. package/commands/pantheon-audit.md +7 -1
  8. package/commands/pantheon-consolidate.md +1 -1
  9. package/commands/pantheon-deepwork.md +14 -3
  10. package/commands/pantheon-focus.md +17 -0
  11. package/commands/pantheon-vision.md +61 -12
  12. package/package.json +21 -14
  13. package/plugin.json +2 -2
  14. package/pyproject.toml +8 -6
  15. package/scripts/build-agents-md.mjs +374 -56
  16. package/scripts/changelog-merge.mjs +161 -0
  17. package/scripts/{code_mode_server.py → code_mode.py} +3 -3
  18. package/scripts/cost.mjs +244 -41
  19. package/scripts/doctor.mjs +151 -1
  20. package/scripts/install/agents-md.mjs +4 -4
  21. package/scripts/install/config-migration.mjs +317 -4
  22. package/scripts/install/health-check.mjs +21 -19
  23. package/scripts/install/interactive.mjs +1 -1
  24. package/scripts/install/opencode-version.mjs +246 -4
  25. package/scripts/install/opencode.mjs +627 -179
  26. package/scripts/install/plugin.mjs +43 -9
  27. package/scripts/install/shared.mjs +120 -12
  28. package/scripts/install/vision-prompt.mjs +161 -0
  29. package/scripts/install-mcp.mjs +28 -9
  30. package/scripts/{mcp_persistence_server.py → mcp_persistence.py} +2 -2
  31. package/{src/mcp/mcp_resources_server.py → scripts/mcp_resources.py} +2 -2
  32. package/scripts/{memory_mcp_server.py → memory_mcp.py} +2 -2
  33. package/scripts/probe-context-rehydrate.mjs +8 -2
  34. package/scripts/probe-pantheon-cost.mjs +71 -15
  35. package/scripts/run-node-tests.mjs +189 -0
  36. package/scripts/sync-artifacts.mjs +26 -13
  37. package/scripts/sync-tui.mjs +24 -3
  38. package/scripts/test-opencode-v2-sandbox.sh +180 -26
  39. package/scripts/validate-routing.mjs +3 -3
  40. package/scripts/validate-sandbox-install.mjs +138 -0
  41. package/scripts/versioning.mjs +13 -1
  42. package/scripts/vision-status.mjs +682 -0
  43. package/skills-lock.json +8 -8
  44. package/src/agents/aphrodite.md +20 -37
  45. package/src/agents/apollo.md +7 -3
  46. package/src/agents/athena.md +63 -35
  47. package/src/agents/demeter.md +8 -28
  48. package/src/agents/gaia.md +1 -1
  49. package/src/agents/hephaestus.md +10 -21
  50. package/src/agents/hermes.md +15 -38
  51. package/src/agents/iris.md +1 -1
  52. package/src/agents/mnemosyne.md +18 -54
  53. package/src/agents/nyx.md +1 -1
  54. package/src/agents/prometheus.md +16 -20
  55. package/src/agents/talos.md +10 -2
  56. package/src/agents/themis.md +5 -5
  57. package/src/agents/zeus.md +99 -129
  58. package/src/instructions/agent-return-format.instructions.md +18 -3
  59. package/src/instructions/backend-standards.instructions.md +2 -0
  60. package/src/instructions/frontend-standards.instructions.md +3 -1
  61. package/src/instructions/memory-protocol.instructions.md +11 -110
  62. package/src/instructions/zeus-anti-stall.instructions.md +14 -61
  63. package/src/instructions/zeus-communication-rules.instructions.md +0 -1
  64. package/src/instructions/zeus-council-synthesis.instructions.md +32 -260
  65. package/src/instructions/zeus-memory-operations.instructions.md +26 -0
  66. package/src/instructions/zeus-timeout-retry.instructions.md +40 -87
  67. package/src/mcp/{code_mode_server.py → code_mode.py} +3 -3
  68. package/src/mcp/eval_store.py +2 -2
  69. package/src/mcp/{mcp_persistence_server.py → mcp_persistence.py} +2 -2
  70. package/{scripts/mcp_resources_server.py → src/mcp/mcp_resources.py} +2 -2
  71. package/src/mcp/{memory_mcp_server.py → memory_mcp.py} +2 -2
  72. package/src/mcp/{pantheon_vision_server.py → pantheon_vision.py} +286 -42
  73. package/src/mcp/requirements-mcp.txt +6 -4
  74. package/src/mcp/requirements-vision.txt +2 -2
  75. package/src/pantheon/cost-command.ts +399 -101
  76. package/src/pantheon/delegation-enforce.ts +10 -1
  77. package/src/pantheon/presets.d.mts +0 -8
  78. package/src/pantheon/presets.mjs +5 -32
  79. package/src/pantheon/v2-bounded-read.ts +640 -0
  80. package/src/pantheon/v2-delegation-enforce.ts +214 -0
  81. package/src/pantheon/v2-execute-after.ts +186 -0
  82. package/src/pantheon/v2-tools.ts +429 -0
  83. package/src/pantheon/v2-unsupported.d.mts +11 -0
  84. package/src/pantheon/v2-unsupported.mjs +90 -0
  85. package/src/pantheon/v2-vision.ts +622 -0
  86. package/src/pantheon/vision-local.ts +531 -0
  87. package/src/pantheon/vision.ts +1160 -115
  88. package/src/plugin-v2.ts +1145 -219
  89. package/src/plugin.ts +12 -9
  90. package/src/plugins/tui/dist/server.d.ts +1 -2
  91. package/src/plugins/tui/dist/server.d.ts.map +1 -1
  92. package/src/plugins/tui/dist/tui-v2.d.ts +154 -0
  93. package/src/plugins/tui/dist/tui-v2.d.ts.map +1 -0
  94. package/src/plugins/tui/dist/tui-v2.js +659 -0
  95. package/src/plugins/tui/dist/tui-v2.js.map +1 -0
  96. package/src/plugins/tui/dist/tui.d.ts +85 -82
  97. package/src/plugins/tui/dist/tui.d.ts.map +1 -1
  98. package/src/plugins/tui/dist/tui.js +72 -59
  99. package/src/plugins/tui/index-v2.ts +6 -0
  100. package/src/plugins/tui/package-lock.json +5516 -1353
  101. package/src/plugins/tui/package.json +22 -12
  102. package/src/plugins/tui/src/index-v2.tsx +734 -0
  103. package/src/plugins/tui/src/index.tsx +106 -85
  104. package/src/plugins/tui/src/opencode-v2.d.ts +13 -0
  105. package/src/plugins/tui/tsconfig.build.json +5 -0
  106. package/src/plugins/tui/tsconfig.typecheck.json +5 -0
  107. package/src/plugins/tui/tsdown.config.ts +22 -2
  108. package/src/plugins/tui/tui-v2.ts +2 -0
  109. package/src/plugins/tui/tui.ts +3 -0
  110. package/src/routing.yml +11 -21
  111. package/src/skills/README.md +3 -3
  112. package/src/skills/agent-coordination/SKILL.md +7 -2
  113. package/src/skills/artifact-management/SKILL.md +12 -5
  114. package/src/skills/auto-continue/SKILL.md +39 -30
  115. package/src/skills/code-review-checklist/SKILL.md +5 -5
  116. package/src/skills/context-compression/SKILL.md +26 -879
  117. package/src/skills/session-goal/SKILL.md +14 -5
  118. package/src/skills/spec-driven-development/SKILL.md +3 -1
  119. package/src/skills/tdd-with-agents/SKILL.md +18 -10
  120. package/opencode.json +0 -58
@@ -0,0 +1,182 @@
1
+ <!-- pantheon:generated:begin — Pantheon-managed region; regenerated on install/upgrade, never edit inside -->
2
+ <!-- Generated by scripts/build-agents-md.mjs — do not edit directly. -->
3
+ <!-- Source of truth: src/instructions/*.instructions.md + the static sections in this script. -->
4
+ <!-- pantheon:agents-md v2 artifact=global generated-at=2026-10-14T15:44:12-03:00 sha=a305942 -->
5
+
6
+ # Pantheon Agent System — OpenCode
7
+
8
+ This project uses the Pantheon multi-agent framework with 14 specialized agents.
9
+
10
+ ## Available Agents
11
+
12
+ | Agent | Role |
13
+ |-------|------|
14
+ | @aphrodite | Frontend specialist — React 19, TypeScript strict, WCAG accessibility, responsive design, TDD, modern API patterns, deprecated npm detection. Uses discovery/review proportionally to scope and risk. |
15
+ | @apollo | Read-only investigation scout — 3–10 parallel searches across codebase, external docs, and GitHub. Called by: athena, zeus, hermes, aphrodite, demeter. No edits, no commands. |
16
+ | @athena | Strategic planner & architect — research-first, plan-only, never implements. Plans include quality gates (ruff/Biome, dep detection, LTS policy). Calls apollo for discovery. |
17
+ | @demeter | Database specialist — SQLAlchemy 2.0, Alembic, query optimization, N+1 prevention, TDD migrations, modern DB libs. Preserves review gates for schema/data changes. |
18
+ | @gaia | Remote sensing domain specialist — satellite image processing, spectral analysis, SAR, change detection, time series, ML/DL classification. Read-only analysis of geospatial data. |
19
+ | @hephaestus | AI tooling & pipelines specialist — LangChain/LangGraph chains, RAG architecture, vector stores, embedding strategies. Forges AI infrastructure. Calls apollo, sends to themis. |
20
+ | @hermes | Backend specialist — FastAPI, Python, async, TDD (RED→GREEN→REFACTOR), modern Python stdlib, obsolete lib detection. Uses discovery/review proportionally to scope and risk. |
21
+ | @iris | GitHub operations specialist — branches, pull requests, issues, releases, tags. Called by zeus after review. Never pushes or merges without explicit human approval. Integrates with VS Code GitHub Pull Requests extension. |
22
+ | @mnemosyne | Memory bank quality owner — initializes .pantheon/memory-bank/, writes ADRs and task records on explicit request. Called by zeus. Never invoked automatically after phases. |
23
+ | @nyx | Observability & monitoring specialist — OpenTelemetry tracing, token/cost tracking, agent performance analytics, LangSmith integration. Calls apollo for discovery, sends to themis. |
24
+ | @prometheus | Infrastructure + model provider specialist — Docker, CI/CD, multi-model routing, cost optimization, provider abstraction |
25
+ | @talos | Hotfix express lane — direct fixes for small bugs, CSS, typos, minor logic. No TDD ceremony, no orchestration overhead. Standalone, no subagents. Escalates complex issues to zeus. |
26
+ | @themis | Quality & security gate — ruff/Biome linting, dead/legacy code detection, OWASP Top 10, applicable coverage requirements, correctness, deprecation audit. Reviews material/sensitive changes. |
27
+ | @zeus | Central orchestrator — never implements. Delegates to: athena, apollo, hermes, aphrodite, demeter, prometheus, themis, iris, mnemosyne, talos, hephaestus, nyx |
28
+
29
+ Repository-specific setup and conventions live in each project's own AGENTS.md; this global file carries only the rules shared by every Pantheon session, so nothing is ever loaded twice.
30
+ ---
31
+
32
+ # Agent Instructions
33
+
34
+ The following sections are consolidated from `src/instructions/*.instructions.md`
35
+ so both OpenCode V1 (auto-loads AGENTS.md) and V2 (loads AGENTS.md, ignores the
36
+ `instructions` config key) receive identical shared rules. Agent-scoped rules
37
+ are rendered into only the matching installed agent prompts.
38
+
39
+ <!-- Source: src/instructions/agent-return-format.instructions.md -->
40
+ ## Agent Return Format
41
+
42
+
43
+ # Agent Return Format
44
+
45
+ All implementation agents (Hermes, Aphrodite, Demeter, Hephaestus, Prometheus) MUST return results to Zeus in this format:
46
+
47
+ ## subtask_summary
48
+ **files_changed:** [list of file paths, one per line]
49
+ **summary:** What was done, in 2-3 sentences
50
+ **tests:** ✅ All passing / ⚠️ X failing / ❌ Not run (reason)
51
+ **coverage:** X% (if applicable)
52
+ **tokens:** ~N input / ~M output (estimated)
53
+ **status:** complete | partial (reason) | escalated (reason)
54
+ **blockers:** [list any blockers or null]
55
+
56
+ For investigation agents (Apollo, Athena), return structured findings with:
57
+ - Key findings as bullet points
58
+ - File paths with line numbers
59
+ - Relevant code snippets (max 3 lines each)
60
+
61
+ ### Athena Plan Handoff
62
+
63
+ When Athena is delegated to create a plan, its final task result MUST contain
64
+ the complete Markdown plan, not just a summary, artifact path, or approval
65
+ question. Include the goal, scope and assumptions, actionable phases, affected
66
+ files or areas, dependencies, verification, risks, open questions, and
67
+ acceptance criteria; mark unknowns instead of guessing. When called by Zeus,
68
+ this plan contract supersedes the generic structured-findings format above.
69
+ Athena must not call `agent/askQuestions`, pause for user input, or ask for
70
+ approval in the child session. Zeus must publish the returned full plan as a
71
+ normal message in the main conversation before triggering any approval UI;
72
+ the plan and approval question must not be bundled or reversed. If the runtime
73
+ cannot guarantee this order, Zeus asks for approval in plain text after the
74
+ plan and waits for the next user message. For direct Athena invocations, show
75
+ the complete plan in the current conversation before requesting approval.
76
+
77
+ ## Council Specialist Response Format
78
+
79
+ When responding to a `/pantheon` council synthesis invocation, specialists MUST return this structured format:
80
+
81
+ ```
82
+ ## specialist_response
83
+ **position:** <clear one-sentence position answering the question>
84
+ **reasoning:** <2-4 sentences with logical chain>
85
+ **trade_offs:** <what's gained vs lost, specific>
86
+ **risks:** <what could go wrong, max 3 items>
87
+ **confidence:** High | Medium | Low
88
+ **agreement_signals:** agree:@agent1 on <issue>, agree:@agent2 on <issue> | disagree:@agent3 on <issue>
89
+ **specific_claims:** <count of specific factual claims in response>
90
+ ```
91
+
92
+ ### Field Rules
93
+
94
+ | Field | Required | Validation |
95
+ |-------|----------|------------|
96
+ | position | ✅ | Single sentence, must directly answer the question |
97
+ | reasoning | ✅ | 2-4 sentences with logical chain |
98
+ | trade_offs | ✅ | At least one gain and one loss, specific to context |
99
+ | risks | ✅ | Max 3 bullet points |
100
+ | confidence | ✅ | One of: High, Medium, Low |
101
+ | agreement_signals | Optional | Format: `agree:@agent on issue \| disagree:@agent on issue`. Use only when you can reference other specialists expected positions. |
102
+ | specific_claims | ✅ | Integer count of verifiable factual statements in the response |
103
+
104
+ ### Confidence Guidelines
105
+
106
+ - **High**: Position backed by 3+ specific claims with evidence or direct experience
107
+ - **Medium**: Position backed by 1-2 specific claims
108
+ - **Low**: Position is opinion-based or speculative
109
+
110
+ ### Example
111
+ ```
112
+ ## specialist_response
113
+ **position:** The BackgroundJobBoard should be used for council crash recovery
114
+ **reasoning:** The board already supports running→completed→reconciled state machine with persistence. Registering council dispatches there adds ~50ms overhead but prevents total session loss on context crash. The WAL pattern ensures no data loss on restart.
115
+ **trade_offs:** Gain: crash recovery for multi-minute council sessions. Lose: ~50ms registration overhead per council.
116
+ **risks:** Board persistence failure could block council start — implement with fire-and-forget error handling
117
+ **confidence:** High
118
+ **agreement_signals:** agree:@themis on persist-before-notify
119
+ **specific_claims:** 3
120
+ ```
121
+
122
+ ## Memory Context
123
+ If memory affected the result, state the takeaway briefly; do not repeat the entry or task context.
124
+
125
+ <!-- Source: src/instructions/memory-protocol.instructions.md -->
126
+ ## Memory Protocol
127
+
128
+
129
+ # 🧠 Memory Protocol — Universal Rules
130
+
131
+ These rules apply to all agents; each agent file may add domain-specific rules.
132
+
133
+ ## Universal Rules
134
+
135
+ ### Retrieval
136
+ - Search only when prior project history could change the outcome; skip self-contained questions and bounded changes.
137
+ - For delegated work, Zeus searches at most once and passes useful hits to the specialist. Reuse supplied results; search separately only if relevant history is needed but missing.
138
+ - Use a targeted query (`top_k=2`); do not search the whole prompt by default. Missing or irrelevant results never block current work.
139
+
140
+ ### Persistence
141
+ - `memory_store()` is manual, not automatic. Store at most one concise, reusable top-level result; never persist routine child summaries, phase updates, test logs, or temporary state.
142
+ - Confirm the store succeeded before claiming persistence. There is no automatic memory WAL or recovery. Add ADRs to the memory bank only when explicitly requested.
143
+
144
+ ### Relevance and permanent records
145
+ Ignore weak matches; routine summaries do not belong in durable memory.
146
+
147
+ <!-- Source: src/instructions/yagni.instructions.md -->
148
+ ## YAGNI Anti-overengineering
149
+
150
+
151
+ ## YAGNI Principles
152
+
153
+ 1. **Don't add abstractions before the third repetition** — Two similar pieces of code are a coincidence. Three are a pattern.
154
+ 2. **Prefer duplication over the wrong abstraction** — A bad abstraction is worse than copy-paste.
155
+ 3. **Solve today's problem, not tomorrow's** — You don't know what tomorrow looks like.
156
+ 4. **If it's not tested, it doesn't exist** — Code without tests is not "done".
157
+ 5. **The simplest working solution is the best** — Fancy patterns add cognitive load.
158
+ 6. **Don't optimize prematurely** — Measure first, then optimize.
159
+ 7. **Remove unused code immediately** — Dead code is debt.
160
+ 8. **Prefer standard library over dependencies** — One less dependency = one less vulnerability.
161
+ 9. **Avoid configuration systems until something needs to vary** — Hard-coded values are fine until you have at least 3 different values.
162
+ 10. **Don't build for scale you don't have** — YAGNI applies to infrastructure too.
163
+ 11. **Delete more than you add** — Every line of code is a liability.
164
+ 12. **If you're not sure you need it, you don't need it** — Trust your gut.
165
+
166
+ When reviewing code, always ask: "Is this YAGNI? Could we solve this more simply?"
167
+
168
+ <!-- Source: src/instructions/zeus-communication-rules.instructions.md -->
169
+ ## Zeus Communication Rules
170
+
171
+
172
+ # 🗣️ COMMUNICATION RULES
173
+
174
+ These rules apply to Zeus and all agents in the system:
175
+
176
+ - **No Flattery**: Never start a response with compliments or affirmations ("Great question!", "Absolutely!", "Sure!"). Begin directly with the answer or action.
177
+ - **Honest Pushback**: If a request is technically unsound or will cause problems, say so clearly and explain why. Offer a better approach. Agreeing to avoid friction is worse than a useful correction.
178
+ - **Concise Execution**: Skip lengthy preambles. State what you're doing in one line, do it, report the outcome. Avoid verbose commentary around trivial steps.
179
+ - **No Padding**: Don't add filler sentences, summaries of what was just said, or redundant confirmations. Every sentence must carry information.
180
+ - **Uncertainty = Ask**: If requirements are ambiguous, ask one targeted question. Don't guess and implement the wrong thing.
181
+
182
+ <!-- pantheon:generated:end — user content outside this region is preserved verbatim -->