@aiready/cli 0.14.13 → 0.14.15

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 (95) hide show
  1. package/CONTRIBUTING.md +86 -1
  2. package/LICENSE +21 -0
  3. package/package.json +33 -12
  4. package/.aiready/aiready-report-20260227-133806.json +0 -7805
  5. package/.aiready/aiready-report-20260227-133938.json +0 -7951
  6. package/.aiready/aiready-report-20260228-003433.json +0 -7939
  7. package/.aiready/aiready-report-20260228-003613.json +0 -771
  8. package/.aiready/aiready-report-20260314-164626.json +0 -59
  9. package/.aiready/aiready-report-20260314-164741.json +0 -59
  10. package/.aiready/aiready-report-20260319-201106.json +0 -5566
  11. package/.aiready/aiready-report-20260319-201511.json +0 -5566
  12. package/.aiready/aiready-report-20260319-202017.json +0 -5708
  13. package/.github/FUNDING.yml +0 -5
  14. package/.turbo/turbo-build.log +0 -29
  15. package/.turbo/turbo-lint.log +0 -0
  16. package/.turbo/turbo-test.log +0 -76
  17. package/aiready-report.json +0 -30703
  18. package/coverage/base.css +0 -224
  19. package/coverage/block-navigation.js +0 -87
  20. package/coverage/clover.xml +0 -865
  21. package/coverage/coverage-final.json +0 -15
  22. package/coverage/favicon.png +0 -0
  23. package/coverage/index.html +0 -146
  24. package/coverage/prettify.css +0 -1
  25. package/coverage/prettify.js +0 -2
  26. package/coverage/sort-arrow-sprite.png +0 -0
  27. package/coverage/sorter.js +0 -210
  28. package/coverage/src/commands/agent-grounding.ts.html +0 -271
  29. package/coverage/src/commands/ai-signal-clarity.ts.html +0 -253
  30. package/coverage/src/commands/change-amplification.ts.html +0 -94
  31. package/coverage/src/commands/consistency.ts.html +0 -781
  32. package/coverage/src/commands/context.ts.html +0 -871
  33. package/coverage/src/commands/deps-health.ts.html +0 -280
  34. package/coverage/src/commands/doc-drift.ts.html +0 -271
  35. package/coverage/src/commands/index.html +0 -281
  36. package/coverage/src/commands/patterns.ts.html +0 -745
  37. package/coverage/src/commands/scan.ts.html +0 -1393
  38. package/coverage/src/commands/testability.ts.html +0 -304
  39. package/coverage/src/commands/upload.ts.html +0 -466
  40. package/coverage/src/commands/visualize.ts.html +0 -1027
  41. package/coverage/src/index.html +0 -116
  42. package/coverage/src/index.ts.html +0 -1372
  43. package/coverage/src/utils/helpers.ts.html +0 -559
  44. package/coverage/src/utils/index.html +0 -116
  45. package/docs/SPOKE_GUIDE.md +0 -184
  46. package/packages/core/src/.aiready/aiready-report-20260314-161145.json +0 -224
  47. package/packages/core/src/.aiready/aiready-report-20260314-161152.json +0 -235
  48. package/packages/pattern-detect/src/.aiready/aiready-report-20260314-161139.json +0 -224
  49. package/src/.aiready/aiready-report-20260312-103623.json +0 -32574
  50. package/src/.aiready/aiready-report-20260312-110843.json +0 -28740
  51. package/src/.aiready/aiready-report-20260312-110955.json +0 -28740
  52. package/src/.aiready/aiready-report-20260314-203209.json +0 -30713
  53. package/src/.aiready/aiready-report-20260314-203736.json +0 -30713
  54. package/src/.aiready/aiready-report-20260314-203857.json +0 -30713
  55. package/src/.aiready/aiready-report-20260314-204047.json +0 -30713
  56. package/src/.aiready/aiready-report-20260318-002110.json +0 -28782
  57. package/src/__tests__/cli.test.ts +0 -85
  58. package/src/__tests__/config-shape.test.ts +0 -105
  59. package/src/__tests__/unified.test.ts +0 -95
  60. package/src/cli.ts +0 -333
  61. package/src/commands/__tests__/agent-grounding.test.ts +0 -24
  62. package/src/commands/__tests__/ai-signal-clarity.test.ts +0 -32
  63. package/src/commands/__tests__/consistency.test.ts +0 -100
  64. package/src/commands/__tests__/deps-health.test.ts +0 -26
  65. package/src/commands/__tests__/doc-drift.test.ts +0 -26
  66. package/src/commands/__tests__/extra-commands.test.ts +0 -168
  67. package/src/commands/__tests__/init.test.ts +0 -51
  68. package/src/commands/__tests__/scan.test.ts +0 -153
  69. package/src/commands/__tests__/testability.test.ts +0 -36
  70. package/src/commands/__tests__/upload.test.ts +0 -50
  71. package/src/commands/__tests__/visualize.test.ts +0 -78
  72. package/src/commands/agent-grounding.ts +0 -62
  73. package/src/commands/ai-signal-clarity.ts +0 -1
  74. package/src/commands/bug.ts +0 -99
  75. package/src/commands/change-amplification.ts +0 -3
  76. package/src/commands/consistency.ts +0 -232
  77. package/src/commands/context.ts +0 -262
  78. package/src/commands/deps-health.ts +0 -1
  79. package/src/commands/doc-drift.ts +0 -1
  80. package/src/commands/index.ts +0 -20
  81. package/src/commands/init.ts +0 -199
  82. package/src/commands/patterns.ts +0 -222
  83. package/src/commands/report-formatter.ts +0 -267
  84. package/src/commands/scan.ts +0 -432
  85. package/src/commands/shared/configured-tool-action.ts +0 -35
  86. package/src/commands/shared/standard-tool-actions.ts +0 -126
  87. package/src/commands/testability.ts +0 -73
  88. package/src/commands/upload.ts +0 -129
  89. package/src/commands/visualize.ts +0 -321
  90. package/src/index.ts +0 -465
  91. package/src/utils/__tests__/helpers.test.ts +0 -35
  92. package/src/utils/helpers.ts +0 -234
  93. package/tsconfig.json +0 -11
  94. package/tsconfig.tsbuildinfo +0 -1
  95. package/vitest.config.ts +0 -13
@@ -1,116 +0,0 @@
1
-
2
- <!doctype html>
3
- <html lang="en">
4
-
5
- <head>
6
- <title>Code coverage report for src/utils</title>
7
- <meta charset="utf-8" />
8
- <link rel="stylesheet" href="../../prettify.css" />
9
- <link rel="stylesheet" href="../../base.css" />
10
- <link rel="shortcut icon" type="image/x-icon" href="../../favicon.png" />
11
- <meta name="viewport" content="width=device-width, initial-scale=1" />
12
- <style type='text/css'>
13
- .coverage-summary .sorter {
14
- background-image: url(../../sort-arrow-sprite.png);
15
- }
16
- </style>
17
- </head>
18
-
19
- <body>
20
- <div class='wrapper'>
21
- <div class='pad1'>
22
- <h1><a href="../../index.html">All files</a> src/utils</h1>
23
- <div class='clearfix'>
24
-
25
- <div class='fl pad1y space-right2'>
26
- <span class="strong">52.23% </span>
27
- <span class="quiet">Statements</span>
28
- <span class='fraction'>35/67</span>
29
- </div>
30
-
31
-
32
- <div class='fl pad1y space-right2'>
33
- <span class="strong">37.2% </span>
34
- <span class="quiet">Branches</span>
35
- <span class='fraction'>16/43</span>
36
- </div>
37
-
38
-
39
- <div class='fl pad1y space-right2'>
40
- <span class="strong">53.84% </span>
41
- <span class="quiet">Functions</span>
42
- <span class='fraction'>7/13</span>
43
- </div>
44
-
45
-
46
- <div class='fl pad1y space-right2'>
47
- <span class="strong">51.56% </span>
48
- <span class="quiet">Lines</span>
49
- <span class='fraction'>33/64</span>
50
- </div>
51
-
52
-
53
- </div>
54
- <p class="quiet">
55
- Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
56
- </p>
57
- <template id="filterTemplate">
58
- <div class="quiet">
59
- Filter:
60
- <input type="search" id="fileSearch">
61
- </div>
62
- </template>
63
- </div>
64
- <div class='status-line medium'></div>
65
- <div class="pad1">
66
- <table class="coverage-summary">
67
- <thead>
68
- <tr>
69
- <th data-col="file" data-fmt="html" data-html="true" class="file">File</th>
70
- <th data-col="pic" data-type="number" data-fmt="html" data-html="true" class="pic"></th>
71
- <th data-col="statements" data-type="number" data-fmt="pct" class="pct">Statements</th>
72
- <th data-col="statements_raw" data-type="number" data-fmt="html" class="abs"></th>
73
- <th data-col="branches" data-type="number" data-fmt="pct" class="pct">Branches</th>
74
- <th data-col="branches_raw" data-type="number" data-fmt="html" class="abs"></th>
75
- <th data-col="functions" data-type="number" data-fmt="pct" class="pct">Functions</th>
76
- <th data-col="functions_raw" data-type="number" data-fmt="html" class="abs"></th>
77
- <th data-col="lines" data-type="number" data-fmt="pct" class="pct">Lines</th>
78
- <th data-col="lines_raw" data-type="number" data-fmt="html" class="abs"></th>
79
- </tr>
80
- </thead>
81
- <tbody><tr>
82
- <td class="file medium" data-value="helpers.ts"><a href="helpers.ts.html">helpers.ts</a></td>
83
- <td data-value="52.23" class="pic medium">
84
- <div class="chart"><div class="cover-fill" style="width: 52%"></div><div class="cover-empty" style="width: 48%"></div></div>
85
- </td>
86
- <td data-value="52.23" class="pct medium">52.23%</td>
87
- <td data-value="67" class="abs medium">35/67</td>
88
- <td data-value="37.2" class="pct low">37.2%</td>
89
- <td data-value="43" class="abs low">16/43</td>
90
- <td data-value="53.84" class="pct medium">53.84%</td>
91
- <td data-value="13" class="abs medium">7/13</td>
92
- <td data-value="51.56" class="pct medium">51.56%</td>
93
- <td data-value="64" class="abs medium">33/64</td>
94
- </tr>
95
-
96
- </tbody>
97
- </table>
98
- </div>
99
- <div class='push'></div><!-- for sticky footer -->
100
- </div><!-- /wrapper -->
101
- <div class='footer quiet pad2 space-top1 center small'>
102
- Code coverage generated by
103
- <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
104
- at 2026-03-09T03:44:16.153Z
105
- </div>
106
- <script src="../../prettify.js"></script>
107
- <script>
108
- window.onload = function () {
109
- prettyPrint();
110
- };
111
- </script>
112
- <script src="../../sorter.js"></script>
113
- <script src="../../block-navigation.js"></script>
114
- </body>
115
- </html>
116
-
@@ -1,184 +0,0 @@
1
- # Building a New AIReady Spoke
2
-
3
- This guide explains how to build a new analysis tool ("spoke") and integrate it into the AIReady ecosystem. AIReady uses a hub-and-spoke architecture where independent tools are coordinated by a central CLI and Hub (@aiready/core).
4
-
5
- ## 🚀 Getting Started
6
-
7
- ### 1. Create Package Structure
8
-
9
- If you are contributing to the monorepo:
10
-
11
- ```bash
12
- mkdir -p packages/your-tool/src
13
- cd packages/your-tool
14
- ```
15
-
16
- ### 2. Create `package.json`
17
-
18
- Your tool should depend on `@aiready/core` for shared types and utilities.
19
-
20
- ```json
21
- {
22
- "name": "@aiready/your-tool",
23
- "version": "0.1.0",
24
- "description": "Brief description of what this tool does",
25
- "main": "./dist/index.js",
26
- "module": "./dist/index.mjs",
27
- "types": "./dist/index.d.ts",
28
- "bin": {
29
- "aiready-yourtool": "./dist/cli.js"
30
- },
31
- "scripts": {
32
- "build": "tsup src/index.ts src/cli.ts --format cjs,esm --dts",
33
- "dev": "tsup src/index.ts src/cli.ts --format cjs,esm --dts --watch",
34
- "test": "vitest run",
35
- "lint": "eslint src",
36
- "clean": "rm -rf dist"
37
- },
38
- "dependencies": {
39
- "@aiready/core": "workspace:*",
40
- "commander": "^12.1.0"
41
- },
42
- "devDependencies": {
43
- "tsup": "^8.3.5"
44
- },
45
- "keywords": ["aiready", "your-keywords"],
46
- "license": "MIT"
47
- }
48
- ```
49
-
50
- ### 3. Implement the Analysis Logic
51
-
52
- Create `src/analyzer.ts` to contain your core logic.
53
-
54
- ```typescript
55
- import { scanFiles, readFileContent } from '@aiready/core';
56
- import type {
57
- AnalysisResult,
58
- Issue,
59
- ScanOptions,
60
- SpokeOutput,
61
- } from '@aiready/core';
62
-
63
- export async function analyzeYourTool(
64
- options: ScanOptions
65
- ): Promise<SpokeOutput> {
66
- const files = await scanFiles(options);
67
- const results: AnalysisResult[] = [];
68
-
69
- // Your analysis logic here
70
- // 1. Iterate through files
71
- // 2. Detect issues
72
- // 3. Return standardized AnalysisResult[]
73
-
74
- return {
75
- results,
76
- summary: {
77
- totalFiles: files.length,
78
- totalIssues: results.reduce((acc, r) => acc + r.issues.length, 0),
79
- // ... other summary stats
80
- },
81
- };
82
- }
83
- ```
84
-
85
- ### 4. Implement ToolProvider and Register
86
-
87
- Every spoke must implement the `ToolProvider` interface and register with the global `ToolRegistry` so that it is automatically discovered by the unified CLI.
88
-
89
- 1. **Create `src/provider.ts`**:
90
-
91
- ```typescript
92
- import {
93
- ToolProvider,
94
- ToolName,
95
- SpokeOutput,
96
- ScanOptions,
97
- ToolScoringOutput,
98
- } from '@aiready/core';
99
- import { analyzeYourTool } from './analyzer';
100
-
101
- export const YourToolProvider: ToolProvider = {
102
- id: ToolName.YourToolID, // Use an existing ToolName or request a new one
103
- alias: ['your-alias'],
104
-
105
- async analyze(options: ScanOptions): Promise<SpokeOutput> {
106
- const output = await analyzeYourTool(options);
107
- return {
108
- ...output,
109
- metadata: { toolName: ToolName.YourToolID, version: '0.1.0' },
110
- };
111
- },
112
-
113
- score(output: SpokeOutput, options: ScanOptions): ToolScoringOutput {
114
- // Implement scoring logic (0-100)
115
- return {
116
- score: 100, // Example
117
- metrics: output.summary,
118
- };
119
- },
120
-
121
- defaultWeight: 10,
122
- };
123
- ```
124
-
125
- 2. **Register in `src/index.ts`**:
126
-
127
- ```typescript
128
- import { ToolRegistry } from '@aiready/core';
129
- import { YourToolProvider } from './provider';
130
-
131
- // Register with global registry for automatic CLI discovery
132
- ToolRegistry.register(YourToolProvider);
133
-
134
- export { YourToolProvider };
135
- export * from './analyzer';
136
- ```
137
-
138
- ### 5. Create Standalone CLI (`src/cli.ts`)
139
-
140
- ```typescript
141
- #!/usr/bin/env node
142
- import { Command } from 'commander';
143
- import { analyzeYourTool } from './analyzer';
144
- import chalk from 'chalk';
145
-
146
- const program = new Command();
147
-
148
- program
149
- .name('aiready-yourtool')
150
- .description('Description of your tool')
151
- .version('0.1.0')
152
- .argument('<directory>', 'Directory to analyze')
153
- .action(async (directory, options) => {
154
- console.log(chalk.blue('🔍 Analyzing...\n'));
155
- const output = await analyzeYourTool({ rootDir: directory });
156
- console.log(JSON.stringify(output, null, 2));
157
- });
158
-
159
- program.parse();
160
- ```
161
-
162
- ## 📋 Standard Specs to Follow
163
-
164
- To ensure your tool integrates perfectly with the AIReady ecosystem, it must follow these rules:
165
-
166
- 1. **Standard Options**: Support `--include`, `--exclude`, and `--output` (standardized via `ScanOptions`).
167
- 2. **No Direct Dependencies**: Spokes should never depend on other spokes. Only depend on `@aiready/core`.
168
- 3. **Standard Issue Types**: Use `IssueType` from `@aiready/core` whenever possible.
169
- 4. **Severity Levels**: Use `critical`, `major`, `minor`, and `info`.
170
- 5. **Non-Blocking**: The `analyze` function should be asynchronous and handle large codebases efficiently.
171
-
172
- ## 🧪 Testing
173
-
174
- Use `vitest` for unit and integration tests. Ensure you test your `ToolProvider` implementation using the `validateSpokeOutput` utility from `@aiready/core`.
175
-
176
- ```typescript
177
- import { validateSpokeOutput } from '@aiready/core/types/contract';
178
-
179
- test('output matches AIReady contract', async () => {
180
- const output = await analyzeYourTool({ rootDir: './test' });
181
- const validation = validateSpokeOutput('your-tool', output);
182
- expect(validation.valid).toBe(true);
183
- });
184
- ```
@@ -1,224 +0,0 @@
1
- {
2
- "summary": {
3
- "totalIssues": 0,
4
- "criticalIssues": 0,
5
- "majorIssues": 0,
6
- "totalFiles": 0,
7
- "toolsRun": ["pattern-detect"],
8
- "executionTime": 5,
9
- "config": {
10
- "scan": {
11
- "tools": ["patterns"]
12
- },
13
- "tools": {
14
- "pattern-detect": {
15
- "minSimilarity": 0.5,
16
- "minLines": 6,
17
- "approx": true,
18
- "minSharedTokens": 10,
19
- "maxCandidatesPerBlock": 100,
20
- "severity": "all"
21
- }
22
- }
23
- },
24
- "toolConfigs": {
25
- "pattern-detect": {
26
- "minSimilarity": 0.5,
27
- "minLines": 6,
28
- "approx": true,
29
- "minSharedTokens": 10,
30
- "maxCandidatesPerBlock": 100,
31
- "severity": "all"
32
- }
33
- }
34
- },
35
- "pattern-detect": {
36
- "results": [],
37
- "summary": {
38
- "totalFiles": 0,
39
- "totalIssues": 0,
40
- "duplicates": [],
41
- "clusters": [],
42
- "config": {
43
- "rootDir": "/Users/pengcao/projects/aiready/packages/cli/packages/core/src",
44
- "minSimilarity": 0.5,
45
- "minLines": 6,
46
- "approx": true,
47
- "minSharedTokens": 10,
48
- "maxCandidatesPerBlock": 100,
49
- "severity": "all"
50
- }
51
- },
52
- "metadata": {
53
- "toolName": "pattern-detect",
54
- "version": "0.12.5",
55
- "timestamp": "2026-03-14T05:11:45.606Z",
56
- "config": {
57
- "minSimilarity": 0.5,
58
- "minLines": 6,
59
- "approx": true,
60
- "minSharedTokens": 10,
61
- "maxCandidatesPerBlock": 100,
62
- "severity": "all",
63
- "includeTests": false
64
- }
65
- }
66
- },
67
- "patterns": {
68
- "results": [],
69
- "summary": {
70
- "totalFiles": 0,
71
- "totalIssues": 0,
72
- "duplicates": [],
73
- "clusters": [],
74
- "config": {
75
- "rootDir": "/Users/pengcao/projects/aiready/packages/cli/packages/core/src",
76
- "minSimilarity": 0.5,
77
- "minLines": 6,
78
- "approx": true,
79
- "minSharedTokens": 10,
80
- "maxCandidatesPerBlock": 100,
81
- "severity": "all"
82
- }
83
- },
84
- "metadata": {
85
- "toolName": "pattern-detect",
86
- "version": "0.12.5",
87
- "timestamp": "2026-03-14T05:11:45.606Z",
88
- "config": {
89
- "minSimilarity": 0.5,
90
- "minLines": 6,
91
- "approx": true,
92
- "minSharedTokens": 10,
93
- "maxCandidatesPerBlock": 100,
94
- "severity": "all",
95
- "includeTests": false
96
- }
97
- }
98
- },
99
- "duplicates": {
100
- "results": [],
101
- "summary": {
102
- "totalFiles": 0,
103
- "totalIssues": 0,
104
- "duplicates": [],
105
- "clusters": [],
106
- "config": {
107
- "rootDir": "/Users/pengcao/projects/aiready/packages/cli/packages/core/src",
108
- "minSimilarity": 0.5,
109
- "minLines": 6,
110
- "approx": true,
111
- "minSharedTokens": 10,
112
- "maxCandidatesPerBlock": 100,
113
- "severity": "all"
114
- }
115
- },
116
- "metadata": {
117
- "toolName": "pattern-detect",
118
- "version": "0.12.5",
119
- "timestamp": "2026-03-14T05:11:45.606Z",
120
- "config": {
121
- "minSimilarity": 0.5,
122
- "minLines": 6,
123
- "approx": true,
124
- "minSharedTokens": 10,
125
- "maxCandidatesPerBlock": 100,
126
- "severity": "all",
127
- "includeTests": false
128
- }
129
- }
130
- },
131
- "duplication": {
132
- "results": [],
133
- "summary": {
134
- "totalFiles": 0,
135
- "totalIssues": 0,
136
- "duplicates": [],
137
- "clusters": [],
138
- "config": {
139
- "rootDir": "/Users/pengcao/projects/aiready/packages/cli/packages/core/src",
140
- "minSimilarity": 0.5,
141
- "minLines": 6,
142
- "approx": true,
143
- "minSharedTokens": 10,
144
- "maxCandidatesPerBlock": 100,
145
- "severity": "all"
146
- }
147
- },
148
- "metadata": {
149
- "toolName": "pattern-detect",
150
- "version": "0.12.5",
151
- "timestamp": "2026-03-14T05:11:45.606Z",
152
- "config": {
153
- "minSimilarity": 0.5,
154
- "minLines": 6,
155
- "approx": true,
156
- "minSharedTokens": 10,
157
- "maxCandidatesPerBlock": 100,
158
- "severity": "all",
159
- "includeTests": false
160
- }
161
- }
162
- },
163
- "patternDetect": {
164
- "results": [],
165
- "summary": {
166
- "totalFiles": 0,
167
- "totalIssues": 0,
168
- "duplicates": [],
169
- "clusters": [],
170
- "config": {
171
- "rootDir": "/Users/pengcao/projects/aiready/packages/cli/packages/core/src",
172
- "minSimilarity": 0.5,
173
- "minLines": 6,
174
- "approx": true,
175
- "minSharedTokens": 10,
176
- "maxCandidatesPerBlock": 100,
177
- "severity": "all"
178
- }
179
- },
180
- "metadata": {
181
- "toolName": "pattern-detect",
182
- "version": "0.12.5",
183
- "timestamp": "2026-03-14T05:11:45.606Z",
184
- "config": {
185
- "minSimilarity": 0.5,
186
- "minLines": 6,
187
- "approx": true,
188
- "minSharedTokens": 10,
189
- "maxCandidatesPerBlock": 100,
190
- "severity": "all",
191
- "includeTests": false
192
- }
193
- }
194
- },
195
- "results": [],
196
- "scoring": {
197
- "overall": 100,
198
- "rating": "Excellent",
199
- "timestamp": "2026-03-14T05:11:45.608Z",
200
- "toolsUsed": ["pattern-detect"],
201
- "breakdown": [
202
- {
203
- "toolName": "pattern-detect",
204
- "score": 100,
205
- "rawMetrics": {
206
- "totalDuplicates": 0,
207
- "totalTokenCost": 0,
208
- "highImpactDuplicates": 0,
209
- "totalFilesAnalyzed": 0
210
- },
211
- "factors": [],
212
- "recommendations": []
213
- }
214
- ],
215
- "calculation": {
216
- "formula": "[(100 × 22)] / 22 = 100",
217
- "weights": {
218
- "pattern-detect": 22
219
- },
220
- "normalized": "[(100 × 22)] / 22 = 100"
221
- }
222
- },
223
- "repository": {}
224
- }