pantheon-opencode 2.0.0-beta.6 → 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 (93) hide show
  1. package/AGENTS.global.md +7 -2
  2. package/AGENTS.md +8 -8
  3. package/CHANGELOG.md +99 -0
  4. package/README.md +171 -510
  5. package/README.pt-BR.md +179 -149
  6. package/bin/pantheon-init.mjs +14 -1
  7. package/commands/pantheon-audit.md +1 -1
  8. package/commands/pantheon-deepwork.md +7 -2
  9. package/commands/pantheon-optimize.md +41 -63
  10. package/commands/pantheon.md +10 -5
  11. package/package.json +4 -3
  12. package/plugin.json +2 -2
  13. package/prompts/optimize-database.prompt.md +5 -5
  14. package/prompts/orchestrate-with-zeus.prompt.md +82 -290
  15. package/prompts/plan-architecture.prompt.md +6 -6
  16. package/prompts/subtask.prompt.md +1 -1
  17. package/pyproject.toml +1 -1
  18. package/scripts/build-agents-md.mjs +10 -10
  19. package/scripts/build-plugin.mjs +26 -0
  20. package/scripts/doctor.mjs +27 -11
  21. package/scripts/hooks/format-multi-language.sh +30 -48
  22. package/scripts/install/opencode-version.mjs +17 -5
  23. package/scripts/install/opencode.mjs +8 -1
  24. package/scripts/jev-live-probe.mjs +1 -1
  25. package/scripts/optimize.mjs +322 -0
  26. package/scripts/prune.mjs +105 -14
  27. package/scripts/release-gates.mjs +19 -5
  28. package/scripts/skill-search.mjs +27 -3
  29. package/scripts/test-opencode-sandbox.sh +44 -15
  30. package/scripts/update.mjs +29 -17
  31. package/skills-lock.json +15 -13
  32. package/src/agents/aphrodite.md +17 -14
  33. package/src/agents/apollo.md +10 -207
  34. package/src/agents/athena.md +30 -34
  35. package/src/agents/demeter.md +2 -0
  36. package/src/agents/hephaestus.md +1 -0
  37. package/src/agents/hermes.md +21 -95
  38. package/src/agents/iris.md +3 -0
  39. package/src/agents/mnemosyne.md +1 -1
  40. package/src/agents/nyx.md +2 -1
  41. package/src/agents/prometheus.md +2 -203
  42. package/src/agents/talos.md +5 -0
  43. package/src/agents/themis.md +93 -84
  44. package/src/agents/zeus.md +44 -263
  45. package/src/instructions/agent-return-format.instructions.md +1 -1
  46. package/src/instructions/memory-protocol.instructions.md +5 -1
  47. package/src/instructions/test-economy.instructions.md +1 -0
  48. package/src/instructions/zeus-anti-stall.instructions.md +3 -3
  49. package/src/instructions/zeus-communication-rules.instructions.md +1 -1
  50. package/src/instructions/zeus-council-synthesis.instructions.md +15 -3
  51. package/src/instructions/zeus-timeout-retry.instructions.md +10 -10
  52. package/src/pantheon/model-command.ts +12 -12
  53. package/src/pantheon/pantheon-decision-catalog.ts +8 -0
  54. package/src/pantheon/skill-search-tool.ts +193 -0
  55. package/src/pantheon/tools.ts +6 -0
  56. package/src/pantheon/tui-version-check.ts +1 -1
  57. package/src/pantheon/update-notifier.ts +13 -8
  58. package/src/pantheon/vision.ts +20 -20
  59. package/src/plugin/index.js +14594 -0
  60. package/src/plugins/tui/dist/tui.d.ts +15 -5
  61. package/src/plugins/tui/dist/tui.d.ts.map +1 -1
  62. package/src/plugins/tui/dist/tui.js +1761 -556
  63. package/src/plugins/tui/dist/tui.js.map +1 -1
  64. package/src/plugins/tui/package-lock.json +2 -2
  65. package/src/plugins/tui/package.json +1 -1
  66. package/src/plugins/tui/src/autonomy-state.ts +28 -16
  67. package/src/plugins/tui/src/context-gauge.ts +64 -5
  68. package/src/plugins/tui/src/decision-router-state.ts +49 -2
  69. package/src/plugins/tui/src/index.tsx +69 -26
  70. package/src/plugins/tui/src/pantheon-settings-state.ts +99 -0
  71. package/src/plugins/tui/src/pantheon-settings.tsx +771 -125
  72. package/src/plugins/tui/src/tui-prefs.ts +266 -12
  73. package/src/plugins/tui/src/update-notice.ts +9 -6
  74. package/src/plugins/tui/src/update-status.ts +27 -8
  75. package/src/plugins/tui/src/whats-new-open.ts +4 -4
  76. package/src/plugins/tui/src/whats-new.tsx +119 -17
  77. package/src/routing.yml +9 -0
  78. package/src/skills/README.md +35 -25
  79. package/src/skills/agent-coordination/SKILL.md +6 -6
  80. package/src/skills/artifact-management/SKILL.md +43 -39
  81. package/src/skills/artifact-management/references/artifact-templates.md +103 -48
  82. package/src/skills/auto-continue/references/auto-continue-details.md +13 -13
  83. package/src/skills/code-review-checklist/SKILL.md +6 -6
  84. package/src/skills/fast-path-execution/SKILL.md +54 -0
  85. package/src/skills/incremental-implementation/SKILL.md +13 -13
  86. package/src/skills/memory-bank/references/anti-patterns.md +3 -3
  87. package/src/skills/prompt-refinery/SKILL.md +51 -65
  88. package/src/skills/spec-driven-development/SKILL.md +12 -14
  89. package/src/skills/tdd-with-agents/SKILL.md +23 -10
  90. package/src/skills/test-slicing/SKILL.md +56 -0
  91. package/src/skills/verification-planning/SKILL.md +4 -3
  92. package/src/skills/visual-review-pipeline/SKILL.md +1 -1
  93. package/src/skills/visual-review-pipeline/references/workflow-steps.md +1 -1
@@ -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
 
@@ -0,0 +1,54 @@
1
+ ---
2
+ name: fast-path-execution
3
+ description: "Fast-track execution protocol for bounded micro-edits (<= 2 files). Zero council overhead, direct specialist dispatch, inline verification."
4
+ ---
5
+
6
+ # Fast-Path Execution
7
+
8
+ > **Bounded changes do not require a multi-agent council. Bypass planning, discovery, and review overhead for direct specialist execution with inline verification.**
9
+
10
+ ---
11
+
12
+ ## Eligibility Criteria (Fast-Track)
13
+
14
+ A task qualifies for the Fast-Path if **ALL** of the following hold:
15
+ - **Scope:** Touches $\le 2$ source files and $\le 50$ lines of diff.
16
+ - **Risk:** Zero database schema migrations, zero auth/credential changes, zero breaking API contract modifications.
17
+ - **Clarity:** The problem and solution are clear (bug fix, typo, CSS adjustment, localized refactor).
18
+
19
+ If ANY condition is violated, route via **Deep-Track** (Athena planning $\to$ Specialist $\to$ Themis gate).
20
+
21
+ ---
22
+
23
+ ## Fast-Path Protocol
24
+
25
+ ```
26
+ User Request
27
+ │
28
+ ▼
29
+ [Zeus Assessment: <= 2 files?]
30
+ ├── YES ──► Dispatch directly to Specialist (@talos / @hermes / @aphrodite)
31
+ │ │
32
+ │ ▼
33
+ │ [Implement change + Targeted Test Slice]
34
+ │ │
35
+ │ ▼
36
+ │ [Test passes?] ── YES ──► Report completion directly to User
37
+ │ │
38
+ │ NO (unexpected regression)
39
+ │ │
40
+ ▼ ▼
41
+ [Deep-Track: Council / Athena / Themis Review]
42
+ ```
43
+
44
+ ---
45
+
46
+ ## Execution Rules
47
+
48
+ 1. **Zero-Council:** Do NOT call `pantheon_jev_decide`, local selector, or Athena planning for an obvious route. Dispatch directly via native `subagent`.
49
+ 2. **Dedicated Lane:**
50
+ - Small bug, typo, isolated CSS: dispatch to `@talos` (hotfix express lane).
51
+ - Backend logic, single endpoint: dispatch to `@hermes`.
52
+ - Frontend component, style: dispatch to `@aphrodite`.
53
+ 3. **Inline Verification:** The specialist runs the sliced test (`test-slicing`), verifies GREEN, and completes the turn without requesting `@themis` review.
54
+ 4. **Hard Escalation Boundary:** If the fix unexpectedly breaks unrelated tests, touches 3+ files, or uncovers architectural debt, abort Fast-Path immediately and escalate to `@zeus` for Deep-Track orchestration.
@@ -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
 
@@ -5,86 +5,72 @@ description: "Turn a vague multi-concern request into a usable brief — interna
5
5
 
6
6
  # Prompt Refinery
7
7
 
8
- > **A vague request executes expensively and wrong. Tier 1 refines it INTERNALLY (the user sees the work begin); Tier 2 — only via `>>` — shows the full contract for confirmation.**
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
- ## When this fires — TRÊS NÍVEIS
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
-
18
- **Anti-padrões que ESCALAM o nível** (qualquer um presente = no mínimo Tier 1; dois ou mais = considere perguntar via tool `question` antes de seguir):
19
- - **Escopo sem fronteira** — "melhorar tudo", "refatorar o projeto": sem fatias, sem fim.
20
- - **Adjetivo sem critério** — "mais rápido", "melhor": sem número, sem baseline, sem like-to-like.
21
- - **Unidade/versão ausente** — "32" de quê? "atualize" pra qual versão? O default pode ser errado.
22
- - **Multi-concern em um parágrafo** — fix + refactor + redesign sem prioridade (o caso que criou esta skill).
23
- - **Premissa implícita de ambiente** — assume stack/host/credenciais que o agente não pode inferir.
24
- | **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 |
25
- | **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
26
21
 
27
- O modelo ativo da sessão faz os dois níveis sem problema — o custo é controlado pelo LIMITE de saída de cada nível, não por trocar de modelo. Nível 1 nunca vira nível 2 sem o prefixo.
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 |
28
27
 
29
28
  ---
30
29
 
31
- ## The contract shape — tiers and caps
30
+ ## Tier 1: Silent Lean Extraction (Internal Default)
32
31
 
33
- **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).
32
+ Execute silently in session context. Never show to the user; begin work immediately:
33
+ ```
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]
39
+ ```
34
40
 
35
- **Diagnóstico interno ANTES do rewrite** (os improvers oficiais diagnosticam primeiro — o rewrite que não diagnostica chuta):
36
- 1. **Tarefa** — qual ação concreta o usuário quer? (verbo + objeto)
37
- 2. **Restrições ausentes** — o que ele não disse que LIMITA o resultado? (prazo, tamanho, compatibilidade, budget)
38
- 3. **Sucesso indefinido** — como saber que ficou pronto? Se não dá pra testar, formule o teste.
39
- 4. **Premissas implícitas** — o que o pedido ASSUME que você sabe? (stack, ambiente, histórico)
40
- 5. **Conflitos** — o pedido se contradiz? (peça X mas o aceite implica ¬X)
41
+ ---
41
42
 
42
- Cada ponto do diagnóstico vira OU uma decisão no rewrite OU um default declarado OU uma pergunta bloqueante — nada fica implícito duas vezes. Quando o pedido tiver **duas leituras com resultados materialmente diferentes** ("atualizar o README" = patch ou reescrita?), é bloqueante — a leitura errada executa caro e errado. E é aqui que o **Jev entra quando ativado** (ver a regra de desambiguação nas Operating rules): o decision model resolve a leitura como escalar tipado, e a interrupção do usuário vira exceção, não regra.
43
+ ## Tier 2: Visual Contract (Prefix `>>` Only)
43
44
 
44
- **Restrições negativas entram no rewrite quando detectadas** — "não tocar em X", "sem nova dependência", "sem migrar ainda". O usuário raramente as diz; o agente que infere incorretamente é quem executa drift.
45
+ Presented to user for confirmation before starting:
45
46
 
46
- **Formato da resposta**: se o pedido implicar entrega estruturada (relatório, tabela, plano), o rewrite fixa o formato — "responda como tabela com colunas X/Y" custa uma frase e economiza um redo.
47
+ ```markdown
48
+ ### Proposed Scope & Execution Plan
47
49
 
48
- Exemplo de saída aceitável:
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` |
49
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)*
50
63
  ```
51
- Objetivo: publicar deploys pendentes e liberar espaço nos VPS sem perder dados.
52
- Fatias: 1) identificar pendências vs produção 2) deploy por serviço 3) limpeza segura de disco.
53
- Aceite: lista de SHAs por serviço; espaço antes/depois; nada persistente apagado.
54
- Perguntas: quais VPS? (default: os que rodam estes serviços) | limpeza destrutiva? (default: não).
55
- ```
56
-
57
- **Self-check do rewrite** (rubrica interna, custo zero — a versão agent-side do loop OPRO/DSPy): antes de seguir, o rewrite passa por — objetivo único e único verbo? | fatias verificáveis individualmente? | todo default declarado por escrito? | formato da resposta definido (quando a entrega é estruturada)? | restrições negativas registradas? Qualquer não = uma passada de correção interna, não uma nova conversa.
58
-
59
- **NÍVEL 2 — Contrato completo (SOMENTE com o prefixo `>>`):** as seis seções abaixo, inteiras, apresentadas ao usuário para confirmar-ou-ajustar.
60
-
61
- Produce ALL of the following sections, filling from the request and marking real gaps as open questions — never invent requirements silently:
62
-
63
- 1. **Objetivo do projeto** — one paragraph: what changes and why.
64
- 2. **Escopo em fatias numeradas** — each slice independently verifiable (audit/corrections; architecture/IA; nomenclature/statistics; UI/UX; …). Slices the user did not ask for go under "fora de escopo", not here.
65
- 3. **Critérios de aceite por fatia** — testable statements ("toda moeda passa por Decimal; nenhum float em valor monetário"), not vibes.
66
- 4. **Entregáveis esperados** — the concrete artifacts (report, route map, dictionary, implementation).
67
- 5. **Perguntas abertas** — the gaps that change the plan, with your recommended default for each so silence means "proceed with the default".
68
- 6. **Glossário/nomenclatura proposta** — when the domain has ambiguous terms, propose the canonical names up front.
69
- 7. **Formato da resposta** — como o usuário recebe cada entregável (tabela, checklist, diff, PR, relatório com seções): o improver oficial trata output structure como parte do prompt, não do acaso.
70
64
 
71
65
  ---
72
66
 
73
- ## Operating rules
74
-
75
- - **Tier 1 é INTERNO**: o ajuste mínimo acontece na cabeça do agente — o usuário vê o trabalho começar, não o reescrito. Aprovação explícita só existe no Tier 2 (`>>`).
76
- - **Domain mapping stays the ladder's**: after confirmation, slices route through the normal discovery ladder (local selector → Jev → specialist dispatch). The contract is the SPEC, not the dispatcher.
77
- - **Preserve the user's language** (a PT-BR request refines into PT-BR).
78
- - **Falha = fail-open**: qualquer erro no rewrite e o prompt ORIGINAL segue — nunca bloqueia.
79
- - **Nudge self-cancel cheap** (do claude-code-prompt-improver): perguntas abertas com "se isso não se aplicar ao seu caso, ignore" — o nudge barato se anula sozinho quando o palpite erra.
80
- - **Desambiguação — Jev PRIMEIRO quando ativo, `question` como fallback** (revê a regra antiga "NUNCA Jev": com o decision router ATIVO e com budget o usuário já consentiu gastar; a leitura errada custa mais que o escalar):
81
- 1. Ambiguidade bloqueante (leitores materialmente diferentes) + decision router ATIVO → `jev_decide` modo `choice` — candidatos = as leituras, o default recomendado marcado como tal. Decisão interna, silenciosa (Tier 1).
82
- 2. Jev OFF / indisponível / veredito UNVERIFIABLE ou FAIL / timeout → tool `question` nativa com opções e o default recomendado — exatamente o comportamento anterior.
83
- 3. Lacuna NÃO-bloqueante vira escolha com default declarado e segue (nada de Jev nem pergunta — decisa é barata).
84
- 4. **Fail-open nos dois lados**: qualquer erro do Jev cai na `question`; qualquer erro da `question` segue com o default. Nada bloqueia além de uma pergunta legítima.
85
- 5. O Jev decide a LEITURA — nunca escreve o rewrite (prosa é do modelo de sessão).
86
- - **`extra_instructions` do projeto**: convenções do projeto (stack, hosts de deploy, domínios como cupons ML/AliExpress) têm PRIORIDADE sobre os defaults recomendados — leia o AGENTS.md do projeto antes de propor defaults.
87
- - **Referências**: `omkarxpatel/prompt-enhancer` (prefixo opt-in, cap de saída, fail-open) e `severity1/claude-code-prompt-improver` (nudges self-cancel, clarificação com opções) — os dois designs que este skill incorpora. Fundação teórica dos padrões de diagnóstico-e-rewrite: os prompt improvers oficiais (Anthropic/OpenAI), meta-prompting (LLMs guiando LLMs) e o loop de otimização com verificação (OPRO/DSPy) — esta skill é a versão agent-side de custo-controlado: um turno, sem loop de API.
88
- - **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.
89
- - **One refinement turn + no máx. um escalar.** The rewrite is a single planning pass on the session model — no extra provider call, no Jev for the rewrite itself (decision models answer typed scalars, they do not write prose). The ONE exception is the ambiguity `choice` above: quando o router está ativo, é um escalar a mais no budget — se o budget recusar, cai na `question` sem cerimônia.
90
- - **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.
@@ -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.
@@ -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,24 @@ 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. Hermes writes failing test (RED)
59
- 3. Hermes implements minimal code (GREEN)
60
- 4. Hermes refactors (REFACTOR)
61
- 5. Aphrodite writes frontend tests in parallel
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; do not fail a micro-edit against an unrelated global coverage figure
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
- - ❌ Writing code before test
71
- - ❌ Testing implementation details (private methods, internal state)
72
- - ❌ Mocking everything (test real behavior where possible)
73
- - ❌ Skipping RED step (test must fail first)
74
- - ❌ Ignoring flaky tests (fix or delete)
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.
75
88
 
76
89
  ---
77
90
 
@@ -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
- - Verification plan must be approved by @themis before implementation
51
- - Low risk: inline verification (1-2 lines in the task description)
52
- - Escalate to @athena if verification plan reveals unknown scope
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.
@@ -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.