@haposoft/cafekit 0.3.6 → 0.3.11
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@haposoft/cafekit",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.11",
|
|
4
4
|
"description": "Spec-Driven Development workflow for AI coding assistants. Supports Claude Code and Antigravity with spec-first and code-test-review workflows.",
|
|
5
5
|
"author": "Haposoft <nghialt@haposoft.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -37,4 +37,4 @@
|
|
|
37
37
|
"engines": {
|
|
38
38
|
"node": ">=18.0.0"
|
|
39
39
|
}
|
|
40
|
-
}
|
|
40
|
+
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
---
|
|
2
|
-
description:
|
|
2
|
+
description: Analyze code change impacts on features and user actions
|
|
3
3
|
allowed-tools: Read, Glob, Grep, Bash, WebSearch
|
|
4
4
|
argument-hint: <feature-name> [--from <branch>]
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
# /impact-analysis -
|
|
7
|
+
# /impact-analysis - Feature Impact Analysis
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
Use this workflow after completing a feature (after `/code`) or before committing.
|
|
10
10
|
|
|
11
11
|
<background_information>
|
|
12
12
|
- **Mission**: Comprehensive impact analysis for completed features to prevent regression bugs
|
|
@@ -16,8 +16,8 @@ Sử dụng workflow này sau khi hoàn thành feature (sau `/code`) hoặc trư
|
|
|
16
16
|
- Test scenarios generated for all critical paths
|
|
17
17
|
- Regression risks assessed with mitigation recommendations
|
|
18
18
|
- Cross-referenced with spec artifacts when available
|
|
19
|
-
- **Timing**: After implementing all tasks for a feature, before running
|
|
20
|
-
- **Helper Scripts**: Optionally use advanced analysis scripts from `.
|
|
19
|
+
- **Timing**: After implementing all tasks for a feature, before running tests
|
|
20
|
+
- **Helper Scripts**: Optionally use advanced analysis scripts from `.agent/skills/impact-analysis/scripts/` for automated dependency analysis, AST-based semantic analysis, and risk scoring
|
|
21
21
|
</background_information>
|
|
22
22
|
|
|
23
23
|
<instructions>
|
|
@@ -26,11 +26,11 @@ Analyze the impact of code changes for feature **$ARGUMENTS** to identify affect
|
|
|
26
26
|
|
|
27
27
|
## Helper Scripts (Optional Enhancement)
|
|
28
28
|
|
|
29
|
-
If available in `.
|
|
29
|
+
If available in `.agent/skills/impact-analysis/scripts/`, these scripts provide advanced automated analysis:
|
|
30
30
|
|
|
31
31
|
**1. Dependency Analysis**:
|
|
32
32
|
```bash
|
|
33
|
-
.
|
|
33
|
+
.agent/skills/impact-analysis/scripts/find-dependencies.sh <file>
|
|
34
34
|
```
|
|
35
35
|
- Finds all files importing/using the changed file
|
|
36
36
|
- Identifies API consumers and component usage
|
|
@@ -38,7 +38,7 @@ If available in `.claude/skills/impact-analysis/scripts/`, these scripts provide
|
|
|
38
38
|
|
|
39
39
|
**2. AST-Based Analysis** (for TypeScript/JavaScript):
|
|
40
40
|
```bash
|
|
41
|
-
node .
|
|
41
|
+
node .agent/skills/impact-analysis/scripts/ast-analyze.js <file>
|
|
42
42
|
```
|
|
43
43
|
- Detects function signature changes
|
|
44
44
|
- Identifies breaking changes
|
|
@@ -46,7 +46,7 @@ node .claude/skills/impact-analysis/scripts/ast-analyze.js <file>
|
|
|
46
46
|
|
|
47
47
|
**3. Risk Calculation**:
|
|
48
48
|
```bash
|
|
49
|
-
node .
|
|
49
|
+
node .agent/skills/impact-analysis/scripts/calculate-risk.js
|
|
50
50
|
```
|
|
51
51
|
- Calculates risk score (0-25)
|
|
52
52
|
- Determines risk level (CRITICAL/HIGH/MEDIUM/LOW)
|
|
@@ -54,7 +54,7 @@ node .claude/skills/impact-analysis/scripts/calculate-risk.js
|
|
|
54
54
|
|
|
55
55
|
**4. Complete Analysis**:
|
|
56
56
|
```bash
|
|
57
|
-
.
|
|
57
|
+
.agent/skills/impact-analysis/scripts/run-analysis.sh
|
|
58
58
|
```
|
|
59
59
|
- Runs all techniques
|
|
60
60
|
- Generates comprehensive markdown report
|
|
@@ -160,8 +160,7 @@ Scan file contents for keywords to detect additional features:
|
|
|
160
160
|
|
|
161
161
|
If helper script available, run comprehensive analysis:
|
|
162
162
|
```bash
|
|
163
|
-
|
|
164
|
-
.claude/skills/impact-analysis/scripts/find-dependencies.sh <file>
|
|
163
|
+
.agent/skills/impact-analysis/scripts/find-dependencies.sh <file>
|
|
165
164
|
```
|
|
166
165
|
|
|
167
166
|
**Manual Dependency Analysis** (fallback):
|
|
@@ -200,11 +199,8 @@ For each changed file, find:
|
|
|
200
199
|
|
|
201
200
|
**Option 1: Use Helper Scripts** (if available):
|
|
202
201
|
```bash
|
|
203
|
-
|
|
204
|
-
node .
|
|
205
|
-
|
|
206
|
-
# Run risk calculation
|
|
207
|
-
node .claude/skills/impact-analysis/scripts/calculate-risk.js
|
|
202
|
+
node .agent/skills/impact-analysis/scripts/ast-analyze.js <file>
|
|
203
|
+
node .agent/skills/impact-analysis/scripts/calculate-risk.js
|
|
208
204
|
```
|
|
209
205
|
|
|
210
206
|
**Option 2: Manual Detection** (fallback):
|
|
@@ -328,8 +324,7 @@ For each affected feature and user action, generate:
|
|
|
328
324
|
**Automated Risk Assessment** (if helper script available):
|
|
329
325
|
|
|
330
326
|
```bash
|
|
331
|
-
|
|
332
|
-
node .claude/skills/impact-analysis/scripts/calculate-risk.js
|
|
327
|
+
node .agent/skills/impact-analysis/scripts/calculate-risk.js
|
|
333
328
|
|
|
334
329
|
# Output includes:
|
|
335
330
|
# - Risk score (0-25)
|
|
@@ -1,44 +1,44 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: impact-analysis
|
|
3
|
-
description: "
|
|
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
4
|
argument-hint: "[files] OR auto"
|
|
5
5
|
version: 1.0.0
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
-
# Impact Analysis -
|
|
8
|
+
# Impact Analysis - Impact Analysis & Test Guidance
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
Analyze the impact of code changes and provide detailed test guidance to prevent regression bugs.
|
|
11
11
|
|
|
12
12
|
## Arguments
|
|
13
13
|
|
|
14
|
-
- **Default (no args)**:
|
|
15
|
-
- **`auto`**:
|
|
16
|
-
- **`{files}`**:
|
|
14
|
+
- **Default (no args)**: Analyze most recent git diff
|
|
15
|
+
- **`auto`**: Automatically detect changes and analyze
|
|
16
|
+
- **`{files}`**: Analyze specific files (comma-separated)
|
|
17
17
|
|
|
18
|
-
##
|
|
18
|
+
## When to Use
|
|
19
19
|
|
|
20
|
-
✅ **
|
|
21
|
-
-
|
|
22
|
-
-
|
|
23
|
-
-
|
|
24
|
-
-
|
|
25
|
-
-
|
|
20
|
+
✅ **Should use:**
|
|
21
|
+
- After code changes, before commit
|
|
22
|
+
- Before creating Pull Request
|
|
23
|
+
- After fixing bugs (ensure no new bugs introduced)
|
|
24
|
+
- When refactoring code (verify functionality not broken)
|
|
25
|
+
- When adding new features (find integration points)
|
|
26
26
|
|
|
27
|
-
❌ **
|
|
28
|
-
-
|
|
29
|
-
-
|
|
30
|
-
-
|
|
27
|
+
❌ **Not needed:**
|
|
28
|
+
- Only documentation changes
|
|
29
|
+
- Only comment changes
|
|
30
|
+
- Config changes that don't affect logic
|
|
31
31
|
|
|
32
32
|
## Quick Start
|
|
33
33
|
|
|
34
34
|
```bash
|
|
35
|
-
#
|
|
35
|
+
# Analyze most recent changes
|
|
36
36
|
/impact-analysis
|
|
37
37
|
|
|
38
|
-
#
|
|
38
|
+
# Auto-detect and analyze
|
|
39
39
|
/impact-analysis auto
|
|
40
40
|
|
|
41
|
-
#
|
|
41
|
+
# Analyze specific files
|
|
42
42
|
/impact-analysis src/api/auth.ts,src/components/Login.tsx
|
|
43
43
|
```
|
|
44
44
|
|
|
@@ -46,59 +46,59 @@ Phân tích tác động của code changes và đưa ra hướng dẫn test chi
|
|
|
46
46
|
|
|
47
47
|
### 0. Auto-Detect Project Type (NEW)
|
|
48
48
|
|
|
49
|
-
Load `references/project-detection.md`
|
|
50
|
-
-
|
|
51
|
-
- Load appropriate profile
|
|
49
|
+
Load `references/project-detection.md` to:
|
|
50
|
+
- Automatically detect project type (React Native, Next.js, Node.js API, etc.)
|
|
51
|
+
- Load appropriate profile with patterns and edge cases
|
|
52
52
|
- Check for custom config file (`impact-analysis.config.js`)
|
|
53
|
-
- Merge custom config
|
|
53
|
+
- Merge custom config with default profile
|
|
54
54
|
|
|
55
55
|
### 1. Detect Changes
|
|
56
56
|
|
|
57
|
-
Load `references/change-detection.md`
|
|
58
|
-
-
|
|
59
|
-
-
|
|
60
|
-
-
|
|
57
|
+
Load `references/change-detection.md` to:
|
|
58
|
+
- Detect changed files (git diff)
|
|
59
|
+
- Classify changes (backend/frontend/database)
|
|
60
|
+
- Assess risk level
|
|
61
61
|
|
|
62
62
|
### 2. Scout Dependencies
|
|
63
63
|
|
|
64
|
-
Load `references/dependency-scouting.md`
|
|
65
|
-
-
|
|
66
|
-
-
|
|
67
|
-
-
|
|
64
|
+
Load `references/dependency-scouting.md` to:
|
|
65
|
+
- Find files that import/use modified code
|
|
66
|
+
- Detect reverse dependencies
|
|
67
|
+
- Identify integration points
|
|
68
68
|
|
|
69
|
-
**Advanced**: Load `references/industry-techniques.md`
|
|
70
|
-
-
|
|
71
|
-
-
|
|
72
|
-
-
|
|
69
|
+
**Advanced**: Load `references/industry-techniques.md` to:
|
|
70
|
+
- Use Call Graph Analysis (Technique #2)
|
|
71
|
+
- Use Dependency Graph tools
|
|
72
|
+
- Apply AST-based analysis (Technique #3) for semantic changes
|
|
73
73
|
|
|
74
74
|
### 3. Identify Edge Cases
|
|
75
75
|
|
|
76
|
-
Load `references/edge-case-identification.md`
|
|
77
|
-
-
|
|
78
|
-
-
|
|
79
|
-
-
|
|
80
|
-
-
|
|
76
|
+
Load `references/edge-case-identification.md` to:
|
|
77
|
+
- Analyze data flow
|
|
78
|
+
- Find boundary conditions
|
|
79
|
+
- Identify error scenarios
|
|
80
|
+
- Detect race conditions
|
|
81
81
|
|
|
82
|
-
**Advanced**: Load `references/industry-techniques.md`
|
|
83
|
-
-
|
|
84
|
-
-
|
|
85
|
-
-
|
|
82
|
+
**Advanced**: Load `references/industry-techniques.md` to:
|
|
83
|
+
- Use Static Analysis (Technique #4) for data/control flow
|
|
84
|
+
- Use Type Analysis for type compatibility
|
|
85
|
+
- Apply Test-Based Analysis (Technique #6) for coverage mapping
|
|
86
86
|
|
|
87
87
|
### 4. Generate Test Scenarios
|
|
88
88
|
|
|
89
|
-
Load `references/test-scenario-generation.md`
|
|
90
|
-
-
|
|
91
|
-
-
|
|
92
|
-
-
|
|
93
|
-
-
|
|
89
|
+
Load `references/test-scenario-generation.md` to:
|
|
90
|
+
- Create happy path scenarios
|
|
91
|
+
- Create error handling scenarios
|
|
92
|
+
- Create integration test scenarios
|
|
93
|
+
- Create regression test checklist
|
|
94
94
|
|
|
95
95
|
### 5. Create Report
|
|
96
96
|
|
|
97
|
-
Load `references/report-template.md`
|
|
98
|
-
-
|
|
99
|
-
-
|
|
100
|
-
-
|
|
101
|
-
-
|
|
97
|
+
Load `references/report-template.md` to:
|
|
98
|
+
- Consolidate findings
|
|
99
|
+
- Assess risk
|
|
100
|
+
- Provide recommendations
|
|
101
|
+
- Create actionable checklist
|
|
102
102
|
|
|
103
103
|
## Output
|
|
104
104
|
|
|
@@ -158,7 +158,7 @@ Load `references/report-template.md` để:
|
|
|
158
158
|
- `references/report-template.md` - Output format
|
|
159
159
|
|
|
160
160
|
### Advanced References
|
|
161
|
-
- `references/industry-techniques.md` - 9 techniques
|
|
161
|
+
- `references/industry-techniques.md` - 9 techniques from industry & research
|
|
162
162
|
- `references/practical-techniques-guide.md` - Detailed implementation guide
|
|
163
163
|
- `references/react-native-customization.md` - React Native specific guide
|
|
164
164
|
|
|
@@ -171,7 +171,7 @@ Load `references/report-template.md` để:
|
|
|
171
171
|
|
|
172
172
|
## Advanced Techniques
|
|
173
173
|
|
|
174
|
-
|
|
174
|
+
This skill supports advanced analysis techniques from industry:
|
|
175
175
|
|
|
176
176
|
### Available Scripts
|
|
177
177
|
|
|
@@ -214,12 +214,12 @@ See `scripts/README.md` for detailed documentation.
|
|
|
214
214
|
|
|
215
215
|
## Best Practices
|
|
216
216
|
|
|
217
|
-
1. **Run early** -
|
|
218
|
-
2. **Focus on risk** -
|
|
219
|
-
3. **Automate** - Integrate
|
|
220
|
-
4. **Document** -
|
|
221
|
-
5. **Verify** -
|
|
222
|
-
6. **Use scripts** - Leverage advanced techniques
|
|
217
|
+
1. **Run early** - Analyze immediately after coding, don't wait until commit
|
|
218
|
+
2. **Focus on risk** - Prioritize high-risk changes
|
|
219
|
+
3. **Automate** - Integrate into automated workflow (pre-commit, CI/CD)
|
|
220
|
+
4. **Document** - Save findings for future reference
|
|
221
|
+
5. **Verify** - Always run tests after generating scenarios
|
|
222
|
+
6. **Use scripts** - Leverage advanced techniques for deep analysis
|
|
223
223
|
|
|
224
224
|
## Examples
|
|
225
225
|
|
|
@@ -261,11 +261,11 @@ See `scripts/README.md` for detailed documentation.
|
|
|
261
261
|
|
|
262
262
|
## Troubleshooting
|
|
263
263
|
|
|
264
|
-
**Q:
|
|
265
|
-
A: Check git status,
|
|
264
|
+
**Q: Cannot detect changes?**
|
|
265
|
+
A: Check git status, ensure there are staged/committed changes
|
|
266
266
|
|
|
267
|
-
**Q:
|
|
268
|
-
A:
|
|
267
|
+
**Q: Too many affected files?**
|
|
268
|
+
A: Use `--scope` to limit scope
|
|
269
269
|
|
|
270
|
-
**Q: Test scenarios
|
|
271
|
-
A: Load `edge-case-identification.md`
|
|
270
|
+
**Q: Test scenarios not sufficient?**
|
|
271
|
+
A: Load `edge-case-identification.md` and review manually
|