vibe-fabric 0.3.1 → 0.3.3

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.
@@ -0,0 +1,203 @@
1
+ # Gap Analysis Assessment
2
+
3
+ ## Variables
4
+
5
+ | Variable | Description | Required |
6
+ |----------|-------------|----------|
7
+ | {PROJECT_PATH} | Path to the project directory | Yes |
8
+ | {OUTPUT_FILE} | Path to write the assessment output | Yes |
9
+
10
+ ---
11
+
12
+ ## Context
13
+
14
+ You are performing a gap analysis between the PRD (requirements) and the synchronized repository maps (implementation). This helps identify:
15
+ - Requirements that have no implementation
16
+ - Implementations that have no requirements
17
+ - Partial implementations
18
+ - Potential consistency issues
19
+
20
+ Project: {PROJECT_PATH}
21
+
22
+ ---
23
+
24
+ ## Your Task
25
+
26
+ Analyze the PRD requirements against synchronized repository data and help the user understand coverage gaps.
27
+
28
+ ### Step 1: Analyze PRD Requirements
29
+
30
+ Read and analyze:
31
+ - `docs/prd/modules/` - All requirement modules
32
+ - Count requirements by module and priority
33
+
34
+ For each requirement, note:
35
+ - ID (e.g., REQ-AUTH-001)
36
+ - Module
37
+ - Priority (P0, P1, P2)
38
+ - Status (draft, approved, implemented)
39
+
40
+ ### Step 2: Analyze Repository Maps
41
+
42
+ Read and analyze:
43
+ - `docs/sync-cache/*/maps/` - Entity, API, service maps from synced repos
44
+
45
+ For each repository, identify:
46
+ - Models/entities defined
47
+ - API endpoints
48
+ - Services and modules
49
+ - Key functionality areas
50
+
51
+ ### Step 3: Identify Gaps
52
+
53
+ Compare requirements to implementation:
54
+
55
+ **Unimplemented Requirements:**
56
+ - Requirements with status != 'implemented' that have no matching implementation
57
+
58
+ **Undocumented Features:**
59
+ - Code/APIs in maps that don't appear in any requirement
60
+
61
+ **Partial Implementation:**
62
+ - Requirements partially covered (some ACs met, others not)
63
+
64
+ **Status Mismatches:**
65
+ - Requirements marked 'implemented' but no matching code found
66
+
67
+ ### Step 4: Present Findings
68
+
69
+ Summarize clearly:
70
+ - Total requirements analyzed
71
+ - Implementation coverage percentage
72
+ - Number of gaps by category
73
+ - Most critical gaps (P0 requirements not implemented)
74
+
75
+ ### Step 5: Ask User Intent
76
+
77
+ Ask the user: **"What would you like to focus on?"**
78
+
79
+ Options:
80
+ 1. **Full gap report** - Analyze all modules in depth
81
+ 2. **Specific module** - Focus on one module (e.g., "auth gaps")
82
+ 3. **Quick summary** - High-level overview only
83
+ 4. **Just checking** - Show summary, no tasks
84
+
85
+ ### Step 6: Create Task List
86
+
87
+ Based on findings and user intent, create tasks:
88
+
89
+ **Task Types:**
90
+ - `task-analyze-module` - Deep analysis of a specific module's gaps (non-interactive)
91
+
92
+ ---
93
+
94
+ ## Output Format
95
+
96
+ Write to: {OUTPUT_FILE}
97
+
98
+ ```json
99
+ {
100
+ "complexity": "S|M|L",
101
+ "assessment": {
102
+ "prd_exists": true,
103
+ "maps_exist": true,
104
+ "module_count": 5,
105
+ "requirement_count": 23,
106
+ "implementation_coverage": 68,
107
+ "unimplemented_p0": 2,
108
+ "unimplemented_total": 8,
109
+ "undocumented_features": 5,
110
+ "status_mismatches": 1,
111
+ "repos_analyzed": ["backend", "frontend"],
112
+ "user_intent": "full gap report"
113
+ },
114
+ "tasks": [
115
+ {
116
+ "id": 1,
117
+ "name": "analyze-auth-gaps",
118
+ "description": "Analyze gaps in auth module",
119
+ "prompt": "task-analyze-module",
120
+ "interactive": false,
121
+ "context": {
122
+ "module": "auth",
123
+ "requirements": ["REQ-AUTH-001", "REQ-AUTH-002"],
124
+ "repos": ["backend"]
125
+ }
126
+ },
127
+ {
128
+ "id": 2,
129
+ "name": "analyze-users-gaps",
130
+ "description": "Analyze gaps in users module",
131
+ "prompt": "task-analyze-module",
132
+ "interactive": false,
133
+ "context": {
134
+ "module": "users",
135
+ "requirements": ["REQ-USER-001"],
136
+ "repos": ["backend", "frontend"]
137
+ }
138
+ }
139
+ ]
140
+ }
141
+ ```
142
+
143
+ ---
144
+
145
+ ## Rules
146
+
147
+ - Focus ONLY on gap analysis between PRD and implementations
148
+ - Maximum 10 tasks (one per module analyzed)
149
+ - Prioritize P0 requirements in analysis
150
+ - If no maps exist, explain that `vibe sync` should be run first
151
+ - If no PRD exists, explain that `vibe prd` should be run first
152
+ - Be concise - don't list every single requirement, summarize by module
153
+ - If user says "just checking", output empty tasks array
154
+
155
+ ---
156
+
157
+ ## Examples
158
+
159
+ **User says "just checking":**
160
+ ```json
161
+ {
162
+ "complexity": "S",
163
+ "assessment": {...},
164
+ "tasks": []
165
+ }
166
+ ```
167
+
168
+ **User says "full gap report":**
169
+ ```json
170
+ {
171
+ "complexity": "L",
172
+ "assessment": {...},
173
+ "tasks": [
174
+ {"id": 1, "name": "analyze-auth-gaps", "prompt": "task-analyze-module", ...},
175
+ {"id": 2, "name": "analyze-users-gaps", "prompt": "task-analyze-module", ...},
176
+ {"id": 3, "name": "analyze-payments-gaps", "prompt": "task-analyze-module", ...}
177
+ ]
178
+ }
179
+ ```
180
+
181
+ **User says "check auth module":**
182
+ ```json
183
+ {
184
+ "complexity": "S",
185
+ "assessment": {...},
186
+ "tasks": [
187
+ {"id": 1, "name": "analyze-auth-gaps", "prompt": "task-analyze-module", ...}
188
+ ]
189
+ }
190
+ ```
191
+
192
+ **No maps exist:**
193
+ ```json
194
+ {
195
+ "complexity": "S",
196
+ "assessment": {
197
+ "prd_exists": true,
198
+ "maps_exist": false,
199
+ "error": "No repository maps found. Run 'vibe sync' first to sync your repositories."
200
+ },
201
+ "tasks": []
202
+ }
203
+ ```
@@ -0,0 +1,180 @@
1
+ # Synthesize Gap Report
2
+
3
+ ## Variables
4
+
5
+ | Variable | Description | Required |
6
+ |----------|-------------|----------|
7
+ | {PROJECT_PATH} | Path to the project directory | Yes |
8
+ | {TASK_OUTPUTS} | JSON array of task output file paths | Yes |
9
+ | {TOTAL_TASKS} | Number of tasks completed | Yes |
10
+
11
+ ---
12
+
13
+ ## Context
14
+
15
+ You are synthesizing the results of gap analysis tasks into a comprehensive report. Each task analyzed one module's requirements against implementation.
16
+
17
+ Project: {PROJECT_PATH}
18
+ Task outputs: {TASK_OUTPUTS}
19
+ Total tasks: {TOTAL_TASKS}
20
+
21
+ ---
22
+
23
+ ## Your Task
24
+
25
+ Combine all module gap analyses into a comprehensive gap report.
26
+
27
+ ### Step 1: Load Task Outputs
28
+
29
+ Read each task output file from {TASK_OUTPUTS}.
30
+
31
+ ### Step 2: Aggregate Results
32
+
33
+ Combine all module analyses:
34
+ - Total requirements across all modules
35
+ - Overall coverage percentage
36
+ - All gaps categorized by severity
37
+ - All undocumented features
38
+ - All recommendations
39
+
40
+ ### Step 3: Prioritize Gaps
41
+
42
+ Rank gaps by impact:
43
+ 1. **Critical** - P0 requirements with missing implementation
44
+ 2. **High** - P1 requirements partially implemented
45
+ 3. **Medium** - P2 requirements with gaps
46
+ 4. **Low** - Documentation/status mismatches
47
+
48
+ ### Step 4: Generate Summary Report
49
+
50
+ Create a summary suitable for project planning:
51
+ - Executive summary
52
+ - Coverage by module
53
+ - Top priority gaps
54
+ - Recommended actions
55
+
56
+ ### Step 5: Write Report File
57
+
58
+ Generate `docs/reports/gap-analysis.md` with:
59
+ - Date of analysis
60
+ - Coverage summary table
61
+ - Detailed gaps by module
62
+ - Recommendations
63
+
64
+ ---
65
+
66
+ ## Output
67
+
68
+ ### Console Output
69
+
70
+ Print a summary:
71
+
72
+ ```
73
+ Gap Analysis Complete
74
+ =====================
75
+
76
+ Coverage Summary:
77
+ - Total Requirements: 23
78
+ - Fully Implemented: 15 (65%)
79
+ - Partially Implemented: 5 (22%)
80
+ - Not Implemented: 3 (13%)
81
+
82
+ Critical Gaps (P0):
83
+ 1. REQ-PAY-001: Payment processing - missing Stripe integration
84
+ 2. REQ-AUTH-003: MFA - not implemented
85
+
86
+ High Priority Gaps (P1):
87
+ 1. REQ-USER-002: Profile pictures - missing upload endpoint
88
+ 2. REQ-AUTH-002: Password reset - incomplete flow
89
+
90
+ Report written to: docs/reports/gap-analysis.md
91
+
92
+ Next Steps:
93
+ - Create scopes for critical gaps with: vibe scope
94
+ - Update PRD statuses with: vibe prd
95
+ ```
96
+
97
+ ### Report File
98
+
99
+ Write to: `docs/reports/gap-analysis.md`
100
+
101
+ ```markdown
102
+ # Gap Analysis Report
103
+
104
+ **Generated:** 2026-01-21
105
+ **Modules Analyzed:** 5
106
+ **Overall Coverage:** 65%
107
+
108
+ ## Executive Summary
109
+
110
+ [2-3 paragraph summary of findings]
111
+
112
+ ## Coverage by Module
113
+
114
+ | Module | Requirements | Implemented | Coverage |
115
+ |--------|--------------|-------------|----------|
116
+ | auth | 5 | 4 | 80% |
117
+ | users | 3 | 2 | 67% |
118
+ | payments | 4 | 0 | 0% |
119
+ | ... | ... | ... | ... |
120
+
121
+ ## Critical Gaps
122
+
123
+ ### REQ-PAY-001: Payment Processing
124
+
125
+ **Status:** Not Implemented
126
+ **Priority:** P0
127
+
128
+ **Missing:**
129
+ - Stripe integration
130
+ - Payment intent creation
131
+ - Webhook handling
132
+
133
+ **Recommendation:** Create SCOPE for payment integration as highest priority.
134
+
135
+ [... more gaps ...]
136
+
137
+ ## Undocumented Features
138
+
139
+ | Feature | Location | Recommendation |
140
+ |---------|----------|----------------|
141
+ | POST /auth/refresh | backend | Add requirement for token refresh |
142
+ | ... | ... | ... |
143
+
144
+ ## Recommendations
145
+
146
+ 1. **Immediate:** Create scopes for P0 gaps (payments, MFA)
147
+ 2. **Short-term:** Complete partial implementations (password reset)
148
+ 3. **Documentation:** Add requirements for undocumented features
149
+
150
+ ## Next Steps
151
+
152
+ - Run `vibe scope` to create implementation scopes for gaps
153
+ - Run `vibe prd` to update requirement statuses
154
+ - Run `vibe sync` to refresh implementation maps after changes
155
+ ```
156
+
157
+ ---
158
+
159
+ ## Rules
160
+
161
+ - Be actionable - every gap should have a clear next step
162
+ - Prioritize by business impact (P0 > P1 > P2)
163
+ - Keep executive summary concise (max 3 paragraphs)
164
+ - Use tables for scannable data
165
+ - Include specific commands for next steps
166
+ - Create the reports directory if it doesn't exist
167
+ - Timestamp the report
168
+
169
+ ---
170
+
171
+ ## Directory Structure
172
+
173
+ Ensure this exists:
174
+ ```
175
+ docs/
176
+ └── reports/
177
+ └── gap-analysis.md
178
+ ```
179
+
180
+ Create `docs/reports/` if it doesn't exist.
@@ -0,0 +1,198 @@
1
+ # Analyze Module Gaps
2
+
3
+ ## Variables
4
+
5
+ | Variable | Description | Required |
6
+ |----------|-------------|----------|
7
+ | {PROJECT_PATH} | Path to the project directory | Yes |
8
+ | {TASK_NAME} | Name of this task | Yes |
9
+ | {TASK_DESCRIPTION} | Description of this task | Yes |
10
+ | {OUTPUT_FILE} | Path to write the task output | Yes |
11
+ | {PREVIOUS_OUTPUTS} | JSON array of previous task output paths | Yes |
12
+ | {MODULE} | Module name to analyze | Yes |
13
+ | {REQUIREMENTS} | JSON array of requirement IDs to analyze | Yes |
14
+ | {REPOS} | JSON array of repo aliases to check | Yes |
15
+
16
+ ---
17
+
18
+ ## Context
19
+
20
+ You are analyzing gaps for a specific PRD module. Compare the requirements against the implementation maps from synchronized repositories.
21
+
22
+ Project: {PROJECT_PATH}
23
+ Module: {MODULE}
24
+ Requirements: {REQUIREMENTS}
25
+ Repositories: {REPOS}
26
+
27
+ ---
28
+
29
+ ## Your Task
30
+
31
+ Perform deep gap analysis for this module.
32
+
33
+ ### Step 1: Load Requirements
34
+
35
+ Read each requirement file:
36
+ - `docs/prd/modules/{MODULE}/*.md`
37
+
38
+ For each requirement, extract:
39
+ - ID
40
+ - User needs (UN-*)
41
+ - Business rules (BR-*)
42
+ - Acceptance criteria (AC-*)
43
+ - Current status
44
+
45
+ ### Step 2: Load Repository Maps
46
+
47
+ For each repo in {REPOS}, read:
48
+ - `docs/sync-cache/{repo}/maps/entities.json` - Data models
49
+ - `docs/sync-cache/{repo}/maps/api.json` - API endpoints
50
+ - `docs/sync-cache/{repo}/maps/services.json` - Business logic
51
+ - `docs/sync-cache/{repo}/maps/modules.json` - Module structure
52
+
53
+ ### Step 3: Match Requirements to Implementation
54
+
55
+ For each requirement:
56
+
57
+ 1. **Find related code:**
58
+ - Search entities for matching models
59
+ - Search API for matching endpoints
60
+ - Search services for matching functionality
61
+
62
+ 2. **Assess coverage:**
63
+ - Fully implemented: All ACs can be verified in code
64
+ - Partially implemented: Some ACs verified, others missing
65
+ - Not implemented: No matching code found
66
+
67
+ 3. **Note discrepancies:**
68
+ - Extra functionality in code not in requirements
69
+ - Requirements that don't match implementation patterns
70
+
71
+ ### Step 4: Generate Gap Report
72
+
73
+ Create detailed gap report for this module.
74
+
75
+ ---
76
+
77
+ ## Output Format
78
+
79
+ Write to: {OUTPUT_FILE}
80
+
81
+ ```json
82
+ {
83
+ "module": "{MODULE}",
84
+ "summary": {
85
+ "total_requirements": 5,
86
+ "fully_implemented": 2,
87
+ "partially_implemented": 2,
88
+ "not_implemented": 1,
89
+ "coverage_percentage": 60
90
+ },
91
+ "requirements": [
92
+ {
93
+ "id": "REQ-AUTH-001",
94
+ "title": "User Authentication",
95
+ "status_in_prd": "approved",
96
+ "implementation_status": "fully_implemented",
97
+ "evidence": {
98
+ "entities": ["User", "Session"],
99
+ "endpoints": ["POST /auth/login", "POST /auth/logout"],
100
+ "services": ["AuthService.login", "AuthService.logout"]
101
+ },
102
+ "acceptance_criteria": [
103
+ {
104
+ "id": "AC-1",
105
+ "description": "User can log in with email/password",
106
+ "implemented": true,
107
+ "evidence": "POST /auth/login endpoint with email/password body"
108
+ },
109
+ {
110
+ "id": "AC-2",
111
+ "description": "Failed login returns error message",
112
+ "implemented": true,
113
+ "evidence": "AuthService.login throws UnauthorizedError"
114
+ }
115
+ ],
116
+ "gaps": [],
117
+ "recommendations": []
118
+ },
119
+ {
120
+ "id": "REQ-AUTH-002",
121
+ "title": "Password Reset",
122
+ "status_in_prd": "approved",
123
+ "implementation_status": "partially_implemented",
124
+ "evidence": {
125
+ "entities": ["PasswordResetToken"],
126
+ "endpoints": ["POST /auth/forgot-password"],
127
+ "services": ["AuthService.requestPasswordReset"]
128
+ },
129
+ "acceptance_criteria": [
130
+ {
131
+ "id": "AC-1",
132
+ "description": "User can request password reset email",
133
+ "implemented": true,
134
+ "evidence": "POST /auth/forgot-password endpoint"
135
+ },
136
+ {
137
+ "id": "AC-2",
138
+ "description": "User can reset password with valid token",
139
+ "implemented": false,
140
+ "evidence": null
141
+ }
142
+ ],
143
+ "gaps": [
144
+ {
145
+ "type": "missing_endpoint",
146
+ "description": "No endpoint for POST /auth/reset-password",
147
+ "severity": "high",
148
+ "ac_id": "AC-2"
149
+ }
150
+ ],
151
+ "recommendations": [
152
+ "Add POST /auth/reset-password endpoint to complete password reset flow"
153
+ ]
154
+ }
155
+ ],
156
+ "undocumented_features": [
157
+ {
158
+ "type": "endpoint",
159
+ "item": "POST /auth/refresh-token",
160
+ "location": "backend",
161
+ "recommendation": "Add requirement for token refresh functionality"
162
+ }
163
+ ],
164
+ "module_recommendations": [
165
+ "Update REQ-AUTH-002 status to 'in_progress' in PRD",
166
+ "Consider adding requirement for refresh token functionality",
167
+ "Complete POST /auth/reset-password implementation"
168
+ ]
169
+ }
170
+ ```
171
+
172
+ ---
173
+
174
+ ## Rules
175
+
176
+ - Analyze ONLY the specified module
177
+ - Be thorough - check every acceptance criterion
178
+ - Provide specific evidence (file names, endpoint paths, function names)
179
+ - Severity levels: high (P0 AC missing), medium (P1 AC missing), low (P2 AC missing)
180
+ - Don't make assumptions - if you can't find evidence, mark as not implemented
181
+ - Include actionable recommendations
182
+ - Keep output focused and structured
183
+
184
+ ---
185
+
186
+ ## Evidence Guidelines
187
+
188
+ When claiming something is implemented, cite specific evidence:
189
+
190
+ **Good evidence:**
191
+ - "POST /auth/login endpoint in api.json"
192
+ - "User entity with email, passwordHash fields in entities.json"
193
+ - "AuthService.validatePassword in services.json"
194
+
195
+ **Bad evidence:**
196
+ - "Probably exists somewhere"
197
+ - "Should be implemented"
198
+ - "Likely in the auth module"