aios-core 3.7.0 → 3.9.1
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 +6 -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/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/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/test-generator.js +8 -8
- package/.aios-core/infrastructure/scripts/test-quality-assessment.js +5 -5
- package/.aios-core/infrastructure/scripts/test-utilities.js +3 -3
- package/.aios-core/install-manifest.yaml +97 -33
- package/.aios-core/quality/metrics-collector.js +27 -0
- package/.aios-core/scripts/session-context-loader.js +13 -254
- package/.aios-core/scripts/test-template-system.js +6 -6
- 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
- package/src/installer/brownfield-upgrader.js +1 -1
- package/bin/aios-init.backup-v1.1.4.js +0 -352
|
@@ -0,0 +1,411 @@
|
|
|
1
|
+
---
|
|
2
|
+
task: extendSquad()
|
|
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: component_type
|
|
16
|
+
tipo: string
|
|
17
|
+
origem: User Input
|
|
18
|
+
obrigatorio: true
|
|
19
|
+
validacao: "agent | task | workflow | checklist | template | tool | script | data"
|
|
20
|
+
|
|
21
|
+
- campo: component_name
|
|
22
|
+
tipo: string
|
|
23
|
+
origem: User Input
|
|
24
|
+
obrigatorio: true
|
|
25
|
+
validacao: "kebab-case, no special characters"
|
|
26
|
+
|
|
27
|
+
- campo: agent_id
|
|
28
|
+
tipo: string
|
|
29
|
+
origem: User Input
|
|
30
|
+
obrigatorio: false
|
|
31
|
+
validacao: "Required for tasks - must exist in squad's agents/"
|
|
32
|
+
|
|
33
|
+
- campo: story_id
|
|
34
|
+
tipo: string
|
|
35
|
+
origem: User Input
|
|
36
|
+
obrigatorio: false
|
|
37
|
+
validacao: "Format: SQS-XX (optional traceability)"
|
|
38
|
+
|
|
39
|
+
Saida:
|
|
40
|
+
- campo: created_file
|
|
41
|
+
tipo: string
|
|
42
|
+
destino: Squad directory
|
|
43
|
+
persistido: true
|
|
44
|
+
|
|
45
|
+
- campo: updated_manifest
|
|
46
|
+
tipo: boolean
|
|
47
|
+
destino: squad.yaml
|
|
48
|
+
persistido: true
|
|
49
|
+
|
|
50
|
+
- campo: validation_result
|
|
51
|
+
tipo: object
|
|
52
|
+
destino: Console
|
|
53
|
+
persistido: false
|
|
54
|
+
|
|
55
|
+
Checklist:
|
|
56
|
+
- "[ ] Validate squad exists"
|
|
57
|
+
- "[ ] Collect component type"
|
|
58
|
+
- "[ ] Collect component name and metadata"
|
|
59
|
+
- "[ ] Create file from template"
|
|
60
|
+
- "[ ] Update squad.yaml manifest"
|
|
61
|
+
- "[ ] Run validation"
|
|
62
|
+
- "[ ] Display result and next steps"
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
# Extend Squad Task
|
|
66
|
+
|
|
67
|
+
## Purpose
|
|
68
|
+
|
|
69
|
+
Add new components to an existing squad with automatic manifest updates and validation. This task enables incremental squad improvement without manual file manipulation.
|
|
70
|
+
|
|
71
|
+
## Story Reference
|
|
72
|
+
|
|
73
|
+
- **Story:** SQS-11 - Squad Analyze & Extend
|
|
74
|
+
- **Epic:** SQS - Squad System Enhancement
|
|
75
|
+
|
|
76
|
+
## Pre-Conditions
|
|
77
|
+
|
|
78
|
+
```yaml
|
|
79
|
+
pre-conditions:
|
|
80
|
+
- [ ] Squad exists in ./squads/ directory
|
|
81
|
+
tipo: pre-condition
|
|
82
|
+
blocker: true
|
|
83
|
+
validacao: |
|
|
84
|
+
Check if squad directory exists with valid manifest
|
|
85
|
+
error_message: "Squad not found. Use *list-squads to see available squads."
|
|
86
|
+
|
|
87
|
+
- [ ] Component name is valid kebab-case
|
|
88
|
+
tipo: pre-condition
|
|
89
|
+
blocker: true
|
|
90
|
+
validacao: |
|
|
91
|
+
Must match /^[a-z][a-z0-9-]*[a-z0-9]$/
|
|
92
|
+
error_message: "Invalid component name. Use kebab-case (e.g., my-component)"
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
## Elicitation Flow (Interactive Mode)
|
|
96
|
+
|
|
97
|
+
```
|
|
98
|
+
@squad-creator
|
|
99
|
+
|
|
100
|
+
*extend-squad my-squad
|
|
101
|
+
|
|
102
|
+
? What would you like to add?
|
|
103
|
+
1. Agent - New agent persona
|
|
104
|
+
2. Task - New task for an agent
|
|
105
|
+
3. Workflow - Multi-step workflow
|
|
106
|
+
4. Checklist - Validation checklist
|
|
107
|
+
5. Template - Document template
|
|
108
|
+
6. Tool - Custom tool (JavaScript)
|
|
109
|
+
7. Script - Automation script
|
|
110
|
+
8. Data - Static data file (YAML)
|
|
111
|
+
|
|
112
|
+
> 2
|
|
113
|
+
|
|
114
|
+
? Task name: process-data
|
|
115
|
+
? Which agent owns this task?
|
|
116
|
+
1. lead-agent
|
|
117
|
+
2. helper-agent
|
|
118
|
+
> 1
|
|
119
|
+
? Task description (optional): Process incoming data and generate output
|
|
120
|
+
? Link to story? (leave blank to skip): SQS-11
|
|
121
|
+
|
|
122
|
+
Creating task...
|
|
123
|
+
Created: tasks/lead-agent-process-data.md
|
|
124
|
+
Updated: squad.yaml (added to components.tasks)
|
|
125
|
+
Validation: PASS
|
|
126
|
+
|
|
127
|
+
Next steps:
|
|
128
|
+
1. Edit tasks/lead-agent-process-data.md
|
|
129
|
+
2. Add entrada/saida/checklist
|
|
130
|
+
3. Run: *validate-squad my-squad
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
## Direct Mode (Flags)
|
|
134
|
+
|
|
135
|
+
```bash
|
|
136
|
+
# Add agent directly
|
|
137
|
+
*extend-squad my-squad --add agent --name analytics-agent
|
|
138
|
+
|
|
139
|
+
# Add task with agent linkage
|
|
140
|
+
*extend-squad my-squad --add task --name process-data --agent lead-agent
|
|
141
|
+
|
|
142
|
+
# Add workflow with story reference
|
|
143
|
+
*extend-squad my-squad --add workflow --name daily-processing --story SQS-11
|
|
144
|
+
|
|
145
|
+
# Add all component types
|
|
146
|
+
*extend-squad my-squad --add template --name report-template
|
|
147
|
+
*extend-squad my-squad --add tool --name data-validator
|
|
148
|
+
*extend-squad my-squad --add checklist --name quality-checklist
|
|
149
|
+
*extend-squad my-squad --add script --name migration-helper
|
|
150
|
+
*extend-squad my-squad --add data --name config-data
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
## Execution Steps
|
|
154
|
+
|
|
155
|
+
### Step 1: Validate Squad Exists
|
|
156
|
+
|
|
157
|
+
```javascript
|
|
158
|
+
const { SquadLoader } = require('../scripts/squad/squad-loader');
|
|
159
|
+
const loader = new SquadLoader();
|
|
160
|
+
|
|
161
|
+
const squadPath = path.join('./squads', squadName);
|
|
162
|
+
const exists = await loader.squadExists(squadName);
|
|
163
|
+
|
|
164
|
+
if (!exists) {
|
|
165
|
+
throw new Error(`Squad "${squadName}" not found`);
|
|
166
|
+
}
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
### Step 2: Collect Component Info
|
|
170
|
+
|
|
171
|
+
```javascript
|
|
172
|
+
// Interactive mode
|
|
173
|
+
if (!componentType) {
|
|
174
|
+
componentType = await promptComponentType();
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
if (!componentName) {
|
|
178
|
+
componentName = await promptComponentName(componentType);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
// Validate name format
|
|
182
|
+
if (!isValidKebabCase(componentName)) {
|
|
183
|
+
throw new Error('Component name must be kebab-case');
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
// For tasks, require agent
|
|
187
|
+
if (componentType === 'task' && !agentId) {
|
|
188
|
+
const agents = await listAgents(squadPath);
|
|
189
|
+
agentId = await promptAgentSelection(agents);
|
|
190
|
+
}
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
### Step 3: Create Component File
|
|
194
|
+
|
|
195
|
+
```javascript
|
|
196
|
+
const { SquadExtender } = require('../scripts/squad/squad-extender');
|
|
197
|
+
const extender = new SquadExtender();
|
|
198
|
+
|
|
199
|
+
const result = await extender.addComponent(squadPath, {
|
|
200
|
+
type: componentType,
|
|
201
|
+
name: componentName,
|
|
202
|
+
agentId: agentId,
|
|
203
|
+
storyId: storyId,
|
|
204
|
+
description: description
|
|
205
|
+
});
|
|
206
|
+
|
|
207
|
+
// result = {
|
|
208
|
+
// filePath: 'squads/my-squad/tasks/lead-agent-process-data.md',
|
|
209
|
+
// created: true,
|
|
210
|
+
// templateUsed: 'task-template.md'
|
|
211
|
+
// }
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
### Step 4: Update Manifest
|
|
215
|
+
|
|
216
|
+
```javascript
|
|
217
|
+
const manifestUpdated = await extender.updateManifest(squadPath, {
|
|
218
|
+
type: componentType,
|
|
219
|
+
file: result.fileName
|
|
220
|
+
});
|
|
221
|
+
|
|
222
|
+
// Creates backup before updating
|
|
223
|
+
// Adds to components.{type}[]
|
|
224
|
+
// Preserves YAML formatting
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
### Step 5: Validate
|
|
228
|
+
|
|
229
|
+
```javascript
|
|
230
|
+
const { SquadValidator } = require('../scripts/squad/squad-validator');
|
|
231
|
+
const validator = new SquadValidator();
|
|
232
|
+
|
|
233
|
+
const validationResult = await validator.validate(squadPath);
|
|
234
|
+
|
|
235
|
+
if (!validationResult.valid) {
|
|
236
|
+
console.log('Validation errors:', validationResult.errors);
|
|
237
|
+
console.log('Suggestions:', validationResult.suggestions);
|
|
238
|
+
}
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
### Step 6: Display Result
|
|
242
|
+
|
|
243
|
+
```javascript
|
|
244
|
+
console.log(`
|
|
245
|
+
Creating ${componentType}...
|
|
246
|
+
Created: ${result.relativePath}
|
|
247
|
+
Updated: squad.yaml (added to components.${componentType}s)
|
|
248
|
+
Validation: ${validationResult.valid ? 'PASS' : 'FAIL'}
|
|
249
|
+
|
|
250
|
+
Next steps:
|
|
251
|
+
1. Edit ${result.relativePath}
|
|
252
|
+
2. ${getNextStepHint(componentType)}
|
|
253
|
+
3. Run: *validate-squad ${squadName}
|
|
254
|
+
`);
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
## Component Templates
|
|
258
|
+
|
|
259
|
+
Each component type uses a template from `.aios-core/development/templates/squad/`:
|
|
260
|
+
|
|
261
|
+
| Type | Template | Key Fields |
|
|
262
|
+
|------|----------|------------|
|
|
263
|
+
| agent | agent-template.md | name, id, role, commands |
|
|
264
|
+
| task | task-template.md | responsavel, entrada, saida, checklist |
|
|
265
|
+
| workflow | workflow-template.md | steps, conditions, triggers |
|
|
266
|
+
| checklist | checklist-template.md | items, categories |
|
|
267
|
+
| template | template-template.md | placeholders, structure |
|
|
268
|
+
| tool | tool-template.js | functions, exports |
|
|
269
|
+
| script | script-template.js | main, helpers |
|
|
270
|
+
| data | data-template.yaml | schema, content |
|
|
271
|
+
|
|
272
|
+
## Error Handling
|
|
273
|
+
|
|
274
|
+
### Error 1: Squad Not Found
|
|
275
|
+
|
|
276
|
+
```yaml
|
|
277
|
+
error: SQUAD_NOT_FOUND
|
|
278
|
+
cause: Squad directory does not exist
|
|
279
|
+
resolution: Use *list-squads to see available squads
|
|
280
|
+
recovery: Suggest *create-squad to create new squad
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
### Error 2: Invalid Component Name
|
|
284
|
+
|
|
285
|
+
```yaml
|
|
286
|
+
error: INVALID_COMPONENT_NAME
|
|
287
|
+
cause: Name does not match kebab-case pattern
|
|
288
|
+
resolution: Use lowercase letters, numbers, and hyphens only
|
|
289
|
+
recovery: Suggest valid name format
|
|
290
|
+
```
|
|
291
|
+
|
|
292
|
+
### Error 3: Component Already Exists
|
|
293
|
+
|
|
294
|
+
```yaml
|
|
295
|
+
error: COMPONENT_EXISTS
|
|
296
|
+
cause: File already exists in squad directory
|
|
297
|
+
resolution: Use --force to overwrite, or choose different name
|
|
298
|
+
recovery: Show existing file path
|
|
299
|
+
```
|
|
300
|
+
|
|
301
|
+
### Error 4: Agent Not Found (for tasks)
|
|
302
|
+
|
|
303
|
+
```yaml
|
|
304
|
+
error: AGENT_NOT_FOUND
|
|
305
|
+
cause: Specified agent does not exist in squad
|
|
306
|
+
resolution: Create agent first with --add agent
|
|
307
|
+
recovery: List available agents
|
|
308
|
+
```
|
|
309
|
+
|
|
310
|
+
### Error 5: Manifest Update Failed
|
|
311
|
+
|
|
312
|
+
```yaml
|
|
313
|
+
error: MANIFEST_UPDATE_FAILED
|
|
314
|
+
cause: Could not update squad.yaml
|
|
315
|
+
resolution: Check file permissions and YAML syntax
|
|
316
|
+
recovery: Restore from backup (.squad.yaml.bak)
|
|
317
|
+
```
|
|
318
|
+
|
|
319
|
+
## Security Considerations
|
|
320
|
+
|
|
321
|
+
### Path Traversal Prevention
|
|
322
|
+
|
|
323
|
+
```javascript
|
|
324
|
+
// Validate component name - no path separators
|
|
325
|
+
if (componentName.includes('/') || componentName.includes('\\') || componentName.includes('..')) {
|
|
326
|
+
throw new Error('Invalid component name - path traversal not allowed');
|
|
327
|
+
}
|
|
328
|
+
```
|
|
329
|
+
|
|
330
|
+
### Overwrite Protection
|
|
331
|
+
|
|
332
|
+
```javascript
|
|
333
|
+
if (await fs.access(targetPath).then(() => true).catch(() => false)) {
|
|
334
|
+
if (!force) {
|
|
335
|
+
throw new Error(`File already exists: ${targetPath}. Use --force to overwrite`);
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
```
|
|
339
|
+
|
|
340
|
+
### Backup Before Update
|
|
341
|
+
|
|
342
|
+
```javascript
|
|
343
|
+
const backupPath = manifestPath + '.bak';
|
|
344
|
+
await fs.copyFile(manifestPath, backupPath);
|
|
345
|
+
```
|
|
346
|
+
|
|
347
|
+
## Post-Conditions
|
|
348
|
+
|
|
349
|
+
```yaml
|
|
350
|
+
post-conditions:
|
|
351
|
+
- [ ] Component file created in correct directory
|
|
352
|
+
tipo: post-condition
|
|
353
|
+
blocker: true
|
|
354
|
+
validacao: |
|
|
355
|
+
Verify file exists and contains valid content
|
|
356
|
+
error_message: "Component file was not created successfully"
|
|
357
|
+
|
|
358
|
+
- [ ] Manifest updated with new component
|
|
359
|
+
tipo: post-condition
|
|
360
|
+
blocker: true
|
|
361
|
+
validacao: |
|
|
362
|
+
Verify squad.yaml contains new entry
|
|
363
|
+
error_message: "Manifest was not updated"
|
|
364
|
+
|
|
365
|
+
- [ ] Validation passes
|
|
366
|
+
tipo: post-condition
|
|
367
|
+
blocker: false
|
|
368
|
+
validacao: |
|
|
369
|
+
Squad passes validation after extension
|
|
370
|
+
error_message: "Squad validation failed after extension"
|
|
371
|
+
```
|
|
372
|
+
|
|
373
|
+
## Dependencies
|
|
374
|
+
|
|
375
|
+
- **Scripts:**
|
|
376
|
+
- `.aios-core/development/scripts/squad/squad-loader.js`
|
|
377
|
+
- `.aios-core/development/scripts/squad/squad-extender.js`
|
|
378
|
+
- `.aios-core/development/scripts/squad/squad-validator.js`
|
|
379
|
+
|
|
380
|
+
- **Templates:**
|
|
381
|
+
- `.aios-core/development/templates/squad/agent-template.md`
|
|
382
|
+
- `.aios-core/development/templates/squad/task-template.md`
|
|
383
|
+
- `.aios-core/development/templates/squad/workflow-template.md`
|
|
384
|
+
- `.aios-core/development/templates/squad/checklist-template.md`
|
|
385
|
+
- `.aios-core/development/templates/squad/template-template.md`
|
|
386
|
+
- `.aios-core/development/templates/squad/tool-template.js`
|
|
387
|
+
- `.aios-core/development/templates/squad/script-template.js`
|
|
388
|
+
- `.aios-core/development/templates/squad/data-template.yaml`
|
|
389
|
+
|
|
390
|
+
- **Tools:**
|
|
391
|
+
- js-yaml (YAML parsing)
|
|
392
|
+
- fs (file system operations)
|
|
393
|
+
|
|
394
|
+
## Metadata
|
|
395
|
+
|
|
396
|
+
```yaml
|
|
397
|
+
story: SQS-11
|
|
398
|
+
version: 1.0.0
|
|
399
|
+
created: 2025-12-26
|
|
400
|
+
updated: 2025-12-26
|
|
401
|
+
author: Dex (dev)
|
|
402
|
+
tags:
|
|
403
|
+
- squad
|
|
404
|
+
- extension
|
|
405
|
+
- components
|
|
406
|
+
- templates
|
|
407
|
+
```
|
|
408
|
+
|
|
409
|
+
---
|
|
410
|
+
|
|
411
|
+
*Task definition for *extend-squad command*
|
|
@@ -61,6 +61,12 @@ Validates a squad against the JSON Schema and TASK-FORMAT-SPECIFICATION-V1.
|
|
|
61
61
|
- Checks for valid agent definition format
|
|
62
62
|
- Validates naming conventions
|
|
63
63
|
|
|
64
|
+
### 5. Config Reference Validation (SQS-10)
|
|
65
|
+
- Validates config paths in squad.yaml resolve correctly
|
|
66
|
+
- Supports both local (`config/coding-standards.md`) and project-level (`../../docs/framework/CODING-STANDARDS.md`) paths
|
|
67
|
+
- Warns if project-level reference doesn't exist
|
|
68
|
+
- Errors if local reference doesn't exist
|
|
69
|
+
|
|
64
70
|
## Flow
|
|
65
71
|
|
|
66
72
|
```
|
|
@@ -72,7 +78,8 @@ Validates a squad against the JSON Schema and TASK-FORMAT-SPECIFICATION-V1.
|
|
|
72
78
|
├── validateManifest() → Schema check
|
|
73
79
|
├── validateStructure() → Directory check
|
|
74
80
|
├── validateTasks() → Task format check
|
|
75
|
-
|
|
81
|
+
├── validateAgents() → Agent format check
|
|
82
|
+
└── validateConfigReferences() → Config path check (SQS-10)
|
|
76
83
|
|
|
77
84
|
3. Format and display result
|
|
78
85
|
├── Show errors (if any)
|
|
@@ -146,6 +153,7 @@ async function validateSquad(options) {
|
|
|
146
153
|
## Related
|
|
147
154
|
|
|
148
155
|
- **Story:** SQS-3 (Squad Validator + JSON Schema)
|
|
156
|
+
- **Story:** SQS-10 (Project Config Reference) - Config path resolution
|
|
149
157
|
- **Dependencies:** squad-loader.js, squad-validator.js
|
|
150
158
|
- **Schema:** .aios-core/schemas/squad-schema.json
|
|
151
159
|
- **Agent:** @squad-creator (Craft)
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
# Task: `*waves` - Wave Analysis
|
|
2
|
+
|
|
3
|
+
<!-- Story: WIS-4 - Wave Analysis Engine -->
|
|
4
|
+
<!-- Version: 1.0.0 -->
|
|
5
|
+
<!-- Created: 2025-12-25 -->
|
|
6
|
+
|
|
7
|
+
## Overview
|
|
8
|
+
|
|
9
|
+
Analyzes workflow task dependencies to identify waves of tasks that can execute in parallel. Shows optimization opportunities and critical path.
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
```
|
|
14
|
+
*waves [workflow-name] [options]
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Arguments
|
|
18
|
+
|
|
19
|
+
| Argument | Type | Required | Description |
|
|
20
|
+
|----------|------|----------|-------------|
|
|
21
|
+
| `workflow` | string | No | Workflow name to analyze (default: auto-detect from context) |
|
|
22
|
+
|
|
23
|
+
## Options
|
|
24
|
+
|
|
25
|
+
| Option | Type | Description |
|
|
26
|
+
|--------|------|-------------|
|
|
27
|
+
| `--visual` | flag | Show ASCII visualization of wave structure |
|
|
28
|
+
| `--json` | flag | Output as JSON format |
|
|
29
|
+
| `--help` | flag | Show this help message |
|
|
30
|
+
|
|
31
|
+
## Examples
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
# Analyze current workflow (auto-detected)
|
|
35
|
+
*waves
|
|
36
|
+
|
|
37
|
+
# Analyze specific workflow
|
|
38
|
+
*waves story_development
|
|
39
|
+
|
|
40
|
+
# Visual ASCII representation
|
|
41
|
+
*waves story_development --visual
|
|
42
|
+
|
|
43
|
+
# JSON output for programmatic use
|
|
44
|
+
*waves story_development --json
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Output
|
|
48
|
+
|
|
49
|
+
### Standard Output
|
|
50
|
+
|
|
51
|
+
```
|
|
52
|
+
Wave Analysis: story_development
|
|
53
|
+
════════════════════════════════════════
|
|
54
|
+
|
|
55
|
+
Wave 1 (parallel):
|
|
56
|
+
└─ read-story
|
|
57
|
+
└─ setup-branch
|
|
58
|
+
|
|
59
|
+
Wave 2:
|
|
60
|
+
└─ implement
|
|
61
|
+
|
|
62
|
+
Wave 3 (parallel):
|
|
63
|
+
└─ write-tests
|
|
64
|
+
└─ update-docs
|
|
65
|
+
|
|
66
|
+
Wave 4:
|
|
67
|
+
└─ run-tests
|
|
68
|
+
|
|
69
|
+
Total Sequential: 57min
|
|
70
|
+
Total Parallel: 42min
|
|
71
|
+
Optimization: 26% faster
|
|
72
|
+
|
|
73
|
+
Critical Path: read-story → implement → write-tests → run-tests
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### Visual Output (--visual)
|
|
77
|
+
|
|
78
|
+
```
|
|
79
|
+
Wave Analysis: story_development
|
|
80
|
+
════════════════════════════════════════
|
|
81
|
+
|
|
82
|
+
Wave 1 ──┬── read-story (5min)
|
|
83
|
+
└── setup-branch (2min)
|
|
84
|
+
│
|
|
85
|
+
Wave 2 ──────── implement (30min)
|
|
86
|
+
│
|
|
87
|
+
Wave 3 ──┬── write-tests (10min)
|
|
88
|
+
└── update-docs (5min)
|
|
89
|
+
│
|
|
90
|
+
Wave 4 ──────── run-tests (5min)
|
|
91
|
+
|
|
92
|
+
Total Sequential: 57min
|
|
93
|
+
Total Parallel: 42min
|
|
94
|
+
Optimization: 26% faster
|
|
95
|
+
|
|
96
|
+
Critical Path: read-story → implement → write-tests → run-tests
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
### JSON Output (--json)
|
|
100
|
+
|
|
101
|
+
```json
|
|
102
|
+
{
|
|
103
|
+
"workflowId": "story_development",
|
|
104
|
+
"totalTasks": 6,
|
|
105
|
+
"waves": [
|
|
106
|
+
{
|
|
107
|
+
"waveNumber": 1,
|
|
108
|
+
"tasks": ["read-story", "setup-branch"],
|
|
109
|
+
"parallel": true,
|
|
110
|
+
"dependsOn": [],
|
|
111
|
+
"estimatedDuration": "5min"
|
|
112
|
+
}
|
|
113
|
+
],
|
|
114
|
+
"optimizationGain": "26%",
|
|
115
|
+
"criticalPath": ["read-story", "implement", "write-tests", "run-tests"]
|
|
116
|
+
}
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
## Circular Dependency Handling
|
|
120
|
+
|
|
121
|
+
If circular dependencies are detected, the command will show an error:
|
|
122
|
+
|
|
123
|
+
```
|
|
124
|
+
❌ Circular Dependency Detected!
|
|
125
|
+
|
|
126
|
+
Cycle: task-a → task-b → task-c → task-a
|
|
127
|
+
|
|
128
|
+
Suggestion: Remove dependency from task-c to task-a
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
## Integration
|
|
132
|
+
|
|
133
|
+
### With `*next` Command
|
|
134
|
+
|
|
135
|
+
The `*waves` analysis integrates with the `*next` command to show wave context:
|
|
136
|
+
|
|
137
|
+
```
|
|
138
|
+
🧭 Workflow: story_development
|
|
139
|
+
📍 State: in_development (Wave 2 of 4)
|
|
140
|
+
|
|
141
|
+
Current Wave (parallel):
|
|
142
|
+
├─ `*write-tests` - Write unit tests ⏳
|
|
143
|
+
└─ `*update-docs` - Update documentation ⏳
|
|
144
|
+
|
|
145
|
+
Next Wave (after current completes):
|
|
146
|
+
└─ `*run-tests` - Execute test suite
|
|
147
|
+
|
|
148
|
+
💡 Tip: Run both current wave tasks in parallel to save ~15min
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
## Implementation
|
|
152
|
+
|
|
153
|
+
```javascript
|
|
154
|
+
// Task implementation
|
|
155
|
+
const { analyzeWaves, createWaveAnalyzer } = require('.aios-core/workflow-intelligence');
|
|
156
|
+
|
|
157
|
+
async function executeWaves(args, options) {
|
|
158
|
+
const workflowId = args[0] || await detectCurrentWorkflow();
|
|
159
|
+
const analyzer = createWaveAnalyzer();
|
|
160
|
+
|
|
161
|
+
try {
|
|
162
|
+
const result = analyzer.analyzeWaves(workflowId);
|
|
163
|
+
const output = analyzer.formatOutput(result, {
|
|
164
|
+
visual: options.visual,
|
|
165
|
+
json: options.json
|
|
166
|
+
});
|
|
167
|
+
console.log(output);
|
|
168
|
+
} catch (error) {
|
|
169
|
+
if (error.name === 'CircularDependencyError') {
|
|
170
|
+
console.error('❌ Circular Dependency Detected!\n');
|
|
171
|
+
console.error(`Cycle: ${error.cycle.join(' → ')}`);
|
|
172
|
+
console.error(`\nSuggestion: ${error.getSuggestion()}`);
|
|
173
|
+
process.exit(1);
|
|
174
|
+
}
|
|
175
|
+
throw error;
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
## Performance
|
|
181
|
+
|
|
182
|
+
| Workflow Size | Analysis Time |
|
|
183
|
+
|--------------|---------------|
|
|
184
|
+
| Small (5 tasks) | <10ms |
|
|
185
|
+
| Medium (20 tasks) | <30ms |
|
|
186
|
+
| Large (50 tasks) | <50ms |
|
|
187
|
+
|
|
188
|
+
## Related Commands
|
|
189
|
+
|
|
190
|
+
- `*next` - Get next command suggestions (integrates wave context)
|
|
191
|
+
- `*workflow` - Show workflow status
|
|
192
|
+
- `*help` - Show all available commands
|
|
193
|
+
|
|
194
|
+
## Agent Integration
|
|
195
|
+
|
|
196
|
+
This task is available for:
|
|
197
|
+
- `@dev` - Developer Agent
|
|
198
|
+
|
|
199
|
+
---
|
|
200
|
+
|
|
201
|
+
## Change Log
|
|
202
|
+
|
|
203
|
+
| Version | Date | Changes |
|
|
204
|
+
|---------|------|---------|
|
|
205
|
+
| 1.0.0 | 2025-12-25 | Initial implementation (WIS-4) |
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# {{COMPONENTNAME}}
|
|
2
|
+
|
|
3
|
+
> Agent definition for {{SQUADNAME}} squad
|
|
4
|
+
> Created: {{CREATEDAT}}
|
|
5
|
+
{{#IF STORYID}}
|
|
6
|
+
> Story: {{STORYID}}
|
|
7
|
+
{{/IF}}
|
|
8
|
+
|
|
9
|
+
## Description
|
|
10
|
+
|
|
11
|
+
{{DESCRIPTION}}
|
|
12
|
+
|
|
13
|
+
## Configuration
|
|
14
|
+
|
|
15
|
+
```yaml
|
|
16
|
+
agent:
|
|
17
|
+
name: {{COMPONENTNAME}}
|
|
18
|
+
id: {{COMPONENTNAME}}
|
|
19
|
+
title: "{{COMPONENTNAME}} Agent"
|
|
20
|
+
icon: "{{ICON}}"
|
|
21
|
+
whenToUse: "Use this agent when {{USECASE}}"
|
|
22
|
+
|
|
23
|
+
persona:
|
|
24
|
+
role: "Describe the agent's primary role and responsibilities"
|
|
25
|
+
style: "Communication style (e.g., systematic, empathetic, analytical)"
|
|
26
|
+
identity: "What makes this agent unique"
|
|
27
|
+
focus: "Primary focus areas"
|
|
28
|
+
|
|
29
|
+
core_principles:
|
|
30
|
+
- "Principle 1: Define the first guiding principle"
|
|
31
|
+
- "Principle 2: Define the second guiding principle"
|
|
32
|
+
- "Principle 3: Define the third guiding principle"
|
|
33
|
+
|
|
34
|
+
commands:
|
|
35
|
+
- name: help
|
|
36
|
+
visibility: [full, quick, key]
|
|
37
|
+
description: "Show all available commands"
|
|
38
|
+
- name: command-1
|
|
39
|
+
visibility: [full, quick]
|
|
40
|
+
description: "Description of command 1"
|
|
41
|
+
- name: exit
|
|
42
|
+
visibility: [full, quick, key]
|
|
43
|
+
description: "Exit agent mode"
|
|
44
|
+
|
|
45
|
+
dependencies:
|
|
46
|
+
tasks: []
|
|
47
|
+
templates: []
|
|
48
|
+
checklists: []
|
|
49
|
+
tools: []
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Commands
|
|
53
|
+
|
|
54
|
+
| Command | Description |
|
|
55
|
+
|---------|-------------|
|
|
56
|
+
| `*help` | Show available commands |
|
|
57
|
+
| `*exit` | Exit agent mode |
|
|
58
|
+
|
|
59
|
+
## Collaboration
|
|
60
|
+
|
|
61
|
+
**Works with:**
|
|
62
|
+
- List other agents this agent collaborates with
|
|
63
|
+
|
|
64
|
+
**Handoff points:**
|
|
65
|
+
- When to hand off to other agents
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
*Agent created by squad-creator*
|