aios-core 2.1.4 → 2.1.5
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/infrastructure/scripts/llm-routing/install-llm-routing.js +6 -6
- package/package.json +1 -1
- package/packages/installer/src/config/templates/env-template.js +2 -2
- package/packages/installer/src/wizard/wizard.js +34 -185
- package/src/wizard/index.js +2 -2
- package/.aios-core/development/tasks/analyze-brownfield.md +0 -456
- package/.aios-core/development/tasks/setup-project-docs.md +0 -444
- package/.aios-core/infrastructure/scripts/documentation-integrity/brownfield-analyzer.js +0 -501
- package/.aios-core/infrastructure/scripts/documentation-integrity/config-generator.js +0 -329
- package/.aios-core/infrastructure/scripts/documentation-integrity/deployment-config-loader.js +0 -282
- package/.aios-core/infrastructure/scripts/documentation-integrity/doc-generator.js +0 -331
- package/.aios-core/infrastructure/scripts/documentation-integrity/gitignore-generator.js +0 -312
- package/.aios-core/infrastructure/scripts/documentation-integrity/index.js +0 -74
- package/.aios-core/infrastructure/scripts/documentation-integrity/mode-detector.js +0 -358
- package/.aios-core/infrastructure/templates/core-config/core-config-brownfield.tmpl.yaml +0 -182
- package/.aios-core/infrastructure/templates/core-config/core-config-greenfield.tmpl.yaml +0 -127
- package/.aios-core/infrastructure/templates/gitignore/gitignore-aios-base.tmpl +0 -63
- package/.aios-core/infrastructure/templates/gitignore/gitignore-brownfield-merge.tmpl +0 -18
- package/.aios-core/infrastructure/templates/gitignore/gitignore-node.tmpl +0 -85
- package/.aios-core/infrastructure/templates/gitignore/gitignore-python.tmpl +0 -145
- package/.aios-core/infrastructure/templates/project-docs/coding-standards-tmpl.md +0 -346
- package/.aios-core/infrastructure/templates/project-docs/source-tree-tmpl.md +0 -177
- package/.aios-core/infrastructure/templates/project-docs/tech-stack-tmpl.md +0 -267
|
@@ -1,444 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
|
|
3
|
-
## Execution Modes
|
|
4
|
-
|
|
5
|
-
**Choose your execution mode:**
|
|
6
|
-
|
|
7
|
-
### 1. YOLO Mode - Fast, Autonomous (0-1 prompts)
|
|
8
|
-
- Autonomous decision making with logging
|
|
9
|
-
- Minimal user interaction
|
|
10
|
-
- **Best for:** Greenfield projects, quick setup
|
|
11
|
-
|
|
12
|
-
### 2. Interactive Mode - Balanced, Educational (5-10 prompts) **[DEFAULT]**
|
|
13
|
-
- Explicit decision checkpoints
|
|
14
|
-
- Educational explanations
|
|
15
|
-
- **Best for:** Brownfield projects, complex configurations
|
|
16
|
-
|
|
17
|
-
### 3. Pre-Flight Planning - Comprehensive Upfront Planning
|
|
18
|
-
- Task analysis phase (identify all ambiguities)
|
|
19
|
-
- Zero ambiguity execution
|
|
20
|
-
- **Best for:** Critical projects, enterprise setups
|
|
21
|
-
|
|
22
|
-
**Parameter:** `mode` (optional, default: `interactive`)
|
|
23
|
-
|
|
24
|
-
---
|
|
25
|
-
|
|
26
|
-
## Task Definition (AIOS Task Format V1.0)
|
|
27
|
-
|
|
28
|
-
```yaml
|
|
29
|
-
task: setupProjectDocs()
|
|
30
|
-
responsável: dev (Developer)
|
|
31
|
-
responsavel_type: Agente
|
|
32
|
-
atomic_layer: Documentation
|
|
33
|
-
|
|
34
|
-
**Entrada:**
|
|
35
|
-
- campo: targetDir
|
|
36
|
-
tipo: string
|
|
37
|
-
origem: User Input or cwd
|
|
38
|
-
obrigatório: false
|
|
39
|
-
validação: Valid directory path
|
|
40
|
-
|
|
41
|
-
- campo: projectName
|
|
42
|
-
tipo: string
|
|
43
|
-
origem: User Input or package.json
|
|
44
|
-
obrigatório: false
|
|
45
|
-
validação: Non-empty string
|
|
46
|
-
|
|
47
|
-
- campo: mode
|
|
48
|
-
tipo: string
|
|
49
|
-
origem: User Input
|
|
50
|
-
obrigatório: false
|
|
51
|
-
validação: greenfield|brownfield|framework-dev
|
|
52
|
-
|
|
53
|
-
- campo: executionMode
|
|
54
|
-
tipo: string
|
|
55
|
-
origem: User Input
|
|
56
|
-
obrigatório: false
|
|
57
|
-
validação: yolo|interactive|pre-flight
|
|
58
|
-
|
|
59
|
-
**Saída:**
|
|
60
|
-
- campo: docs_generated
|
|
61
|
-
tipo: array
|
|
62
|
-
destino: .aios-core/docs/
|
|
63
|
-
persistido: true
|
|
64
|
-
|
|
65
|
-
- campo: core_config
|
|
66
|
-
tipo: file
|
|
67
|
-
destino: .aios-core/core-config.yaml
|
|
68
|
-
persistido: true
|
|
69
|
-
|
|
70
|
-
- campo: gitignore
|
|
71
|
-
tipo: file
|
|
72
|
-
destino: .gitignore
|
|
73
|
-
persistido: true
|
|
74
|
-
```
|
|
75
|
-
|
|
76
|
-
---
|
|
77
|
-
|
|
78
|
-
## Pre-Conditions
|
|
79
|
-
|
|
80
|
-
**Purpose:** Validate prerequisites BEFORE task execution (blocking)
|
|
81
|
-
|
|
82
|
-
**Checklist:**
|
|
83
|
-
|
|
84
|
-
```yaml
|
|
85
|
-
pre-conditions:
|
|
86
|
-
- [ ] Target directory exists and is writable
|
|
87
|
-
tipo: pre-condition
|
|
88
|
-
blocker: true
|
|
89
|
-
validação: |
|
|
90
|
-
Check target directory exists and has write permissions
|
|
91
|
-
error_message: "Pre-condition failed: Target directory not accessible"
|
|
92
|
-
|
|
93
|
-
- [ ] Documentation Integrity module is available
|
|
94
|
-
tipo: pre-condition
|
|
95
|
-
blocker: true
|
|
96
|
-
validação: |
|
|
97
|
-
Verify .aios-core/infrastructure/scripts/documentation-integrity/index.js exists
|
|
98
|
-
error_message: "Pre-condition failed: Documentation Integrity module not found"
|
|
99
|
-
```
|
|
100
|
-
|
|
101
|
-
---
|
|
102
|
-
|
|
103
|
-
## Post-Conditions
|
|
104
|
-
|
|
105
|
-
**Purpose:** Validate execution success AFTER task completes
|
|
106
|
-
|
|
107
|
-
**Checklist:**
|
|
108
|
-
|
|
109
|
-
```yaml
|
|
110
|
-
post-conditions:
|
|
111
|
-
- [ ] Project docs created in .aios-core/docs/
|
|
112
|
-
tipo: post-condition
|
|
113
|
-
blocker: true
|
|
114
|
-
validação: |
|
|
115
|
-
Verify source-tree.md, coding-standards.md, tech-stack.md exist
|
|
116
|
-
error_message: "Post-condition failed: Documentation files not created"
|
|
117
|
-
|
|
118
|
-
- [ ] core-config.yaml created with valid deployment section
|
|
119
|
-
tipo: post-condition
|
|
120
|
-
blocker: true
|
|
121
|
-
validação: |
|
|
122
|
-
Verify .aios-core/core-config.yaml exists and has deployment configuration
|
|
123
|
-
error_message: "Post-condition failed: core-config.yaml not properly configured"
|
|
124
|
-
```
|
|
125
|
-
|
|
126
|
-
---
|
|
127
|
-
|
|
128
|
-
## Acceptance Criteria
|
|
129
|
-
|
|
130
|
-
**Purpose:** Definitive pass/fail criteria for task completion
|
|
131
|
-
|
|
132
|
-
**Checklist:**
|
|
133
|
-
|
|
134
|
-
```yaml
|
|
135
|
-
acceptance-criteria:
|
|
136
|
-
- [ ] All documentation files generated from templates
|
|
137
|
-
tipo: acceptance-criterion
|
|
138
|
-
blocker: true
|
|
139
|
-
validação: |
|
|
140
|
-
Assert docs contain project-specific content, not placeholders
|
|
141
|
-
error_message: "Acceptance criterion not met: Docs contain unresolved placeholders"
|
|
142
|
-
|
|
143
|
-
- [ ] .gitignore properly configured for project
|
|
144
|
-
tipo: acceptance-criterion
|
|
145
|
-
blocker: true
|
|
146
|
-
validação: |
|
|
147
|
-
Assert .gitignore includes AIOS ignores and tech stack ignores
|
|
148
|
-
error_message: "Acceptance criterion not met: .gitignore incomplete"
|
|
149
|
-
|
|
150
|
-
- [ ] Configuration-Driven Architecture pattern applied
|
|
151
|
-
tipo: acceptance-criterion
|
|
152
|
-
blocker: true
|
|
153
|
-
validação: |
|
|
154
|
-
Assert core-config.yaml contains project-specific values
|
|
155
|
-
error_message: "Acceptance criterion not met: core-config.yaml not configuration-driven"
|
|
156
|
-
```
|
|
157
|
-
|
|
158
|
-
---
|
|
159
|
-
|
|
160
|
-
## Tools
|
|
161
|
-
|
|
162
|
-
**External/shared resources used by this task:**
|
|
163
|
-
|
|
164
|
-
- **Tool:** documentation-integrity
|
|
165
|
-
- **Purpose:** Mode detection, doc generation, config generation
|
|
166
|
-
- **Source:** .aios-core/infrastructure/scripts/documentation-integrity/index.js
|
|
167
|
-
|
|
168
|
-
- **Tool:** deployment-config-loader
|
|
169
|
-
- **Purpose:** Load and validate deployment configuration
|
|
170
|
-
- **Source:** .aios-core/infrastructure/scripts/documentation-integrity/deployment-config-loader.js
|
|
171
|
-
|
|
172
|
-
---
|
|
173
|
-
|
|
174
|
-
## Scripts
|
|
175
|
-
|
|
176
|
-
**Agent-specific code for this task:**
|
|
177
|
-
|
|
178
|
-
- **Script:** mode-detector.js
|
|
179
|
-
- **Purpose:** Detect installation mode from project markers
|
|
180
|
-
- **Language:** JavaScript
|
|
181
|
-
- **Location:** .aios-core/infrastructure/scripts/documentation-integrity/mode-detector.js
|
|
182
|
-
|
|
183
|
-
- **Script:** doc-generator.js
|
|
184
|
-
- **Purpose:** Generate project documentation from templates
|
|
185
|
-
- **Language:** JavaScript
|
|
186
|
-
- **Location:** .aios-core/infrastructure/scripts/documentation-integrity/doc-generator.js
|
|
187
|
-
|
|
188
|
-
- **Script:** config-generator.js
|
|
189
|
-
- **Purpose:** Generate core-config.yaml
|
|
190
|
-
- **Language:** JavaScript
|
|
191
|
-
- **Location:** .aios-core/infrastructure/scripts/documentation-integrity/config-generator.js
|
|
192
|
-
|
|
193
|
-
- **Script:** gitignore-generator.js
|
|
194
|
-
- **Purpose:** Generate or merge .gitignore
|
|
195
|
-
- **Language:** JavaScript
|
|
196
|
-
- **Location:** .aios-core/infrastructure/scripts/documentation-integrity/gitignore-generator.js
|
|
197
|
-
|
|
198
|
-
---
|
|
199
|
-
|
|
200
|
-
## Error Handling
|
|
201
|
-
|
|
202
|
-
**Strategy:** fallback-defaults
|
|
203
|
-
|
|
204
|
-
**Common Errors:**
|
|
205
|
-
|
|
206
|
-
1. **Error:** Mode Detection Failed
|
|
207
|
-
- **Cause:** Unable to determine project type from markers
|
|
208
|
-
- **Resolution:** Use default mode (greenfield) or prompt user
|
|
209
|
-
- **Recovery:** Provide mode selection options
|
|
210
|
-
|
|
211
|
-
2. **Error:** Template Not Found
|
|
212
|
-
- **Cause:** Template file missing from templates directory
|
|
213
|
-
- **Resolution:** Check template paths in templates/project-docs/
|
|
214
|
-
- **Recovery:** Use inline fallback templates
|
|
215
|
-
|
|
216
|
-
3. **Error:** Config Write Failed
|
|
217
|
-
- **Cause:** Permission denied or disk full
|
|
218
|
-
- **Resolution:** Check directory permissions
|
|
219
|
-
- **Recovery:** Output config to console for manual creation
|
|
220
|
-
|
|
221
|
-
---
|
|
222
|
-
|
|
223
|
-
## Performance
|
|
224
|
-
|
|
225
|
-
**Expected Metrics:**
|
|
226
|
-
|
|
227
|
-
```yaml
|
|
228
|
-
duration_expected: 1-3 min (estimated)
|
|
229
|
-
cost_estimated: $0.001-0.003
|
|
230
|
-
token_usage: ~500-2,000 tokens
|
|
231
|
-
```
|
|
232
|
-
|
|
233
|
-
**Optimization Notes:**
|
|
234
|
-
- Uses template-based generation for fast execution
|
|
235
|
-
- Minimal file I/O with batched writes
|
|
236
|
-
- Configuration-Driven Architecture reduces runtime decisions
|
|
237
|
-
|
|
238
|
-
---
|
|
239
|
-
|
|
240
|
-
## Metadata
|
|
241
|
-
|
|
242
|
-
```yaml
|
|
243
|
-
story: 6.9
|
|
244
|
-
version: 1.0.0
|
|
245
|
-
dependencies:
|
|
246
|
-
- documentation-integrity module
|
|
247
|
-
tags:
|
|
248
|
-
- documentation
|
|
249
|
-
- setup
|
|
250
|
-
- configuration
|
|
251
|
-
updated_at: 2025-12-14
|
|
252
|
-
```
|
|
253
|
-
|
|
254
|
-
---
|
|
255
|
-
|
|
256
|
-
tools:
|
|
257
|
-
- filesystem # Read/write project files
|
|
258
|
-
- documentation-integrity # Core module for this task
|
|
259
|
-
---
|
|
260
|
-
|
|
261
|
-
# Setup Project Documentation
|
|
262
|
-
|
|
263
|
-
## Purpose
|
|
264
|
-
|
|
265
|
-
Generate project-specific documentation and configuration using the Documentation Integrity System. This task creates the foundational docs that enable AI agents to understand project structure, coding standards, and deployment configuration.
|
|
266
|
-
|
|
267
|
-
## Task Instructions
|
|
268
|
-
|
|
269
|
-
### 1. Detect Installation Mode
|
|
270
|
-
|
|
271
|
-
First, determine the installation mode based on project markers:
|
|
272
|
-
|
|
273
|
-
```javascript
|
|
274
|
-
const { detectInstallationMode, collectMarkers } = require('./.aios-core/infrastructure/scripts/documentation-integrity');
|
|
275
|
-
|
|
276
|
-
const targetDir = process.cwd(); // or specified directory
|
|
277
|
-
const detected = detectInstallationMode(targetDir);
|
|
278
|
-
const markers = collectMarkers(targetDir);
|
|
279
|
-
|
|
280
|
-
console.log(`Detected Mode: ${detected.mode}`);
|
|
281
|
-
console.log(`Confidence: ${detected.confidence}`);
|
|
282
|
-
console.log(`Reason: ${detected.reason}`);
|
|
283
|
-
```
|
|
284
|
-
|
|
285
|
-
**Mode Descriptions:**
|
|
286
|
-
|
|
287
|
-
| Mode | Description | Actions |
|
|
288
|
-
|------|-------------|---------|
|
|
289
|
-
| `framework-dev` | Contributing to aios-core itself | Skip project setup, use existing config |
|
|
290
|
-
| `greenfield` | New empty project | Full scaffolding, deployment config wizard |
|
|
291
|
-
| `brownfield` | Existing project | Analyze and adapt, merge configurations |
|
|
292
|
-
|
|
293
|
-
### 2. Elicit Deployment Configuration (Greenfield/Brownfield)
|
|
294
|
-
|
|
295
|
-
For greenfield and brownfield projects, gather deployment preferences:
|
|
296
|
-
|
|
297
|
-
**Key Questions:**
|
|
298
|
-
|
|
299
|
-
1. **Deployment Workflow:**
|
|
300
|
-
- `staging-first`: All changes go to staging before production
|
|
301
|
-
- `direct-to-main`: Feature branches merge directly to main
|
|
302
|
-
|
|
303
|
-
2. **Deployment Platform:**
|
|
304
|
-
- `vercel`: Vercel deployment
|
|
305
|
-
- `netlify`: Netlify deployment
|
|
306
|
-
- `aws`: AWS (S3/CloudFront, ECS, Lambda)
|
|
307
|
-
- `gcp`: Google Cloud Platform
|
|
308
|
-
- `azure`: Microsoft Azure
|
|
309
|
-
- `railway`: Railway.app
|
|
310
|
-
- `custom`: Custom deployment scripts
|
|
311
|
-
|
|
312
|
-
3. **Branch Configuration:**
|
|
313
|
-
- Staging branch name (default: `staging`)
|
|
314
|
-
- Production branch name (default: `main`)
|
|
315
|
-
|
|
316
|
-
4. **Quality Gates:**
|
|
317
|
-
- Enable lint check? (default: yes)
|
|
318
|
-
- Enable typecheck? (default: yes for TypeScript projects)
|
|
319
|
-
- Enable tests? (default: yes)
|
|
320
|
-
- Enable security scan? (default: no)
|
|
321
|
-
|
|
322
|
-
### 3. Generate Documentation
|
|
323
|
-
|
|
324
|
-
Using the gathered context, generate project documentation:
|
|
325
|
-
|
|
326
|
-
```javascript
|
|
327
|
-
const { buildDocContext, generateDocs } = require('./.aios-core/infrastructure/scripts/documentation-integrity');
|
|
328
|
-
|
|
329
|
-
const context = buildDocContext(projectName, mode, markers, {
|
|
330
|
-
// Custom overrides if needed
|
|
331
|
-
});
|
|
332
|
-
|
|
333
|
-
const result = generateDocs(targetDir, context, {
|
|
334
|
-
dryRun: false, // Set true to preview
|
|
335
|
-
});
|
|
336
|
-
|
|
337
|
-
console.log(`Generated ${result.filesCreated.length} documentation files`);
|
|
338
|
-
```
|
|
339
|
-
|
|
340
|
-
**Files Generated:**
|
|
341
|
-
|
|
342
|
-
| File | Purpose |
|
|
343
|
-
|------|---------|
|
|
344
|
-
| `.aios-core/docs/source-tree.md` | Project structure documentation |
|
|
345
|
-
| `.aios-core/docs/coding-standards.md` | Coding conventions and patterns |
|
|
346
|
-
| `.aios-core/docs/tech-stack.md` | Technology stack reference |
|
|
347
|
-
|
|
348
|
-
### 4. Generate Core Configuration
|
|
349
|
-
|
|
350
|
-
Create the core-config.yaml with deployment settings:
|
|
351
|
-
|
|
352
|
-
```javascript
|
|
353
|
-
const { buildConfigContext, generateConfig, DeploymentWorkflow, DeploymentPlatform } = require('./.aios-core/infrastructure/scripts/documentation-integrity');
|
|
354
|
-
|
|
355
|
-
const configContext = buildConfigContext(projectName, mode, {
|
|
356
|
-
workflow: DeploymentWorkflow.STAGING_FIRST,
|
|
357
|
-
platform: DeploymentPlatform.VERCEL,
|
|
358
|
-
branches: {
|
|
359
|
-
staging: 'staging',
|
|
360
|
-
production: 'main',
|
|
361
|
-
},
|
|
362
|
-
quality_gates: {
|
|
363
|
-
lint: true,
|
|
364
|
-
typecheck: true,
|
|
365
|
-
tests: true,
|
|
366
|
-
security_scan: false,
|
|
367
|
-
},
|
|
368
|
-
});
|
|
369
|
-
|
|
370
|
-
const configResult = generateConfig(targetDir, mode, configContext);
|
|
371
|
-
```
|
|
372
|
-
|
|
373
|
-
### 5. Generate/Merge .gitignore
|
|
374
|
-
|
|
375
|
-
Handle .gitignore based on project state:
|
|
376
|
-
|
|
377
|
-
```javascript
|
|
378
|
-
const { generateGitignoreFile, hasAiosIntegration } = require('./.aios-core/infrastructure/scripts/documentation-integrity');
|
|
379
|
-
|
|
380
|
-
const gitignoreResult = generateGitignoreFile(targetDir, markers, {
|
|
381
|
-
projectName,
|
|
382
|
-
merge: mode === 'brownfield', // Merge with existing for brownfield
|
|
383
|
-
});
|
|
384
|
-
|
|
385
|
-
console.log(`Gitignore ${gitignoreResult.mode}: ${gitignoreResult.path}`);
|
|
386
|
-
```
|
|
387
|
-
|
|
388
|
-
### 6. Verify Configuration-Driven Architecture
|
|
389
|
-
|
|
390
|
-
Confirm the deployment config can be loaded by other tasks:
|
|
391
|
-
|
|
392
|
-
```javascript
|
|
393
|
-
const { loadDeploymentConfig, validateDeploymentConfig } = require('./.aios-core/infrastructure/scripts/documentation-integrity');
|
|
394
|
-
|
|
395
|
-
const deployConfig = loadDeploymentConfig(targetDir);
|
|
396
|
-
const validation = validateDeploymentConfig(deployConfig);
|
|
397
|
-
|
|
398
|
-
if (validation.valid) {
|
|
399
|
-
console.log('Configuration-Driven Architecture ready');
|
|
400
|
-
console.log(`Workflow: ${deployConfig.workflow}`);
|
|
401
|
-
console.log(`Platform: ${deployConfig.platform}`);
|
|
402
|
-
} else {
|
|
403
|
-
console.error('Configuration validation failed:', validation.errors);
|
|
404
|
-
}
|
|
405
|
-
```
|
|
406
|
-
|
|
407
|
-
## Success Criteria
|
|
408
|
-
|
|
409
|
-
- [ ] Installation mode correctly detected
|
|
410
|
-
- [ ] Project documentation generated in `.aios-core/docs/`
|
|
411
|
-
- [ ] `core-config.yaml` created with deployment section
|
|
412
|
-
- [ ] `.gitignore` properly configured (created or merged)
|
|
413
|
-
- [ ] Configuration passes validation
|
|
414
|
-
- [ ] No unresolved template placeholders in generated files
|
|
415
|
-
|
|
416
|
-
## Output
|
|
417
|
-
|
|
418
|
-
After successful execution:
|
|
419
|
-
|
|
420
|
-
```
|
|
421
|
-
Project Documentation Setup Complete
|
|
422
|
-
=====================================
|
|
423
|
-
Mode: greenfield
|
|
424
|
-
Project: my-awesome-app
|
|
425
|
-
|
|
426
|
-
Generated Files:
|
|
427
|
-
✓ .aios-core/docs/source-tree.md
|
|
428
|
-
✓ .aios-core/docs/coding-standards.md
|
|
429
|
-
✓ .aios-core/docs/tech-stack.md
|
|
430
|
-
✓ .aios-core/core-config.yaml
|
|
431
|
-
✓ .gitignore (created)
|
|
432
|
-
|
|
433
|
-
Deployment Configuration:
|
|
434
|
-
Workflow: staging-first
|
|
435
|
-
Platform: vercel
|
|
436
|
-
Quality Gates: lint, typecheck, tests
|
|
437
|
-
```
|
|
438
|
-
|
|
439
|
-
## Notes
|
|
440
|
-
|
|
441
|
-
- This task implements the Configuration-Driven Architecture pattern
|
|
442
|
-
- Tasks read project-specific values from `core-config.yaml`
|
|
443
|
-
- For brownfield projects, existing configurations are preserved
|
|
444
|
-
- Use `*analyze-brownfield` task first for complex existing projects
|