@aiready/pattern-detect 0.1.1 โ 0.1.2
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/CONTRIBUTING.md +134 -0
- package/package.json +4 -3
package/CONTRIBUTING.md
ADDED
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
# Contributing to @aiready/pattern-detect
|
|
2
|
+
|
|
3
|
+
Thank you for your interest in contributing to AIReady Pattern Detection! We welcome bug reports, feature requests, and code contributions.
|
|
4
|
+
|
|
5
|
+
## ๐ Reporting Issues
|
|
6
|
+
|
|
7
|
+
Found a bug or have a feature request? [Open an issue](https://github.com/caopengau/aiready-pattern-detect/issues) with:
|
|
8
|
+
- Clear description of the problem or feature
|
|
9
|
+
- Sample code that demonstrates the issue
|
|
10
|
+
- Expected vs actual behavior
|
|
11
|
+
- Your environment (Node version, OS)
|
|
12
|
+
|
|
13
|
+
## ๐ง Development Setup
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
# Clone your fork
|
|
17
|
+
git clone https://github.com/YOUR_USERNAME/aiready-pattern-detect
|
|
18
|
+
cd aiready-pattern-detect
|
|
19
|
+
|
|
20
|
+
# Install dependencies
|
|
21
|
+
pnpm install
|
|
22
|
+
|
|
23
|
+
# Build
|
|
24
|
+
pnpm build
|
|
25
|
+
|
|
26
|
+
# Run tests
|
|
27
|
+
pnpm test
|
|
28
|
+
|
|
29
|
+
# Test CLI locally
|
|
30
|
+
./dist/cli.js ../test-project
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## ๐ Making Changes
|
|
34
|
+
|
|
35
|
+
1. **Fork the repository** and create a new branch:
|
|
36
|
+
```bash
|
|
37
|
+
git checkout -b fix/similarity-calculation
|
|
38
|
+
# or
|
|
39
|
+
git checkout -b feat/new-pattern-type
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
2. **Make your changes** following our code style:
|
|
43
|
+
- Use TypeScript strict mode
|
|
44
|
+
- Add tests for new pattern types
|
|
45
|
+
- Update README with new features
|
|
46
|
+
- Keep detection logic modular
|
|
47
|
+
|
|
48
|
+
3. **Test your changes**:
|
|
49
|
+
```bash
|
|
50
|
+
pnpm build
|
|
51
|
+
pnpm test
|
|
52
|
+
|
|
53
|
+
# Test on real codebases
|
|
54
|
+
./dist/cli.js /path/to/test-repo
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
4. **Commit using conventional commits**:
|
|
58
|
+
```bash
|
|
59
|
+
git commit -m "fix: improve similarity threshold accuracy"
|
|
60
|
+
git commit -m "feat: add React component pattern detection"
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
5. **Push and open a PR**:
|
|
64
|
+
```bash
|
|
65
|
+
git push origin feat/new-pattern-type
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## ๐ Commit Convention
|
|
69
|
+
|
|
70
|
+
We use [Conventional Commits](https://www.conventionalcommits.org/):
|
|
71
|
+
|
|
72
|
+
- `feat:` - New feature (new pattern type, output format)
|
|
73
|
+
- `fix:` - Bug fix (detection accuracy, false positives)
|
|
74
|
+
- `docs:` - Documentation updates
|
|
75
|
+
- `perf:` - Performance improvements
|
|
76
|
+
- `refactor:` - Code restructuring
|
|
77
|
+
- `test:` - Test additions/updates
|
|
78
|
+
|
|
79
|
+
## ๐งช Testing Guidelines
|
|
80
|
+
|
|
81
|
+
- Add test cases in `src/__tests__/detector.test.ts`
|
|
82
|
+
- Include real-world pattern examples
|
|
83
|
+
- Test edge cases (empty files, single-line functions)
|
|
84
|
+
- Verify output formats (console, JSON, HTML)
|
|
85
|
+
|
|
86
|
+
Example test:
|
|
87
|
+
```typescript
|
|
88
|
+
test('detects API handler patterns', () => {
|
|
89
|
+
const results = detectDuplicatePatterns([...]);
|
|
90
|
+
expect(results).toHaveLength(2);
|
|
91
|
+
expect(results[0].patternType).toBe('api-handler');
|
|
92
|
+
});
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
## ๐ฏ Areas for Contribution
|
|
96
|
+
|
|
97
|
+
Great places to start:
|
|
98
|
+
- **New pattern types**: Add detection for new code patterns
|
|
99
|
+
- **Better categorization**: Improve pattern type classification
|
|
100
|
+
- **Detection accuracy**: Reduce false positives/negatives
|
|
101
|
+
- **Performance**: Optimize for large codebases
|
|
102
|
+
- **Output formats**: Add new export options
|
|
103
|
+
- **Documentation**: Usage examples, best practices
|
|
104
|
+
|
|
105
|
+
## ๐ Code Review
|
|
106
|
+
|
|
107
|
+
- All checks must pass (build, tests, lint)
|
|
108
|
+
- Maintainers review within 2 business days
|
|
109
|
+
- Address feedback and update PR
|
|
110
|
+
- Once approved, we'll merge and publish
|
|
111
|
+
|
|
112
|
+
## ๐ Documentation
|
|
113
|
+
|
|
114
|
+
- Update README.md for new features
|
|
115
|
+
- Add examples for new pattern types
|
|
116
|
+
- Document CLI options
|
|
117
|
+
- Include real-world use cases
|
|
118
|
+
|
|
119
|
+
## ๐ก Feature Ideas
|
|
120
|
+
|
|
121
|
+
Looking for inspiration? Consider:
|
|
122
|
+
- Language-specific pattern types (Go, Rust, etc.)
|
|
123
|
+
- Integration with popular linters
|
|
124
|
+
- VS Code extension
|
|
125
|
+
- CI/CD report generation
|
|
126
|
+
- Pattern suggestion improvements
|
|
127
|
+
|
|
128
|
+
## โ Questions?
|
|
129
|
+
|
|
130
|
+
Open an issue or reach out to the maintainers. We're here to help!
|
|
131
|
+
|
|
132
|
+
---
|
|
133
|
+
|
|
134
|
+
**Thank you for helping make AI-generated code better!** ๐
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aiready/pattern-detect",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "Semantic duplicate pattern detection for AI-generated code - finds similar implementations that waste AI context tokens",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"dependencies": {
|
|
46
46
|
"commander": "^12.1.0",
|
|
47
47
|
"chalk": "^5.3.0",
|
|
48
|
-
"@aiready/core": "0.1.
|
|
48
|
+
"@aiready/core": "0.1.2"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"tsup": "^8.3.5",
|
|
@@ -54,7 +54,8 @@
|
|
|
54
54
|
"files": [
|
|
55
55
|
"dist",
|
|
56
56
|
"README.md",
|
|
57
|
-
"LICENSE"
|
|
57
|
+
"LICENSE",
|
|
58
|
+
"CONTRIBUTING.md"
|
|
58
59
|
],
|
|
59
60
|
"engines": {
|
|
60
61
|
"node": ">=18.0.0"
|