aiox-core 5.0.0 → 5.0.2
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/.aiox-core/data/entity-registry.yaml +5297 -1814
- package/.aiox-core/data/registry-update-log.jsonl +2 -0
- package/.aiox-core/development/templates/service-template/README.md.hbs +158 -158
- package/.aiox-core/development/templates/service-template/__tests__/index.test.ts.hbs +237 -237
- package/.aiox-core/development/templates/service-template/client.ts.hbs +403 -403
- package/.aiox-core/development/templates/service-template/errors.ts.hbs +182 -182
- package/.aiox-core/development/templates/service-template/index.ts.hbs +120 -120
- package/.aiox-core/development/templates/service-template/package.json.hbs +87 -87
- package/.aiox-core/development/templates/service-template/types.ts.hbs +145 -145
- package/.aiox-core/development/templates/squad-template/LICENSE +21 -21
- package/.aiox-core/infrastructure/scripts/tool-resolver.js +4 -4
- package/.aiox-core/infrastructure/templates/aiox-sync.yaml.template +182 -182
- package/.aiox-core/infrastructure/templates/coderabbit.yaml.template +279 -279
- package/.aiox-core/infrastructure/templates/github-workflows/ci.yml.template +169 -169
- package/.aiox-core/infrastructure/templates/github-workflows/pr-automation.yml.template +330 -330
- package/.aiox-core/infrastructure/templates/github-workflows/release.yml.template +196 -196
- package/.aiox-core/infrastructure/templates/gitignore/gitignore-aiox-base.tmpl +63 -63
- package/.aiox-core/infrastructure/templates/gitignore/gitignore-brownfield-merge.tmpl +18 -18
- package/.aiox-core/infrastructure/templates/gitignore/gitignore-node.tmpl +85 -85
- package/.aiox-core/infrastructure/templates/gitignore/gitignore-python.tmpl +145 -145
- package/.aiox-core/install-manifest.yaml +58 -58
- package/.aiox-core/local-config.yaml.template +71 -71
- package/.aiox-core/monitor/hooks/lib/__init__.py +1 -1
- package/.aiox-core/monitor/hooks/lib/enrich.py +58 -58
- package/.aiox-core/monitor/hooks/lib/send_event.py +47 -47
- package/.aiox-core/monitor/hooks/notification.py +29 -29
- package/.aiox-core/monitor/hooks/post_tool_use.py +45 -45
- package/.aiox-core/monitor/hooks/pre_compact.py +29 -29
- package/.aiox-core/monitor/hooks/pre_tool_use.py +40 -40
- package/.aiox-core/monitor/hooks/stop.py +29 -29
- package/.aiox-core/monitor/hooks/subagent_stop.py +29 -29
- package/.aiox-core/monitor/hooks/user_prompt_submit.py +38 -38
- package/.aiox-core/product/templates/adr.hbs +125 -125
- package/.aiox-core/product/templates/dbdr.hbs +241 -241
- package/.aiox-core/product/templates/engine/elicitation.js +2 -3
- package/.aiox-core/product/templates/epic.hbs +212 -212
- package/.aiox-core/product/templates/pmdr.hbs +186 -186
- package/.aiox-core/product/templates/prd-v2.0.hbs +216 -216
- package/.aiox-core/product/templates/prd.hbs +201 -201
- package/.aiox-core/product/templates/story.hbs +263 -263
- package/.aiox-core/product/templates/task.hbs +170 -170
- package/.aiox-core/product/templates/tmpl-comment-on-examples.sql +158 -158
- package/.aiox-core/product/templates/tmpl-migration-script.sql +91 -91
- package/.aiox-core/product/templates/tmpl-rls-granular-policies.sql +104 -104
- package/.aiox-core/product/templates/tmpl-rls-kiss-policy.sql +10 -10
- package/.aiox-core/product/templates/tmpl-rls-roles.sql +135 -135
- package/.aiox-core/product/templates/tmpl-rls-simple.sql +77 -77
- package/.aiox-core/product/templates/tmpl-rls-tenant.sql +152 -152
- package/.aiox-core/product/templates/tmpl-rollback-script.sql +77 -77
- package/.aiox-core/product/templates/tmpl-seed-data.sql +140 -140
- package/.aiox-core/product/templates/tmpl-smoke-test.sql +16 -16
- package/.aiox-core/product/templates/tmpl-staging-copy-merge.sql +139 -139
- package/.aiox-core/product/templates/tmpl-stored-proc.sql +140 -140
- package/.aiox-core/product/templates/tmpl-trigger.sql +152 -152
- package/.aiox-core/product/templates/tmpl-view-materialized.sql +133 -133
- package/.aiox-core/product/templates/tmpl-view.sql +177 -177
- package/.aiox-core/scripts/pm.sh +0 -0
- package/.claude/hooks/code-intel-pretool.cjs +107 -0
- package/.claude/hooks/enforce-architecture-first.py +196 -196
- package/.claude/hooks/mind-clone-governance.py +192 -192
- package/.claude/hooks/read-protection.py +151 -151
- package/.claude/hooks/slug-validation.py +176 -176
- package/.claude/hooks/sql-governance.py +182 -182
- package/.claude/hooks/write-path-validation.py +194 -194
- package/LICENSE +33 -33
- package/bin/aiox-graph.js +0 -0
- package/bin/aiox-minimal.js +0 -0
- package/bin/aiox.js +0 -0
- package/docs/guides/aios-workflows/README.md +247 -0
- package/docs/guides/aios-workflows/bob-orchestrator-workflow.md +1536 -0
- package/package.json +1 -1
- package/packages/aiox-install/bin/aiox-install.js +0 -0
- package/packages/aiox-install/bin/edmcp.js +0 -0
- package/packages/aiox-pro-cli/bin/aiox-pro.js +0 -0
- package/packages/installer/src/wizard/pro-setup.js +210 -123
- package/pro/README.md +66 -0
- package/pro/license/degradation.js +220 -0
- package/pro/license/errors.js +450 -0
- package/pro/license/feature-gate.js +354 -0
- package/pro/license/index.js +181 -0
- package/pro/license/license-api.js +679 -0
- package/pro/license/license-cache.js +523 -0
- package/pro/license/license-crypto.js +303 -0
- package/scripts/check-markdown-links.py +352 -352
- package/scripts/dashboard-parallel-dev.sh +0 -0
- package/scripts/dashboard-parallel-phase3.sh +0 -0
- package/scripts/dashboard-parallel-phase4.sh +0 -0
- package/scripts/glue/README.md +355 -0
- package/scripts/glue/compose-agent-prompt.cjs +362 -0
- package/scripts/install-monitor-hooks.sh +0 -0
- package/.aiox-core/lib/build.json +0 -1
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,355 @@
|
|
|
1
|
+
# Glue Script: Compose Agent Prompt
|
|
2
|
+
|
|
3
|
+
Deterministic prompt composition for autonomous AIOS agents.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
The glue script (`compose-agent-prompt.cjs`) composes complete prompts for autonomous agents by combining:
|
|
8
|
+
|
|
9
|
+
1. **Agent Persona** - From `.aios-core/development/agents/{id}.md`
|
|
10
|
+
2. **Task Workflow** - From Mission Router → `.aios-core/development/tasks/{file}.md`
|
|
11
|
+
3. **Extra Resources** - Checklists, templates specified in Mission Router
|
|
12
|
+
4. **Context** - Story files, accumulated context, etc.
|
|
13
|
+
5. **Execution Directive** - Mission-specific instructions
|
|
14
|
+
|
|
15
|
+
## Architecture
|
|
16
|
+
|
|
17
|
+
```
|
|
18
|
+
Skill (orchestrator) → Calls glue script
|
|
19
|
+
↓
|
|
20
|
+
Glue Script → Deterministic composition (~240 lines)
|
|
21
|
+
↓ outputs 1500-2000 lines
|
|
22
|
+
Task(general-purpose) → Agent receives COMPLETE prompt
|
|
23
|
+
↓
|
|
24
|
+
Autonomous Execution → No additional Reads needed
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
**Benefits:**
|
|
28
|
+
- Lead doesn't burn context with Reads per spawn
|
|
29
|
+
- Agent receives everything upfront (fresh context)
|
|
30
|
+
- Deterministic: same inputs → same output
|
|
31
|
+
- Validatable and testable
|
|
32
|
+
|
|
33
|
+
## Installation
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
# Already included in project
|
|
37
|
+
# No additional dependencies needed
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Usage
|
|
41
|
+
|
|
42
|
+
### Basic Usage
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
# Develop a story
|
|
46
|
+
node scripts/glue/compose-agent-prompt.cjs \
|
|
47
|
+
--agent dev \
|
|
48
|
+
--mission develop-story \
|
|
49
|
+
--context path/to/story.md
|
|
50
|
+
|
|
51
|
+
# Validate a story
|
|
52
|
+
node scripts/glue/compose-agent-prompt.cjs \
|
|
53
|
+
--agent po \
|
|
54
|
+
--mission validate-story \
|
|
55
|
+
--context path/to/expanded.md
|
|
56
|
+
|
|
57
|
+
# Review implementation
|
|
58
|
+
node scripts/glue/compose-agent-prompt.cjs \
|
|
59
|
+
--agent qa \
|
|
60
|
+
--mission gate \
|
|
61
|
+
--context path/to/story.md \
|
|
62
|
+
--context path/to/impl-log.md
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### Options
|
|
66
|
+
|
|
67
|
+
| Option | Description | Example |
|
|
68
|
+
|--------|-------------|---------|
|
|
69
|
+
| `--agent <id>` | Agent ID (dev, qa, po, db-sage, etc.) | `--agent dev` |
|
|
70
|
+
| `--mission <keyword>` | Mission from Agent's Router | `--mission develop-story` |
|
|
71
|
+
| `--context <path>` | Context file (repeatable) | `--context story.md` |
|
|
72
|
+
| `--squad <name>` | Explicit squad name for agent resolution | `--squad design` |
|
|
73
|
+
| `--extra-instruction` | Additional instruction | `--extra-instruction "Focus on tests"` |
|
|
74
|
+
| `--verbose` | Show debug info to stderr | `--verbose` |
|
|
75
|
+
| `--list-missions` | List available missions | `--list-missions` |
|
|
76
|
+
|
|
77
|
+
### Multiple Contexts
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
# Story + accumulated context
|
|
81
|
+
node scripts/glue/compose-agent-prompt.cjs \
|
|
82
|
+
--agent po \
|
|
83
|
+
--mission validate \
|
|
84
|
+
--context story.md \
|
|
85
|
+
--context accumulated-context.md
|
|
86
|
+
|
|
87
|
+
# Story + implementation log
|
|
88
|
+
node scripts/glue/compose-agent-prompt.cjs \
|
|
89
|
+
--agent qa \
|
|
90
|
+
--mission gate \
|
|
91
|
+
--context expanded.md \
|
|
92
|
+
--context impl-log.md
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### Mission Aliases
|
|
96
|
+
|
|
97
|
+
Common shortcuts for mission keywords:
|
|
98
|
+
|
|
99
|
+
| Alias | Resolves To |
|
|
100
|
+
|-------|-------------|
|
|
101
|
+
| `review` | `gate` |
|
|
102
|
+
| `validate` | `validate-story` |
|
|
103
|
+
| `expand` | `create-story` |
|
|
104
|
+
| `develop` | `develop-story` |
|
|
105
|
+
| `implement` | `develop-story` |
|
|
106
|
+
| `backlog` | `backlog-review` |
|
|
107
|
+
| `draft` | `create-story` |
|
|
108
|
+
|
|
109
|
+
### List Available Missions
|
|
110
|
+
|
|
111
|
+
```bash
|
|
112
|
+
# List missions for QA agent
|
|
113
|
+
node scripts/glue/compose-agent-prompt.cjs --agent qa --list-missions
|
|
114
|
+
|
|
115
|
+
# List missions for PO agent
|
|
116
|
+
node scripts/glue/compose-agent-prompt.cjs --agent po --list-missions
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
## Integration with Task Tool
|
|
120
|
+
|
|
121
|
+
```javascript
|
|
122
|
+
// 1. Compose the prompt
|
|
123
|
+
const prompt = await Bash(
|
|
124
|
+
`node scripts/glue/compose-agent-prompt.cjs \
|
|
125
|
+
--agent dev \
|
|
126
|
+
--mission develop-story \
|
|
127
|
+
--context ${storyPath}`
|
|
128
|
+
);
|
|
129
|
+
|
|
130
|
+
// 2. Spawn agent with complete prompt
|
|
131
|
+
Task({
|
|
132
|
+
subagent_type: "general-purpose",
|
|
133
|
+
model: "opus", // or "sonnet" for mechanical tasks
|
|
134
|
+
mode: "bypassPermissions",
|
|
135
|
+
prompt: prompt.stdout
|
|
136
|
+
});
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
## Execute-Epic Pipeline
|
|
140
|
+
|
|
141
|
+
The glue script supports the full execute-epic pipeline:
|
|
142
|
+
|
|
143
|
+
### Phase 1: Backlog Review (PO)
|
|
144
|
+
```bash
|
|
145
|
+
node scripts/glue/compose-agent-prompt.cjs \
|
|
146
|
+
--agent po \
|
|
147
|
+
--mission backlog-review \
|
|
148
|
+
--context path/to/epic.md
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
### Phase 2: Development Cycle
|
|
152
|
+
|
|
153
|
+
**2.1 Expand Story (SM)**
|
|
154
|
+
```bash
|
|
155
|
+
node scripts/glue/compose-agent-prompt.cjs \
|
|
156
|
+
--agent sm \
|
|
157
|
+
--mission expand \
|
|
158
|
+
--context path/to/epic.md \
|
|
159
|
+
--extra-instruction "Extract story X"
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
**2.2 Validate Story (PO)**
|
|
163
|
+
```bash
|
|
164
|
+
node scripts/glue/compose-agent-prompt.cjs \
|
|
165
|
+
--agent po \
|
|
166
|
+
--mission validate \
|
|
167
|
+
--context path/to/expanded.md
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
**2.3 Implement (Dev)**
|
|
171
|
+
```bash
|
|
172
|
+
node scripts/glue/compose-agent-prompt.cjs \
|
|
173
|
+
--agent dev \
|
|
174
|
+
--mission develop \
|
|
175
|
+
--context path/to/expanded.md \
|
|
176
|
+
--context path/to/accumulated-context.md
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
**2.4 Review (QA)**
|
|
180
|
+
```bash
|
|
181
|
+
node scripts/glue/compose-agent-prompt.cjs \
|
|
182
|
+
--agent qa \
|
|
183
|
+
--mission review \
|
|
184
|
+
--context path/to/expanded.md \
|
|
185
|
+
--context path/to/impl-log.md
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
### Phase 3: Retrospective (PO)
|
|
189
|
+
```bash
|
|
190
|
+
node scripts/glue/compose-agent-prompt.cjs \
|
|
191
|
+
--agent po \
|
|
192
|
+
--mission retrospective \
|
|
193
|
+
--context path/to/accumulated-context.md
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
## Agent Reference
|
|
197
|
+
|
|
198
|
+
### Agent Resolution Priority
|
|
199
|
+
|
|
200
|
+
The glue script resolves agents in this order:
|
|
201
|
+
|
|
202
|
+
1. `.claude/agents/aios-{id}.md` (AIOS core agents)
|
|
203
|
+
2. `.claude/agents/{id}.md` (standalone agents like db-sage)
|
|
204
|
+
3. `squads/{squad}/agents/{id}.md` (squad-specific agents)
|
|
205
|
+
|
|
206
|
+
### AIOS Core Agents
|
|
207
|
+
|
|
208
|
+
| Agent ID | Role | Common Missions |
|
|
209
|
+
|----------|------|-----------------|
|
|
210
|
+
| `dev` | Developer | `develop-story`, `apply-qa-fixes` |
|
|
211
|
+
| `qa` | Quality Assurance | `gate`, `review-story`, `security-scan` |
|
|
212
|
+
| `po` | Product Owner | `validate-story`, `backlog-review` |
|
|
213
|
+
| `sm` | Scrum Master | `create-story`, `expand` |
|
|
214
|
+
| `architect` | Architect | `analyze-impact`, `create-fullstack-arch` |
|
|
215
|
+
| `devops` | DevOps | `commit`, `pre-push`, `create-pr` |
|
|
216
|
+
| `analyst` | Analyst | `market-research`, `competitor-analysis` |
|
|
217
|
+
| `data-engineer` | Data Engineer | `develop-story`, `migration`, `schema-audit` |
|
|
218
|
+
| `ux` | UX Designer | `wireframe`, `audit`, `develop-story` |
|
|
219
|
+
| `pm` | Product Manager | `create-prd`, `create-epic` |
|
|
220
|
+
|
|
221
|
+
### Specialized Squad Agents
|
|
222
|
+
|
|
223
|
+
| Agent ID | Squad | Replaces | Common Missions |
|
|
224
|
+
|----------|-------|----------|-----------------|
|
|
225
|
+
| `db-sage` | db-sage | data-engineer (for DB) | `kiss`, `kiss-schema-check`, `setup` |
|
|
226
|
+
| `brad-frost` | design | — | Uses internal `*command` system |
|
|
227
|
+
| `design-chief` | design | — | Squad orchestration |
|
|
228
|
+
| `cyber-chief` | cybersecurity | — | Security audits |
|
|
229
|
+
|
|
230
|
+
**Note:** Squad agents may use different mission systems. Use `--list-missions` to check available missions for each agent.
|
|
231
|
+
|
|
232
|
+
### Squad Agent Usage
|
|
233
|
+
|
|
234
|
+
```bash
|
|
235
|
+
# db-sage uses Mission Router
|
|
236
|
+
node scripts/glue/compose-agent-prompt.cjs --agent db-sage --mission kiss
|
|
237
|
+
|
|
238
|
+
# brad-frost uses internal command system (load persona only)
|
|
239
|
+
node scripts/glue/compose-agent-prompt.cjs --agent brad-frost --mission audit \
|
|
240
|
+
--extra-instruction "Execute *audit command from your configuration"
|
|
241
|
+
|
|
242
|
+
# Explicit squad specification
|
|
243
|
+
node scripts/glue/compose-agent-prompt.cjs --agent my-agent --squad my-squad --mission task
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
## Prompt Structure
|
|
247
|
+
|
|
248
|
+
The output prompt has the following structure:
|
|
249
|
+
|
|
250
|
+
```markdown
|
|
251
|
+
## Agent Persona
|
|
252
|
+
|
|
253
|
+
[Full agent definition from .aios-core/development/agents/{id}.md]
|
|
254
|
+
|
|
255
|
+
---
|
|
256
|
+
|
|
257
|
+
## Task Workflow: {mission}
|
|
258
|
+
|
|
259
|
+
[Task workflow from .aios-core/development/tasks/{file}.md]
|
|
260
|
+
|
|
261
|
+
---
|
|
262
|
+
|
|
263
|
+
## Checklist: {resource}.md
|
|
264
|
+
|
|
265
|
+
[Checklists specified in Mission Router]
|
|
266
|
+
|
|
267
|
+
---
|
|
268
|
+
|
|
269
|
+
## Context
|
|
270
|
+
|
|
271
|
+
### Context 1: {filename}
|
|
272
|
+
|
|
273
|
+
[File content]
|
|
274
|
+
|
|
275
|
+
### Context 2: {filename}
|
|
276
|
+
|
|
277
|
+
[File content]
|
|
278
|
+
|
|
279
|
+
---
|
|
280
|
+
|
|
281
|
+
## Execution Directive
|
|
282
|
+
|
|
283
|
+
Execute the mission "{mission}" following the task workflow above.
|
|
284
|
+
- Follow ALL steps in the task workflow exactly
|
|
285
|
+
- Use Self-Critique checkpoints if defined in the workflow
|
|
286
|
+
- Output artifacts as specified in the workflow
|
|
287
|
+
- Mark success/failure clearly at the end
|
|
288
|
+
|
|
289
|
+
**Additional Instruction:** {extra-instruction if provided}
|
|
290
|
+
```
|
|
291
|
+
|
|
292
|
+
## Verbose Mode
|
|
293
|
+
|
|
294
|
+
Use `--verbose` to see debug information:
|
|
295
|
+
|
|
296
|
+
```bash
|
|
297
|
+
node scripts/glue/compose-agent-prompt.cjs \
|
|
298
|
+
--agent dev \
|
|
299
|
+
--mission develop \
|
|
300
|
+
--context story.md \
|
|
301
|
+
--verbose
|
|
302
|
+
```
|
|
303
|
+
|
|
304
|
+
Output (to stderr):
|
|
305
|
+
```
|
|
306
|
+
[glue] Agent: dev, Mission: develop, Resolved: develop-story
|
|
307
|
+
[glue] Task file: dev-develop-story.md
|
|
308
|
+
[glue] Extra resources: story-dod-checklist.md, self-critique-checklist.md
|
|
309
|
+
[glue] Loading context: story.md
|
|
310
|
+
|
|
311
|
+
[glue] Prompt stats: 1773 lines, 60117 chars
|
|
312
|
+
[glue] Sections: 6 (persona, task, 2 checklists, 1 contexts, directive)
|
|
313
|
+
```
|
|
314
|
+
|
|
315
|
+
## Troubleshooting
|
|
316
|
+
|
|
317
|
+
### Agent file not found
|
|
318
|
+
```
|
|
319
|
+
Error: Agent file not found: .claude/agents/aios-foo.md
|
|
320
|
+
```
|
|
321
|
+
Check that the agent ID is valid. Use one of: dev, qa, po, sm, architect, devops, analyst, data-engineer, ux, pm.
|
|
322
|
+
|
|
323
|
+
### Mission not found
|
|
324
|
+
```
|
|
325
|
+
## Mission: foo
|
|
326
|
+
No router entry found. Execute mission based on agent expertise.
|
|
327
|
+
```
|
|
328
|
+
Use `--list-missions` to see available missions for the agent.
|
|
329
|
+
|
|
330
|
+
### Context file not found
|
|
331
|
+
```
|
|
332
|
+
### Context 1
|
|
333
|
+
File not found: /path/to/missing.md
|
|
334
|
+
```
|
|
335
|
+
Verify the context file path is correct.
|
|
336
|
+
|
|
337
|
+
## Test Results
|
|
338
|
+
|
|
339
|
+
Pipeline tested with MMOS epic stories:
|
|
340
|
+
|
|
341
|
+
| Story | Phase | Agent | Duration | Result |
|
|
342
|
+
|-------|-------|-------|----------|--------|
|
|
343
|
+
| MMOS-001 | Develop | dev | 227s | ✅ COMPLETED (verified existing impl) |
|
|
344
|
+
| MMOS-002 | Validate | po | 60s | ✅ APPROVED (impl exists) |
|
|
345
|
+
| MMOS-002 | Review | qa | 345s | ✅ APPROVED (38/38 tests pass) |
|
|
346
|
+
|
|
347
|
+
**Key Metrics:**
|
|
348
|
+
- Prompt size: 1500-1850 lines per agent
|
|
349
|
+
- Agent autonomy: 100% (no manual intervention)
|
|
350
|
+
- Test pass rate: 100%
|
|
351
|
+
|
|
352
|
+
---
|
|
353
|
+
|
|
354
|
+
*Created: 2026-02-06*
|
|
355
|
+
*Version: 1.0.0*
|