@comfanion/workflow 3.0.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 +185 -0
- package/bin/cli.js +406 -0
- package/package.json +50 -0
- package/src/build-info.json +16 -0
- package/src/opencode/ARCHITECTURE.md +255 -0
- package/src/opencode/FLOW.yaml +900 -0
- package/src/opencode/agents/analyst.md +141 -0
- package/src/opencode/agents/architect.md +177 -0
- package/src/opencode/agents/change-manager.md +263 -0
- package/src/opencode/agents/dev.md +171 -0
- package/src/opencode/agents/module-docs.md +628 -0
- package/src/opencode/agents/pm.md +157 -0
- package/src/opencode/agents/researcher.md +254 -0
- package/src/opencode/agents/sm.md +184 -0
- package/src/opencode/agents/workflow-orchestrator.md +249 -0
- package/src/opencode/checklists/architecture-checklist.md +166 -0
- package/src/opencode/checklists/code-review-checklist.md +151 -0
- package/src/opencode/checklists/prd-checklist.md +140 -0
- package/src/opencode/checklists/requirements-checklist.md +86 -0
- package/src/opencode/checklists/story-checklist.md +137 -0
- package/src/opencode/commands/architecture.md +68 -0
- package/src/opencode/commands/archive.md +146 -0
- package/src/opencode/commands/change.md +169 -0
- package/src/opencode/commands/clarify.md +132 -0
- package/src/opencode/commands/code-review.md +96 -0
- package/src/opencode/commands/coding-standards.md +102 -0
- package/src/opencode/commands/dev-story.md +80 -0
- package/src/opencode/commands/diagram.md +152 -0
- package/src/opencode/commands/epics.md +52 -0
- package/src/opencode/commands/help.md +139 -0
- package/src/opencode/commands/jira-sync.md +58 -0
- package/src/opencode/commands/module-docs.md +158 -0
- package/src/opencode/commands/prd.md +63 -0
- package/src/opencode/commands/quick.md +166 -0
- package/src/opencode/commands/requirements.md +49 -0
- package/src/opencode/commands/research.md +113 -0
- package/src/opencode/commands/sprint-plan.md +59 -0
- package/src/opencode/commands/stories.md +61 -0
- package/src/opencode/commands/validate.md +84 -0
- package/src/opencode/commands/workflow-status.md +150 -0
- package/src/opencode/config.yaml +223 -0
- package/src/opencode/opencode.json +36 -0
- package/src/opencode/skills/acceptance-criteria/SKILL.md +212 -0
- package/src/opencode/skills/adr-writing/SKILL.md +241 -0
- package/src/opencode/skills/architecture-design/SKILL.md +183 -0
- package/src/opencode/skills/architecture-validation/SKILL.md +199 -0
- package/src/opencode/skills/archiving/SKILL.md +191 -0
- package/src/opencode/skills/changelog/SKILL.md +280 -0
- package/src/opencode/skills/code-review/SKILL.md +193 -0
- package/src/opencode/skills/coding-standards/SKILL.md +430 -0
- package/src/opencode/skills/diagram-creation/SKILL.md +273 -0
- package/src/opencode/skills/doc-todo/SKILL.md +325 -0
- package/src/opencode/skills/epic-writing/SKILL.md +291 -0
- package/src/opencode/skills/jira-integration/SKILL.md +560 -0
- package/src/opencode/skills/methodologies/SKILL.md +376 -0
- package/src/opencode/skills/module-documentation/SKILL.md +214 -0
- package/src/opencode/skills/prd-validation/SKILL.md +164 -0
- package/src/opencode/skills/prd-writing/SKILL.md +104 -0
- package/src/opencode/skills/requirements-gathering/SKILL.md +132 -0
- package/src/opencode/skills/requirements-validation/SKILL.md +141 -0
- package/src/opencode/skills/research-methodology/SKILL.md +140 -0
- package/src/opencode/skills/sprint-planning/SKILL.md +217 -0
- package/src/opencode/skills/story-writing/SKILL.md +574 -0
- package/src/opencode/skills/test-design/SKILL.md +313 -0
- package/src/opencode/skills/translation/SKILL.md +411 -0
- package/src/opencode/templates/CHANGELOG.md +82 -0
- package/src/opencode/templates/adr-template.md +115 -0
- package/src/opencode/templates/architecture-template.md +362 -0
- package/src/opencode/templates/change-proposal-template.md +186 -0
- package/src/opencode/templates/epic-template.md +151 -0
- package/src/opencode/templates/git-workflow-template.md +384 -0
- package/src/opencode/templates/integration-tests-template.md +265 -0
- package/src/opencode/templates/jira-cache-template.yaml +103 -0
- package/src/opencode/templates/module-index-template.md +139 -0
- package/src/opencode/templates/module-test-cases-template.md +230 -0
- package/src/opencode/templates/prd-acceptance-criteria-template.md +124 -0
- package/src/opencode/templates/prd-template.md +479 -0
- package/src/opencode/templates/requirements-template.md +132 -0
- package/src/opencode/templates/sprint-status-template.yaml +84 -0
- package/src/opencode/templates/story-template.md +437 -0
- package/src/opencode/templates/testing-standards-template.md +359 -0
- package/src/opencode/workflows/dev-story/instructions.md +529 -0
- package/src/repo-structure/.gitattributes +64 -0
- package/src/repo-structure/CONTRIBUTING.md +182 -0
- package/src/repo-structure/README.md +77 -0
- package/src/repo-structure/docs/README.md +62 -0
- package/src/repo-structure/docs/api/README.md +43 -0
- package/src/repo-structure/docs/architecture/README.md +36 -0
- package/src/repo-structure/docs/architecture/adr/README.md +53 -0
- package/src/repo-structure/docs/architecture/diagrams/README.md +59 -0
- package/src/repo-structure/docs/coding-standards/README.md +52 -0
- package/src/repo-structure/docs/confluence/README.md +43 -0
- package/src/repo-structure/docs/requirements/README.md +28 -0
- package/src/repo-structure/docs/sprint-artifacts/README.md +76 -0
- package/src/repo-structure/docs/sprint-artifacts/backlog/README.md +24 -0
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
# [Module] Test Cases
|
|
2
|
+
|
|
3
|
+
**Parent:** [Module Architecture](./architecture.md)
|
|
4
|
+
**Version:** 1.0
|
|
5
|
+
**Status:** Draft | Review | Approved
|
|
6
|
+
**QA Owner:** [Name]
|
|
7
|
+
|
|
8
|
+
> **Note:** This file is OPTIONAL. Create only when module has complex test scenarios that don't fit in PRD acceptance criteria.
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## Overview
|
|
13
|
+
|
|
14
|
+
Test cases specific to this module, covering domain logic, use cases, and module-specific integrations.
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## Domain Layer Tests
|
|
19
|
+
|
|
20
|
+
### Aggregate: [Aggregate Name]
|
|
21
|
+
|
|
22
|
+
#### Business Rules
|
|
23
|
+
|
|
24
|
+
| Rule ID | Rule Description | Test Case |
|
|
25
|
+
|---------|------------------|-----------|
|
|
26
|
+
| BR-01 | Order total must be > 0 | Create order with zero total → error |
|
|
27
|
+
| BR-02 | Cannot add items to completed order | Add item to completed → error |
|
|
28
|
+
| BR-03 | Discount cannot exceed total | Apply 100% discount → max discount applied |
|
|
29
|
+
|
|
30
|
+
#### State Transitions
|
|
31
|
+
|
|
32
|
+
```
|
|
33
|
+
┌─────────┐
|
|
34
|
+
│ DRAFT │
|
|
35
|
+
└────┬────┘
|
|
36
|
+
│ submit()
|
|
37
|
+
▼
|
|
38
|
+
┌─────────┐
|
|
39
|
+
│ PENDING │
|
|
40
|
+
└────┬────┘
|
|
41
|
+
┌────┴────┐
|
|
42
|
+
approve() reject()
|
|
43
|
+
│ │
|
|
44
|
+
▼ ▼
|
|
45
|
+
┌────────┐ ┌──────────┐
|
|
46
|
+
│ ACTIVE │ │ REJECTED │
|
|
47
|
+
└────────┘ └──────────┘
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
| From | To | Action | Test Case |
|
|
51
|
+
|------|-----|--------|-----------|
|
|
52
|
+
| DRAFT | PENDING | submit() | Valid order → status = PENDING |
|
|
53
|
+
| DRAFT | PENDING | submit() | Invalid order → error, status = DRAFT |
|
|
54
|
+
| PENDING | ACTIVE | approve() | Approve → status = ACTIVE |
|
|
55
|
+
| PENDING | REJECTED | reject() | Reject with reason → status = REJECTED |
|
|
56
|
+
| ACTIVE | DRAFT | submit() | Invalid transition → error |
|
|
57
|
+
|
|
58
|
+
#### Value Object Validation
|
|
59
|
+
|
|
60
|
+
| Value Object | Valid | Invalid | Edge Case |
|
|
61
|
+
|--------------|-------|---------|-----------|
|
|
62
|
+
| Email | test@example.com | "invalid" | max length |
|
|
63
|
+
| Phone | +380501234567 | "123" | international format |
|
|
64
|
+
| Money | 100.00 UAH | -1 | 0.01 (minimum) |
|
|
65
|
+
| SKU | "SKU-001" | "" | special chars |
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
## Use Case Tests
|
|
70
|
+
|
|
71
|
+
### Use Case: [Create Order]
|
|
72
|
+
|
|
73
|
+
**Input:** CreateOrderCommand
|
|
74
|
+
**Output:** OrderCreatedResult
|
|
75
|
+
|
|
76
|
+
#### Test Matrix
|
|
77
|
+
|
|
78
|
+
| Scenario | Input | Expected | Priority |
|
|
79
|
+
|----------|-------|----------|----------|
|
|
80
|
+
| Happy path | Valid order | Created, event published | Must |
|
|
81
|
+
| Empty items | No items | Validation error | Must |
|
|
82
|
+
| Invalid customer | Missing required | Validation error | Must |
|
|
83
|
+
| Duplicate SKU | Same SKU twice | Items merged | Should |
|
|
84
|
+
| Concurrent creation | Same order ID | Conflict error | Must |
|
|
85
|
+
|
|
86
|
+
#### Detailed Scenarios
|
|
87
|
+
|
|
88
|
+
```
|
|
89
|
+
Scenario: Create order - happy path
|
|
90
|
+
Given valid customer data
|
|
91
|
+
And valid items list
|
|
92
|
+
When CreateOrder is executed
|
|
93
|
+
Then order is saved with status DRAFT
|
|
94
|
+
And OrderCreated event is published
|
|
95
|
+
And order ID is returned
|
|
96
|
+
|
|
97
|
+
Scenario: Create order - validation failure
|
|
98
|
+
Given customer phone is invalid
|
|
99
|
+
When CreateOrder is executed
|
|
100
|
+
Then ValidationError is returned
|
|
101
|
+
And no order is saved
|
|
102
|
+
And no event is published
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
---
|
|
106
|
+
|
|
107
|
+
## API Tests
|
|
108
|
+
|
|
109
|
+
### Endpoint: POST /api/v1/orders
|
|
110
|
+
|
|
111
|
+
| Scenario | Request | Response | Status |
|
|
112
|
+
|----------|---------|----------|--------|
|
|
113
|
+
| Valid request | Full body | Order DTO | 201 |
|
|
114
|
+
| Missing field | No customer | Error details | 400 |
|
|
115
|
+
| Invalid auth | No token | Unauthorized | 401 |
|
|
116
|
+
| Forbidden | Wrong merchant | Forbidden | 403 |
|
|
117
|
+
|
|
118
|
+
### Endpoint: GET /api/v1/orders/{id}
|
|
119
|
+
|
|
120
|
+
| Scenario | Request | Response | Status |
|
|
121
|
+
|----------|---------|----------|--------|
|
|
122
|
+
| Exists | Valid ID | Order DTO | 200 |
|
|
123
|
+
| Not found | Unknown ID | Error | 404 |
|
|
124
|
+
| Wrong owner | Other's order | Forbidden | 403 |
|
|
125
|
+
|
|
126
|
+
---
|
|
127
|
+
|
|
128
|
+
## Event Tests
|
|
129
|
+
|
|
130
|
+
### Event: OrderCreated
|
|
131
|
+
|
|
132
|
+
**Producer:** This module
|
|
133
|
+
**Consumers:** Inventory, Notifications
|
|
134
|
+
|
|
135
|
+
| Scenario | Test | Verification |
|
|
136
|
+
|----------|------|--------------|
|
|
137
|
+
| Event structure | Create order | Event has all required fields |
|
|
138
|
+
| Event timing | After save | Event published after DB commit |
|
|
139
|
+
| Idempotency key | Event ID | Unique per order |
|
|
140
|
+
|
|
141
|
+
### Event: InventoryReserved (consumed)
|
|
142
|
+
|
|
143
|
+
**Producer:** Inventory
|
|
144
|
+
**Consumer:** This module
|
|
145
|
+
|
|
146
|
+
| Scenario | Test | Verification |
|
|
147
|
+
|----------|------|--------------|
|
|
148
|
+
| Reservation success | Receive event | Order status → CONFIRMED |
|
|
149
|
+
| Reservation failed | Receive failure | Order status → FAILED |
|
|
150
|
+
| Duplicate event | Same event twice | Ignored, no state change |
|
|
151
|
+
|
|
152
|
+
---
|
|
153
|
+
|
|
154
|
+
## Database Tests
|
|
155
|
+
|
|
156
|
+
### Table: orders
|
|
157
|
+
|
|
158
|
+
| Test | Query | Verification |
|
|
159
|
+
|------|-------|--------------|
|
|
160
|
+
| Insert | Create order | Row exists, all fields correct |
|
|
161
|
+
| Update | Change status | Only changed fields updated |
|
|
162
|
+
| Optimistic lock | Concurrent update | Second update fails |
|
|
163
|
+
| Cascade delete | Delete order | Items deleted |
|
|
164
|
+
|
|
165
|
+
### Performance
|
|
166
|
+
|
|
167
|
+
| Query | Max Time | Load |
|
|
168
|
+
|-------|----------|------|
|
|
169
|
+
| Find by ID | 10ms | Single |
|
|
170
|
+
| Search by status | 50ms | 1000 rows |
|
|
171
|
+
| List by merchant | 100ms | 10000 rows |
|
|
172
|
+
|
|
173
|
+
---
|
|
174
|
+
|
|
175
|
+
## Error Handling Tests
|
|
176
|
+
|
|
177
|
+
| Error Type | Trigger | Expected Behavior |
|
|
178
|
+
|------------|---------|-------------------|
|
|
179
|
+
| Validation | Invalid input | 400 + field errors |
|
|
180
|
+
| Not found | Unknown ID | 404 + message |
|
|
181
|
+
| Conflict | Duplicate | 409 + conflict details |
|
|
182
|
+
| DB timeout | Slow query | 503 + retry |
|
|
183
|
+
| External failure | API down | Graceful degradation |
|
|
184
|
+
|
|
185
|
+
---
|
|
186
|
+
|
|
187
|
+
## Coverage Requirements
|
|
188
|
+
|
|
189
|
+
| Layer | Target | Current |
|
|
190
|
+
|-------|--------|---------|
|
|
191
|
+
| Domain | 100% | - |
|
|
192
|
+
| Use Cases | 80% | - |
|
|
193
|
+
| API Handlers | 70% | - |
|
|
194
|
+
| Repository | 60% | - |
|
|
195
|
+
|
|
196
|
+
---
|
|
197
|
+
|
|
198
|
+
## Test Data
|
|
199
|
+
|
|
200
|
+
### Fixtures
|
|
201
|
+
|
|
202
|
+
```yaml
|
|
203
|
+
# fixtures/orders.yaml
|
|
204
|
+
valid_order:
|
|
205
|
+
customer:
|
|
206
|
+
name: "Test Customer"
|
|
207
|
+
phone: "+380501234567"
|
|
208
|
+
email: "test@example.com"
|
|
209
|
+
items:
|
|
210
|
+
- sku: "TEST-001"
|
|
211
|
+
quantity: 2
|
|
212
|
+
price: 100.00
|
|
213
|
+
|
|
214
|
+
invalid_order:
|
|
215
|
+
customer:
|
|
216
|
+
name: "" # Missing required field
|
|
217
|
+
items: [] # Empty items
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
---
|
|
221
|
+
|
|
222
|
+
## Validation Checklist
|
|
223
|
+
|
|
224
|
+
- [ ] All business rules have tests
|
|
225
|
+
- [ ] All state transitions tested
|
|
226
|
+
- [ ] All use cases covered
|
|
227
|
+
- [ ] All API endpoints tested
|
|
228
|
+
- [ ] Error scenarios documented
|
|
229
|
+
- [ ] Performance requirements defined
|
|
230
|
+
- [ ] Test data prepared
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
# PRD Acceptance Criteria
|
|
2
|
+
|
|
3
|
+
**PRD Version:** [X.Y]
|
|
4
|
+
**Date:** [YYYY-MM-DD]
|
|
5
|
+
**Author:** [Name]
|
|
6
|
+
**Status:** Draft | Review | Approved
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## Overview
|
|
11
|
+
|
|
12
|
+
This document defines acceptance criteria for all Functional Requirements from the PRD.
|
|
13
|
+
Each FR must have testable acceptance criteria before implementation begins.
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## Acceptance Criteria by Domain
|
|
18
|
+
|
|
19
|
+
### [Domain 1: e.g., Catalog Management]
|
|
20
|
+
|
|
21
|
+
#### FR-001: [Requirement Title]
|
|
22
|
+
|
|
23
|
+
**Priority:** P0 | P1 | P2
|
|
24
|
+
**PRD Reference:** Section X.Y
|
|
25
|
+
|
|
26
|
+
**Acceptance Criteria:**
|
|
27
|
+
|
|
28
|
+
| AC ID | Given | When | Then | Status |
|
|
29
|
+
|-------|-------|------|------|--------|
|
|
30
|
+
| FR-001-AC1 | [precondition] | [action] | [expected result] | Draft |
|
|
31
|
+
| FR-001-AC2 | [precondition] | [action] | [expected result] | Draft |
|
|
32
|
+
|
|
33
|
+
**Edge Cases:**
|
|
34
|
+
- [ ] [Edge case 1 - what happens when...]
|
|
35
|
+
- [ ] [Edge case 2 - what happens when...]
|
|
36
|
+
|
|
37
|
+
**Negative Tests:**
|
|
38
|
+
- [ ] [Invalid input scenario 1]
|
|
39
|
+
- [ ] [Invalid input scenario 2]
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
#### FR-002: [Requirement Title]
|
|
44
|
+
|
|
45
|
+
**Priority:** P0 | P1 | P2
|
|
46
|
+
**PRD Reference:** Section X.Y
|
|
47
|
+
|
|
48
|
+
**Acceptance Criteria:**
|
|
49
|
+
|
|
50
|
+
| AC ID | Given | When | Then | Status |
|
|
51
|
+
|-------|-------|------|------|--------|
|
|
52
|
+
| FR-002-AC1 | [precondition] | [action] | [expected result] | Draft |
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
### [Domain 2: e.g., Order Processing]
|
|
57
|
+
|
|
58
|
+
#### FR-010: [Requirement Title]
|
|
59
|
+
|
|
60
|
+
**Priority:** P0 | P1 | P2
|
|
61
|
+
**PRD Reference:** Section X.Y
|
|
62
|
+
|
|
63
|
+
**Acceptance Criteria:**
|
|
64
|
+
|
|
65
|
+
| AC ID | Given | When | Then | Status |
|
|
66
|
+
|-------|-------|------|------|--------|
|
|
67
|
+
| FR-010-AC1 | [precondition] | [action] | [expected result] | Draft |
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
|
|
71
|
+
## NFR Acceptance Criteria
|
|
72
|
+
|
|
73
|
+
### Performance (NFR-001 - NFR-0XX)
|
|
74
|
+
|
|
75
|
+
| NFR ID | Metric | Target | Test Method | Status |
|
|
76
|
+
|--------|--------|--------|-------------|--------|
|
|
77
|
+
| NFR-001 | Response time | < 200ms p95 | Load test with k6 | Draft |
|
|
78
|
+
| NFR-002 | Throughput | > 1000 RPS | Load test with k6 | Draft |
|
|
79
|
+
|
|
80
|
+
### Security (NFR-0XX - NFR-0XX)
|
|
81
|
+
|
|
82
|
+
| NFR ID | Requirement | Test Method | Status |
|
|
83
|
+
|--------|-------------|-------------|--------|
|
|
84
|
+
| NFR-010 | JWT authentication | Auth test suite | Draft |
|
|
85
|
+
| NFR-011 | Data encryption | Security audit | Draft |
|
|
86
|
+
|
|
87
|
+
### Scalability (NFR-0XX - NFR-0XX)
|
|
88
|
+
|
|
89
|
+
| NFR ID | Requirement | Test Method | Status |
|
|
90
|
+
|--------|-------------|-------------|--------|
|
|
91
|
+
| NFR-020 | Horizontal scaling | K8s scaling test | Draft |
|
|
92
|
+
|
|
93
|
+
---
|
|
94
|
+
|
|
95
|
+
## Coverage Matrix
|
|
96
|
+
|
|
97
|
+
| FR ID | AC Count | AC Defined | AC Approved | Epic | Story |
|
|
98
|
+
|-------|----------|------------|-------------|------|-------|
|
|
99
|
+
| FR-001 | 3 | ✅ | ⏳ | E01 | S01-01 |
|
|
100
|
+
| FR-002 | 2 | ✅ | ⏳ | E01 | S01-02 |
|
|
101
|
+
| FR-010 | 4 | ⏳ | ❌ | E02 | - |
|
|
102
|
+
|
|
103
|
+
**Legend:**
|
|
104
|
+
- ✅ Complete
|
|
105
|
+
- ⏳ In Progress
|
|
106
|
+
- ❌ Not Started
|
|
107
|
+
|
|
108
|
+
---
|
|
109
|
+
|
|
110
|
+
## Sign-off
|
|
111
|
+
|
|
112
|
+
| Role | Name | Date | Signature |
|
|
113
|
+
|------|------|------|-----------|
|
|
114
|
+
| Product Manager | | | |
|
|
115
|
+
| Tech Lead | | | |
|
|
116
|
+
| QA Lead | | | |
|
|
117
|
+
|
|
118
|
+
---
|
|
119
|
+
|
|
120
|
+
## Revision History
|
|
121
|
+
|
|
122
|
+
| Version | Date | Author | Changes |
|
|
123
|
+
|---------|------|--------|---------|
|
|
124
|
+
| 0.1 | YYYY-MM-DD | [Name] | Initial draft |
|