@thatix.io/context-first-agents-cli 0.1.0 → 0.2.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 +189 -7
- package/dist/commands/create-orchestrator.js +4 -1
- package/dist/commands/doctor.js +21 -5
- package/dist/commands/init.js +3 -1
- package/dist/templates/commands/en/engineer/plan.md +301 -0
- package/dist/templates/commands/en/engineer/pr.md +194 -0
- package/dist/templates/commands/en/engineer/pre-pr.md +325 -0
- package/dist/templates/commands/en/engineer/start.md +285 -0
- package/dist/templates/commands/en/engineer/work.md +256 -0
- package/dist/templates/commands/en/products/check.md +237 -0
- package/dist/templates/commands/en/products/collect.md +170 -0
- package/dist/templates/commands/en/products/refine.md +231 -0
- package/dist/templates/commands/en/products/spec.md +273 -0
- package/dist/templates/commands/en/quality/metrics.md +266 -0
- package/dist/templates/commands/en/quality/observe.md +172 -0
- package/dist/templates/commands/en/warm-up.md +59 -0
- package/dist/templates/commands/es/agents/CONTEXT-CONTRACT.md +63 -0
- package/dist/templates/commands/es/agents/implementer.md +27 -0
- package/dist/templates/commands/es/agents/integrator.md +24 -0
- package/dist/templates/commands/es/agents/reviewer.md +31 -0
- package/dist/templates/commands/es/agents/tester.md +22 -0
- package/dist/templates/commands/es/engineer/plan.md +335 -0
- package/dist/templates/commands/es/engineer/pr.md +228 -0
- package/dist/templates/commands/es/engineer/pre-pr.md +359 -0
- package/dist/templates/commands/es/engineer/start.md +318 -0
- package/dist/templates/commands/es/engineer/work.md +290 -0
- package/dist/templates/commands/es/orchestrate.md +125 -0
- package/dist/templates/commands/es/products/check.md +271 -0
- package/dist/templates/commands/es/products/collect.md +218 -0
- package/dist/templates/commands/es/products/refine.md +265 -0
- package/dist/templates/commands/es/products/spec.md +306 -0
- package/dist/templates/commands/es/quality/metrics.md +300 -0
- package/dist/templates/commands/es/quality/observe.md +205 -0
- package/dist/templates/commands/es/warm-up.md +59 -0
- package/dist/templates/commands/pt-BR/engineer/plan.md +335 -0
- package/dist/templates/commands/pt-BR/engineer/pr.md +228 -0
- package/dist/templates/commands/pt-BR/engineer/pre-pr.md +359 -0
- package/dist/templates/commands/pt-BR/engineer/start.md +319 -0
- package/dist/templates/commands/pt-BR/engineer/work.md +290 -0
- package/dist/templates/commands/pt-BR/products/check.md +271 -0
- package/dist/templates/commands/pt-BR/products/collect.md +219 -0
- package/dist/templates/commands/pt-BR/products/refine.md +265 -0
- package/dist/templates/commands/pt-BR/products/spec.md +307 -0
- package/dist/templates/commands/pt-BR/quality/metrics.md +300 -0
- package/dist/templates/commands/pt-BR/quality/observe.md +206 -0
- package/dist/templates/commands/pt-BR/warm-up.md +59 -0
- package/package.json +7 -3
- package/templates/commands/en/engineer/plan.md +301 -0
- package/templates/commands/en/engineer/pr.md +194 -0
- package/templates/commands/en/engineer/pre-pr.md +325 -0
- package/templates/commands/en/engineer/start.md +285 -0
- package/templates/commands/en/engineer/work.md +256 -0
- package/templates/commands/en/products/check.md +237 -0
- package/templates/commands/en/products/collect.md +170 -0
- package/templates/commands/en/products/refine.md +231 -0
- package/templates/commands/en/products/spec.md +273 -0
- package/templates/commands/en/quality/metrics.md +266 -0
- package/templates/commands/en/quality/observe.md +172 -0
- package/templates/commands/en/warm-up.md +59 -0
- package/templates/commands/es/agents/CONTEXT-CONTRACT.md +63 -0
- package/templates/commands/es/agents/implementer.md +27 -0
- package/templates/commands/es/agents/integrator.md +24 -0
- package/templates/commands/es/agents/reviewer.md +31 -0
- package/templates/commands/es/agents/tester.md +22 -0
- package/templates/commands/es/engineer/plan.md +335 -0
- package/templates/commands/es/engineer/pr.md +228 -0
- package/templates/commands/es/engineer/pre-pr.md +359 -0
- package/templates/commands/es/engineer/start.md +318 -0
- package/templates/commands/es/engineer/work.md +290 -0
- package/templates/commands/es/orchestrate.md +125 -0
- package/templates/commands/es/products/check.md +271 -0
- package/templates/commands/es/products/collect.md +218 -0
- package/templates/commands/es/products/refine.md +265 -0
- package/templates/commands/es/products/spec.md +306 -0
- package/templates/commands/es/quality/metrics.md +300 -0
- package/templates/commands/es/quality/observe.md +205 -0
- package/templates/commands/es/warm-up.md +59 -0
- package/templates/commands/pt-BR/engineer/plan.md +335 -0
- package/templates/commands/pt-BR/engineer/pr.md +228 -0
- package/templates/commands/pt-BR/engineer/pre-pr.md +359 -0
- package/templates/commands/pt-BR/engineer/start.md +319 -0
- package/templates/commands/pt-BR/engineer/work.md +290 -0
- package/templates/commands/pt-BR/products/check.md +271 -0
- package/templates/commands/pt-BR/products/collect.md +219 -0
- package/templates/commands/pt-BR/products/refine.md +265 -0
- package/templates/commands/pt-BR/products/spec.md +307 -0
- package/templates/commands/pt-BR/quality/metrics.md +300 -0
- package/templates/commands/pt-BR/quality/observe.md +206 -0
- package/templates/commands/pt-BR/warm-up.md +59 -0
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
# Specification Creation (PRD)
|
|
2
|
+
|
|
3
|
+
This command creates the complete specification (Product Requirements Document) for the feature.
|
|
4
|
+
|
|
5
|
+
## ⚠️ IMPORTANT: This Command DOES NOT Implement Code
|
|
6
|
+
|
|
7
|
+
**This command is ONLY for requirements documentation:**
|
|
8
|
+
- ✅ Create PRD (Product Requirements Document)
|
|
9
|
+
- ✅ Update issue in the task manager via MCP
|
|
10
|
+
- ✅ **READ** files from main repositories (read-only)
|
|
11
|
+
- ❌ **DO NOT implement code**
|
|
12
|
+
- ❌ **DO NOT edit code files**
|
|
13
|
+
- ❌ **DO NOT checkout branches in main repositories**
|
|
14
|
+
- ❌ **DO NOT make commits**
|
|
15
|
+
|
|
16
|
+
**Next step**: `/orchestrate <ISSUE-ID>` to derive the agent graph and execute (recommended). `/start` remains a manual escape hatch.
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## Configuration
|
|
21
|
+
|
|
22
|
+
Read `context-manifest.json` and `ai.properties.md` from the orchestrator to get repositories, base_path, and task_management_system.
|
|
23
|
+
|
|
24
|
+
## 📋 Prerequisites
|
|
25
|
+
|
|
26
|
+
- Issue refined via `/refine`
|
|
27
|
+
- Approval to proceed with the feature
|
|
28
|
+
|
|
29
|
+
## 📚 Load MetaSpecs
|
|
30
|
+
|
|
31
|
+
**Automatically locate MetaSpecs**:
|
|
32
|
+
1. Read `context-manifest.json` from the orchestrator
|
|
33
|
+
2. Find the repository with `"role": "metaspecs"`
|
|
34
|
+
3. Read `ai.properties.md` to get the `base_path`
|
|
35
|
+
4. The metaspecs are located at: `{base_path}/{metaspecs-repo-id}/`
|
|
36
|
+
5. Read relevant `index.md` files to ensure compliance with:
|
|
37
|
+
- System architecture
|
|
38
|
+
- Design patterns
|
|
39
|
+
- Technical constraints
|
|
40
|
+
- Project conventions
|
|
41
|
+
|
|
42
|
+
## 🎯 Objective
|
|
43
|
+
|
|
44
|
+
Create a complete PRD that will serve as the single source of truth for implementation.
|
|
45
|
+
|
|
46
|
+
## 📝 PRD Structure
|
|
47
|
+
|
|
48
|
+
### 1. Overview
|
|
49
|
+
|
|
50
|
+
```markdown
|
|
51
|
+
# [Feature Title]
|
|
52
|
+
|
|
53
|
+
## Context
|
|
54
|
+
[Why are we building this? What problem does it solve?]
|
|
55
|
+
|
|
56
|
+
## Objective
|
|
57
|
+
[What do we want to achieve with this feature?]
|
|
58
|
+
|
|
59
|
+
## Success Metrics
|
|
60
|
+
- [Metric 1]: [How to measure]
|
|
61
|
+
- [Metric 2]: [How to measure]
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### 2. Functional Requirements
|
|
65
|
+
|
|
66
|
+
```markdown
|
|
67
|
+
## Functional Requirements
|
|
68
|
+
|
|
69
|
+
### RF-01: [Requirement Name]
|
|
70
|
+
**Description**: [Detailed description]
|
|
71
|
+
**Priority**: Must Have / Should Have / Could Have
|
|
72
|
+
**Repositories**: [affected repos]
|
|
73
|
+
|
|
74
|
+
### RF-02: [Requirement Name]
|
|
75
|
+
**Description**: [Detailed description]
|
|
76
|
+
**Priority**: Must Have / Should Have / Could Have
|
|
77
|
+
**Repositories**: [affected repos]
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### 3. Non-Functional Requirements
|
|
81
|
+
|
|
82
|
+
```markdown
|
|
83
|
+
## Non-Functional Requirements
|
|
84
|
+
|
|
85
|
+
### Performance
|
|
86
|
+
- [Performance requirement]
|
|
87
|
+
|
|
88
|
+
### Security
|
|
89
|
+
- [Security requirement]
|
|
90
|
+
|
|
91
|
+
### Accessibility
|
|
92
|
+
- [Accessibility requirement]
|
|
93
|
+
|
|
94
|
+
### Scalability
|
|
95
|
+
- [Scalability requirement]
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
### 4. User Flows
|
|
99
|
+
|
|
100
|
+
```markdown
|
|
101
|
+
## User Flows
|
|
102
|
+
|
|
103
|
+
### Main Flow
|
|
104
|
+
1. [Step 1]
|
|
105
|
+
2. [Step 2]
|
|
106
|
+
3. [Step 3]
|
|
107
|
+
|
|
108
|
+
### Alternative Flows
|
|
109
|
+
**Scenario**: [Scenario name]
|
|
110
|
+
1. [Step 1]
|
|
111
|
+
2. [Step 2]
|
|
112
|
+
|
|
113
|
+
### Error Handling
|
|
114
|
+
**Error**: [Error type]
|
|
115
|
+
**Behavior**: [How the system should react]
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
### 5. Technical Specification
|
|
119
|
+
|
|
120
|
+
```markdown
|
|
121
|
+
## Technical Specification
|
|
122
|
+
|
|
123
|
+
### Architecture
|
|
124
|
+
|
|
125
|
+
#### <repo-1>
|
|
126
|
+
- **New components**: [list]
|
|
127
|
+
- **Modified components**: [list]
|
|
128
|
+
- **APIs**: [new/modified endpoints]
|
|
129
|
+
|
|
130
|
+
#### <repo-2>
|
|
131
|
+
- **New components**: [list]
|
|
132
|
+
- **Modified components**: [list]
|
|
133
|
+
- **APIs**: [new/modified endpoints]
|
|
134
|
+
|
|
135
|
+
### Integrations
|
|
136
|
+
- **Between repos**: [how repos communicate]
|
|
137
|
+
- **External**: [external APIs, if any]
|
|
138
|
+
|
|
139
|
+
### Data Model
|
|
140
|
+
[Describe changes to data model, if any]
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
### 6. Acceptance Criteria
|
|
144
|
+
|
|
145
|
+
```markdown
|
|
146
|
+
## Acceptance Criteria
|
|
147
|
+
|
|
148
|
+
### Functional
|
|
149
|
+
- [ ] [Specific and testable criterion]
|
|
150
|
+
- [ ] [Specific and testable criterion]
|
|
151
|
+
|
|
152
|
+
### Technical
|
|
153
|
+
- [ ] Unit tests with coverage >= X%
|
|
154
|
+
- [ ] Integration tests implemented
|
|
155
|
+
- [ ] Performance within requirements
|
|
156
|
+
- [ ] Documentation updated
|
|
157
|
+
|
|
158
|
+
### Quality
|
|
159
|
+
- [ ] Code review approved
|
|
160
|
+
- [ ] No regressions
|
|
161
|
+
- [ ] Accessibility validated
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
### 7. Out of Scope
|
|
165
|
+
|
|
166
|
+
```markdown
|
|
167
|
+
## Out of Scope
|
|
168
|
+
|
|
169
|
+
Features that will NOT be implemented in this version:
|
|
170
|
+
- [Item 1]
|
|
171
|
+
- [Item 2]
|
|
172
|
+
|
|
173
|
+
Justification: [Why these are deferred]
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
### 8. Risks and Mitigations
|
|
177
|
+
|
|
178
|
+
```markdown
|
|
179
|
+
## Risks and Mitigations
|
|
180
|
+
|
|
181
|
+
### Risk 1: [Description]
|
|
182
|
+
- **Probability**: High / Medium / Low
|
|
183
|
+
- **Impact**: High / Medium / Low
|
|
184
|
+
- **Mitigation**: [How to mitigate]
|
|
185
|
+
|
|
186
|
+
### Risk 2: [Description]
|
|
187
|
+
- **Probability**: High / Medium / Low
|
|
188
|
+
- **Impact**: High / Medium / Low
|
|
189
|
+
- **Mitigation**: [How to mitigate]
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
### 9. Dependencies
|
|
193
|
+
|
|
194
|
+
```markdown
|
|
195
|
+
## Dependencies
|
|
196
|
+
|
|
197
|
+
### Technical
|
|
198
|
+
- [Technical dependency 1]
|
|
199
|
+
- [Technical dependency 2]
|
|
200
|
+
|
|
201
|
+
### Business
|
|
202
|
+
- [Business dependency 1]
|
|
203
|
+
- [Business dependency 2]
|
|
204
|
+
|
|
205
|
+
### Blockers
|
|
206
|
+
- [Blocker 1 and plan to resolve]
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
### 10. Test Plan
|
|
210
|
+
|
|
211
|
+
```markdown
|
|
212
|
+
## Test Plan
|
|
213
|
+
|
|
214
|
+
### Unit Tests
|
|
215
|
+
- [Area 1 to be tested]
|
|
216
|
+
- [Area 2 to be tested]
|
|
217
|
+
|
|
218
|
+
### Integration Tests
|
|
219
|
+
- [Scenario 1]
|
|
220
|
+
- [Scenario 2]
|
|
221
|
+
|
|
222
|
+
### Manual Tests
|
|
223
|
+
- [Scenario 1]
|
|
224
|
+
- [Scenario 2]
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
## 📄 Saving the PRD
|
|
228
|
+
|
|
229
|
+
**PRIORITY 1: Use MCP (Model Context Protocol)**
|
|
230
|
+
|
|
231
|
+
- Read `ai.properties.md` from the orchestrator to identify the `task_management_system`
|
|
232
|
+
- Use the appropriate MCP to update the issue with the PRD:
|
|
233
|
+
- Add the complete PRD as a comment on the issue
|
|
234
|
+
- Or attach as a file (if the task manager supports it)
|
|
235
|
+
- Update status/labels (e.g., "spec-ready", "ready-for-dev")
|
|
236
|
+
- Inform the user: "✅ PRD added to issue [ID]"
|
|
237
|
+
|
|
238
|
+
**FALLBACK: Create .md file only if MCP fails**
|
|
239
|
+
|
|
240
|
+
If MCP is unavailable or fails:
|
|
241
|
+
- Save to `./.sessions/<ISSUE-ID>/prd.md`
|
|
242
|
+
- Inform the user: "⚠️ PRD saved locally in .sessions/ (task manager not available)"
|
|
243
|
+
|
|
244
|
+
## 🔍 Review and Approval
|
|
245
|
+
|
|
246
|
+
Before finishing:
|
|
247
|
+
1. Review the PRD with stakeholders
|
|
248
|
+
2. Validate against metaspecs (if available)
|
|
249
|
+
3. Obtain approval to start implementation
|
|
250
|
+
4. **Via MCP**: Update the issue in the task manager with status "Ready for Development"
|
|
251
|
+
5. **Fallback**: Document approval in `./.sessions/<ISSUE-ID>/prd.md`
|
|
252
|
+
|
|
253
|
+
---
|
|
254
|
+
|
|
255
|
+
**Provided arguments**:
|
|
256
|
+
|
|
257
|
+
```
|
|
258
|
+
#$ARGUMENTS
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
---
|
|
262
|
+
|
|
263
|
+
## 🎯 Next Step
|
|
264
|
+
|
|
265
|
+
After PRD approval, run:
|
|
266
|
+
|
|
267
|
+
```bash
|
|
268
|
+
/orchestrate <ISSUE-ID>
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
This derives the minimum agent graph from the spec and executes it. `/start` + `/plan` + `/work` remain available as manual escape hatches.
|
|
272
|
+
|
|
273
|
+
This command will start feature development.
|
|
@@ -0,0 +1,266 @@
|
|
|
1
|
+
# Quality Metrics
|
|
2
|
+
|
|
3
|
+
This command collects and analyzes quality metrics of the code and the development process.
|
|
4
|
+
|
|
5
|
+
## 🎯 Objective
|
|
6
|
+
|
|
7
|
+
Measure and document the quality of the implementation through objective metrics:
|
|
8
|
+
- Test coverage
|
|
9
|
+
- Code complexity
|
|
10
|
+
- Technical debt
|
|
11
|
+
- Performance
|
|
12
|
+
- Compliance with standards
|
|
13
|
+
|
|
14
|
+
## Configuration
|
|
15
|
+
|
|
16
|
+
Read `context-manifest.json` and `ai.properties.md` from the orchestrator to get repositories, base_path, and task_management_system.
|
|
17
|
+
|
|
18
|
+
## 📋 Prerequisites
|
|
19
|
+
|
|
20
|
+
- Implementation completed (after `/work`)
|
|
21
|
+
- Tests implemented
|
|
22
|
+
- Build working
|
|
23
|
+
|
|
24
|
+
## 📊 Metrics to Collect
|
|
25
|
+
|
|
26
|
+
### 1. Test Coverage
|
|
27
|
+
|
|
28
|
+
For each modified repository:
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
cd <repository>
|
|
32
|
+
|
|
33
|
+
# Run tests with coverage (examples by stack):
|
|
34
|
+
# Node.js: npm run test:coverage / jest --coverage
|
|
35
|
+
# Python: pytest --cov=src tests/
|
|
36
|
+
# Java: mvn jacoco:report / gradle jacocoTestReport
|
|
37
|
+
# Go: go test -cover ./...
|
|
38
|
+
# Ruby: rspec --coverage
|
|
39
|
+
# Rust: cargo tarpaulin
|
|
40
|
+
# PHP: ./vendor/bin/phpunit --coverage-html coverage/
|
|
41
|
+
# C#: dotnet test /p:CollectCoverage=true
|
|
42
|
+
|
|
43
|
+
# Capture results
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Document:
|
|
47
|
+
```markdown
|
|
48
|
+
## Test Coverage
|
|
49
|
+
|
|
50
|
+
### <repo-1>
|
|
51
|
+
- **Total Coverage**: X%
|
|
52
|
+
- **Statements**: X%
|
|
53
|
+
- **Branches**: X%
|
|
54
|
+
- **Functions**: X%
|
|
55
|
+
- **Lines**: X%
|
|
56
|
+
- **Uncovered Files**: [list]
|
|
57
|
+
|
|
58
|
+
### <repo-2>
|
|
59
|
+
[Same format]
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### 2. Code Complexity
|
|
63
|
+
|
|
64
|
+
Analyze the cyclomatic complexity of modified files:
|
|
65
|
+
|
|
66
|
+
```markdown
|
|
67
|
+
## Code Complexity
|
|
68
|
+
|
|
69
|
+
### Files with High Complexity
|
|
70
|
+
- **file1.ts**: Complexity 15 (recommended: < 10)
|
|
71
|
+
- **file2.ts**: Complexity 12
|
|
72
|
+
|
|
73
|
+
### Recommendations
|
|
74
|
+
- [Refactoring suggestion 1]
|
|
75
|
+
- [Refactoring suggestion 2]
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### 3. Code Quality
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
# Run linting (examples by stack):
|
|
82
|
+
# Node.js: npm run lint / eslint .
|
|
83
|
+
# Python: flake8 . / pylint src/
|
|
84
|
+
# Java: mvn checkstyle:check
|
|
85
|
+
# Go: golangci-lint run
|
|
86
|
+
# Ruby: rubocop
|
|
87
|
+
# Rust: cargo clippy
|
|
88
|
+
|
|
89
|
+
# Check formatting (examples by stack):
|
|
90
|
+
# Node.js: prettier --check .
|
|
91
|
+
# Python: black --check .
|
|
92
|
+
# Java: mvn formatter:validate
|
|
93
|
+
# Go: gofmt -l .
|
|
94
|
+
# Ruby: rubocop --format-only
|
|
95
|
+
# Rust: cargo fmt --check
|
|
96
|
+
|
|
97
|
+
# Static analysis (examples by stack):
|
|
98
|
+
# Node.js: npm run analyze (if configured)
|
|
99
|
+
# Python: mypy src/ / bandit -r src/
|
|
100
|
+
# Java: mvn pmd:check / spotbugs:check
|
|
101
|
+
# Go: go vet ./...
|
|
102
|
+
# Ruby: brakeman (for Rails)
|
|
103
|
+
# Rust: cargo audit
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
Document:
|
|
107
|
+
```markdown
|
|
108
|
+
## Code Quality
|
|
109
|
+
|
|
110
|
+
### Linting
|
|
111
|
+
- **Errors**: 0
|
|
112
|
+
- **Warnings**: X
|
|
113
|
+
- **Justified Warnings**: [list with justifications]
|
|
114
|
+
|
|
115
|
+
### Formatting
|
|
116
|
+
- **Status**: ✅ Compliant / ⚠️ Adjustments needed
|
|
117
|
+
|
|
118
|
+
### Static Analysis
|
|
119
|
+
- **Critical Issues**: 0
|
|
120
|
+
- **Medium Issues**: X
|
|
121
|
+
- **Low Issues**: Y
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
### 4. Performance
|
|
125
|
+
|
|
126
|
+
If applicable, measure performance:
|
|
127
|
+
|
|
128
|
+
```markdown
|
|
129
|
+
## Performance
|
|
130
|
+
|
|
131
|
+
### Benchmarks
|
|
132
|
+
- **Operation X**: Yms (baseline: Zms)
|
|
133
|
+
- **Operation Y**: Yms (baseline: Zms)
|
|
134
|
+
|
|
135
|
+
### Applied Optimizations
|
|
136
|
+
- [Optimization 1 and impact]
|
|
137
|
+
- [Optimization 2 and impact]
|
|
138
|
+
|
|
139
|
+
### Identified Bottlenecks
|
|
140
|
+
- [Bottleneck 1 and mitigation plan]
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
### 5. Size and Impact
|
|
144
|
+
|
|
145
|
+
```markdown
|
|
146
|
+
## Size and Impact
|
|
147
|
+
|
|
148
|
+
### Lines of Code
|
|
149
|
+
- **Added**: +X lines
|
|
150
|
+
- **Removed**: -Y lines
|
|
151
|
+
- **Modified**: Z lines
|
|
152
|
+
|
|
153
|
+
### Files
|
|
154
|
+
- **New**: X files
|
|
155
|
+
- **Modified**: Y files
|
|
156
|
+
- **Removed**: Z files
|
|
157
|
+
|
|
158
|
+
### Dependencies
|
|
159
|
+
- **New dependencies**: [list]
|
|
160
|
+
- **Bundle size**: +X KB
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
### 6. Technical Debt
|
|
164
|
+
|
|
165
|
+
Identify technical debt introduced or resolved:
|
|
166
|
+
|
|
167
|
+
```markdown
|
|
168
|
+
## Technical Debt
|
|
169
|
+
|
|
170
|
+
### Debt Introduced
|
|
171
|
+
- **Item 1**: [Description and justification]
|
|
172
|
+
- Severity: High / Medium / Low
|
|
173
|
+
- Resolution plan: [when and how to resolve]
|
|
174
|
+
|
|
175
|
+
### Debt Resolved
|
|
176
|
+
- **Item 1**: [What was resolved]
|
|
177
|
+
- Impact: [improvement achieved]
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
## 📄 Metrics Report
|
|
181
|
+
|
|
182
|
+
Create `./.sessions/<ISSUE-ID>/metrics.md`:
|
|
183
|
+
|
|
184
|
+
```markdown
|
|
185
|
+
# Metrics Report - [ISSUE-ID]
|
|
186
|
+
|
|
187
|
+
**Date**: [date/time]
|
|
188
|
+
**Repositories**: [list]
|
|
189
|
+
|
|
190
|
+
## Executive Summary
|
|
191
|
+
|
|
192
|
+
- **Test Coverage**: X% (goal: Y%)
|
|
193
|
+
- **Code Quality**: ✅ / ⚠️ / ❌
|
|
194
|
+
- **Performance**: ✅ / ⚠️ / ❌
|
|
195
|
+
- **Technical Debt**: Low / Medium / High
|
|
196
|
+
|
|
197
|
+
## Detailed Metrics
|
|
198
|
+
|
|
199
|
+
[Include all sections above]
|
|
200
|
+
|
|
201
|
+
## Comparison with Baseline
|
|
202
|
+
|
|
203
|
+
| Metric | Before | After | Variation |
|
|
204
|
+
|--------|--------|-------|-----------|
|
|
205
|
+
| Coverage | X% | Y% | +Z% |
|
|
206
|
+
| Average Complexity | X | Y | +Z |
|
|
207
|
+
| Bundle Size | X KB | Y KB | +Z KB |
|
|
208
|
+
|
|
209
|
+
## Recommended Actions
|
|
210
|
+
|
|
211
|
+
1. [Action 1 - high priority]
|
|
212
|
+
2. [Action 2 - medium priority]
|
|
213
|
+
3. [Action 3 - low priority]
|
|
214
|
+
|
|
215
|
+
## Approval for Merge
|
|
216
|
+
|
|
217
|
+
- [ ] Test coverage >= goal
|
|
218
|
+
- [ ] No critical quality issues
|
|
219
|
+
- [ ] Performance within requirements
|
|
220
|
+
- [ ] Technical debt documented and approved
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
## 🎯 Quality Goals
|
|
224
|
+
|
|
225
|
+
If the project has goals defined in metaspecs, validate:
|
|
226
|
+
|
|
227
|
+
```markdown
|
|
228
|
+
## Validation against Goals
|
|
229
|
+
|
|
230
|
+
### Project Goals
|
|
231
|
+
- **Minimum coverage**: 80%
|
|
232
|
+
- **Maximum complexity**: 10
|
|
233
|
+
- **Performance**: < 100ms
|
|
234
|
+
|
|
235
|
+
### Status
|
|
236
|
+
- Coverage: ✅ 85% (goal: 80%)
|
|
237
|
+
- Complexity: ⚠️ 12 (goal: 10) - Justified
|
|
238
|
+
- Performance: ✅ 85ms (goal: 100ms)
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
## 🚨 Alerts
|
|
242
|
+
|
|
243
|
+
If any metric is out of acceptable range:
|
|
244
|
+
1. 🛑 **DOCUMENT** the issue
|
|
245
|
+
2. 💬 **ALERT** the user
|
|
246
|
+
3. 🔧 **PROPOSE** corrective actions
|
|
247
|
+
4. ⏸️ **CONSIDER** blocking the merge until resolution
|
|
248
|
+
|
|
249
|
+
---
|
|
250
|
+
|
|
251
|
+
**Provided arguments**:
|
|
252
|
+
|
|
253
|
+
```
|
|
254
|
+
#$ARGUMENTS
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
---
|
|
258
|
+
|
|
259
|
+
## 🎯 Outcome
|
|
260
|
+
|
|
261
|
+
After running this command, you will have:
|
|
262
|
+
- Complete metrics report
|
|
263
|
+
- Comparison with baseline and goals
|
|
264
|
+
- Identification of quality issues
|
|
265
|
+
- Recommendations for actions
|
|
266
|
+
- Objective basis for merge approval
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
# Decision Observability
|
|
2
|
+
|
|
3
|
+
This command records important decisions made during development, creating an auditable log for explainability and traceability.
|
|
4
|
+
|
|
5
|
+
## 🎯 Objective
|
|
6
|
+
|
|
7
|
+
Create a structured record of technical and product decisions, ensuring:
|
|
8
|
+
- **Explainability**: Why each decision was made
|
|
9
|
+
- **Traceability**: Which sources (PRD, metaspecs, ADRs) supported the decision
|
|
10
|
+
- **Audit**: Complete history of choices for future review
|
|
11
|
+
- **Learning**: Documentation of trade-offs and alternatives considered
|
|
12
|
+
|
|
13
|
+
**IMPORTANT**: This command DOES NOT generate new decisions. It only RECORDS decisions that have already been made during the development process.
|
|
14
|
+
|
|
15
|
+
## Configuration
|
|
16
|
+
|
|
17
|
+
Read `context-manifest.json` and `ai.properties.md` from the orchestrator to get repositories, base_path, and task_management_system.
|
|
18
|
+
|
|
19
|
+
## 📋 Prerequisites
|
|
20
|
+
|
|
21
|
+
- Have executed at least one of the commands that generate decisions:
|
|
22
|
+
- `/spec` - generates PRD with product decisions
|
|
23
|
+
- `/plan` - generates plan.md with technical decisions
|
|
24
|
+
- `/work` - implementation generates decisions during development
|
|
25
|
+
|
|
26
|
+
## 🔍 Observation Process
|
|
27
|
+
|
|
28
|
+
### 1. Identify Relevant Decisions
|
|
29
|
+
|
|
30
|
+
Analyze the session files (`./.sessions/<ISSUE-ID>/`) to identify decisions:
|
|
31
|
+
|
|
32
|
+
**After `/spec`** - Product Decisions:
|
|
33
|
+
- Read `./.sessions/<ISSUE-ID>/prd.md`
|
|
34
|
+
- Identify decisions in:
|
|
35
|
+
- Scope (what is included/excluded in the feature)
|
|
36
|
+
- Personas served (who is the target audience)
|
|
37
|
+
- Success metrics (how to measure results)
|
|
38
|
+
- Non-functional requirements (performance, accessibility)
|
|
39
|
+
- Constraints and trade-offs
|
|
40
|
+
|
|
41
|
+
**After `/plan`** - Technical Decisions:
|
|
42
|
+
- Read `./.sessions/<ISSUE-ID>/plan.md`
|
|
43
|
+
- Identify decisions in:
|
|
44
|
+
- Component/module architecture
|
|
45
|
+
- Choice of libraries or tools
|
|
46
|
+
- Implementation patterns
|
|
47
|
+
- Data structure
|
|
48
|
+
- Testing strategy
|
|
49
|
+
|
|
50
|
+
**During `/work`** - Implementation Decisions:
|
|
51
|
+
- Read `./.sessions/<ISSUE-ID>/work.md`
|
|
52
|
+
- Identify decisions in:
|
|
53
|
+
- Refactorings performed
|
|
54
|
+
- Approach changes
|
|
55
|
+
- Applied optimizations
|
|
56
|
+
- Edge case handling
|
|
57
|
+
|
|
58
|
+
### 2. Document Each Decision
|
|
59
|
+
|
|
60
|
+
For each identified decision, document:
|
|
61
|
+
|
|
62
|
+
```markdown
|
|
63
|
+
## Decision: [Clear Title]
|
|
64
|
+
|
|
65
|
+
**Context**: [Why do we need to decide this? What is the problem or need?]
|
|
66
|
+
|
|
67
|
+
**Options Considered**:
|
|
68
|
+
1. **Option A**: [Description]
|
|
69
|
+
- Pros: [advantages]
|
|
70
|
+
- Cons: [disadvantages]
|
|
71
|
+
2. **Option B**: [Description]
|
|
72
|
+
- Pros: [advantages]
|
|
73
|
+
- Cons: [disadvantages]
|
|
74
|
+
|
|
75
|
+
**Decision**: [Chosen option]
|
|
76
|
+
|
|
77
|
+
**Justification**: [Why did we choose this option? Which criteria were most important?]
|
|
78
|
+
|
|
79
|
+
**Sources**:
|
|
80
|
+
- [PRD section X]
|
|
81
|
+
- [Metaspec Y]
|
|
82
|
+
- [ADR-00Z]
|
|
83
|
+
|
|
84
|
+
**Accepted Trade-offs**: [Which disadvantages did we consciously accept?]
|
|
85
|
+
|
|
86
|
+
**Reversibility**: Easy / Medium / Hard
|
|
87
|
+
|
|
88
|
+
**Date**: [decision date]
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
### 3. Create Decision Log
|
|
92
|
+
|
|
93
|
+
Save in `./.sessions/<ISSUE-ID>/decisions.md`:
|
|
94
|
+
|
|
95
|
+
```markdown
|
|
96
|
+
# Decision Log - [ISSUE-ID]
|
|
97
|
+
|
|
98
|
+
## Summary
|
|
99
|
+
[Brief summary of the main decisions made in this feature]
|
|
100
|
+
|
|
101
|
+
## Product Decisions
|
|
102
|
+
|
|
103
|
+
### [Decision 1]
|
|
104
|
+
[As per template above]
|
|
105
|
+
|
|
106
|
+
### [Decision 2]
|
|
107
|
+
[As per template above]
|
|
108
|
+
|
|
109
|
+
## Technical Decisions
|
|
110
|
+
|
|
111
|
+
### [Decision 3]
|
|
112
|
+
[As per template above]
|
|
113
|
+
|
|
114
|
+
### [Decision 4]
|
|
115
|
+
[As per template above]
|
|
116
|
+
|
|
117
|
+
## Implementation Decisions
|
|
118
|
+
|
|
119
|
+
### [Decision 5]
|
|
120
|
+
[As per template above]
|
|
121
|
+
|
|
122
|
+
## Lessons Learned
|
|
123
|
+
- [Lesson 1]
|
|
124
|
+
- [Lesson 2]
|
|
125
|
+
|
|
126
|
+
## Pending Decisions
|
|
127
|
+
- [Decision that still needs to be made]
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
## 📊 Impact Analysis
|
|
131
|
+
|
|
132
|
+
For critical decisions, document the impact:
|
|
133
|
+
|
|
134
|
+
```markdown
|
|
135
|
+
## Impact Analysis
|
|
136
|
+
|
|
137
|
+
**Affected Repositories**: [list]
|
|
138
|
+
|
|
139
|
+
**Impacted Components**: [list]
|
|
140
|
+
|
|
141
|
+
**Created Dependencies**: [list]
|
|
142
|
+
|
|
143
|
+
**Introduced Risks**: [list]
|
|
144
|
+
|
|
145
|
+
**Applied Mitigations**: [list]
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
## 🔄 Decision Review
|
|
149
|
+
|
|
150
|
+
Periodically review the decisions made:
|
|
151
|
+
- Do they still make sense?
|
|
152
|
+
- Have the trade-offs proven correct?
|
|
153
|
+
- Are there learnings to document?
|
|
154
|
+
- Does any decision need to be reversed?
|
|
155
|
+
|
|
156
|
+
---
|
|
157
|
+
|
|
158
|
+
**Provided arguments**:
|
|
159
|
+
|
|
160
|
+
```
|
|
161
|
+
#$ARGUMENTS
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
---
|
|
165
|
+
|
|
166
|
+
## 🎯 Outcome
|
|
167
|
+
|
|
168
|
+
After running this command, you will have:
|
|
169
|
+
- Complete decision log in `./.sessions/<ISSUE-ID>/decisions.md`
|
|
170
|
+
- Traceability of every choice made
|
|
171
|
+
- Documentation for future reference
|
|
172
|
+
- Basis for ADRs (if decisions are architectural)
|