oh-my-opencode-lite 0.1.0 → 0.1.2

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.
@@ -17,7 +17,7 @@ task progress durable, ordered, and verifiable.
17
17
  - `~/.config/opencode/skills/_shared/persistence-contract.md`
18
18
  - `~/.config/opencode/skills/_shared/thoth-mem-convention.md`
19
19
 
20
- ## Ownership Model
20
+ ## Progress Tracking Invariants
21
21
 
22
22
  The orchestrator owns task progress tracking.
23
23
 
@@ -26,12 +26,23 @@ The orchestrator owns task progress tracking.
26
26
  received and verified.
27
27
  - The orchestrator marks `- [-]` with a clear reason when a task is skipped or
28
28
  fails after escalation.
29
+ - Sub-agents execute assigned work and return structured results. They do not
30
+ own checkbox updates.
31
+ - Never batch-update multiple checkboxes at once.
32
+ - Never proceed without updating the current task state first.
33
+ - Re-read the canonical tasks artifact after each edit to confirm persistence.
34
+ - Persistence mode determines target stores: `openspec` → file only,
35
+ `thoth-mem` → memory only, `hybrid` → both. Never skip a store that the
36
+ active mode requires.
29
37
  - `openspec/` files are coordination artifacts, not source code. The
30
38
  orchestrator may read and edit them directly for progress tracking and state
31
- management.
32
-
33
- Sub-agents execute assigned work and return structured results. They do not own
34
- checkbox updates.
39
+ management only when the active mode includes openspec artifacts.
40
+ - Task state updates are NOT optional and NOT deferred — they happen in
41
+ real-time as execution proceeds.
42
+ - Every state transition (pending→in-progress, in-progress→completed,
43
+ in-progress→skipped) MUST be persisted BEFORE moving on.
44
+ - Real-time tracking is a hard invariant, not a best practice. Deferred or
45
+ batched updates are a protocol violation.
35
46
 
36
47
  ## When to Use
37
48
 
@@ -43,16 +54,19 @@ checkbox updates.
43
54
 
44
55
  ### Phase 1: Load
45
56
 
46
- 1. Scan `openspec/changes/` for active changes.
47
- 2. Read `tasks.md` and find the first unchecked task in state `- [ ]` or
48
- `- [~]`.
49
- 3. Build a mental model of the plan: total tasks, remaining work,
57
+ 1. Determine the artifact store mode from config before reading or writing any
58
+ SDD artifacts.
59
+ 2. Load task artifacts using mode-aware retrieval:
60
+ - `openspec`/`hybrid`: scan `openspec/changes/` for active changes and read
61
+ `tasks.md`.
62
+ - `thoth-mem`: recover tasks via 3-layer recall
63
+ (`search` → `timeline` → `get_observation`) using topic key
64
+ `sdd/{change-name}/tasks`.
65
+ 3. Find the first unchecked task in state `- [ ]` or `- [~]`.
66
+ 4. Build a mental model of the plan: total tasks, remaining work,
50
67
  parallelizable work, and dependency order.
51
- 4. Load SDD context from the change directory plus thoth-mem fallback using the
52
- retrieval protocol in
68
+ 5. Load remaining SDD context using mode-aware retrieval in
53
69
  `~/.config/opencode/skills/_shared/persistence-contract.md`.
54
- 5. Determine the artifact store mode from config before reading or writing any
55
- SDD artifacts.
56
70
 
57
71
  ### Phase 2: Execute Each Task
58
72
 
@@ -185,20 +199,15 @@ Treat missing sections or vague summaries as incomplete execution results.
185
199
 
186
200
  To resume safely:
187
201
 
188
- 1. Read `openspec/changes/` to identify active changes.
189
- 2. Read `openspec/changes/{change-name}/tasks.md` and inspect checkbox state.
190
- 3. If the mode includes thoth-mem, recover `sdd/{change-name}/apply-progress`
191
- and `sdd/{change-name}/tasks` with the exact topic-key protocol.
192
- 4. Resume from the first task marked `- [ ]` or `- [~]`.
193
-
194
- ## Progress Tracking Rules
195
-
196
- 1. Before dispatching, change `- [ ]` to `- [~]`.
197
- 2. After verified completion, change `- [~]` to `- [x]`.
198
- 3. After 3 retries, change the task to `- [-]` and add the explicit reason.
199
- 4. Never batch-update multiple checkboxes at once.
200
- 5. Never proceed without updating the current task state first.
201
- 6. Re-read `tasks.md` after each edit to confirm persistence.
202
+ 1. Determine the artifact store mode from config.
203
+ 2. Recover task state using mode-aware retrieval:
204
+ - `openspec`: read `openspec/changes/{change-name}/tasks.md`.
205
+ - `thoth-mem`: recover `sdd/{change-name}/tasks` and
206
+ `sdd/{change-name}/apply-progress` via 3-layer recall
207
+ (`search` → `timeline` → `get_observation`).
208
+ - `hybrid`: do both recovery paths and prefer thoth-mem as the source of
209
+ truth if state diverges.
210
+ 3. Resume from the first task marked `- [ ]` or `- [~]`.
202
211
 
203
212
  ## Guardrails
204
213
 
@@ -0,0 +1,192 @@
1
+ ---
2
+ name: requirements-interview
3
+ description: >
4
+ Mandatory step-0 requirements discovery for non-trivial work before any
5
+ implementation or SDD routing decisions.
6
+ metadata:
7
+ author: oh-my-opencode-lite
8
+ version: '1.0'
9
+ ---
10
+
11
+ # Requirements Interview Skill
12
+
13
+ Use this skill as the mandatory step-0 entry point for non-trivial requests.
14
+ The goal is requirement clarity, scope calibration, and a user-approved
15
+ handoff path before implementation begins.
16
+
17
+ ## Shared Conventions
18
+
19
+ - `~/.config/opencode/skills/_shared/openspec-convention.md`
20
+ - `~/.config/opencode/skills/_shared/persistence-contract.md`
21
+ - `~/.config/opencode/skills/_shared/thoth-mem-convention.md`
22
+
23
+ ## HARD GATE
24
+
25
+ - Do not implement during the requirements interview.
26
+ - Do not write code.
27
+ - Do not patch files.
28
+ - Do not create formal SDD artifacts until the user approves the route.
29
+
30
+ ## Question Tool Requirement
31
+
32
+ - The interview flow MUST use the built-in `question` tool for user-input
33
+ prompts.
34
+ - Do not embed interview questions as plain prose in normal response text.
35
+ - Prefer one focused question-tool call at a time for the core interview loop.
36
+ - Use short headers (<=30 chars), concise option labels, and concrete
37
+ descriptions.
38
+ - Put the recommended option first and include `(Recommended)` in that label.
39
+ - Do not add an `Other` option manually; rely on `custom: true` unless custom
40
+ input must be disabled.
41
+ - Use `multiple: true` only when multiple simultaneous selections are genuinely
42
+ valid.
43
+
44
+ ## Workflow
45
+
46
+ ### Phase 1: Discovery Context Gathering
47
+
48
+ 1. Always dispatch `@explorer` for codebase context. Dispatch `@librarian`
49
+ only when the request involves external APIs, dependency versions, library
50
+ migration, or public documentation.
51
+ 2. Collect only the minimum context needed to improve questions and reduce
52
+ user repetition.
53
+ 3. Prefer facts from the codebase and known references over asking the user
54
+ for information the environment can answer.
55
+
56
+ ### Phase 2: Requirements Interview
57
+
58
+ 1. Ask each interview question through the `question` tool.
59
+ 2. Ask 1 question-tool call at a time.
60
+ 3. Ask at most 5 total questions.
61
+ 4. Prefer multiple-choice questions when practical.
62
+ 5. Stop early when clarity is already sufficient.
63
+ 6. Focus on what the user truly needs, not only the first phrasing of the
64
+ request.
65
+ 7. Surface unstated assumptions and validate them with the user.
66
+ 8. Guide the user toward potentially better options when appropriate, but never
67
+ impose a decision.
68
+ 9. Always ask and confirm; never choose on the user's behalf.
69
+ 10. Do not ask for details that the codebase, task artifacts, or gathered
70
+ context already answer.
71
+
72
+ ### Phase 3: Complexity Assessment
73
+
74
+ Evaluate these 6 dimensions. Rate each as **Low**, **Medium**, or **High**:
75
+
76
+ | Dimension | Low | Medium | High |
77
+ | --- | --- | --- | --- |
78
+ | **Logic depth** | Copy, CSS, rename, simple wiring | Localized behavior tweak, validation, one workflow step | Algorithm, state-machine, or business-rule rewrite with many invariants |
79
+ | **Contract sensitivity** | Presentation only, internal refactor | User-visible behavior change in one flow | API, schema, data model, migration, auth, privacy, or public contract |
80
+ | **Context span** | Can be done in one bounded pass | Several dependent edits or choices to coordinate | Many sequential steps where earlier decisions must be remembered |
81
+ | **Discovery need** | Request and acceptance criteria are already clear | Some ambiguity, a few viable approaches | Goal is clear but solution requires investigation or tradeoff analysis |
82
+ | **Failure cost** | Mistakes are obvious and cheap to revert | Needs integration or regression checks | Subtle correctness bugs, customer-facing, data, or compliance impact |
83
+ | **Concern coupling** | Single concern | Two related concerns | Multiple independent concerns that could conflict |
84
+
85
+ ### Phase 4: Approach Proposal
86
+
87
+ 1. Present 2-3 viable options as recommendations, not decisions.
88
+ 2. For each option, give the main trade-offs and when it is a good fit.
89
+ 3. Mark one option as the current recommendation and explain why.
90
+ 4. Use the `question` tool to confirm the preferred approach before moving on.
91
+
92
+ ### Phase 5: User Approval Gate
93
+
94
+ Present:
95
+
96
+ - Summary of understanding
97
+ - Scope classification and why
98
+ - Recommended approach options
99
+ - Proposed handoff path
100
+
101
+ Then wait for explicit user confirmation.
102
+
103
+ Use the `question` tool for this approval gate.
104
+
105
+ Nothing proceeds without explicit approval in this phase. The user is the sole
106
+ approver during requirements discovery. Do not request oracle review here.
107
+
108
+ ### Phase 6: Handoff
109
+
110
+ Recommend a route based on the complexity assessment, then wait for the
111
+ user to confirm it:
112
+
113
+ **Direct implementation** — when all of:
114
+ - No dimensions rated High
115
+ - At most one dimension rated Medium
116
+ - Contract sensitivity is Low
117
+ - Failure cost is Low
118
+
119
+ **Accelerated SDD** (`propose -> tasks`) — when:
120
+ - 2-3 dimensions are Medium, or
121
+ - 1 dimension is High in logic depth, context span, or discovery need
122
+ - But contract sensitivity and failure cost are not High
123
+
124
+ **Full SDD** (`propose -> spec -> design -> tasks`) — when any of:
125
+ - Contract sensitivity is High
126
+ - Failure cost is High
127
+ - 2 or more dimensions are High
128
+ - Discovery need is High and at least one other dimension is
129
+ Medium or High
130
+ - Concern coupling is High with risk of conflicting decisions
131
+
132
+ Quick decision heuristics:
133
+
134
+ 1. Cosmetic work routes direct regardless of file count.
135
+ 2. Dense logic rewrites route to at least accelerated SDD regardless
136
+ of file count.
137
+ 3. External contracts (API, schema, migration, auth, privacy) usually
138
+ need full SDD.
139
+ 4. If the model must remember decisions across many steps, write them
140
+ down — that means SDD.
141
+ 5. Tie-breaker: unsure between direct and accelerated, choose
142
+ accelerated. Unsure between accelerated and full, ask: 'Do we
143
+ need a durable behavior contract?' If yes, full SDD.
144
+
145
+ Before any SDD generation starts, present the artifact store policy choice:
146
+
147
+ ```text
148
+ How would you like to persist planning artifacts?
149
+ 1. none — No persistence. Ephemeral exploration, privacy-sensitive work, or when no backend is available. Results are inline only and not saved across sessions.
150
+ 2. thoth-mem — Memory only. Lightest token cost. No repo files.
151
+ 3. openspec — Repo files only. Visible and reviewable.
152
+ 4. hybrid — Both. Maximum durability, higher token cost.
153
+ Default: hybrid
154
+ ```
155
+
156
+ Collect this choice with the `question` tool rather than plain prose.
157
+
158
+ When the user selects a mode that includes OpenSpec (`openspec` or `hybrid`),
159
+ verify that `openspec/` is initialized. If it is not, recommend running
160
+ `sdd-init` before proceeding:
161
+ `~/.config/opencode/skills/sdd-init/SKILL.md`
162
+
163
+ Once route, persistence mode, and initialization are confirmed, hand off to the
164
+ corresponding SDD pipeline phase:
165
+
166
+ - **Propose**: `~/.config/opencode/skills/sdd-propose/SKILL.md`
167
+ - **Spec** (full SDD only): `~/.config/opencode/skills/sdd-spec/SKILL.md`
168
+ - **Design** (full SDD only): `~/.config/opencode/skills/sdd-design/SKILL.md`
169
+ - **Tasks**: `~/.config/opencode/skills/sdd-tasks/SKILL.md`
170
+
171
+ Do not silently choose the handoff route or artifact store mode. Recommend,
172
+ ask, and wait.
173
+
174
+ ## Guardrails
175
+
176
+ - Maximum 5 interview questions.
177
+ - Ask only one question-tool call at a time.
178
+ - Do not ask what codebase context can answer.
179
+ - Do not skip explicit user approval.
180
+ - Do not auto-select the handoff route.
181
+ - Do not auto-select the persistence mode.
182
+ - Never convert recommendations into unilateral decisions.
183
+ - Do not replace question-tool prompts with plain-text interview questions.
184
+
185
+ ## Anti-Patterns
186
+
187
+ - Question dumping
188
+ - Option inflation
189
+ - Premature implementation
190
+ - Silent route selection
191
+ - Silent persistence-mode selection
192
+ - Treating discovery as optional
@@ -65,29 +65,20 @@ rules per mode.
65
65
 
66
66
  ## Response Format
67
67
 
68
- Return a structured result to the orchestrator:
68
+ Return a structured result to the orchestrator using the Task Result envelope:
69
69
 
70
70
  **Status**: completed | failed | partial
71
71
  **Task**: {task reference}
72
- **What was done**: {list of concrete changes}
73
- **Files changed**: {paths with descriptions}
74
- **Verification**: {check results}
75
- **Issues**: {any problems encountered}
76
- **Failure/Skip reason**: {if applicable}
72
+
73
+ **What was done**: concrete list of changes
74
+ **Files changed**: paths with descriptions
75
+ **Verification**: check results (passed/failed)
76
+ **Issues**: problems encountered with severity
77
+ **Failure/Skip reason**: if applicable
77
78
 
78
79
  Progress tracking (checkbox state updates) is managed by the orchestrator
79
80
  via the `executing-plans` skill. Do not update task checkboxes yourself.
80
81
 
81
- ## Output Format
82
-
83
- Return:
84
-
85
- - `Change`
86
- - `Completed Tasks`: assigned items completed or partially completed
87
- - `Files Changed`: concise table or bullets
88
- - `Progress Topic Key`: `sdd/{change-name}/apply-progress` when applicable
89
- - `Remaining Work`: next known pending work or blockers
90
-
91
82
  ## Rules
92
83
 
93
84
  - Read specs before implementing; they are the acceptance contract.
@@ -97,5 +88,4 @@ Return:
97
88
  - Retrieve every SDD dependency with the mode-aware protocol in
98
89
  `~/.config/opencode/skills/_shared/persistence-contract.md`.
99
90
  - Return structured execution evidence to the orchestrator so it can manage task
100
- state correctly.
101
- - Never reference engram.
91
+ state correctly.
@@ -91,4 +91,3 @@ Return:
91
91
  - Use the retrieval protocol in
92
92
  `~/.config/opencode/skills/_shared/persistence-contract.md` for every
93
93
  dependency.
94
- - Never reference engram.
@@ -101,4 +101,3 @@ Return:
101
101
  - Keep implementation details aligned with the spec and repository patterns.
102
102
  - Retrieve full dependencies with the protocol in
103
103
  `~/.config/opencode/skills/_shared/persistence-contract.md`.
104
- - Never reference engram.
@@ -0,0 +1,157 @@
1
+ ---
2
+ name: sdd-init
3
+ description: Bootstrap OpenSpec structure and SDD context for a project.
4
+ metadata:
5
+ author: gentleman-programming
6
+ version: "1.0"
7
+ ---
8
+
9
+ # SDD Init Skill
10
+
11
+ Initialize SDD for a project by detecting local conventions, creating the
12
+ minimal OpenSpec structure when needed, and persisting startup context.
13
+
14
+ ## Shared Conventions
15
+
16
+ - Shared references:
17
+ - `~/.config/opencode/skills/_shared/openspec-convention.md`
18
+ - `~/.config/opencode/skills/_shared/persistence-contract.md`
19
+ - `~/.config/opencode/skills/_shared/thoth-mem-convention.md`
20
+
21
+ ## Persistence Mode
22
+
23
+ The orchestrator passes the artifact store mode (`thoth-mem`, `openspec`, or
24
+ `hybrid`). Follow
25
+ `~/.config/opencode/skills/_shared/persistence-contract.md` for read/write
26
+ rules per mode.
27
+
28
+ - `thoth-mem`: persist initialization context to thoth-mem only — do NOT create
29
+ or modify `openspec/` files.
30
+ - `openspec`: create or update OpenSpec structure only — do NOT call thoth-mem
31
+ save tools.
32
+ - `hybrid`: do both (default).
33
+
34
+ ## When to Use
35
+
36
+ - SDD is needed but `openspec/` is not initialized
37
+ - A new project needs initial OpenSpec conventions
38
+ - The team wants detected stack/context captured before `sdd-propose`
39
+
40
+ ## Prerequisites
41
+
42
+ - Project root path
43
+ - Project name
44
+ - Selected persistence mode (default: `hybrid`)
45
+
46
+ ## Workflow
47
+
48
+ 1. Read the shared conventions before initializing.
49
+ 2. Detect project stack and conventions from repository files:
50
+ - Stack indicators: `package.json`, `go.mod`, `pyproject.toml`,
51
+ `requirements.txt`, `Cargo.toml`, `pom.xml`, `build.gradle`,
52
+ `composer.json`.
53
+ - Testing indicators: `vitest.config.*`, `jest.config.*`,
54
+ `playwright.config.*`, `pytest.ini`, `tox.ini`, `go test` conventions,
55
+ `Cargo.toml` test crates.
56
+ - Style indicators: `biome.json`, `.eslintrc*`, `eslint.config.*`,
57
+ `.prettierrc*`, `ruff.toml`, `.golangci.*`, `rustfmt.toml`.
58
+ - CI indicators: `.github/workflows/*`, `.gitlab-ci.yml`,
59
+ `azure-pipelines.yml`, `.circleci/config.yml`.
60
+ - Architecture hints: common layout markers such as `apps/`, `packages/`,
61
+ `services/`, `src/`, `cmd/`, `internal/`.
62
+ 3. Build concise config context (max 10 lines) using detected values. Use
63
+ `unknown` for missing signals.
64
+ 4. If the selected mode includes OpenSpec (`openspec` or `hybrid`), check
65
+ whether these already exist:
66
+ - `openspec/config.yaml`
67
+ - `openspec/specs/`
68
+ - `openspec/changes/`
69
+ 5. If all required OpenSpec paths already exist, report what exists and ask the
70
+ orchestrator whether `config.yaml` should be updated. Do not overwrite by
71
+ default.
72
+ 6. If any required OpenSpec path is missing and mode includes OpenSpec, create
73
+ only the minimum structure:
74
+
75
+ ```text
76
+ openspec/
77
+ ├── config.yaml
78
+ ├── specs/
79
+ └── changes/
80
+ └── archive/
81
+ ```
82
+
83
+ 7. Generate `openspec/config.yaml` dynamically with this shape:
84
+
85
+ ```yaml
86
+ schema: spec-driven
87
+
88
+ context: |
89
+ Tech stack: {detected}
90
+ Architecture: {detected}
91
+ Testing: {detected}
92
+ Style: {detected}
93
+
94
+ rules:
95
+ proposal:
96
+ - Include rollback plan for risky changes
97
+ - Identify affected modules/packages
98
+ specs:
99
+ - Use Given/When/Then format for scenarios
100
+ - Use RFC 2119 keywords (MUST, SHALL, SHOULD, MAY)
101
+ design:
102
+ - Include sequence diagrams for complex flows
103
+ - Document architecture decisions with rationale
104
+ tasks:
105
+ - Group tasks by phase (infrastructure, implementation, testing)
106
+ - Use hierarchical numbering (1.1, 1.2, etc.)
107
+ - Keep tasks small enough to complete in one session
108
+ apply:
109
+ - Follow existing code patterns and conventions
110
+ tdd: false
111
+ test_command: ''
112
+ verify:
113
+ test_command: ''
114
+ build_command: ''
115
+ coverage_threshold: 0
116
+ archive:
117
+ - Warn before merging destructive deltas
118
+ ```
119
+
120
+ 8. Never create placeholder SDD artifacts (`proposal.md`, `design.md`,
121
+ `tasks.md`, or spec files) during initialization.
122
+ 9. If the selected mode includes thoth-mem (`thoth-mem` or `hybrid`), persist
123
+ the detected context and initialization status with:
124
+
125
+ ```text
126
+ thoth_mem_mem_save(
127
+ title: "sdd-init/{project-name}",
128
+ topic_key: "sdd-init/{project-name}",
129
+ type: "config",
130
+ project: "{project-name}",
131
+ scope: "project",
132
+ content: "What: ...\nWhy: ...\nWhere: ...\nLearned: ..."
133
+ )
134
+ ```
135
+
136
+ 10. In `hybrid` mode, initialization is complete only when both OpenSpec setup
137
+ and thoth-mem persistence succeed.
138
+
139
+ ## Output Format
140
+
141
+ Return:
142
+
143
+ - `Project`
144
+ - `Mode`
145
+ - `Detected Context`: stack, architecture, testing, style, CI
146
+ - `OpenSpec Status`: initialized, already initialized, or skipped by mode
147
+ - `Created Paths`: list of directories/files created (if any)
148
+ - `Topic Key`: `sdd-init/{project-name}` when mode includes thoth-mem
149
+ - `Next Step`: usually `sdd-propose`
150
+
151
+ ## Rules
152
+
153
+ - Be idempotent: if OpenSpec already exists, report and ask before updates.
154
+ - In `thoth-mem` mode, never create `openspec/` directories or files.
155
+ - Keep `config.yaml` context concise (max 10 lines).
156
+ - Detect and include CI, test, and style conventions in the context summary.
157
+ - Never create placeholder spec/change files during init.
@@ -95,5 +95,6 @@ Return a short report with:
95
95
  - Keep the proposal focused on why, scope, and success criteria.
96
96
  - Always include rollback guidance and explicit out-of-scope items.
97
97
  - Never reference engram.
98
- - Never rely on a `thoth_mem_mem_search` preview without calling
99
- `thoth_mem_mem_get_observation` when the selected mode uses thoth-mem.
98
+ - Never rely on `thoth_mem_mem_search` output alone when the mode uses
99
+ thoth-mem. Follow the 3-layer recall protocol: `search(mode: "compact")`
100
+ `timeline` → `get_observation` to retrieve the full artifact body.
@@ -101,5 +101,4 @@ Return:
101
101
  - Keep domain boundaries explicit.
102
102
  - Use the retrieval protocol from
103
103
  `~/.config/opencode/skills/_shared/persistence-contract.md` for every SDD
104
- dependency.
105
- - Never reference engram.
104
+ dependency.
@@ -113,4 +113,3 @@ Return:
113
113
  - Do not create vague tasks such as “implement feature”.
114
114
  - Retrieve all dependencies through the mode-aware protocol in
115
115
  `~/.config/opencode/skills/_shared/persistence-contract.md`.
116
- - Never reference engram.
@@ -99,4 +99,3 @@ Return:
99
99
  - Do not fix issues inside this phase; report them.
100
100
  - Recover full artifacts with the protocol in
101
101
  `~/.config/opencode/skills/_shared/persistence-contract.md`.
102
- - Never reference engram.
@@ -1,120 +0,0 @@
1
- ---
2
- name: brainstorming
3
- description: Clarify ambiguous work, assess scope, and choose the right planning path before implementation.
4
- metadata:
5
- author: oh-my-opencode-lite
6
- version: '1.0'
7
- ---
8
-
9
- # Brainstorming Skill
10
-
11
- Use this skill to understand what should be built before implementation starts.
12
- The goal is clarity, scope calibration, and a user-approved handoff.
13
-
14
- ## Shared Conventions
15
-
16
- - `~/.config/opencode/skills/_shared/thoth-mem-convention.md`
17
- - `~/.config/opencode/skills/_shared/persistence-contract.md`
18
-
19
- ## HARD GATE
20
-
21
- - Do not implement during brainstorming.
22
- - Do not write code.
23
- - Do not patch files.
24
- - Do not create formal SDD artifacts until the user approves the route.
25
-
26
- ## Workflow
27
-
28
- ### Phase 1: Context Gathering
29
-
30
- 1. Dispatch `@explorer` and `@librarian` in parallel for codebase and external
31
- context.
32
- 2. Collect only the minimum context needed to improve questions and reduce user
33
- repetition.
34
- 3. Prefer facts from the codebase and known references over asking the user for
35
- information the environment can answer.
36
-
37
- ### Phase 2: Interview
38
-
39
- 1. Ask 1 question at a time.
40
- 2. Ask at most 5 total questions.
41
- 3. Prefer multiple-choice questions when practical.
42
- 4. Stop early when clarity is already sufficient.
43
- 5. Do not ask for details that the codebase, task artifacts, or gathered
44
- context already answer.
45
-
46
- ### Phase 3: Scope Assessment
47
-
48
- Evaluate these 7 scope signals:
49
-
50
- 1. Multiple views, pages, or user flows
51
- 2. New or modified API endpoints, queries, or data models
52
- 3. Restructuring existing functionality
53
- 4. Affects multiple layers such as frontend and backend, or UI and logic and
54
- data
55
- 5. Described in business or UX terms instead of specific code changes
56
- 6. Scope is ambiguous or open-ended
57
- 7. Would likely touch 3 or more files across different directories
58
-
59
- Signal mapping:
60
-
61
- - `0-1` = trivial
62
- - `2-4` = medium
63
- - `5+` = complex
64
-
65
- ### Phase 4: Approach Proposal
66
-
67
- 1. Present 2-3 viable options.
68
- 2. For each option, give the main trade-offs.
69
- 3. Mark one option as the recommendation.
70
- 4. Ask the user to confirm the preferred approach before moving on.
71
-
72
- ### Phase 5: User Approval
73
-
74
- Present:
75
-
76
- - Summary of understanding
77
- - Scope classification and why
78
- - Recommended approach
79
- - Proposed handoff path
80
-
81
- Then wait for explicit user approval.
82
-
83
- The user is the sole approver during brainstorming. Do not request oracle
84
- review here.
85
-
86
- ### Phase 6: Handoff
87
-
88
- Recommend a route based on complexity, then wait for the user to confirm it:
89
-
90
- - Trivial (`1-2` files): direct implementation
91
- - Medium (`3-7` files): accelerated SDD (`propose -> tasks`)
92
- - Complex (`8+` files): full SDD (`propose -> spec -> design -> tasks`)
93
-
94
- Before any SDD generation starts, present the artifact store policy choice:
95
-
96
- ```text
97
- How would you like to persist planning artifacts?
98
- 1. thoth-mem — Memory only. Lightest token cost. No repo files.
99
- 2. openspec — Repo files only. Visible and reviewable.
100
- 3. hybrid — Both. Maximum durability, higher token cost.
101
- Default: hybrid
102
- ```
103
-
104
- Do not silently choose the handoff route or artifact store mode. Recommend, ask,
105
- and wait.
106
-
107
- ## Guardrails
108
-
109
- - Maximum 5 interview questions.
110
- - Ask only one question at a time.
111
- - Do not ask what codebase context can answer.
112
- - Do not skip explicit user approval.
113
- - Do not auto-select the handoff route.
114
-
115
- ## Anti-Patterns
116
-
117
- - Question dumping
118
- - Option inflation
119
- - Premature implementation
120
- - Silent route selection