@haposoft/cafekit 0.13.4 → 0.14.1

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.
Files changed (114) hide show
  1. package/README.md +1 -2
  2. package/bin/lib/i18n.js +2 -2
  3. package/bin/lib/manifest.js +15 -0
  4. package/bin/lib/opencode-install.js +0 -14
  5. package/bin/phases/claude-runtime.js +4 -1
  6. package/bin/phases/claude-settings.js +38 -7
  7. package/package.json +1 -1
  8. package/src/claude/agents/ui-ux-designer.md +4 -4
  9. package/src/claude/hooks/__tests__/privacy-block.test.js +79 -0
  10. package/src/claude/hooks/__tests__/session-writeenv.test.js +68 -0
  11. package/src/claude/hooks/__tests__/spec-gate.test.js +270 -0
  12. package/src/claude/hooks/privacy-block.cjs +22 -2
  13. package/src/claude/hooks/session.cjs +5 -1
  14. package/src/claude/hooks/spec-gate.cjs +173 -0
  15. package/src/claude/hooks/spec-state.cjs +10 -17
  16. package/src/claude/hooks/task-scaffold-guard.cjs +4 -2
  17. package/src/claude/migration-manifest.json +5 -4
  18. package/src/claude/rules/skill-domain-routing.md +2 -3
  19. package/src/claude/rules/skill-workflow-routing.md +2 -3
  20. package/src/claude/rules/state-sync.md +4 -0
  21. package/src/claude/runtime.json +4 -0
  22. package/src/claude/scripts/validate-docs.cjs +4 -7
  23. package/src/claude/scripts/validate-spec-output.cjs +29 -9
  24. package/src/claude/settings/settings.json +4 -0
  25. package/src/claude/skills/ai-multimodal/.env.example +11 -13
  26. package/src/claude/skills/ai-multimodal/SKILL.md +1 -1
  27. package/src/claude/skills/ai-multimodal/references/audio-processing.md +25 -27
  28. package/src/claude/skills/ai-multimodal/references/video-analysis.md +23 -27
  29. package/src/claude/skills/ai-multimodal/references/vision-understanding.md +26 -26
  30. package/src/claude/skills/ai-multimodal/scripts/check_setup.py +1 -1
  31. package/src/claude/skills/ai-multimodal/scripts/gemini_batch_process.py +7 -9
  32. package/src/claude/skills/brainstorm/SKILL.md +1 -2
  33. package/src/claude/skills/docx/SKILL.md +1 -1
  34. package/src/claude/skills/frontend-design/SKILL.md +1 -1
  35. package/src/claude/skills/frontend-design/references/ai-multimodal-overview.md +4 -4
  36. package/src/claude/skills/frontend-design/references/analysis-techniques.md +3 -3
  37. package/src/claude/skills/frontend-design/references/asset-generation.md +2 -2
  38. package/src/claude/skills/frontend-design/references/design-extraction-overview.md +4 -4
  39. package/src/claude/skills/frontend-design/references/extraction-best-practices.md +3 -3
  40. package/src/claude/skills/frontend-design/references/technical-accessibility.md +1 -1
  41. package/src/claude/skills/frontend-design/references/technical-optimization.md +1 -1
  42. package/src/claude/skills/frontend-design/references/technical-overview.md +2 -2
  43. package/src/claude/skills/frontend-design/references/technical-workflows.md +6 -6
  44. package/src/claude/skills/frontend-design/references/visual-analysis-overview.md +3 -3
  45. package/src/claude/skills/inspect/SKILL.md +3 -3
  46. package/src/claude/skills/inspect/references/external-gemini-inspection.md +9 -9
  47. package/src/claude/skills/pdf/SKILL.md +1 -1
  48. package/src/claude/skills/pptx/SKILL.md +1 -1
  49. package/src/claude/skills/specs/SKILL.md +1 -1
  50. package/src/claude/skills/xlsx/SKILL.md +1 -1
  51. package/src/opencode/AGENTS.md +1 -2
  52. package/src/opencode/plugins/session.ts +2 -2
  53. package/src/opencode/plugins/spec-state.ts +244 -0
  54. package/src/opencode/plugins/task-scaffold-guard.ts +161 -0
  55. package/src/claude/scripts/browser-tool.cjs +0 -138
  56. package/src/claude/skills/generate-graph/LICENSE +0 -21
  57. package/src/claude/skills/generate-graph/README.md +0 -523
  58. package/src/claude/skills/generate-graph/SKILL.md +0 -429
  59. package/src/claude/skills/generate-graph/agentloop-core.svg +0 -101
  60. package/src/claude/skills/generate-graph/agents/openai.yaml +0 -4
  61. package/src/claude/skills/generate-graph/assets/samples/sample-style1-flat.png +0 -0
  62. package/src/claude/skills/generate-graph/assets/samples/sample-style2-dark.png +0 -0
  63. package/src/claude/skills/generate-graph/assets/samples/sample-style3-blueprint.png +0 -0
  64. package/src/claude/skills/generate-graph/assets/samples/sample-style4-notion.png +0 -0
  65. package/src/claude/skills/generate-graph/assets/samples/sample-style5-glass.png +0 -0
  66. package/src/claude/skills/generate-graph/assets/samples/sample-style6-claude.png +0 -0
  67. package/src/claude/skills/generate-graph/assets/samples/sample-style7-openai.png +0 -0
  68. package/src/claude/skills/generate-graph/fixtures/agent-memory-types-style4.json +0 -181
  69. package/src/claude/skills/generate-graph/fixtures/api-flow-style7.json +0 -40
  70. package/src/claude/skills/generate-graph/fixtures/mem0-style1.json +0 -297
  71. package/src/claude/skills/generate-graph/fixtures/microservices-style3.json +0 -64
  72. package/src/claude/skills/generate-graph/fixtures/multi-agent-style5.json +0 -45
  73. package/src/claude/skills/generate-graph/fixtures/system-architecture-style6.json +0 -48
  74. package/src/claude/skills/generate-graph/fixtures/tool-call-style2.json +0 -182
  75. package/src/claude/skills/generate-graph/package.json +0 -42
  76. package/src/claude/skills/generate-graph/references/icons.md +0 -281
  77. package/src/claude/skills/generate-graph/references/style-1-flat-icon.md +0 -108
  78. package/src/claude/skills/generate-graph/references/style-2-dark-terminal.md +0 -107
  79. package/src/claude/skills/generate-graph/references/style-3-blueprint.md +0 -113
  80. package/src/claude/skills/generate-graph/references/style-4-notion-clean.md +0 -94
  81. package/src/claude/skills/generate-graph/references/style-5-glassmorphism.md +0 -125
  82. package/src/claude/skills/generate-graph/references/style-6-claude-official.md +0 -209
  83. package/src/claude/skills/generate-graph/references/style-7-openai.md +0 -215
  84. package/src/claude/skills/generate-graph/references/style-diagram-matrix.md +0 -135
  85. package/src/claude/skills/generate-graph/references/svg-layout-best-practices.md +0 -100
  86. package/src/claude/skills/generate-graph/scripts/generate-diagram.sh +0 -157
  87. package/src/claude/skills/generate-graph/scripts/generate-from-template.py +0 -1556
  88. package/src/claude/skills/generate-graph/scripts/test-all-styles.sh +0 -135
  89. package/src/claude/skills/generate-graph/scripts/validate-svg.sh +0 -292
  90. package/src/claude/skills/generate-graph/templates/agent-architecture.svg +0 -28
  91. package/src/claude/skills/generate-graph/templates/architecture.svg +0 -23
  92. package/src/claude/skills/generate-graph/templates/comparison-matrix.svg +0 -14
  93. package/src/claude/skills/generate-graph/templates/data-flow.svg +0 -28
  94. package/src/claude/skills/generate-graph/templates/er-diagram.svg +0 -21
  95. package/src/claude/skills/generate-graph/templates/flowchart.svg +0 -21
  96. package/src/claude/skills/generate-graph/templates/sequence.svg +0 -20
  97. package/src/claude/skills/generate-graph/templates/state-machine.svg +0 -20
  98. package/src/claude/skills/generate-graph/templates/timeline.svg +0 -19
  99. package/src/claude/skills/generate-graph/templates/use-case.svg +0 -21
  100. package/src/claude/skills/impact-analysis/SKILL.md +0 -276
  101. package/src/claude/skills/impact-analysis/references/change-detection.md +0 -270
  102. package/src/claude/skills/impact-analysis/references/dependency-scouting.md +0 -338
  103. package/src/claude/skills/impact-analysis/references/edge-case-identification.md +0 -439
  104. package/src/claude/skills/impact-analysis/references/industry-techniques.md +0 -695
  105. package/src/claude/skills/impact-analysis/references/practical-techniques-guide.md +0 -753
  106. package/src/claude/skills/impact-analysis/references/project-detection.md +0 -704
  107. package/src/claude/skills/impact-analysis/references/react-native-customization.md +0 -508
  108. package/src/claude/skills/impact-analysis/references/report-template.md +0 -604
  109. package/src/claude/skills/impact-analysis/references/test-scenario-generation.md +0 -459
  110. package/src/claude/skills/impact-analysis/scripts/README.md +0 -476
  111. package/src/claude/skills/impact-analysis/scripts/ast-analyze.js +0 -403
  112. package/src/claude/skills/impact-analysis/scripts/calculate-risk.js +0 -475
  113. package/src/claude/skills/impact-analysis/scripts/find-dependencies.sh +0 -202
  114. package/src/claude/skills/impact-analysis/scripts/run-analysis.sh +0 -312
@@ -1,276 +0,0 @@
1
- ---
2
- name: hapo:impact-analysis
3
- description: "Analyze code change impacts and generate test scenarios. Use after code changes, before commit, or when checking for regressions. Automatically detects affected files, dependencies, and edge cases."
4
- user-invocable: true
5
- when_to_use: "Invoke after code changes to map regression impact and test scenarios."
6
- category: dev-tools
7
- keywords: [impact, regression, dependencies, testing]
8
- argument-hint: "[files] OR auto"
9
- metadata:
10
- author: haposoft
11
- version: "1.0.0"
12
- ---
13
- # Impact Analysis - Impact Analysis & Test Guidance
14
-
15
- Analyze the impact of code changes and provide detailed test guidance to prevent regression bugs.
16
-
17
- ## Arguments
18
-
19
- - **Default (no args)**: Analyze most recent git diff
20
- - **`auto`**: Automatically detect changes and analyze
21
- - **`{files}`**: Analyze specific files (comma-separated)
22
-
23
- ## When to Use
24
-
25
- ✅ **Should use:**
26
- - After code changes, before commit
27
- - Before creating Pull Request
28
- - After fixing bugs (ensure no new bugs introduced)
29
- - When refactoring code (verify functionality not broken)
30
- - When adding new features (find integration points)
31
-
32
- ❌ **Not needed:**
33
- - Only documentation changes
34
- - Only comment changes
35
- - Config changes that don't affect logic
36
-
37
- ## Quick Start
38
-
39
- ```bash
40
- # Analyze most recent changes
41
- /impact-analysis
42
-
43
- # Auto-detect and analyze
44
- /impact-analysis auto
45
-
46
- # Analyze specific files
47
- /impact-analysis src/api/auth.ts,src/components/Login.tsx
48
- ```
49
-
50
- ## Workflow
51
-
52
- ### 0. Auto-Detect Project Type (NEW)
53
-
54
- Load `references/project-detection.md` to:
55
- - Automatically detect project type (React Native, Next.js, Node.js API, etc.)
56
- - Load appropriate profile with patterns and edge cases
57
- - Check for custom config file (`impact-analysis.config.js`)
58
- - Merge custom config with default profile
59
-
60
- ### 1. Detect Changes
61
-
62
- Load `references/change-detection.md` to:
63
- - Detect changed files (git diff)
64
- - Classify changes (backend/frontend/database)
65
- - Assess risk level
66
-
67
- ### 2. Inspect Dependencies
68
-
69
- Load `references/dependency-scouting.md` to:
70
- - Find files that import/use modified code
71
- - Detect reverse dependencies
72
- - Identify integration points
73
-
74
- **Advanced**: Load `references/industry-techniques.md` to:
75
- - Use Call Graph Analysis (Technique #2)
76
- - Use Dependency Graph tools
77
- - Apply AST-based analysis (Technique #3) for semantic changes
78
-
79
- ### 3. Identify Edge Cases
80
-
81
- Load `references/edge-case-identification.md` to:
82
- - Analyze data flow
83
- - Find boundary conditions
84
- - Identify error scenarios
85
- - Detect race conditions
86
-
87
- **Advanced**: Load `references/industry-techniques.md` to:
88
- - Use Static Analysis (Technique #4) for data/control flow
89
- - Use Type Analysis for type compatibility
90
- - Apply Test-Based Analysis (Technique #6) for coverage mapping
91
-
92
- ### 4. Generate Test Scenarios
93
-
94
- Load `references/test-scenario-generation.md` to:
95
- - Create happy path scenarios
96
- - Create error handling scenarios
97
- - Create integration test scenarios
98
- - Create regression test checklist
99
-
100
- ### 5. Create Report
101
-
102
- Load `references/report-template.md` to:
103
- - Consolidate findings
104
- - Assess risk
105
- - Provide recommendations
106
- - Create actionable checklist
107
-
108
- ## Output
109
-
110
- ```markdown
111
- # Impact Analysis Report
112
-
113
- ## 📋 Summary
114
- - Changed: 3 files
115
- - Affected: 12 components
116
- - Risk: Medium
117
- - Test Time: ~30 mins
118
-
119
- ## 🔍 Changes
120
- {detailed analysis}
121
-
122
- ## 🔗 Dependencies
123
- {affected files}
124
-
125
- ## ⚠️ Edge Cases
126
- {identified issues}
127
-
128
- ## 🧪 Test Scenarios
129
- {detailed scenarios}
130
-
131
- ## ✅ Checklist
132
- {actionable items}
133
- ```
134
-
135
- ## Integration
136
-
137
- ### With Code Review
138
-
139
- ```
140
- 1. Make changes
141
- 2. /impact-analysis
142
- 3. Review findings
143
- 4. /review (includes impact report)
144
- ```
145
-
146
- ### With Testing
147
-
148
- ```
149
- 1. /impact-analysis
150
- 2. Get test scenarios
151
- 3. /test (execute scenarios)
152
- 4. Verify all pass
153
- ```
154
-
155
- ## References
156
-
157
- ### Core References
158
- - `references/project-detection.md` - Auto-detect project type & load profile
159
- - `references/change-detection.md` - Git diff analysis
160
- - `references/dependency-scouting.md` - Finding affected files
161
- - `references/edge-case-identification.md` - Edge case patterns
162
- - `references/test-scenario-generation.md` - Test templates
163
- - `references/report-template.md` - Output format
164
-
165
- ### Advanced References
166
- - `references/industry-techniques.md` - 9 techniques from industry & research
167
- - `references/practical-techniques-guide.md` - Detailed implementation guide
168
- - `references/react-native-customization.md` - React Native specific guide
169
-
170
- ### Scripts
171
- - `scripts/README.md` - Helper scripts documentation
172
- - `scripts/ast-analyze.js` - AST-based analysis
173
- - `scripts/find-dependencies.sh` - Dependency analysis
174
- - `scripts/calculate-risk.js` - Risk scoring
175
- - `scripts/run-analysis.sh` - Master script
176
-
177
- ## Advanced Techniques
178
-
179
- This skill supports advanced analysis techniques from industry:
180
-
181
- ### Available Scripts
182
-
183
- Located in `scripts/` directory:
184
-
185
- 1. **ast-analyze.js** - AST-based semantic analysis
186
- - Detect function signature changes
187
- - Identify breaking changes
188
- - Compare before/after versions
189
-
190
- 2. **find-dependencies.sh** - Comprehensive dependency analysis
191
- - Find all affected files
192
- - Map API consumers
193
- - Identify integration points
194
-
195
- 3. **calculate-risk.js** - Automated risk scoring
196
- - Multi-factor risk assessment
197
- - Actionable recommendations
198
- - JSON output for CI/CD
199
-
200
- 4. **run-analysis.sh** - Master script
201
- - Run all techniques
202
- - Generate comprehensive report
203
- - Markdown output
204
-
205
- ### Usage
206
-
207
- ```bash
208
- # Quick risk check
209
- node scripts/calculate-risk.js
210
-
211
- # Full analysis
212
- ./scripts/run-analysis.sh
213
-
214
- # Specific files
215
- ./scripts/run-analysis.sh --files "file1.ts,file2.ts"
216
- ```
217
-
218
- See `scripts/README.md` for detailed documentation.
219
-
220
- ## Best Practices
221
-
222
- 1. **Run early** - Analyze immediately after coding, don't wait until commit
223
- 2. **Focus on risk** - Prioritize high-risk changes
224
- 3. **Automate** - Integrate into automated workflow (pre-commit, CI/CD)
225
- 4. **Document** - Save findings for future reference
226
- 5. **Verify** - Always run tests after generating scenarios
227
- 6. **Use scripts** - Leverage advanced techniques for deep analysis
228
-
229
- ## Examples
230
-
231
- ### Example 1: API Change
232
-
233
- ```bash
234
- # Changed: src/api/users.ts (added new field)
235
- /impact-analysis
236
-
237
- # Output:
238
- # - Affected: 5 frontend components using user data
239
- # - Edge cases: Null handling, backward compatibility
240
- # - Test: Verify old clients still work
241
- ```
242
-
243
- ### Example 2: Database Migration
244
-
245
- ```bash
246
- # Changed: prisma/schema.prisma (renamed column)
247
- /impact-analysis
248
-
249
- # Output:
250
- # - Affected: 15 queries using old column name
251
- # - Edge cases: Migration rollback, data integrity
252
- # - Test: Verify all queries updated
253
- ```
254
-
255
- ### Example 3: Component Refactor
256
-
257
- ```bash
258
- # Changed: components/Button.tsx (props interface)
259
- /impact-analysis
260
-
261
- # Output:
262
- # - Affected: 23 components using Button
263
- # - Edge cases: TypeScript errors, missing props
264
- # - Test: Visual regression, interaction tests
265
- ```
266
-
267
- ## Troubleshooting
268
-
269
- **Q: Cannot detect changes?**
270
- A: Check git status, ensure there are staged/committed changes
271
-
272
- **Q: Too many affected files?**
273
- A: Use `--scope` to limit scope
274
-
275
- **Q: Test scenarios not sufficient?**
276
- A: Load `edge-case-identification.md` and review manually
@@ -1,270 +0,0 @@
1
- # Change Detection - Detecting Changes
2
-
3
- Methods for detecting and classifying code changes for impact analysis.
4
-
5
- ## Git Commands
6
-
7
- ### 1. Detect Recent Changes
8
-
9
- ```bash
10
- # Uncommitted changes
11
- git diff --name-only
12
-
13
- # Staged changes
14
- git diff --cached --name-only
15
-
16
- # Changes in last commit
17
- git diff --name-only HEAD~1
18
-
19
- # Changes compared to another branch
20
- git diff --name-only main...HEAD
21
-
22
- # View detailed changes
23
- git diff HEAD~1
24
-
25
- # View statistics
26
- git diff --stat HEAD~1
27
- ```
28
-
29
- ### 2. Get Change Details
30
-
31
- ```bash
32
- # Lines changed
33
- git diff --numstat HEAD~1
34
-
35
- # Files and change count
36
- git diff --shortstat HEAD~1
37
-
38
- # Only view added/deleted files
39
- git diff --diff-filter=AD --name-only HEAD~1
40
- ```
41
-
42
- ### 3. Historical Analysis
43
-
44
- ```bash
45
- # View file history
46
- git log --oneline -10 {file}
47
-
48
- # See who modified which line
49
- git blame {file}
50
-
51
- # View changes in specific commit
52
- git show {commit-hash}
53
- ```
54
-
55
- ## Change Classification
56
-
57
- ### Backend Changes
58
-
59
- **Indicators:**
60
- - Files: `*.ts`, `*.js`, `*.py`, `*.go` in `src/api/`, `src/services/`, `src/controllers/`
61
- - Patterns: API routes, database queries, business logic
62
-
63
- **Risk Level:**
64
- - **High**: Authentication, authorization, payment, data validation
65
- - **Medium**: CRUD operations, utility functions
66
- - **Low**: Logging, comments, formatting
67
-
68
- **Check:**
69
- ```bash
70
- # API endpoints changed
71
- grep -r "router\." {changed-files}
72
- grep -r "app\.(get|post|put|delete)" {changed-files}
73
-
74
- # Database queries
75
- grep -r "prisma\." {changed-files}
76
- grep -r "SELECT\|INSERT\|UPDATE\|DELETE" {changed-files}
77
- ```
78
-
79
- ### Frontend Changes
80
-
81
- **Indicators:**
82
- - Files: `*.tsx`, `*.jsx`, `*.vue`, `*.svelte` in `src/components/`, `src/pages/`
83
- - Patterns: Components, hooks, state management
84
-
85
- **Risk Level:**
86
- - **High**: Authentication UI, payment forms, data entry
87
- - **Medium**: Display components, navigation
88
- - **Low**: Styling, text changes
89
-
90
- **Check:**
91
- ```bash
92
- # Component props changed
93
- grep -r "interface.*Props" {changed-files}
94
-
95
- # State management
96
- grep -r "useState\|useEffect\|useContext" {changed-files}
97
-
98
- # API calls
99
- grep -r "fetch\|axios\|api\." {changed-files}
100
- ```
101
-
102
- ### Database Changes
103
-
104
- **Indicators:**
105
- - Files: `*.prisma`, `*.sql`, `migrations/*.sql`
106
- - Patterns: Schema changes, migrations
107
-
108
- **Risk Level:**
109
- - **Critical**: Column deletion, type changes, constraint changes
110
- - **High**: New required columns, index changes
111
- - **Medium**: New optional columns, new tables
112
- - **Low**: Comments, formatting
113
-
114
- **Check:**
115
- ```bash
116
- # Schema changes
117
- git diff schema.prisma
118
-
119
- # Migration files
120
- ls -la migrations/ | tail -5
121
-
122
- # Find affected queries
123
- grep -r "{table_name}" src/
124
- ```
125
-
126
- ### Configuration Changes
127
-
128
- **Indicators:**
129
- - Files: `.env`, `config/*.ts`, `package.json`, `tsconfig.json`
130
- - Patterns: Environment variables, dependencies, build config
131
-
132
- **Risk Level:**
133
- - **Critical**: Database URL, API keys, auth secrets
134
- - **High**: Dependencies version, build settings
135
- - **Medium**: Feature flags, timeouts
136
- - **Low**: Comments, formatting
137
-
138
- **Check:**
139
- ```bash
140
- # Env changes
141
- git diff .env.example
142
-
143
- # Dependency changes
144
- git diff package.json | grep -A5 -B5 "dependencies"
145
-
146
- # Config changes
147
- git diff config/
148
- ```
149
-
150
- ## Change Metrics
151
-
152
- ### Lines of Code (LOC)
153
-
154
- ```bash
155
- # Total LOC changed
156
- git diff --stat HEAD~1 | tail -1
157
-
158
- # Per file
159
- git diff --numstat HEAD~1
160
- ```
161
-
162
- **Risk Assessment:**
163
- - **< 50 LOC**: Low risk
164
- - **50-200 LOC**: Medium risk
165
- - **> 200 LOC**: High risk (consider splitting)
166
-
167
- ### File Count
168
-
169
- ```bash
170
- # Count changed files
171
- git diff --name-only HEAD~1 | wc -l
172
- ```
173
-
174
- **Risk Assessment:**
175
- - **1-3 files**: Low risk
176
- - **4-10 files**: Medium risk
177
- - **> 10 files**: High risk (wide impact)
178
-
179
- ### Change Type
180
-
181
- ```bash
182
- # Added lines
183
- git diff HEAD~1 | grep "^+" | wc -l
184
-
185
- # Deleted lines
186
- git diff HEAD~1 | grep "^-" | wc -l
187
- ```
188
-
189
- **Risk Assessment:**
190
- - **More additions**: New feature (test new paths)
191
- - **More deletions**: Refactor (test existing paths)
192
- - **Balanced**: Modification (test both)
193
-
194
- ## Automated Detection Script
195
-
196
- ```bash
197
- #!/bin/bash
198
- # detect-changes.sh
199
-
200
- echo "=== Change Detection ==="
201
-
202
- # Get changed files
203
- CHANGED_FILES=$(git diff --name-only HEAD~1)
204
- FILE_COUNT=$(echo "$CHANGED_FILES" | wc -l)
205
-
206
- echo "Files changed: $FILE_COUNT"
207
- echo ""
208
-
209
- # Classify by type
210
- BACKEND=$(echo "$CHANGED_FILES" | grep -E "src/(api|services|controllers)" | wc -l)
211
- FRONTEND=$(echo "$CHANGED_FILES" | grep -E "src/(components|pages)" | wc -l)
212
- DATABASE=$(echo "$CHANGED_FILES" | grep -E "prisma|migrations" | wc -l)
213
- CONFIG=$(echo "$CHANGED_FILES" | grep -E "\.env|config|package\.json" | wc -l)
214
-
215
- echo "Backend: $BACKEND files"
216
- echo "Frontend: $FRONTEND files"
217
- echo "Database: $DATABASE files"
218
- echo "Config: $CONFIG files"
219
- echo ""
220
-
221
- # Get LOC stats
222
- git diff --stat HEAD~1 | tail -1
223
-
224
- # Risk assessment
225
- if [ $FILE_COUNT -gt 10 ] || [ $DATABASE -gt 0 ]; then
226
- echo "Risk: HIGH"
227
- elif [ $FILE_COUNT -gt 3 ]; then
228
- echo "Risk: MEDIUM"
229
- else
230
- echo "Risk: LOW"
231
- fi
232
- ```
233
-
234
- ## Output Format
235
-
236
- ```json
237
- {
238
- "summary": {
239
- "totalFiles": 5,
240
- "linesAdded": 120,
241
- "linesDeleted": 45,
242
- "riskLevel": "medium"
243
- },
244
- "changes": [
245
- {
246
- "file": "src/api/auth.ts",
247
- "type": "backend",
248
- "category": "authentication",
249
- "linesChanged": 67,
250
- "risk": "high",
251
- "reason": "Authentication logic modified"
252
- },
253
- {
254
- "file": "src/components/Login.tsx",
255
- "type": "frontend",
256
- "category": "ui",
257
- "linesChanged": 34,
258
- "risk": "medium",
259
- "reason": "Login form updated"
260
- }
261
- ]
262
- }
263
- ```
264
-
265
- ## Integration Points
266
-
267
- After detection, pass to:
268
- 1. **Dependency Scouting** - Find affected files
269
- 2. **Edge Case Identification** - Analyze risks
270
- 3. **Test Scenario Generation** - Create tests