@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,24 @@
1
+ # UI/UX Design Guidelines
2
+
3
+ - Prioritize ease of use, accessibility, intuitive navigation, visual hierarchy, polish, and design-system consistency.
4
+ - In pre-sync, define screen components, interactions, layout, visual hierarchy, color, typography, and usability risks.
5
+ - In review, inspect screenshots/evidence from `.optima/evidences/<task_id>/`; do not review code.
6
+ - If visual evidence is missing or inadequate, ask for better screenshots instead of guessing.
7
+ - Judge results as `Good`, `Needs Fix Now`, or `Future Enhancement`.
8
+
9
+ ## Quality Checklist
10
+
11
+ - Alignment and grid discipline are clear.
12
+ - Spacing is consistent across related elements.
13
+ - Typography hierarchy makes screens easy to scan.
14
+ - Interactive elements have obvious affordance.
15
+ - Color contrast supports accessibility.
16
+ - The UI feels modern, focused, uncluttered, and professionally polished.
17
+
18
+ ## Mandatory Rejection
19
+
20
+ - Blatant misalignment.
21
+ - Ignored design system.
22
+ - Overlap, cut-off text, or broken responsive layout.
23
+ - Missing interaction flow from pre-sync.
24
+ - Amateur visual polish or unreadable contrast.
@@ -0,0 +1,15 @@
1
+ # Domains
2
+
3
+ Use `docs/domains/` for stable product areas that contain multiple related features.
4
+
5
+ At minimum, each domain should contain:
6
+
7
+ - `OVERVIEW.md`
8
+
9
+ Recommended supporting files:
10
+
11
+ - `RULES.md`
12
+ - `WORKFLOWS.md`
13
+ - `ENTITIES.md`
14
+
15
+ Domain docs should explain shared concepts and cross-feature rules, not low-level implementation details.
@@ -0,0 +1,7 @@
1
+ scope: module
2
+ parent: ../codemap.yml
3
+ modules:
4
+ - path: domain-template
5
+ - path: task-lifecycle
6
+ sources_of_truth:
7
+ - path: README.md
@@ -0,0 +1,37 @@
1
+ # Domain Overview Template
2
+
3
+ Use this template when introducing a new domain under `docs/domains/<domain>/`.
4
+
5
+ ## Domain Name
6
+
7
+ `<domain-name>`
8
+
9
+ ## Purpose
10
+
11
+ Describe the stable product area this domain covers and why it exists.
12
+
13
+ ## Scope
14
+
15
+ - What belongs in this domain
16
+ - What does not belong in this domain
17
+ - How this domain interacts with neighboring domains
18
+
19
+ ## Core Concepts
20
+
21
+ - List the shared concepts or terms that appear across multiple features in this domain.
22
+
23
+ ## Owned Features
24
+
25
+ - List the primary features that belong to this domain.
26
+
27
+ ## Shared Rules
28
+
29
+ - Summarize the rules or invariants that apply across multiple features in the domain.
30
+
31
+ ## Key Workflows
32
+
33
+ - List or link the major workflows that matter in this domain.
34
+
35
+ ## Related Documents
36
+
37
+ - Link to supporting `RULES.md`, `WORKFLOWS.md`, `ENTITIES.md`, related feature specs, and relevant architecture docs.
@@ -0,0 +1,4 @@
1
+ scope: module
2
+ parent: ../codemap.yml
3
+ sources_of_truth:
4
+ - path: OVERVIEW.md
@@ -0,0 +1,69 @@
1
+ # Task Lifecycle
2
+
3
+ ## Purpose
4
+
5
+ This domain defines how work is classified, discussed, executed, verified, and archived inside Optima.
6
+
7
+ It is the primary product area responsible for turning approved work into structured task execution with the right amount of process for the task's complexity and risk.
8
+
9
+ ## Scope
10
+
11
+ This domain includes:
12
+
13
+ - task classification by `tiny`, `standard`, and `complex`
14
+ - task routing by `implementation`, `investigation`, and `spec`
15
+ - slice-based task planning using `foundation`, `core`, `logic`, `ui`, `polish`, `qa`, and `docs`
16
+ - definition-of-ready and definition-of-done expectations for task execution
17
+ - pre-sync quorum rules
18
+ - task execution flow and handoff expectations
19
+ - verification and archiving expectations
20
+
21
+ This domain does not include:
22
+
23
+ - low-level technical architecture details
24
+ - plugin installation and configuration guidance
25
+ - CodeMap schema rules
26
+
27
+ ## Core Concepts
28
+
29
+ - **Complexity:** The process weight of the task.
30
+ - **Track:** The type of work being performed.
31
+ - **Slice:** The dominant work surface for the task.
32
+ - **Pre-Sync:** The required specialist discussion before execution starts.
33
+ - **Decomposition:** Breaking `complex` work into slice-based subtasks.
34
+ - **Verification:** The proof and checks required before closure.
35
+
36
+ ## Owned Features
37
+
38
+ - task template structure
39
+ - complexity-based routing
40
+ - pre-sync specialist defaults
41
+ - slice-based decomposition for complex work
42
+ - evidence and verification expectations
43
+ - task completion and archiving flow
44
+
45
+ ## Shared Rules
46
+
47
+ - `tiny` work should stay narrowly scoped within one primary slice.
48
+ - `standard` work should remain bounded and keep one dominant slice.
49
+ - `complex` work should be decomposed into slice-based subtasks.
50
+ - PMA always facilitates the discussion, but the required specialist quorum depends on task complexity and impact.
51
+ - UI and other user-facing interface work must include `ui_ux_designer` in pre-sync.
52
+
53
+ ## Key Workflows
54
+
55
+ - classify task complexity and track
56
+ - select the required specialist quorum
57
+ - define objective and acceptance criteria
58
+ - decompose complex work when needed
59
+ - execute, verify, and archive the task
60
+
61
+ ## Related Documents
62
+
63
+ - `docs/core/task_model.md`
64
+ - `docs/core/agent_orchestration.md`
65
+ - `.optima/policies/definition-of-ready.md`
66
+ - `.optima/policies/definition-of-done.md`
67
+ - `.optima/tasks/task-template.md`
68
+ - `.optima/tasks/subtask-template.md`
69
+ - `docs/core/documentation_structure.md`
@@ -0,0 +1,4 @@
1
+ scope: module
2
+ parent: ../codemap.yml
3
+ sources_of_truth:
4
+ - path: OVERVIEW.md
@@ -0,0 +1,11 @@
1
+ # Features
2
+
3
+ Use `docs/features/` for specific product or system capabilities.
4
+
5
+ Each feature should:
6
+
7
+ - belong to one primary domain
8
+ - have one `SPECIFICATION.md`
9
+ - describe concrete behavior and acceptance criteria
10
+
11
+ Feature docs should stay capability-focused and should not become a second domain overview.
@@ -0,0 +1,6 @@
1
+ scope: module
2
+ parent: ../codemap.yml
3
+ modules:
4
+ - path: feature-template
5
+ sources_of_truth:
6
+ - path: README.md
@@ -0,0 +1,36 @@
1
+ # Feature Specification Template
2
+
3
+ Use this template for `docs/features/<feature>/SPECIFICATION.md`.
4
+
5
+ ## Feature Name
6
+
7
+ `<feature-name>`
8
+
9
+ ## Primary Domain
10
+
11
+ `<domain-name>`
12
+
13
+ ## Summary
14
+
15
+ Describe the specific capability this feature provides.
16
+
17
+ ## Users Or Systems Affected
18
+
19
+ - Identify who uses this feature or which systems depend on it.
20
+
21
+ ## Behavior
22
+
23
+ - Describe the expected behavior of the feature.
24
+ - Include major success paths and key error or edge cases.
25
+
26
+ ## Acceptance Criteria
27
+
28
+ - [ ] Define the conditions that must be true for the feature to be considered complete.
29
+
30
+ ## Dependencies
31
+
32
+ - List related domains, features, contracts, or architecture documents.
33
+
34
+ ## Notes
35
+
36
+ - Include any additional product notes, UX notes, or technical constraints that are important for delivery.
@@ -0,0 +1,4 @@
1
+ scope: module
2
+ parent: ../codemap.yml
3
+ sources_of_truth:
4
+ - path: SPECIFICATION.md
@@ -0,0 +1,63 @@
1
+ # Workflow Agents
2
+
3
+ Optima installs the **Optima Collective** into OpenCode: a role-based AI software development team that behaves more like a delivery organization than a single assistant.
4
+
5
+ The collective is designed so each agent represents a professional function inside an AI-native software company. Instead of one model improvising across all concerns, Optima distributes responsibility across product, architecture, implementation, QA, technical review, and design roles.
6
+
7
+ ## Primary orchestration agents
8
+
9
+ - `product_manager`: The default primary agent. Routes work by complexity, delegates specialists, and decides when to use the Workflow Runner.
10
+ - `workflow_runner`: Delegated orchestrator for complex implementation tasks. Handles task-readiness validation, pre-task sync, specialist delegation, post-task sync, finalization, and final reporting inside a PMA-started workflow.
11
+
12
+ ## Specialist agents
13
+
14
+ - `business_analyst`: Maintains product truth, clarifies requirements, and improves SCR quality.
15
+ - `technical_architect`: Defines interfaces, impact surfaces, and architectural consistency.
16
+ - `tech_lead`: Performs behavioral verification, code quality checks, and technical sign-off.
17
+ - `developer`: Implements code and tests.
18
+ - `qa_engineer`: Designs and executes verification and test coverage.
19
+ - `ui_ux_designer`: Reviews visual and interaction quality for UI-facing work.
20
+
21
+ ## Discussion-Capable Agents
22
+
23
+ These agents can talk directly with the user and turn meaningful discussions into tracked handoff tasks:
24
+
25
+ - `product_manager`
26
+ - `business_analyst`
27
+ - `tech_lead`
28
+
29
+ ## Agent Mode Semantics
30
+
31
+ - `primary`: The default main agent the user lands in for the repository.
32
+ - `subagent`: Intended for delegated specialist work rather than direct primary use.
33
+ - `all`: Can be used either as a directly selected agent or as a delegated specialist, depending on the workflow.
34
+
35
+ `mode: all` does not make an agent an orchestrator by default. PMA remains the sole workflow orchestrator. Discussion-capable agents may speak directly with the user, but workflow-relevant work must still be handed back through task files and PMA-owned orchestration.
36
+
37
+ ## Repository Customization
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.
41
+ - `.optima/policies/*.md`: overrides shared repository policy files used by multiple agents.
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.
44
+
45
+ ## Typical usage by task complexity
46
+
47
+ ### Tiny
48
+
49
+ - PMA routes directly to the most relevant specialist.
50
+ - Verification stays lightweight.
51
+ - Use a single primary slice.
52
+
53
+ ### Standard
54
+
55
+ - PMA orchestrates a bounded delivery sequence.
56
+ - One primary slice, with adjacent work only when necessary.
57
+ - Verification and documentation expectations remain normal.
58
+
59
+ ### Complex
60
+
61
+ - PMA links the task to an approved SCR.
62
+ - Architect helps decompose the work into slice-based subtasks.
63
+ - `workflow_runner` executes the end-to-end delivery cycle through specialist delegation while PMA waits for completion notification.
@@ -0,0 +1,44 @@
1
+ # Full Team Mode
2
+
3
+ Full team mode enables the complete Optima Collective.
4
+
5
+ ## Available Agents
6
+
7
+ - `product_manager` (PMA)
8
+ - `workflow_runner`
9
+ - `business_analyst` (BA)
10
+ - `technical_architect`
11
+ - `tech_lead`
12
+ - `developer`
13
+ - `qa_engineer`
14
+ - `ui_ux_designer`
15
+
16
+ ## Supported Work
17
+
18
+ - `tiny`
19
+ - `standard`
20
+ - `complex`
21
+
22
+ ## Full Team Task Flow
23
+
24
+ ```text
25
+ User request
26
+ -> PMA classifies task and track
27
+ -> BA + Tech Lead refine or review specification
28
+ -> For standard work, PMA orchestrates specialist handoffs directly
29
+ -> For complex work, PMA starts Workflow Runner in a separate session
30
+ -> Architect decomposes structural work into slices when needed
31
+ -> Developer / QA / UI-UX contribute by specialty
32
+ -> Workflow Runner or PMA returns evidence and completion state
33
+ -> PMA checks documentation closure
34
+ -> Commit and archive
35
+ ```
36
+
37
+ ## Full Team Responsibilities
38
+
39
+ - **PMA:** orchestration, routing, final closure
40
+ - **Workflow Runner:** separate-session orchestration for complex workflows
41
+ - **BA:** product truth and acceptance criteria
42
+ - **Technical Architect:** architecture and decomposition
43
+ - **Tech Lead:** technical leadership and behavioral verification
44
+ - **Developer / QA / UI-UX:** specialist execution and review
@@ -0,0 +1,41 @@
1
+ # Mini Team Mode
2
+
3
+ Mini team mode is the lightest supported Optima operating model.
4
+
5
+ ## Available Agents
6
+
7
+ - `product_manager` (PMA)
8
+ - `business_analyst` (BA)
9
+ - `tech_lead`
10
+
11
+ ## Supported Work
12
+
13
+ - `tiny`
14
+ - `standard`
15
+
16
+ Not supported:
17
+
18
+ - `complex`
19
+ - `workflow_runner`
20
+
21
+ ## Mini Team Task Flow
22
+
23
+ ```text
24
+ User request
25
+ -> PMA classifies task
26
+ -> BA clarifies requirements and product truth when needed
27
+ -> Tech Lead executes technical work
28
+ -> Tech Lead performs verification and review as separate task phases
29
+ -> PMA checks evidence and documentation closure
30
+ -> Commit and archive
31
+ ```
32
+
33
+ ## Mini Team Responsibilities
34
+
35
+ - **PMA:** orchestration, routing, closure, documentation closure verification
36
+ - **BA:** requirements, acceptance criteria, product documentation
37
+ - **Tech Lead:** implementation, technical verification, review, technical documentation
38
+
39
+ ## Escalation Rule
40
+
41
+ If the task clearly needs architecture decomposition, Workflow Runner orchestration, or broader specialist support, PMA should stop and ask to switch the repository to `full` team mode or rescope the work.
@@ -0,0 +1,117 @@
1
+ # Plugin Tools
2
+
3
+ This page documents the tools provided by the Optima plugin.
4
+
5
+ ## `optima_init`
6
+
7
+ Initializes Optima in the current repository.
8
+
9
+ ### Arguments
10
+
11
+ - `team_mode`: `mini` or `full`
12
+
13
+ ### What it creates
14
+
15
+ - `.optima/.config/optima.yaml`
16
+ - `.optima/policies/README.md`
17
+ - `.optima/agents/README.md`
18
+ - `.optima/agent-additions/README.md`
19
+ - `.optima/.config/generated/agents/README.md`
20
+ - `.optima/.config/generated/policies/README.md`
21
+ - `.optima/codemap.yml`
22
+ - `.optima/tasks/current.md`
23
+ - `.optima/tasks/done.md`
24
+ - `.optima/docs/scrs/current.md`
25
+ - `.optima/docs/scrs/done.md`
26
+ - `.gitignore` Optima local/private rules when the target is a git repository
27
+
28
+ ### Notes
29
+
30
+ - Full repository-local agent definitions or custom agents are optional and can be created later under `.optima/agents/`.
31
+ - Repository-specific additive agent instructions are optional and can be created later under `.optima/agent-additions/`.
32
+ - Generated prompt dumps go to `.optima/.config/generated/agents/` when `features.debug_dumps` is enabled.
33
+ - Generated reference policy files go to `.optima/.config/generated/policies/` when `policies.extract_defaults` is set to `all`.
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.
36
+
37
+ ## `optima_validate`
38
+
39
+ Validates Optima workflow artifacts and CodeMap integrity.
40
+
41
+ It checks things like:
42
+
43
+ - missing root `.optima/codemap.yml`
44
+ - invalid or broken codemap references
45
+ - missing codemaps in maintained source directories
46
+ - placeholder documentation problems
47
+ - hidden/tool-owned trees such as `.github/workflows/` are ignored
48
+
49
+ ## `optima_start_discussion`
50
+
51
+ Starts or reopens an automatic discussion transcript for the current session.
52
+
53
+ ### Arguments
54
+
55
+ Provide exactly one of:
56
+
57
+ - `title`: title for a new discussion
58
+ - `existing_discussion_id`: existing discussion ID to reopen
59
+
60
+ Also provide:
61
+
62
+ - `previous_message_count`: number of earlier **user and assistant** messages from the current session to include before live capture starts or before a discussion is reopened
63
+
64
+ ### Notes
65
+
66
+ - Use `0` if the discussion starts now.
67
+ - Use `existing_discussion_id` plus `previous_message_count` to reopen an older discussion and include a small amount of newer conversation that happened before the reopen call.
68
+ - Only one active discussion is allowed per session.
69
+ - While active, raw discussion transcripts are stored in `.optima/.config/runtime/discussions/`.
70
+ - The durable workflow artifact is written to `.optima/tasks/discussions/` when the discussion is stopped and summarized.
71
+ - Active discussion state is persisted in `.optima/.config/runtime/discussions.json`.
72
+ - Only discussion-capable agents should use these discussion tools.
73
+
74
+ ## `optima_stop_discussion`
75
+
76
+ Stops the automatic discussion transcript for the current session.
77
+
78
+ This tool performs the full close flow synchronously:
79
+
80
+ - marks the runtime transcript as summarizing
81
+ - invokes `business_analyst` with a blocking prompt to write the structured summary to `.optima/tasks/discussions/`
82
+ - verifies the summary file was written successfully
83
+ - archives the raw runtime transcript
84
+ - returns the final closed result from the tool call itself
85
+
86
+ ## `optima_run_workflow`
87
+
88
+ Starts a `workflow_runner` session for a complex task.
89
+
90
+ ### Arguments
91
+
92
+ - `task_path`: path to the task markdown file
93
+ - `instructions`: detailed instructions for the workflow runner
94
+
95
+ ### Notes
96
+
97
+ - Only available in `full` team mode.
98
+ - Used for `complex` implementation tasks.
99
+ - The runner executes in a separate session and reports completion back to PMA.
100
+ - The runner is expected to orchestrate the lifecycle by validating task readiness, delegating implementation and verification work to specialists, and driving the task to delivery or a hard blocker.
101
+ - For implementation tasks, the runner must create or append a Workflow Execution Plan in the task file after Pre-Task Sync and before implementation starts.
102
+ - The runner must not directly edit product source code, tests, application configuration, or implementation files.
103
+ - When a hard blocker is reached, the runner should end its run and return a final summary starting with `HARD BLOCKER:` so the plugin relays it back to the PMA session.
104
+
105
+ ## `optima_prompt_workflow`
106
+
107
+ Sends a follow-up prompt to an existing `workflow_runner` session.
108
+
109
+ ### Arguments
110
+
111
+ - `session_id`: workflow runner session ID
112
+ - `text`: follow-up message for that session
113
+
114
+ ### Notes
115
+
116
+ - Only available in `full` team mode.
117
+ - Useful for bounce-backs, clarifications, and resumed runner work.
@@ -0,0 +1,116 @@
1
+ # Workflow Usage
2
+
3
+ Optima uses three task complexity levels and three work tracks.
4
+
5
+ ## Complexity
6
+
7
+ - `tiny`: Minimal, low-risk work.
8
+ - `standard`: Default bounded delivery work.
9
+ - `complex`: Multi-step work that uses decomposition and the Workflow Runner.
10
+
11
+ ## Track
12
+
13
+ - `implementation`: Delivery work that changes code, tests, config, or linked docs.
14
+ - `investigation`: Discovery and debugging work intended to produce findings.
15
+ - `spec`: SCR and specification work.
16
+
17
+ ## Slice set
18
+
19
+ - `foundation`
20
+ - `core`
21
+ - `logic`
22
+ - `ui`
23
+ - `polish`
24
+ - `qa`
25
+ - `docs`
26
+
27
+ ## Routing rules
28
+
29
+ - Prefer `tiny` when one specialist can complete the task in one slice with lightweight verification.
30
+ - Use `standard` for the normal delivery path when a task is still bounded and does not require decomposition.
31
+ - Use `complex` when the work needs an approved SCR, multiple handoffs, or slice-based subtasks.
32
+
33
+ ## SCR Requirement Rules
34
+
35
+ - `tiny` + `implementation` + non-behavioral change: SCR optional, `scr: null` allowed
36
+ - `standard` + `implementation`: SCR required
37
+ - `complex` + `implementation`: SCR required
38
+ - `spec`: SCR required by definition
39
+ - `investigation`: SCR optional unless the work is already formalizing a proposed change
40
+
41
+ ## Team modes
42
+
43
+ - `mini`: supports `tiny` and `standard` only, using `product_manager`, `business_analyst`, and `tech_lead`
44
+ - `full`: supports `tiny`, `standard`, and `complex`, including `workflow_runner`
45
+
46
+ See also:
47
+
48
+ - `docs/guides/TEAM_MODE_MINI.md`
49
+ - `docs/guides/TEAM_MODE_FULL.md`
50
+
51
+ ## Current parallelism rule
52
+
53
+ - One shared-worktree implementation task may run at a time.
54
+ - Investigation and spec tasks may run in parallel when they avoid conflicting edits.
55
+
56
+ ## Task metadata
57
+
58
+ Task files use lightweight frontmatter to record only durable workflow fields. Use `scr: null` only for `tiny` work that does not change product behavior or shared specifications.
59
+
60
+ ```yaml
61
+ ---
62
+ id: TASK-001
63
+ complexity: standard
64
+ track: implementation
65
+ slice: logic
66
+ status: todo
67
+ scr: SCR-001
68
+ parent: null
69
+ assigned_to: product_manager
70
+ handoff_from: null
71
+ ---
72
+ ```
73
+
74
+ When PMA, BA, or Tech Lead need to hand workflow-relevant discussion context to one another, use a normal task file with:
75
+
76
+ - `assigned_to` set to the next responsible agent
77
+ - `handoff_from` set to the agent creating the handoff
78
+ - a detailed `Discussion Record` section in the task body
79
+
80
+ Track these task files under `Active Discussions` in `.optima/tasks/current.md` until they resolve into execution, SCR work, clarification, or closure.
81
+
82
+ ## Reopen And Resume
83
+
84
+ - If a task was thought to be done but later needs discrepancies fixed or minor same-scope changes, reopen the same task instead of creating a new one.
85
+ - Move it back into `Active` in `.optima/tasks/current.md`.
86
+ - Keep the same task file ID and record the reason in `Reopen History`.
87
+ - Reuse the same Task tool `task_id` for delegated task work when possible.
88
+ - If the task used `workflow_runner`, reuse both the same Task tool `task_id` and the same Workflow Runner `session_id` when possible.
89
+
90
+ ## Evidence By Track
91
+
92
+ - `implementation`: produce the normal evidence packet, including logs, screenshots when relevant, and AC coverage.
93
+ - `investigation`: produce findings, reproduction notes, logs when useful, and a recommended next step.
94
+ - `spec`: produce SCR and documentation updates that capture the accepted change definition and product/architecture impact.
95
+
96
+ SCR files use similarly lightweight frontmatter:
97
+
98
+ ```yaml
99
+ ---
100
+ id: SCR-001
101
+ status: proposed
102
+ tasks: []
103
+ ---
104
+ ```
105
+
106
+ ## Documentation lookup
107
+
108
+ When deciding where documentation belongs:
109
+
110
+ - use `docs/product/` for whole-product truth
111
+ - use `docs/domains/` for stable product areas that contain multiple features
112
+ - use `docs/features/` for one concrete capability
113
+ - use `docs/architecture/` for technical design and cross-cutting engineering decisions
114
+ - use `.optima/docs/scrs/` for proposed and approved changes, not steady-state truth
115
+
116
+ See `docs/core/documentation_structure.md` for the canonical rules.
@@ -0,0 +1,8 @@
1
+ scope: module
2
+ parent: ../codemap.yml
3
+ sources_of_truth:
4
+ - path: AGENTS.md
5
+ - path: TEAM_MODE_FULL.md
6
+ - path: TEAM_MODE_MINI.md
7
+ - path: TOOLS.md
8
+ - path: WORKFLOW.md
@@ -0,0 +1,41 @@
1
+ # Domain Map
2
+
3
+ This document maps the major product domains and the features that belong to them.
4
+
5
+ ## How To Use This File
6
+
7
+ - Add a new domain entry when the product introduces a stable new area of responsibility.
8
+ - Link each feature to one primary domain.
9
+ - Keep this file at the summary level. Put detailed rules and workflows into `docs/domains/<domain>/`.
10
+
11
+ ## Domain Entries
12
+
13
+ ### Agent Orchestration
14
+
15
+ - **Purpose:** Defines how PMA, Workflow Runner, and specialist agents collaborate.
16
+ - **Owned Features:** Product Manager routing, Workflow Runner handoff, specialist delegation, discussion protocols.
17
+ - **Primary Docs:** `docs/guides/AGENTS.md`, `docs/core/agent_orchestration.md`
18
+
19
+ ### Task Lifecycle
20
+
21
+ - **Purpose:** Defines how tasks are classified, discussed, executed, verified, and archived.
22
+ - **Owned Features:** `tiny` / `standard` / `complex` routing, pre-sync quorum rules, task templates, evidence expectations.
23
+ - **Primary Docs:** `docs/domains/task-lifecycle/OVERVIEW.md`, `docs/core/task_model.md`, `.optima/tasks/task-template.md`
24
+
25
+ ### Documentation System
26
+
27
+ - **Purpose:** Defines how product, domain, feature, and architecture truth is organized and maintained.
28
+ - **Owned Features:** documentation hierarchy, ownership model, domain map maintenance, feature specification placement.
29
+ - **Primary Docs:** `docs/core/documentation_structure.md`, `docs/product/FEATURES_LIST.md`
30
+
31
+ ### Validation And Navigation
32
+
33
+ - **Purpose:** Keeps the repository navigable and structurally correct for humans and agents.
34
+ - **Owned Features:** CodeMap validation, local knowledge rule, source indexing, placeholder detection.
35
+ - **Primary Docs:** `docs/core/codemap_conventions.md`, `codemap.yml`
36
+
37
+ ### Plugin Setup And Configuration
38
+
39
+ - **Purpose:** Defines how Optima is installed, configured, and enabled in an OpenCode environment.
40
+ - **Owned Features:** plugin installation, OpenCode config wiring, `optima.yaml`, repo-local agent definitions, agent additions, policy overrides.
41
+ - **Primary Docs:** `docs/setup/INSTALLATION.md`, `docs/setup/CONFIGURATION.md`