pantheon-opencode 1.6.3-beta.27 → 1.6.3-beta.29

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/CHANGELOG.md CHANGED
@@ -10,6 +10,42 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
10
10
  <!-- Add new changes here. Running `node scripts/versioning.mjs apply` will
11
11
  move this section to a versioned entry and reset the template below. -->
12
12
 
13
+ ## [v1.6.3-beta.29] - 2026-11-07
14
+
15
+ ## 🆕 What's New
16
+ - **skills** — the three-tier refine — minimal adjust default, full contract via >> only
17
+ - **skills** — the refinement tiers — internal minimal adjust, >> full contract
18
+ - **routing** — the pre-stable cost inventory
19
+ - **skills** — the enhancer references and project-convention priority
20
+ - **skills** — the three-tier refine — minimal adjust default, full contract via >> only
21
+ - **routing** — the external-ref regressions
22
+ - **routing** — the criteria object form and the fixture-vs-work rule
23
+ - **install** — the deterministic refine trigger
24
+ - **skills** — agent-forge on-demand agents and the order-mode discovery ladder
25
+ - **routing** — the J1 approval gate — explicit ask, hash-pinned pass
26
+ - **routing** — the J1 enforce handoff contract — risk hands off to the human
27
+ - **routing** — the order mode (top-K ordering) and the noul rename
28
+ - **routing** — the J1 escalation ladder (off/shadow/warn/enforce) and the caller-refusal remedy
29
+ - **skills** — the prompt-refinery contract and the nyx observability restore
30
+ - **install** — one coherent setup summary — inline warnings, project-only worktree box, flags hint
31
+ - **routing** — the beta.12 field acceptance record
32
+ - **tui** — the paginated What's New window with the curated summary contract
33
+
34
+ ## 🐞 Fixed
35
+ - **install** — the jsonc heal repairs orphan commas
36
+ - **config** — the jsonc heal and the venv-aware test:ci
37
+ - **validate** — the V2 package probe
38
+ - **routing** — the local-router D3 PT fallback and the D4 polarity docs
39
+ - **install** — heal the cwd-relative agent source field — the Agent-not-found root cause
40
+ - **routing** — the beta.13 field report — verify evidence, popularity parser, stable plugin root
41
+ - **routing** — the field-report corrections — descriptions ride, envelope everywhere, rank 20, gate influence
42
+ ## [v1.6.3-beta.28] - 2026-11-07
43
+
44
+ ## 🆕 What's New
45
+ - auto-continue split: core 2,656→1,003 tokens, the cooldown/timeout/checkpoint details moved to references/ (read under demand). The checkpoint contract is intact — the test follows the move.
46
+ - prompt-refinery tiers finalized: Tier 1 is an INTERNAL minimal adjust (the user sees the work begin, no approval ceremony; generous scope when the request demands); the six-section contract is EXCLUSIVELY the >> prefix; clarifying questions ride the native question tool.
47
+ - Descriptions trimmed keeping triggers (mnemosyne, agent-forge, prompt-refinery); skill-creator referenced in agent-forge.
48
+
13
49
  ## [v1.6.3-beta.27] - 2026-11-07
14
50
 
15
51
  ## 🆕 What's New
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pantheon-opencode",
3
- "version": "1.6.3-beta.27",
3
+ "version": "1.6.3-beta.29",
4
4
  "description": "Multi-agent orchestration for OpenCode \u2014 14 specialized agents, TDD, Themis review gates.",
5
5
  "type": "module",
6
6
  "workspaces": [
package/plugin.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pantheon",
3
3
  "publisher": "ils15",
4
- "version": "1.6.3-beta.27",
4
+ "version": "1.6.3-beta.29",
5
5
  "displayName": "Pantheon",
6
6
  "description": "Conductor-Delegate orchestration platform with 14 specialized agents, 22 skills, and OpenCode support.",
7
7
  "agents": "./src/agents",
package/pyproject.toml CHANGED
@@ -4,7 +4,7 @@ build-backend = "setuptools.backends._legacy:_Backend"
4
4
 
5
5
  [project]
6
6
  name = "pantheon"
7
- version = "1.6.3-beta.27"
7
+ version = "1.6.3-beta.29"
8
8
  description = "Multi-agent orchestration framework"
9
9
  requires-python = ">=3.11"
10
10
  # Python sources under src/mcp/ import fastmcp/pydantic at runtime, but those
package/skills-lock.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "src/skills/agent-coordination/SKILL.md": "ffa4cfc9c778dd9619665010de32d82d49ae5bb803c985dc99417eb6fc7c3d1c",
3
- "src/skills/agent-forge/SKILL.md": "83d032a17299a67eb0ae7053d5cafd61abad061def19990de118179777300309",
3
+ "src/skills/agent-forge/SKILL.md": "cbe09946a59fa45b471828d9de6e7bc5c4b2fa29e0ce48e21d188593ece6c046",
4
4
  "src/skills/artifact-management/SKILL.md": "55446fbd0e13f9097d091b9773c37910409b70e26df5781bde8d903ff89a07fd",
5
- "src/skills/auto-continue/SKILL.md": "090f61bfa1a394f5146e838c63e7e9d58f47a1f49bc84927e5cdfc07eaa4cc33",
5
+ "src/skills/auto-continue/SKILL.md": "cf785a2afa6d75894ae8889a5c5e107df4b910630dacf82952546c06b0e03941",
6
6
  "src/skills/clonedeps/SKILL.md": "3e0b43cf96da98c83699dc48db3fd58fbfda84b9022bb70d3747875c81c3e124",
7
7
  "src/skills/code-review-checklist/SKILL.md": "cbaffb89045e1bbb7c3c905248f953ec3faa2c1d4679bcd5320df99798df2f98",
8
8
  "src/skills/codemap/SKILL.md": "d21b3fa66b931b29dcf1ec0f0fcf1ec28514642a9f33f96e4b2901a0be74c72d",
@@ -11,7 +11,7 @@
11
11
  "src/skills/incremental-implementation/SKILL.md": "7065ddb45da3c6b6751de07f290e92e6cb072e949a2e3aaae13ee7762f0a70fc",
12
12
  "src/skills/loop-engineering/SKILL.md": "f804e545821b9cca8fe0ec517307ed902446f28c2ca8ff9194c0f987cf7229e3",
13
13
  "src/skills/memory-bank/SKILL.md": "6c27623e5588b7ba44fbd0ea88e5061ed36894e1c7cbc88e50f003c2b463d9ff",
14
- "src/skills/prompt-refinery/SKILL.md": "d2ed35b1d74ee1caef07b572ee7771e19019a9bc6ad40ea71c4b32dbccd256d9",
14
+ "src/skills/prompt-refinery/SKILL.md": "a4935058aba4845ce93049113fc7f524eff31bbe3b1dbf46bbea208c6b2d5612",
15
15
  "src/skills/reflect/SKILL.md": "4c7608c2a55cb8a50ac90fc0e2446bdf25e7914b1748cb7731c311d13c29dfdd",
16
16
  "src/skills/security-hardening/SKILL.md": "6d637e122421f7bc3b751f04854ad343a5a5d35249458bc8939233138fd3f20d",
17
17
  "src/skills/session-goal/SKILL.md": "2911157c8e020f62ca015a73a46f5427f41da71c83e624d6a1cecf7d64c64aea",
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: mnemosyne
3
- description: "Memory curation specialist — owns the durable pantheon-memory stores (memory_store/recall/search) with namespace hygiene and the durable-facts-only policy; curates .pantheon/memory-bank/ and writes ADRs/task records on explicit request. Called by zeus. Never invoked automatically after phases."
3
+ description: "Memory curation specialist — owns the durable pantheon-memory stores (memory_store/recall/search) and curates .pantheon/memory-bank/ + ADRs on request. Use when memory needs saving, curating or recovering."
4
4
  mode: all
5
5
  reasoning_effort: low
6
6
 
@@ -22,7 +22,6 @@ import {
22
22
  DECISION_PROVIDER_ADAPTERS,
23
23
  type DecisionProviderId,
24
24
  } from './local-decision-provider-matrix.ts'
25
- import { selectPantheonSkills } from './local-decision-skills.ts'
26
25
  import { PANTHEON_AGENT_CATALOG, PANTHEON_SKILL_CATALOG } from './pantheon-decision-catalog.ts'
27
26
  import {
28
27
  findRouteKind,
@@ -464,15 +464,15 @@ export function createJ1RiskGateObserver(
464
464
  mode?: J1RiskGateMode
465
465
  threshold?: number
466
466
  },
467
- ): (event: unknown) => Promise<void | J1Verdict> {
467
+ ): (event: unknown) => Promise<J1Verdict | undefined> {
468
468
  const timeoutMs = options.timeoutMs ?? J1_RISK_GATE_TIMEOUT_MS
469
469
  const sink = options.sink
470
470
  const enforce = options.mode === 'enforce'
471
471
  const threshold = options.threshold ?? J1_ENFORCE_THRESHOLD_DEFAULT
472
- return async (event: unknown): Promise<void | J1Verdict> => {
472
+ return async (event: unknown): Promise<J1Verdict | undefined> => {
473
473
  try {
474
474
  const payload = (event ?? {}) as J1ExecuteBeforeEvent
475
- if (!isRiskGateTarget(payload.tool)) return
475
+ if (!isRiskGateTarget(payload.tool)) return undefined
476
476
  const tool = payload.tool
477
477
  const scope = classifyRiskGateScope(tool)
478
478
  const built = buildRiskGateRequest({
@@ -482,7 +482,7 @@ export function createJ1RiskGateObserver(
482
482
  })
483
483
  if (!built.ok) {
484
484
  recordSkip(sink, 'skip-input-invalid')
485
- return
485
+ return undefined
486
486
  }
487
487
  const controller = new AbortController()
488
488
  const timer = setTimeout(() => controller.abort(), timeoutMs)
@@ -507,11 +507,11 @@ export function createJ1RiskGateObserver(
507
507
  ])
508
508
  if (outcome === 'timeout') {
509
509
  recordSkip(sink, 'skip-timeout')
510
- return
510
+ return undefined
511
511
  }
512
512
  if (!outcome.ok) {
513
513
  recordSkip(sink, mapGateFailureToSkipReason(outcome.reasonCode))
514
- return
514
+ return undefined
515
515
  }
516
516
  const evaluation = evaluateRiskGateDecision(outcome.call.response, outcome.call.request)
517
517
  observeShadow(
@@ -543,6 +543,7 @@ export function createJ1RiskGateObserver(
543
543
  // be opened; any other unexpected failure lands here too. One skip
544
544
  // record, no detail, no propagation into the tool call.
545
545
  recordSkip(sink, 'skip-gate-unavailable')
546
+ return undefined
546
547
  }
547
548
  }
548
549
  }
@@ -447,6 +447,47 @@ export interface V2ToolShadowOptions {
447
447
  * per-call definition with no construction-time I/O. A fresh descriptor array
448
448
  * prevents callers from mutating another registration's definitions.
449
449
  */
450
+ /** JSON Schema for `todowrite` — the TUI todo panel's feed (full replace). */
451
+ const TODOWRITE_INPUT = {
452
+ type: 'object',
453
+ additionalProperties: false,
454
+ required: ['todos'],
455
+ properties: {
456
+ todos: {
457
+ type: 'array',
458
+ minItems: 1,
459
+ maxItems: 50,
460
+ items: {
461
+ type: 'object',
462
+ additionalProperties: false,
463
+ required: ['content', 'status'],
464
+ properties: {
465
+ content: { type: 'string', minLength: 1, maxLength: 500 },
466
+ status: { type: 'string', enum: ['pending', 'in_progress', 'completed', 'cancelled'] },
467
+ },
468
+ },
469
+ },
470
+ },
471
+ } as const
472
+
473
+ /** A V2 pass-through `todowrite`: the host stores the tool part in the
474
+ * transcript, and the TUI todo panel renders the newest completed write. The
475
+ * tool itself is stateless — the transcript IS the store. */
476
+ const todowriteTool: V2ToolDef = {
477
+ name: 'todowrite',
478
+ description:
479
+ 'Write the session task checklist (full replace). The TUI todo panel renders the ' +
480
+ 'newest list; mark each item in_progress/completed as soon as its state changes.',
481
+ input: TODOWRITE_INPUT,
482
+ output: {},
483
+ execute: async (input) => {
484
+ const todos = Array.isArray((input as Record<string, unknown>).todos)
485
+ ? (input as Record<string, unknown>).todos
486
+ : []
487
+ return { ok: true, todos, output: JSON.stringify({ todos }) }
488
+ },
489
+ }
490
+
450
491
  export function createV2ToolDefinitions(
451
492
  visionRuntime?: V2VisionRuntime,
452
493
  shadow: V2ToolShadowOptions = {},
@@ -497,6 +538,7 @@ export function createV2ToolDefinitions(
497
538
  ...(shadow.complexitySink === undefined ? {} : { sink: shadow.complexitySink }),
498
539
  }),
499
540
  )
541
+ definitions.push(todowriteTool)
500
542
  if (visionRuntime) definitions.push(createV2VisionTool(visionRuntime))
501
543
  if (jevRuntime) definitions.push(createV2JevDecisionDefinition(jevRuntime))
502
544
  return definitions
package/src/plugin-v2.ts CHANGED
@@ -1994,7 +1994,7 @@ async function registerV2ToolHooks(
1994
1994
  // only — it is fired WITHOUT await inside the before-handler (fire-and-
1995
1995
  // observe), self-bounds at 2s with an AbortController, and never retries.
1996
1996
  const j1Mode = j1ModeFromEnv()
1997
- let j1Observer: ((event: unknown) => Promise<void | J1Verdict>) | undefined
1997
+ let j1Observer: ((event: unknown) => Promise<J1Verdict | undefined>) | undefined
1998
1998
  if (jevRuntime !== undefined && j1Mode !== 'off') {
1999
1999
  const j1Sink = createTelemetrySink()
2000
2000
  j1TelemetrySink = j1Sink
@@ -367,7 +367,7 @@ async function readChangelogForBundle(bundleUrl) {
367
367
  }
368
368
  /** The ambient build-time version, or null outside a tsdown build. */
369
369
  function embeddedVersion() {
370
- return "1.6.3-beta.25";
370
+ return "1.6.3-beta.28";
371
371
  }
372
372
  /**
373
373
  * Resolve the running Pantheon version for the what's-new window: the plugin
@@ -3752,7 +3752,7 @@ function Sidebar(props) {
3752
3752
  setProp(_el$12, "width", "100%");
3753
3753
  setProp(_el$12, "padding", 1);
3754
3754
  setProp(_el$13, "attributes", 1);
3755
- insert(_el$13, `Pantheon v1.6.3-beta.25`);
3755
+ insert(_el$13, `Pantheon v1.6.3-beta.28`);
3756
3756
  insert(_el$14, () => presetHeaderLine(model.preset().name ?? "", model.provider()));
3757
3757
  insert(_el$12, createComponent(Show, {
3758
3758
  get when() {
@@ -4473,7 +4473,7 @@ function HomeStatus(props) {
4473
4473
  const muted = () => props.context.theme?.text?.muted ?? props.context.theme?.text?.base;
4474
4474
  return (() => {
4475
4475
  var _el$72 = createElement("text");
4476
- insert(_el$72, () => `Pantheon v1.6.3-beta.25${preset().name ? ` ▸ ${preset().name}` : ""}`);
4476
+ insert(_el$72, () => `Pantheon v1.6.3-beta.28${preset().name ? ` ▸ ${preset().name}` : ""}`);
4477
4477
  effect((_$p) => setProp(_el$72, "fg", muted(), _$p));
4478
4478
  return _el$72;
4479
4479
  })();
@@ -167,7 +167,7 @@ async function detectVersion(api) {
167
167
  if (ver) return ver;
168
168
  }
169
169
  } catch {}
170
- return "1.6.3-beta.25";
170
+ return "1.6.3-beta.28";
171
171
  }
172
172
  /**
173
173
  * usage-bar — AI subscription usage gauge for the opencode TUI.
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "pantheon-tui",
3
- "version": "1.6.3-beta.27",
3
+ "version": "1.6.3-beta.29",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "pantheon-tui",
9
- "version": "1.6.3-beta.27",
9
+ "version": "1.6.3-beta.29",
10
10
  "license": "MIT",
11
11
  "dependencies": {
12
12
  "@opencode-ai/plugin": "1.18.33",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pantheon-tui",
3
3
  "type": "module",
4
- "version": "1.6.3-beta.27",
4
+ "version": "1.6.3-beta.29",
5
5
  "description": "Pantheon TUI plugin — V1 rich sidebar and usage gauges; native V2 status, session and delegation sidebar",
6
6
  "license": "MIT",
7
7
  "engines": {
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: agent-forge
3
- description: "Forge a new OpenCode agent on demand — interview the user, draft a canonical agent .md (frontmatter, permissions, MCP grants, governance ladder), write it project- or user-scoped, and validate it against the existing roster. Use when the user asks for 'um agente que faça X', 'create an agent for X', or wants a specialist that the roster lacks."
3
+ description: "Forge a new OpenCode agent on demand. Use when the user asks for 'um agente que faça X', 'create an agent for X', or wants a specialist the roster lacks."
4
4
  ---
5
5
 
6
6
  # Agent Forge
@@ -67,6 +67,7 @@ Rules that are NOT optional:
67
67
  - **Governance identical** — the ladder block is byte-copied from a canonical agent; a forged agent never invents its own escalation rules.
68
68
  - **Never overwrite** — if the target file exists, show it and ask before replacing.
69
69
  - **Routing honesty** — project agents are picked up by the host automatically; do not claim they are in `routing.yml` or the decision catalogs (those are package-level and validated by tests).
70
+ - **Referência de fluxo**: o `skill-creator` da Anthropic (entender objetivo → quando ativa → formato → como testar → rascunho → iterar) é o precedentes do nosso interview → draft → confirm.
70
71
 
71
72
  ---
72
73
 
@@ -74,171 +74,20 @@ Full-auto may continue only within a task and scope the user explicitly authoriz
74
74
 
75
75
  ---
76
76
 
77
- ## Cooldown Pattern
77
+ ## Checkpoint content contract (format safety — keep in core)
78
78
 
79
- Between phases, execute a brief synthesis handoff to prevent context drift and prepare the next phase:
80
-
81
- ### Phase Summary Template
82
- ```
83
- Phase N complete. Summary:
84
- - What was done: <2 bullet points>
85
- - What changed: <files modified>
86
- - What's next: <Gate 2 review OR next phase>
87
- - Will continue: <YES / after gate approval>
88
- ```
89
-
90
- ### Cooldown Rules
91
- 1. **Between parallel waves (no dependency):** No cooldown needed — wave results are independent
92
- 2. **Between sequential phases:** Summarize when dependencies or risk changed; skip ceremony for one-step work
93
- 3. **After required Themis review:** Reassess findings before continuing
94
- 4. **Session reuse check:** Reuse a prior specialist session only when it reduces real context duplication
95
-
96
- ### Abbreviated Cooldown
97
- When auto-continuing between sequential non-gated phases, the cooldown is abbreviated to one line:
98
- ```
99
- → Phase N done. Next: Phase N+1. [auto-continuing]
100
- ```
101
- Only expand to full cooldown when hitting a mandatory gate.
102
-
103
- ---
104
-
105
- ## Timeout & Retry Enforcement
106
-
107
- Delegate through the root `subagent` tool observed in the Beta 10 runtime. `task()` is
108
- host/API terminology, not an assumed root tool; call shape and background support are
109
- runtime-dependent. Prefer synchronous dispatch unless the active schema exposes background
110
- and the host provides an observable completion notification. Do not assume `task_status`,
111
- `cancel_task`, or board-based tracking/recovery tools are available. When no completion
112
- mechanism is observable, use synchronous dispatch or state the limitation; do not claim
113
- that jobs are being tracked or recovered.
114
-
115
- When a delegated agent does not respond in time, enforce the timeout policy defined in
116
- `src/instructions/zeus-timeout-retry.instructions.md`.
117
-
118
- **That file is the single authority** for per-role timeouts, retry counts, fallback chains, and
119
- whether partial results are acceptable. It is force-fed into every session via `AGENTS.md`; this
120
- skill is opt-in. Do not restate those values here — a copy in this skill is precisely what drifted
121
- out of sync with them. If a dispatch times out, read the role's row from the instruction file.
122
-
123
- ### Timeout Parcial (Partial Results)
124
-
125
- Whether an agent may return partial results is the **Partial Results OK?** column in that table.
126
- Only agents marked ✅ there may return partial — never implementers, never reviewers.
127
-
128
- **How to signal timeout parcial:**
129
- When dispatching, set the expectation explicitly:
130
- ```
131
- @apollo Search for all auth-related files. If you hit timeout, return whatever you have found so far — partial results are acceptable.
132
- ```
133
-
134
- ### Timeout Tracking Table
135
-
136
- Maintain an in-context (not persistent/native) checklist of delegations when needed:
137
-
138
- | Agent | Started | Timeout | Status | Partial OK? |
139
- |-------|---------|---------|--------|-------------|
140
- | apollo | T+0s | T+60s | ✅ complete | ✅ |
141
- | hermes | T+0s | T+180s | ⏳ in progress | ❌ |
79
+ When checkpointing via `context_save`: `content=JSON.stringify(state)` and an
80
+ explicit `session_id`; `state` must be an OBJECT (its `goal`/`phase`/
81
+ `delegations`/`heartbeat` values are objects, `tail` is an array); if the
82
+ optional `goal` is unset, omit the key rather than passing a string
83
+ placeholder.
142
84
 
143
85
  ---
144
86
 
145
- ## Examples
146
-
147
- **Good (auto-continues):**
148
- ```
149
- ✅ Wrote migration file.
150
- → Running migration tests...
151
- ✅ Tests pass (3/3).
152
- → Next: write UserRepository query methods.
153
- ```
154
-
155
- **Good (stops at Gate 2):**
156
- ```
157
- ✅ Phase 1 complete: migration + repository layer.
158
- ⏸️ GATE 2 — Themis review summary:
159
- - Coverage: 87% ✅ | No OWASP issues ✅
160
- Ready for Phase 2? Waiting for go-ahead.
161
- ```
162
-
163
- **Bad (stops unnecessarily):**
164
- ```
165
- ✅ Wrote the migration file.
166
- Should I now run the migration tests? [waiting]
167
- ```
168
-
169
- ## Session Heartbeat & Checkpoints
170
-
171
- Session state is **not** file-based. It lives in **pantheon-persistence** under the
172
- `checkpoint:<slug>` namespace and is cleaned up automatically by a 4h TTL.
173
-
174
- Use checkpoints only when `context_save` and `context_get` are explicitly
175
- present in the active session's tool list. If unavailable, do not attempt a
176
- checkpoint or guess a session ID; carry the handoff in the normal response.
177
-
178
- When available, call `context_save` with `content=JSON.stringify(state)` and an
179
- explicit `session_id`. A successful save needs no immediate `context_get`; read
180
- only when resuming or when the save result is uncertain. Reuse the same session
181
- ID so the `latest` pointer survives compaction. `state` must be an object — never pass a bare string as `content`: its
182
- `goal`/`phase`/`delegations`/`heartbeat` values are objects and `tail` is an array.
183
- `goal` is optional; when unset, omit the key rather than passing a string placeholder.
184
-
185
- ### Heartbeat Check
186
- - Check heartbeat only when checkpoint tools are available and the workflow needs a durable resume.
187
- - Write a heartbeat after anti-stall recovery only when the current session exposes checkpoint tools.
188
-
189
- ### Checkpoint Rules
190
- 1. Save checkpoints only for long-running/multi-phase work, context-loss risk, or substantive parallel work — not a one-off command or bounded fix
191
- 2. Include current phase and remaining tasks when a checkpoint is warranted
192
- 3. On resume, read the latest checkpoint only with a known session ID; otherwise request the missing handoff context.
193
-
194
- > Do not create `heartbeat.json`, `checkpoint-<N>.json`, or `session.json` under
195
- > `.pantheon/deepwork/`. That file-based mechanism is retired — TTL handles cleanup, and reading
196
- > a file that nothing writes back returns stale state.
197
-
198
- ---
199
-
200
- ## Safety Policy Configuration
201
-
202
- Configurable gates for different platforms and risk levels:
203
-
204
- | Gate | Default | Auto-Approval Condition |
205
- |------|---------|------------------------|
206
- | Council | Only when explicitly invoked | Never auto-start a council for ordinary implementation |
207
- | Plan approval | Only for requested or risk-required plans | Skip for bounded, clear work |
208
- | Themis review | Required for sensitive/material changes | May omit for trivial isolated edits; never auto-bypass required findings |
209
- | Git / external actions | Never Auto | Commit, push, merge, deploy, destructive/global changes require explicit approval |
210
- | Deploy | Always Ask | N/A — always requires human |
211
- | Destructive DB Ops | Always Ask | N/A — always requires human |
212
-
213
- ### Configuration Format (for agents/PLAN.md)
214
-
215
- ```yaml
216
- auto-continue:
217
- checkpoint_interval: 5 # turns between checkpoints
218
- idle_warning: 60 # seconds before warning
219
- idle_stall: 120 # seconds before stall detection
220
- idle_pause: 300 # seconds before auto-pause
221
- gates:
222
- plan_approval: when_required_by_scope_or_risk
223
- themis_review: required_for_sensitive_or_material_changes
224
- git_commit: never_auto
225
- deploy: always_ask
226
- destructive_ops: always_ask
227
- ```
228
-
229
- ### Idle Detection
230
-
231
- | Condition | Action |
232
- |-----------|--------|
233
- | No tool call for 60s | Log warning heartbeat (status: warning) |
234
- | No tool call for 120s | Trigger anti-stall protocol |
235
- | No tool call for 300s | Auto-save checkpoint and pause session |
236
- | Resume | User must acknowledge and restart |
237
-
238
- ---
239
-
240
- ## Scope
241
-
242
- **Applies to:** Zeus (multi-phase), Hermes/Aphrodite/Demeter (TDD cycles), Apollo (parallel searches), Talos (bug fixes).
87
+ ## Details under demand
243
88
 
244
- **Does NOT apply to:** Athena planning (always presents plan = Gate 1), Iris (confirms before push), destructive operations (always ask).
89
+ The cooldown templates, timeout/retry enforcement (the single authority is
90
+ `src/instructions/zeus-timeout-retry.instructions.md` — force-fed via AGENTS.md),
91
+ tracking-table format, worked examples and the checkpoint rules live in
92
+ `references/auto-continue-details.md` — read it ONLY when a delegation times out,
93
+ you need a cooldown template, or you are about to checkpoint.
@@ -0,0 +1,175 @@
1
+ # Auto-Continue — details under demand
2
+
3
+ Moved out of SKILL.md (cost inventory beta.27: the body was 2,656 tokens and
4
+ most of it only matters mid-task). Read on demand.
5
+
6
+ ---
7
+
8
+ ## Cooldown Pattern
9
+
10
+ Between phases, execute a brief synthesis handoff to prevent context drift and prepare the next phase:
11
+
12
+ ### Phase Summary Template
13
+ ```
14
+ Phase N complete. Summary:
15
+ - What was done: <2 bullet points>
16
+ - What changed: <files modified>
17
+ - What's next: <Gate 2 review OR next phase>
18
+ - Will continue: <YES / after gate approval>
19
+ ```
20
+
21
+ ### Cooldown Rules
22
+ 1. **Between parallel waves (no dependency):** No cooldown needed — wave results are independent
23
+ 2. **Between sequential phases:** Summarize when dependencies or risk changed; skip ceremony for one-step work
24
+ 3. **After required Themis review:** Reassess findings before continuing
25
+ 4. **Session reuse check:** Reuse a prior specialist session only when it reduces real context duplication
26
+
27
+ ### Abbreviated Cooldown
28
+ When auto-continuing between sequential non-gated phases, the cooldown is abbreviated to one line:
29
+ ```
30
+ → Phase N done. Next: Phase N+1. [auto-continuing]
31
+ ```
32
+ Only expand to full cooldown when hitting a mandatory gate.
33
+
34
+ ---
35
+
36
+ ## Timeout & Retry Enforcement
37
+
38
+ Delegate through the root `subagent` tool observed in the Beta 10 runtime. `task()` is
39
+ host/API terminology, not an assumed root tool; call shape and background support are
40
+ runtime-dependent. Prefer synchronous dispatch unless the active schema exposes background
41
+ and the host provides an observable completion notification. Do not assume `task_status`,
42
+ `cancel_task`, or board-based tracking/recovery tools are available. When no completion
43
+ mechanism is observable, use synchronous dispatch or state the limitation; do not claim
44
+ that jobs are being tracked or recovered.
45
+
46
+ When a delegated agent does not respond in time, enforce the timeout policy defined in
47
+ `src/instructions/zeus-timeout-retry.instructions.md`.
48
+
49
+ **That file is the single authority** for per-role timeouts, retry counts, fallback chains, and
50
+ whether partial results are acceptable. It is force-fed into every session via `AGENTS.md`; this
51
+ skill is opt-in. Do not restate those values here — a copy in this skill is precisely what drifted
52
+ out of sync with them. If a dispatch times out, read the role's row from the instruction file.
53
+
54
+ ### Timeout Parcial (Partial Results)
55
+
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.
58
+
59
+ **How to signal timeout parcial:**
60
+ When dispatching, set the expectation explicitly:
61
+ ```
62
+ @apollo Search for all auth-related files. If you hit timeout, return whatever you have found so far — partial results are acceptable.
63
+ ```
64
+
65
+ ### Timeout Tracking Table
66
+
67
+ Maintain an in-context (not persistent/native) checklist of delegations when needed:
68
+
69
+ | Agent | Started | Timeout | Status | Partial OK? |
70
+ |-------|---------|---------|--------|-------------|
71
+ | apollo | T+0s | T+60s | ✅ complete | ✅ |
72
+ | hermes | T+0s | T+180s | ⏳ in progress | ❌ |
73
+
74
+ ---
75
+
76
+ ## Examples
77
+
78
+ **Good (auto-continues):**
79
+ ```
80
+ ✅ Wrote migration file.
81
+ → Running migration tests...
82
+ ✅ Tests pass (3/3).
83
+ → Next: write UserRepository query methods.
84
+ ```
85
+
86
+ **Good (stops at Gate 2):**
87
+ ```
88
+ ✅ Phase 1 complete: migration + repository layer.
89
+ ⏸️ GATE 2 — Themis review summary:
90
+ - Coverage: 87% ✅ | No OWASP issues ✅
91
+ Ready for Phase 2? Waiting for go-ahead.
92
+ ```
93
+
94
+ **Bad (stops unnecessarily):**
95
+ ```
96
+ ✅ Wrote the migration file.
97
+ Should I now run the migration tests? [waiting]
98
+ ```
99
+
100
+ ## Session Heartbeat & Checkpoints
101
+
102
+ Session state is **not** file-based. It lives in **pantheon-persistence** under the
103
+ `checkpoint:<slug>` namespace and is cleaned up automatically by a 4h TTL.
104
+
105
+ Use checkpoints only when `context_save` and `context_get` are explicitly
106
+ present in the active session's tool list. If unavailable, do not attempt a
107
+ checkpoint or guess a session ID; carry the handoff in the normal response.
108
+
109
+ When available, call `context_save` with `content=JSON.stringify(state)` and an
110
+ explicit `session_id`. A successful save needs no immediate `context_get`; read
111
+ only when resuming or when the save result is uncertain. Reuse the same session
112
+ ID so the `latest` pointer survives compaction. `state` must be an object — never pass a bare string as `content`: its
113
+ `goal`/`phase`/`delegations`/`heartbeat` values are objects and `tail` is an array.
114
+ `goal` is optional; when unset, omit the key rather than passing a string placeholder.
115
+
116
+ ### Heartbeat Check
117
+ - Check heartbeat only when checkpoint tools are available and the workflow needs a durable resume.
118
+ - Write a heartbeat after anti-stall recovery only when the current session exposes checkpoint tools.
119
+
120
+ ### Checkpoint Rules
121
+ 1. Save checkpoints only for long-running/multi-phase work, context-loss risk, or substantive parallel work — not a one-off command or bounded fix
122
+ 2. Include current phase and remaining tasks when a checkpoint is warranted
123
+ 3. On resume, read the latest checkpoint only with a known session ID; otherwise request the missing handoff context.
124
+
125
+ > Do not create `heartbeat.json`, `checkpoint-<N>.json`, or `session.json` under
126
+ > `.pantheon/deepwork/`. That file-based mechanism is retired — TTL handles cleanup, and reading
127
+ > a file that nothing writes back returns stale state.
128
+
129
+ ---
130
+
131
+ ## Safety Policy Configuration
132
+
133
+ Configurable gates for different platforms and risk levels:
134
+
135
+ | Gate | Default | Auto-Approval Condition |
136
+ |------|---------|------------------------|
137
+ | Council | Only when explicitly invoked | Never auto-start a council for ordinary implementation |
138
+ | Plan approval | Only for requested or risk-required plans | Skip for bounded, clear work |
139
+ | Themis review | Required for sensitive/material changes | May omit for trivial isolated edits; never auto-bypass required findings |
140
+ | Git / external actions | Never Auto | Commit, push, merge, deploy, destructive/global changes require explicit approval |
141
+ | Deploy | Always Ask | N/A — always requires human |
142
+ | Destructive DB Ops | Always Ask | N/A — always requires human |
143
+
144
+ ### Configuration Format (for agents/PLAN.md)
145
+
146
+ ```yaml
147
+ auto-continue:
148
+ checkpoint_interval: 5 # turns between checkpoints
149
+ idle_warning: 60 # seconds before warning
150
+ idle_stall: 120 # seconds before stall detection
151
+ idle_pause: 300 # seconds before auto-pause
152
+ gates:
153
+ plan_approval: when_required_by_scope_or_risk
154
+ themis_review: required_for_sensitive_or_material_changes
155
+ git_commit: never_auto
156
+ deploy: always_ask
157
+ destructive_ops: always_ask
158
+ ```
159
+
160
+ ### Idle Detection
161
+
162
+ | Condition | Action |
163
+ |-----------|--------|
164
+ | No tool call for 60s | Log warning heartbeat (status: warning) |
165
+ | No tool call for 120s | Trigger anti-stall protocol |
166
+ | No tool call for 300s | Auto-save checkpoint and pause session |
167
+ | Resume | User must acknowledge and restart |
168
+
169
+ ---
170
+
171
+ ## Scope
172
+
173
+ **Applies to:** Zeus (multi-phase), Hermes/Aphrodite/Demeter (TDD cycles), Apollo (parallel searches), Talos (bug fixes).
174
+
175
+ **Does NOT apply to:** Athena planning (always presents plan = Gate 1), Iris (confirms before push), destructive operations (always ask).
@@ -1,11 +1,11 @@
1
1
  ---
2
2
  name: prompt-refinery
3
- description: "Turn a rough, vague, or one-line request into a structured execution contract (objective, scope slices, acceptance criteria, deliverables, open questions) shown to the user BEFORE executing. Use when a request spans multiple concerns or lacks explicit acceptance criteria."
3
+ description: "Turn a vague multi-concern request into a usable brief — internally and silently by default; the full contract is shown only via >>. Use when the request mixes refactor/fix/redesign without acceptance criteria, or starts with >>."
4
4
  ---
5
5
 
6
6
  # Prompt Refinery
7
7
 
8
- > **A vague request executes expensively and wrong. Refine it into a contract, show the contract, then execute what was confirmed.**
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.**
9
9
 
10
10
  ---
11
11
 
@@ -14,16 +14,16 @@ description: "Turn a rough, vague, or one-line request into a structured executi
14
14
  | Nível | Gatilho | O que acontece |
15
15
  |---|---|---|
16
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 (automático)** | O sinal determinístico dispara (multi-concern sem critérios) | Reescreve o prompt: **PT corrigido** (typos, acentos), estrutura leve (objetivo + fatias em 1 linha cada + o que falta como pergunta), expansão do implícito. **Limite duro: ~15 linhas.** Não é um contrato — é o mesmo pedido, legível |
18
- | **2 — Contrato completo** | **SOMENTE prefixo `>>`** (`>> fazer os deploys e limpar a vps`) | As seis seções inteiras (objetivo, fatias, critérios, entregáveis, perguntas com defaults, glossário) |
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) |
19
19
 
20
20
  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.
21
21
 
22
22
  ---
23
23
 
24
- ## The contract shape — TWO tiers (cost control)
24
+ ## The contract shape — tiers and caps
25
25
 
26
- **COMPACTO (default, quando o sinal determinístico dispara):** no máximo **8 linhas**, uma por seção, pule o que não se aplica. Exemplo de saída aceitável:
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:
27
27
 
28
28
  ```
29
29
  Objetivo: publicar deploys pendentes e liberar espaço nos VPS sem perder dados.
@@ -32,7 +32,7 @@ Aceite: lista de SHAs por serviço; espaço antes/depois; nada persistente apaga
32
32
  Perguntas: quais VPS? (default: os que rodam estes serviços) | limpeza destrutiva? (default: não).
33
33
  ```
34
34
 
35
- **COMPLETO (só quando o usuário pedir "contrato completo" ou o domínio exigir):** as seis seções abaixo, inteiras.
35
+ **NÍVEL 2 — Contrato completo (SOMENTE com o prefixo `>>`):** as seis seções abaixo, inteiras, apresentadas ao usuário para confirmar-ou-ajustar.
36
36
 
37
37
  Produce ALL of the following sections, filling from the request and marking real gaps as open questions — never invent requirements silently:
38
38
 
@@ -47,13 +47,14 @@ Produce ALL of the following sections, filling from the request and marking real
47
47
 
48
48
  ## Operating rules
49
49
 
50
- - **Show, then execute.** The refined contract is presented to the user for confirm-or-adjust BEFORE implementation — one confirmation, not a dialogue. Silence or "ok" proceeds with the defaults stated in Perguntas abertas.
50
+ - **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 (`>>`).
51
51
  - **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.
52
52
  - **Preserve the user's language** (a PT-BR request refines into PT-BR).
53
53
  - **Falha = fail-open**: qualquer erro no rewrite e o prompt ORIGINAL segue — nunca bloqueia.
54
- - **Nudge self-cancel cheap** (do claude-code-prompt-improver): perguntas abertas abrem com "se isso não se aplicar ao seu caso, ignore" — o nudge barato se anula sozinho quando o palpite erra, sem custo de diálogo.
54
+ - **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.
55
+ - **Perguntas pela tool `question` nativa** (NUNCA Jev — decisão de paid/free; não prosa solta): uma lacuna que BLOQUEIA a execução vira uma pergunta com opções e o default recomendado. Lacuna não-bloqueante vira escolha com default declarado e segue.
55
56
  - **`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.
56
57
  - **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.
57
- - **Modelo**: o rewrite roda no modelo de sessão com o cap de 8 linhas; "barato" é o CAP, não um tier específico — 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.
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.
58
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).
59
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.