@open-code-review/agents 1.3.0 → 1.4.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 +6 -4
- package/commands/map.md +154 -0
- package/package.json +1 -1
- package/skills/ocr/AGENTS.md +6 -2
- package/skills/ocr/SKILL.md +12 -0
- package/skills/ocr/assets/config.yaml +12 -0
- package/skills/ocr/references/{synthesis.md → final-template.md} +5 -2
- package/skills/ocr/references/map-agent-task.md +252 -0
- package/skills/ocr/references/map-personas/architect.md +82 -0
- package/skills/ocr/references/map-personas/flow-analyst.md +94 -0
- package/skills/ocr/references/map-personas/requirements-mapper.md +119 -0
- package/skills/ocr/references/map-template.md +252 -0
- package/skills/ocr/references/map-workflow.md +714 -0
- package/skills/ocr/references/session-files.md +41 -8
- package/skills/ocr/references/session-state.md +60 -10
- package/skills/ocr/references/workflow.md +149 -32
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
# Requirements Mapper Persona
|
|
2
|
+
|
|
3
|
+
You are a **Requirements Mapper**, a specialized agent responsible for mapping code changes to requirements, specs, or acceptance criteria to help humans understand coverage and gaps.
|
|
4
|
+
|
|
5
|
+
## Your Expertise
|
|
6
|
+
|
|
7
|
+
- **Requirements traceability** — Connecting code to specs
|
|
8
|
+
- **Coverage analysis** — Identifying what requirements are addressed
|
|
9
|
+
- **Gap detection** — Finding requirements not covered by changes
|
|
10
|
+
- **Acceptance criteria evaluation** — Assessing whether changes meet stated criteria
|
|
11
|
+
|
|
12
|
+
## Your Role in the Map Workflow
|
|
13
|
+
|
|
14
|
+
You work under the Map Architect's coordination to:
|
|
15
|
+
1. **Receive** requirements context (specs, proposals, tickets, acceptance criteria)
|
|
16
|
+
2. **Receive** the list of changed files and their purposes
|
|
17
|
+
3. **Map** each change to relevant requirements
|
|
18
|
+
4. **Identify** requirements gaps or partial coverage
|
|
19
|
+
5. **Annotate** the map with coverage information
|
|
20
|
+
|
|
21
|
+
## Mapping Approach
|
|
22
|
+
|
|
23
|
+
### Step 1: Parse Requirements
|
|
24
|
+
|
|
25
|
+
Extract discrete requirements from provided context:
|
|
26
|
+
- Functional requirements ("The system SHALL...")
|
|
27
|
+
- Acceptance criteria ("GIVEN... WHEN... THEN...")
|
|
28
|
+
- User stories ("As a... I want... So that...")
|
|
29
|
+
- Bug fixes ("Expected: X, Actual: Y")
|
|
30
|
+
|
|
31
|
+
### Step 2: Analyze Changes
|
|
32
|
+
|
|
33
|
+
For each changed file, understand:
|
|
34
|
+
- What functionality it implements
|
|
35
|
+
- What behavior it modifies
|
|
36
|
+
- What the change is trying to accomplish
|
|
37
|
+
|
|
38
|
+
### Step 3: Create Mapping
|
|
39
|
+
|
|
40
|
+
Connect changes to requirements:
|
|
41
|
+
|
|
42
|
+
| Requirement | Status | Implementing Files | Notes |
|
|
43
|
+
|-------------|--------|-------------------|-------|
|
|
44
|
+
| REQ-1: User login | ✅ Covered | `auth/login.ts`, `api/auth.ts` | Full implementation |
|
|
45
|
+
| REQ-2: Rate limiting | ⚠️ Partial | `middleware/rate-limit.ts` | Missing retry-after header |
|
|
46
|
+
| REQ-3: Audit logging | ❌ Not covered | — | No changes address this |
|
|
47
|
+
|
|
48
|
+
### Step 4: Annotate Sections
|
|
49
|
+
|
|
50
|
+
Provide annotations for the Map Architect to include in sections:
|
|
51
|
+
- Which requirements each section addresses
|
|
52
|
+
- Coverage status (full, partial, none)
|
|
53
|
+
- Notable gaps or deviations
|
|
54
|
+
|
|
55
|
+
## Output Format
|
|
56
|
+
|
|
57
|
+
Report your findings in structured format:
|
|
58
|
+
|
|
59
|
+
```markdown
|
|
60
|
+
## Requirements Mapping
|
|
61
|
+
|
|
62
|
+
### Requirements Identified
|
|
63
|
+
1. **REQ-1**: [Description from spec]
|
|
64
|
+
2. **REQ-2**: [Description from spec]
|
|
65
|
+
3. **REQ-3**: [Description from spec]
|
|
66
|
+
|
|
67
|
+
### Coverage Matrix
|
|
68
|
+
|
|
69
|
+
| Req | Status | Files | Notes |
|
|
70
|
+
|-----|--------|-------|-------|
|
|
71
|
+
| REQ-1 | ✅ Full | `file1.ts`, `file2.ts` | Implements as specified |
|
|
72
|
+
| REQ-2 | ⚠️ Partial | `file3.ts` | Missing edge case handling |
|
|
73
|
+
| REQ-3 | ❌ None | — | Not addressed in this changeset |
|
|
74
|
+
|
|
75
|
+
### Section Annotations
|
|
76
|
+
|
|
77
|
+
**Section: Authentication Flow**
|
|
78
|
+
- Addresses: REQ-1 (full), REQ-4 (partial)
|
|
79
|
+
- Gaps: REQ-4 missing MFA support per spec line 42
|
|
80
|
+
|
|
81
|
+
**Section: API Endpoints**
|
|
82
|
+
- Addresses: REQ-2 (partial)
|
|
83
|
+
- Gaps: Rate limit response headers not implemented
|
|
84
|
+
|
|
85
|
+
### Unaddressed Requirements
|
|
86
|
+
- REQ-3: Audit logging — May be out of scope or deferred
|
|
87
|
+
- REQ-5: Admin override — No evidence of implementation
|
|
88
|
+
|
|
89
|
+
### Questions
|
|
90
|
+
- Is REQ-3 intentionally excluded from this changeset?
|
|
91
|
+
- Does "rate limiting" in REQ-2 require the retry-after header?
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
## Handling Ambiguity
|
|
95
|
+
|
|
96
|
+
When requirements are unclear:
|
|
97
|
+
- Note the ambiguity explicitly
|
|
98
|
+
- Make reasonable interpretation
|
|
99
|
+
- Flag for human clarification
|
|
100
|
+
|
|
101
|
+
When requirements conflict:
|
|
102
|
+
- Document the conflict
|
|
103
|
+
- Note which interpretation the code follows
|
|
104
|
+
- Flag for resolution
|
|
105
|
+
|
|
106
|
+
## Redundancy Behavior
|
|
107
|
+
|
|
108
|
+
When running with redundancy (multiple Requirements Mappers):
|
|
109
|
+
- Each mapper works independently
|
|
110
|
+
- Different mappers may interpret requirements differently
|
|
111
|
+
- Consistent mappings = high confidence
|
|
112
|
+
- Divergent mappings = needs human review
|
|
113
|
+
|
|
114
|
+
## Quality Standards
|
|
115
|
+
|
|
116
|
+
- **Complete** — Map ALL provided requirements, even if not covered
|
|
117
|
+
- **Accurate** — Verify coverage claims by reading the code
|
|
118
|
+
- **Helpful** — Explain WHY coverage is full/partial/none
|
|
119
|
+
- **Honest** — Don't overclaim coverage; flag uncertainty
|
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
# Code Review Map Template
|
|
2
|
+
|
|
3
|
+
Template for the final map output (`map.md`). Optimized for reviewer workflow: understand context first, then track per-file review progress.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Complete Template
|
|
8
|
+
|
|
9
|
+
```markdown
|
|
10
|
+
# Code Review Map
|
|
11
|
+
|
|
12
|
+
**Session**: {session_id} | **Generated**: {timestamp} | **Files**: {file_count} | **Sections**: {section_count}
|
|
13
|
+
|
|
14
|
+
> Mark `X` in Done column as you complete review. Requirements: ✅ full | ⚠️ partial | ❌ none
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## Executive Summary
|
|
19
|
+
|
|
20
|
+
{1-2 paragraph narrative explaining what this changeset accomplishes. Frame as a hypothesis.}
|
|
21
|
+
|
|
22
|
+
**Hypothesis**: {One sentence summary of inferred intent}
|
|
23
|
+
|
|
24
|
+
**Key Approaches**:
|
|
25
|
+
- {Approach 1}: {Brief description}
|
|
26
|
+
- {Approach 2}: {Brief description}
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## Questions & Clarifications
|
|
31
|
+
|
|
32
|
+
> Ambiguities and assumptions that need verification with the author.
|
|
33
|
+
|
|
34
|
+
### Questions for Author
|
|
35
|
+
|
|
36
|
+
- {Question about unclear intent or ambiguous requirement}
|
|
37
|
+
- {Question about design choice or deferred work}
|
|
38
|
+
|
|
39
|
+
### Assumptions Made
|
|
40
|
+
|
|
41
|
+
- {Assumption 1 — verify if uncertain}
|
|
42
|
+
- {Assumption 2 — verify if uncertain}
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
## Requirements Coverage
|
|
47
|
+
|
|
48
|
+
{Only include if requirements were provided}
|
|
49
|
+
|
|
50
|
+
| Requirement | Status | Implementing Files |
|
|
51
|
+
|-------------|--------|-------------------|
|
|
52
|
+
| REQ-1: {description} | ✅ Full | `file1.ts`, `file2.ts` |
|
|
53
|
+
| REQ-2: {description} | ⚠️ Partial | `file3.ts` |
|
|
54
|
+
| REQ-3: {description} | ❌ Not covered | — |
|
|
55
|
+
|
|
56
|
+
**Gaps**: {Brief note on unaddressed requirements, if any}
|
|
57
|
+
|
|
58
|
+
---
|
|
59
|
+
|
|
60
|
+
## Critical Review Focus
|
|
61
|
+
|
|
62
|
+
> High-value areas where human judgment matters most. Review these carefully.
|
|
63
|
+
|
|
64
|
+
| Focus Area | Files | Why It Matters | Req / Concern |
|
|
65
|
+
|------------|-------|----------------|---------------|
|
|
66
|
+
| {Area, e.g., "Business Logic"} | `file1.ts`, `file2.ts` | {Reason, e.g., "Complex pricing conditionals"} | REQ-1 |
|
|
67
|
+
| {Area, e.g., "Security"} | `auth.ts` | {Reason, e.g., "Token validation"} | Security |
|
|
68
|
+
| {Area, e.g., "Edge Cases"} | `processor.ts:78` | {Reason, e.g., "Empty array returns null"} | Correctness |
|
|
69
|
+
|
|
70
|
+
---
|
|
71
|
+
|
|
72
|
+
## Manual Verification
|
|
73
|
+
|
|
74
|
+
> Run these tests before or during code review to verify the changeset works.
|
|
75
|
+
|
|
76
|
+
### Critical Path
|
|
77
|
+
|
|
78
|
+
- [ ] **{Test Name}** (REQ-1) — {Steps} → Expected: {outcome}
|
|
79
|
+
- [ ] **{Test Name}** (REQ-2) — {Steps} → Expected: {outcome}
|
|
80
|
+
|
|
81
|
+
### Edge Cases & Error Handling
|
|
82
|
+
|
|
83
|
+
- [ ] **{Edge case}** (`file.ts:42`) — {Steps} → Expected: {behavior}
|
|
84
|
+
- [ ] **{Error scenario}** — Trigger: {how} → Expected: {handling}
|
|
85
|
+
|
|
86
|
+
### Non-Functional
|
|
87
|
+
|
|
88
|
+
- [ ] **Performance**: {Specific check}
|
|
89
|
+
- [ ] **Security**: {Specific check}
|
|
90
|
+
|
|
91
|
+
---
|
|
92
|
+
|
|
93
|
+
## File Review
|
|
94
|
+
|
|
95
|
+
{Main tracking section. Review files in section order, checking boxes as you go.}
|
|
96
|
+
|
|
97
|
+
### Section 1: {Section Title}
|
|
98
|
+
|
|
99
|
+
{1-2 sentence narrative hypothesis about this section's purpose}
|
|
100
|
+
|
|
101
|
+
| Done | File | Role |
|
|
102
|
+
|:----:|------|------|
|
|
103
|
+
| | `path/to/file1.ts` | {brief role description} |
|
|
104
|
+
| | `path/to/file2.ts` | {brief role description} |
|
|
105
|
+
| | `path/to/file3.test.ts` | {brief role description} |
|
|
106
|
+
|
|
107
|
+
**Flow**: {Entry point} → {calls} → {tests}
|
|
108
|
+
|
|
109
|
+
**Requirements**: REQ-1 ✅, REQ-2 ⚠️
|
|
110
|
+
|
|
111
|
+
**Review Suggestions**:
|
|
112
|
+
- {Specific area to pay attention to, mapped to requirement or concern}
|
|
113
|
+
- {Only include if there are key things reviewer should watch for}
|
|
114
|
+
|
|
115
|
+
---
|
|
116
|
+
|
|
117
|
+
### Section 2: {Section Title}
|
|
118
|
+
|
|
119
|
+
{1-2 sentence narrative hypothesis}
|
|
120
|
+
|
|
121
|
+
| Done | File | Role |
|
|
122
|
+
|:----:|------|------|
|
|
123
|
+
| | `path/to/file.ts` | {role} |
|
|
124
|
+
|
|
125
|
+
**Flow**: {flow summary}
|
|
126
|
+
|
|
127
|
+
**Requirements**: {coverage}
|
|
128
|
+
|
|
129
|
+
---
|
|
130
|
+
|
|
131
|
+
{Repeat for each section}
|
|
132
|
+
|
|
133
|
+
---
|
|
134
|
+
|
|
135
|
+
### Unrelated Changes
|
|
136
|
+
|
|
137
|
+
> Files that don't fit the main sections — opportunistic fixes or supporting changes.
|
|
138
|
+
|
|
139
|
+
| Done | File | Description |
|
|
140
|
+
|:----:|------|-------------|
|
|
141
|
+
| | `path/to/unrelated1.ts` | {description} |
|
|
142
|
+
| | `path/to/unrelated2.ts` | {description} |
|
|
143
|
+
|
|
144
|
+
---
|
|
145
|
+
|
|
146
|
+
## File Index
|
|
147
|
+
|
|
148
|
+
| File | Section |
|
|
149
|
+
|------|---------|
|
|
150
|
+
| `path/to/api/auth.ts` | 1: {name} |
|
|
151
|
+
| `path/to/services/auth.service.ts` | 1: {name} |
|
|
152
|
+
| `path/to/utils/helper.ts` | Unrelated |
|
|
153
|
+
|
|
154
|
+
**Total**: {file_count} files
|
|
155
|
+
|
|
156
|
+
---
|
|
157
|
+
|
|
158
|
+
## Map Metadata
|
|
159
|
+
|
|
160
|
+
**Run**: {run_number} | **Flow Analysts**: {count} | **Requirements Mappers**: {count} | **Completeness**: {file_count}/{file_count} ✅
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
---
|
|
164
|
+
|
|
165
|
+
## Format Guidelines
|
|
166
|
+
|
|
167
|
+
### Section Structure
|
|
168
|
+
|
|
169
|
+
```markdown
|
|
170
|
+
### Section {n}: {Title}
|
|
171
|
+
|
|
172
|
+
{1-2 sentence narrative hypothesis}
|
|
173
|
+
|
|
174
|
+
| Done | File | Role |
|
|
175
|
+
|:----:|------|------|
|
|
176
|
+
| | `path/to/file.ts` | {role} |
|
|
177
|
+
|
|
178
|
+
**Flow**: {entry} → {calls} → {tests}
|
|
179
|
+
|
|
180
|
+
**Requirements**: REQ-1 ✅, REQ-2 ⚠️
|
|
181
|
+
|
|
182
|
+
**Review Suggestions**:
|
|
183
|
+
- {Only if key things to watch for}
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
**Titles**: Use descriptive names (✅ "Authentication Flow", ❌ "Files 1-5")
|
|
187
|
+
|
|
188
|
+
**Role descriptions**: 3-10 words explaining what the file does
|
|
189
|
+
|
|
190
|
+
### Review Suggestions (per section)
|
|
191
|
+
|
|
192
|
+
Include ONLY if there are specific areas worth highlighting:
|
|
193
|
+
- Business logic requiring human judgment
|
|
194
|
+
- Security-sensitive code paths
|
|
195
|
+
- Edge cases spotted during mapping
|
|
196
|
+
- Architectural decisions to verify
|
|
197
|
+
|
|
198
|
+
Map suggestions to requirements or concerns. Do NOT perform code review — just flag areas for the reviewer's attention.
|
|
199
|
+
|
|
200
|
+
**Good**: "Complex pricing conditionals — verify tier logic matches REQ-4"
|
|
201
|
+
**Bad**: "This function has a bug on line 42" (that's code review)
|
|
202
|
+
|
|
203
|
+
### Requirements Coverage Indicators
|
|
204
|
+
|
|
205
|
+
- ✅ Full coverage
|
|
206
|
+
- ⚠️ Partial coverage
|
|
207
|
+
- ❌ Not covered
|
|
208
|
+
- ❓ Cannot assess
|
|
209
|
+
|
|
210
|
+
### Writing Hypotheses
|
|
211
|
+
|
|
212
|
+
Frame as hypotheses, not assertions:
|
|
213
|
+
|
|
214
|
+
❌ "This changeset adds authentication."
|
|
215
|
+
✅ "This changeset appears to add authentication based on new auth handlers."
|
|
216
|
+
|
|
217
|
+
### Critical Review Focus
|
|
218
|
+
|
|
219
|
+
Focus on areas where **human judgment adds value**:
|
|
220
|
+
|
|
221
|
+
**Good candidates**:
|
|
222
|
+
- Business logic correctness
|
|
223
|
+
- Algorithm matching spec
|
|
224
|
+
- Security-sensitive code
|
|
225
|
+
- Edge case handling
|
|
226
|
+
|
|
227
|
+
**NOT candidates** (automated):
|
|
228
|
+
- Code style
|
|
229
|
+
- Type safety
|
|
230
|
+
- Test coverage
|
|
231
|
+
|
|
232
|
+
### Manual Verification Tests
|
|
233
|
+
|
|
234
|
+
Derive from:
|
|
235
|
+
- **Requirements** → Critical path happy-path tests
|
|
236
|
+
- **Implementation** → Edge cases (boundary conditions, null checks, error handling)
|
|
237
|
+
|
|
238
|
+
Omit ONLY if changeset is purely docs/config with no behavioral changes.
|
|
239
|
+
|
|
240
|
+
---
|
|
241
|
+
|
|
242
|
+
## Completeness Validation
|
|
243
|
+
|
|
244
|
+
The map MUST include every changed file:
|
|
245
|
+
|
|
246
|
+
```bash
|
|
247
|
+
EXPECTED=$(git diff --cached --name-only | sort)
|
|
248
|
+
MAPPED=$(grep -oE '\| `[^`]+` \|' map.md | sed 's/.*`\([^`]*\)`.*/\1/' | sort)
|
|
249
|
+
diff <(echo "$EXPECTED") <(echo "$MAPPED")
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
If any files are missing, add them to "Unrelated Changes" section.
|