@aiready/pattern-detect 0.9.9 → 0.9.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.
Files changed (2) hide show
  1. package/README.md +39 -5
  2. package/package.json +2 -2
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
- **Recommended: Use the unified CLI** (includes pattern detection + more tools):
9
+ **Zero config, works out of the box:**
10
10
 
11
11
  ```bash
12
- npm install -g @aiready/cli
13
- aiready patterns ./src
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 simpler command and faster runs
19
+ npm install -g @aiready/pattern-detect
20
+ aiready-patterns ./src
14
21
  ```
15
22
 
16
- **Or use this package directly:**
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:
@@ -211,6 +241,10 @@ aiready scan ./src
211
241
  - [**@aiready/context-analyzer**](https://www.npmjs.com/package/@aiready/context-analyzer) - Context window cost analysis
212
242
  - [**@aiready/consistency**](https://www.npmjs.com/package/@aiready/consistency) - Consistency checking
213
243
 
244
+ ## 🌐 Visit Our Website
245
+
246
+ **Try AIReady tools online and optimize your codebase:** [getaiready.dev](https://getaiready.dev)
247
+
214
248
  ---
215
249
 
216
250
  **Made with 💙 by the AIReady team** | [GitHub](https://github.com/caopengau/aiready)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aiready/pattern-detect",
3
- "version": "0.9.9",
3
+ "version": "0.9.11",
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": "^14.0.0",
47
47
  "chalk": "^5.3.0",
48
- "@aiready/core": "0.7.4"
48
+ "@aiready/core": "0.7.5"
49
49
  },
50
50
  "devDependencies": {
51
51
  "tsup": "^8.3.5",