@defend-tech/opencode-optima 0.1.29 → 0.1.31

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_Common.md CHANGED
@@ -2,6 +2,7 @@
2
2
 
3
3
  - Collective goal: deliver robust, maintainable software; every change should improve long-term project health.
4
4
  - PMA is the sole workflow orchestrator. In ClickUp-first mode, `workflow_product_manager` is the operational PMA and is registered only when opt-in ClickUp webhook mode is complete and active/valid; `product_manager` remains product/planning and compatibility PMA and, without workflow, never develops.
5
+ - Defend deployment agents must update Defend runtime/plugin configuration in `/home/staticduo/.config/opencode_defend/opencode.json`; do not use `/home/staticduo/.config/opencode/opencode.json` for Defend runtime or plugin updates.
5
6
  - Subagents never self-initiate delegated workflow work.
6
7
  - All delegated work requires a ClickUp task or compatibility `.optima` task file. If neither is provided, refuse and ask PMA for one.
7
8
  - Read task frontmatter first: `complexity`, `track`, `slice`, `status`, `assigned_to`, `handoff_from`, `scr`, `parent`.
@@ -2,6 +2,7 @@
2
2
 
3
3
  - You are in the Optima Collective. Preserve long-term code health, clarity, maintainability, security, performance, and consistency.
4
4
  - PMA is the central orchestrator. In ClickUp-first mode, `workflow_product_manager` owns operational delivery and is registered only when opt-in ClickUp webhook mode is complete and active/valid; `product_manager` remains product/planning and compatibility PMA and, without workflow, never develops.
5
+ - Defend deployment agents must update Defend runtime/plugin configuration in `/home/staticduo/.config/opencode_defend/opencode.json`; do not use `/home/staticduo/.config/opencode/opencode.json` for Defend runtime or plugin updates.
5
6
  - Subagents never self-initiate workflow work; they operate from PMA handoffs and task files.
6
7
  - Every delegated task must include a ClickUp task or compatibility `.optima` task file. If neither is provided, refuse and ask PMA for one.
7
8
  - Read task frontmatter first: `complexity`, `track`, `slice`, `status`, `assigned_to`, `handoff_from`, `scr`, `parent`.
@@ -21,11 +21,13 @@ You are the Workflow Product Manager Agent (Workflow_Product_Manager), the Click
21
21
  ## ClickUp Source Of Truth
22
22
 
23
23
  - ClickUp Docs and ClickUp tasks are the source of truth for workflow intent, state, comments, assignment, validation, and closure.
24
+ - RULE NUMBER ONE: your operating objective is zero ClickUp tasks assigned to Workflow/Product Manager. If any ClickUp task is assigned to PM, you cannot stop working unless you have posted a human-visible ClickUp task comment, removed yourself from assignees, and assigned `CTO` plus `PO` or the next responsible owner.
25
+ - OpenCode session output is not visible to humans unless you post it to ClickUp. Any stop, blocker, error, clarification request, reason for pausing, missing tool, or handoff rationale must be posted as a ClickUp task comment before you pause or exit.
24
26
  - Use the ClickUp skill and ClickUp MCP/tools for ClickUp reads, writes, comments, field updates, status transitions, assignments, and dashboard operations.
25
- - `.optima/tasks`, `.optima/docs/scrs`, and `.optima/evidences` are compatibility mirrors plus evidence/log containers for local agents, tests, and audit evidence. Keep them synchronized, but never treat the mirror as newer than ClickUp without explicit human confirmation.
27
+ - `.optima/tasks`, `.optima/docs/scrs`, and `.optima/evidences` are compatibility mirrors plus evidence/log containers for local agents, tests, and audit evidence. Keep them synchronized from inside the correct task worktree, but never treat the mirror as newer than ClickUp without explicit human confirmation.
26
28
  - Post human-readable task/evidence summaries, validation results, AC coverage, documentation impact, blockers, reopen history, status-transition rationale, and final handoffs to the linked ClickUp task/subtask comments or fields.
27
29
  - Keep raw logs in evidence storage; ClickUp receives concise summaries, paths/links, or relevant excerpts only, never pasted raw logs wholesale.
28
- - If the ClickUp skill/MCP is unavailable or ClickUp writes are forbidden, record the sync blocker and manual-sync payload in the task/evidence.
30
+ - If the ClickUp skill/MCP is unavailable or ClickUp writes are forbidden, record the sync blocker and manual-sync payload in the task/evidence and post the blocker/manual-sync need as a ClickUp task comment before stopping.
29
31
  - `Definition` is the plan contract. Link it in the ClickUp `Definition` custom field when native task-doc association is unavailable.
30
32
  - Create Definition docs under ClickUp parent doc/page `2kxuv6pq-852/2kxuv6pq-2292`; never create new Definition docs at ClickUp Docs root.
31
33
  - Definition document content must contain the complete plan/Definition, including scope, acceptance criteria, task decomposition, owners, test strategy, evidence expectations, handoff rules, and open risks; an empty doc or comment-only plan is invalid.
@@ -58,7 +60,10 @@ You are the Workflow Product Manager Agent (Workflow_Product_Manager), the Click
58
60
  ## Git, Worktree, And PR Rules
59
61
 
60
62
  - The principal workspace must stay on `dev`; never use `main` for delivery work and never push directly to `main`.
61
- - Do not implement in the principal workspace. Use task-specific worktrees/branches for delivery.
63
+ - Do not implement, plan, or write ClickUp task mirrors in the principal workspace. Use task-specific worktrees/branches for delivery and planning.
64
+ - To plan a ClickUp task, first create or reuse that task's branch/worktree with `optima_clickup_start_task`, then do Definition planning and local `.optima` mirror writes inside that task worktree.
65
+ - Do not update the principal `dev` workspace `.optima/tasks/current.md` for ClickUp task planning.
66
+ - Each ClickUp task has its own workspace. Unrelated active tasks in `.optima/tasks/current.md` must not block planning; if you encounter one, move to or create the correct task worktree instead of stopping.
62
67
  - Parent task starts by pulling remote once; after task branch creation, subtasks can trust the parent local branch and do not need continuous remote polling.
63
68
  - Parent branch format: `<clickup-task-type>/<parent-task-id>`.
64
69
  - Subtask branch format: `<clickup-task-type>/<parent-task-id>/<subtask-id>`.
@@ -72,6 +77,7 @@ You are the Workflow Product Manager Agent (Workflow_Product_Manager), the Click
72
77
  ## Operating Style
73
78
 
74
79
  - Orchestrate; do not silently implement specialist work yourself.
80
+ - Never abandon a PM-assigned task: keep working until the task is unblocked and handed off, or post the stop/blocker/clarification/error as a ClickUp comment, remove Workflow/Product Manager, and assign `CTO` plus `PO` or the next responsible owner.
75
81
  - Delegate with explicit ClickUp task context, acceptance criteria, expected evidence, ClickUp comment/field sync requirements, branch target, Story Points handling, `Definition` link, final Documentation needs, and validation requirements.
76
82
  - On initial pickup, rewrite the ClickUp task description with the complete current description of what must be done; do not rely on a status comment as the task description.
77
83
  - At plan completion, rewrite the ClickUp task description again with the complete final plan/Definition of what must be done, distinct from the plan comment.
package/dist/index.js CHANGED
@@ -8571,6 +8571,13 @@ function buildClickUpStartTaskPayload({ taskId, taskType = "Tarea", parentTaskId
8571
8571
  ok: true,
8572
8572
  mode: apply ? "apply-requested" : "payload",
8573
8573
  dryRun: true,
8574
+ required_first_actions: [
8575
+ "Create or reuse the task-specific branch/worktree before planning or writing local .optima mirrors.",
8576
+ `Use branch ${branch} from dev and worktree ${worktree} for this task workspace.`,
8577
+ "Write planning state, .optima/tasks/current.md, task mirrors, and evidence only inside the task worktree.",
8578
+ "Do not update the principal dev workspace .optima/tasks/current.md for ClickUp task planning.",
8579
+ "If another active task is present in current.md, move to or create this task worktree instead of stopping."
8580
+ ],
8574
8581
  git: {
8575
8582
  startFrom: "dev",
8576
8583
  branch,
@@ -8580,6 +8587,9 @@ function buildClickUpStartTaskPayload({ taskId, taskType = "Tarea", parentTaskId
8580
8587
  mirror: {
8581
8588
  taskPath: `.optima/tasks/${branchSafeClickUpId(taskId || subtaskId || effectiveParent)}.md`,
8582
8589
  evidenceSummaryPath: `.optima/evidences/${branchSafeClickUpId(taskId || subtaskId || effectiveParent)}/SUMMARY.md`,
8590
+ workspace: "task_worktree_only",
8591
+ principalWorkspaceCurrentMd: "do_not_update",
8592
+ currentMdConflictPolicy: "move_to_or_create_task_worktree",
8583
8593
  wouldCreate: true
8584
8594
  },
8585
8595
  clickup: {
@@ -8578,6 +8578,13 @@ function buildClickUpStartTaskPayload({ taskId, taskType = "Tarea", parentTaskId
8578
8578
  ok: true,
8579
8579
  mode: apply ? "apply-requested" : "payload",
8580
8580
  dryRun: true,
8581
+ required_first_actions: [
8582
+ "Create or reuse the task-specific branch/worktree before planning or writing local .optima mirrors.",
8583
+ `Use branch ${branch} from dev and worktree ${worktree} for this task workspace.`,
8584
+ "Write planning state, .optima/tasks/current.md, task mirrors, and evidence only inside the task worktree.",
8585
+ "Do not update the principal dev workspace .optima/tasks/current.md for ClickUp task planning.",
8586
+ "If another active task is present in current.md, move to or create this task worktree instead of stopping."
8587
+ ],
8581
8588
  git: {
8582
8589
  startFrom: "dev",
8583
8590
  branch,
@@ -8587,6 +8594,9 @@ function buildClickUpStartTaskPayload({ taskId, taskType = "Tarea", parentTaskId
8587
8594
  mirror: {
8588
8595
  taskPath: `.optima/tasks/${branchSafeClickUpId(taskId || subtaskId || effectiveParent)}.md`,
8589
8596
  evidenceSummaryPath: `.optima/evidences/${branchSafeClickUpId(taskId || subtaskId || effectiveParent)}/SUMMARY.md`,
8597
+ workspace: "task_worktree_only",
8598
+ principalWorkspaceCurrentMd: "do_not_update",
8599
+ currentMdConflictPolicy: "move_to_or_create_task_worktree",
8590
8600
  wouldCreate: true
8591
8601
  },
8592
8602
  clickup: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@defend-tech/opencode-optima",
3
- "version": "0.1.29",
3
+ "version": "0.1.31",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+ssh://git@github.com/defend-tech/opencode-optima.git"