@jaimevalasek/aioson 1.4.0 → 1.6.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/CHANGELOG.md +31 -1
- package/LICENSE +661 -21
- package/README.md +9 -1
- package/docs/design-previews/aurora-command-ui-website.html +884 -0
- package/docs/design-previews/aurora-command-ui.html +682 -0
- package/docs/design-previews/bold-editorial-ui-website.html +658 -0
- package/docs/design-previews/bold-editorial-ui.html +717 -0
- package/docs/design-previews/clean-saas-ui-website.html +1202 -0
- package/docs/design-previews/clean-saas-ui.html +549 -0
- package/docs/design-previews/cognitive-core-ui-website.html +1009 -0
- package/docs/design-previews/cognitive-core-ui.html +463 -0
- package/docs/design-previews/glassmorphism-ui-website.html +572 -0
- package/docs/design-previews/glassmorphism-ui.html +886 -0
- package/docs/design-previews/index.html +699 -0
- package/docs/design-previews/interface-design-website.html +1187 -0
- package/docs/design-previews/interface-design.html +513 -0
- package/docs/design-previews/neo-brutalist-ui-website.html +621 -0
- package/docs/design-previews/neo-brutalist-ui.html +797 -0
- package/docs/design-previews/premium-command-center-ui-website.html +1217 -0
- package/docs/design-previews/premium-command-center-ui.html +552 -0
- package/docs/design-previews/warm-craft-ui-website.html +684 -0
- package/docs/design-previews/warm-craft-ui.html +739 -0
- package/docs/en/cli-reference.md +20 -9
- package/docs/en/squad-dashboard.md +372 -0
- package/docs/openclaw-bridge.md +308 -0
- package/docs/pt/README.md +7 -0
- package/docs/pt/agent-sharding.md +132 -0
- package/docs/pt/agentes.md +131 -11
- package/docs/pt/busca-de-contexto.md +129 -0
- package/docs/pt/cache-de-contexto.md +156 -0
- package/docs/pt/cenarios.md +46 -2
- package/docs/pt/comandos-cli.md +88 -1
- package/docs/pt/design-hybrid-forge.md +107 -0
- package/docs/pt/inicio-rapido.md +72 -5
- package/docs/pt/inteligencia-adaptativa.md +324 -0
- package/docs/pt/monitor-de-contexto.md +104 -0
- package/docs/pt/recuperacao-de-sessao.md +125 -0
- package/docs/pt/sandbox.md +125 -0
- package/docs/pt/skills.md +98 -6
- package/docs/pt/squad-dashboard.md +373 -0
- package/docs/testing/genome-2.0-matrix.md +5 -5
- package/docs/testing/genome-2.0-rollout.md +9 -9
- package/package.json +2 -2
- package/src/agent-loader.js +280 -0
- package/src/backup-local.js +74 -0
- package/src/cli.js +192 -0
- package/src/commands/agent-loader.js +85 -0
- package/src/commands/backup-local-cmd.js +25 -0
- package/src/commands/context-cache.js +90 -0
- package/src/commands/context-monitor.js +92 -0
- package/src/commands/context-search.js +66 -0
- package/src/commands/design-hybrid-options.js +385 -0
- package/src/commands/health.js +214 -0
- package/src/commands/init.js +54 -13
- package/src/commands/install.js +52 -13
- package/src/commands/learning-evolve.js +355 -0
- package/src/commands/live.js +34 -0
- package/src/commands/recovery.js +43 -0
- package/src/commands/runtime.js +242 -0
- package/src/commands/sandbox.js +37 -0
- package/src/commands/setup-context.js +29 -4
- package/src/commands/setup.js +178 -0
- package/src/commands/skill.js +79 -32
- package/src/commands/squad-daemon.js +209 -0
- package/src/commands/squad-dashboard.js +39 -0
- package/src/commands/squad-deploy.js +64 -0
- package/src/commands/squad-doctor.js +52 -0
- package/src/commands/squad-mcp.js +270 -0
- package/src/commands/squad-processes.js +56 -0
- package/src/commands/squad-recovery.js +42 -0
- package/src/commands/squad-roi.js +291 -0
- package/src/commands/squad-score.js +250 -0
- package/src/commands/squad-status.js +37 -1
- package/src/commands/squad-validate.js +62 -1
- package/src/commands/squad-webhook.js +160 -0
- package/src/commands/squad-worker.js +191 -0
- package/src/commands/squad-worktrees.js +75 -0
- package/src/commands/tool-registry-cmd.js +232 -0
- package/src/commands/update.js +7 -0
- package/src/commands/web-map.js +70 -0
- package/src/commands/web-scrape.js +71 -0
- package/src/constants.js +17 -0
- package/src/context-cache.js +159 -0
- package/src/context-search.js +326 -0
- package/src/context-writer.js +45 -1
- package/src/design-variation-catalog.js +503 -0
- package/src/i18n/messages/en.js +159 -3
- package/src/i18n/messages/es.js +147 -2
- package/src/i18n/messages/fr.js +147 -2
- package/src/i18n/messages/pt-BR.js +158 -3
- package/src/install-animation.js +260 -0
- package/src/install-profile.js +143 -0
- package/src/install-wizard.js +474 -0
- package/src/installer.js +38 -10
- package/src/lib/webhook-server.js +328 -0
- package/src/mcp-connectors/registry.js +602 -0
- package/src/parser.js +7 -1
- package/src/recovery-context-session.js +154 -0
- package/src/runtime-store.js +355 -2
- package/src/sandbox.js +177 -0
- package/src/squad/external-session.js +180 -0
- package/src/squad/inter-squad.js +74 -0
- package/src/squad/recovery-context.js +201 -0
- package/src/squad/worktree-manager.js +114 -0
- package/src/squad-daemon.js +490 -0
- package/src/squad-dashboard/api.js +223 -0
- package/src/squad-dashboard/attachment-handler.js +93 -0
- package/src/squad-dashboard/context-monitor.js +157 -0
- package/src/squad-dashboard/execution-logs.js +115 -0
- package/src/squad-dashboard/hunk-review.js +209 -0
- package/src/squad-dashboard/metrics.js +133 -0
- package/src/squad-dashboard/process-monitor.js +125 -0
- package/src/squad-dashboard/renderer.js +858 -0
- package/src/squad-dashboard/server.js +232 -0
- package/src/squad-dashboard/styles.js +525 -0
- package/src/squad-dashboard/token-tracker.js +99 -0
- package/src/tool-executor.js +94 -0
- package/src/updater.js +11 -3
- package/src/web.js +284 -0
- package/src/worker-runner.js +339 -0
- package/template/.aioson/agents/analyst.md +62 -3
- package/template/.aioson/agents/architect.md +42 -0
- package/template/.aioson/agents/design-hybrid-forge.md +127 -0
- package/template/.aioson/agents/dev.md +223 -11
- package/template/.aioson/agents/deyvin.md +65 -0
- package/template/.aioson/agents/neo.md +152 -0
- package/template/.aioson/agents/orache.md +17 -0
- package/template/.aioson/agents/orchestrator.md +26 -0
- package/template/.aioson/agents/pm.md +58 -0
- package/template/.aioson/agents/product.md +88 -12
- package/template/.aioson/agents/qa.md +80 -0
- package/template/.aioson/agents/setup.md +128 -22
- package/template/.aioson/agents/sheldon.md +704 -0
- package/template/.aioson/agents/squad.md +191 -0
- package/template/.aioson/agents/tester.md +410 -0
- package/template/.aioson/agents/ux-ui.md +12 -0
- package/template/.aioson/config.md +21 -0
- package/template/.aioson/context/forensics/.gitkeep +0 -0
- package/template/.aioson/context/seeds/seed-example.md +27 -0
- package/template/.aioson/context/user-profile.md +42 -0
- package/template/.aioson/locales/en/agents/analyst.md +8 -0
- package/template/.aioson/locales/en/agents/architect.md +8 -0
- package/template/.aioson/locales/en/agents/dev.md +66 -7
- package/template/.aioson/locales/en/agents/deyvin.md +8 -0
- package/template/.aioson/locales/en/agents/neo.md +8 -0
- package/template/.aioson/locales/en/agents/orchestrator.md +26 -0
- package/template/.aioson/locales/en/agents/qa.md +49 -0
- package/template/.aioson/locales/en/agents/setup.md +35 -2
- package/template/.aioson/locales/en/agents/sheldon.md +340 -0
- package/template/.aioson/locales/en/agents/ux-ui.md +8 -0
- package/template/.aioson/locales/es/agents/analyst.md +8 -0
- package/template/.aioson/locales/es/agents/architect.md +8 -0
- package/template/.aioson/locales/es/agents/dev.md +66 -7
- package/template/.aioson/locales/es/agents/deyvin.md +8 -0
- package/template/.aioson/locales/es/agents/neo.md +48 -0
- package/template/.aioson/locales/es/agents/orchestrator.md +26 -0
- package/template/.aioson/locales/es/agents/qa.md +26 -0
- package/template/.aioson/locales/es/agents/setup.md +35 -2
- package/template/.aioson/locales/es/agents/sheldon.md +192 -0
- package/template/.aioson/locales/es/agents/squad.md +63 -0
- package/template/.aioson/locales/es/agents/ux-ui.md +8 -0
- package/template/.aioson/locales/fr/agents/analyst.md +8 -0
- package/template/.aioson/locales/fr/agents/architect.md +8 -0
- package/template/.aioson/locales/fr/agents/dev.md +66 -7
- package/template/.aioson/locales/fr/agents/deyvin.md +8 -0
- package/template/.aioson/locales/fr/agents/neo.md +48 -0
- package/template/.aioson/locales/fr/agents/orchestrator.md +26 -0
- package/template/.aioson/locales/fr/agents/qa.md +26 -0
- package/template/.aioson/locales/fr/agents/setup.md +35 -2
- package/template/.aioson/locales/fr/agents/sheldon.md +192 -0
- package/template/.aioson/locales/fr/agents/squad.md +63 -0
- package/template/.aioson/locales/fr/agents/ux-ui.md +8 -0
- package/template/.aioson/locales/pt-BR/agents/analyst.md +19 -0
- package/template/.aioson/locales/pt-BR/agents/architect.md +19 -0
- package/template/.aioson/locales/pt-BR/agents/dev.md +75 -12
- package/template/.aioson/locales/pt-BR/agents/deyvin.md +8 -0
- package/template/.aioson/locales/pt-BR/agents/neo.md +147 -0
- package/template/.aioson/locales/pt-BR/agents/orchestrator.md +26 -0
- package/template/.aioson/locales/pt-BR/agents/product.md +8 -3
- package/template/.aioson/locales/pt-BR/agents/qa.md +60 -0
- package/template/.aioson/locales/pt-BR/agents/setup.md +35 -2
- package/template/.aioson/locales/pt-BR/agents/sheldon.md +192 -0
- package/template/.aioson/locales/pt-BR/agents/squad.md +105 -0
- package/template/.aioson/locales/pt-BR/agents/ux-ui.md +8 -0
- package/template/.aioson/schemas/squad-blueprint.schema.json +21 -0
- package/template/.aioson/schemas/squad-manifest.schema.json +178 -1
- package/template/.aioson/skills/design/aurora-command-ui/SKILL.md +243 -0
- package/template/.aioson/skills/design/aurora-command-ui/references/art-direction.md +293 -0
- package/template/.aioson/skills/design/aurora-command-ui/references/components.md +827 -0
- package/template/.aioson/skills/design/aurora-command-ui/references/dashboards.md +250 -0
- package/template/.aioson/skills/design/aurora-command-ui/references/design-tokens.md +585 -0
- package/template/.aioson/skills/design/aurora-command-ui/references/motion.md +365 -0
- package/template/.aioson/skills/design/aurora-command-ui/references/patterns.md +482 -0
- package/template/.aioson/skills/design/aurora-command-ui/references/websites.md +387 -0
- package/template/.aioson/skills/design/bold-editorial-ui/SKILL.md +205 -0
- package/template/.aioson/skills/design/bold-editorial-ui/references/art-direction.md +338 -0
- package/template/.aioson/skills/design/bold-editorial-ui/references/components.md +977 -0
- package/template/.aioson/skills/design/bold-editorial-ui/references/dashboards.md +218 -0
- package/template/.aioson/skills/design/bold-editorial-ui/references/design-tokens.md +326 -0
- package/template/.aioson/skills/design/bold-editorial-ui/references/motion.md +461 -0
- package/template/.aioson/skills/design/bold-editorial-ui/references/patterns.md +293 -0
- package/template/.aioson/skills/design/bold-editorial-ui/references/websites.md +352 -0
- package/template/.aioson/skills/design/clean-saas-ui/SKILL.md +210 -0
- package/template/.aioson/skills/design/clean-saas-ui/references/art-direction.md +319 -0
- package/template/.aioson/skills/design/clean-saas-ui/references/components.md +365 -0
- package/template/.aioson/skills/design/clean-saas-ui/references/dashboards.md +196 -0
- package/template/.aioson/skills/design/clean-saas-ui/references/design-tokens.md +244 -0
- package/template/.aioson/skills/design/clean-saas-ui/references/motion.md +235 -0
- package/template/.aioson/skills/design/clean-saas-ui/references/patterns.md +215 -0
- package/template/.aioson/skills/design/clean-saas-ui/references/websites.md +295 -0
- package/template/.aioson/skills/design/cognitive-core-ui/SKILL.md +55 -9
- package/template/.aioson/skills/design/cognitive-core-ui/references/art-direction.md +339 -0
- package/template/.aioson/skills/design/cognitive-core-ui/references/components.md +1 -1
- package/template/.aioson/skills/design/cognitive-core-ui/references/dashboards.md +100 -0
- package/template/.aioson/skills/design/cognitive-core-ui/references/design-tokens.md +43 -9
- package/template/.aioson/skills/design/cognitive-core-ui/references/motion.md +40 -0
- package/template/.aioson/skills/design/cognitive-core-ui/references/patterns.md +1 -1
- package/template/.aioson/skills/design/cognitive-core-ui/references/websites.md +99 -12
- package/template/.aioson/skills/design/glassmorphism-ui/SKILL.md +222 -0
- package/template/.aioson/skills/design/glassmorphism-ui/references/art-direction.md +159 -0
- package/template/.aioson/skills/design/glassmorphism-ui/references/components.md +498 -0
- package/template/.aioson/skills/design/glassmorphism-ui/references/dashboards.md +236 -0
- package/template/.aioson/skills/design/glassmorphism-ui/references/design-tokens.md +274 -0
- package/template/.aioson/skills/design/glassmorphism-ui/references/motion.md +355 -0
- package/template/.aioson/skills/design/glassmorphism-ui/references/patterns.md +198 -0
- package/template/.aioson/skills/design/glassmorphism-ui/references/websites.md +307 -0
- package/template/.aioson/skills/design/neo-brutalist-ui/SKILL.md +213 -0
- package/template/.aioson/skills/design/neo-brutalist-ui/references/art-direction.md +228 -0
- package/template/.aioson/skills/design/neo-brutalist-ui/references/components.md +855 -0
- package/template/.aioson/skills/design/neo-brutalist-ui/references/dashboards.md +334 -0
- package/template/.aioson/skills/design/neo-brutalist-ui/references/design-tokens.md +342 -0
- package/template/.aioson/skills/design/neo-brutalist-ui/references/motion.md +286 -0
- package/template/.aioson/skills/design/neo-brutalist-ui/references/patterns.md +458 -0
- package/template/.aioson/skills/design/neo-brutalist-ui/references/websites.md +723 -0
- package/template/.aioson/skills/design/warm-craft-ui/SKILL.md +209 -0
- package/template/.aioson/skills/design/warm-craft-ui/references/art-direction.md +324 -0
- package/template/.aioson/skills/design/warm-craft-ui/references/components.md +508 -0
- package/template/.aioson/skills/design/warm-craft-ui/references/dashboards.md +223 -0
- package/template/.aioson/skills/design/warm-craft-ui/references/design-tokens.md +374 -0
- package/template/.aioson/skills/design/warm-craft-ui/references/motion.md +356 -0
- package/template/.aioson/skills/design/warm-craft-ui/references/patterns.md +288 -0
- package/template/.aioson/skills/design/warm-craft-ui/references/websites.md +289 -0
- package/template/.aioson/skills/premium-visual-design/SKILL.md +83 -0
- package/template/.aioson/skills/premium-visual-design/components/agent-badge.md +92 -0
- package/template/.aioson/skills/premium-visual-design/components/dependency-node.md +102 -0
- package/template/.aioson/skills/premium-visual-design/components/mention-autocomplete.md +136 -0
- package/template/.aioson/skills/premium-visual-design/components/notification-center.md +136 -0
- package/template/.aioson/skills/premium-visual-design/components/review-action-bar.md +188 -0
- package/template/.aioson/skills/premium-visual-design/components/team-switcher.md +131 -0
- package/template/.aioson/skills/premium-visual-design/patterns/agent-message-thread.md +198 -0
- package/template/.aioson/skills/premium-visual-design/patterns/notification-panel.md +275 -0
- package/template/.aioson/skills/premium-visual-design/patterns/review-workflow-ui.md +234 -0
- package/template/.aioson/skills/premium-visual-design/patterns/task-dependency-graph.md +147 -0
- package/template/.aioson/skills/premium-visual-design/tokens/status-extended.md +142 -0
- package/template/.aioson/skills/process/aioson-spec-driven/SKILL.md +45 -0
- package/template/.aioson/skills/process/aioson-spec-driven/references/approval-gates.md +109 -0
- package/template/.aioson/skills/process/aioson-spec-driven/references/artifact-map.md +44 -0
- package/template/.aioson/skills/process/aioson-spec-driven/references/classification-map.md +37 -0
- package/template/.aioson/skills/process/aioson-spec-driven/references/hardening-lane.md +49 -0
- package/template/.aioson/skills/process/aioson-spec-driven/references/maintenance-and-state.md +66 -0
- package/template/.aioson/skills/process/aioson-spec-driven/references/ui-language.md +75 -0
- package/template/.aioson/skills/process/design-hybrid-forge/SKILL.md +144 -0
- package/template/.aioson/skills/process/design-hybrid-forge/references/crossover-protocol.md +221 -0
- package/template/.aioson/skills/process/design-hybrid-forge/references/naming-registry.md +88 -0
- package/template/.aioson/skills/process/design-hybrid-forge/references/output-contract.md +291 -0
- package/template/.aioson/skills/process/design-hybrid-forge/references/pair-compatibility.md +117 -0
- package/template/.aioson/skills/process/design-hybrid-forge/references/quality-gates.md +188 -0
- package/template/.aioson/skills/process/design-hybrid-forge/references/variation-library.md +125 -0
- package/template/.aioson/skills/squad/formats/catalog.json +15 -0
- package/template/.aioson/skills/squad/formats/content/blog-post.md +47 -0
- package/template/.aioson/skills/squad/formats/content/newsletter.md +47 -0
- package/template/.aioson/skills/squad/formats/creative/podcast-script.md +43 -0
- package/template/.aioson/skills/squad/formats/creative/video-script.md +41 -0
- package/template/.aioson/skills/squad/formats/social/instagram-feed.md +42 -0
- package/template/.aioson/skills/squad/formats/social/linkedin-post.md +42 -0
- package/template/.aioson/skills/squad/formats/social/tiktok.md +39 -0
- package/template/.aioson/skills/squad/formats/social/twitter-thread.md +39 -0
- package/template/.aioson/skills/squad/formats/social/youtube-long.md +47 -0
- package/template/.aioson/skills/squad/formats/social/youtube-shorts.md +39 -0
- package/template/.aioson/skills/squad/patterns/multi-platform-pattern.md +108 -0
- package/template/.aioson/skills/squad/patterns/persona-based-pattern.md +98 -0
- package/template/.aioson/skills/squad/patterns/pipeline-pattern.md +106 -0
- package/template/.aioson/skills/squad/patterns/review-loop-pattern.md +81 -0
- package/template/.aioson/skills/squad/references/checklist-templates.md +122 -0
- package/template/.aioson/skills/squad/references/executor-archetypes.md +123 -0
- package/template/.aioson/skills/squad/references/workflow-templates.md +169 -0
- package/template/.aioson/skills/static/debugging-protocol.md +42 -0
- package/template/.aioson/skills/static/git-worktrees.md +36 -0
- package/template/.aioson/tasks/implementation-plan.md +19 -0
- package/template/.aioson/tasks/squad-design.md +28 -0
- package/template/.aioson/tasks/squad-profile.md +48 -0
- package/template/.aioson/tasks/squad-review.md +61 -0
- package/template/.aioson/tasks/squad-task-decompose.md +66 -0
- package/template/.claude/commands/aioson/agent/neo.md +5 -0
- package/template/.claude/commands/aioson/agent/tester.md +5 -0
- package/template/.gemini/GEMINI.md +1 -0
- package/template/.gemini/commands/aios-neo.toml +4 -0
- package/template/.gemini/commands/aios-tester.toml +6 -0
- package/template/AGENTS.md +26 -1
- package/template/CLAUDE.md +6 -2
- package/template/OPENCODE.md +2 -0
|
@@ -0,0 +1,339 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const fs = require('node:fs/promises');
|
|
4
|
+
const path = require('node:path');
|
|
5
|
+
const { spawn } = require('node:child_process');
|
|
6
|
+
|
|
7
|
+
const SQUADS_DIR = path.join('.aioson', 'squads');
|
|
8
|
+
const DEFAULT_TIMEOUT = 30000;
|
|
9
|
+
const DEFAULT_RETRY_ATTEMPTS = 3;
|
|
10
|
+
const BACKOFF_BASE = [1000, 3000, 8000];
|
|
11
|
+
|
|
12
|
+
async function pathExists(targetPath) {
|
|
13
|
+
try {
|
|
14
|
+
await fs.access(targetPath);
|
|
15
|
+
return true;
|
|
16
|
+
} catch {
|
|
17
|
+
return false;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
async function loadWorkerConfig(projectDir, squadSlug, workerSlug) {
|
|
22
|
+
const configPath = path.join(projectDir, SQUADS_DIR, squadSlug, 'workers', workerSlug, 'worker.json');
|
|
23
|
+
if (!(await pathExists(configPath))) return null;
|
|
24
|
+
const raw = await fs.readFile(configPath, 'utf8');
|
|
25
|
+
return JSON.parse(raw);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
async function listWorkers(projectDir, squadSlug) {
|
|
29
|
+
const workersDir = path.join(projectDir, SQUADS_DIR, squadSlug, 'workers');
|
|
30
|
+
let entries;
|
|
31
|
+
try {
|
|
32
|
+
entries = await fs.readdir(workersDir, { withFileTypes: true });
|
|
33
|
+
} catch {
|
|
34
|
+
return [];
|
|
35
|
+
}
|
|
36
|
+
const workers = [];
|
|
37
|
+
for (const entry of entries) {
|
|
38
|
+
if (!entry.isDirectory()) continue;
|
|
39
|
+
const config = await loadWorkerConfig(projectDir, squadSlug, entry.name);
|
|
40
|
+
if (config) {
|
|
41
|
+
workers.push({ slug: entry.name, ...config });
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
return workers;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function resolveScript(projectDir, squadSlug, workerSlug) {
|
|
48
|
+
const base = path.join(projectDir, SQUADS_DIR, squadSlug, 'workers', workerSlug);
|
|
49
|
+
return {
|
|
50
|
+
js: path.join(base, 'run.js'),
|
|
51
|
+
py: path.join(base, 'run.py')
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
function validateInputs(inputPayload, inputSchema) {
|
|
56
|
+
if (!inputSchema) return { valid: true, errors: [] };
|
|
57
|
+
const errors = [];
|
|
58
|
+
for (const [key, spec] of Object.entries(inputSchema)) {
|
|
59
|
+
if (spec.required && (inputPayload[key] === undefined || inputPayload[key] === null)) {
|
|
60
|
+
errors.push(`Missing required input: ${key}`);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
return { valid: errors.length === 0, errors };
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
function spawnWorker(scriptPath, inputPayload, env, timeoutMs) {
|
|
67
|
+
return new Promise((resolve, reject) => {
|
|
68
|
+
const ext = path.extname(scriptPath);
|
|
69
|
+
const cmd = ext === '.py' ? 'python3' : 'node';
|
|
70
|
+
const args = [scriptPath, JSON.stringify(inputPayload)];
|
|
71
|
+
const child = spawn(cmd, args, {
|
|
72
|
+
env: { ...process.env, ...env },
|
|
73
|
+
stdio: ['ignore', 'pipe', 'pipe'],
|
|
74
|
+
timeout: timeoutMs
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
let stdout = '';
|
|
78
|
+
let stderr = '';
|
|
79
|
+
child.stdout.on('data', (chunk) => { stdout += chunk; });
|
|
80
|
+
child.stderr.on('data', (chunk) => { stderr += chunk; });
|
|
81
|
+
|
|
82
|
+
child.on('close', (code) => {
|
|
83
|
+
if (code === 0) {
|
|
84
|
+
let output;
|
|
85
|
+
try {
|
|
86
|
+
output = JSON.parse(stdout);
|
|
87
|
+
} catch {
|
|
88
|
+
output = { raw: stdout.trim() };
|
|
89
|
+
}
|
|
90
|
+
resolve({ ok: true, output, stderr: stderr.trim() || null });
|
|
91
|
+
} else {
|
|
92
|
+
let errorDetail;
|
|
93
|
+
try {
|
|
94
|
+
errorDetail = JSON.parse(stderr);
|
|
95
|
+
} catch {
|
|
96
|
+
errorDetail = { message: stderr.trim() || `Process exited with code ${code}` };
|
|
97
|
+
}
|
|
98
|
+
resolve({ ok: false, error: errorDetail.error || errorDetail.message || String(errorDetail), code });
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
child.on('error', (err) => {
|
|
103
|
+
if (err.code === 'ETIMEDOUT' || err.killed) {
|
|
104
|
+
resolve({ ok: false, error: `Worker timed out after ${timeoutMs}ms`, code: -1 });
|
|
105
|
+
} else {
|
|
106
|
+
reject(err);
|
|
107
|
+
}
|
|
108
|
+
});
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
function resolveEnvVars(envKeys) {
|
|
113
|
+
const resolved = {};
|
|
114
|
+
for (const key of (envKeys || [])) {
|
|
115
|
+
if (process.env[key]) {
|
|
116
|
+
resolved[key] = process.env[key];
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
return resolved;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
function sleep(ms) {
|
|
123
|
+
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
async function runWorker(projectDir, squadSlug, workerSlug, inputPayload, options = {}) {
|
|
127
|
+
const config = await loadWorkerConfig(projectDir, squadSlug, workerSlug);
|
|
128
|
+
if (!config) {
|
|
129
|
+
return { ok: false, error: `Worker config not found: ${workerSlug}`, attempts: 0 };
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
// Validate inputs
|
|
133
|
+
const validation = validateInputs(inputPayload || {}, config.inputs);
|
|
134
|
+
if (!validation.valid) {
|
|
135
|
+
return { ok: false, error: `Input validation failed: ${validation.errors.join(', ')}`, attempts: 0 };
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
// Resolve script path
|
|
139
|
+
const scripts = resolveScript(projectDir, squadSlug, workerSlug);
|
|
140
|
+
let scriptPath;
|
|
141
|
+
if (await pathExists(scripts.js)) {
|
|
142
|
+
scriptPath = scripts.js;
|
|
143
|
+
} else if (await pathExists(scripts.py)) {
|
|
144
|
+
scriptPath = scripts.py;
|
|
145
|
+
} else {
|
|
146
|
+
return { ok: false, error: `No run script found for worker: ${workerSlug}`, attempts: 0 };
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
// Resolve env vars
|
|
150
|
+
const env = resolveEnvVars(config.env);
|
|
151
|
+
|
|
152
|
+
// Resolve MCP env vars if worker declares uses_mcp
|
|
153
|
+
if (config.uses_mcp && config.uses_mcp.length > 0) {
|
|
154
|
+
try {
|
|
155
|
+
const { listIntegrations, buildWorkerMcpEnv } = require('./mcp-connectors/registry');
|
|
156
|
+
const integrations = await listIntegrations(projectDir, squadSlug);
|
|
157
|
+
const mcpEnv = buildWorkerMcpEnv(projectDir, squadSlug, config.uses_mcp, integrations);
|
|
158
|
+
Object.assign(env, mcpEnv);
|
|
159
|
+
} catch { /* MCP resolution optional — fail silently */ }
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
// Timeout and retry config
|
|
163
|
+
const timeoutMs = config.timeout_ms || DEFAULT_TIMEOUT;
|
|
164
|
+
const maxAttempts = (config.retry && config.retry.attempts) || (options.noRetry ? 1 : DEFAULT_RETRY_ATTEMPTS);
|
|
165
|
+
const triggerType = options.triggerType || 'manual';
|
|
166
|
+
|
|
167
|
+
let lastResult;
|
|
168
|
+
const startTime = Date.now();
|
|
169
|
+
|
|
170
|
+
for (let attempt = 1; attempt <= maxAttempts; attempt++) {
|
|
171
|
+
lastResult = await spawnWorker(scriptPath, inputPayload || {}, env, timeoutMs);
|
|
172
|
+
lastResult.attempt = attempt;
|
|
173
|
+
lastResult.triggerType = triggerType;
|
|
174
|
+
|
|
175
|
+
if (lastResult.ok) {
|
|
176
|
+
lastResult.durationMs = Date.now() - startTime;
|
|
177
|
+
return lastResult;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
// Backoff before retry
|
|
181
|
+
if (attempt < maxAttempts) {
|
|
182
|
+
const delay = BACKOFF_BASE[attempt - 1] || BACKOFF_BASE[BACKOFF_BASE.length - 1];
|
|
183
|
+
await sleep(delay);
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
lastResult.durationMs = Date.now() - startTime;
|
|
188
|
+
return lastResult;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
// --- Scaffold generation ---
|
|
192
|
+
|
|
193
|
+
function generateWorkerJson(slug, name, triggerType, inputFields, outputFields, envVars) {
|
|
194
|
+
const trigger = { type: triggerType || 'manual' };
|
|
195
|
+
if (triggerType === 'event') {
|
|
196
|
+
trigger.source = 'content_item_created';
|
|
197
|
+
trigger.filter = {};
|
|
198
|
+
}
|
|
199
|
+
if (triggerType === 'scheduled') {
|
|
200
|
+
trigger.cron = '0 8 * * *';
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
const inputs = {};
|
|
204
|
+
for (const field of (inputFields || [])) {
|
|
205
|
+
inputs[field] = { type: 'string', required: true };
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
const outputs = {};
|
|
209
|
+
for (const field of (outputFields || [])) {
|
|
210
|
+
outputs[field] = { type: 'string' };
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
return {
|
|
214
|
+
slug,
|
|
215
|
+
name: name || slug,
|
|
216
|
+
type: triggerType || 'manual',
|
|
217
|
+
trigger,
|
|
218
|
+
inputs,
|
|
219
|
+
outputs,
|
|
220
|
+
env: envVars || [],
|
|
221
|
+
timeout_ms: 30000,
|
|
222
|
+
retry: { attempts: 3, backoff: 'exponential' }
|
|
223
|
+
};
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
function generateRunJs(slug, config) {
|
|
227
|
+
const inputParsing = Object.keys(config.inputs || {}).length > 0
|
|
228
|
+
? Object.keys(config.inputs).map(k => ` // input.${k}`).join('\n')
|
|
229
|
+
: ' // No inputs defined';
|
|
230
|
+
|
|
231
|
+
const outputReturn = Object.keys(config.outputs || {}).length > 0
|
|
232
|
+
? ' ' + Object.keys(config.outputs).map(k => `${k}: null`).join(',\n ')
|
|
233
|
+
: ' result: "ok"';
|
|
234
|
+
|
|
235
|
+
return `#!/usr/bin/env node
|
|
236
|
+
'use strict';
|
|
237
|
+
|
|
238
|
+
// Worker: ${slug}
|
|
239
|
+
// Trigger: ${config.type || 'manual'}
|
|
240
|
+
// Generated by aioson squad:create
|
|
241
|
+
|
|
242
|
+
const input = JSON.parse(process.argv[2] || '{}');
|
|
243
|
+
|
|
244
|
+
async function execute(input) {
|
|
245
|
+
// Available inputs:
|
|
246
|
+
${inputParsing}
|
|
247
|
+
|
|
248
|
+
// TODO: Implement worker logic here
|
|
249
|
+
// Examples:
|
|
250
|
+
// - Send WhatsApp message via Business API
|
|
251
|
+
// - Call external REST API
|
|
252
|
+
// - Calculate metrics and save to squad_metrics
|
|
253
|
+
// - Move a lead in CRM
|
|
254
|
+
// - Send email via SMTP
|
|
255
|
+
|
|
256
|
+
return {
|
|
257
|
+
${outputReturn}
|
|
258
|
+
};
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
execute(input)
|
|
262
|
+
.then(result => {
|
|
263
|
+
process.stdout.write(JSON.stringify(result));
|
|
264
|
+
process.exit(0);
|
|
265
|
+
})
|
|
266
|
+
.catch(err => {
|
|
267
|
+
process.stderr.write(JSON.stringify({ error: err.message }));
|
|
268
|
+
process.exit(1);
|
|
269
|
+
});
|
|
270
|
+
`;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
function generateWorkerReadme(slug, config) {
|
|
274
|
+
const envSection = (config.env || []).length > 0
|
|
275
|
+
? config.env.map(e => `- \`${e}\``).join('\n')
|
|
276
|
+
: '- None';
|
|
277
|
+
|
|
278
|
+
return `# Worker: ${config.name || slug}
|
|
279
|
+
|
|
280
|
+
## Trigger
|
|
281
|
+
- **Type**: ${config.type || 'manual'}
|
|
282
|
+
${config.trigger && config.trigger.cron ? `- **Cron**: \`${config.trigger.cron}\`` : ''}
|
|
283
|
+
${config.trigger && config.trigger.source ? `- **Source**: ${config.trigger.source}` : ''}
|
|
284
|
+
|
|
285
|
+
## Inputs
|
|
286
|
+
${Object.entries(config.inputs || {}).map(([k, v]) => `- \`${k}\` (${v.type})${v.required ? ' *required*' : ''}`).join('\n') || '- None'}
|
|
287
|
+
|
|
288
|
+
## Outputs
|
|
289
|
+
${Object.entries(config.outputs || {}).map(([k, v]) => `- \`${k}\` (${v.type})`).join('\n') || '- None'}
|
|
290
|
+
|
|
291
|
+
## Environment Variables
|
|
292
|
+
${envSection}
|
|
293
|
+
|
|
294
|
+
## Usage
|
|
295
|
+
|
|
296
|
+
\`\`\`bash
|
|
297
|
+
# Run manually
|
|
298
|
+
aioson squad:worker --squad=<squad-slug> --worker=${slug} --input='{"key": "value"}'
|
|
299
|
+
|
|
300
|
+
# Test with dry run
|
|
301
|
+
aioson squad:worker --squad=<squad-slug> --worker=${slug} --sub=test
|
|
302
|
+
|
|
303
|
+
# View execution logs
|
|
304
|
+
aioson squad:worker --squad=<squad-slug> --sub=logs
|
|
305
|
+
\`\`\`
|
|
306
|
+
`;
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
async function scaffoldWorker(projectDir, squadSlug, workerSlug, options = {}) {
|
|
310
|
+
const workerDir = path.join(projectDir, SQUADS_DIR, squadSlug, 'workers', workerSlug);
|
|
311
|
+
await fs.mkdir(workerDir, { recursive: true });
|
|
312
|
+
|
|
313
|
+
const config = generateWorkerJson(
|
|
314
|
+
workerSlug,
|
|
315
|
+
options.name,
|
|
316
|
+
options.triggerType,
|
|
317
|
+
options.inputs,
|
|
318
|
+
options.outputs,
|
|
319
|
+
options.env
|
|
320
|
+
);
|
|
321
|
+
|
|
322
|
+
await fs.writeFile(path.join(workerDir, 'worker.json'), JSON.stringify(config, null, 2));
|
|
323
|
+
await fs.writeFile(path.join(workerDir, 'run.js'), generateRunJs(workerSlug, config));
|
|
324
|
+
await fs.writeFile(path.join(workerDir, 'README.md'), generateWorkerReadme(workerSlug, config));
|
|
325
|
+
|
|
326
|
+
return { workerDir, config };
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
module.exports = {
|
|
330
|
+
loadWorkerConfig,
|
|
331
|
+
listWorkers,
|
|
332
|
+
runWorker,
|
|
333
|
+
scaffoldWorker,
|
|
334
|
+
generateWorkerJson,
|
|
335
|
+
generateRunJs,
|
|
336
|
+
generateWorkerReadme,
|
|
337
|
+
validateInputs,
|
|
338
|
+
resolveEnvVars
|
|
339
|
+
};
|
|
@@ -40,6 +40,25 @@ Check the following before doing anything else:
|
|
|
40
40
|
- `.aioson/context/design-doc.md` + `readiness.md` (if present)
|
|
41
41
|
- `.aioson/context/discovery.md` + `spec.md` (feature mode — project context, if present)
|
|
42
42
|
|
|
43
|
+
## Context loading policy
|
|
44
|
+
|
|
45
|
+
**Sempre carregar:**
|
|
46
|
+
- `.aioson/context/project.context.md`
|
|
47
|
+
- `prd*.md` ou `prd-{slug}.md` relevante
|
|
48
|
+
- `sheldon-enrichment-{slug}.md` (se existir)
|
|
49
|
+
|
|
50
|
+
**Carregar só se relevante ao scope:**
|
|
51
|
+
- `architecture.md` (brownfield apenas)
|
|
52
|
+
- skills do domínio atual
|
|
53
|
+
|
|
54
|
+
**Nunca carregar:**
|
|
55
|
+
- Arquivos de implementação (src/, routes/, etc.)
|
|
56
|
+
- Specs de features não relacionadas
|
|
57
|
+
|
|
58
|
+
## Disk-first principle
|
|
59
|
+
|
|
60
|
+
Escreva `discovery.md` ou `requirements-{slug}.md` no disco antes de retornar qualquer resposta ao usuário. Se a sessão cair no meio do trabalho, os artefatos escritos são recuperáveis — análises apenas na conversa são perdidas. Para cada fase significativa: execute, escreva o artefato, então responda.
|
|
61
|
+
|
|
43
62
|
## Context integrity
|
|
44
63
|
|
|
45
64
|
Read `project.context.md` before starting discovery.
|
|
@@ -91,6 +110,8 @@ Before deepening discovery:
|
|
|
91
110
|
- use `readiness.md` to avoid unnecessary rediscovery
|
|
92
111
|
- load only the docs that actually matter for this batch
|
|
93
112
|
- consult local skills only when they improve domain mapping or flow clarity
|
|
113
|
+
- check `.aioson/installed-skills/` for any installed skill relevant to the current discovery scope — load `SKILL.md` of matching skills, then load per-agent references only if they reduce ambiguity for the current phase
|
|
114
|
+
- if `aioson-spec-driven` is installed (`.aioson/installed-skills/aioson-spec-driven/SKILL.md` exists), load it when starting feature discovery or project discovery — then load `references/analyst.md` from that skill
|
|
94
115
|
|
|
95
116
|
Do not inflate context without need.
|
|
96
117
|
|
|
@@ -175,8 +196,15 @@ For each new or modified entity, produce field-level detail (same format as Phas
|
|
|
175
196
|
4. Relationships (with existing entities from discovery.md)
|
|
176
197
|
5. Migration additions (ordered)
|
|
177
198
|
6. Business rules
|
|
178
|
-
|
|
179
|
-
|
|
199
|
+
- Use format: `REQ-{slug}-{N}` for each rule (e.g., `REQ-checkout-01`)
|
|
200
|
+
- Each rule must state: condition + expected behavior + who can trigger it
|
|
201
|
+
7. Acceptance criteria
|
|
202
|
+
- Use format: `AC-{slug}-{N}` (e.g., `AC-checkout-01`)
|
|
203
|
+
- Each AC must be independently verifiable by QA without implementation knowledge
|
|
204
|
+
8. Edge cases and failure modes
|
|
205
|
+
- Cover: invalid input, empty states, concurrent operations, external service failure
|
|
206
|
+
9. Out of scope for this feature
|
|
207
|
+
- Be explicit — list what was deliberately excluded and why
|
|
180
208
|
|
|
181
209
|
**`spec-{slug}.md`** — feature memory skeleton (will be enriched by @dev):
|
|
182
210
|
|
|
@@ -185,6 +213,12 @@ For each new or modified entity, produce field-level detail (same format as Phas
|
|
|
185
213
|
feature: {slug}
|
|
186
214
|
status: in_progress
|
|
187
215
|
started: {ISO-date}
|
|
216
|
+
phase_gates:
|
|
217
|
+
requirements: approved # approved | pending | needs_work
|
|
218
|
+
design: pending # approved | pending | skipped (MICRO/SMALL sem @architect)
|
|
219
|
+
plan: pending # approved | pending | skipped (MICRO sem implementation-plan)
|
|
220
|
+
last_checkpoint: null # filled by @dev after each completed phase
|
|
221
|
+
pending_review: [] # items that need human review before next phase
|
|
188
222
|
---
|
|
189
223
|
|
|
190
224
|
# Spec — {Feature Name}
|
|
@@ -209,7 +243,19 @@ started: {ISO-date}
|
|
|
209
243
|
[Anything @dev or @qa should know before touching this feature]
|
|
210
244
|
```
|
|
211
245
|
|
|
212
|
-
After producing both files,
|
|
246
|
+
After producing both files, use `AskUserQuestion` with `multiSelect: true` to confirm which requirements are approved:
|
|
247
|
+
|
|
248
|
+
```
|
|
249
|
+
AskUserQuestion:
|
|
250
|
+
question: "Quais requirements estão aprovados para prosseguir?"
|
|
251
|
+
multiSelect: true
|
|
252
|
+
options:
|
|
253
|
+
- label: "REQ-{slug}-01: [título]"
|
|
254
|
+
- label: "REQ-{slug}-02: [título]"
|
|
255
|
+
- label: "Todos aprovados"
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
Then tell the user: "Feature spec ready. Activate **@dev** to implement — it will read `prd-{slug}.md`, `requirements-{slug}.md`, and `spec-{slug}.md`."
|
|
213
259
|
|
|
214
260
|
## MICRO shortcut
|
|
215
261
|
If classification is MICRO (score 0–1) or the user describes a clearly single-entity project with no integrations, adapt the process:
|
|
@@ -226,6 +272,9 @@ The `@analyst` owns all technical and structural content: requirements, entities
|
|
|
226
272
|
Copy, interface text, onboarding messages, and marketing content are not within `@analyst` scope.
|
|
227
273
|
|
|
228
274
|
## Output contract
|
|
275
|
+
|
|
276
|
+
> **CRITICAL — FILE WRITE RULE:** Every artifact listed below MUST be written to disk using the Write tool before this agent session ends. Generating content as chat text is NOT sufficient. Always write the file, then confirm it was saved with: `✅ discovery.md written — @architect can proceed.`
|
|
277
|
+
|
|
229
278
|
Generate `.aioson/context/discovery.md` with the following sections:
|
|
230
279
|
|
|
231
280
|
1. **What we are building** — 2–3 objective lines
|
|
@@ -249,4 +298,14 @@ Generate `.aioson/context/discovery.md` with the following sections:
|
|
|
249
298
|
- Do not finalize any output file with missing or assumed fields.
|
|
250
299
|
- In feature mode: never duplicate content already in `discovery.md` — only document what is new or changed.
|
|
251
300
|
- If `readiness.md` already says the context is sufficiently clear, do not reopen broad discovery without a good reason.
|
|
301
|
+
- At session end, after writing the discovery file, register the session: `aioson agent:done . --agent=analyst --summary="<one-line summary of discovery produced>" 2>/dev/null || true`
|
|
252
302
|
- If `aioson` CLI is not available, write a devlog at session end following the "Devlog" section in `.aioson/config.md`.
|
|
303
|
+
|
|
304
|
+
---
|
|
305
|
+
## ▶ Próximo passo
|
|
306
|
+
**[@architect ou @dev]** — [SMALL/MEDIUM: @architect para decisões técnicas | MICRO: @dev direto]
|
|
307
|
+
Ative: `/architect` ou `/dev`
|
|
308
|
+
> Recomendado: `/clear` antes — janela de contexto fresca
|
|
309
|
+
|
|
310
|
+
Também disponível: `/sheldon` (enriquecimento adicional), `/qa` (revisão dos requisitos)
|
|
311
|
+
---
|
|
@@ -25,6 +25,24 @@ These directories are **optional**. Check silently — if a directory is absent
|
|
|
25
25
|
- `.aioson/context/readiness.md` (if present)
|
|
26
26
|
- `.aioson/context/discovery.md`
|
|
27
27
|
|
|
28
|
+
## Context loading policy
|
|
29
|
+
|
|
30
|
+
**Sempre carregar:**
|
|
31
|
+
- `.aioson/context/project.context.md`
|
|
32
|
+
- `.aioson/context/discovery.md`
|
|
33
|
+
|
|
34
|
+
**Carregar só se presente:**
|
|
35
|
+
- `design-doc.md`, `readiness.md`
|
|
36
|
+
- `sheldon-enrichment-{slug}.md` (se houver fase de enriquecimento)
|
|
37
|
+
|
|
38
|
+
**Nunca carregar:**
|
|
39
|
+
- Arquivos de implementação (src/, routes/, etc.)
|
|
40
|
+
- Specs de features não relacionadas ao escopo atual
|
|
41
|
+
|
|
42
|
+
## Disk-first principle
|
|
43
|
+
|
|
44
|
+
Escreva `architecture.md` no disco antes de retornar qualquer resposta ao usuário. Se a sessão cair, o artefato escrito é recuperável — análises apenas na conversa são perdidas. Execute a análise, escreva o arquivo, então responda ao usuário com o resumo.
|
|
45
|
+
|
|
28
46
|
## Brownfield memory handoff
|
|
29
47
|
|
|
30
48
|
For existing codebases:
|
|
@@ -35,6 +53,15 @@ For existing codebases:
|
|
|
35
53
|
- If `discovery.md` is missing but local scan artifacts exist, do not architect directly from the raw scan maps. Route through `@analyst` first.
|
|
36
54
|
- If neither `discovery.md` nor local scan artifacts exist, ask for the local scanner before continuing.
|
|
37
55
|
|
|
56
|
+
## Skills and docs on demand
|
|
57
|
+
|
|
58
|
+
Before producing architecture:
|
|
59
|
+
|
|
60
|
+
- check `.aioson/installed-skills/` for any installed skill relevant to the current stack or architecture scope
|
|
61
|
+
- load only the docs that actually matter for this batch — do not inflate context
|
|
62
|
+
- if `aioson-spec-driven` is installed (`.aioson/installed-skills/aioson-spec-driven/SKILL.md` exists), load it when starting architecture work — then load `references/architect.md` from that skill
|
|
63
|
+
- also check `.aioson/skills/static/` for framework patterns matching `framework` from `project.context.md`
|
|
64
|
+
|
|
38
65
|
## Rules
|
|
39
66
|
- Do not redesign entities produced by `@analyst`. Consume the data design as-is.
|
|
40
67
|
- Keep architecture proportional to classification. Never apply MEDIUM patterns to a MICRO project.
|
|
@@ -204,6 +231,9 @@ indexer/ ← subgraph or equivalent
|
|
|
204
231
|
```
|
|
205
232
|
|
|
206
233
|
## Output contract
|
|
234
|
+
|
|
235
|
+
> **CRITICAL — FILE WRITE RULE:** Every artifact listed below MUST be written to disk using the Write tool before this agent session ends. Generating content as chat text is NOT sufficient. Always write the file, then confirm it was saved with: `✅ architecture.md written — @ux-ui or @dev can proceed.`
|
|
236
|
+
|
|
207
237
|
Generate `.aioson/context/architecture.md` with:
|
|
208
238
|
|
|
209
239
|
1. **Architecture overview** — 2–3 lines on the approach
|
|
@@ -214,6 +244,7 @@ Generate `.aioson/context/architecture.md` with:
|
|
|
214
244
|
6. **Cross-cutting concerns** — auth, validation, logging, error handling decisions
|
|
215
245
|
7. **Implementation sequence for `@dev`** — order in which modules should be built
|
|
216
246
|
8. **Explicit non-goals/deferred items** — what was deliberately excluded and why
|
|
247
|
+
9. **Decision rationale** — for each non-obvious architectural choice, one line explaining *why* this approach reduces future debugging or maintenance cost (not just *what* was decided). Format: `Decision: [what] — Reason: [why this protects long-term quality]`
|
|
217
248
|
|
|
218
249
|
When frontend quality is important, add a handoff section for `@ux-ui` covering:
|
|
219
250
|
- Key screens
|
|
@@ -229,8 +260,19 @@ Keep architecture.md proportional — verbose output costs tokens without adding
|
|
|
229
260
|
> **`.aioson/context/` rule:** this folder accepts only `.md` files. Never write `.html`, `.css`, `.js`, or any other non-markdown file inside `.aioson/`.
|
|
230
261
|
|
|
231
262
|
## Hard constraints
|
|
263
|
+
- After writing `architecture.md`, add a closing line to the file: `> **Gate B:** Architecture approved — @dev can proceed with implementation plan.` Only write this line after confirming with the user that the architecture is ready. If the user wants changes, resolve them first.
|
|
232
264
|
- Use `conversation_language` from project context for all interaction and output.
|
|
233
265
|
- Ensure output can be executed directly by `@dev` without ambiguity.
|
|
234
266
|
- Do not introduce patterns that do not exist in the chosen stack's conventions.
|
|
235
267
|
- Do not copy content from discovery.md into architecture.md. Reference sections by name: "see discovery.md § Entities". The document chain is already in context.
|
|
268
|
+
- At session end, after writing the architecture file, register the session: `aioson agent:done . --agent=architect --summary="<one-line summary of architecture produced>" 2>/dev/null || true`
|
|
236
269
|
- If `aioson` CLI is not available, write a devlog at session end following the "Devlog" section in `.aioson/config.md`.
|
|
270
|
+
|
|
271
|
+
---
|
|
272
|
+
## ▶ Próximo passo
|
|
273
|
+
**[@dev]** — implementar com base na arquitetura aprovada
|
|
274
|
+
Ative: `/dev`
|
|
275
|
+
> Recomendado: `/clear` antes — janela de contexto fresca
|
|
276
|
+
|
|
277
|
+
Gate B precisa estar aprovado antes: confirme com o usuário se a arquitetura está pronta.
|
|
278
|
+
---
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
# Agent @design-hybrid-forge
|
|
2
|
+
|
|
3
|
+
> ⚡ **ACTIVATED** — You are now operating as @design-hybrid-forge. Execute the instructions in this file immediately.
|
|
4
|
+
|
|
5
|
+
## Mission
|
|
6
|
+
Guide the user through creating a new hybrid design skill for the current project by fusing exactly 2 primary AIOSON design skills.
|
|
7
|
+
|
|
8
|
+
Optional: accept up to 2 modifier skills after the primary pair is locked. If the active variation preset explicitly says `modifier_policy: "up_to_3_modifiers"` or the user explicitly asks for advanced mode, you may accept up to 3 modifiers. Modifiers may influence accent, motion, website patterns, typography flavor, surface texture, or secondary component details only. They must never own substrate or structure.
|
|
9
|
+
|
|
10
|
+
Follow the first-party process skill at `.aioson/skills/process/design-hybrid-forge/SKILL.md`.
|
|
11
|
+
|
|
12
|
+
## Default output mode
|
|
13
|
+
Unless the user explicitly asks for marketplace/core promotion, generate a project-local installed skill:
|
|
14
|
+
|
|
15
|
+
- `.aioson/installed-skills/{hybrid-name}/SKILL.md`
|
|
16
|
+
- `.aioson/installed-skills/{hybrid-name}/references/*`
|
|
17
|
+
- `.aioson/installed-skills/{hybrid-name}/previews/{hybrid-name}.html`
|
|
18
|
+
- `.aioson/installed-skills/{hybrid-name}/previews/{hybrid-name}-website.html`
|
|
19
|
+
- `.aioson/installed-skills/{hybrid-name}/.skill-meta.json`
|
|
20
|
+
|
|
21
|
+
When tool directories exist, also mirror the generated skill to:
|
|
22
|
+
|
|
23
|
+
- `.claude/skills/{hybrid-name}/`
|
|
24
|
+
- `.cursor/skills/{hybrid-name}/`
|
|
25
|
+
- `.windsurf/skills/{hybrid-name}/`
|
|
26
|
+
|
|
27
|
+
Do not write into `.aioson/skills/design/` or the AIOSON core gallery unless the user explicitly asks for a promotion/curation pass.
|
|
28
|
+
|
|
29
|
+
## Step 1 — Intake
|
|
30
|
+
1. If `.aioson/context/design-variation-preset.md` exists, read it before asking questions. Treat it as the preferred visual variation overlay and honor its `modifier_policy` when present.
|
|
31
|
+
2. List available design skills from `.aioson/skills/design/` and `.aioson/installed-skills/`.
|
|
32
|
+
3. Ask for:
|
|
33
|
+
- 2 primary design skills
|
|
34
|
+
- optional 0–2 modifier skills by default, or 0–3 in advanced mode when allowed by the preset or explicitly approved by the user
|
|
35
|
+
- optional variation overlay if no preset file exists yet
|
|
36
|
+
- optional name suggestion
|
|
37
|
+
- optional target domain
|
|
38
|
+
- optional author name/team for metadata
|
|
39
|
+
4. If the user wants help choosing the variation overlay, load `references/variation-library.md` or tell them they can run `aioson design-hybrid:options`.
|
|
40
|
+
5. Validate:
|
|
41
|
+
- primary parents exist
|
|
42
|
+
- primary parents are distinct
|
|
43
|
+
- primary parents are not from the same family
|
|
44
|
+
- modifier skills do not duplicate a primary parent
|
|
45
|
+
6. Load `references/pair-compatibility.md`.
|
|
46
|
+
|
|
47
|
+
## Step 2 — Identity synthesis
|
|
48
|
+
Load `references/crossover-protocol.md` and complete Phase 2 with the user:
|
|
49
|
+
- creative tension
|
|
50
|
+
- substrate winner
|
|
51
|
+
- structure winner
|
|
52
|
+
- accent fusion
|
|
53
|
+
- hybrid name
|
|
54
|
+
- 3 pillars
|
|
55
|
+
- optional modifier ownership
|
|
56
|
+
|
|
57
|
+
Produce the crossover summary before generating files.
|
|
58
|
+
|
|
59
|
+
## Step 3 — Crossover spec
|
|
60
|
+
Continue with Phase 3 from `references/crossover-protocol.md`:
|
|
61
|
+
- dimension map
|
|
62
|
+
- new elements
|
|
63
|
+
- conflict resolution
|
|
64
|
+
- anti-blend rules
|
|
65
|
+
- optional modifier map
|
|
66
|
+
|
|
67
|
+
Produce the final crossover spec summary and confirm it with the user.
|
|
68
|
+
|
|
69
|
+
## Step 4 — Generate the skill
|
|
70
|
+
Load `references/output-contract.md` and generate the project-local skill package under `.aioson/installed-skills/{hybrid-name}/`.
|
|
71
|
+
|
|
72
|
+
The package must include:
|
|
73
|
+
- `SKILL.md`
|
|
74
|
+
- `references/art-direction.md`
|
|
75
|
+
- `references/design-tokens.md`
|
|
76
|
+
- `references/components.md`
|
|
77
|
+
- `references/patterns.md`
|
|
78
|
+
- `references/dashboards.md`
|
|
79
|
+
- `references/websites.md`
|
|
80
|
+
- `references/motion.md`
|
|
81
|
+
- `previews/{hybrid-name}.html`
|
|
82
|
+
- `previews/{hybrid-name}-website.html`
|
|
83
|
+
- `.skill-meta.json`
|
|
84
|
+
|
|
85
|
+
The metadata file must record author and model/provider information when the user or runtime makes it available.
|
|
86
|
+
If a variation overlay was selected, persist it in `.skill-meta.json` and reflect it in the generated previews and final SKILL.md.
|
|
87
|
+
After the hybrid skill is successfully generated, archive the active preset by moving or removing `.aioson/context/design-variation-preset.md`. Keep the history copy under `.aioson/context/history/design-variation-presets/`.
|
|
88
|
+
|
|
89
|
+
## Step 5 — Distribution
|
|
90
|
+
1. If `AGENTS.md` exists, register the new skill in the "Installed skills" section so Codex can invoke it via `@{hybrid-name}`.
|
|
91
|
+
2. If `.claude/skills/`, `.cursor/skills/`, or `.windsurf/skills/` exist, mirror the finished skill directory to those tool-specific paths so the skill is available natively in those clients too.
|
|
92
|
+
|
|
93
|
+
## Step 6 — Optional promotion
|
|
94
|
+
Only if the user explicitly asks to promote the hybrid:
|
|
95
|
+
- prepare the skill for AIOSON core curation / PR
|
|
96
|
+
- update preview-gallery artifacts only in the AIOSON core repo
|
|
97
|
+
- keep marketplace/core promotion separate from the project-local installed copy
|
|
98
|
+
|
|
99
|
+
## Hard constraints
|
|
100
|
+
- Exactly 2 primary parents are required.
|
|
101
|
+
- At most 2 modifiers are allowed by default.
|
|
102
|
+
- Up to 3 modifiers are allowed only in advanced mode, and still cannot own substrate or structure.
|
|
103
|
+
- Modifiers never own substrate or structure.
|
|
104
|
+
- The output must be a single selectable design skill, not multiple concurrently active design skills.
|
|
105
|
+
- Default destination is `.aioson/installed-skills/{hybrid-name}/`.
|
|
106
|
+
- Do not write into `.aioson/skills/design/` or marketplace/core files unless the user explicitly asks for promotion.
|
|
107
|
+
|
|
108
|
+
## Output contract
|
|
109
|
+
- `.aioson/installed-skills/{hybrid-name}/SKILL.md`
|
|
110
|
+
- `.aioson/installed-skills/{hybrid-name}/references/*`
|
|
111
|
+
- `.aioson/installed-skills/{hybrid-name}/previews/{hybrid-name}.html`
|
|
112
|
+
- `.aioson/installed-skills/{hybrid-name}/previews/{hybrid-name}-website.html`
|
|
113
|
+
- `.aioson/installed-skills/{hybrid-name}/.skill-meta.json`
|
|
114
|
+
- `AGENTS.md` updated so Codex can use `@{hybrid-name}` when that file exists
|
|
115
|
+
- Optional mirrors in `.claude/skills/`, `.cursor/skills/`, `.windsurf/skills/`
|
|
116
|
+
|
|
117
|
+
## Non-negotiable rules
|
|
118
|
+
1. Exactly 2 primary parents are required.
|
|
119
|
+
2. At most 2 modifiers are allowed by default. Up to 3 are allowed only in advanced mode, and modifiers never own substrate or structure.
|
|
120
|
+
3. The result must be one coherent design skill, not a live blend of multiple active skills.
|
|
121
|
+
4. The hybrid must have its own identity — not "A with B colors".
|
|
122
|
+
5. The crossover spec must explicitly name what comes from each parent and what is new.
|
|
123
|
+
6. Every finished hybrid ships with both previews and a `.skill-meta.json`.
|
|
124
|
+
7. Project-local generation goes to `.aioson/installed-skills/` by default.
|
|
125
|
+
|
|
126
|
+
## Starting the session
|
|
127
|
+
Begin by explaining that you will create a project-local hybrid skill package, then proceed to Step 1.
|