aios-core 3.6.0 → 3.8.0
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/.aios-core/core/session/context-detector.js +3 -0
- package/.aios-core/core/session/context-loader.js +154 -0
- package/.aios-core/data/learned-patterns.yaml +3 -0
- package/.aios-core/data/workflow-patterns.yaml +347 -3
- package/.aios-core/development/agents/dev.md +13 -0
- package/.aios-core/development/agents/squad-creator.md +30 -0
- package/.aios-core/development/scripts/squad/squad-analyzer.js +638 -0
- package/.aios-core/development/scripts/squad/squad-extender.js +871 -0
- package/.aios-core/development/scripts/squad/squad-generator.js +107 -19
- package/.aios-core/development/scripts/squad/squad-migrator.js +3 -5
- package/.aios-core/development/scripts/squad/squad-validator.js +98 -0
- package/.aios-core/development/tasks/create-service.md +391 -0
- package/.aios-core/development/tasks/next.md +294 -0
- package/.aios-core/development/tasks/patterns.md +334 -0
- package/.aios-core/development/tasks/squad-creator-analyze.md +315 -0
- package/.aios-core/development/tasks/squad-creator-create.md +26 -3
- package/.aios-core/development/tasks/squad-creator-extend.md +411 -0
- package/.aios-core/development/tasks/squad-creator-validate.md +9 -1
- package/.aios-core/development/tasks/waves.md +205 -0
- package/.aios-core/development/templates/service-template/README.md.hbs +158 -0
- package/.aios-core/development/templates/service-template/__tests__/index.test.ts.hbs +237 -0
- package/.aios-core/development/templates/service-template/client.ts.hbs +403 -0
- package/.aios-core/development/templates/service-template/errors.ts.hbs +182 -0
- package/.aios-core/development/templates/service-template/index.ts.hbs +120 -0
- package/.aios-core/development/templates/service-template/jest.config.js +89 -0
- package/.aios-core/development/templates/service-template/package.json.hbs +87 -0
- package/.aios-core/development/templates/service-template/tsconfig.json +45 -0
- package/.aios-core/development/templates/service-template/types.ts.hbs +145 -0
- package/.aios-core/development/templates/squad/agent-template.md +69 -0
- package/.aios-core/development/templates/squad/checklist-template.md +82 -0
- package/.aios-core/development/templates/squad/data-template.yaml +105 -0
- package/.aios-core/development/templates/squad/script-template.js +179 -0
- package/.aios-core/development/templates/squad/task-template.md +125 -0
- package/.aios-core/development/templates/squad/template-template.md +97 -0
- package/.aios-core/development/templates/squad/tool-template.js +103 -0
- package/.aios-core/development/templates/squad/workflow-template.yaml +108 -0
- package/.aios-core/infrastructure/scripts/ide-sync/agent-parser.js +45 -1
- package/.aios-core/infrastructure/scripts/ide-sync/transformers/antigravity.js +6 -6
- package/.aios-core/infrastructure/scripts/ide-sync/transformers/cursor.js +5 -4
- package/.aios-core/infrastructure/scripts/ide-sync/transformers/trae.js +3 -3
- package/.aios-core/infrastructure/scripts/ide-sync/transformers/windsurf.js +3 -3
- package/.aios-core/install-manifest.yaml +139 -35
- package/.aios-core/quality/metrics-collector.js +27 -0
- package/.aios-core/scripts/session-context-loader.js +13 -254
- package/.aios-core/utils/aios-validator.js +25 -0
- package/.aios-core/workflow-intelligence/__tests__/confidence-scorer.test.js +334 -0
- package/.aios-core/workflow-intelligence/__tests__/integration.test.js +337 -0
- package/.aios-core/workflow-intelligence/__tests__/suggestion-engine.test.js +431 -0
- package/.aios-core/workflow-intelligence/__tests__/wave-analyzer.test.js +458 -0
- package/.aios-core/workflow-intelligence/__tests__/workflow-registry.test.js +302 -0
- package/.aios-core/workflow-intelligence/engine/confidence-scorer.js +305 -0
- package/.aios-core/workflow-intelligence/engine/output-formatter.js +285 -0
- package/.aios-core/workflow-intelligence/engine/suggestion-engine.js +603 -0
- package/.aios-core/workflow-intelligence/engine/wave-analyzer.js +676 -0
- package/.aios-core/workflow-intelligence/index.js +327 -0
- package/.aios-core/workflow-intelligence/learning/capture-hook.js +147 -0
- package/.aios-core/workflow-intelligence/learning/index.js +230 -0
- package/.aios-core/workflow-intelligence/learning/pattern-capture.js +340 -0
- package/.aios-core/workflow-intelligence/learning/pattern-store.js +498 -0
- package/.aios-core/workflow-intelligence/learning/pattern-validator.js +309 -0
- package/.aios-core/workflow-intelligence/registry/workflow-registry.js +358 -0
- package/package.json +1 -1
|
@@ -0,0 +1,315 @@
|
|
|
1
|
+
---
|
|
2
|
+
task: analyzeSquad()
|
|
3
|
+
responsavel: "@squad-creator"
|
|
4
|
+
responsavel_type: Agent
|
|
5
|
+
atomic_layer: Task
|
|
6
|
+
elicit: true
|
|
7
|
+
|
|
8
|
+
Entrada:
|
|
9
|
+
- campo: squad_name
|
|
10
|
+
tipo: string
|
|
11
|
+
origem: User Input
|
|
12
|
+
obrigatorio: true
|
|
13
|
+
validacao: Squad must exist in ./squads/ directory
|
|
14
|
+
|
|
15
|
+
- campo: output_format
|
|
16
|
+
tipo: string
|
|
17
|
+
origem: User Input
|
|
18
|
+
obrigatorio: false
|
|
19
|
+
validacao: "console | markdown | json (default: console)"
|
|
20
|
+
|
|
21
|
+
- campo: verbose
|
|
22
|
+
tipo: boolean
|
|
23
|
+
origem: User Input
|
|
24
|
+
obrigatorio: false
|
|
25
|
+
validacao: "Include file details (default: false)"
|
|
26
|
+
|
|
27
|
+
- campo: suggestions
|
|
28
|
+
tipo: boolean
|
|
29
|
+
origem: User Input
|
|
30
|
+
obrigatorio: false
|
|
31
|
+
validacao: "Include improvement suggestions (default: true)"
|
|
32
|
+
|
|
33
|
+
Saida:
|
|
34
|
+
- campo: analysis_report
|
|
35
|
+
tipo: object
|
|
36
|
+
destino: Console or file
|
|
37
|
+
persistido: false
|
|
38
|
+
|
|
39
|
+
- campo: component_inventory
|
|
40
|
+
tipo: object
|
|
41
|
+
destino: Return value
|
|
42
|
+
persistido: false
|
|
43
|
+
|
|
44
|
+
- campo: coverage_metrics
|
|
45
|
+
tipo: object
|
|
46
|
+
destino: Return value
|
|
47
|
+
persistido: false
|
|
48
|
+
|
|
49
|
+
- campo: suggestions
|
|
50
|
+
tipo: array
|
|
51
|
+
destino: Return value
|
|
52
|
+
persistido: false
|
|
53
|
+
|
|
54
|
+
Checklist:
|
|
55
|
+
- "[ ] Validate squad exists"
|
|
56
|
+
- "[ ] Load squad.yaml manifest"
|
|
57
|
+
- "[ ] Inventory components by type"
|
|
58
|
+
- "[ ] Calculate coverage metrics"
|
|
59
|
+
- "[ ] Generate improvement suggestions"
|
|
60
|
+
- "[ ] Format and display report"
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
# Analyze Squad Task
|
|
64
|
+
|
|
65
|
+
## Purpose
|
|
66
|
+
|
|
67
|
+
Analyze an existing squad's structure, components, and coverage to provide insights and improvement suggestions. This task enables developers to understand what a squad contains and identify opportunities for enhancement.
|
|
68
|
+
|
|
69
|
+
## Story Reference
|
|
70
|
+
|
|
71
|
+
- **Story:** SQS-11 - Squad Analyze & Extend
|
|
72
|
+
- **Epic:** SQS - Squad System Enhancement
|
|
73
|
+
|
|
74
|
+
## Pre-Conditions
|
|
75
|
+
|
|
76
|
+
```yaml
|
|
77
|
+
pre-conditions:
|
|
78
|
+
- [ ] Squad exists in ./squads/ directory
|
|
79
|
+
tipo: pre-condition
|
|
80
|
+
blocker: true
|
|
81
|
+
validacao: |
|
|
82
|
+
Check if squad directory exists with valid manifest
|
|
83
|
+
error_message: "Squad not found. Use *list-squads to see available squads."
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
## Elicitation Flow
|
|
87
|
+
|
|
88
|
+
```
|
|
89
|
+
@squad-creator
|
|
90
|
+
|
|
91
|
+
*analyze-squad
|
|
92
|
+
|
|
93
|
+
? Squad name: _________________
|
|
94
|
+
(Tab to autocomplete from available squads)
|
|
95
|
+
|
|
96
|
+
? Output format:
|
|
97
|
+
> 1. console (default) - Display in terminal
|
|
98
|
+
2. markdown - Save to file
|
|
99
|
+
3. json - Machine readable
|
|
100
|
+
|
|
101
|
+
? Include suggestions? (Y/n): Y
|
|
102
|
+
|
|
103
|
+
Analyzing squad...
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
## Execution Steps
|
|
107
|
+
|
|
108
|
+
### Step 1: Validate Squad Exists
|
|
109
|
+
|
|
110
|
+
```javascript
|
|
111
|
+
const { SquadLoader } = require('../scripts/squad/squad-loader');
|
|
112
|
+
const loader = new SquadLoader();
|
|
113
|
+
|
|
114
|
+
const squadPath = path.join('./squads', squadName);
|
|
115
|
+
const exists = await loader.squadExists(squadName);
|
|
116
|
+
|
|
117
|
+
if (!exists) {
|
|
118
|
+
throw new Error(`Squad "${squadName}" not found. Use *list-squads to see available squads.`);
|
|
119
|
+
}
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
### Step 2: Load Squad Manifest
|
|
123
|
+
|
|
124
|
+
```javascript
|
|
125
|
+
const manifest = await loader.loadManifest(squadName);
|
|
126
|
+
|
|
127
|
+
// Extract overview
|
|
128
|
+
const overview = {
|
|
129
|
+
name: manifest.name,
|
|
130
|
+
version: manifest.version,
|
|
131
|
+
author: manifest.author,
|
|
132
|
+
license: manifest.license,
|
|
133
|
+
aiosMinVersion: manifest.aios?.minVersion || 'N/A',
|
|
134
|
+
description: manifest.description
|
|
135
|
+
};
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
### Step 3: Inventory Components
|
|
139
|
+
|
|
140
|
+
```javascript
|
|
141
|
+
const { SquadAnalyzer } = require('../scripts/squad/squad-analyzer');
|
|
142
|
+
const analyzer = new SquadAnalyzer();
|
|
143
|
+
|
|
144
|
+
const inventory = await analyzer.inventoryComponents(squadPath);
|
|
145
|
+
|
|
146
|
+
// Expected structure:
|
|
147
|
+
// {
|
|
148
|
+
// agents: ['lead-agent.md', 'helper-agent.md'],
|
|
149
|
+
// tasks: ['lead-agent-task1.md', 'lead-agent-task2.md'],
|
|
150
|
+
// workflows: [],
|
|
151
|
+
// checklists: [],
|
|
152
|
+
// templates: ['report-template.md'],
|
|
153
|
+
// tools: [],
|
|
154
|
+
// scripts: [],
|
|
155
|
+
// data: []
|
|
156
|
+
// }
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
### Step 4: Calculate Coverage Metrics
|
|
160
|
+
|
|
161
|
+
```javascript
|
|
162
|
+
const coverage = analyzer.calculateCoverage(inventory, manifest);
|
|
163
|
+
|
|
164
|
+
// Expected structure:
|
|
165
|
+
// {
|
|
166
|
+
// agents: { total: 2, withTasks: 2, percentage: 100 },
|
|
167
|
+
// tasks: { total: 3, percentage: 75 },
|
|
168
|
+
// config: { hasReadme: true, hasTechStack: false, percentage: 60 },
|
|
169
|
+
// directories: { populated: 3, empty: 5, percentage: 37.5 }
|
|
170
|
+
// }
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
### Step 5: Generate Suggestions
|
|
174
|
+
|
|
175
|
+
```javascript
|
|
176
|
+
const suggestions = analyzer.generateSuggestions(inventory, coverage);
|
|
177
|
+
|
|
178
|
+
// Expected structure:
|
|
179
|
+
// [
|
|
180
|
+
// { priority: 'high', message: 'Add tasks for helper-agent (currently has only 1)' },
|
|
181
|
+
// { priority: 'medium', message: 'Create workflows for common sequences' },
|
|
182
|
+
// { priority: 'low', message: 'Add checklists for validation' }
|
|
183
|
+
// ]
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
### Step 6: Format and Display Report
|
|
187
|
+
|
|
188
|
+
```javascript
|
|
189
|
+
const report = analyzer.formatReport({
|
|
190
|
+
overview,
|
|
191
|
+
inventory,
|
|
192
|
+
coverage,
|
|
193
|
+
suggestions
|
|
194
|
+
}, outputFormat);
|
|
195
|
+
|
|
196
|
+
if (outputFormat === 'console') {
|
|
197
|
+
console.log(report);
|
|
198
|
+
} else if (outputFormat === 'markdown') {
|
|
199
|
+
const outputPath = path.join(squadPath, 'ANALYSIS.md');
|
|
200
|
+
await fs.writeFile(outputPath, report);
|
|
201
|
+
console.log(`Analysis saved to: ${outputPath}`);
|
|
202
|
+
} else if (outputFormat === 'json') {
|
|
203
|
+
console.log(JSON.stringify({ overview, inventory, coverage, suggestions }, null, 2));
|
|
204
|
+
}
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
## Output Format (Console)
|
|
208
|
+
|
|
209
|
+
```
|
|
210
|
+
=== Squad Analysis: {squad-name} ===
|
|
211
|
+
|
|
212
|
+
Overview
|
|
213
|
+
Name: {name}
|
|
214
|
+
Version: {version}
|
|
215
|
+
Author: {author}
|
|
216
|
+
License: {license}
|
|
217
|
+
AIOS Min Version: {aiosMinVersion}
|
|
218
|
+
|
|
219
|
+
Components
|
|
220
|
+
Agents ({count})
|
|
221
|
+
{agent-file-1}
|
|
222
|
+
{agent-file-2}
|
|
223
|
+
Tasks ({count})
|
|
224
|
+
{task-file-1}
|
|
225
|
+
{task-file-2}
|
|
226
|
+
Workflows ({count}) {empty-indicator}
|
|
227
|
+
Checklists ({count}) {empty-indicator}
|
|
228
|
+
Templates ({count})
|
|
229
|
+
Tools ({count}) {empty-indicator}
|
|
230
|
+
Scripts ({count}) {empty-indicator}
|
|
231
|
+
Data ({count}) {empty-indicator}
|
|
232
|
+
|
|
233
|
+
Coverage
|
|
234
|
+
Agents: {bar} {percentage}% ({details})
|
|
235
|
+
Tasks: {bar} {percentage}% ({details})
|
|
236
|
+
Config: {bar} {percentage}% ({details})
|
|
237
|
+
Docs: {bar} {percentage}% ({details})
|
|
238
|
+
|
|
239
|
+
Suggestions
|
|
240
|
+
1. {suggestion-1}
|
|
241
|
+
2. {suggestion-2}
|
|
242
|
+
3. {suggestion-3}
|
|
243
|
+
|
|
244
|
+
Next: *extend-squad {squad-name}
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
## Error Handling
|
|
248
|
+
|
|
249
|
+
### Error 1: Squad Not Found
|
|
250
|
+
|
|
251
|
+
```yaml
|
|
252
|
+
error: SQUAD_NOT_FOUND
|
|
253
|
+
cause: Squad directory does not exist
|
|
254
|
+
resolution: Use *list-squads to see available squads
|
|
255
|
+
recovery: Suggest *create-squad to create new squad
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
### Error 2: Invalid Manifest
|
|
259
|
+
|
|
260
|
+
```yaml
|
|
261
|
+
error: MANIFEST_PARSE_ERROR
|
|
262
|
+
cause: squad.yaml contains invalid YAML
|
|
263
|
+
resolution: Fix YAML syntax errors
|
|
264
|
+
recovery: Run *validate-squad for detailed validation
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
### Error 3: Permission Denied
|
|
268
|
+
|
|
269
|
+
```yaml
|
|
270
|
+
error: PERMISSION_DENIED
|
|
271
|
+
cause: Cannot read squad directory or files
|
|
272
|
+
resolution: Check file permissions
|
|
273
|
+
recovery: chmod 644 for files, 755 for directories
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
## Post-Conditions
|
|
277
|
+
|
|
278
|
+
```yaml
|
|
279
|
+
post-conditions:
|
|
280
|
+
- [ ] Analysis report generated successfully
|
|
281
|
+
tipo: post-condition
|
|
282
|
+
blocker: false
|
|
283
|
+
validacao: |
|
|
284
|
+
Verify all components were inventoried
|
|
285
|
+
error_message: "Analysis incomplete - some components may not be listed"
|
|
286
|
+
```
|
|
287
|
+
|
|
288
|
+
## Dependencies
|
|
289
|
+
|
|
290
|
+
- **Scripts:**
|
|
291
|
+
- `.aios-core/development/scripts/squad/squad-loader.js`
|
|
292
|
+
- `.aios-core/development/scripts/squad/squad-analyzer.js`
|
|
293
|
+
|
|
294
|
+
- **Tools:**
|
|
295
|
+
- js-yaml (YAML parsing)
|
|
296
|
+
- fs (file system operations)
|
|
297
|
+
|
|
298
|
+
## Metadata
|
|
299
|
+
|
|
300
|
+
```yaml
|
|
301
|
+
story: SQS-11
|
|
302
|
+
version: 1.0.0
|
|
303
|
+
created: 2025-12-26
|
|
304
|
+
updated: 2025-12-26
|
|
305
|
+
author: Dex (dev)
|
|
306
|
+
tags:
|
|
307
|
+
- squad
|
|
308
|
+
- analysis
|
|
309
|
+
- inventory
|
|
310
|
+
- coverage
|
|
311
|
+
```
|
|
312
|
+
|
|
313
|
+
---
|
|
314
|
+
|
|
315
|
+
*Task definition for *analyze-squad command*
|
|
@@ -92,6 +92,28 @@ Cria um novo squad seguindo a arquitetura task-first do AIOS.
|
|
|
92
92
|
|
|
93
93
|
## Estrutura Gerada
|
|
94
94
|
|
|
95
|
+
### Com Project Configs (SQS-10)
|
|
96
|
+
|
|
97
|
+
Quando o projeto tem `docs/framework/` com arquivos de config (CODING-STANDARDS.md, etc.),
|
|
98
|
+
o squad referencia esses arquivos ao invés de criar cópias locais:
|
|
99
|
+
|
|
100
|
+
```
|
|
101
|
+
./squads/meu-dominio-squad/
|
|
102
|
+
├── squad.yaml # Manifest (referencia docs/framework/)
|
|
103
|
+
├── README.md # Documentacao
|
|
104
|
+
├── config/
|
|
105
|
+
│ └── .gitkeep # Configs em docs/framework/
|
|
106
|
+
├── agents/
|
|
107
|
+
│ └── example-agent.md # Agente de exemplo
|
|
108
|
+
├── tasks/
|
|
109
|
+
│ └── example-agent-task.md # Task de exemplo
|
|
110
|
+
...
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
### Sem Project Configs (Fallback)
|
|
114
|
+
|
|
115
|
+
Quando o projeto NÃO tem `docs/framework/`, cria arquivos locais:
|
|
116
|
+
|
|
95
117
|
```
|
|
96
118
|
./squads/meu-dominio-squad/
|
|
97
119
|
├── squad.yaml # Manifest
|
|
@@ -145,9 +167,10 @@ components:
|
|
|
145
167
|
|
|
146
168
|
config:
|
|
147
169
|
extends: extend
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
170
|
+
# SQS-10: References project-level files when docs/framework/ exists
|
|
171
|
+
coding-standards: ../../docs/framework/CODING-STANDARDS.md # or config/coding-standards.md
|
|
172
|
+
tech-stack: ../../docs/framework/TECH-STACK.md # or config/tech-stack.md
|
|
173
|
+
source-tree: ../../docs/framework/SOURCE-TREE.md # or config/source-tree.md
|
|
151
174
|
|
|
152
175
|
dependencies:
|
|
153
176
|
node: []
|