add-skill-kit 3.2.4 → 3.2.6
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 +179 -119
- package/bin/lib/commands/help.js +0 -4
- package/bin/lib/commands/install.js +129 -9
- package/bin/lib/ui.js +1 -1
- package/lib/agent-cli/__tests__/adaptive_engine.test.js +190 -0
- package/lib/agent-cli/__tests__/integration/cross_script.test.js +222 -0
- package/lib/agent-cli/__tests__/integration/full_cycle.test.js +230 -0
- package/lib/agent-cli/__tests__/pattern_analyzer.test.js +173 -0
- package/lib/agent-cli/__tests__/pre_execution_check.test.js +167 -0
- package/lib/agent-cli/__tests__/skill_injector.test.js +191 -0
- package/lib/agent-cli/bin/{ag-smart.js → agent.js} +48 -15
- package/lib/agent-cli/dashboard/dashboard_server.js +340 -0
- package/lib/agent-cli/dashboard/index.html +538 -0
- package/lib/agent-cli/lib/audit.js +2 -2
- package/lib/agent-cli/lib/auto-learn.js +8 -8
- package/lib/agent-cli/lib/eslint-fix.js +1 -1
- package/lib/agent-cli/lib/fix.js +5 -5
- package/lib/agent-cli/lib/hooks/install-hooks.js +4 -4
- package/lib/agent-cli/lib/hooks/lint-learn.js +4 -4
- package/lib/agent-cli/lib/learn.js +10 -10
- package/lib/agent-cli/lib/recall.js +1 -1
- package/lib/agent-cli/lib/settings.js +24 -0
- package/lib/agent-cli/lib/skill-learn.js +2 -2
- package/lib/agent-cli/lib/stats.js +3 -3
- package/lib/agent-cli/lib/ui/dashboard-ui.js +103 -4
- package/lib/agent-cli/lib/ui/index.js +36 -6
- package/lib/agent-cli/lib/watcher.js +2 -2
- package/lib/agent-cli/package.json +4 -4
- package/lib/agent-cli/scripts/adaptive_engine.js +381 -0
- package/lib/agent-cli/scripts/dashboard_server.js +224 -0
- package/lib/agent-cli/scripts/error_sensor.js +565 -0
- package/lib/agent-cli/scripts/learn_from_failure.js +225 -0
- package/lib/agent-cli/scripts/pattern_analyzer.js +781 -0
- package/lib/agent-cli/scripts/pre_execution_check.js +623 -0
- package/lib/agent-cli/scripts/rule_sharing.js +374 -0
- package/lib/agent-cli/scripts/skill_injector.js +387 -0
- package/lib/agent-cli/scripts/success_sensor.js +500 -0
- package/lib/agent-cli/scripts/user_correction_sensor.js +426 -0
- package/lib/agent-cli/services/auto-learn-service.js +247 -0
- package/lib/agent-cli/src/MIGRATION.md +418 -0
- package/lib/agent-cli/src/README.md +367 -0
- package/lib/agent-cli/src/core/evolution/evolution-signal.js +42 -0
- package/lib/agent-cli/src/core/evolution/index.js +17 -0
- package/lib/agent-cli/src/core/evolution/review-gate.js +40 -0
- package/lib/agent-cli/src/core/evolution/signal-detector.js +137 -0
- package/lib/agent-cli/src/core/evolution/signal-queue.js +79 -0
- package/lib/agent-cli/src/core/evolution/threshold-checker.js +79 -0
- package/lib/agent-cli/src/core/index.js +15 -0
- package/lib/agent-cli/src/core/learning/cognitive-enhancer.js +282 -0
- package/lib/agent-cli/src/core/learning/index.js +12 -0
- package/lib/agent-cli/src/core/learning/lesson-synthesizer.js +83 -0
- package/lib/agent-cli/src/core/scanning/index.js +14 -0
- package/lib/agent-cli/src/data/index.js +13 -0
- package/lib/agent-cli/src/data/repositories/index.js +8 -0
- package/lib/agent-cli/src/data/repositories/lesson-repository.js +130 -0
- package/lib/agent-cli/src/data/repositories/signal-repository.js +119 -0
- package/lib/agent-cli/src/data/storage/index.js +8 -0
- package/lib/agent-cli/src/data/storage/json-storage.js +64 -0
- package/lib/agent-cli/src/data/storage/yaml-storage.js +66 -0
- package/lib/agent-cli/src/infrastructure/index.js +13 -0
- package/lib/agent-cli/src/presentation/formatters/skill-formatter.js +232 -0
- package/lib/agent-cli/src/services/export-service.js +162 -0
- package/lib/agent-cli/src/services/index.js +13 -0
- package/lib/agent-cli/src/services/learning-service.js +99 -0
- package/lib/agent-cli/types/index.d.ts +343 -0
- package/lib/agent-cli/utils/benchmark.js +269 -0
- package/lib/agent-cli/utils/logger.js +303 -0
- package/lib/agent-cli/utils/ml_patterns.js +300 -0
- package/lib/agent-cli/utils/recovery.js +312 -0
- package/lib/agent-cli/utils/telemetry.js +290 -0
- package/lib/agentskillskit-cli/ag-smart.js +15 -15
- package/lib/agentskillskit-cli/package.json +3 -3
- package/package.json +12 -6
- package/lib/agent-cli/lib/auto_preview.py +0 -148
- package/lib/agent-cli/lib/checklist.py +0 -222
- package/lib/agent-cli/lib/session_manager.py +0 -120
- package/lib/agent-cli/lib/verify_all.py +0 -327
- /package/bin/{cli.js → kit.js} +0 -0
|
@@ -0,0 +1,538 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
|
|
4
|
+
<head>
|
|
5
|
+
<meta charset="UTF-8">
|
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
7
|
+
<title>Auto-Learn Dashboard</title>
|
|
8
|
+
<style>
|
|
9
|
+
* {
|
|
10
|
+
margin: 0;
|
|
11
|
+
padding: 0;
|
|
12
|
+
box-sizing: border-box;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
body {
|
|
16
|
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
|
|
17
|
+
background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
|
|
18
|
+
min-height: 100vh;
|
|
19
|
+
color: #e0e0e0;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.container {
|
|
23
|
+
max-width: 1400px;
|
|
24
|
+
margin: 0 auto;
|
|
25
|
+
padding: 20px;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
header {
|
|
29
|
+
display: flex;
|
|
30
|
+
justify-content: space-between;
|
|
31
|
+
align-items: center;
|
|
32
|
+
padding: 20px 0;
|
|
33
|
+
border-bottom: 1px solid rgba(255, 255, 255, 0.1);
|
|
34
|
+
margin-bottom: 30px;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
h1 {
|
|
38
|
+
font-size: 24px;
|
|
39
|
+
font-weight: 600;
|
|
40
|
+
display: flex;
|
|
41
|
+
align-items: center;
|
|
42
|
+
gap: 10px;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
h1 span {
|
|
46
|
+
background: linear-gradient(135deg, #00d9ff, #00ff88);
|
|
47
|
+
-webkit-background-clip: text;
|
|
48
|
+
background-clip: text;
|
|
49
|
+
-webkit-text-fill-color: transparent;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.status-badge {
|
|
53
|
+
padding: 6px 12px;
|
|
54
|
+
border-radius: 20px;
|
|
55
|
+
font-size: 12px;
|
|
56
|
+
font-weight: 600;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.status-active {
|
|
60
|
+
background: rgba(0, 255, 136, 0.2);
|
|
61
|
+
color: #00ff88;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.grid {
|
|
65
|
+
display: grid;
|
|
66
|
+
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
|
|
67
|
+
gap: 20px;
|
|
68
|
+
margin-bottom: 30px;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.card {
|
|
72
|
+
background: rgba(255, 255, 255, 0.05);
|
|
73
|
+
border-radius: 16px;
|
|
74
|
+
padding: 24px;
|
|
75
|
+
border: 1px solid rgba(255, 255, 255, 0.1);
|
|
76
|
+
backdrop-filter: blur(10px);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.card h2 {
|
|
80
|
+
font-size: 14px;
|
|
81
|
+
text-transform: uppercase;
|
|
82
|
+
letter-spacing: 1px;
|
|
83
|
+
color: #888;
|
|
84
|
+
margin-bottom: 16px;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.metric {
|
|
88
|
+
font-size: 48px;
|
|
89
|
+
font-weight: 700;
|
|
90
|
+
background: linear-gradient(135deg, #00d9ff, #00ff88);
|
|
91
|
+
-webkit-background-clip: text;
|
|
92
|
+
background-clip: text;
|
|
93
|
+
-webkit-text-fill-color: transparent;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.metric-label {
|
|
97
|
+
font-size: 14px;
|
|
98
|
+
color: #888;
|
|
99
|
+
margin-top: 8px;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.chart-container {
|
|
103
|
+
height: 200px;
|
|
104
|
+
margin-top: 20px;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.bar-chart {
|
|
108
|
+
display: flex;
|
|
109
|
+
align-items: flex-end;
|
|
110
|
+
gap: 8px;
|
|
111
|
+
height: 150px;
|
|
112
|
+
padding-top: 20px;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.bar {
|
|
116
|
+
flex: 1;
|
|
117
|
+
background: linear-gradient(180deg, #00d9ff, #0066ff);
|
|
118
|
+
border-radius: 4px 4px 0 0;
|
|
119
|
+
min-height: 10px;
|
|
120
|
+
transition: height 0.3s ease;
|
|
121
|
+
position: relative;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.bar:hover {
|
|
125
|
+
opacity: 0.8;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.bar-label {
|
|
129
|
+
position: absolute;
|
|
130
|
+
bottom: -25px;
|
|
131
|
+
left: 50%;
|
|
132
|
+
transform: translateX(-50%);
|
|
133
|
+
font-size: 10px;
|
|
134
|
+
color: #888;
|
|
135
|
+
white-space: nowrap;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.list {
|
|
139
|
+
list-style: none;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
.list li {
|
|
143
|
+
display: flex;
|
|
144
|
+
justify-content: space-between;
|
|
145
|
+
align-items: center;
|
|
146
|
+
padding: 12px 0;
|
|
147
|
+
border-bottom: 1px solid rgba(255, 255, 255, 0.05);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
.list li:last-child {
|
|
151
|
+
border-bottom: none;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
.severity {
|
|
155
|
+
padding: 4px 8px;
|
|
156
|
+
border-radius: 4px;
|
|
157
|
+
font-size: 11px;
|
|
158
|
+
font-weight: 600;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
.severity-critical {
|
|
162
|
+
background: rgba(255, 68, 68, 0.2);
|
|
163
|
+
color: #ff4444;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
.severity-high {
|
|
167
|
+
background: rgba(255, 187, 0, 0.2);
|
|
168
|
+
color: #ffbb00;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
.severity-medium {
|
|
172
|
+
background: rgba(0, 136, 255, 0.2);
|
|
173
|
+
color: #0088ff;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
.severity-low {
|
|
177
|
+
background: rgba(136, 136, 136, 0.2);
|
|
178
|
+
color: #888;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
.progress-bar {
|
|
182
|
+
height: 8px;
|
|
183
|
+
background: rgba(255, 255, 255, 0.1);
|
|
184
|
+
border-radius: 4px;
|
|
185
|
+
overflow: hidden;
|
|
186
|
+
margin-top: 12px;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
.progress-fill {
|
|
190
|
+
height: 100%;
|
|
191
|
+
background: linear-gradient(90deg, #00d9ff, #00ff88);
|
|
192
|
+
border-radius: 4px;
|
|
193
|
+
transition: width 0.5s ease;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
.actions {
|
|
197
|
+
display: flex;
|
|
198
|
+
gap: 10px;
|
|
199
|
+
margin-top: 20px;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
button {
|
|
203
|
+
padding: 10px 20px;
|
|
204
|
+
border: none;
|
|
205
|
+
border-radius: 8px;
|
|
206
|
+
cursor: pointer;
|
|
207
|
+
font-weight: 600;
|
|
208
|
+
transition: all 0.2s ease;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
.btn-primary {
|
|
212
|
+
background: linear-gradient(135deg, #00d9ff, #00ff88);
|
|
213
|
+
color: #1a1a2e;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
.btn-primary:hover {
|
|
217
|
+
transform: translateY(-2px);
|
|
218
|
+
box-shadow: 0 4px 20px rgba(0, 217, 255, 0.3);
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
.btn-secondary {
|
|
222
|
+
background: rgba(255, 255, 255, 0.1);
|
|
223
|
+
color: #fff;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
.btn-secondary:hover {
|
|
227
|
+
background: rgba(255, 255, 255, 0.2);
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
.insights {
|
|
231
|
+
background: linear-gradient(135deg, rgba(0, 217, 255, 0.1), rgba(0, 255, 136, 0.1));
|
|
232
|
+
border: 1px solid rgba(0, 217, 255, 0.3);
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
.insight-item {
|
|
236
|
+
display: flex;
|
|
237
|
+
gap: 12px;
|
|
238
|
+
padding: 16px 0;
|
|
239
|
+
border-bottom: 1px solid rgba(255, 255, 255, 0.05);
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
.insight-item:last-child {
|
|
243
|
+
border-bottom: none;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
.insight-icon {
|
|
247
|
+
font-size: 24px;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
.insight-content h3 {
|
|
251
|
+
font-size: 14px;
|
|
252
|
+
font-weight: 600;
|
|
253
|
+
margin-bottom: 4px;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
.insight-content p {
|
|
257
|
+
font-size: 13px;
|
|
258
|
+
color: #888;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
.footer {
|
|
262
|
+
text-align: center;
|
|
263
|
+
padding: 40px 0;
|
|
264
|
+
color: #666;
|
|
265
|
+
font-size: 13px;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
@media (max-width: 768px) {
|
|
269
|
+
.grid {
|
|
270
|
+
grid-template-columns: 1fr;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
.metric {
|
|
274
|
+
font-size: 36px;
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
</style>
|
|
278
|
+
</head>
|
|
279
|
+
|
|
280
|
+
<body>
|
|
281
|
+
<div class="container">
|
|
282
|
+
<header>
|
|
283
|
+
<h1>🧠 <span>Auto-Learn</span> Dashboard</h1>
|
|
284
|
+
<span class="status-badge status-active">⚡ Agent Skill Kit</span>
|
|
285
|
+
</header>
|
|
286
|
+
|
|
287
|
+
<!-- Metrics -->
|
|
288
|
+
<div class="grid">
|
|
289
|
+
<div class="card">
|
|
290
|
+
<h2>Total Errors Detected</h2>
|
|
291
|
+
<div class="metric" id="totalErrors">0</div>
|
|
292
|
+
<div class="metric-label">From error_sensor.js</div>
|
|
293
|
+
</div>
|
|
294
|
+
|
|
295
|
+
<div class="card">
|
|
296
|
+
<h2>User Corrections</h2>
|
|
297
|
+
<div class="metric" id="totalCorrections">0</div>
|
|
298
|
+
<div class="metric-label">From user_correction_sensor.js</div>
|
|
299
|
+
</div>
|
|
300
|
+
|
|
301
|
+
<div class="card">
|
|
302
|
+
<h2>Lessons Learned</h2>
|
|
303
|
+
<div class="metric" id="totalLessons">0</div>
|
|
304
|
+
<div class="metric-label">Active prevention rules</div>
|
|
305
|
+
</div>
|
|
306
|
+
|
|
307
|
+
<div class="card">
|
|
308
|
+
<h2>Pattern Match Score</h2>
|
|
309
|
+
<div class="metric" id="patternScore">0%</div>
|
|
310
|
+
<div class="metric-label">Repeat error prevention</div>
|
|
311
|
+
<div class="progress-bar">
|
|
312
|
+
<div class="progress-fill" id="progressFill" style="width: 0%"></div>
|
|
313
|
+
</div>
|
|
314
|
+
</div>
|
|
315
|
+
</div>
|
|
316
|
+
|
|
317
|
+
<!-- Charts -->
|
|
318
|
+
<div class="grid">
|
|
319
|
+
<div class="card">
|
|
320
|
+
<h2>Error Types Distribution</h2>
|
|
321
|
+
<div class="bar-chart" id="errorChart">
|
|
322
|
+
<!-- Bars will be added dynamically -->
|
|
323
|
+
</div>
|
|
324
|
+
</div>
|
|
325
|
+
|
|
326
|
+
<div class="card">
|
|
327
|
+
<h2>Correction Categories</h2>
|
|
328
|
+
<div class="bar-chart" id="correctionChart">
|
|
329
|
+
<!-- Bars will be added dynamically -->
|
|
330
|
+
</div>
|
|
331
|
+
</div>
|
|
332
|
+
</div>
|
|
333
|
+
|
|
334
|
+
<!-- Rules & Insights -->
|
|
335
|
+
<div class="grid">
|
|
336
|
+
<div class="card">
|
|
337
|
+
<h2>Recent High-Frequency Patterns</h2>
|
|
338
|
+
<ul class="list" id="patternList">
|
|
339
|
+
<li>
|
|
340
|
+
<span>No patterns detected yet</span>
|
|
341
|
+
<span class="severity severity-low">PENDING</span>
|
|
342
|
+
</li>
|
|
343
|
+
</ul>
|
|
344
|
+
<div class="actions">
|
|
345
|
+
<button class="btn-secondary" onclick="refreshData()">↻ Refresh</button>
|
|
346
|
+
</div>
|
|
347
|
+
</div>
|
|
348
|
+
|
|
349
|
+
<div class="card insights">
|
|
350
|
+
<h2>💡 AI Insights</h2>
|
|
351
|
+
<div id="insightsList">
|
|
352
|
+
<div class="insight-item">
|
|
353
|
+
<span class="insight-icon">📊</span>
|
|
354
|
+
<div class="insight-content">
|
|
355
|
+
<h3>Run sensors first</h3>
|
|
356
|
+
<p>Execute error_sensor.js and user_correction_sensor.js to collect data</p>
|
|
357
|
+
</div>
|
|
358
|
+
</div>
|
|
359
|
+
<div class="insight-item">
|
|
360
|
+
<span class="insight-icon">🔍</span>
|
|
361
|
+
<div class="insight-content">
|
|
362
|
+
<h3>Analyze patterns</h3>
|
|
363
|
+
<p>Run pattern_analyzer.js to identify high-frequency issues</p>
|
|
364
|
+
</div>
|
|
365
|
+
</div>
|
|
366
|
+
<div class="insight-item">
|
|
367
|
+
<span class="insight-icon">🛡️</span>
|
|
368
|
+
<div class="insight-content">
|
|
369
|
+
<h3>Enable prevention</h3>
|
|
370
|
+
<p>Use pre_execution_check.js before writing code</p>
|
|
371
|
+
</div>
|
|
372
|
+
</div>
|
|
373
|
+
</div>
|
|
374
|
+
</div>
|
|
375
|
+
</div>
|
|
376
|
+
|
|
377
|
+
<!-- Quick Actions -->
|
|
378
|
+
<div class="card">
|
|
379
|
+
<h2>Quick Commands</h2>
|
|
380
|
+
<div
|
|
381
|
+
style="display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; margin-top: 16px;">
|
|
382
|
+
<div
|
|
383
|
+
style="background: rgba(0,0,0,0.2); padding: 16px; border-radius: 8px; font-family: monospace; font-size: 13px;">
|
|
384
|
+
<div style="color: #888; margin-bottom: 8px;">Scan for errors:</div>
|
|
385
|
+
<code style="color: #00d9ff;">node error_sensor.js --scan all</code>
|
|
386
|
+
</div>
|
|
387
|
+
<div
|
|
388
|
+
style="background: rgba(0,0,0,0.2); padding: 16px; border-radius: 8px; font-family: monospace; font-size: 13px;">
|
|
389
|
+
<div style="color: #888; margin-bottom: 8px;">Detect corrections:</div>
|
|
390
|
+
<code style="color: #00d9ff;">node user_correction_sensor.js --scan</code>
|
|
391
|
+
</div>
|
|
392
|
+
<div
|
|
393
|
+
style="background: rgba(0,0,0,0.2); padding: 16px; border-radius: 8px; font-family: monospace; font-size: 13px;">
|
|
394
|
+
<div style="color: #888; margin-bottom: 8px;">Analyze patterns:</div>
|
|
395
|
+
<code style="color: #00d9ff;">node pattern_analyzer.js --analyze</code>
|
|
396
|
+
</div>
|
|
397
|
+
<div
|
|
398
|
+
style="background: rgba(0,0,0,0.2); padding: 16px; border-radius: 8px; font-family: monospace; font-size: 13px;">
|
|
399
|
+
<div style="color: #888; margin-bottom: 8px;">Generate rules:</div>
|
|
400
|
+
<code style="color: #00d9ff;">node pattern_analyzer.js --rules</code>
|
|
401
|
+
</div>
|
|
402
|
+
</div>
|
|
403
|
+
|
|
404
|
+
<!-- Help Guide -->
|
|
405
|
+
<div class="card" id="helpSection">
|
|
406
|
+
<h2>📖 Help & Quick Guide</h2>
|
|
407
|
+
<div
|
|
408
|
+
style="display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; margin-top: 16px;">
|
|
409
|
+
<div class="insight-item" style="border: none; padding: 0;">
|
|
410
|
+
<span class="insight-icon">🧠</span>
|
|
411
|
+
<div class="insight-content">
|
|
412
|
+
<h3>What is Auto-Learn?</h3>
|
|
413
|
+
<p>An AI system that learns from your coding mistakes and prevents them in the future.</p>
|
|
414
|
+
</div>
|
|
415
|
+
</div>
|
|
416
|
+
<div class="insight-item" style="border: none; padding: 0;">
|
|
417
|
+
<span class="insight-icon">🔄</span>
|
|
418
|
+
<div class="insight-content">
|
|
419
|
+
<h3>How it works</h3>
|
|
420
|
+
<p>Error → Lesson → Pattern → Rule → Prevention</p>
|
|
421
|
+
</div>
|
|
422
|
+
</div>
|
|
423
|
+
<div class="insight-item" style="border: none; padding: 0;">
|
|
424
|
+
<span class="insight-icon">⚡</span>
|
|
425
|
+
<div class="insight-content">
|
|
426
|
+
<h3>CLI Commands</h3>
|
|
427
|
+
<p><code style="color: #00d9ff;">agent auto-learn --scan</code></p>
|
|
428
|
+
</div>
|
|
429
|
+
</div>
|
|
430
|
+
<div class="insight-item" style="border: none; padding: 0;">
|
|
431
|
+
<span class="insight-icon">⚙️</span>
|
|
432
|
+
<div class="insight-content">
|
|
433
|
+
<h3>Settings</h3>
|
|
434
|
+
<p><code style="color: #00d9ff;">agent</code> → Settings → Auto-Learning</p>
|
|
435
|
+
</div>
|
|
436
|
+
</div>
|
|
437
|
+
</div>
|
|
438
|
+
<div style="margin-top: 20px; padding: 16px; background: rgba(0,217,255,0.1); border-radius: 8px;">
|
|
439
|
+
<h3 style="margin-bottom: 12px; font-size: 14px;">🚀 Getting Started</h3>
|
|
440
|
+
<ol style="margin-left: 20px; line-height: 1.8; color: #aaa;">
|
|
441
|
+
<li>Run <code style="color: #00d9ff;">agent auto-learn --scan</code> to detect errors</li>
|
|
442
|
+
<li>Run <code style="color: #00d9ff;">agent auto-learn --analyze</code> to find patterns</li>
|
|
443
|
+
<li>Toggle <strong>Auto-Learning: ON</strong> in Settings</li>
|
|
444
|
+
<li>The system will now prevent repeat errors!</li>
|
|
445
|
+
</ol>
|
|
446
|
+
</div>
|
|
447
|
+
</div>
|
|
448
|
+
|
|
449
|
+
<footer>
|
|
450
|
+
Auto-Learn Dashboard • ⚡ Agent Skill Kit • Built with ❤️
|
|
451
|
+
</footer>
|
|
452
|
+
</div>
|
|
453
|
+
|
|
454
|
+
<script>
|
|
455
|
+
// Sample data - In production, this would load from JSON files
|
|
456
|
+
const sampleData = {
|
|
457
|
+
errors: {
|
|
458
|
+
total: 24,
|
|
459
|
+
byType: {
|
|
460
|
+
'test': 8,
|
|
461
|
+
'build': 6,
|
|
462
|
+
'lint': 7,
|
|
463
|
+
'pattern': 3
|
|
464
|
+
}
|
|
465
|
+
},
|
|
466
|
+
corrections: {
|
|
467
|
+
total: 15,
|
|
468
|
+
byCategory: {
|
|
469
|
+
'imports': 5,
|
|
470
|
+
'types': 4,
|
|
471
|
+
'null-safety': 3,
|
|
472
|
+
'async': 2,
|
|
473
|
+
'other': 1
|
|
474
|
+
}
|
|
475
|
+
},
|
|
476
|
+
lessons: 7,
|
|
477
|
+
patterns: [
|
|
478
|
+
{ name: 'import_path_fix', count: 5, severity: 'HIGH' },
|
|
479
|
+
{ name: 'type_annotation_fix', count: 4, severity: 'HIGH' },
|
|
480
|
+
{ name: 'null_check_added', count: 3, severity: 'MEDIUM' }
|
|
481
|
+
]
|
|
482
|
+
};
|
|
483
|
+
|
|
484
|
+
function updateMetrics(data) {
|
|
485
|
+
document.getElementById('totalErrors').textContent = data.errors.total;
|
|
486
|
+
document.getElementById('totalCorrections').textContent = data.corrections.total;
|
|
487
|
+
document.getElementById('totalLessons').textContent = data.lessons;
|
|
488
|
+
|
|
489
|
+
const score = Math.min(95, data.lessons * 10 + 25);
|
|
490
|
+
document.getElementById('patternScore').textContent = score + '%';
|
|
491
|
+
document.getElementById('progressFill').style.width = score + '%';
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
function renderBarChart(containerId, data, color = '#00d9ff') {
|
|
495
|
+
const container = document.getElementById(containerId);
|
|
496
|
+
container.innerHTML = '';
|
|
497
|
+
|
|
498
|
+
const maxValue = Math.max(...Object.values(data));
|
|
499
|
+
|
|
500
|
+
for (const [label, value] of Object.entries(data)) {
|
|
501
|
+
const height = (value / maxValue) * 130 + 10;
|
|
502
|
+
const bar = document.createElement('div');
|
|
503
|
+
bar.className = 'bar';
|
|
504
|
+
bar.style.height = height + 'px';
|
|
505
|
+
bar.innerHTML = `<span class="bar-label">${label}</span>`;
|
|
506
|
+
bar.title = `${label}: ${value}`;
|
|
507
|
+
container.appendChild(bar);
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
function renderPatterns(patterns) {
|
|
512
|
+
const container = document.getElementById('patternList');
|
|
513
|
+
container.innerHTML = '';
|
|
514
|
+
|
|
515
|
+
for (const pattern of patterns) {
|
|
516
|
+
const li = document.createElement('li');
|
|
517
|
+
li.innerHTML = `
|
|
518
|
+
<span>${pattern.name} (${pattern.count}x)</span>
|
|
519
|
+
<span class="severity severity-${pattern.severity.toLowerCase()}">${pattern.severity}</span>
|
|
520
|
+
`;
|
|
521
|
+
container.appendChild(li);
|
|
522
|
+
}
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
function refreshData() {
|
|
526
|
+
// Simulate loading
|
|
527
|
+
updateMetrics(sampleData);
|
|
528
|
+
renderBarChart('errorChart', sampleData.errors.byType);
|
|
529
|
+
renderBarChart('correctionChart', sampleData.corrections.byCategory);
|
|
530
|
+
renderPatterns(sampleData.patterns);
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
// Initialize
|
|
534
|
+
refreshData();
|
|
535
|
+
</script>
|
|
536
|
+
</body>
|
|
537
|
+
|
|
538
|
+
</html>
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* 2. Constitution Checks (Governance)
|
|
8
8
|
* 3. Real-time Analysis
|
|
9
9
|
*
|
|
10
|
-
* Usage:
|
|
10
|
+
* Usage: agent audit [directory]
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
13
|
import fs from "fs";
|
|
@@ -143,7 +143,7 @@ if (args.includes("--help")) {
|
|
|
143
143
|
⚖️ Smart Audit - Compliance Checker
|
|
144
144
|
|
|
145
145
|
Usage:
|
|
146
|
-
|
|
146
|
+
agent audit [directory]
|
|
147
147
|
|
|
148
148
|
Options:
|
|
149
149
|
--help Show this help
|
|
@@ -8,10 +8,10 @@
|
|
|
8
8
|
* 3. TypeScript errors (runs tsc and parses)
|
|
9
9
|
*
|
|
10
10
|
* Usage:
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
11
|
+
* agent auto-learn # Run all
|
|
12
|
+
* agent auto-learn --eslint # ESLint only
|
|
13
|
+
* agent auto-learn --test # Test failures only
|
|
14
|
+
* agent auto-learn --typescript # TypeScript only
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
17
|
import fs from "fs";
|
|
@@ -297,10 +297,10 @@ if (args.includes("--help")) {
|
|
|
297
297
|
🧠 Smart Auto-Learn - True Self-Learning Engine
|
|
298
298
|
|
|
299
299
|
Usage:
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
300
|
+
agent auto-learn Run all analyzers
|
|
301
|
+
agent auto-learn --eslint ESLint only
|
|
302
|
+
agent auto-learn --typescript TypeScript only
|
|
303
|
+
agent auto-learn --test Test failures only
|
|
304
304
|
|
|
305
305
|
The engine automatically:
|
|
306
306
|
1. Runs ESLint and learns from violations
|
package/lib/agent-cli/lib/fix.js
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* - Remove violations (aggressive mode)
|
|
10
10
|
* - Replace patterns (custom fix rules)
|
|
11
11
|
*
|
|
12
|
-
* Usage:
|
|
12
|
+
* Usage: agent fix <file|directory> [--mode safe|aggressive]
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
15
|
import fs from "fs";
|
|
@@ -249,7 +249,7 @@ async function main() {
|
|
|
249
249
|
🔧 Smart Fix v${VERSION} - Auto-fix Violations
|
|
250
250
|
|
|
251
251
|
Usage:
|
|
252
|
-
|
|
252
|
+
agent fix <file|directory> [options]
|
|
253
253
|
|
|
254
254
|
Options:
|
|
255
255
|
--mode safe Comment out violations (default)
|
|
@@ -259,9 +259,9 @@ Options:
|
|
|
259
259
|
--help Show this help
|
|
260
260
|
|
|
261
261
|
Examples:
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
262
|
+
agent fix src/
|
|
263
|
+
agent fix app.js --mode aggressive
|
|
264
|
+
agent fix src/ --eslint
|
|
265
265
|
`);
|
|
266
266
|
process.exit(0);
|
|
267
267
|
}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*
|
|
5
5
|
* Installs pre-commit hook that runs recall on staged files.
|
|
6
6
|
*
|
|
7
|
-
* Usage:
|
|
7
|
+
* Usage: agent install-hooks
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
import fs from "fs";
|
|
@@ -26,7 +26,7 @@ if [ -z "$STAGED_FILES" ]; then
|
|
|
26
26
|
fi
|
|
27
27
|
|
|
28
28
|
# Run recall (Clack handles all output)
|
|
29
|
-
npx
|
|
29
|
+
npx agent recall . 2>/dev/null
|
|
30
30
|
exit $?
|
|
31
31
|
`;
|
|
32
32
|
|
|
@@ -136,8 +136,8 @@ if (args.includes("--help")) {
|
|
|
136
136
|
🔧 Smart Agent Hooks Installer
|
|
137
137
|
|
|
138
138
|
Usage:
|
|
139
|
-
|
|
140
|
-
|
|
139
|
+
agent install-hooks Install git hooks
|
|
140
|
+
agent install-hooks --remove Remove installed hooks
|
|
141
141
|
|
|
142
142
|
The pre-commit hook checks staged files against learned
|
|
143
143
|
patterns before each commit.
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* Parses ESLint JSON output and creates lessons automatically.
|
|
6
6
|
*
|
|
7
7
|
* Usage:
|
|
8
|
-
* npx eslint . --format json |
|
|
9
|
-
* npx eslint . --format json > output.json &&
|
|
8
|
+
* npx eslint . --format json | agent lint-learn
|
|
9
|
+
* npx eslint . --format json > output.json && agent lint-learn output.json
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
12
|
import fs from "fs";
|
|
@@ -86,8 +86,8 @@ async function main() {
|
|
|
86
86
|
🔧 Lint Learn - Auto-Learn from ESLint
|
|
87
87
|
|
|
88
88
|
Usage:
|
|
89
|
-
npx eslint . --format json |
|
|
90
|
-
|
|
89
|
+
npx eslint . --format json | agent lint-learn
|
|
90
|
+
agent lint-learn eslint-output.json
|
|
91
91
|
|
|
92
92
|
Creates lessons from ESLint violations automatically.
|
|
93
93
|
`);
|