@defend-tech/opencode-optima 0.1.10

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.
Files changed (72) hide show
  1. package/Agents_Common.md +50 -0
  2. package/Agents_Common.prompt.md +40 -0
  3. package/README.md +168 -0
  4. package/agents/business_analyst.md +22 -0
  5. package/agents/codemap.yml +11 -0
  6. package/agents/developer.md +23 -0
  7. package/agents/ops_product_manager.md +68 -0
  8. package/agents/product_manager.md +36 -0
  9. package/agents/qa_engineer.md +21 -0
  10. package/agents/tech_lead.md +28 -0
  11. package/agents/technical_architect.md +23 -0
  12. package/agents/ui_ux_designer.md +17 -0
  13. package/agents/workflow_product_manager.md +81 -0
  14. package/agents/workflow_runner.md +23 -0
  15. package/dist/index.js +11018 -0
  16. package/dist/sanitize_cli.js +11487 -0
  17. package/docs/architecture/TECHNICAL_ARCHITECTURE.md +21 -0
  18. package/docs/architecture/codemap.yml +4 -0
  19. package/docs/codemap.yml +12 -0
  20. package/docs/core/agent_orchestration.md +62 -0
  21. package/docs/core/agent_orchestration.prompt.md +27 -0
  22. package/docs/core/business_analyst_guidelines.md +21 -0
  23. package/docs/core/codemap.yml +27 -0
  24. package/docs/core/codemap_conventions.md +13 -0
  25. package/docs/core/communication_guidelines.md +10 -0
  26. package/docs/core/communication_guidelines.prompt.md +9 -0
  27. package/docs/core/discussion_agent_guidelines.md +11 -0
  28. package/docs/core/discussion_agent_guidelines.prompt.md +10 -0
  29. package/docs/core/documentation_structure.md +27 -0
  30. package/docs/core/documentation_structure.prompt.md +12 -0
  31. package/docs/core/humans.md +6 -0
  32. package/docs/core/pma_mode_full.md +25 -0
  33. package/docs/core/pma_mode_mini.md +33 -0
  34. package/docs/core/qa_guidelines.md +15 -0
  35. package/docs/core/role_contracts.md +44 -0
  36. package/docs/core/role_contracts.prompt.md +26 -0
  37. package/docs/core/task_model.md +36 -0
  38. package/docs/core/task_model.prompt.md +16 -0
  39. package/docs/core/tech_lead_guidelines.md +17 -0
  40. package/docs/core/tech_lead_mode_full.md +8 -0
  41. package/docs/core/tech_lead_mode_mini.md +11 -0
  42. package/docs/core/technical_guidelines.md +18 -0
  43. package/docs/core/testing_strategy.md +26 -0
  44. package/docs/core/ui_ux_guidelines.md +24 -0
  45. package/docs/domains/README.md +15 -0
  46. package/docs/domains/codemap.yml +7 -0
  47. package/docs/domains/domain-template/OVERVIEW.md +37 -0
  48. package/docs/domains/domain-template/codemap.yml +4 -0
  49. package/docs/domains/task-lifecycle/OVERVIEW.md +69 -0
  50. package/docs/domains/task-lifecycle/codemap.yml +4 -0
  51. package/docs/features/README.md +11 -0
  52. package/docs/features/codemap.yml +6 -0
  53. package/docs/features/feature-template/SPECIFICATION.md +36 -0
  54. package/docs/features/feature-template/codemap.yml +4 -0
  55. package/docs/guides/AGENTS.md +63 -0
  56. package/docs/guides/TEAM_MODE_FULL.md +44 -0
  57. package/docs/guides/TEAM_MODE_MINI.md +41 -0
  58. package/docs/guides/TOOLS.md +117 -0
  59. package/docs/guides/WORKFLOW.md +116 -0
  60. package/docs/guides/codemap.yml +8 -0
  61. package/docs/product/DOMAIN_MAP.md +41 -0
  62. package/docs/product/FEATURES_LIST.md +17 -0
  63. package/docs/product/PRODUCT_OVERVIEW.md +12 -0
  64. package/docs/product/codemap.yml +6 -0
  65. package/docs/setup/CONFIGURATION.md +117 -0
  66. package/docs/setup/INSTALLATION.md +66 -0
  67. package/docs/setup/RELEASING.md +101 -0
  68. package/docs/setup/codemap.yml +6 -0
  69. package/package.json +47 -0
  70. package/scripts/optima-sanitize-host.js +12 -0
  71. package/templates/codemap.yml.template +30 -0
  72. package/templates/optima.yaml.template +68 -0
@@ -0,0 +1,21 @@
1
+ # Technical Architecture
2
+
3
+ This document defines the global patterns and technical strategy for this project.
4
+
5
+ ## Global Patterns
6
+ - **Orchestrated Subagent Workflow:** Using Product Manager as central coordinator.
7
+ - **File-Based Task Management:** All work is tracked in the `tasks/` directory.
8
+ - **Complexity-Based Routing:** The workflow weight is determined by task complexity: `tiny`, `standard`, or `complex`.
9
+ - **Slice-Based Decomposition:** Complex work is decomposed into `foundation`, `core`, `logic`, `ui`, `polish`, `qa`, and `docs` slices.
10
+ - **Shared-Worktree Concurrency Guard:** Only one implementation workflow may own the shared worktree at a time.
11
+
12
+ ## Tech Stack
13
+ - **Runtime:** Node.js with ECMAScript modules
14
+ - **Plugin SDK:** `@opencode-ai/plugin`
15
+ - **Configuration Format:** YAML for Optima config and CodeMaps
16
+ - **Tests:** Jest
17
+
18
+ ## Architectural Patterns
19
+ - **Feature-First Organization:** Code and documentation are grouped by feature.
20
+ - **Prompt-Driven Agent Composition:** Agents are defined as markdown prompts with frontmatter and reusable includes.
21
+ - **Tool-Supervised Orchestration:** The plugin supervises session creation, agent registration, and workflow handoff tools.
@@ -0,0 +1,4 @@
1
+ scope: module
2
+ parent: ../codemap.yml
3
+ sources_of_truth:
4
+ - path: TECHNICAL_ARCHITECTURE.md
@@ -0,0 +1,12 @@
1
+ scope: module
2
+ parent: ../.optima/codemap.yml
3
+ modules:
4
+ - path: architecture
5
+ - path: core
6
+ - path: domains
7
+ - path: features
8
+ - path: guides
9
+ - path: product
10
+ - path: setup
11
+ sources_of_truth: []
12
+ internals: []
@@ -0,0 +1,62 @@
1
+ # Agent Orchestration
2
+
3
+ - PMA is sole orchestrator; subagents execute PMA-delegated task files and do not self-initiate workflow work.
4
+ - Dual PM model: `workflow_product_manager` owns ClickUp-first operational delivery, while `product_manager` remains product/planning support and compatibility/default PMA; without workflow, `product_manager` never develops and converts development asks into ClickUp tasks.
5
+ - ClickUp Docs and tasks are the source of truth in ClickUp-first mode; `.optima` task/SCR/evidence files are local compatibility mirrors plus evidence/log containers until a future SCR changes that.
6
+ - Agents must use the ClickUp skill and ClickUp MCP/tools for ClickUp reads, writes, comments, field updates, status transitions, assignments, and dashboards.
7
+ - Human-readable task/evidence summaries, validation results, AC coverage, documentation impact, blockers, reopen history, status-transition rationale, and final handoffs must be synced to linked ClickUp task/subtask comments or fields.
8
+ - Raw logs stay in evidence storage; ClickUp receives concise summaries, paths/links, or relevant excerpts only, never wholesale raw logs.
9
+ - Registries: `.optima/tasks/current.md` tracks Active Discussions, Active, Todo, Blocked; `.optima/tasks/done.md` records completed tasks, SCRs, commits, and summaries.
10
+ - Task files follow `.optima/tasks/task-template.md` and normally stay under `.optima/tasks/todo/` while active through registry status.
11
+ - Routing is defined in `docs/core/task_model.md`: `tiny` stays lightweight, `standard` bounded, `complex` decomposed; complex implementation generally uses `workflow_runner`.
12
+
13
+ ## Two-Phase Flow
14
+
15
+ - Negotiation: requirement discovery -> PMA/BA/Tech Lead sync -> SCR in `.optima/docs/scrs/` when behavior/spec changes -> PO iteration/approval -> SCR becomes truth anchor.
16
+ - Delegated implementation: PMA activates one task, runs pre-task sync, delegates execution, verifies evidence in post-task sync, finalizes docs/registries, authorizes commit/archive, then starts the next task.
17
+ - PMA and Technical Architect map impact surface and slice complex work into micro-tasks.
18
+ - A task is complete only after implementation, verification, documentation closure, registry updates, and authorized finalization are done.
19
+
20
+ ## ClickUp-First Flow
21
+
22
+ - `product_manager` may answer, investigate, operate dashboards, and pre-estimate "a qué huele" small/medium/large plus rough story points; WPM owns delivery routing.
23
+ - Supported delivery task types are `Tarea`, `Bug`, `Doc`, and `PoC`; ignore `Idea`, legacy `Backlog` alias, `Hito`, `Nota de reunión`, and `Respuesta del formulario` unless converted or linked to delivery work.
24
+ - Human role registry: resolve `CTO` and `PO` from `docs/core/humans.md`; use role identifiers in workflow text and automation config.
25
+ - Status actions are deterministic: `backlog` ignore, `plan` plan plus `Story Points`, test strategy, `Definition`, and `CTO`/`PO` assignment, `in progress` execute, `validation` split Tech Lead and Validator/QA gates, `merge` parent approval state after `CTO`/`PO` move a validated parent task there, and `completed`/`Closed` ignore unless reopened.
26
+ - Store ClickUp `agent_metadata` JSON with session IDs per agent/type/task/subtask; keep `Definition` as the plan contract and final Documentation as delivered behavior docs.
27
+ - `workflow_product_manager` is registered only when explicit ClickUp webhook mode is configured and the local webhook subscription state is active/valid.
28
+ - Webhook mode is opt-in: Optima validates signed `X-Signature` HMAC SHA-256 requests, routes status/assignee events only for Product Manager-assigned non-terminal tasks, routes comments only when they mention `@Defend Tech Product Manager`, stores new `ses_...` ids in ClickUp `agent_metadata`, and reports stale/missing sessions to ClickUp without creating replacements.
29
+ - The listener is a gated in-process HTTP listener for local runtime use; deployments still need a stable public URL/tunnel and local `.optima/.config/runtime/` state containing the ClickUp webhook id/secret. When a ClickUp client exposes webhook validation, Optima validates remote state; otherwise local-only validation is limited to ignored runtime state with matching URL/events and present id/secret.
30
+
31
+ ## Shared Worktree And Git
32
+
33
+ - Only one shared-worktree `implementation` task may be active.
34
+ - ClickUp-first delivery should use task-specific worktrees/branches; the principal workspace must remain on `dev` and never on `main`.
35
+ - Parent task start pulls remote once; after branch creation, subtasks trust the parent local branch instead of continuous remote polling.
36
+ - Parent branch format is `<clickup-task-type>/<parent-task-id>`; subtask branch format is `<clickup-task-type>/<parent-task-id>/<subtask-id>`; PoC branch format is always `poc/<clickup-task-id>` and stays there until a later productization task.
37
+ - Subtask PRs target the parent branch, parent task PRs target `dev`, and release PRs target `main` from `dev` only after explicit approval.
38
+ - After successful subtask validation, Validator/QA merges the subtask PR into the parent branch/workspace without `CTO`/`PO` approval.
39
+ - After parent Tech Lead and Validator/QA validation passes, the parent task stays in `validation`, `CTO`/`PO` are assigned and marked as approval owners, and they approve by moving it to `merge`; only then does Validator/QA attempt the parent PR merge into `dev`.
40
+ - If any subtask or parent merge conflicts or fails, Validator/QA returns the affected ClickUp item to `in progress` and routes it to the coding owner.
41
+ - Never push directly to `main`.
42
+ - `investigation` and `spec` tasks may run in parallel only when they avoid conflicting delivery artifacts.
43
+
44
+ ## Reopen And Resume
45
+
46
+ - Reopen same-scope discrepancies by moving the same task back to Active, preserving the task ID, and recording `Reopen History`.
47
+ - Reuse the same Task tool `task_id` when possible; for prior Workflow Runner work, reuse both Task tool `task_id` and Workflow Runner `session_id` when possible.
48
+ - Create a new task only for true follow-up scope.
49
+
50
+ ## Communication And Authority
51
+
52
+ - Questions, blockers, dependencies, reviews, and escalation go through PMA.
53
+ - Tech Lead reviews architecture, code, PR readiness, standards, and repo-skill usage.
54
+ - Validator/QA participates in planning for test strategy and validates automated tests, Playwright flows, regression, required new coverage, evidence, and final documentation freshness.
55
+ - Workflow Runner commits only for PMA-delegated full-team complex workflows.
56
+ - PMA remains final closure authority and documentation-closure verifier.
57
+
58
+ ## Blockers And Verification
59
+
60
+ - Blocked work moves to `.optima/tasks/blocked/` with a clear report of what is missing and what the PO must resolve.
61
+ - No task closes with failing/skipped automated tests, failed builds, missing evidence, or unresolved documentation impact.
62
+ - Evidence must include logs and screenshots where applicable and map back to acceptance criteria.
@@ -0,0 +1,27 @@
1
+ # Agent Orchestration Compact
2
+
3
+ - PMA is sole workflow orchestrator; subagents execute PMA-delegated task files and do not self-initiate.
4
+ - Dual PM model: `workflow_product_manager` owns ClickUp-first operational delivery; `product_manager` remains product/planning support and compatibility/default PMA and never develops without workflow.
5
+ - ClickUp Docs/tasks are source of truth in ClickUp-first mode; `.optima` tasks/SCRs/evidence are compatibility mirrors plus evidence/log containers.
6
+ - Use the ClickUp skill and ClickUp MCP/tools for ClickUp reads/writes, comments, fields, statuses, assignments, and dashboards; if unavailable or forbidden, record the sync blocker and manual-sync payload.
7
+ - Sync human-readable task/evidence summaries, validation results, AC coverage, documentation impact, blockers, reopen history, status-transition rationale, and final handoffs to ClickUp comments/fields.
8
+ - Keep raw logs in evidence storage; ClickUp receives concise summaries, paths/links, or relevant excerpts only, never wholesale raw logs.
9
+ - Registries: `.optima/tasks/current.md` tracks Active Discussions, Active, Todo, Blocked; `.optima/tasks/done.md` records completed work; task files live under `.optima/tasks/todo/`, `.optima/tasks/blocked/`, or `.optima/tasks/done/`.
10
+ - Negotiation phase: requirements -> PMA/BA/Tech Lead sync -> SCR in `.optima/docs/scrs/` when behavior/spec changes -> PO approval -> truth anchor.
11
+ - Delegated implementation phase: PMA processes approved work one task at a time; complex implementation uses slice decomposition and usually `workflow_runner`.
12
+ - Standard cycle: task initiation -> pre-task sync -> implementation -> post-task sync -> evidence/docs/registry finalization -> authorized commit/archive.
13
+ - Routing comes from `docs/core/task_model.md`: `tiny` lightweight, `standard` bounded, `complex` decomposed; full mode supports all, mini mode refuses complex.
14
+ - `product_manager` may answer/investigate/dashboard/pre-estimate "a qué huele" plus rough story points; development asks become routed ClickUp tasks.
15
+ - ClickUp-first types: execute `Tarea`, `Bug`, `Doc`, `PoC`; ignore `Idea`, legacy `Backlog` alias, `Hito`, `Nota de reunión`, `Respuesta del formulario` unless converted/linked.
16
+ - Human role registry: resolve `CTO` and `PO` from `docs/core/humans.md`; use role identifiers in workflow text and automation config.
17
+ - ClickUp-first statuses: `backlog` ignore, `plan` plan with `Story Points`, `Definition`, test strategy, and `CTO`/`PO` assignment, `in progress` execute, `validation` split Tech Lead + Validator/QA gates; Validator/QA may merge validated subtasks directly into the parent branch; validated parents stay in `validation` for `CTO`/`PO` approval; `merge` means `CTO`/`PO` approved the parent and Validator/QA may attempt parent merge into `dev`; `completed`/`Closed` ignore unless reopened.
18
+ - Shared-worktree rule: one active `implementation` task at a time; isolated `investigation`/`spec` may run in parallel if non-conflicting.
19
+ - Git rules: principal workspace stays on `dev`, never `main`; parent task pulls remote once at start; subtasks trust parent local branch; PoC branches stay `poc/<clickup-task-id>`; subtasks PR to parent branch, parents PR to `dev`, releases PR `dev` -> `main`; failed/conflicted subtask or parent merges return the affected item to `in progress` for the coding owner; no direct `main` pushes.
20
+ - Store `agent_metadata` session JSON; `Definition` is the plan contract, final Documentation is delivered behavior docs.
21
+ - `workflow_product_manager` is registered only when opt-in ClickUp webhook mode is complete and active/valid.
22
+ - Webhook mode validates `X-Signature` HMAC SHA-256, routes only PM-assigned non-terminal status/assignee events, routes comments only on `@Defend Tech Product Manager`, writes new `ses_...` ids to `agent_metadata`, and reports stale/missing sessions to ClickUp without replacement.
23
+ - The listener is gated in-process local runtime; production needs a stable public URL/tunnel and ignored `.optima/.config/runtime/` webhook state. Remote webhook validation is used when the injected ClickUp client supports it; otherwise local-only validation is limited to matching id/secret/URL/events state.
24
+ - Communication: questions, blockers, reviews, dependencies, and escalation go through PMA. Tech Lead reviews architecture/code/PR/standards/repo skills; Validator/QA verifies tests/regression/coverage/evidence/docs.
25
+ - Reopen same-scope discrepancies by reactivating the same task file, adding `Reopen History`, and reusing existing Task/Workflow Runner session IDs when possible.
26
+ - Blockers move to `.optima/tasks/blocked/` with a clear blocker report and PO-facing resolution need.
27
+ - Verification: 100% pass rate, evidence-first proof, docs updated before closure, no failed/skipped automated tests.
@@ -0,0 +1,21 @@
1
+ # Business Analyst & Document Steward Guidelines
2
+
3
+ This document defines the responsibilities and workflow for the Business Analyst (BA) agent, who also serves as the project's **Document Steward**.
4
+
5
+ ## Core Responsibilities
6
+ 1. **Requirements Elicitation:** Translate high-level product goals into detailed functional and non-functional specifications.
7
+ 2. **User Stories:** Write clear, concise user stories that follow the "As a [user], I want [action], so that [benefit]" format.
8
+ 3. **Acceptance Criteria (AC):** Define measurable and testable AC for every task.
9
+ 4. **Task Definition Approval:** Review all new task definitions for clarity, completeness, and alignment with the product vision.
10
+
11
+ ## Document Stewardship (Mandatory)
12
+ As the Document Steward, you are responsible for the integrity of the project's documentation:
13
+ 1. **Consistency:** Ensure all agents follow established formatting, naming conventions, and architectural terminology.
14
+ 2. **Cross-Linking:** When a feature or architectural decision changes, ensure all related documents (Specs, Features List, Architecture) are updated.
15
+ 3. **Audit & Pruning:** Regularly audit the `docs/` and `tasks/` directories to remove contradictions and ensure "Single Source of Truth" integrity.
16
+ 4. **Archive Integrity:** Before a task is moved to `done/`, ensure the task file contains a clear summary of the outcome and links to relevant documentation.
17
+
18
+ ## Workflow
19
+ - **Pre-Sync:** The BA is the first to review a task definition. They must ensure there are no ambiguities before the Architect or Developer starts work.
20
+ - **Documentation:** Maintain the `docs/product/` directory, including `PRODUCT_OVERVIEW.md` and `FEATURES_LIST.md`. You are also responsible for the **SCR Registries (`.optima/docs/scrs/current.md` and `.optima/docs/scrs/done.md`)**, ensuring every proposal is logged and tracked.
21
+ - **Validation:** Confirm that the final implementation satisfies all acceptance criteria defined at the start.
@@ -0,0 +1,27 @@
1
+ scope: module
2
+ parent: ../codemap.yml
3
+ sources_of_truth:
4
+ - path: agent_orchestration.md
5
+ - path: business_analyst_guidelines.md
6
+ - path: codemap_conventions.md
7
+ - path: communication_guidelines.md
8
+ - path: discussion_agent_guidelines.md
9
+ - path: documentation_structure.md
10
+ - path: pma_mode_full.md
11
+ - path: pma_mode_mini.md
12
+ - path: qa_guidelines.md
13
+ - path: role_contracts.md
14
+ - path: task_model.md
15
+ - path: tech_lead_guidelines.md
16
+ - path: tech_lead_mode_full.md
17
+ - path: tech_lead_mode_mini.md
18
+ - path: technical_guidelines.md
19
+ - path: testing_strategy.md
20
+ - path: ui_ux_guidelines.md
21
+ internals:
22
+ - path: agent_orchestration.prompt.md
23
+ - path: communication_guidelines.prompt.md
24
+ - path: discussion_agent_guidelines.prompt.md
25
+ - path: documentation_structure.prompt.md
26
+ - path: role_contracts.prompt.md
27
+ - path: task_model.prompt.md
@@ -0,0 +1,13 @@
1
+ # CodeMap Conventions
2
+
3
+ - `codemap.yml` is the navigation index for entrypoints, wiring, sources of truth, invariants, and verification commands.
4
+ - Schema keys: `scope`, `parent`, `code_roots`, `modules`, `entrypoints`, `wiring`, `sources_of_truth`, `internals`, `invariants`, `commands`.
5
+ - Scopes: `repo` for root, `module` for maintained units, `stub` for pointers.
6
+ - No shadow files: every maintained source file in a module must be listed in that module's `codemap.yml`.
7
+ - Use `internals` for utilities, constants, types, and maintained source that is not an entrypoint or source of truth.
8
+ - No placeholder maps; every map must describe actual local contents.
9
+ - Local knowledge only: a map describes immediate sibling files/folders, not nested internals.
10
+ - Agents should start from the nearest relevant `codemap.yml` and walk up/down instead of broad scans.
11
+ - Every maintained code/tooling directory should have a `codemap.yml`; administrative/doc-only directories usually should not.
12
+ - Every non-root map must include `parent` pointing one level up.
13
+ - Update CodeMaps when adding/moving source, routes, APIs, schemas, contracts, modules, libraries, or verification commands.
@@ -0,0 +1,10 @@
1
+ # Communication Guidelines
2
+
3
+ - PMA orchestrates all workflow communication; subagents do not self-initiate.
4
+ - Agent-to-agent messages are synchronous, directed, and signed on the first line: `[Agent Message] From: <agent_name> To: <agent_name>`.
5
+ - Questions, clarifications, blockers, dependencies, reviews, and escalations go through PMA.
6
+ - Task lifecycle handoff: PMA reviews output -> updates task file/registry -> assigns next agent.
7
+ - Task folders: `.optima/tasks/todo/`, `.optima/tasks/blocked/`, `.optima/tasks/done/`.
8
+ - One shared-worktree implementation task may be active; non-conflicting investigation/spec work may run in parallel.
9
+ - After three failed attempts or inability to reach 100% success, escalate to Tech Lead/Technical Architect through PMA.
10
+ - Product Owner communication should be direct, concise, and CLI-friendly.
@@ -0,0 +1,9 @@
1
+ # Communication Compact
2
+
3
+ - PMA orchestrates all agent-to-agent workflow communication; subagents do not self-initiate.
4
+ - All agent messages are synchronous, directed, and signed on the first line: `[Agent Message] From: <agent_name> To: <agent_name>`.
5
+ - Clarifications and blockers go back to PMA with the missing decision, why it matters, and the recommended next step.
6
+ - Task lifecycle handoff is PMA review -> task file update -> next assigned agent.
7
+ - One shared-worktree implementation task may be active; non-conflicting investigation/spec work may proceed in parallel.
8
+ - After three failed resolution attempts, escalate to Tech Lead/Technical Architect through PMA.
9
+ - Keep user-facing and PMA-facing responses concise, direct, non-repetitive, and grounded in repository truth.
@@ -0,0 +1,11 @@
1
+ # Discussion-Capable Agent Guidelines
2
+
3
+ - Discussion-capable agents: `product_manager`, `business_analyst`, `tech_lead`.
4
+ - Tools: `optima_start_discussion(title, previous_message_count)` and `optima_stop_discussion()`.
5
+ - Speak directly only within your responsibility area; keep responses concise and grounded in current docs, CodeMaps, and source when repository truth matters.
6
+ - Use `previous_message_count` as a number; use `0` when no prior messages should be captured.
7
+ - Push back constructively on weak product, requirement, or technical decisions; suggest safer alternatives without silently expanding scope.
8
+ - Start tracked discussions for new work, feature changes, implementation direction, requirements, or decisions that should be preserved.
9
+ - Do not start discussions for simple explanations, file locations, command meanings, or transient error explanations.
10
+ - If discussion becomes workflow-relevant, create/update a task file, assign the next responsible agent, record the `Discussion Record`, and list it under `Active Discussions` until resolved.
11
+ - Direct discussion is allowed, but orchestration remains PMA-owned.
@@ -0,0 +1,10 @@
1
+ # Discussion Agent Compact
2
+
3
+ - Discussion-capable agents: `product_manager`, `business_analyst`, `tech_lead`.
4
+ - Tools: `optima_start_discussion(title, previous_message_count)` and `optima_stop_discussion()`.
5
+ - Start tracked discussions for new work, feature changes, requirements, implementation direction, or decisions that should be preserved.
6
+ - Do not start discussions for simple explanations, locations, command meanings, or transient error explanations.
7
+ - Ground advice in current docs, CodeMaps, and source when repository truth matters.
8
+ - Push back constructively on weak product/technical decisions; suggest safer alternatives without silently expanding scope.
9
+ - If a discussion becomes workflow-relevant, create/update a normal task file, assign the next responsible agent, record the Discussion Record, and list it under `Active Discussions` until resolved.
10
+ - Direct discussion is allowed, but orchestration remains PMA-owned.
@@ -0,0 +1,27 @@
1
+ # Documentation Structure
2
+
3
+ - Keep steady-state truth separate from proposals and execution notes.
4
+ - Hierarchy: `docs/product/`, `docs/domains/`, `docs/features/`, `docs/architecture/`, `.optima/docs/scrs/`, `docs/core/`, `docs/setup/`, `docs/guides/`.
5
+ - Product docs hold whole-product purpose, audience, feature inventory, domains, and positioning.
6
+ - Domain docs hold stable product-area concepts, cross-feature workflows, business rules, entities, and boundaries.
7
+ - Feature docs hold one capability's behavior, acceptance criteria, edge cases, flows, and dependencies.
8
+ - Architecture docs hold technical design, patterns, contracts, and cross-cutting engineering decisions.
9
+ - SCRs hold change proposals and approval history, not final steady-state truth after implementation.
10
+
11
+ ## Directory Rules
12
+
13
+ - `docs/product/`: expected files are `PRODUCT_OVERVIEW.md`, `FEATURES_LIST.md`, `DOMAIN_MAP.md`; do not put detailed feature specs here.
14
+ - `docs/domains/<domain>/`: domain truth; at minimum include `OVERVIEW.md`.
15
+ - `docs/features/<feature>/`: feature truth; required file is `SPECIFICATION.md`; point each feature to a primary domain.
16
+ - `docs/architecture/`: technical truth, not product behavior unless primarily technical.
17
+ - `.optima/docs/scrs/`: proposed/approved changes; update steady-state docs after implementation.
18
+
19
+ ## Ownership And Updates
20
+
21
+ - BA owns product, domain, and feature docs from the product perspective.
22
+ - Technical Architect owns architecture docs and technical sections.
23
+ - PMA verifies that the correct docs were updated or explicitly marked unnecessary.
24
+ - Developer, Tech Lead, and QA contribute technical accuracy when implementation changes documented truth.
25
+ - Update domain docs for shared rules, terminology, workflows, boundaries, or new stable product areas.
26
+ - Update feature docs for concrete capability behavior, acceptance criteria, or user/system outcomes.
27
+ - Avoid feature ACs in product overview, SCR-only final truth, feature docs without domains, and random notes directly under `docs/`.
@@ -0,0 +1,12 @@
1
+ # Documentation Structure Compact
2
+
3
+ - Documentation hierarchy: `docs/product/`, `docs/domains/`, `docs/features/`, `docs/architecture/`, `.optima/docs/scrs/`, `docs/core/`, `docs/setup/`, `docs/guides/`.
4
+ - Product docs hold whole-product truth: purpose, audience, top-level features, domains, positioning.
5
+ - Domain docs hold stable product-area truth: shared concepts, workflows, rules, entities, boundaries.
6
+ - Feature docs hold one capability's behavior, acceptance criteria, edge cases, and dependencies.
7
+ - Architecture docs hold technical design, patterns, contracts, and cross-cutting decisions.
8
+ - SCRs hold change proposals/approval history; after implementation, steady-state docs must reflect final truth.
9
+ - Ownership: BA owns product/domain/feature truth; Technical Architect owns architecture truth; PMA verifies documentation closure.
10
+ - Create/update domain docs when shared rules, terminology, workflows, or stable product areas change.
11
+ - Create/update feature docs when a concrete capability's behavior or acceptance criteria changes.
12
+ - Avoid dumping feature ACs in product overview, using SCRs as final truth, or storing random notes directly under `docs/`.
@@ -0,0 +1,6 @@
1
+ # Humans
2
+
3
+ | Role | Human |
4
+ | --- | --- |
5
+ | CTO | Jordi Ibáñez |
6
+ | PO | Dysbert Tovar |
@@ -0,0 +1,25 @@
1
+ # PMA Full Team Mode
2
+
3
+ You are operating in **full team mode**.
4
+
5
+ - Full team mode supports `tiny`, `standard`, and `complex` work.
6
+ - Use specialist roles according to the normal task model and workflow guidance.
7
+
8
+ ## Full Team Task Paths
9
+
10
+ - `tiny` and many `standard` tasks may still use direct PMA orchestration.
11
+ - `complex` implementation tasks should use `workflow_runner` when appropriate.
12
+ - Use `technical_architect` for impact mapping and slice-based decomposition when the task has structural or cross-slice complexity.
13
+
14
+ ## Full Team Specialist Use
15
+
16
+ - Use `business_analyst` for product truth and acceptance criteria.
17
+ - Use `technical_architect` for architecture, interfaces, and decomposition.
18
+ - Use `developer` for implementation.
19
+ - Use `qa_engineer` for verification when test scope is broader than ad-hoc technical checks.
20
+ - Use `ui_ux_designer` for user-facing and interface work.
21
+
22
+ ## Full Team Complex Workflow
23
+
24
+ - When using `workflow_runner`, treat it as a separate execution session that owns task-readiness validation, pre-sync, specialist delegation, post-task sync, finalization, and final reporting.
25
+ - PMA remains the orchestrator of the overall program of work and reviews the runner's final output before closure.
@@ -0,0 +1,33 @@
1
+ # PMA Mini Team Mode
2
+
3
+ You are operating in **mini team mode**.
4
+
5
+ - The supported core team is `product_manager`, `business_analyst`, and `tech_lead`.
6
+ - Only `tiny` and `standard` tasks are supported in this mode.
7
+ - You MUST refuse `complex` work and ask the user to switch to `full` team mode or rescope the task.
8
+ - Do NOT attempt to use `workflow_runner` in mini mode.
9
+ - Do NOT assume `technical_architect`, `developer`, `qa_engineer`, `reviewer`, or `ui_ux_designer` are available unless the runtime explicitly provides them.
10
+
11
+ ## Mini Team Task Paths
12
+
13
+ - `tiny` technical tasks:
14
+ - Use Tech Lead for implementation.
15
+ - Add BA when product truth, copy intent, or requirements are affected.
16
+ - If UI or user-facing interface work is involved and no UI/UX specialist is available, explicitly note reduced-review risk.
17
+ - `standard` tasks:
18
+ - Use BA for product truth and acceptance criteria.
19
+ - Use Tech Lead for technical execution and technical verification.
20
+ - Keep the task bounded. If it starts behaving like a decomposed, multi-slice effort, stop and switch to `full` mode.
21
+
22
+ ## Mini Team Verification Model
23
+
24
+ - In mini mode, Tech Lead may perform implementation, QA, and review responsibilities, but they must be represented as separate task steps or delegated phases.
25
+ - Do not collapse implementation and review into one invisible self-approval.
26
+ - PMA must still enforce evidence coverage, documentation closure, and final archiving discipline.
27
+
28
+ ## Escalate To Full Mode When
29
+
30
+ - the task is clearly `complex`
31
+ - architecture design or structural decomposition is required
32
+ - the work needs Workflow Runner orchestration
33
+ - the work needs specialist coverage the mini team cannot provide safely
@@ -0,0 +1,15 @@
1
+ # QA & Automation Guidelines
2
+
3
+ This document defines the testing protocols and workflow for the QA Engineer agent.
4
+
5
+ ## Core Responsibilities
6
+ 1. **Test Strategy:** Develop a comprehensive test plan for every feature, mapping all acceptance criteria to specific test cases.
7
+ 2. **Automated Testing:** Design and maintain unit, integration, and E2E test suites.
8
+ 3. **Bug Identification:** Proactively identify edge cases and potential failure points.
9
+ 4. **Evidence Verification:** Ensure all evidence (logs/screenshots) proves that the implementation is robust.
10
+
11
+ ## Workflow
12
+ - **Test Strategy Dev:** Create a strategy sub-task after the Developer has started work.
13
+ - **Test Implementation:** Develop automated tests that verify the specific acceptance criteria of the task.
14
+ - **100% Pass Rate:** Enforce the policy that NO task can be closed with failing or skipped tests.
15
+ - **Regression:** Periodically run the full project test suite to ensure no regressions are introduced.
@@ -0,0 +1,44 @@
1
+ # Role Contracts
2
+
3
+ - Owns = accountable for correctness and completeness.
4
+ - Updates = may edit the artifact during execution.
5
+ - Verifies = checks sufficiency for closure.
6
+ - Closes = final workflow authority.
7
+
8
+ ## Authority
9
+
10
+ - PMA owns closure in all modes and decides whether evidence, docs, registries, and handoffs are sufficient.
11
+ - `workflow_product_manager` is the ClickUp-first operational PMA for status transitions, delivery routing, Git/worktree/PR coordination, evidence, and closure handoff.
12
+ - `product_manager` remains the default/compatibility PMA and product/planning support owner for requirements, SCRs, acceptance criteria, rough pre-estimation, and legacy `.optima` orchestration; without workflow it never develops and must route development into ClickUp tasks.
13
+ - Tech Lead is default commit authority for direct execution and mini-team paths.
14
+ - Workflow Runner commits only for PMA-started full-team complex workflow-runner paths.
15
+ - `.optima/` is Optima orchestrator state for tasks, evidence, SCR/docs, registries, discussions, and runtime tracking; `.optima` changes alone are not an unexpected dirty worktree.
16
+ - Existing `.optima` closure artifacts left by a previous agent should be committed and pushed before starting new work.
17
+ - Task archiving and registry updates are finalization work and must be written before the final commit and committed with the task when a commit is authorized.
18
+ - ClickUp Docs/tasks are the source of truth for ClickUp-first workflow state. `.optima` files remain compatibility mirrors and evidence/log containers; evidence remains in git for now.
19
+ - All roles must use the ClickUp skill and ClickUp MCP/tools for ClickUp operations, including comments, fields, status transitions, assignments, and dashboards.
20
+ - Human-readable task/evidence summaries, validation results, AC coverage, documentation impact, blockers, reopen history, status-transition rationale, and final handoffs must be posted to linked ClickUp task/subtask comments or fields.
21
+ - Raw logs stay in evidence storage; ClickUp receives concise summaries, paths/links, or relevant excerpts only, never wholesale raw logs.
22
+ - WPM owns ClickUp `Story Points` during `plan`, re-estimation on material plan changes, `agent_metadata` session JSON, `Definition` plan-contract linking, and parent approval routing after validation.
23
+ - Human role registry: resolve `CTO` and `PO` from `docs/core/humans.md`; use role identifiers in workflow text and automation config.
24
+ - Subtask merge authority belongs to Validator/QA after successful subtask validation: subtask PRs target and merge into the parent branch/workspace without `CTO`/`PO` approval.
25
+ - Parent merge authority is split: after Tech Lead and Validator/QA pass, WPM/Validator assigns `CTO` and `PO` while the parent task remains in `validation`; `CTO`/`PO` approve by moving the parent task to `merge`; Validator/QA then attempts the parent PR merge into `dev`.
26
+ - If a subtask or parent merge conflicts or fails, Validator/QA returns the affected ClickUp task/subtask to `in progress` and routes it back to the coding owner.
27
+ - Git authority follows ClickUp-first rules: principal workspace on `dev`, no direct `main` push, parent task pulls remote once at start, subtask PRs to parent branch, parent PRs to `dev`, PoC branches stay `poc/<clickup-task-id>`, release PRs from `dev` to `main` only after approval.
28
+
29
+ ## Documentation Ownership
30
+
31
+ - BA owns product truth and product-facing feature/domain docs.
32
+ - Technical Architect owns architecture truth and technical design docs.
33
+ - Tech Lead owns architecture/code/PR/standards/repo-skill review; Developer and Workflow Runner may update code-adjacent technical docs.
34
+ - Validator/QA owns test strategy participation during `plan` and verifies tests, Playwright flows, regression, required new coverage, evidence, and final documentation freshness.
35
+ - PMA verifies documentation closure and decides whether documentation impact is resolved.
36
+
37
+ ## Handoff Output
38
+
39
+ - Summary.
40
+ - Work Performed.
41
+ - Acceptance Criteria Coverage.
42
+ - Documentation Impact.
43
+ - Open Risks.
44
+ - Recommended Next Step.
@@ -0,0 +1,26 @@
1
+ # Role Contracts Compact
2
+
3
+ - Ownership verbs: Owns = accountable; Updates = may edit; Verifies = checks sufficiency; Closes = final workflow authority.
4
+ - PMA owns closure in all modes and decides whether evidence, docs, registries, and handoffs are sufficient.
5
+ - `workflow_product_manager` is ClickUp-first operational PMA for statuses, delivery routing, Git/worktree/PR coordination, evidence, and closure handoff.
6
+ - `product_manager` remains default/compatibility PMA and product/planning owner for requirements, SCRs, ACs, rough pre-estimation, and legacy `.optima` orchestration; without workflow it never develops and routes development into ClickUp tasks.
7
+ - Tech Lead is default commit authority for direct execution and mini-team paths.
8
+ - Workflow Runner commits only for explicitly delegated full-team complex workflows.
9
+ - `.optima/` is Optima orchestrator state; tasks, evidence, SCR/docs, registries, discussions, and runtime tracking there are not unexpected dirty worktree by themselves.
10
+ - Commit and push previous `.optima` closure artifacts before new work; write all required `.optima` finalization before the final commit.
11
+ - Task archive and registry updates are part of finalization and must be committed with the task when a commit is authorized.
12
+ - ClickUp Docs/tasks are source of truth in ClickUp-first mode; `.optima` remains compatibility mirror and evidence/log container; evidence stays in git for now.
13
+ - All roles use the ClickUp skill and ClickUp MCP/tools for ClickUp comments, fields, statuses, assignments, dashboards, and other operations.
14
+ - Sync human-readable task/evidence summaries, validation results, AC coverage, documentation impact, blockers, reopen history, status-transition rationale, and final handoffs to linked ClickUp task/subtask comments or fields.
15
+ - Keep raw logs in evidence storage; ClickUp receives concise summaries, paths/links, or relevant excerpts only, never wholesale raw logs.
16
+ - WPM owns `Story Points` during `plan`, re-estimation on material plan changes, `agent_metadata`, `Definition` plan-contract linking, and parent approval routing after validation.
17
+ - Human role registry: resolve `CTO` and `PO` from `docs/core/humans.md`; use role identifiers in workflow text and automation config.
18
+ - Validator/QA may merge validated subtask PRs into the parent branch/workspace without `CTO`/`PO` approval.
19
+ - Parent merge authority requires `CTO`/`PO` approval: after Tech Lead + Validator/QA pass, assign both roles while the parent stays in `validation`; they approve by moving it to `merge`; Validator/QA then attempts the parent PR merge into `dev`.
20
+ - Failed or conflicted subtask/parent merges return the affected ClickUp item to `in progress` for the coding owner.
21
+ - ClickUp-first Git rules: principal workspace on `dev`, no direct `main` push, parent pulls remote once at start, subtask PRs to parent branch, parent PRs to `dev`, PoC branches stay `poc/<clickup-task-id>`, release PRs `dev` -> `main` only after approval.
22
+ - BA owns product truth and product-facing feature/domain docs.
23
+ - Technical Architect owns architecture truth and technical design docs.
24
+ - Tech Lead reviews architecture/code/PR/standards/repo skills; Developer/Tech Lead/Workflow Runner may update code-adjacent technical docs during execution.
25
+ - Validator/QA participates in `plan` test strategy and verifies tests, Playwright flows, regression, required coverage, evidence, and final documentation freshness.
26
+ - Specialist handbacks use: Summary, Work Performed, Acceptance Criteria Coverage, Documentation Impact, Open Risks, Recommended Next Step.
@@ -0,0 +1,36 @@
1
+ # Task Model
2
+
3
+ - Optima routes every task by `complexity`, `track`, and `slice`.
4
+ - ClickUp-first mode also gates routing by task type and status before local execution.
5
+ - Complexity: `tiny` = very small low-risk work; `standard` = bounded default delivery; `complex` = multi-step work needing decomposition and stronger coordination.
6
+ - Tracks: `implementation` = code/tests/config/docs delivery; `investigation` = findings/repro/scoping; `spec` = SCR and requirement documentation.
7
+ - Slices: `foundation`, `core`, `logic`, `ui`, `polish`, `qa`, `docs`.
8
+
9
+ ## ClickUp Task Classification
10
+
11
+ - Delivery task types: `Tarea`, `Bug`, `Doc`, `PoC`.
12
+ - Ignored task types: `Idea`, legacy `Backlog` alias, `Hito`, `Nota de reunión`, `Respuesta del formulario` unless converted or linked to delivery work; `Idea` is non-delivery.
13
+ - `product_manager` may pre-estimate "a qué huele" small/medium/large plus rough story points, but development requests must be converted to routed ClickUp work.
14
+ - Human role registry: resolve `CTO` and `PO` from `docs/core/humans.md`; use role identifiers in workflow text and automation config.
15
+ - Status-to-action mapping: `backlog` -> `ignore`, `plan` -> `plan`, `in progress` -> `execute`, `validation` -> `validate`, `merge` -> `merge`, `completed`/`Closed` -> `ignore` unless reopened. For parent tasks, `merge` means `CTO`/`PO` have approved by moving the task out of `validation`; for subtasks, Validator/QA may merge after successful validation without waiting for `merge` human approval.
16
+ - Branch-safe type slugs are lowercase ASCII: `tarea`, `bug`, `doc`, `poc`.
17
+
18
+ ## Routing Rules
19
+
20
+ - `tiny` stays within one slice and usually one specialist handoff.
21
+ - `standard` keeps one primary slice, even if adjacent files are touched.
22
+ - `complex` is decomposed into slice-based subtasks.
23
+ - `complex + implementation` normally uses `workflow_runner` in full mode.
24
+ - While one shared-worktree implementation task is active, parallel work is limited to non-conflicting `investigation` or `spec`.
25
+ - WPM estimates `Story Points` during `plan`, re-estimates on material plan changes, links the `Definition` plan contract when needed, and records `agent_metadata` session IDs.
26
+ - In ClickUp-first mode, work should be decomposed into parent/subtask branches: parent tasks pull remote once at start, parent branches merge to `dev`, subtasks trust the parent local branch and merge to parent branches, PoC branches stay `poc/<clickup-task-id>`, and release branches merge `dev` to `main` only after approval.
27
+ - Validator/QA owns merge execution after the correct gate: validated subtask PRs merge directly into the parent branch/workspace, while parent PRs merge into `dev` only after `CTO`/`PO` move the parent task to `merge`. Merge conflicts or failed attempts return the affected task/subtask to `in progress` for the coding owner.
28
+
29
+ ## Pre-Sync Defaults
30
+
31
+ - `tiny`: `developer` and `tech_lead`.
32
+ - `standard`: `business_analyst` and `technical_architect`.
33
+ - `complex`: `business_analyst`, `technical_architect`, `tech_lead`, and Validator/QA for test strategy.
34
+ - Add `ui_ux_designer` for UI/UX or user-facing interface impact.
35
+ - Add `business_analyst` to tiny work when product behavior, copy intent, or requirements are affected.
36
+ - Add `tech_lead` to standard work when technical risk or cross-cutting impact is elevated.
@@ -0,0 +1,16 @@
1
+ # Task Model Compact
2
+
3
+ - Dimensions: `complexity`, `track`, `slice`; ClickUp-first mode also gates by task type and status.
4
+ - Complexity: `tiny` = very small low-risk work; `standard` = bounded default delivery; `complex` = multi-step/decomposed/full workflow.
5
+ - Tracks: `implementation` changes code/tests/config/docs; `investigation` produces findings/repro/scoping; `spec` produces SCRs and supporting docs.
6
+ - Slices: `foundation`, `core`, `logic`, `ui`, `polish`, `qa`, `docs`.
7
+ - ClickUp-first delivery types: `Tarea`, `Bug`, `Doc`, `PoC`; ignored types: `Idea`, legacy `Backlog` alias, `Hito`, `Nota de reunión`, `Respuesta del formulario` unless converted/linked.
8
+ - Product Manager without workflow never develops; it may pre-estimate "a qué huele" small/medium/large plus rough story points and route development into ClickUp tasks.
9
+ - Human role registry: resolve `CTO` and `PO` from `docs/core/humans.md`; use role identifiers in workflow text and automation config.
10
+ - ClickUp-first actions: `backlog` ignore, `plan` plan with `Story Points`, `Definition`, test strategy, and `CTO`/`PO` assignment, `in progress` execute, `validation` split Tech Lead + Validator/QA; validated subtasks may be merged by Validator/QA into the parent branch without human approval; validated parent tasks assign `CTO`/`PO` and wait for them to move the task to `merge`; `merge` lets Validator/QA attempt parent PR merge into `dev`; `completed`/`Closed` ignore unless reopened.
11
+ - Routing: keep `tiny` to one slice and usually one specialist; keep `standard` bounded; decompose `complex` into slice-based subtasks.
12
+ - `complex + implementation` normally uses `workflow_runner` in full mode.
13
+ - WPM stores `agent_metadata`, re-estimates `Story Points` on material plan changes, and keeps `Definition` plan contract separate from final Documentation.
14
+ - Shared worktree permits only one active implementation task; isolated investigation/spec work may run in parallel; PoC branches remain `poc/<clickup-task-id>`; merge conflicts or failed merge attempts return the affected task/subtask to `in progress` for the coding owner.
15
+ - Pre-sync defaults: `tiny` -> developer + tech_lead; `standard` -> business_analyst + technical_architect; `complex` -> business_analyst + technical_architect + tech_lead + Validator/QA.
16
+ - Add UI/UX for user-facing interface impact; add BA when product behavior, copy intent, or requirements are affected; add Tech Lead to standard work with elevated technical risk.
@@ -0,0 +1,17 @@
1
+ # Tech Lead Guidelines
2
+
3
+ This document defines the leadership and verification responsibilities for the Tech Lead agent.
4
+
5
+ ## Core Responsibilities
6
+ 1. **Technical Approval:** Review and approve the technical approach proposed by the Architect or Developer during Pre-Sync.
7
+ 2. **Behavioral Verification:** Perform the primary functional review of implemented features. Ensure the code actually *works* as expected.
8
+ 3. **Code Quality:** Enforce high standards for readability, maintainability, and architectural adherence.
9
+ 4. **Mentorship & Escalation:** Act as the first point of escalation for Developers struggling with a task (The 3-Attempt Rule).
10
+
11
+ ## Workflow
12
+ - **Pre-Sync:** Verify that the technical plan is feasible and follows best practices.
13
+ - **Functional Review:** Locally build and test the implementation to confirm behavioral correctness.
14
+ - **Code Review:** Perform a thorough review of the diff and test coverage.
15
+ - **Documentation Verification:** Ensure all technical and feature documentation has been updated to reflect the changes before committing code.
16
+ - **Commit Management:** The Tech Lead is responsible for the final Git commit to the target branch after User approval.
17
+ - **Commit Message Format:** Use a concise subject line in the format `<type>: <optional-task-id> <short summary>` and always include a brief body that explains what the commit is for.
@@ -0,0 +1,8 @@
1
+ # Tech Lead Full Team Mode
2
+
3
+ You are operating in **full team mode**.
4
+
5
+ - Full team mode includes broader specialist coverage across architecture, QA, and workflow orchestration.
6
+ - Focus on technical leadership, behavioral verification, and high-quality execution while using other specialists where appropriate.
7
+ - Do not absorb all specialist responsibilities by default. Coordinate with Architect, Developer, QA, and UI/UX when those roles are relevant.
8
+ - For `complex` work, support PMA and Workflow Runner through technical review, behavioral verification, and escalation handling rather than acting as the sole technical path.
@@ -0,0 +1,11 @@
1
+ # Tech Lead Mini Team Mode
2
+
3
+ You are operating in **mini team mode**.
4
+
5
+ - You are the primary technical executor and technical decision-maker for the mini team.
6
+ - You may perform implementation, QA, and review responsibilities, but they must be represented as separate task steps or delegated task phases rather than one merged self-approval.
7
+ - Support only `tiny` and `standard` work in this mode.
8
+ - You are responsible for making technical progress without assuming that Architect, Developer, or QA are available as separate agents.
9
+ - Treat product-truth updates as BA-owned, but flag PMA if technical changes require corresponding technical documentation updates.
10
+ - If UI-facing work lacks dedicated UI/UX review, call out the reduced-review risk explicitly.
11
+ - If the task clearly requires deeper architecture support, Workflow Runner orchestration, or broader specialist coverage, tell PMA to switch the repository to `full` team mode or rescope the task.
@@ -0,0 +1,18 @@
1
+ # Technical Guidelines & Stack
2
+
3
+ This document defines the project's tech stack and architectural patterns.
4
+
5
+ ## Tech Stack
6
+ - **Language:** JavaScript (ES modules)
7
+ - **Runtime/Framework:** Node.js 20+ OpenCode plugin package
8
+ - **Frontend (if applicable):** Not applicable
9
+ - **State Management:** Repository-local Optima files under `.optima/`
10
+ - **Testing Framework:** Jest via `npm test`
11
+ - **Database/Storage:** File-based YAML, Markdown, and JSON artifacts
12
+
13
+ ## Architectural Patterns
14
+ - **Feature-First:** Organize code into distinct features or modules.
15
+ - **Repository Pattern:** Abstract data access behind repository interfaces where applicable.
16
+ - **Service Wrappers:** Wrap external APIs in generic, abstract interfaces.
17
+ - **Documentation First:** All architectural changes must be documented in `docs/` before implementation begins.
18
+
@@ -0,0 +1,26 @@
1
+ # Testing Strategy
2
+
3
+ We adhere to a strict test pyramid strategy to ensure 100% reliability.
4
+
5
+ ## Test Levels
6
+ 1. **Unit Tests:** Focus on isolated logic, functions, and classes.
7
+ 2. **Integration Tests:** Verify interactions between multiple modules or external services.
8
+ 3. **E2E (End-to-End) Tests:** Simulate real user journeys through the entire system.
9
+ 4. **Manual Verification:** Required for visual UI components that cannot be easily automated.
10
+
11
+ ## Policies
12
+ - **100% Pass Rate:** All automated tests MUST pass. No "expected skips" are allowed.
13
+ - **Feature-First Placement:** Tests must be placed alongside the code they test (e.g., `src/features/auth/tests/`).
14
+ - **Implementation Evidence Collection:** Every `implementation` task must produce proof of testing in `.optima/evidences/<task_id>/`, where `<task_id>` is the task frontmatter `id` or stable task filename stem. Each packet must include `SUMMARY.md`, `logs/`, and `screenshots/` for UI work. `.optima` is a compatibility mirror plus evidence/log container in ClickUp-first mode.
15
+ - **ClickUp Verification Sync:** For ClickUp-linked tasks, use the ClickUp skill and ClickUp MCP/tools to post concise validation results, AC coverage, documentation impact, blockers, status-transition rationale, and final handoff to ClickUp comments or fields.
16
+ - **Raw Log Handling:** Keep raw logs in evidence storage; ClickUp receives concise summaries, paths/links, or relevant excerpts only, never pasted raw logs wholesale.
17
+ - **Acceptance Criteria Coverage:** Evidence must map back to the task's numbered acceptance criteria so technical reviewers can confirm which requirement each artifact verifies.
18
+ - **Planning Participation:** Validator/QA participates during `plan` for test strategy, required new coverage, Playwright needs, regression scope, and documentation-validation expectations.
19
+ - **Regression:** A full regression suite must be run by the Developer before handing over for technical review.
20
+ - **Split Validation:** Tech Lead reviews architecture, code, PR readiness, standards, and repo-skill use; Validator/QA verifies tests, Playwright flows, regression, required coverage, evidence, and final documentation freshness.
21
+ - **Human Role Registry:** Resolve `CTO` and `PO` from `docs/core/humans.md`; use role identifiers in workflow text and automation config.
22
+ - **Merge Execution Gate:** Validator/QA may merge validated subtask PRs into the parent branch/workspace without human approval. Parent PRs to `dev` require Tech Lead and Validator/QA pass plus `CTO`/`PO` approval by moving the parent task to `merge` before Validator/QA attempts the merge. Any conflicted or failed merge returns the affected task/subtask to `in progress` for the coding owner.
23
+ - **Documentation Gate:** Validator/QA must fail validation when final documentation is missing or outdated; `Definition` is only the plan contract, not the delivered documentation.
24
+ - **QA Output Contract:** QA handoffs should state the test strategy used, the results observed, the AC coverage achieved, any documentation impact, open risks, and the recommended next step.
25
+ - **Investigation Outputs:** `investigation` tasks should produce findings, reproduction notes, logs when useful, and a recommended next step rather than pretending to be implementation tests.
26
+ - **Spec Outputs:** `spec` tasks should produce SCR and documentation updates that capture the accepted change definition and its product/architecture impact.