@aiready/pattern-detect 0.8.5 → 0.9.0
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/README.md +38 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -150,6 +150,44 @@ aiready patterns ./src --similarity 0.3 --min-lines 3
|
|
|
150
150
|
aiready patterns ./src --min-lines 10 --min-shared-tokens 10
|
|
151
151
|
```
|
|
152
152
|
|
|
153
|
+
## 📁 Configuration File
|
|
154
|
+
|
|
155
|
+
Create an `aiready.json` or `aiready.config.json` file in your project root:
|
|
156
|
+
|
|
157
|
+
```json
|
|
158
|
+
{
|
|
159
|
+
"scan": {
|
|
160
|
+
"include": ["src/**/*.{ts,tsx,js,jsx}"],
|
|
161
|
+
"exclude": ["**/*.test.*", "**/dist/**"]
|
|
162
|
+
},
|
|
163
|
+
"tools": {
|
|
164
|
+
"pattern-detect": {
|
|
165
|
+
"minSimilarity": 0.6,
|
|
166
|
+
"minLines": 8,
|
|
167
|
+
"maxResults": 20,
|
|
168
|
+
"minSharedTokens": 10,
|
|
169
|
+
"maxCandidatesPerBlock": 100
|
|
170
|
+
}
|
|
171
|
+
},
|
|
172
|
+
"output": {
|
|
173
|
+
"format": "console",
|
|
174
|
+
"file": ".aiready/pattern-report.json"
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
**Configuration Options:**
|
|
180
|
+
|
|
181
|
+
| Option | Type | Default | Description |
|
|
182
|
+
|--------|------|---------|-------------|
|
|
183
|
+
| `minSimilarity` | number | `0.4` | Similarity threshold (0-1) |
|
|
184
|
+
| `minLines` | number | `5` | Minimum lines to consider |
|
|
185
|
+
| `maxResults` | number | `10` | Max results to display in console |
|
|
186
|
+
| `minSharedTokens` | number | `8` | Min tokens that must match |
|
|
187
|
+
| `maxCandidatesPerBlock` | number | `100` | Performance tuning limit |
|
|
188
|
+
| `approx` | boolean | `true` | Use approximate candidate selection |
|
|
189
|
+
| `severity` | string | `'all'` | Filter: `'critical'`, `'high'`, `'medium'`, `'all'` |
|
|
190
|
+
|
|
153
191
|
**Use the unified CLI** for all AIReady tools:
|
|
154
192
|
|
|
155
193
|
```bash
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aiready/pattern-detect",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
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",
|