@defend-tech/opencode-optima 0.1.55 → 0.1.56

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.
@@ -36,11 +36,11 @@ These agents can talk directly with the user and turn meaningful discussions int
36
36
 
37
37
  ## Repository Customization
38
38
 
39
- - `.optima/agents/<agent>.md`: full repository-local agent definition. Use this to override a bundled agent's base prompt or define a brand new custom repository agent.
40
- - `.optima/agent-additions/<agent>.md`: appends repository-specific instructions to a bundled or custom agent prompt.
39
+ - `.optima/agents/<agent>.md`: full repository-local agent definition. Use this to override a bundled agent's base prompt or define a brand new custom repository agent. This replaces the plugin-bundled prompt for that agent, so future npm/plugin updates to that bundled prompt will not apply until the local override is removed or manually merged.
40
+ - `.optima/agent-additions/<agent>.md`: appends repository-specific instructions to a bundled or custom agent prompt. This keeps receiving future plugin-bundled prompt updates.
41
41
  - `.optima/policies/*.md`: overrides shared repository policy files used by multiple agents.
42
42
 
43
- Use shared policies and additive agent files by default. Use full agent definitions in `.optima/agents/` when a repository needs a custom agent or needs to take over an agent's base prompt.
43
+ Use shared policies and additive agent files by default. Do not create or populate `.optima/agents/<agent>.md` unless the user explicitly requests a full local override or custom repository agent; otherwise use `.optima/agent-additions/<agent>.md` so bundled plugin updates keep applying.
44
44
 
45
45
  ## Typical usage by task complexity
46
46
 
@@ -32,7 +32,7 @@ Initializes Optima in the current repository.
32
32
  - Generated prompt dumps go to `.optima/.config/generated/agents/` when `features.debug_dumps` is enabled.
33
33
  - Generated reference policy files go to `.optima/.config/generated/policies/` when `policies.extract_defaults` is set to `all`.
34
34
  - The scaffolded README files in `.optima/agents/` and `.optima/agent-additions/` list common `plugin:` and `policy:` includes that custom agents can reuse.
35
- - After a successful init, Optima will request the OpenCode instance be disposed so the new config/agents can be reloaded.
35
+ - After a successful init, reload OpenCode manually if the newly scaffolded config or agents are not visible. Optima does not dispose the active instance automatically because that can abort the current session.
36
36
 
37
37
  ## `optima_validate`
38
38
 
@@ -46,6 +46,31 @@ It checks things like:
46
46
  - placeholder documentation problems
47
47
  - hidden/tool-owned trees such as `.github/workflows/` are ignored
48
48
 
49
+ ## `optima_repair`
50
+
51
+ Inspects and repairs common Optima operational metadata problems.
52
+
53
+ ### Arguments
54
+
55
+ - `apply`: optional boolean. Defaults to dry-run. Set `true` to write deterministic repairs.
56
+ - `mode`: optional string. Use `apply` or `dry-run`; dry-run is the default.
57
+ - `team_mode`: `mini` or `full` for a newly created config when `.optima/.config/optima.yaml` is missing.
58
+
59
+ ### What it checks
60
+
61
+ - missing `.optima/` operational scaffolding
62
+ - legacy/root artifacts that should be merged into `.optima/`
63
+ - missing registries, task templates, policy README, config, and root CodeMap
64
+ - Markdown references that still point at root `tasks/`, `evidences/`, `docs/scrs/`, `logs/`, or `screenshots/`
65
+ - missing Optima `.gitignore` local/private rules
66
+ - broken, over-deep, or incomplete CodeMap entries
67
+
68
+ ### Notes
69
+
70
+ - Dry-run never mutates the worktree.
71
+ - Apply mode runs `optima_validate` after repair and includes the validation result in the response.
72
+ - Ambiguous CodeMap boundaries are reported as unresolved instead of guessed.
73
+
49
74
  ## `optima_start_discussion`
50
75
 
51
76
  Starts or reopens an automatic discussion transcript for the current session.
@@ -115,3 +140,120 @@ Sends a follow-up prompt to an existing `workflow_runner` session.
115
140
 
116
141
  - Only available in `full` team mode.
117
142
  - Useful for bounce-backs, clarifications, and resumed runner work.
143
+
144
+ ## OpenCode Session Control Tools
145
+
146
+ These tools are intended for controlled automation paths such as ClickUp routing and diagnostics. They all resolve the requested directory through Optima's safe worktree rules.
147
+
148
+ ### `optima_session_create`
149
+
150
+ Creates an OpenCode session.
151
+
152
+ Arguments:
153
+
154
+ - `directory`: project directory for the session
155
+ - `title`: session title
156
+ - `agent`: optional agent id
157
+
158
+ ### `optima_session_prompt`
159
+
160
+ Sends a prompt to an existing OpenCode session.
161
+
162
+ Arguments:
163
+
164
+ - `session_id`: OpenCode session id
165
+ - `directory`: project directory for the session
166
+ - `text`: prompt text
167
+ - `agent`: optional agent id
168
+ - `omit_agent`: set to `true` to omit the agent field from the prompt body
169
+
170
+ ### `optima_session_messages`
171
+
172
+ Reads and summarizes messages from an OpenCode session.
173
+
174
+ Arguments:
175
+
176
+ - `session_id`: OpenCode session id
177
+ - `directory`: optional project directory for the session
178
+ - `limit`: optional message limit
179
+
180
+ ### `optima_session_probe`
181
+
182
+ Creates, prompts, and reads an OpenCode session without touching ClickUp state.
183
+
184
+ Arguments:
185
+
186
+ - `directory`: project directory for the session
187
+ - `agent`: optional agent id
188
+ - `omit_agent_on_prompt`: set to `true` to omit the agent field from the prompt body
189
+ - `text`: optional marker text to send
190
+
191
+ ## ClickUp Dry-Run Payload Tools
192
+
193
+ These tools generate or validate payloads for ClickUp-oriented workflows. Except for webhook runtime paths configured explicitly through OpenCode/plugin options, these helper tools are dry-run/no-op boundaries and do not directly mutate ClickUp.
194
+
195
+ ### `optima_clickup_sync_summary`
196
+
197
+ Builds a ClickUp summary/comment payload from `.optima/evidences/<task>/SUMMARY.md` and optional task markdown.
198
+
199
+ Arguments:
200
+
201
+ - `summary_path`: path to the evidence summary markdown
202
+ - `task_path`: optional path to `.optima/tasks/...` task markdown
203
+ - `branch`: optional branch override
204
+ - `worktree`: optional worktree display override
205
+ - `pr`: optional PR override
206
+
207
+ ### `optima_clickup_start_task`
208
+
209
+ Builds a start-task payload with branch, worktree, mirror paths, initial fields, and Definition content.
210
+
211
+ Arguments include:
212
+
213
+ - `task_id`
214
+ - `task_type`
215
+ - `parent_task_id`
216
+ - `subtask_id`
217
+ - `definition`
218
+ - `task_description`
219
+ - `complexity`
220
+ - `files_changed`
221
+ - `acceptance_criteria`
222
+ - `unknowns`
223
+
224
+ ### `optima_clickup_transition`
225
+
226
+ Builds a status transition payload and final-approval assignment plan.
227
+
228
+ Arguments include:
229
+
230
+ - `from_status`
231
+ - `to_status`
232
+ - `validation_passed`
233
+ - `validation_failed`
234
+ - `is_subtask`
235
+ - `reopen`
236
+ - `product_manager_assignee`
237
+ - `plan_description`
238
+ - `definition`
239
+
240
+ ### `optima_clickup_create_subtasks`
241
+
242
+ Builds dry-run ClickUp subtask creation payloads from a strict Markdown `## Subtasks` section.
243
+
244
+ Arguments:
245
+
246
+ - `parent_task_id`
247
+ - `markdown_path`
248
+ - `parent_branch`
249
+ - `parent_task_type`
250
+ - `apply`: records an apply request, but live apply remains no-op
251
+
252
+ ### `optima_clickup_apply_payload`
253
+
254
+ Validates a generated ClickUp payload at the dry-run/no-op apply boundary.
255
+
256
+ Arguments:
257
+
258
+ - `payload_json`
259
+ - `apply`: set to `true` to request live apply; currently returns not implemented/configured without calling ClickUp
@@ -96,6 +96,8 @@ This writes the bundled default policy files from package `assets/policies/` to
96
96
 
97
97
  Create `.optima/agent-additions/<agent>.md` to append repository-specific instructions to a bundled or custom agent prompt.
98
98
 
99
+ Use additions for normal repository-specific guidance. Because additions are appended after the bundled prompt, future plugin updates to the bundled agent still apply.
100
+
99
101
  ### Add repository-local agents or override a bundled base prompt
100
102
 
101
103
  Create `.optima/agents/<agent>.md` to:
@@ -103,6 +105,8 @@ Create `.optima/agents/<agent>.md` to:
103
105
  - replace the bundled base prompt for an existing agent, or
104
106
  - define a brand new custom repository agent
105
107
 
108
+ A file in `.optima/agents/<agent>.md` is a full local override. For that agent, Optima uses the repository-local definition instead of the plugin-bundled definition, so later npm/plugin updates to that bundled agent will not affect the overridden prompt until you remove or manually merge the local override. Do not create these files unless the user explicitly requests a full local override or custom repository agent; use `.optima/agent-additions/<agent>.md` for normal repo-specific guidance.
109
+
106
110
  ## Operational notes
107
111
 
108
112
  - The `product_manager` agent becomes the default primary agent when Optima is enabled.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@defend-tech/opencode-optima",
3
- "version": "0.1.55",
3
+ "version": "0.1.56",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+ssh://git@github.com/defend-tech/opencode-optima.git"
@@ -35,7 +35,7 @@
35
35
  "dependencies": {
36
36
  "@opencode-ai/plugin": "^1.2.6",
37
37
  "ignore": "^5.3.2",
38
- "yaml": "^2.3.0"
38
+ "yaml": "^2.9.0"
39
39
  },
40
40
  "devDependencies": {
41
41
  "esbuild": "^0.25.0",