@haposoft/cafekit 0.3.5 → 0.3.7
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/bin/install.js +28 -23
- package/package.json +1 -1
- package/src/common/skills/impact-analysis/SKILL.md +69 -69
package/bin/install.js
CHANGED
|
@@ -467,32 +467,37 @@ function copyPlatformFiles(platformKey, results, options = {}) {
|
|
|
467
467
|
});
|
|
468
468
|
}
|
|
469
469
|
|
|
470
|
+
// Copy additional required skills based on platform
|
|
471
|
+
let requiredSkills = [];
|
|
470
472
|
if (platformKey === 'claude') {
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
}
|
|
473
|
+
requiredSkills = CLAUDE_MIGRATION_MANIFEST?.skills?.required || [];
|
|
474
|
+
} else if (platformKey === 'antigravity') {
|
|
475
|
+
// Antigravity also needs impact-analysis skill
|
|
476
|
+
requiredSkills = ['impact-analysis'];
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
requiredSkills
|
|
480
|
+
.filter((skillName) => skillName !== 'specs')
|
|
481
|
+
.forEach((skillName) => {
|
|
482
|
+
const skillSource = path.join(skillsSourceDir, skillName);
|
|
483
|
+
const skillDest = path.join(platform.skillsDir, skillName);
|
|
484
|
+
|
|
485
|
+
if (fs.existsSync(skillSource)) {
|
|
486
|
+
const skillExisted = fs.existsSync(skillDest);
|
|
487
|
+
copyRecursive(skillSource, skillDest, options);
|
|
488
|
+
results.installedSkills++;
|
|
489
|
+
|
|
490
|
+
if (shouldOverwriteManagedFiles && skillExisted) {
|
|
491
|
+
console.log(` ↻ Skill updated: ${skillName}`);
|
|
492
|
+
results.updated++;
|
|
490
493
|
} else {
|
|
491
|
-
|
|
492
|
-
console.log(` ⚠ Missing dependency template: ${path.join(platform.skillsDir, skillName)}`);
|
|
494
|
+
console.log(` ✓ Skill installed: ${skillName}`);
|
|
493
495
|
}
|
|
494
|
-
}
|
|
495
|
-
|
|
496
|
+
} else {
|
|
497
|
+
results.missingDependencies++;
|
|
498
|
+
console.log(` ⚠ Missing dependency template: ${path.join(platform.skillsDir, skillName)}`);
|
|
499
|
+
}
|
|
500
|
+
});
|
|
496
501
|
}
|
|
497
502
|
|
|
498
503
|
// Copy agents
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@haposoft/cafekit",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.7",
|
|
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",
|
|
@@ -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
|