@aiready/consistency 0.8.29 → 0.8.30
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/.turbo/turbo-build.log +7 -7
- package/.turbo/turbo-test.log +11 -9
- package/README.md +33 -335
- package/package.json +2 -2
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
|
-
> @aiready/consistency@0.8.
|
|
3
|
+
> @aiready/consistency@0.8.30 build /Users/pengcao/projects/aiready/packages/consistency
|
|
4
4
|
> tsup src/index.ts src/cli.ts --format cjs,esm --dts
|
|
5
5
|
|
|
6
6
|
[34mCLI[39m Building entry: src/cli.ts, src/index.ts
|
|
@@ -9,15 +9,15 @@
|
|
|
9
9
|
[34mCLI[39m Target: es2020
|
|
10
10
|
[34mCJS[39m Build start
|
|
11
11
|
[34mESM[39m Build start
|
|
12
|
-
[32mCJS[39m [1mdist/index.js [22m[32m55.56 KB[39m
|
|
13
|
-
[32mCJS[39m [1mdist/cli.js [22m[32m50.90 KB[39m
|
|
14
|
-
[32mCJS[39m ⚡️ Build success in 245ms
|
|
15
12
|
[32mESM[39m [1mdist/index.mjs [22m[32m12.92 KB[39m
|
|
16
|
-
[32mESM[39m [1mdist/chunk-YEHXYHGY.mjs [22m[32m40.95 KB[39m
|
|
17
13
|
[32mESM[39m [1mdist/cli.mjs [22m[32m8.76 KB[39m
|
|
18
|
-
[32mESM[39m
|
|
14
|
+
[32mESM[39m [1mdist/chunk-YEHXYHGY.mjs [22m[32m40.95 KB[39m
|
|
15
|
+
[32mESM[39m ⚡️ Build success in 168ms
|
|
16
|
+
[32mCJS[39m [1mdist/cli.js [22m[32m50.90 KB[39m
|
|
17
|
+
[32mCJS[39m [1mdist/index.js [22m[32m55.56 KB[39m
|
|
18
|
+
[32mCJS[39m ⚡️ Build success in 205ms
|
|
19
19
|
DTS Build start
|
|
20
|
-
DTS ⚡️ Build success in
|
|
20
|
+
DTS ⚡️ Build success in 9020ms
|
|
21
21
|
DTS dist/cli.d.ts 20.00 B
|
|
22
22
|
DTS dist/index.d.ts 3.41 KB
|
|
23
23
|
DTS dist/cli.d.mts 20.00 B
|
package/.turbo/turbo-test.log
CHANGED
|
@@ -1,22 +1,24 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
|
-
> @aiready/consistency@0.8.
|
|
3
|
+
> @aiready/consistency@0.8.30 test /Users/pengcao/projects/aiready/packages/consistency
|
|
4
4
|
> vitest run
|
|
5
5
|
|
|
6
6
|
[?25l
|
|
7
7
|
[1m[46m RUN [49m[22m [36mv4.0.18 [39m[90m/Users/pengcao/projects/aiready/packages/consistency[39m
|
|
8
8
|
|
|
9
9
|
[32m✓[39m dist/__tests__/scoring.test.js [2m([22m[2m8 tests[22m[2m)[22m[32m 3[2mms[22m[39m
|
|
10
|
-
[32m✓[39m src/__tests__/
|
|
11
|
-
[32m✓[39m
|
|
12
|
-
[32m✓[39m
|
|
13
|
-
[32m✓[39m
|
|
14
|
-
[33m[2m✓[22m[39m should analyze naming issues [33m
|
|
15
|
-
|
|
10
|
+
[32m✓[39m src/__tests__/scoring.test.ts [2m([22m[2m8 tests[22m[2m)[22m[32m 7[2mms[22m[39m
|
|
11
|
+
[32m✓[39m src/__tests__/language-filter.test.ts [2m([22m[2m3 tests[22m[2m)[22m[32m 5[2mms[22m[39m
|
|
12
|
+
[32m✓[39m dist/__tests__/language-filter.test.js [2m([22m[2m3 tests[22m[2m)[22m[32m 4[2mms[22m[39m
|
|
13
|
+
[32m✓[39m dist/__tests__/analyzer.test.js [2m([22m[2m18 tests[22m[2m)[22m[33m 1061[2mms[22m[39m
|
|
14
|
+
[33m[2m✓[22m[39m should analyze naming issues [33m 494[2mms[22m[39m
|
|
15
|
+
[33m[2m✓[22m[39m should detect minimum severity filtering [33m 372[2mms[22m[39m
|
|
16
|
+
[32m✓[39m src/__tests__/analyzer.test.ts [2m([22m[2m18 tests[22m[2m)[22m[33m 1009[2mms[22m[39m
|
|
17
|
+
[33m[2m✓[22m[39m should analyze naming issues [33m 673[2mms[22m[39m
|
|
16
18
|
|
|
17
19
|
[2m Test Files [22m [1m[32m6 passed[39m[22m[90m (6)[39m
|
|
18
20
|
[2m Tests [22m [1m[32m58 passed[39m[22m[90m (58)[39m
|
|
19
|
-
[2m Start at [22m
|
|
20
|
-
[2m Duration [22m
|
|
21
|
+
[2m Start at [22m 13:04:30
|
|
22
|
+
[2m Duration [22m 4.31s[2m (transform 3.85s, setup 0ms, import 13.17s, tests 2.09s, environment 4ms)[22m
|
|
21
23
|
|
|
22
24
|
[?25h
|
package/README.md
CHANGED
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
# @aiready/consistency
|
|
2
2
|
|
|
3
|
-
>
|
|
3
|
+
> AIReady Spoke: Scans for naming violations, architectural drift, and pattern mismatches that confuse AI agents.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
[](https://npmjs.com/package/@aiready/consistency)
|
|
6
|
+
[](https://opensource.org/licenses/MIT)
|
|
7
|
+
|
|
8
|
+
## Overview
|
|
9
|
+
|
|
10
|
+
Consistent naming and project structure are the bedrock of high-performing AI teams. The **Consistency** analyzer scans your project for naming violations, architectural drift, and pattern mismatches that slow down AI agents.
|
|
6
11
|
|
|
7
12
|
## 🏛️ Architecture
|
|
8
13
|
|
|
@@ -10,349 +15,42 @@ Helps teams maintain consistent coding practices across their codebase, making i
|
|
|
10
15
|
🎯 USER
|
|
11
16
|
│
|
|
12
17
|
▼
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
└────────┘ └───┬────┘
|
|
23
|
-
│ │
|
|
24
|
-
│ ┌─────────────────────┼─────────────────────┐
|
|
25
|
-
│ ▼ ▼ ▼
|
|
26
|
-
│ ┌────────┐ ┌────────┐ ┌────────┐
|
|
27
|
-
│ │📊 PAT- │ │📦 CON- │ │🔧 CON- │
|
|
28
|
-
│ │TERN │ │TEXT │ │SISTENCY│
|
|
29
|
-
│ │DETECT │ │ANALYZER│ │ │
|
|
30
|
-
│ │ │ │ │ │ │
|
|
31
|
-
│ │✅ Ready│ │✅ Ready│ │✅ Ready│
|
|
32
|
-
│ └────────┘ └────────┘ └────────┘
|
|
33
|
-
│ │
|
|
34
|
-
│ ← YOU ARE HERE ──────┘
|
|
35
|
-
│ │
|
|
36
|
-
└───────────────────────────────────────────────────────┘
|
|
37
|
-
│
|
|
38
|
-
▼
|
|
39
|
-
🏢 HUB (@aiready/core)
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
## 🌍 Language Support
|
|
43
|
-
|
|
44
|
-
**Currently Supported (64% market coverage):**
|
|
45
|
-
- ✅ **TypeScript** (`.ts`, `.tsx`) - camelCase, PascalCase conventions
|
|
46
|
-
- ✅ **JavaScript** (`.js`, `.jsx`) - camelCase, PascalCase conventions
|
|
47
|
-
- ✅ **Python** (`.py`) - PEP 8 conventions (snake_case, PascalCase, UPPER_CASE)
|
|
48
|
-
|
|
49
|
-
**Roadmap:**
|
|
50
|
-
- 🔜 **Java** (Q3 2026) - Java naming conventions, JavaBean patterns
|
|
51
|
-
- 🔜 **Go** (Q4 2026) - Go naming conventions, exported names
|
|
52
|
-
- 🔜 **Rust** (Q4 2026) - Rust naming conventions, snake_case
|
|
53
|
-
- 🔜 **C#** (Q1 2027) - C# conventions, PascalCase
|
|
54
|
-
|
|
55
|
-
## 🚀 Quick Start
|
|
56
|
-
|
|
57
|
-
**Zero config, works out of the box:**
|
|
58
|
-
|
|
59
|
-
```bash
|
|
60
|
-
# Run without installation (recommended)
|
|
61
|
-
npx @aiready/consistency ./src
|
|
18
|
+
🎛️ @aiready/cli (orchestrator)
|
|
19
|
+
│ │ │ │ │ │ │ │ │
|
|
20
|
+
▼ ▼ ▼ ▼ ▼ ▼ ▼ ▼ ▼
|
|
21
|
+
[PAT] [CTX] [CON] [AMP] [DEP] [DOC] [SIG] [AGT] [TST]
|
|
22
|
+
│ │ │ │ │ │ │ │ │
|
|
23
|
+
└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘
|
|
24
|
+
│
|
|
25
|
+
▼
|
|
26
|
+
🏢 @aiready/core
|
|
62
27
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
### 🎯 Input & Output
|
|
72
|
-
|
|
73
|
-
**Input:** Path to your source code directory
|
|
74
|
-
```bash
|
|
75
|
-
aiready-consistency ./src
|
|
28
|
+
Legend:
|
|
29
|
+
PAT = pattern-detect CTX = context-analyzer
|
|
30
|
+
CON = consistency ★ AMP = change-amplification
|
|
31
|
+
DEP = deps-health DOC = doc-drift
|
|
32
|
+
SIG = ai-signal-clarity AGT = agent-grounding
|
|
33
|
+
TST = testability ★ = YOU ARE HERE
|
|
76
34
|
```
|
|
77
35
|
|
|
78
|
-
|
|
79
|
-
```
|
|
80
|
-
📊 Consistency Analysis
|
|
81
|
-
━━━━━━━━━━━━━━━━━━━━━━━━
|
|
82
|
-
📁 Files analyzed: 47
|
|
83
|
-
⚠️ Issues found: 15 naming + 8 pattern issues
|
|
84
|
-
|
|
85
|
-
CRITICAL (2 files)
|
|
86
|
-
src/utils/helpers.ts:12 - poor-naming: x
|
|
87
|
-
src/api/users.ts:45 - convention-mix: user_name
|
|
88
|
-
```
|
|
89
|
-
|
|
90
|
-
### ✨ Smart Defaults (Zero Config)
|
|
91
|
-
|
|
92
|
-
- ✅ **Auto-excludes** test files (`**/*.test.*`, `**/*.spec.*`, `**/__tests__/**`)
|
|
93
|
-
- ✅ **Auto-excludes** build outputs (`dist/`, `build/`, `.next/`)
|
|
94
|
-
- ✅ **Auto-excludes** dependencies (`node_modules/`)
|
|
95
|
-
- ✅ **Context-aware**: Skips common iterators (i, j, k) in loops
|
|
96
|
-
- ✅ **100+ built-in** acceptable abbreviations (env, api, url, ctx, etc.)
|
|
97
|
-
- ✅ **Smart detection**: Recognizes arrow functions, factory patterns, callbacks
|
|
98
|
-
|
|
99
|
-
> Override defaults with `--include-tests` or `--exclude <patterns>` as needed
|
|
100
|
-
|
|
101
|
-
## 🎯 What It Does
|
|
102
|
-
|
|
103
|
-
Inconsistent code patterns confuse AI models and reduce their effectiveness. This tool analyzes:
|
|
104
|
-
|
|
105
|
-
### 🔧 Language Support
|
|
106
|
-
|
|
107
|
-
**Fully Supported:**
|
|
108
|
-
- TypeScript (`.ts`, `.tsx`)
|
|
109
|
-
- JavaScript (`.js`, `.jsx`)
|
|
110
|
-
|
|
111
|
-
**Not Yet Supported:**
|
|
112
|
-
- Python (`.py`) - Files will be skipped
|
|
113
|
-
- Java (`.java`) - Files will be skipped
|
|
114
|
-
- Other languages - Files will be skipped
|
|
115
|
-
|
|
116
|
-
If you see "Failed to parse" warnings for non-JS/TS files, this is expected behavior and won't affect the analysis of your JavaScript/TypeScript code.
|
|
117
|
-
|
|
118
|
-
### 🏷️ Naming Quality & Conventions
|
|
119
|
-
- **Single-letter variables** - Detects unclear variable names (skips common iterators: i, j, k, l, x, y, z in appropriate contexts)
|
|
120
|
-
- **Abbreviations** - Identifies unclear abbreviations while allowing 60+ standard ones (env, req, res, ctx, max, min, etc.)
|
|
121
|
-
- **Mixed naming conventions** - Detects snake_case in TypeScript/JavaScript projects (should use camelCase)
|
|
122
|
-
- **Boolean naming** - Ensures booleans use clear prefixes (is/has/can/should)
|
|
123
|
-
- **Function naming** - Checks for action verbs while allowing factory patterns and descriptive names
|
|
124
|
-
|
|
125
|
-
**Smart Detection:** The tool understands context and won't flag:
|
|
126
|
-
- Common abbreviations (env, api, url, max, min, now, etc.) - 100+ built-in
|
|
127
|
-
- Boolean prefixes (is, has, can used as variables)
|
|
128
|
-
- Loop iterators (i, j, k) in appropriate contexts
|
|
129
|
-
- Arrow function parameters in callbacks (`.map(s => ...)`)
|
|
130
|
-
- Multi-line arrow functions (detects across 3-5 line context)
|
|
131
|
-
- Short-lived comparison variables (used within 5 lines)
|
|
132
|
-
- Factory/builder patterns
|
|
133
|
-
- Long descriptive function names
|
|
134
|
-
- Project-specific abbreviations via configuration
|
|
135
|
-
|
|
136
|
-
### 🔄 Pattern Consistency
|
|
137
|
-
- **Error handling strategies** - Detects mixed approaches (try-catch vs returns vs throws)
|
|
138
|
-
- **Async patterns** - Identifies mixing of async/await, promises, and callbacks
|
|
139
|
-
- **Import styles** - Flags mixing of ES modules and CommonJS
|
|
140
|
-
- **API design patterns** - Ensures consistent patterns across endpoints
|
|
141
|
-
|
|
142
|
-
### 🏗️ Architectural Consistency *(coming soon)*
|
|
143
|
-
- File organization patterns
|
|
144
|
-
- Module structure
|
|
145
|
-
- Export/import patterns
|
|
146
|
-
|
|
147
|
-
## 📊 Example Output
|
|
148
|
-
|
|
149
|
-
```
|
|
150
|
-
📊 Summary
|
|
151
|
-
|
|
152
|
-
Files Analyzed: 47
|
|
153
|
-
Total Issues: 23
|
|
154
|
-
Naming: 15
|
|
155
|
-
Patterns: 8
|
|
156
|
-
Architecture: 0
|
|
157
|
-
|
|
158
|
-
🏷️ Naming Issues
|
|
159
|
-
|
|
160
|
-
MINOR src/utils/helpers.ts:12
|
|
161
|
-
poor-naming: x
|
|
162
|
-
→ Use descriptive variable name instead of single letter 'x'
|
|
163
|
-
|
|
164
|
-
MINOR src/components/User.ts:45
|
|
165
|
-
convention-mix: user_name
|
|
166
|
-
→ Use camelCase 'userName' instead of snake_case in TypeScript/JavaScript
|
|
167
|
-
|
|
168
|
-
🔄 Pattern Issues
|
|
169
|
-
|
|
170
|
-
MAJOR multiple files
|
|
171
|
-
Inconsistent error handling strategies across codebase
|
|
172
|
-
→ Standardize error handling strategy (prefer try-catch with typed errors)
|
|
36
|
+
## Features
|
|
173
37
|
|
|
174
|
-
|
|
38
|
+
- **Naming Conventions**: Enforces consistent naming for files, classes, and variables.
|
|
39
|
+
- **Architectural Guardrails**: Ensures components stay within their defined layer (e.g., spokes don't import from other spokes).
|
|
40
|
+
- **Pattern Matcher**: Detects if new code follows established project patterns.
|
|
175
41
|
|
|
176
|
-
|
|
177
|
-
2. Improve variable naming: Found 8 single-letter or unclear variable names
|
|
178
|
-
3. Use async/await consistently instead of mixing with promise chains
|
|
179
|
-
```
|
|
180
|
-
|
|
181
|
-
## ⚙️ Usage
|
|
42
|
+
## Installation
|
|
182
43
|
|
|
183
44
|
```bash
|
|
184
|
-
|
|
185
|
-
aiready-consistency ./src
|
|
186
|
-
|
|
187
|
-
# Skip naming checks
|
|
188
|
-
aiready-consistency ./src --no-naming
|
|
189
|
-
|
|
190
|
-
# Skip pattern checks
|
|
191
|
-
aiready-consistency ./src --no-patterns
|
|
192
|
-
|
|
193
|
-
# Show only major issues
|
|
194
|
-
aiready-consistency ./src --min-severity major
|
|
195
|
-
|
|
196
|
-
# Export to JSON (saved to .aiready/ by default)
|
|
197
|
-
aiready-consistency ./src --output json
|
|
198
|
-
|
|
199
|
-
# Export to Markdown (saved to .aiready/ by default)
|
|
200
|
-
aiready-consistency ./src --output markdown
|
|
201
|
-
|
|
202
|
-
# Or specify custom paths
|
|
203
|
-
aiready-consistency ./src --output json --output-file custom-report.json
|
|
204
|
-
aiready-consistency ./src --output markdown --output-file custom-report.md
|
|
45
|
+
pnpm add @aiready/consistency
|
|
205
46
|
```
|
|
206
47
|
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
## 🎛️ Options
|
|
210
|
-
|
|
211
|
-
| Option | Description | Default |
|
|
212
|
-
|--------|-------------|---------|
|
|
213
|
-
| `--naming` | Enable naming analysis | `true` |
|
|
214
|
-
| `--no-naming` | Skip naming analysis | - |
|
|
215
|
-
| `--patterns` | Enable pattern analysis | `true` |
|
|
216
|
-
| `--no-patterns` | Skip pattern analysis | - |
|
|
217
|
-
| `--min-severity` | Minimum severity: info\|minor\|major\|critical | `info` |
|
|
218
|
-
| `--include` | File patterns to include | All files |
|
|
219
|
-
| `--exclude` | File patterns to exclude | - |
|
|
220
|
-
| `--output` | Output format: console\|json\|markdown | `console` |
|
|
221
|
-
| `--output-file` | Output file path | - |
|
|
222
|
-
|
|
223
|
-
## 📝 Configuration File
|
|
224
|
-
|
|
225
|
-
Create `.airreadyrc.json`, `aiready.json`, or `aiready.config.json` in your project root:
|
|
226
|
-
|
|
227
|
-
```json
|
|
228
|
-
{
|
|
229
|
-
"scan": {
|
|
230
|
-
"include": ["src/**/*.{ts,tsx,js,jsx}"],
|
|
231
|
-
"exclude": ["**/dist/**", "**/node_modules/**"]
|
|
232
|
-
},
|
|
233
|
-
"tools": {
|
|
234
|
-
"consistency": {
|
|
235
|
-
"checkNaming": true,
|
|
236
|
-
"checkPatterns": true,
|
|
237
|
-
"minSeverity": "minor",
|
|
238
|
-
"acceptedAbbreviations": ["ses", "gst", "cdk"],
|
|
239
|
-
"shortWords": ["oak", "elm"],
|
|
240
|
-
"disableChecks": []
|
|
241
|
-
}
|
|
242
|
-
},
|
|
243
|
-
"output": {
|
|
244
|
-
"format": "console"
|
|
245
|
-
}
|
|
246
|
-
}
|
|
247
|
-
```
|
|
248
|
-
|
|
249
|
-
**Configuration Options:**
|
|
250
|
-
|
|
251
|
-
| Option | Type | Default | Description |
|
|
252
|
-
|--------|------|---------|-------------|
|
|
253
|
-
| `checkNaming` | boolean | `true` | Check naming conventions |
|
|
254
|
-
| `checkPatterns` | boolean | `true` | Check code pattern consistency |
|
|
255
|
-
| `minSeverity` | string | `'info'` | Filter: `'info'`, `'minor'`, `'major'`, `'critical'` |
|
|
256
|
-
| `acceptedAbbreviations` | string[] | `[]` | Custom abbreviations to accept (e.g., domain-specific terms) |
|
|
257
|
-
| `shortWords` | string[] | `[]` | Additional full English words to accept |
|
|
258
|
-
| `disableChecks` | string[] | `[]` | Disable specific checks: `'single-letter'`, `'abbreviation'`, `'convention-mix'`, `'unclear'`, `'poor-naming'` |
|
|
259
|
-
|
|
260
|
-
### Project-Specific Configuration Examples
|
|
261
|
-
|
|
262
|
-
**React/Next.js Projects:**
|
|
263
|
-
```json
|
|
264
|
-
{
|
|
265
|
-
"tools": {
|
|
266
|
-
"consistency": {
|
|
267
|
-
"acceptedAbbreviations": ["jsx", "tsx", "ref", "ctx", "req", "res"]
|
|
268
|
-
}
|
|
269
|
-
}
|
|
270
|
-
}
|
|
271
|
-
```
|
|
272
|
-
|
|
273
|
-
**AWS/Cloud Projects:**
|
|
274
|
-
```json
|
|
275
|
-
{
|
|
276
|
-
"tools": {
|
|
277
|
-
"consistency": {
|
|
278
|
-
"acceptedAbbreviations": ["ses", "sns", "sqs", "ec2", "vpc", "iam"]
|
|
279
|
-
}
|
|
280
|
-
}
|
|
281
|
-
}
|
|
282
|
-
```
|
|
48
|
+
## Usage
|
|
283
49
|
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
{
|
|
287
|
-
"tools": {
|
|
288
|
-
"consistency": {
|
|
289
|
-
"acceptedAbbreviations": ["gst", "vat", "sku", "upc"],
|
|
290
|
-
"shortWords": ["tax", "buy", "pay", "cart"]
|
|
291
|
-
}
|
|
292
|
-
}
|
|
293
|
-
}
|
|
294
|
-
```
|
|
295
|
-
|
|
296
|
-
### Acceptable Abbreviations
|
|
297
|
-
|
|
298
|
-
The tool recognizes 100+ standard abbreviations and won't flag them:
|
|
299
|
-
|
|
300
|
-
**Web/Network:** url, uri, api, cdn, dns, ip, http, utm, seo, xhr, cors, ws, wss
|
|
301
|
-
**Data:** json, xml, yaml, csv, html, css, svg, pdf, dto, dao
|
|
302
|
-
**System:** env, os, fs, cli, tmp, src, dst, bin, lib, pkg
|
|
303
|
-
**Request/Response:** req, res, ctx, err, msg
|
|
304
|
-
**Math:** max, min, avg, sum, abs, cos, sin, log, sqrt
|
|
305
|
-
**Time:** now, utc, ms, sec, hr, yr, mo
|
|
306
|
-
**Loop Counters:** i, j, k, n, m
|
|
307
|
-
**Cloud/Infrastructure:** s3, ec2, sqs, sns, vpc, ami, iam, aws
|
|
308
|
-
**Common:** id, uid, db, sql, orm, ui, ux, dom, ref, val, str, obj, arr, cfg, init
|
|
309
|
-
|
|
310
|
-
See [naming.ts](src/analyzers/naming.ts) for the complete list.
|
|
311
|
-
|
|
312
|
-
## 🔧 Programmatic API
|
|
313
|
-
|
|
314
|
-
```typescript
|
|
315
|
-
import { analyzeConsistency } from '@aiready/consistency';
|
|
316
|
-
|
|
317
|
-
const report = await analyzeConsistency({
|
|
318
|
-
rootDir: './src',
|
|
319
|
-
checkNaming: true,
|
|
320
|
-
checkPatterns: true,
|
|
321
|
-
minSeverity: 'minor'
|
|
322
|
-
});
|
|
323
|
-
|
|
324
|
-
console.log(`Found ${report.summary.totalIssues} issues`);
|
|
50
|
+
```bash
|
|
51
|
+
aiready scan . --tools consistency
|
|
325
52
|
```
|
|
326
53
|
|
|
327
|
-
##
|
|
328
|
-
|
|
329
|
-
AI models work best with consistent codebases because:
|
|
330
|
-
|
|
331
|
-
1. **Pattern Recognition**: Consistent patterns help AI understand your coding style
|
|
332
|
-
2. **Context Efficiency**: Less variation = more useful code fits in context window
|
|
333
|
-
3. **Accurate Suggestions**: AI can predict conventions and follow them
|
|
334
|
-
4. **Reduced Errors**: AI makes fewer mistakes with clear, consistent patterns
|
|
335
|
-
|
|
336
|
-
## 📦 Integration with AIReady
|
|
337
|
-
|
|
338
|
-
This tool is part of the [AIReady](https://getaiready.dev) ecosystem:
|
|
339
|
-
|
|
340
|
-
**Related packages:**
|
|
341
|
-
- [**@aiready/cli**](https://www.npmjs.com/package/@aiready/cli) - Unified interface for all analysis tools
|
|
342
|
-
- [**@aiready/pattern-detect**](https://www.npmjs.com/package/@aiready/pattern-detect) - Semantic duplicate detection
|
|
343
|
-
- [**@aiready/context-analyzer**](https://www.npmjs.com/package/@aiready/context-analyzer) - Context window cost analysis
|
|
344
|
-
- **@aiready/context-analyzer** - Context window cost analysis
|
|
345
|
-
- **@aiready/consistency** - Consistency analysis (this tool)
|
|
346
|
-
|
|
347
|
-
## 📖 Documentation
|
|
348
|
-
|
|
349
|
-
- [Contributing Guide](./CONTRIBUTING.md)
|
|
350
|
-
- [AIReady Website](https://getaiready.dev)
|
|
351
|
-
|
|
352
|
-
## 🌐 Visit Our Website
|
|
353
|
-
|
|
354
|
-
**Try AIReady tools online and maintain code consistency:** [getaiready.dev](https://getaiready.dev)
|
|
355
|
-
|
|
356
|
-
## 📄 License
|
|
54
|
+
## License
|
|
357
55
|
|
|
358
|
-
MIT
|
|
56
|
+
MIT
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aiready/consistency",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.30",
|
|
4
4
|
"description": "Detects consistency issues in naming, patterns, and architecture that confuse AI models",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"@typescript-eslint/typescript-estree": "^8.53.0",
|
|
44
44
|
"chalk": "^5.3.0",
|
|
45
45
|
"commander": "^14.0.0",
|
|
46
|
-
"@aiready/core": "0.9.
|
|
46
|
+
"@aiready/core": "0.9.31"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
49
|
"@types/node": "^24.0.0",
|