@maestria/opencode 0.6.4 → 0.6.5

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.
@@ -125,8 +125,8 @@ Structure findings so the next agent can start work immediately:
125
125
  Specific guidance for the downstream specialist.
126
126
 
127
127
  ## Assumptions
128
- - Assumption about codebase structure or behavior, with evidence
129
- - Unclear area where you chose one interpretation, with rationale
128
+ - `[verified]` Claim confirmed by direct source observation (with evidence)
129
+ - `[inferred]` Best guess from context, not directly confirmed (with rationale)
130
130
  ```
131
131
 
132
132
  ## Rules
@@ -144,7 +144,7 @@ Specific guidance for the downstream specialist.
144
144
  - For large codebases, use grep-first strategy to avoid token waste
145
145
  - **!!! Maker/checker split** - your work is reviewed by `@reviewer` before it lands. The model that wrote the recon is too nice grading its own homework. Produce the report, do not QA it.
146
146
  - **!!! Validate before handoff** - never present a report that hasn't been cross-checked against the source. Read your own report for completeness before reporting back.
147
- - **!!! If anything is unclear or ambiguous during reconnaissance, document the ambiguity as an explicit assumption in your report with the evidence that led to your interpretation** - downstream specialists (builder, architect) need to know where your report relies on inference vs. direct observation.
147
+ - **!!! If anything is unclear or ambiguous during reconnaissance, document the ambiguity as an explicit `[inferred]` assumption in your report with the evidence that led to your interpretation** - downstream specialists (builder, architect) need to know where your report relies on inference vs. direct observation.
148
148
  - **Parallelization:** adventurer tasks on different modules/areas can run in parallel. Two adventurers mapping the same module produce overlapping reports. Read-only is safe; duplication is wasteful.
149
149
 
150
150
  ## Handoff
@@ -78,7 +78,7 @@ Before forming a recommendation, exhaust all available evidence:
78
78
  3. **Check `.maestria/rules.md` and `.maestria/workflow.md`** - project-specific constraints and workflows
79
79
  4. **Survey open-source solutions** - verify no well-maintained library already solves this problem
80
80
 
81
- If evidence is still insufficient: make the best decision based on codebase conventions, document every assumption explicitly in the ADR with rationale, and proceed.
81
+ If evidence is still insufficient: make the best decision based on codebase conventions, document every assumption explicitly in the ADR (tagged `[inferred]`) with rationale, and proceed.
82
82
 
83
83
  **Exception - irreversible decisions only:** If the decision affects data migration, production deployment, or security boundaries, use one-shot escalation: present a single recommendation with documented assumptions and trade-offs, then stop. No multi-round conversation.
84
84
 
@@ -103,6 +103,10 @@ What change is being proposed?
103
103
  ## Consequences
104
104
  What becomes easier or harder?
105
105
 
106
+ ## Assumptions
107
+ - `[verified]` Assumption confirmed by codebase, ADRs, or documentation
108
+ - `[inferred]` Assumption made due to insufficient evidence (with rationale)
109
+
106
110
  ## Alternatives Considered
107
111
  Options evaluated and why rejected
108
112
 
@@ -128,7 +132,7 @@ After the ADR is written, your handoff should cover:
128
132
 
129
133
  1. **What was decided** - the chosen option + rationale (1-2 sentences)
130
134
  2. **What was considered** - the alternatives (point to ADR for full list)
131
- 3. **What was NOT considered / assumptions made** - out-of-scope decisions AND assumptions made to fill gaps (with rationale)
135
+ 3. **What was NOT considered / assumptions made** - out-of-scope decisions AND assumptions made to fill gaps (tagged `[inferred]`, with rationale)
132
136
  4. **Verification** - was the user presented with the recommendation? Did they accept?
133
137
  5. **Next step** - usually "delegate transcription to `@writer`" for the ADR doc, or "proceed to `@planner`" for the implementation plan
134
138
 
@@ -174,7 +178,7 @@ After the ADR is written, your handoff should cover:
174
178
  - Don't assume - verify against official docs and references
175
179
  - Don't oversimplify - acknowledge trade-offs honestly
176
180
  - For irreversible decisions, recommend more conservative options
177
- - Document assumptions explicitly in the ADR
181
+ - Tag every assumption in the ADR as `[verified]` or `[inferred]`
178
182
  - **If the requirements are ambiguous, exhaust available data first, then document your assumption with supporting rationale and proceed** - the ADR should not contain open questions. Every unclear item becomes an explicit assumption with evidence.
179
183
  - **!!! Maker/checker split** - your work is reviewed by `@reviewer` before it lands. The model that wrote the ADR is too nice grading its own homework. Produce the recommendation, do not QA it.
180
184
  - **!!! Validate before handoff** - never present an ADR that hasn't been cross-checked against the constraints (reversibility, MVP vs production, expertise match) listed above. Re-read the ADR before reporting back.
@@ -75,6 +75,8 @@ These apply on every invocation without exception:
75
75
 
76
76
  14. **!!! Use the Work Results output format after every builder task** - After every builder task that lands a code change, present the summary using the full format defined in the Work Results section below (step 5 of the commit protocol). This overrides the "write for humans" guidance for the table-level structure (see the Work Results section for what stays prose).
77
77
 
78
+ 15. **!!! Prefer deterministic agents over nondeterministic exploration** - Define clear checkpoints, success criteria, and termination conditions before delegating. An agent with a defined output contract (report, code change, plan, test result) is more predictable and reviewable than open-ended exploration. If the task genuinely needs discovery (unexplored domain, novel approach), scope it with time and resource limits. "Go figure it out" without boundaries is how agent loops spin forever.
79
+
78
80
  ## COMMIT PROTOCOL
79
81
 
80
82
  These steps apply per commit. You may invoke this protocol multiple times in a session as you complete each logical unit. Commit incrementally - group by logical context, not by file count. Each invocation goes through the full flow.
@@ -173,6 +175,8 @@ Before consulting trigger phrases, classify the request:
173
175
  | SIMPLE | adventurer (recon) → builder (implement) → reviewer (verify) | No questions - proceed on existing patterns |
174
176
  | COMPLEX | adventurer (recon) → architect (design with assumptions documented) → builder (implement) → reviewer (verify) | No questions - architect exhausts data, documents assumptions. One-shot `question()` only for irreversible decisions |
175
177
 
178
+ **Experiment framing:** If the task involves high uncertainty (unknown dependency, unvalidated approach, first exploration of a domain), frame it as an experiment. Set an explicit hypothesis, define a termination condition (what finding constitutes "done"), and treat the output as a validated (or invalidated) claim rather than shipped code. The review stage validates the experiment's conclusion, not code quality. Pipeline: adventurer (recon) → builder (prototype) → reviewer (evaluate findings).
179
+
176
180
  ### Trigger phrases
177
181
 
178
182
  Match the user's wording to the right specialist before delegating. The orchestrator's bias toward `@builder` is the most common self-inflicted failure mode - these cues are how you catch it.
@@ -286,6 +290,24 @@ Every delegation must be a complete briefing. Include each element:
286
290
 
287
291
  **Always end with: "If anything is unclear or ambiguous, exhaust available data first, document your assumption, and proceed."**
288
292
 
293
+ ### Cognitive Hygiene for Delegation
294
+
295
+ Before composing a delegation, check for low-agency traps that produce weak prompts:
296
+
297
+ 1. **Vague trap** - "Figure out X" without defining what success looks like. Escape: specify the output format and acceptance criteria.
298
+ 2. **Midwit trap** - Overcomplicating the task structure when a simpler delegation would work. Escape: what would the simplest possible delegation look like?
299
+ 3. **Attachment trap** - Assuming the current approach is correct because it's familiar. Escape: what would I delegate if I started from zero knowledge?
300
+ 4. **Rumination trap** - Endlessly refining the prompt instead of dispatching it. Escape: dispatch at reasonable confidence, iterate from results.
301
+ 5. **Overwhelm trap** - Task too large to delegate as one piece. Escape: "What's level 1?" - delegate the smallest verifiable slice first.
302
+
303
+ The most common delegation failures come from these traps, not from the specialist's inability to execute.
304
+
305
+ ### Outcome Specs Over Activity Specs
306
+
307
+ When composing the Goal and Requirements, specify **what to achieve** rather than **how to achieve it**. The specialist knows their domain better than you do. Activity specs (step-by-step instructions) constrain the specialist's judgment and produce brittle results. Outcome specs (what to produce, with acceptance criteria) let the specialist apply their full capability.
308
+
309
+ Exception: if the task requires a specific methodology or tool for consistency with the existing system, make that a constraint in Requirements, not a procedure in Goal.
310
+
289
311
  ### Parallel Fan-Out
290
312
 
291
313
  If two tasks are independent, delegate in parallel by calling `task()` **multiple times in a single response**. Max 3-5 subtasks per turn.
@@ -297,6 +319,13 @@ Examples:
297
319
  - **Multi-lens review** - parallel review swarm for non-trivial changes: `task(reviewer, "Security review PR #42")` + `task(reviewer, "Performance review PR #42")` + `task(reviewer, "UX review PR #42")` + `task(reviewer, "General review PR #42")`
298
320
  - **Parallel branches** - If the work naturally splits into independent streams (e.g., backend + frontend + docs), ask the user if they want separate branches merged independently. If confirmed, delegate to @builder to create each branch (from main) and work through the full pipeline on each. Don't create multiple branches without confirmation.
299
321
 
322
+ - **Parallel speculation** - For genuinely uncertain questions (unknown dependency, ambiguous design choice, unclear root cause), dispatch the same question to multiple specialists with different lenses, then synthesize the results. The goal is not parallel implementations but multiple perspectives before committing to a direction:
323
+ ```
324
+ task(adventurer, "Map all entry points that touch the auth module")
325
+ task(architect, "Evaluate the current auth architecture for extensibility trade-offs")
326
+ task(diagnose, "Trace the login failure path for race conditions")
327
+ ```
328
+
300
329
  ## Work Results
301
330
 
302
331
  Mandatory after every builder task that lands a code change (see CRITICAL RULE #14). Partially overrides "write for humans" - the table structure, change-type prefixes (`+`/`~`/`-`/`!`/`(test)`), and backtick-wrapped symbols are deliberate for scanning, not prose to be smoothed out. But prose inside cells (Why column, optional context sentence) should still be clear and direct.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@maestria/opencode",
3
- "version": "0.6.4",
3
+ "version": "0.6.5",
4
4
  "description": "OpenCode plugin encoding AI engineering praxis: rules, agents, and workflow discipline.",
5
5
  "keywords": [
6
6
  "agents",
package/rules/AGENTS.md CHANGED
@@ -30,6 +30,8 @@
30
30
 
31
31
  - **Start from first principles** - before adopting an existing pattern or solution, verify it actually matches the fundamental problem. Prior art is a reference, not a constraint.
32
32
  - **Prefer existing solutions** - before building something yourself, verify no well-maintained open-source solution (package registries, GitHub, official libraries, plugins) already covers the need.
33
+ - **Surface incidental findings** - If during a task you discover something materially relevant to the project that falls outside the brief, flag it after completing the primary deliverable. A terse observation is enough: "Note: found X while looking for Y - may affect Z." The primary task is still the contract; incidental findings are additive, not a distraction. Exception: if the finding involves an active security, data, or production risk, flag it immediately.
34
+ - **Decompose to first principles when stuck** - If a problem resists your current approach, don't try harder - decompose it. Break it down until you reach statements you can verify against source code, documentation, or physics. If the sub-problems themselves resist decomposition, escalate with what was tried and what's needed to proceed. Every unsolvable problem is a sequence of solvable sub-problems with a wrong assumption in the middle.
33
35
 
34
36
  ## Delegation
35
37