pantheon-opencode 2.0.0-rc.1 → 2.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 (70) hide show
  1. package/AGENTS.global.md +2 -2
  2. package/AGENTS.md +8 -8
  3. package/CHANGELOG.md +54 -0
  4. package/README.md +2 -0
  5. package/README.pt-BR.md +2 -0
  6. package/bin/pantheon-init.mjs +13 -0
  7. package/commands/pantheon-audit.md +1 -1
  8. package/commands/pantheon-deepwork.md +1 -1
  9. package/commands/pantheon-optimize.md +41 -63
  10. package/package.json +4 -3
  11. package/plugin.json +1 -1
  12. package/prompts/optimize-database.prompt.md +5 -5
  13. package/prompts/plan-architecture.prompt.md +6 -6
  14. package/pyproject.toml +1 -1
  15. package/scripts/build-agents-md.mjs +10 -10
  16. package/scripts/build-plugin.mjs +26 -0
  17. package/scripts/install/opencode-version.mjs +17 -5
  18. package/scripts/install/opencode.mjs +8 -1
  19. package/scripts/optimize.mjs +322 -0
  20. package/scripts/prune.mjs +105 -14
  21. package/scripts/update.mjs +20 -15
  22. package/skills-lock.json +11 -11
  23. package/src/agents/aphrodite.md +15 -14
  24. package/src/agents/apollo.md +2 -1
  25. package/src/agents/athena.md +5 -5
  26. package/src/agents/demeter.md +2 -0
  27. package/src/agents/hephaestus.md +1 -0
  28. package/src/agents/hermes.md +19 -95
  29. package/src/agents/iris.md +3 -0
  30. package/src/agents/nyx.md +1 -0
  31. package/src/agents/prometheus.md +2 -0
  32. package/src/agents/talos.md +3 -0
  33. package/src/agents/themis.md +91 -87
  34. package/src/agents/zeus.md +41 -266
  35. package/src/instructions/agent-return-format.instructions.md +1 -1
  36. package/src/instructions/memory-protocol.instructions.md +1 -1
  37. package/src/instructions/zeus-anti-stall.instructions.md +3 -3
  38. package/src/instructions/zeus-communication-rules.instructions.md +1 -1
  39. package/src/instructions/zeus-council-synthesis.instructions.md +2 -2
  40. package/src/instructions/zeus-timeout-retry.instructions.md +10 -10
  41. package/src/pantheon/model-command.ts +12 -12
  42. package/src/pantheon/tools.ts +4 -0
  43. package/src/pantheon/tui-version-check.ts +1 -1
  44. package/src/pantheon/update-notifier.ts +13 -8
  45. package/src/pantheon/vision.ts +20 -20
  46. package/src/plugin/index.js +14594 -0
  47. package/src/plugins/tui/dist/tui.d.ts +3 -3
  48. package/src/plugins/tui/dist/tui.d.ts.map +1 -1
  49. package/src/plugins/tui/dist/tui.js +923 -340
  50. package/src/plugins/tui/dist/tui.js.map +1 -1
  51. package/src/plugins/tui/package-lock.json +2 -2
  52. package/src/plugins/tui/package.json +1 -1
  53. package/src/plugins/tui/src/autonomy-state.ts +27 -15
  54. package/src/plugins/tui/src/index.tsx +44 -23
  55. package/src/plugins/tui/src/pantheon-settings.tsx +461 -105
  56. package/src/plugins/tui/src/tui-prefs.ts +106 -4
  57. package/src/plugins/tui/src/update-notice.ts +9 -6
  58. package/src/plugins/tui/src/whats-new-open.ts +4 -4
  59. package/src/plugins/tui/src/whats-new.tsx +119 -17
  60. package/src/skills/agent-coordination/SKILL.md +6 -6
  61. package/src/skills/artifact-management/SKILL.md +43 -39
  62. package/src/skills/artifact-management/references/artifact-templates.md +103 -48
  63. package/src/skills/auto-continue/references/auto-continue-details.md +13 -13
  64. package/src/skills/code-review-checklist/SKILL.md +6 -6
  65. package/src/skills/incremental-implementation/SKILL.md +13 -13
  66. package/src/skills/memory-bank/references/anti-patterns.md +3 -3
  67. package/src/skills/spec-driven-development/SKILL.md +12 -14
  68. package/src/skills/tdd-with-agents/SKILL.md +6 -5
  69. package/src/skills/visual-review-pipeline/SKILL.md +1 -1
  70. package/src/skills/visual-review-pipeline/references/workflow-steps.md +1 -1
@@ -1,71 +1,126 @@
1
- # Artifact Management — Templates
1
+ # Artifact Management — High-Density Templates
2
2
 
3
- Detail companion for `SKILL.md`. Read on demand when creating an artifact and
4
- you need the `.tmp/` layout or a PLAN/IMPL/REVIEW template. Artifact types,
5
- who-generates-what, proportional-use rules, pause points, and cleanup stay in
6
- `SKILL.md`.
3
+ Companion reference for `SKILL.md`. Contains templates for architectural plans, executive reports, and ADRs.
7
4
 
8
5
  ---
9
6
 
10
- ## Temp Folder
7
+ ## 1. Architectural Plan (`.pantheon/deepwork/<slug>/PLAN.md`)
11
8
 
12
- All ephemeral artifacts live in `.pantheon/memory-bank/.tmp/` — gitignored and wiped on sprint close.
9
+ Produced by `@athena`. Opens with an immediate Mermaid diagram and follows with dense, actionable phases:
13
10
 
14
- ```
15
- .pantheon/memory-bank/
16
- ├── .tmp/ ← GITIGNORED — ephemeral artifacts
17
- │ ├── PLAN-<feature>.md
18
- │ ├── IMPL-phase1-hermes.md
19
- │ ├── IMPL-phase1-aphrodite.md
20
- │ └── REVIEW-<feature>.md
21
- ├── _notes/ ← permanent ADRs; Git tracking follows repository policy
22
- │ └── ADR-<topic>.md
23
- ├── 01-active-context.md
24
- └── 02-progress-log.md
25
- ```
11
+ ```markdown
12
+ # Architectural Plan: [Feature / Refactor Title]
26
13
 
27
- Memory Bank files are not automatically versioned or shared across clones.
28
- Check the repository's ignore/commit policy before relying on `_tasks/` records
29
- or other files being tracked; `_tasks/` may be Git-ignored.
14
+ > [!NOTE]
15
+ > High-level context, background problem, and target outcome.
30
16
 
31
- ---
17
+ > [!IMPORTANT]
18
+ > Non-negotiable safety constraints, auth boundaries, or database schema requirements.
32
19
 
33
- ### PLAN
34
- ```markdown
35
- # PLAN-<feature>
36
- **Date:** YYYY-MM-DD **Status:** Awaiting Approval
20
+ ## 1. Visual Execution Flow
21
+
22
+ \`\`\`mermaid
23
+ flowchart TD
24
+ A["Requirement"] --> B["Phase 1: Backend (@hermes)"]
25
+ B --> C{"Lint & Slice Test Gate"}
26
+ C -- PASS --> D["Phase 2: Frontend (@aphrodite)"]
27
+ D --> E["Phase 3: Security & Code Audit (@themis)"]
28
+ \`\`\`
29
+
30
+ ## 2. Quantitative Baseline & Impact
37
31
 
38
- ## Goal
39
- [One sentence]
32
+ | Dimension | Before | Target | Verification Method |
33
+ |---|---|---|---|
34
+ | Latency | ~150s | < 2s | Sliced test runner |
35
+ | Token Overhead | ~20k | < 8k | Context telemetry |
36
+ | Affected Files | — | 3 files | Git diff check |
40
37
 
41
- ## Phases
42
- 1. Phase 1 — @hermes
43
- 2. Phase 2 — @aphrodite
38
+ ## 3. Implementation Phases
44
39
 
45
- ## Risks
46
- - [Risk]
40
+ ### Phase 1: Core Implementation (@hermes)
41
+ - **Target Files:** `src/server/auth.ts`, `tests/auth.test.ts`
42
+ - **Actions:** RED -> GREEN -> REFACTOR implementation of the auth handler.
43
+ - **Validation Gate:** `node --test tests/auth.test.ts`
44
+ - **Exit Criteria:** All tests green; no Biome/Ruff lint warnings.
45
+
46
+ ### Phase 2: Interface & Client (@aphrodite)
47
+ - **Target Files:** `src/ui/login.tsx`
48
+ - **Actions:** Connect UI state to new auth endpoint; ensure WCAG AA keyboard access.
49
+ - **Validation Gate:** `npx biome check src/ui/login.tsx`
50
+
51
+ ## 4. Risks & Contingency
52
+
53
+ | Identified Risk | Impact | Contingency / Mitigation |
54
+ |---|---|---|
55
+ | Breaking change to legacy clients | High | Preserve backwards-compatible endpoint alias for 1 release |
56
+ | Token spike in subagent cascade | Medium | Use direct specialist dispatch without intermediate hops |
47
57
  ```
48
58
 
49
- ### IMPL
59
+ ---
60
+
61
+ ## 2. Executive Report & Analysis (`.pantheon/reports/<YYYY-MM-DD>-<topic>.md`)
62
+
63
+ Produced by `@apollo` (deep discovery) or `@themis` (quality/security audits):
64
+
50
65
  ```markdown
51
- # IMPL-<phase>-<agent>
52
- **Date:** YYYY-MM-DD **Status:** Awaiting Themis Review
66
+ # Executive Report: [Analysis Topic]
53
67
 
54
- ## What Was Implemented
55
- - [file] — [what changed]
68
+ > [!NOTE]
69
+ > Summary of findings and systemic conclusions.
56
70
 
57
- ## Tests
58
- - ✅ X tests / Coverage: Y%
71
+ > [!TIP]
72
+ > Key optimization opportunities and quick wins.
73
+
74
+ ## 1. Architecture / System Topology
75
+
76
+ \`\`\`mermaid
77
+ graph LR
78
+ Client["Client Host"] --> Gateway["Decision Router"]
79
+ Gateway --> Specialist["Domain Specialist"]
80
+ \`\`\`
81
+
82
+ ## 2. Metrics & Comparison
83
+
84
+ | Metric | Current State | Target / Proposed | Delta (%) |
85
+ |---|---|---|---|
86
+ | Test Latency | 150.000ms | 50ms | -99.9% |
87
+ | Initial Context | 19.877 tokens | 7.500 tokens | -62.2% |
88
+
89
+ ## 3. Findings & Evidence
90
+ - Detailed finding 1 with exact file citations.
91
+ - Detailed finding 2 with reproducible evidence.
92
+
93
+ ## 4. Prioritized Recommendations
94
+ 1. Actionable item 1 (low effort, high impact)
95
+ 2. Actionable item 2 (medium effort)
59
96
  ```
60
97
 
61
- ### REVIEW
98
+ ---
99
+
100
+ ## 3. Architectural Decision Record (`docs/adr/<NNN>-<slug>.md`)
101
+
102
+ Produced by `@mnemosyne`:
103
+
62
104
  ```markdown
63
- # REVIEW-<feature>
64
- **Status:** APPROVED | NEEDS_REVISION | FAILED
105
+ # ADR-[NNN]: [Decision Title]
106
+
107
+ **Date:** YYYY-MM-DD
108
+ **Status:** [Proposed | Accepted | Superseded]
109
+
110
+ > [!IMPORTANT]
111
+ > Decision impacts: [Core systems / architecture / protocols].
112
+
113
+ ## Context
114
+ What problem was being solved? What forces or constraints applied?
115
+
116
+ ## Decision
117
+ What was decided? Which approach was chosen over the alternatives?
65
118
 
66
- ## Verdict
67
- [APPROVED | NEEDS_REVISION | FAILED]
119
+ ## Alternatives Considered
120
+ - **Alternative A:** [Reason rejected]
121
+ - **Alternative B:** [Reason rejected]
68
122
 
69
- ## Issues
70
- - CRITICAL: X / HIGH: Y / MEDIUM: Z
123
+ ## Consequences
124
+ - **Positive:** [Benefits gained]
125
+ - **Negative / Trade-offs:** [Costs or constraints accepted]
71
126
  ```
@@ -51,12 +51,12 @@ whether partial results are acceptable. It is force-fed into every session via `
51
51
  skill is opt-in. Do not restate those values here — a copy in this skill is precisely what drifted
52
52
  out of sync with them. If a dispatch times out, read the role's row from the instruction file.
53
53
 
54
- ### Timeout Parcial (Partial Results)
54
+ ### Partial Results on Timeout
55
55
 
56
56
  Whether an agent may return partial results is the **Partial Results OK?** column in that table.
57
- Only agents marked ✅ there may return partial — never implementers, never reviewers.
57
+ Only agents marked YES there may return partial — never implementers, never reviewers.
58
58
 
59
- **How to signal timeout parcial:**
59
+ **How to signal partial timeout:**
60
60
  When dispatching, set the expectation explicitly:
61
61
  ```
62
62
  @apollo Search for all auth-related files. If you hit timeout, return whatever you have found so far — partial results are acceptable.
@@ -68,8 +68,8 @@ Maintain an in-context (not persistent/native) checklist of delegations when nee
68
68
 
69
69
  | Agent | Started | Timeout | Status | Partial OK? |
70
70
  |-------|---------|---------|--------|-------------|
71
- | apollo | T+0s | T+60s | ✅ complete | ✅ |
72
- | hermes | T+0s | T+180s | ⏳ in progress | ❌ |
71
+ | apollo | T+0s | T+60s | complete | YES |
72
+ | hermes | T+0s | T+180s | in progress | NO |
73
73
 
74
74
  ---
75
75
 
@@ -77,23 +77,23 @@ Maintain an in-context (not persistent/native) checklist of delegations when nee
77
77
 
78
78
  **Good (auto-continues):**
79
79
  ```
80
- ✅ Wrote migration file.
81
- → Running migration tests...
82
- ✅ Tests pass (3/3).
83
- → Next: write UserRepository query methods.
80
+ Wrote migration file.
81
+ -> Running migration tests...
82
+ Tests pass (3/3).
83
+ -> Next: write UserRepository query methods.
84
84
  ```
85
85
 
86
86
  **Good (stops at Gate 2):**
87
87
  ```
88
- ✅ Phase 1 complete: migration + repository layer.
89
- ⏸️ GATE 2 — Themis review summary:
90
- - Coverage: 87% ✅ | No OWASP issues ✅
88
+ Phase 1 complete: migration + repository layer.
89
+ GATE 2 — Themis review summary:
90
+ - Coverage: 87% | No OWASP issues
91
91
  Ready for Phase 2? Waiting for go-ahead.
92
92
  ```
93
93
 
94
94
  **Bad (stops unnecessarily):**
95
95
  ```
96
- ✅ Wrote the migration file.
96
+ Wrote the migration file.
97
97
  Should I now run the migration tests? [waiting]
98
98
  ```
99
99
 
@@ -52,7 +52,7 @@ Run the itemized pass (Correctness, Code Quality, Testing, Security/OWASP, Docum
52
52
  - [HIGH] component.tsx:15 — Missing input validation
53
53
  - [MEDIUM] test_utils.py:8 — Edge case not covered
54
54
 
55
- ### 🔍 Human Review Focus
55
+ ### Human Review Focus
56
56
  1. [Item AI cannot fully validate — e.g., business logic correctness]
57
57
  2. [Item 2 — e.g., UX flow matches requirements]
58
58
  ```
@@ -86,11 +86,11 @@ For comprehensive reviews, run 5 checks simultaneously:
86
86
 
87
87
  ## Anti-Patterns
88
88
 
89
- - ❌ Reviewing entire file instead of diff
90
- - ❌ Approving without running tests
91
- - ❌ Ignoring security implications
92
- - ❌ Vague feedback ("looks good", "needs work")
93
- - ❌ Nitpicking style over substance
89
+ - Reviewing entire file instead of diff
90
+ - Approving without running tests
91
+ - Ignoring security implications
92
+ - Vague feedback ("looks good", "needs work")
93
+ - Nitpicking style over substance
94
94
 
95
95
  ---
96
96
 
@@ -5,23 +5,23 @@ description: "Implement in thin vertical slices — one commit per task, testabl
5
5
 
6
6
  # Incremental Implementation
7
7
 
8
- **Construa em fatias finas testáveis. Um commit por task.**
8
+ Build in thin, testable vertical slices. One commit per task.
9
9
 
10
10
  ## Rules
11
- 1. Cada slice entrega valor testável de forma independente
12
- 2. Um commit por slice — sempre com tests passando
13
- 3. Se o slice cresceu > 50 linhas, quebre em 2
14
- 4. Rollback de um slice não quebra os anteriores
11
+ 1. Each slice delivers independently testable value.
12
+ 2. One commit per slice with tests passing.
13
+ 3. If a slice exceeds 50 changed lines, split it into smaller tasks.
14
+ 4. Rolling back a slice must not break previous slices.
15
15
 
16
16
  ## Slice Pattern
17
17
  ```
18
- Slice 1 — Schema + model (migration up/down testada)
19
- Slice 2 — API endpoint (teste → implementação → refactor)
20
- Slice 3 — Frontend component (mock API → UI → integração)
21
- Slice N — Integração E2E (caminho feliz + edge cases)
18
+ Slice 1 — Schema and data model (migration up/down tested)
19
+ Slice 2 — API endpoint (test -> implementation -> refactor)
20
+ Slice 3 — Frontend component (mock API -> UI -> integration)
21
+ Slice N — E2E integration (happy path + edge cases)
22
22
  ```
23
23
 
24
- ## Anti-patterns
25
- - ❌ Slices horizontais (backend inteiro, depois frontend inteiro)
26
- - ❌ Commits de 500+ linhas
27
- - ❌ Implementar sem testar antes (RED → GREEN)
24
+ ## Anti-Patterns
25
+ - Horizontal slicing (building the entire backend before touching frontend).
26
+ - Mega-commits of 500+ lines.
27
+ - Implementing changes without prior test verification (RED -> GREEN).
@@ -6,7 +6,7 @@ pattern violates the memory-bank rules. The golden rules themselves stay in
6
6
 
7
7
  ---
8
8
 
9
- ### ❌ Session output as files
9
+ ### Anti-Pattern: Session output as files
10
10
  ```
11
11
  # Wrong
12
12
  Create IMPLEMENTATION_SUMMARY.md
@@ -16,7 +16,7 @@ Create STATUS.md
16
16
  @mnemosyne Append to 02-progress-log.md: [summary]
17
17
  ```
18
18
 
19
- ### ❌ Mandatory handoff after every phase
19
+ ### Anti-Pattern: Mandatory handoff after every phase
20
20
  ```
21
21
  # Wrong: After every phase → handoff to @mnemosyne
22
22
 
@@ -24,7 +24,7 @@ Create STATUS.md
24
24
  At sprint close → explicit @mnemosyne invocation
25
25
  ```
26
26
 
27
- ### ❌ Duplicating information
27
+ ### Anti-Pattern: Duplicating information
28
28
  ```
29
29
  # Wrong: duplicate the same fact in both durable Memory and a project document
30
30
 
@@ -1,25 +1,23 @@
1
1
  ---
2
2
  name: spec-driven-development
3
- description: "Define requirements via spec-first before any code — PRD, edge cases, acceptance criteria"
3
+ description: "Define requirements via spec-first before code — PRD, edge cases, acceptance criteria"
4
4
  ---
5
5
 
6
6
  # Spec-Driven Development
7
7
 
8
- **Não escreva código sem entender o problema primeiro.**
8
+ Do not write code before understanding the problem.
9
9
 
10
10
  ## Workflow
11
- 1. **Interview** — Extraia requisitos com perguntas iterativas (o usuário nunca sabe exatamente o que quer)
12
- 2. **PRD** — Escreva um documento de requisitos: objetivo, personas, fluxos, regras de negócio, critérios de aceitação
13
- 3. **Edge Cases** — Mapeie entradas inválidas, concorrência, falhas de API, estados vazios
14
- 4. **Technical Spec** — Decisões de arquitetura: componentes, dados, API contracts, deploy
15
- 5. **Approval** — Apresente o plano completo ao usuário antes de codar. Se o
16
- planejamento veio de um subagente, devolva o plano integral ao orquestrador
17
- para que ele o exiba na conversa principal antes de pedir aprovação.
11
+ 1. Interview: Extract requirements with iterative questions to resolve ambiguity.
12
+ 2. PRD: Document core requirements: objective, personas, user flows, business rules, and acceptance criteria.
13
+ 3. Edge Cases: Map invalid inputs, concurrency, API failures, and empty states.
14
+ 4. Technical Spec: Document architectural decisions: components, data models, API contracts, and deployment.
15
+ 5. Approval: Present the complete plan to the user before writing code. When planning was executed in a subagent, return the full plan to the orchestrator so it displays in the main conversation before requesting approval.
18
16
 
19
- ## Anti-patterns
20
- - ❌ Pular direto pra implementação
21
- - ❌ Assumir que entendeu sem confirmar
22
- - ❌ Spec muito detalhada (5+ páginas) — mantenha enxuta
17
+ ## Anti-Patterns
18
+ - Jumping straight into implementation without requirements.
19
+ - Assuming requirements without confirmation.
20
+ - Overly verbose specifications (5+ pages) — keep specs concise and actionable.
23
21
 
24
22
  ## Output
25
- `spec.md` no diretório raiz ou no `.pantheon/deepwork/<feature>/` — usado como input pro /plan.
23
+ `spec.md` at project root or `.pantheon/deepwork/<feature>/PLAN.md` — used as input for planning.
@@ -79,11 +79,12 @@ Use RED → GREEN → REFACTOR for behavior-changing implementation where a mean
79
79
 
80
80
  ## Anti-Patterns
81
81
 
82
- - Proibido: escrever codigo de producao sem teste correspondente
83
- - Anti-pattern: testar detalhes de implementacao privada ou acoplamento excessivo
84
- - Anti-pattern: mocking excessivo de I/O em vez de testes de integracao direta
85
- - Anti-pattern: ignorar falhas de teste sem diagnosticar o diff
86
- - Anti-pattern: executar a suite inteira para mudancas locais delimitadas
82
+ - Proportionality: TDD (RED -> GREEN -> REFACTOR) is mandatory for testable behavior, business logic, and security; glue code, configuration, documentation, and UI/CSS adjustments do not require test-first creation.
83
+ - Anti-pattern: Creating test ceremonies for trivial configuration or formatting tasks.
84
+ - Anti-pattern: Testing private implementation details or creating tight coupling.
85
+ - Anti-pattern: Excessive I/O mocking instead of direct integration tests.
86
+ - Anti-pattern: Ignoring test failures without diagnosing the diff.
87
+ - Anti-pattern: Running the entire test suite for bounded local changes.
87
88
 
88
89
  ---
89
90
 
@@ -73,7 +73,7 @@ Zeus must be invoked when:
73
73
  - Use `browser/snapshot` for accessibility tree context
74
74
  - Fallback: If Playwright MCP is unavailable, skip with warning:
75
75
  ```
76
- ⚠️ Playwright MCP unavailable — visual review skipped.
76
+ [WARN] Playwright MCP unavailable — visual review skipped.
77
77
  Install Playwright MCP server to enable visual review pipeline.
78
78
  ```
79
79
  For UI implementation review, Aphrodite self-reviews.
@@ -70,7 +70,7 @@ Iteration N:
70
70
  - Use `browser/snapshot` for accessibility tree context
71
71
  - Fallback: If Playwright MCP is unavailable, skip with warning:
72
72
  ```
73
- ⚠️ Playwright MCP unavailable — visual review skipped.
73
+ [WARN] Playwright MCP unavailable — visual review skipped.
74
74
  Install Playwright MCP server to enable visual review pipeline.
75
75
  ```
76
76
  For UI implementation review, Aphrodite self-reviews.