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,82 @@
|
|
|
1
|
+
# {{COMPONENTNAME}} Checklist
|
|
2
|
+
|
|
3
|
+
> {{DESCRIPTION}}
|
|
4
|
+
> Squad: {{SQUADNAME}}
|
|
5
|
+
> Created: {{CREATEDAT}}
|
|
6
|
+
{{#IF STORYID}}
|
|
7
|
+
> Story: {{STORYID}}
|
|
8
|
+
{{/IF}}
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## Pre-Conditions
|
|
13
|
+
|
|
14
|
+
Before starting, verify:
|
|
15
|
+
|
|
16
|
+
- [ ] Pre-condition 1
|
|
17
|
+
- [ ] Pre-condition 2
|
|
18
|
+
- [ ] Pre-condition 3
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## Checklist Items
|
|
23
|
+
|
|
24
|
+
### Category 1: Setup
|
|
25
|
+
|
|
26
|
+
| # | Item | Status | Notes |
|
|
27
|
+
|---|------|--------|-------|
|
|
28
|
+
| 1.1 | Item description | [ ] | |
|
|
29
|
+
| 1.2 | Item description | [ ] | |
|
|
30
|
+
| 1.3 | Item description | [ ] | |
|
|
31
|
+
|
|
32
|
+
### Category 2: Implementation
|
|
33
|
+
|
|
34
|
+
| # | Item | Status | Notes |
|
|
35
|
+
|---|------|--------|-------|
|
|
36
|
+
| 2.1 | Item description | [ ] | |
|
|
37
|
+
| 2.2 | Item description | [ ] | |
|
|
38
|
+
| 2.3 | Item description | [ ] | |
|
|
39
|
+
|
|
40
|
+
### Category 3: Validation
|
|
41
|
+
|
|
42
|
+
| # | Item | Status | Notes |
|
|
43
|
+
|---|------|--------|-------|
|
|
44
|
+
| 3.1 | Item description | [ ] | |
|
|
45
|
+
| 3.2 | Item description | [ ] | |
|
|
46
|
+
| 3.3 | Item description | [ ] | |
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
## Post-Conditions
|
|
51
|
+
|
|
52
|
+
After completion, verify:
|
|
53
|
+
|
|
54
|
+
- [ ] Post-condition 1
|
|
55
|
+
- [ ] Post-condition 2
|
|
56
|
+
- [ ] Post-condition 3
|
|
57
|
+
|
|
58
|
+
---
|
|
59
|
+
|
|
60
|
+
## Sign-off
|
|
61
|
+
|
|
62
|
+
| Role | Name | Date | Signature |
|
|
63
|
+
|------|------|------|-----------|
|
|
64
|
+
| Creator | | | |
|
|
65
|
+
| Reviewer | | | |
|
|
66
|
+
| Approver | | | |
|
|
67
|
+
|
|
68
|
+
---
|
|
69
|
+
|
|
70
|
+
## Usage
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
# Use this checklist with:
|
|
74
|
+
*checklist {{COMPONENTNAME}}
|
|
75
|
+
|
|
76
|
+
# Or reference in tasks:
|
|
77
|
+
checklist: {{COMPONENTNAME}}.md
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
---
|
|
81
|
+
|
|
82
|
+
*Checklist created by squad-creator*
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
# {{COMPONENTNAME}} Data
|
|
2
|
+
#
|
|
3
|
+
# {{DESCRIPTION}}
|
|
4
|
+
#
|
|
5
|
+
# Squad: {{SQUADNAME}}
|
|
6
|
+
# Created: {{CREATEDAT}}
|
|
7
|
+
# Story: {{STORYID}}
|
|
8
|
+
|
|
9
|
+
name: {{COMPONENTNAME}}
|
|
10
|
+
version: 1.0.0
|
|
11
|
+
description: {{DESCRIPTION}}
|
|
12
|
+
|
|
13
|
+
# Metadata
|
|
14
|
+
metadata:
|
|
15
|
+
created: {{CREATEDAT}}
|
|
16
|
+
author: squad-creator
|
|
17
|
+
squad: {{SQUADNAME}}
|
|
18
|
+
tags:
|
|
19
|
+
- data
|
|
20
|
+
- {{SQUADNAME}}
|
|
21
|
+
|
|
22
|
+
# Data schema definition
|
|
23
|
+
schema:
|
|
24
|
+
type: object
|
|
25
|
+
required:
|
|
26
|
+
- id
|
|
27
|
+
- name
|
|
28
|
+
properties:
|
|
29
|
+
id:
|
|
30
|
+
type: string
|
|
31
|
+
description: "Unique identifier"
|
|
32
|
+
pattern: "^[a-z][a-z0-9-]*$"
|
|
33
|
+
name:
|
|
34
|
+
type: string
|
|
35
|
+
description: "Display name"
|
|
36
|
+
minLength: 1
|
|
37
|
+
maxLength: 100
|
|
38
|
+
description:
|
|
39
|
+
type: string
|
|
40
|
+
description: "Optional description"
|
|
41
|
+
enabled:
|
|
42
|
+
type: boolean
|
|
43
|
+
description: "Whether this entry is enabled"
|
|
44
|
+
default: true
|
|
45
|
+
priority:
|
|
46
|
+
type: integer
|
|
47
|
+
description: "Priority level (1-10)"
|
|
48
|
+
minimum: 1
|
|
49
|
+
maximum: 10
|
|
50
|
+
default: 5
|
|
51
|
+
metadata:
|
|
52
|
+
type: object
|
|
53
|
+
description: "Additional metadata"
|
|
54
|
+
additionalProperties: true
|
|
55
|
+
|
|
56
|
+
# Default values for new entries
|
|
57
|
+
defaults:
|
|
58
|
+
enabled: true
|
|
59
|
+
priority: 5
|
|
60
|
+
metadata: {}
|
|
61
|
+
|
|
62
|
+
# Validation rules
|
|
63
|
+
validation:
|
|
64
|
+
- rule: "id must be unique"
|
|
65
|
+
check: "unique(entries.id)"
|
|
66
|
+
- rule: "name must not be empty"
|
|
67
|
+
check: "length(name) > 0"
|
|
68
|
+
|
|
69
|
+
# Data entries
|
|
70
|
+
entries:
|
|
71
|
+
- id: example-1
|
|
72
|
+
name: "Example Entry 1"
|
|
73
|
+
description: "This is an example entry"
|
|
74
|
+
enabled: true
|
|
75
|
+
priority: 5
|
|
76
|
+
metadata:
|
|
77
|
+
category: example
|
|
78
|
+
|
|
79
|
+
- id: example-2
|
|
80
|
+
name: "Example Entry 2"
|
|
81
|
+
description: "Another example entry"
|
|
82
|
+
enabled: true
|
|
83
|
+
priority: 3
|
|
84
|
+
metadata:
|
|
85
|
+
category: example
|
|
86
|
+
|
|
87
|
+
# Usage examples
|
|
88
|
+
usage:
|
|
89
|
+
load: |
|
|
90
|
+
const yaml = require('js-yaml');
|
|
91
|
+
const fs = require('fs');
|
|
92
|
+
const data = yaml.load(fs.readFileSync('{{COMPONENTNAME}}.yaml', 'utf8'));
|
|
93
|
+
console.log(data.entries);
|
|
94
|
+
|
|
95
|
+
query: |
|
|
96
|
+
const activeEntries = data.entries.filter(e => e.enabled);
|
|
97
|
+
const highPriority = data.entries.filter(e => e.priority >= 7);
|
|
98
|
+
|
|
99
|
+
add_entry: |
|
|
100
|
+
data.entries.push({
|
|
101
|
+
id: 'new-entry',
|
|
102
|
+
name: 'New Entry',
|
|
103
|
+
enabled: true,
|
|
104
|
+
priority: 5,
|
|
105
|
+
});
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* {{COMPONENTNAME}} Script
|
|
5
|
+
*
|
|
6
|
+
* {{DESCRIPTION}}
|
|
7
|
+
*
|
|
8
|
+
* Squad: {{SQUADNAME}}
|
|
9
|
+
* Created: {{CREATEDAT}}
|
|
10
|
+
*
|
|
11
|
+
* Usage:
|
|
12
|
+
* node {{COMPONENTNAME}}.js [options]
|
|
13
|
+
*
|
|
14
|
+
* Options:
|
|
15
|
+
* --help, -h Show this help message
|
|
16
|
+
* --verbose, -v Enable verbose output
|
|
17
|
+
* --dry-run Preview changes without applying
|
|
18
|
+
*
|
|
19
|
+
* @module {{COMPONENTNAME}}
|
|
20
|
+
* @version 1.0.0
|
|
21
|
+
* @see {{STORYID}}
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
'use strict';
|
|
25
|
+
|
|
26
|
+
const fs = require('fs').promises;
|
|
27
|
+
const path = require('path');
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Script configuration
|
|
31
|
+
*/
|
|
32
|
+
const CONFIG = {
|
|
33
|
+
name: '{{COMPONENTNAME}}',
|
|
34
|
+
version: '1.0.0',
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Parse command line arguments
|
|
39
|
+
*
|
|
40
|
+
* @param {string[]} args - Command line arguments
|
|
41
|
+
* @returns {Object} Parsed options
|
|
42
|
+
*/
|
|
43
|
+
function parseArgs(args) {
|
|
44
|
+
const options = {
|
|
45
|
+
help: false,
|
|
46
|
+
verbose: false,
|
|
47
|
+
dryRun: false,
|
|
48
|
+
args: [],
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
for (let i = 0; i < args.length; i++) {
|
|
52
|
+
const arg = args[i];
|
|
53
|
+
|
|
54
|
+
if (arg === '--help' || arg === '-h') {
|
|
55
|
+
options.help = true;
|
|
56
|
+
} else if (arg === '--verbose' || arg === '-v') {
|
|
57
|
+
options.verbose = true;
|
|
58
|
+
} else if (arg === '--dry-run') {
|
|
59
|
+
options.dryRun = true;
|
|
60
|
+
} else if (!arg.startsWith('-')) {
|
|
61
|
+
options.args.push(arg);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
return options;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Show help message
|
|
70
|
+
*/
|
|
71
|
+
function showHelp() {
|
|
72
|
+
console.log(`
|
|
73
|
+
${CONFIG.name} v${CONFIG.version}
|
|
74
|
+
|
|
75
|
+
{{DESCRIPTION}}
|
|
76
|
+
|
|
77
|
+
Usage:
|
|
78
|
+
node ${CONFIG.name}.js [options] [arguments]
|
|
79
|
+
|
|
80
|
+
Options:
|
|
81
|
+
--help, -h Show this help message
|
|
82
|
+
--verbose, -v Enable verbose output
|
|
83
|
+
--dry-run Preview changes without applying
|
|
84
|
+
|
|
85
|
+
Examples:
|
|
86
|
+
node ${CONFIG.name}.js
|
|
87
|
+
node ${CONFIG.name}.js --verbose
|
|
88
|
+
node ${CONFIG.name}.js --dry-run
|
|
89
|
+
`);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Log message if verbose mode is enabled
|
|
94
|
+
*
|
|
95
|
+
* @param {string} message - Message to log
|
|
96
|
+
* @param {boolean} verbose - Verbose mode flag
|
|
97
|
+
*/
|
|
98
|
+
function log(message, verbose) {
|
|
99
|
+
if (verbose) {
|
|
100
|
+
console.log(`[${CONFIG.name}] ${message}`);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Main script execution
|
|
106
|
+
*
|
|
107
|
+
* @param {Object} options - Script options
|
|
108
|
+
* @returns {Promise<Object>} Execution result
|
|
109
|
+
*/
|
|
110
|
+
async function execute(options) {
|
|
111
|
+
log('Starting execution...', options.verbose);
|
|
112
|
+
|
|
113
|
+
// Implementation here
|
|
114
|
+
const result = {
|
|
115
|
+
success: true,
|
|
116
|
+
message: 'Script completed successfully',
|
|
117
|
+
data: {},
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
// Step 1: Initialize
|
|
121
|
+
log('Step 1: Initializing...', options.verbose);
|
|
122
|
+
|
|
123
|
+
// Step 2: Process
|
|
124
|
+
log('Step 2: Processing...', options.verbose);
|
|
125
|
+
|
|
126
|
+
if (options.dryRun) {
|
|
127
|
+
log('Dry run mode - no changes applied', options.verbose);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
// Step 3: Complete
|
|
131
|
+
log('Step 3: Completing...', options.verbose);
|
|
132
|
+
|
|
133
|
+
return result;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* Main entry point
|
|
138
|
+
*
|
|
139
|
+
* @param {string[]} args - Command line arguments
|
|
140
|
+
*/
|
|
141
|
+
async function main(args) {
|
|
142
|
+
const options = parseArgs(args);
|
|
143
|
+
|
|
144
|
+
if (options.help) {
|
|
145
|
+
showHelp();
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
console.log(`${CONFIG.name} v${CONFIG.version}`);
|
|
150
|
+
console.log('');
|
|
151
|
+
|
|
152
|
+
try {
|
|
153
|
+
const result = await execute(options);
|
|
154
|
+
|
|
155
|
+
if (result.success) {
|
|
156
|
+
console.log('Success:', result.message);
|
|
157
|
+
} else {
|
|
158
|
+
console.error('Failed:', result.message);
|
|
159
|
+
process.exit(1);
|
|
160
|
+
}
|
|
161
|
+
} catch (error) {
|
|
162
|
+
console.error('Error:', error.message);
|
|
163
|
+
if (options.verbose) {
|
|
164
|
+
console.error(error.stack);
|
|
165
|
+
}
|
|
166
|
+
process.exit(1);
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
// Run if called directly
|
|
171
|
+
if (require.main === module) {
|
|
172
|
+
main(process.argv.slice(2));
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
module.exports = {
|
|
176
|
+
main,
|
|
177
|
+
execute,
|
|
178
|
+
parseArgs,
|
|
179
|
+
};
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
---
|
|
2
|
+
task: {{COMPONENTNAME}}
|
|
3
|
+
responsavel: "@{{AGENTID}}"
|
|
4
|
+
responsavel_type: Agent
|
|
5
|
+
atomic_layer: Task
|
|
6
|
+
elicit: false
|
|
7
|
+
|
|
8
|
+
Entrada:
|
|
9
|
+
- campo: input_param
|
|
10
|
+
tipo: string
|
|
11
|
+
origem: User Input
|
|
12
|
+
obrigatorio: true
|
|
13
|
+
validacao: "Describe validation rules"
|
|
14
|
+
|
|
15
|
+
Saida:
|
|
16
|
+
- campo: result
|
|
17
|
+
tipo: object
|
|
18
|
+
destino: Return value
|
|
19
|
+
persistido: false
|
|
20
|
+
|
|
21
|
+
Checklist:
|
|
22
|
+
- "[ ] Step 1: Describe first step"
|
|
23
|
+
- "[ ] Step 2: Describe second step"
|
|
24
|
+
- "[ ] Step 3: Describe third step"
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
# {{COMPONENTNAME}}
|
|
28
|
+
|
|
29
|
+
## Purpose
|
|
30
|
+
|
|
31
|
+
{{DESCRIPTION}}
|
|
32
|
+
|
|
33
|
+
{{#IF STORYID}}
|
|
34
|
+
## Story Reference
|
|
35
|
+
|
|
36
|
+
- **Story:** {{STORYID}}
|
|
37
|
+
- **Squad:** {{SQUADNAME}}
|
|
38
|
+
{{/IF}}
|
|
39
|
+
|
|
40
|
+
## Pre-Conditions
|
|
41
|
+
|
|
42
|
+
```yaml
|
|
43
|
+
pre-conditions:
|
|
44
|
+
- [ ] Pre-condition 1
|
|
45
|
+
tipo: pre-condition
|
|
46
|
+
blocker: true
|
|
47
|
+
validacao: |
|
|
48
|
+
Describe what to validate
|
|
49
|
+
error_message: "Error message if pre-condition fails"
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Execution Steps
|
|
53
|
+
|
|
54
|
+
### Step 1: Initialize
|
|
55
|
+
|
|
56
|
+
```javascript
|
|
57
|
+
// Implementation here
|
|
58
|
+
const { Dependency } = require('./path/to/dependency');
|
|
59
|
+
|
|
60
|
+
async function step1() {
|
|
61
|
+
// Step 1 logic
|
|
62
|
+
}
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### Step 2: Process
|
|
66
|
+
|
|
67
|
+
```javascript
|
|
68
|
+
async function step2() {
|
|
69
|
+
// Step 2 logic
|
|
70
|
+
}
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### Step 3: Complete
|
|
74
|
+
|
|
75
|
+
```javascript
|
|
76
|
+
async function step3() {
|
|
77
|
+
// Step 3 logic
|
|
78
|
+
return {
|
|
79
|
+
success: true,
|
|
80
|
+
data: {},
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## Error Handling
|
|
86
|
+
|
|
87
|
+
### Error 1: Description
|
|
88
|
+
|
|
89
|
+
```yaml
|
|
90
|
+
error: ERROR_CODE
|
|
91
|
+
cause: Description of cause
|
|
92
|
+
resolution: How to resolve
|
|
93
|
+
recovery: Suggested recovery action
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
## Post-Conditions
|
|
97
|
+
|
|
98
|
+
```yaml
|
|
99
|
+
post-conditions:
|
|
100
|
+
- [ ] Result is valid
|
|
101
|
+
tipo: post-condition
|
|
102
|
+
blocker: true
|
|
103
|
+
validacao: |
|
|
104
|
+
Describe validation
|
|
105
|
+
error_message: "Error message if post-condition fails"
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
## Metadata
|
|
109
|
+
|
|
110
|
+
```yaml
|
|
111
|
+
{{#IF STORYID}}
|
|
112
|
+
story: {{STORYID}}
|
|
113
|
+
{{/IF}}
|
|
114
|
+
version: 1.0.0
|
|
115
|
+
created: {{CREATEDAT}}
|
|
116
|
+
updated: {{CREATEDAT}}
|
|
117
|
+
author: squad-creator
|
|
118
|
+
tags:
|
|
119
|
+
- {{SQUADNAME}}
|
|
120
|
+
- {{COMPONENTNAME}}
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
---
|
|
124
|
+
|
|
125
|
+
*Task definition created by squad-creator*
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
# {{COMPONENTNAME}} Template
|
|
2
|
+
|
|
3
|
+
> {{DESCRIPTION}}
|
|
4
|
+
> Squad: {{SQUADNAME}}
|
|
5
|
+
> Created: {{CREATEDAT}}
|
|
6
|
+
{{#IF STORYID}}
|
|
7
|
+
> Story: {{STORYID}}
|
|
8
|
+
{{/IF}}
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## Template Variables
|
|
13
|
+
|
|
14
|
+
| Variable | Type | Required | Description |
|
|
15
|
+
|----------|------|----------|-------------|
|
|
16
|
+
| `{{VAR1}}` | string | Yes | Description of variable 1 |
|
|
17
|
+
| `{{VAR2}}` | string | No | Description of variable 2 |
|
|
18
|
+
| `{{VAR3}}` | date | No | Description of variable 3 |
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## Usage
|
|
23
|
+
|
|
24
|
+
```javascript
|
|
25
|
+
const { renderTemplate } = require('.aios-core/infrastructure/scripts/template-engine');
|
|
26
|
+
|
|
27
|
+
const result = await renderTemplate('{{COMPONENTNAME}}.md', {
|
|
28
|
+
VAR1: 'value1',
|
|
29
|
+
VAR2: 'value2',
|
|
30
|
+
VAR3: new Date().toISOString(),
|
|
31
|
+
});
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
## Template Content
|
|
37
|
+
|
|
38
|
+
<!-- BEGIN TEMPLATE -->
|
|
39
|
+
|
|
40
|
+
# {{VAR1}}
|
|
41
|
+
|
|
42
|
+
> Created: {{VAR3}}
|
|
43
|
+
|
|
44
|
+
## Section 1
|
|
45
|
+
|
|
46
|
+
{{VAR2}}
|
|
47
|
+
|
|
48
|
+
### Subsection 1.1
|
|
49
|
+
|
|
50
|
+
Content here...
|
|
51
|
+
|
|
52
|
+
### Subsection 1.2
|
|
53
|
+
|
|
54
|
+
Content here...
|
|
55
|
+
|
|
56
|
+
## Section 2
|
|
57
|
+
|
|
58
|
+
Additional content...
|
|
59
|
+
|
|
60
|
+
## Section 3
|
|
61
|
+
|
|
62
|
+
Final content...
|
|
63
|
+
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
*Generated from {{COMPONENTNAME}} template*
|
|
67
|
+
|
|
68
|
+
<!-- END TEMPLATE -->
|
|
69
|
+
|
|
70
|
+
---
|
|
71
|
+
|
|
72
|
+
## Examples
|
|
73
|
+
|
|
74
|
+
### Example 1: Basic Usage
|
|
75
|
+
|
|
76
|
+
```javascript
|
|
77
|
+
const result = await renderTemplate('{{COMPONENTNAME}}.md', {
|
|
78
|
+
VAR1: 'My Document',
|
|
79
|
+
VAR2: 'This is the introduction text.',
|
|
80
|
+
VAR3: '2025-01-01',
|
|
81
|
+
});
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
### Example 2: With Conditionals
|
|
85
|
+
|
|
86
|
+
```javascript
|
|
87
|
+
const result = await renderTemplate('{{COMPONENTNAME}}.md', {
|
|
88
|
+
VAR1: 'My Document',
|
|
89
|
+
VAR2: 'Introduction',
|
|
90
|
+
VAR3: new Date().toISOString(),
|
|
91
|
+
INCLUDE_EXTRA: true,
|
|
92
|
+
});
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
---
|
|
96
|
+
|
|
97
|
+
*Template created by squad-creator*
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* {{COMPONENTNAME}} Tool
|
|
3
|
+
*
|
|
4
|
+
* {{DESCRIPTION}}
|
|
5
|
+
*
|
|
6
|
+
* Squad: {{SQUADNAME}}
|
|
7
|
+
* Created: {{CREATEDAT}}
|
|
8
|
+
*
|
|
9
|
+
* @module {{COMPONENTNAME}}
|
|
10
|
+
* @version 1.0.0
|
|
11
|
+
* @see {{STORYID}}
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
'use strict';
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Configuration for the tool
|
|
18
|
+
* @constant {Object}
|
|
19
|
+
*/
|
|
20
|
+
const CONFIG = {
|
|
21
|
+
name: '{{COMPONENTNAME}}',
|
|
22
|
+
version: '1.0.0',
|
|
23
|
+
description: '{{DESCRIPTION}}',
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Main function for {{COMPONENTNAME}}
|
|
28
|
+
*
|
|
29
|
+
* @param {Object} input - Input parameters
|
|
30
|
+
* @param {string} input.param1 - First parameter
|
|
31
|
+
* @param {Object} [options={}] - Optional configuration
|
|
32
|
+
* @returns {Object} Result object with success status and data
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* const result = await {{CAMELCASE_NAME}}({
|
|
36
|
+
* param1: 'value1',
|
|
37
|
+
* });
|
|
38
|
+
* console.log(result.data);
|
|
39
|
+
*/
|
|
40
|
+
async function {{CAMELCASE_NAME}}(input, options = {}) {
|
|
41
|
+
// Validate input
|
|
42
|
+
if (!input || typeof input !== 'object') {
|
|
43
|
+
return {
|
|
44
|
+
success: false,
|
|
45
|
+
error: 'Invalid input: expected object',
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
try {
|
|
50
|
+
// Implementation here
|
|
51
|
+
const result = {
|
|
52
|
+
// Process input and generate output
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
return {
|
|
56
|
+
success: true,
|
|
57
|
+
data: result,
|
|
58
|
+
};
|
|
59
|
+
} catch (error) {
|
|
60
|
+
return {
|
|
61
|
+
success: false,
|
|
62
|
+
error: error.message,
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Helper function 1
|
|
69
|
+
*
|
|
70
|
+
* @private
|
|
71
|
+
* @param {*} value - Value to process
|
|
72
|
+
* @returns {*} Processed value
|
|
73
|
+
*/
|
|
74
|
+
function _helperFunction1(value) {
|
|
75
|
+
// Helper implementation
|
|
76
|
+
return value;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Helper function 2
|
|
81
|
+
*
|
|
82
|
+
* @private
|
|
83
|
+
* @param {Object} data - Data to transform
|
|
84
|
+
* @returns {Object} Transformed data
|
|
85
|
+
*/
|
|
86
|
+
function _helperFunction2(data) {
|
|
87
|
+
// Helper implementation
|
|
88
|
+
return data;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Get tool information
|
|
93
|
+
*
|
|
94
|
+
* @returns {Object} Tool configuration
|
|
95
|
+
*/
|
|
96
|
+
function getInfo() {
|
|
97
|
+
return CONFIG;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
module.exports = {
|
|
101
|
+
{{CAMELCASE_NAME}},
|
|
102
|
+
getInfo,
|
|
103
|
+
};
|