pantheon-opencode 2.0.0-beta.5 → 2.0.0-rc.1
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.
- package/AGENTS.global.md +6 -1
- package/AGENTS.md +1 -1
- package/CHANGELOG.md +67 -0
- package/README.md +169 -510
- package/README.pt-BR.md +177 -149
- package/bin/pantheon-init.mjs +1 -1
- package/commands/pantheon-deepwork.md +6 -1
- package/commands/pantheon.md +10 -5
- package/package.json +1 -1
- package/plugin.json +2 -2
- package/prompts/orchestrate-with-zeus.prompt.md +82 -290
- package/prompts/subtask.prompt.md +1 -1
- package/pyproject.toml +1 -1
- package/scripts/doctor.mjs +27 -11
- package/scripts/hooks/format-multi-language.sh +30 -48
- package/scripts/install/opencode.mjs +13 -1
- package/scripts/jev-live-probe.mjs +1 -1
- package/scripts/release-gates.mjs +19 -5
- package/scripts/skill-search.mjs +66 -7
- package/scripts/test-opencode-sandbox.sh +44 -15
- package/scripts/update.mjs +9 -2
- package/skills-lock.json +5 -3
- package/src/agents/aphrodite.md +2 -0
- package/src/agents/apollo.md +8 -206
- package/src/agents/athena.md +25 -29
- package/src/agents/hermes.md +3 -1
- package/src/agents/mnemosyne.md +1 -1
- package/src/agents/nyx.md +1 -1
- package/src/agents/prometheus.md +0 -203
- package/src/agents/talos.md +2 -0
- package/src/agents/themis.md +8 -3
- package/src/agents/zeus.md +18 -12
- package/src/instructions/memory-protocol.instructions.md +4 -0
- package/src/instructions/test-economy.instructions.md +1 -0
- package/src/instructions/zeus-council-synthesis.instructions.md +13 -1
- package/src/pantheon/goal-loop-config.ts +55 -0
- package/src/pantheon/native-vision.ts +9 -5
- package/src/pantheon/pantheon-decision-catalog.ts +8 -0
- package/src/pantheon/skill-search-tool.ts +193 -0
- package/src/pantheon/tools.ts +2 -0
- package/src/pantheon/vision.ts +14 -1
- package/src/plugin.ts +39 -7
- package/src/plugins/tui/dist/tui.d.ts +12 -2
- package/src/plugins/tui/dist/tui.d.ts.map +1 -1
- package/src/plugins/tui/dist/tui.js +1399 -365
- package/src/plugins/tui/dist/tui.js.map +1 -1
- package/src/plugins/tui/package-lock.json +2 -2
- package/src/plugins/tui/package.json +1 -1
- package/src/plugins/tui/src/autonomy-state.ts +149 -0
- package/src/plugins/tui/src/context-gauge.ts +64 -5
- package/src/plugins/tui/src/decision-router-state.ts +175 -6
- package/src/plugins/tui/src/index.tsx +25 -3
- package/src/plugins/tui/src/pantheon-settings-state.ts +99 -0
- package/src/plugins/tui/src/pantheon-settings.tsx +647 -103
- package/src/plugins/tui/src/tui-prefs.ts +161 -9
- package/src/plugins/tui/src/update-status.ts +27 -8
- package/src/routing.yml +9 -0
- package/src/skills/README.md +35 -25
- package/src/skills/fast-path-execution/SKILL.md +54 -0
- package/src/skills/prompt-refinery/SKILL.md +53 -37
- package/src/skills/tdd-with-agents/SKILL.md +22 -10
- package/src/skills/test-slicing/SKILL.md +56 -0
- package/src/skills/verification-planning/SKILL.md +4 -3
|
@@ -5,56 +5,72 @@ description: "Turn a vague multi-concern request into a usable brief — interna
|
|
|
5
5
|
|
|
6
6
|
# Prompt Refinery
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
Turn ambiguous or multi-concern prompts into crisp, verifiable engineering briefs. Emulates Claude Code and ChatGPT Agent prompt architectures: zero-overhead pass-through by default, lean internal structuring for vague requests, and full visual contract only via `>>`.
|
|
9
|
+
|
|
10
|
+
```mermaid
|
|
11
|
+
flowchart LR
|
|
12
|
+
In["User Request"] --> Eval{"Clarity & Scope?"}
|
|
13
|
+
Eval -->|"Clear & Bounded"| T0["Tier 0: Direct Execution<br/>(0 token overhead)"]
|
|
14
|
+
Eval -->|"Vague / Implicit"| T1["Tier 1: Silent Lean Extraction<br/>(< 8 lines, internal only)"]
|
|
15
|
+
Eval -->|"Prefix >>"| T2["Tier 2: Visual Contract<br/>(User confirmation)"]
|
|
16
|
+
```
|
|
9
17
|
|
|
10
18
|
---
|
|
11
19
|
|
|
12
|
-
##
|
|
13
|
-
|
|
14
|
-
| Nível | Gatilho | O que acontece |
|
|
15
|
-
|---|---|---|
|
|
16
|
-
| **0 — Passa intacto** | Pedido claro e delimitado ("corrija o typo do README"), cumprimentos e conversa fiada (o `__SKIP__` do prompt-enhancer) | Executa direto, zero token de refinamento |
|
|
17
|
-
| **1 — Ajuste mínimo INTERNO (automático)** | O sinal determinístico dispara | Reescreve o prompt **silenciosamente, para uso próprio**: PT corrigido, estrutura leve, expansão do implícito, lacunas viram escolhas com default declarado. SEM apresentar contrato, SEM pedir aprovação — o usuário vê o trabalho começar. Limite: o essencial (~10-15 linhas internas); escopo pode ser generoso quando o pedido pede |
|
|
18
|
-
| **2 — Contrato completo** | **SOMENTE prefixo `>>`** | As seis seções inteiras apresentadas ao usuário para confirmar-ou-ajustar (a ÚNICA via com aprovação explícita) |
|
|
20
|
+
## The Three Tiers
|
|
19
21
|
|
|
20
|
-
|
|
22
|
+
| Tier | Trigger | Behavior | Output Format |
|
|
23
|
+
|---|---|---|---|
|
|
24
|
+
| **0 — Pass-through** | Clear, bounded task ("fix typo in README", "run tests") | Executes immediately with zero refinement overhead | Direct execution |
|
|
25
|
+
| **1 — Silent Lean (Default)** | Unbounded scope, missing units/constraints, multi-concern | Silently extracts intent, slices, and defaults for own execution | Internal brief (< 8 lines) |
|
|
26
|
+
| **2 — Visual Contract** | **Prefix `>>` ONLY** | Presents full visual contract to user for explicit approval | Structured Markdown table & gates |
|
|
21
27
|
|
|
22
28
|
---
|
|
23
29
|
|
|
24
|
-
##
|
|
25
|
-
|
|
26
|
-
**NÍVEL 1 — Ajuste mínimo INTERNO (o default do sinal determinístico):** reescrita para uso próprio, SEM apresentar ao usuário. O essencial + o que o pedido pedir (o escopo mínimo não é um aperto: expanda o implícito, estime o que falta com default declarado). Exemplo de saída aceitável:
|
|
30
|
+
## Tier 1: Silent Lean Extraction (Internal Default)
|
|
27
31
|
|
|
32
|
+
Execute silently in session context. Never show to the user; begin work immediately:
|
|
28
33
|
```
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
34
|
+
Target: [Single sentence: action verb + concrete outcome]
|
|
35
|
+
Slices: 1) [Slice A] 2) [Slice B] (2-4 independently testable steps)
|
|
36
|
+
Negative Constraints: [What NOT to touch or break; no new external deps]
|
|
37
|
+
Verification: [Exact test or lint command]
|
|
38
|
+
Defaults: [Assumed parameters, e.g. active branch, default ports]
|
|
33
39
|
```
|
|
34
40
|
|
|
35
|
-
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## Tier 2: Visual Contract (Prefix `>>` Only)
|
|
36
44
|
|
|
37
|
-
|
|
45
|
+
Presented to user for confirmation before starting:
|
|
38
46
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
47
|
+
```markdown
|
|
48
|
+
### Proposed Scope & Execution Plan
|
|
49
|
+
|
|
50
|
+
| Slice | Focus Area | Target Files | Verification Gate |
|
|
51
|
+
|---|---|---|---|
|
|
52
|
+
| 1. Model / Schema | Data structure | `src/models/...` | Unit tests / migrations |
|
|
53
|
+
| 2. Implementation | Core business logic | `src/services/...` | Sliced test command |
|
|
54
|
+
| 3. Integration | E2E & lint check | `tests/...` | Full gate / `ruff` / `biome` |
|
|
55
|
+
|
|
56
|
+
- **In Scope:** [Concrete additions or changes]
|
|
57
|
+
- **Out of Scope & Negative Constraints:** [Explicit exclusions; files/systems not to touch]
|
|
58
|
+
- **Acceptance Criteria:**
|
|
59
|
+
- [ ] Observable completion condition
|
|
60
|
+
- [ ] Test verification passes cleanly
|
|
61
|
+
- **Open Questions (with Recommended Defaults):**
|
|
62
|
+
- [Question]? *(Default: [Recommended choice] — proceed if no objections)*
|
|
63
|
+
```
|
|
45
64
|
|
|
46
65
|
---
|
|
47
66
|
|
|
48
|
-
## Operating
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
-
|
|
56
|
-
-
|
|
57
|
-
-
|
|
58
|
-
- **Modelo**: o rewrite roda no modelo ativo da sessão; o controle de custo é o CAP de cada nível (interno ~10-15 linhas; completo = as seis seções) — quando houver modelo free/rápido no preset ativo (ex.: mimo-v2.5-free, deepseek-v4-flash-free), prefira-o via routing para o turno de rewrite.
|
|
59
|
-
- **One refinement turn.** The rewrite is a single planning pass on the session model — no extra provider call, no Jev needed for the rewrite itself (decision models answer typed scalars, they do not write prose).
|
|
60
|
-
- **Cost honesty**: the refinement costs roughly one planning turn (~1–4K tokens each way). The expensive thing is executing a mis-specified request; this skill buys that back.
|
|
67
|
+
## Operating Rules
|
|
68
|
+
|
|
69
|
+
1. **Tier 1 is Silent & Fast:** The agent extracts structure internally. The user sees execution start immediately, never an intermediate confirmation dialog.
|
|
70
|
+
2. **Tier 2 Requires `>>`:** Only explicit `>>` prefix requests trigger user-visible contract confirmation.
|
|
71
|
+
3. **Language Consistency:** Always preserve the user's language (PT-BR requests produce PT-BR briefs).
|
|
72
|
+
4. **Fail-Open:** Any error during refinement falls back to the original prompt without blocking.
|
|
73
|
+
5. **Ambiguity Resolution:**
|
|
74
|
+
- With decision router active, use `pantheon_jev_decide` (mode: `choice`) for non-trivial architectural trade-offs.
|
|
75
|
+
- Fall back to native `question` tool with options and marked defaults if Jev is off or unavailable.
|
|
76
|
+
- Non-blocking gaps use sensible declared defaults.
|
|
@@ -23,6 +23,18 @@ Use RED → GREEN → REFACTOR for behavior-changing implementation where a mean
|
|
|
23
23
|
|
|
24
24
|
---
|
|
25
25
|
|
|
26
|
+
## Batched Suite Implementation vs Micro-Iterative TDD
|
|
27
|
+
|
|
28
|
+
- **Single Bug / Regression:** Use strict micro-iterative RED -> GREEN -> REFACTOR (write 1 test, confirm RED, write fix, confirm GREEN).
|
|
29
|
+
- **Complete Feature Suites / Multi-Endpoint Modules:** Do NOT repeat a 3-turn RED-wait-GREEN loop for every single function (which causes turn explosion and sluggishness). Instead:
|
|
30
|
+
1. Author the cohesive test specification covering the new contract/suite.
|
|
31
|
+
2. Implement the module components satisfying that contract.
|
|
32
|
+
3. Run the targeted test slice ONCE via `test-slicing` (< 100ms).
|
|
33
|
+
4. Iterate only on assertions that fail.
|
|
34
|
+
- **Lint-First Fast Gate:** Run static syntax/lint checks (`biome check`, `ruff check`) before launching test runners. Fixing typos and missing imports at the lint gate saves up to 80% of test turnaround time.
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
26
38
|
## TDD Cycle (RED → GREEN → REFACTOR)
|
|
27
39
|
|
|
28
40
|
### RED — Write Failing Test
|
|
@@ -55,23 +67,23 @@ Use RED → GREEN → REFACTOR for behavior-changing implementation where a mean
|
|
|
55
67
|
|
|
56
68
|
```
|
|
57
69
|
1. Use a plan/spec only when scope, risk, or ambiguity warrants it; a bounded fix may proceed directly
|
|
58
|
-
2.
|
|
59
|
-
3.
|
|
60
|
-
4.
|
|
61
|
-
5.
|
|
70
|
+
2. Author test specification (RED)
|
|
71
|
+
3. Implement minimal code (GREEN)
|
|
72
|
+
4. Refactor and optimize (REFACTOR)
|
|
73
|
+
5. Run targeted test slice via test-slicing (< 100ms)
|
|
62
74
|
6. Themis reviews sensitive or material changes, checking changed behavior and applicable quality gates
|
|
63
|
-
7. Escalate unmet repository or safety-critical test requirements
|
|
75
|
+
7. Escalate unmet repository or safety-critical test requirements
|
|
64
76
|
```
|
|
65
77
|
|
|
66
78
|
---
|
|
67
79
|
|
|
68
80
|
## Anti-Patterns
|
|
69
81
|
|
|
70
|
-
-
|
|
71
|
-
-
|
|
72
|
-
-
|
|
73
|
-
-
|
|
74
|
-
-
|
|
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
|
|
75
87
|
|
|
76
88
|
---
|
|
77
89
|
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: test-slicing
|
|
3
|
+
description: "Targeted test execution — map changed files directly to their narrow test slice instead of running full suites."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Test Slicing
|
|
7
|
+
|
|
8
|
+
> **Never run the entire repository test suite for an isolated micro-edit. Map modified files directly to their narrow test slice to save time, tokens, and context window.**
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## When to Use
|
|
13
|
+
|
|
14
|
+
- Verifying bug fixes, refactors, or feature additions touching <= 3 files.
|
|
15
|
+
- Running focused checks during TDD (RED → GREEN → REFACTOR).
|
|
16
|
+
- CI-like broad suites (`npm test`, `pytest`) are reserved exclusively for:
|
|
17
|
+
- User explicitly asks to run full test suite.
|
|
18
|
+
- Final pre-release or pre-PR validation.
|
|
19
|
+
- Changes affecting core cross-cutting infrastructure, migrations, or auth.
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## Slicing Rules by Ecosystem
|
|
24
|
+
|
|
25
|
+
| Runtime / Framework | Changed Source File | Sliced Test Command |
|
|
26
|
+
|---|---|---|
|
|
27
|
+
| **Node.js (Built-in test runner)** | `src/foo.ts` / `src/foo.js` | `node --test tests/foo.test.mjs` (or `npm test -- tests/foo.test.mjs`) |
|
|
28
|
+
| **Vitest** | `src/components/Button.tsx` | `npx vitest run src/components/Button.test.tsx` |
|
|
29
|
+
| **Jest** | `src/utils/calc.ts` | `npx jest src/utils/calc.test.ts` |
|
|
30
|
+
| **Pytest** | `src/service/auth.py` | `pytest tests/test_auth.py -k <test_func>` |
|
|
31
|
+
| **Playwright / E2E** | `src/pages/login.tsx` | Run single spec file only when UI contract changes |
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## Lint-First Fast Gate (< 50ms)
|
|
36
|
+
|
|
37
|
+
Before launching the test runner (which requires 1–5s of process bootstrapping and environment initialization), run a static syntax/linter check on the modified file:
|
|
38
|
+
- **Python:** `ruff check <file>` (~20ms)
|
|
39
|
+
- **TypeScript / JavaScript:** `npx biome check <file>` (~30ms) or `tsc --noEmit`
|
|
40
|
+
|
|
41
|
+
Catching syntax errors, missing imports, and broken brackets at the lint gate saves up to 80% of test loop latency and avoids test runner crashes.
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
## Execution Guardrails
|
|
46
|
+
|
|
47
|
+
1. **Timeout Budget:** A sliced check must complete in < 10 seconds. If a test hangs or takes > 30s, abort immediately and check background task/locks.
|
|
48
|
+
2. **Failure Isolation:** When a test fails in the slice:
|
|
49
|
+
- Read the exact assertion failure and stack trace.
|
|
50
|
+
- Do NOT run unrelated test suites hoping for clues.
|
|
51
|
+
- Fix the targeted failure and re-run only the failing slice.
|
|
52
|
+
3. **No Flaky Re-runs:** Do not blindly re-run the same failing test in a loop without inspecting code or diffs.
|
|
53
|
+
4. **Token Economy:** Pass flags that suppress noise:
|
|
54
|
+
- Node: `node --test tests/foo.test.mjs` (clean output).
|
|
55
|
+
- Pytest: `pytest tests/test_foo.py -q --tb=short`.
|
|
56
|
+
- Jest/Vitest: `--bail --silent`.
|
|
@@ -47,6 +47,7 @@ Before making non-trivial changes, plan how you'll verify correctness. Define th
|
|
|
47
47
|
| High | 5+ files, schema/API changes | Full plan + rollback test |
|
|
48
48
|
|
|
49
49
|
## Rules
|
|
50
|
-
-
|
|
51
|
-
-
|
|
52
|
-
-
|
|
50
|
+
- **Fast-Track (Low Risk, 1–2 files)**: Self-contained inline verification (1–2 lines). **Zero pre-implementation approval or delegation needed** — run the targeted test and proceed directly.
|
|
51
|
+
- **Medium Risk (3–5 files)**: Focused verification plan executed directly by the specialist. Run focused tests for changed paths; Themis review occurs after implementation only if behavioral ambiguity exists.
|
|
52
|
+
- **Deep-Track / High Risk (5+ files, Auth, Schema/DB, Payments)**: Verification plan must be approved by @themis before implementation.
|
|
53
|
+
- Escalate to @athena if verification planning reveals unknown scope.
|