opencode-discipline 0.1.3 → 0.1.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.
package/agents/README.md CHANGED
@@ -1,34 +1,43 @@
1
1
  # opencode-discipline Agent Suite
2
2
 
3
- This package ships seven agent definitions for disciplined plan-first execution.
3
+ This package ships eight agent definitions for disciplined plan-first execution.
4
4
 
5
5
  | Agent | Model | Mode | Purpose |
6
6
  | --- | --- | --- | --- |
7
7
  | `plan` | `anthropic/claude-opus-4-6` | primary | Runs the 4-wave planning workflow and coordinates accept/revise handoff |
8
8
  | `build` | `anthropic/claude-opus-4-6` | primary | Executes approved plans phase-by-phase with verification gates |
9
9
  | `oracle` | `openai/gpt-5.4` | subagent | Read-only architecture and tradeoff advisor |
10
- | `librarian` | `openai/gpt-4.1-mini` | subagent | Read-only research and documentation specialist |
10
+ | `librarian` | `openai/gpt-5.4-mini` | subagent | Read-only research and documentation specialist |
11
11
  | `reviewer` | `openai/gpt-5.4` | subagent | Read-only quality critic for plans and code |
12
12
  | `designer` | `anthropic/claude-sonnet-4-6` | subagent | Read-only UI/UX and accessibility advisor |
13
13
  | `deep` | `openai/gpt-5.3-codex` | subagent | Advanced implementation subagent for complex coding work |
14
+ | `explore` | `openai/gpt-5.4-mini` | subagent | Fast codebase search and file discovery |
14
15
 
15
16
  ## Installation
16
17
 
17
- Manual install:
18
+ Enable the plugin in `opencode.json`:
18
19
 
19
- ```bash
20
- mkdir -p ~/.config/opencode/agents
21
- cp agents/*.md ~/.config/opencode/agents/
20
+ ```json
21
+ {
22
+ "plugin": ["opencode-discipline"]
23
+ }
22
24
  ```
23
25
 
24
- Then enable the plugin in `opencode.json`:
26
+ The plugin automatically injects all agent configurations via the `config` hook — no manual file copying required.
27
+
28
+ To override a specific field for any agent, add it to `opencode.json`:
25
29
 
26
30
  ```json
27
31
  {
28
- "plugin": ["opencode-discipline"]
32
+ "plugin": ["opencode-discipline"],
33
+ "agent": {
34
+ "plan": { "model": "anthropic/claude-sonnet-4-6" }
35
+ }
29
36
  }
30
37
  ```
31
38
 
39
+ User overrides take precedence per field; non-overridden fields use the plugin defaults.
40
+
32
41
  ## Delegation flow
33
42
 
34
43
  ```text
package/agents/deep.md CHANGED
@@ -16,6 +16,7 @@ permission:
16
16
  bash:
17
17
  "*": ask
18
18
  "rtk *": allow
19
+ "echo *": allow
19
20
  "git log *": allow
20
21
  "git diff *": allow
21
22
  "git status": allow
@@ -17,6 +17,7 @@ permission:
17
17
  bash:
18
18
  "*": ask
19
19
  "rtk *": allow
20
+ "echo *": allow
20
21
  edit: deny
21
22
  write: deny
22
23
  ---
package/agents/explore.md CHANGED
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  description: Fast codebase search. Finds files, patterns, and structure quickly. Cheap and parallel-friendly.
3
- model: openai/gpt-4.1-mini
3
+ model: openai/gpt-5.4-mini
4
4
  temperature: 0
5
5
  mode: subagent
6
6
  color: "#78909C"
@@ -24,6 +24,7 @@ permission:
24
24
  "wc *": allow
25
25
  "git log *": allow
26
26
  "git show *": allow
27
+ "echo *": allow
27
28
  ---
28
29
 
29
30
  You are a fast codebase explorer. Your job is to find files, patterns, and structure as quickly as possible. You never implement or modify anything.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  description: Research specialist. Gathers context from codebase, external docs, and reference implementations before work begins. Returns structured findings.
3
- model: openai/gpt-4.1-mini
3
+ model: openai/gpt-5.4-mini
4
4
  temperature: 0
5
5
  mode: subagent
6
6
  color: "#1D9E75"
@@ -17,6 +17,7 @@ permission:
17
17
  bash:
18
18
  "*": ask
19
19
  "rtk *": allow
20
+ "echo *": allow
20
21
  ---
21
22
 
22
23
  You are a research specialist. Your job is to gather, organize, and present information. You never implement.
package/agents/oracle.md CHANGED
@@ -23,6 +23,7 @@ permission:
23
23
  "cargo clippy *": allow
24
24
  "npm run type-check *": allow
25
25
  "tsc --noEmit *": allow
26
+ "echo *": allow
26
27
  ---
27
28
 
28
29
  You are a senior staff engineer acting as an architecture consultant. You are the "last resort" advisor — consulted when facing unfamiliar patterns, tricky tradeoffs, or repeated failures.
package/agents/plan.md CHANGED
@@ -37,6 +37,7 @@ permission:
37
37
  "wc *": allow
38
38
  "mkdir *": allow
39
39
  "ls *": allow
40
+ "echo *": allow
40
41
  task:
41
42
  "*": deny
42
43
  "explore": allow
@@ -73,10 +74,10 @@ Before generating the plan, perform a Metis-style gap check. Ask yourself:
73
74
  4. **Ambiguity** — Are there terms or requirements that could be interpreted two ways?
74
75
  5. **Breaking changes** — Will this plan touch shared interfaces, public APIs, or migration paths?
75
76
 
76
- If any gaps are found:
77
- - Ask the user to clarify (1-2 questions max)
78
- - Delegate to @oracle if the gap involves an architectural tradeoff
79
- - Document the gap and resolution in the plan under "## Decisions"
77
+ Wave 2 policy (always required):
78
+ - Ask the user to clarify gaps when needed (1-2 questions max)
79
+ - Delegate to @oracle once in every Wave 2 pass, even for simple tasks
80
+ - Summarize oracle feedback and document the resolution in the plan under "## Decisions"
80
81
 
81
82
  ### Wave 3: Plan generation
82
83
 
@@ -157,14 +158,15 @@ For high-stakes plans (production changes, data migrations, auth refactors):
157
158
  After writing and completing Wave 4 review:
158
159
  1. Tell the user: "Plan written to `tasks/plans/{filename}.md`"
159
160
  2. Summarize in 3-5 sentences
160
- 3. Present exactly three choices and ask the user to pick one:
161
- - **Accept plan & start work** — Call `accept_plan(action="accept")` to create a new Build session with the plan registered. The Build agent will start implementing immediately.
162
- - **Start work later** — Do nothing. The plan is saved and the user can start a Build session manually whenever they're ready.
163
- - **I have modifications to make** — Call `accept_plan(action="revise")` and stay in Wave 4 to incorporate the user's feedback. After revisions, present these three choices again.
161
+ 3. The plugin will inject a handoff prompt into your system context with three choices. Follow those instructions exactly — present the choices and wait for the user's response before acting.
162
+ - Choice 1 label must be: **Accept plan, clear context and build.**
163
+ - Choice 2 label: **Start work later**
164
+ - Choice 3 label: **I have modifications to make**
164
165
 
165
166
  ## Rules
166
167
 
167
168
  - NEVER write implementation code. Only markdown files in `tasks/`.
169
+ - Immediately after Wave 1 starts, call `todowrite` to create the 5-item planning checklist (Wave 1-4 plus Step 5 handoff) and keep it updated.
168
170
  - Every phase MUST have a verify step that is a runnable command.
169
171
  - Every phase with destructive changes MUST have a rollback step.
170
172
  - Reference specific file paths, function names, and line numbers — never "the auth module."
@@ -23,6 +23,7 @@ permission:
23
23
  "cargo clippy *": allow
24
24
  "npm test *": allow
25
25
  "npm run type-check *": allow
26
+ "echo *": allow
26
27
  ---
27
28
 
28
29
  You are a ruthless reviewer. You review plans and code changes with zero tolerance for vagueness, missing tests, or scope creep. Your job is to catch what others miss.
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Reads all agent `.md` files from the given directory, parses their YAML
3
+ * frontmatter and markdown body, and returns a map of agent name to config.
4
+ *
5
+ * The returned config objects have the same shape as `AgentConfig` in the
6
+ * OpenCode SDK — frontmatter keys map directly to config fields, and the
7
+ * markdown body becomes the `prompt` field.
8
+ */
9
+ export declare function loadAgentConfigs(agentsDir: string): Record<string, Record<string, unknown>>;