@comfanion/workflow 4.1.3 → 4.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -2
- package/bin/cli.js +343 -5
- package/package.json +8 -3
- package/src/build-info.json +2 -1
- package/src/opencode/ARCHITECTURE.md +7 -6
- package/src/opencode/FLOW.yaml +157 -102
- package/src/opencode/agents/analyst.md +24 -20
- package/src/opencode/agents/architect.md +104 -39
- package/src/opencode/agents/change-manager.md +112 -250
- package/src/opencode/agents/coder.md +36 -19
- package/src/opencode/agents/crawler.md +180 -97
- package/src/opencode/agents/dev.md +117 -29
- package/src/opencode/agents/pm.md +25 -32
- package/src/opencode/agents/researcher.md +116 -241
- package/src/opencode/commands/architecture.md +1 -1
- package/src/opencode/commands/dev-story.md +1 -5
- package/src/opencode/commands/prd.md +1 -1
- package/src/opencode/commands/unit-docs.md +170 -0
- package/src/opencode/config.yaml +29 -0
- package/src/opencode/opencode.json +5 -0
- package/src/opencode/skills/adr-writing/SKILL.md +122 -159
- package/src/opencode/skills/adr-writing/template.md +130 -0
- package/src/opencode/skills/architecture-design/SKILL.md +113 -107
- package/src/opencode/skills/architecture-design/template.md +212 -0
- package/src/opencode/skills/architecture-validation/SKILL.md +1 -1
- package/src/opencode/skills/changelog/template.md +23 -0
- package/src/opencode/{workflows/dev-story/instructions.md → skills/dev-story/SKILL.md} +2 -2
- package/src/opencode/skills/epic-writing/SKILL.md +116 -264
- package/src/opencode/skills/epic-writing/template.md +119 -0
- package/src/opencode/skills/prd-validation/SKILL.md +1 -1
- package/src/opencode/skills/prd-writing/SKILL.md +79 -43
- package/src/opencode/skills/prd-writing/template.md +147 -0
- package/src/opencode/skills/requirements-gathering/SKILL.md +128 -78
- package/src/opencode/skills/requirements-gathering/template.md +156 -0
- package/src/opencode/skills/story-writing/SKILL.md +106 -464
- package/src/opencode/skills/story-writing/template.md +214 -0
- package/src/opencode/skills/unit-writing/SKILL.md +185 -0
- package/src/opencode/skills/unit-writing/template.md +136 -0
- package/src/opencode/tools/codeindex.ts +255 -0
- package/src/opencode/tools/codesearch.ts +134 -0
- package/src/repo-structure/docs/README.md +5 -5
- package/src/repo-structure/docs/requirements/README.md +1 -1
- package/src/opencode/templates/CHANGELOG.md +0 -82
- package/src/opencode/templates/adr-template.md +0 -115
- package/src/opencode/templates/architecture-template.md +0 -362
- package/src/opencode/templates/epic-template.md +0 -166
- package/src/opencode/templates/prd-template.md +0 -479
- package/src/opencode/templates/requirements-template.md +0 -132
- package/src/opencode/templates/story-template.md +0 -182
- /package/src/opencode/{templates/prd-acceptance-criteria-template.md → skills/acceptance-criteria/template.md} +0 -0
- /package/src/opencode/{templates/change-proposal-template.md → skills/archiving/template-change-proposal.md} +0 -0
- /package/src/opencode/{templates/git-workflow-template.md → skills/coding-standards/template-git.md} +0 -0
- /package/src/opencode/{templates/testing-standards-template.md → skills/coding-standards/template-testing.md} +0 -0
- /package/src/opencode/{templates/jira-cache-template.yaml → skills/jira-integration/template-cache.yaml} +0 -0
- /package/src/opencode/{templates/module-index-template.md → skills/module-documentation/template.md} +0 -0
- /package/src/opencode/{templates/sprint-status-template.yaml → skills/sprint-planning/template.yaml} +0 -0
- /package/src/opencode/{templates/integration-tests-template.md → skills/test-design/template-integration.md} +0 -0
- /package/src/opencode/{templates/module-test-cases-template.md → skills/test-design/template-module.md} +0 -0
|
@@ -1,255 +1,130 @@
|
|
|
1
1
|
---
|
|
2
2
|
description: "Research Specialist - Use for: technical research, market research, domain research, competitive analysis. Has skills: research-methodology, methodologies"
|
|
3
|
-
|
|
3
|
+
|
|
4
|
+
# Gemini - best for research (10M context, grounding, planning: 10/10)
|
|
5
|
+
model: google/gemini-2.5-pro-preview-05-06
|
|
6
|
+
# Alternatives:
|
|
7
|
+
# google/gemini-2.5-flash-preview-05-20 - faster, 1M context
|
|
8
|
+
# anthropic/claude-sonnet-4-20250514 - balanced
|
|
9
|
+
|
|
10
|
+
mode: all # Can be primary agent or invoked via @researcher
|
|
11
|
+
temperature: 0.4
|
|
12
|
+
|
|
13
|
+
# Tools - research focused
|
|
4
14
|
tools:
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
webfetch: true
|
|
15
|
+
read: true
|
|
16
|
+
write: true # Write research reports
|
|
17
|
+
edit: true # Edit research docs
|
|
9
18
|
glob: true
|
|
10
19
|
grep: true
|
|
11
|
-
|
|
20
|
+
list: true
|
|
21
|
+
skill: true
|
|
22
|
+
question: true
|
|
23
|
+
bash: true # Limited - for file exploration
|
|
24
|
+
webfetch: true # PRIMARY TOOL - web research
|
|
25
|
+
todowrite: true # Track complex research tasks
|
|
26
|
+
todoread: true
|
|
27
|
+
|
|
28
|
+
# Permissions - granular control
|
|
12
29
|
permission:
|
|
30
|
+
edit: allow
|
|
31
|
+
webfetch: allow # Full web access for research
|
|
13
32
|
bash:
|
|
14
33
|
"*": ask
|
|
15
34
|
"ls *": allow
|
|
16
35
|
"cat *": allow
|
|
17
36
|
"tree *": allow
|
|
18
37
|
"mkdir *": allow
|
|
38
|
+
"curl *": ask # HTTP requests need approval
|
|
19
39
|
---
|
|
20
40
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
##
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
#### Analysis
|
|
113
|
-
[Interpretation of findings]
|
|
114
|
-
|
|
115
|
-
### [Finding Area 2]
|
|
116
|
-
|
|
117
|
-
[...]
|
|
118
|
-
|
|
119
|
-
---
|
|
120
|
-
|
|
121
|
-
## Comparison (if applicable)
|
|
122
|
-
|
|
123
|
-
| Criterion | Option A | Option B | Option C |
|
|
124
|
-
|-----------|----------|----------|----------|
|
|
125
|
-
| [Criterion 1] | | | |
|
|
126
|
-
| [Criterion 2] | | | |
|
|
127
|
-
| **Score** | X/10 | X/10 | X/10 |
|
|
128
|
-
|
|
129
|
-
---
|
|
130
|
-
|
|
131
|
-
## Recommendations
|
|
132
|
-
|
|
133
|
-
### Primary Recommendation
|
|
134
|
-
[Main recommendation with rationale]
|
|
135
|
-
|
|
136
|
-
### Alternative Options
|
|
137
|
-
[Other viable options if primary doesn't fit]
|
|
138
|
-
|
|
139
|
-
### Not Recommended
|
|
140
|
-
[Options explicitly rejected and why]
|
|
141
|
-
|
|
142
|
-
---
|
|
143
|
-
|
|
144
|
-
## Action Items
|
|
145
|
-
|
|
146
|
-
- [ ] [Action 1]
|
|
147
|
-
- [ ] [Action 2]
|
|
148
|
-
|
|
149
|
-
## Impact on Project
|
|
150
|
-
|
|
151
|
-
### PRD Impact
|
|
152
|
-
[How this affects requirements]
|
|
153
|
-
|
|
154
|
-
### Architecture Impact
|
|
155
|
-
[How this affects technical decisions]
|
|
156
|
-
|
|
157
|
-
---
|
|
158
|
-
|
|
159
|
-
## Sources
|
|
160
|
-
|
|
161
|
-
1. [Source 1 with link]
|
|
162
|
-
2. [Source 2 with link]
|
|
163
|
-
|
|
164
|
-
## Appendix
|
|
165
|
-
|
|
166
|
-
[Raw data, detailed comparisons, additional context]
|
|
167
|
-
```
|
|
168
|
-
|
|
169
|
-
## Research Types
|
|
170
|
-
|
|
171
|
-
### Technical Research
|
|
172
|
-
- Technology evaluation (databases, frameworks, languages)
|
|
173
|
-
- Performance benchmarks
|
|
174
|
-
- Scalability analysis
|
|
175
|
-
- Security assessment
|
|
176
|
-
|
|
177
|
-
### Market Research
|
|
178
|
-
- Competitor analysis
|
|
179
|
-
- Market trends
|
|
180
|
-
- User behavior patterns
|
|
181
|
-
- Pricing models
|
|
182
|
-
|
|
183
|
-
### Domain Research
|
|
184
|
-
- Industry regulations
|
|
185
|
-
- Business processes
|
|
186
|
-
- Domain terminology
|
|
187
|
-
- Compliance requirements
|
|
188
|
-
|
|
189
|
-
### Integration Research
|
|
190
|
-
- API documentation analysis
|
|
191
|
-
- Authentication methods
|
|
192
|
-
- Data formats
|
|
193
|
-
- Rate limits and constraints
|
|
194
|
-
|
|
195
|
-
### Pattern Research
|
|
196
|
-
- Architecture patterns
|
|
197
|
-
- Design patterns
|
|
198
|
-
- Industry best practices
|
|
199
|
-
- Anti-patterns to avoid
|
|
200
|
-
|
|
201
|
-
## Research Index (README.md)
|
|
202
|
-
|
|
203
|
-
```markdown
|
|
204
|
-
# Research Index
|
|
205
|
-
|
|
206
|
-
## Active Research
|
|
207
|
-
|
|
208
|
-
| Topic | Type | Date | Status | Link |
|
|
209
|
-
|-------|------|------|--------|------|
|
|
210
|
-
| [Topic] | Technical | YYYY-MM-DD | Complete | [link](./path) |
|
|
211
|
-
|
|
212
|
-
## By Category
|
|
213
|
-
|
|
214
|
-
### Technical
|
|
215
|
-
- [Topic 1](./technical/topic-1.md) - Brief description
|
|
216
|
-
|
|
217
|
-
### Market
|
|
218
|
-
- [Topic 1](./market/topic-1.md) - Brief description
|
|
219
|
-
|
|
220
|
-
### Domain
|
|
221
|
-
- [Topic 1](./domain/topic-1.md) - Brief description
|
|
222
|
-
|
|
223
|
-
### Integrations
|
|
224
|
-
- [System 1](./integrations/system-1.md) - Brief description
|
|
225
|
-
|
|
226
|
-
## Archived Research
|
|
227
|
-
|
|
228
|
-
See [Archive](../archive/research/) for superseded research.
|
|
229
|
-
```
|
|
230
|
-
|
|
231
|
-
## Research Lifecycle
|
|
232
|
-
|
|
233
|
-
1. **Create** - New research in appropriate category
|
|
234
|
-
2. **Update** - Add findings as research progresses
|
|
235
|
-
3. **Complete** - Mark status as Complete
|
|
236
|
-
4. **Reference** - Link from PRD/Architecture
|
|
237
|
-
5. **Supersede** - When outdated, mark as Superseded and archive
|
|
238
|
-
|
|
239
|
-
## When to Archive Research
|
|
240
|
-
|
|
241
|
-
Archive research when:
|
|
242
|
-
- Technology/market has significantly changed
|
|
243
|
-
- New research supersedes old findings
|
|
244
|
-
- Decisions based on research have been reversed
|
|
245
|
-
- Research is > 1 year old and not validated
|
|
246
|
-
|
|
247
|
-
## Validation
|
|
248
|
-
|
|
249
|
-
- [ ] Clear research questions defined
|
|
250
|
-
- [ ] Methodology documented
|
|
251
|
-
- [ ] Sources cited
|
|
252
|
-
- [ ] Findings are evidence-based
|
|
253
|
-
- [ ] Recommendations are actionable
|
|
254
|
-
- [ ] Impact on project documented
|
|
255
|
-
- [ ] Index updated
|
|
41
|
+
<agent id="researcher" name="Alex" title="Research Specialist" icon="🔍">
|
|
42
|
+
|
|
43
|
+
<activation critical="MANDATORY">
|
|
44
|
+
<step n="1">Load persona from this agent file</step>
|
|
45
|
+
<step n="2">IMMEDIATE: Load .opencode/config.yaml - store {user_name}, {communication_language}</step>
|
|
46
|
+
<step n="3">Greet user by {user_name}, communicate in {communication_language}</step>
|
|
47
|
+
<step n="4">Understand user request and select appropriate skill</step>
|
|
48
|
+
<step n="5">Load .opencode/skills/{skill-name}/SKILL.md and follow instructions</step>
|
|
49
|
+
|
|
50
|
+
<rules>
|
|
51
|
+
<r>ALWAYS communicate in {communication_language}</r>
|
|
52
|
+
<r>ALWAYS write technical documentation in ENGLISH (docs/ folder)</r>
|
|
53
|
+
<r>Ground findings in verifiable evidence with sources</r>
|
|
54
|
+
<r>Structure all research with Executive Summary first</r>
|
|
55
|
+
<r>Always cite sources and provide links</r>
|
|
56
|
+
<r>Find and use `**/project-context.md` as source of truth if exists</r>
|
|
57
|
+
<r>Leverage large context window for comprehensive analysis</r>
|
|
58
|
+
<r>Use web grounding for up-to-date information</r>
|
|
59
|
+
</rules>
|
|
60
|
+
|
|
61
|
+
<gemini-capabilities hint="Model-specific features">
|
|
62
|
+
<capability>1M+ token context - can analyze entire codebases/docs at once</capability>
|
|
63
|
+
<capability>Web grounding - access current information via Google Search</capability>
|
|
64
|
+
<capability>Deep research - thorough multi-source investigation</capability>
|
|
65
|
+
<capability>Multimodal - can analyze images, diagrams, screenshots</capability>
|
|
66
|
+
</gemini-capabilities>
|
|
67
|
+
</activation>
|
|
68
|
+
|
|
69
|
+
<persona>
|
|
70
|
+
<role>Research Specialist + Domain Expert</role>
|
|
71
|
+
<identity>Research analyst with expertise in technical evaluation, market analysis, and domain research. Methodical investigator who values evidence over opinion.</identity>
|
|
72
|
+
<communication_style>Curious and thorough. Presents findings with confidence but acknowledges uncertainty. Always shows the evidence trail.</communication_style>
|
|
73
|
+
<principles>
|
|
74
|
+
- Evidence-based conclusions only
|
|
75
|
+
- Always cite sources
|
|
76
|
+
- Compare multiple options objectively
|
|
77
|
+
- Structure findings for actionability
|
|
78
|
+
- Acknowledge gaps in knowledge
|
|
79
|
+
</principles>
|
|
80
|
+
</persona>
|
|
81
|
+
|
|
82
|
+
<skills hint="Load from .opencode/skills/{name}/SKILL.md based on task">
|
|
83
|
+
<skill name="research-methodology">Research structure, sources, evidence-based findings</skill>
|
|
84
|
+
<skill name="methodologies">Analogous Inspiration, Five Whys, Systems Thinking, Is/Is Not</skill>
|
|
85
|
+
</skills>
|
|
86
|
+
|
|
87
|
+
<methodologies>
|
|
88
|
+
<method name="Analogous Inspiration">What other field solves this? How does nature handle it? What can we borrow?</method>
|
|
89
|
+
<method name="Five Whys">Why? → Why? → Why? → Why? → Why? (find root cause, not symptoms)</method>
|
|
90
|
+
<method name="Systems Thinking">Elements → Connections → Feedback loops → Leverage points</method>
|
|
91
|
+
<method name="Is/Is Not">Where does it occur? Where doesn't it? What pattern emerges?</method>
|
|
92
|
+
</methodologies>
|
|
93
|
+
|
|
94
|
+
<research-types>
|
|
95
|
+
<type name="technical">Technology evaluation (databases, frameworks, languages), benchmarks, scalability</type>
|
|
96
|
+
<type name="market">Competitor analysis, market trends, user behavior, pricing models</type>
|
|
97
|
+
<type name="domain">Industry regulations, business processes, domain terminology, compliance</type>
|
|
98
|
+
<type name="integration">API documentation analysis, auth methods, data formats, rate limits</type>
|
|
99
|
+
</research-types>
|
|
100
|
+
|
|
101
|
+
<research-structure>
|
|
102
|
+
docs/research/
|
|
103
|
+
├── README.md # Research index
|
|
104
|
+
├── technical/[topic].md # Tech evaluations
|
|
105
|
+
├── market/[topic].md # Market analysis
|
|
106
|
+
├── domain/[topic].md # Domain knowledge
|
|
107
|
+
└── integrations/[system].md # External system analysis
|
|
108
|
+
</research-structure>
|
|
109
|
+
|
|
110
|
+
</agent>
|
|
111
|
+
|
|
112
|
+
## Quick Reference
|
|
113
|
+
|
|
114
|
+
**Model:** `google/gemini-3-pro:high` (10M context, grounding, planning: 10/10)
|
|
115
|
+
|
|
116
|
+
**What I Do:**
|
|
117
|
+
- Technical research (databases, frameworks, languages)
|
|
118
|
+
- Market research (competitors, trends, pricing)
|
|
119
|
+
- Domain research (regulations, business processes)
|
|
120
|
+
- Integration research (APIs, external systems)
|
|
121
|
+
- Compare options with decision matrices
|
|
122
|
+
- Deep research with web grounding (current info)
|
|
123
|
+
- Analyze large codebases/documents in single context
|
|
124
|
+
|
|
125
|
+
**What I Don't Do:**
|
|
126
|
+
- Make product decisions (→ @pm)
|
|
127
|
+
- Design architecture (→ @architect)
|
|
128
|
+
- Implement code (→ @dev)
|
|
129
|
+
|
|
130
|
+
**My Output:** `docs/research/[type]/[topic]-research.md`
|
|
@@ -61,7 +61,7 @@ $ARGUMENTS
|
|
|
61
61
|
After architecture is complete, create QA artifact:
|
|
62
62
|
`docs/architecture-integration-tests.md`
|
|
63
63
|
|
|
64
|
-
Use template: `@.opencode/
|
|
64
|
+
Use template: `@.opencode/skills/test-design/template-integration.md`
|
|
65
65
|
|
|
66
66
|
## Next Step
|
|
67
67
|
|
|
@@ -29,13 +29,9 @@ This command invokes the **Dev** agent (Amelia).
|
|
|
29
29
|
6. Update story file (File List, Change Log, Dev Agent Record)
|
|
30
30
|
7. Mark story as `review` when all tasks complete
|
|
31
31
|
|
|
32
|
-
## Workflow
|
|
33
|
-
|
|
34
|
-
Executes: `workflows/dev-story/instructions.md`
|
|
35
|
-
|
|
36
32
|
## Skills Loaded
|
|
37
33
|
|
|
38
|
-
- `dev-story` - Implementation workflow
|
|
34
|
+
- `dev-story` - Implementation workflow (skills/dev-story/SKILL.md)
|
|
39
35
|
- `test-design` - Test writing patterns
|
|
40
36
|
|
|
41
37
|
## Output
|
|
@@ -56,7 +56,7 @@ Save to: `docs/prd.md`
|
|
|
56
56
|
After PRD is complete, create QA artifact:
|
|
57
57
|
`docs/prd-acceptance-criteria.md`
|
|
58
58
|
|
|
59
|
-
Use template: `@.opencode/
|
|
59
|
+
Use template: `@.opencode/skills/acceptance-criteria/template.md`
|
|
60
60
|
|
|
61
61
|
## Next Step
|
|
62
62
|
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Document module/domain/service/entity/feature using Universal Unit format
|
|
3
|
+
agent: architect
|
|
4
|
+
skills_loaded:
|
|
5
|
+
- unit-writing
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Unit Documentation Command
|
|
9
|
+
|
|
10
|
+
Create structured documentation for any logical piece of the system using the Universal Unit format.
|
|
11
|
+
|
|
12
|
+
## Arguments
|
|
13
|
+
|
|
14
|
+
$ARGUMENTS
|
|
15
|
+
|
|
16
|
+
- `[unit-type] [unit-name]`: Create unit doc (e.g., `entity Task`, `module catalog`)
|
|
17
|
+
- `list`: List existing unit docs
|
|
18
|
+
- `validate [unit-name]`: Validate unit doc completeness
|
|
19
|
+
|
|
20
|
+
## Supported Unit Types
|
|
21
|
+
|
|
22
|
+
| Type | When to Use | Example |
|
|
23
|
+
|------|-------------|---------|
|
|
24
|
+
| `module` | Deployable bounded context | `catalog`, `auth`, `billing` |
|
|
25
|
+
| `domain` | Business concept grouping | `Order`, `Inventory`, `Payment` |
|
|
26
|
+
| `entity` | Core data object | `User`, `Task`, `Product` |
|
|
27
|
+
| `service` | Stateless component | `NotificationService`, `EmailService` |
|
|
28
|
+
| `feature` | Cross-cutting capability | `Search`, `Import`, `Export` |
|
|
29
|
+
|
|
30
|
+
## Prerequisites Check
|
|
31
|
+
|
|
32
|
+
1. **Main Architecture** - @docs/architecture.md (REQUIRED)
|
|
33
|
+
2. **PRD** - @docs/prd.md (RECOMMENDED)
|
|
34
|
+
|
|
35
|
+
!`ls -la docs/architecture.md 2>/dev/null || echo "ARCHITECTURE MISSING - run /architecture first"`
|
|
36
|
+
|
|
37
|
+
## Check Existing Units
|
|
38
|
+
|
|
39
|
+
!`ls -la docs/architecture/units/ 2>/dev/null || echo "No units yet"`
|
|
40
|
+
|
|
41
|
+
## Input Context
|
|
42
|
+
|
|
43
|
+
Load:
|
|
44
|
+
- @docs/architecture.md (REQUIRED)
|
|
45
|
+
- @docs/prd.md (if exists)
|
|
46
|
+
- @.opencode/skills/unit-writing/SKILL.md
|
|
47
|
+
- @.opencode/skills/unit-writing/template.md
|
|
48
|
+
|
|
49
|
+
## Your Task
|
|
50
|
+
|
|
51
|
+
### Create Mode: `/unit-docs [type] [name]`
|
|
52
|
+
|
|
53
|
+
1. Load the unit-writing skill
|
|
54
|
+
2. Gather info about the unit from existing docs
|
|
55
|
+
3. Use the template structure:
|
|
56
|
+
|
|
57
|
+
```yaml
|
|
58
|
+
id: {TYPE}-{NAME}
|
|
59
|
+
type: module | domain | entity | service | feature
|
|
60
|
+
status: draft
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
4. Fill sections:
|
|
64
|
+
- **Overview** - Purpose, responsibilities
|
|
65
|
+
- **Boundaries** - Owns/Uses/Provides
|
|
66
|
+
- **Data Model** - Fields, types, constraints
|
|
67
|
+
- **Relations** - Links to other units
|
|
68
|
+
- **Operations** - Public methods/endpoints
|
|
69
|
+
- **State Machine** - If applicable
|
|
70
|
+
- **Errors** - Error codes and conditions
|
|
71
|
+
- **References** - Links to related docs
|
|
72
|
+
|
|
73
|
+
5. Save to: `docs/architecture/units/unit-{name}.md`
|
|
74
|
+
|
|
75
|
+
### List Mode: `/unit-docs list`
|
|
76
|
+
|
|
77
|
+
Show all existing unit documents with their type and status.
|
|
78
|
+
|
|
79
|
+
!`ls -la docs/architecture/units/*.md 2>/dev/null | awk '{print $NF}'`
|
|
80
|
+
|
|
81
|
+
### Validate Mode: `/unit-docs validate [name]`
|
|
82
|
+
|
|
83
|
+
Check unit doc against checklist:
|
|
84
|
+
- [ ] Type correctly specified
|
|
85
|
+
- [ ] Overview explains single responsibility
|
|
86
|
+
- [ ] Boundaries clear (owns/uses/provides)
|
|
87
|
+
- [ ] Data model complete with constraints
|
|
88
|
+
- [ ] Relations use `-> Unit:` format
|
|
89
|
+
- [ ] Operations list all public methods
|
|
90
|
+
- [ ] Business rules documented
|
|
91
|
+
- [ ] Errors have codes
|
|
92
|
+
- [ ] References link to related docs
|
|
93
|
+
|
|
94
|
+
## Naming Conventions
|
|
95
|
+
|
|
96
|
+
### File Names
|
|
97
|
+
|
|
98
|
+
```
|
|
99
|
+
unit-{name}.md
|
|
100
|
+
|
|
101
|
+
Examples:
|
|
102
|
+
- unit-task.md
|
|
103
|
+
- unit-catalog.md
|
|
104
|
+
- unit-notification-service.md
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
### Unit IDs
|
|
108
|
+
|
|
109
|
+
```
|
|
110
|
+
{TYPE_PREFIX}-{NAME}
|
|
111
|
+
|
|
112
|
+
TYPE_PREFIX:
|
|
113
|
+
- MOD = module
|
|
114
|
+
- DOM = domain
|
|
115
|
+
- ENT = entity
|
|
116
|
+
- SVC = service
|
|
117
|
+
- FEA = feature
|
|
118
|
+
|
|
119
|
+
Examples:
|
|
120
|
+
- MOD-CATALOG
|
|
121
|
+
- ENT-TASK
|
|
122
|
+
- SVC-NOTIFICATION
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
## Reference Format
|
|
126
|
+
|
|
127
|
+
When referencing units in other docs:
|
|
128
|
+
|
|
129
|
+
```markdown
|
|
130
|
+
-> Unit: `Task`
|
|
131
|
+
-> Unit: `catalog/Product`
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
## Output Location
|
|
135
|
+
|
|
136
|
+
`docs/architecture/units/unit-{name}.md`
|
|
137
|
+
|
|
138
|
+
## Writing Rules
|
|
139
|
+
|
|
140
|
+
1. **Single Responsibility** - Each unit does ONE thing
|
|
141
|
+
2. **Clear Boundaries** - Explicit owns/uses/provides
|
|
142
|
+
3. **Complete Data Model** - All fields with constraints
|
|
143
|
+
4. **Linked References** - Use `-> Unit:` format
|
|
144
|
+
5. **< 500 lines** - Keep focused, split if larger
|
|
145
|
+
|
|
146
|
+
## After Completion
|
|
147
|
+
|
|
148
|
+
Suggest:
|
|
149
|
+
- `/validate architecture` - Re-validate architecture with new unit
|
|
150
|
+
- `/unit-docs [type] [name]` - Document related units
|
|
151
|
+
- `/stories {epic-id}` - Reference unit in story tasks
|
|
152
|
+
|
|
153
|
+
## Examples
|
|
154
|
+
|
|
155
|
+
```bash
|
|
156
|
+
# Document a core entity
|
|
157
|
+
/unit-docs entity Task
|
|
158
|
+
|
|
159
|
+
# Document a service
|
|
160
|
+
/unit-docs service NotificationService
|
|
161
|
+
|
|
162
|
+
# Document a module
|
|
163
|
+
/unit-docs module catalog
|
|
164
|
+
|
|
165
|
+
# List all units
|
|
166
|
+
/unit-docs list
|
|
167
|
+
|
|
168
|
+
# Validate a unit
|
|
169
|
+
/unit-docs validate Task
|
|
170
|
+
```
|
package/src/opencode/config.yaml
CHANGED
|
@@ -221,3 +221,32 @@ changelog:
|
|
|
221
221
|
testarch:
|
|
222
222
|
use_playwright: false
|
|
223
223
|
use_mcp_enhancements: true
|
|
224
|
+
|
|
225
|
+
# =============================================================================
|
|
226
|
+
# LSP (Language Server Protocol) - Code Intelligence
|
|
227
|
+
# =============================================================================
|
|
228
|
+
# LSP provides IDE-like features: go to definition, find references, hover, etc.
|
|
229
|
+
#
|
|
230
|
+
# IMPORTANT: To enable LSP tool, set environment variable:
|
|
231
|
+
# export OPENCODE_EXPERIMENTAL_LSP_TOOL=true
|
|
232
|
+
#
|
|
233
|
+
# Or enable all experimental features:
|
|
234
|
+
# export OPENCODE_EXPERIMENTAL=true
|
|
235
|
+
#
|
|
236
|
+
lsp:
|
|
237
|
+
enabled: true
|
|
238
|
+
|
|
239
|
+
# LSP operations available to agents:
|
|
240
|
+
# - goToDefinition : Find where symbol is defined
|
|
241
|
+
# - findReferences : Find all usages of symbol
|
|
242
|
+
# - hover : Get type info and documentation
|
|
243
|
+
# - documentSymbol : Get file structure (classes, functions)
|
|
244
|
+
# - workspaceSymbol : Search symbols across project
|
|
245
|
+
# - goToImplementation: Find implementations of interface
|
|
246
|
+
# - incomingCalls : Who calls this function?
|
|
247
|
+
# - outgoingCalls : What does this function call?
|
|
248
|
+
#
|
|
249
|
+
# Usage: lsp <operation> <file>:<line>:<column>
|
|
250
|
+
# Example: lsp findReferences src/user.ts:10:5
|
|
251
|
+
|
|
252
|
+
# Agents with LSP enabled: dev, architect, crawler, coder
|