@aiready/pattern-detect 0.9.9 → 0.9.10
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 +35 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -6,20 +6,50 @@ Finds semantically similar but syntactically different code patterns that waste
|
|
|
6
6
|
|
|
7
7
|
## 🚀 Quick Start
|
|
8
8
|
|
|
9
|
-
**
|
|
9
|
+
**Zero config, works out of the box:**
|
|
10
10
|
|
|
11
11
|
```bash
|
|
12
|
-
|
|
13
|
-
aiready
|
|
12
|
+
# Run without installation (recommended)
|
|
13
|
+
npx @aiready/pattern-detect ./src
|
|
14
|
+
|
|
15
|
+
# Or use the unified CLI (includes all AIReady tools)
|
|
16
|
+
npx @aiready/cli scan ./src
|
|
17
|
+
|
|
18
|
+
# Or install globally for faster runs
|
|
19
|
+
npm install -g @aiready/pattern-detect
|
|
20
|
+
aiready-patterns ./src
|
|
14
21
|
```
|
|
15
22
|
|
|
16
|
-
|
|
23
|
+
### 🎯 Input & Output
|
|
17
24
|
|
|
25
|
+
**Input:** Path to your source code directory
|
|
18
26
|
```bash
|
|
19
|
-
npm install -g @aiready/pattern-detect
|
|
20
27
|
aiready-patterns ./src
|
|
21
28
|
```
|
|
22
29
|
|
|
30
|
+
**Output:** Terminal report + optional JSON file (saved to `.aiready/` directory)
|
|
31
|
+
```
|
|
32
|
+
📊 Duplicate Pattern Analysis
|
|
33
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
34
|
+
📁 Files analyzed: 47
|
|
35
|
+
⚠️ Duplicate patterns: 12 files with 23 issues
|
|
36
|
+
💰 Wasted tokens: 8,450
|
|
37
|
+
|
|
38
|
+
CRITICAL (6 files)
|
|
39
|
+
src/handlers/users.ts - 4 duplicates (1,200 tokens)
|
|
40
|
+
src/handlers/posts.ts - 3 duplicates (950 tokens)
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### ✨ Smart Defaults (Zero Config)
|
|
44
|
+
|
|
45
|
+
- ✅ **Auto-excludes** test files (`**/*.test.*`, `**/*.spec.*`, `**/__tests__/**`)
|
|
46
|
+
- ✅ **Auto-excludes** build outputs (`dist/`, `build/`, `.next/`)
|
|
47
|
+
- ✅ **Auto-excludes** dependencies (`node_modules/`)
|
|
48
|
+
- ✅ **Adaptive threshold**: Adjusts similarity detection based on codebase size
|
|
49
|
+
- ✅ **Pattern classification**: Automatically categorizes duplicates (API handlers, validators, etc.)
|
|
50
|
+
|
|
51
|
+
> Override defaults with `--include-tests` or `--exclude <patterns>` as needed
|
|
52
|
+
|
|
23
53
|
## 🎯 What It Does
|
|
24
54
|
|
|
25
55
|
AI tools generate similar code in different ways because they lack awareness of your codebase patterns. This tool:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aiready/pattern-detect",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.10",
|
|
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",
|