@jaimevalasek/aioson 1.5.1 → 1.7.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 +49 -0
- package/README.md +729 -226
- 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/pt.squarespace.com-homepage.html +889 -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/integrations/sdlc-genius-boundary.md +76 -0
- package/docs/integrations/sdlc-genius-eval-matrix.md +75 -0
- package/docs/integrations/sdlc-genius-install-checklist.md +93 -0
- package/docs/integrations/sdlc-genius-review-samples.md +86 -0
- package/docs/pt/README.md +10 -0
- package/docs/pt/agent-sharding.md +132 -0
- package/docs/pt/agentes.md +9 -2
- package/docs/pt/busca-de-contexto.md +129 -0
- package/docs/pt/cache-de-contexto.md +156 -0
- package/docs/pt/comandos-cli.md +915 -1
- package/docs/pt/design-hybrid-forge.md +356 -0
- package/docs/pt/devlog-pipeline.md +270 -0
- package/docs/pt/fluxo-artefatos.md +178 -0
- package/docs/pt/hooks-session-guard.md +454 -0
- package/docs/pt/inicio-rapido.md +54 -3
- package/docs/pt/inteligencia-adaptativa.md +324 -0
- package/docs/pt/monitor-de-contexto.md +158 -0
- package/docs/pt/recuperacao-de-sessao.md +125 -0
- package/docs/pt/sandbox.md +125 -0
- package/docs/pt/sdd-automation-scripts.md +557 -0
- package/docs/pt/site-forge.md +309 -0
- package/docs/pt/skills.md +98 -6
- package/docs/pt/spec-learnings-pipeline.md +265 -0
- package/package.json +1 -1
- package/src/a2a/client.js +165 -0
- package/src/a2a/server.js +223 -0
- package/src/agent-loader.js +280 -0
- package/src/cli.js +329 -1
- package/src/commands/agent-audit.js +397 -0
- package/src/commands/agent-export-skill.js +229 -0
- package/src/commands/agent-loader.js +85 -0
- package/src/commands/artifact-validate.js +189 -0
- package/src/commands/brief-gen.js +405 -0
- package/src/commands/brief-validate.js +65 -0
- package/src/commands/classify.js +256 -0
- package/src/commands/context-cache.js +90 -0
- package/src/commands/context-compact.js +49 -0
- package/src/commands/context-health.js +175 -0
- package/src/commands/context-monitor.js +163 -0
- package/src/commands/context-search.js +66 -0
- package/src/commands/context-trim.js +177 -0
- package/src/commands/design-hybrid-options.js +385 -0
- package/src/commands/detect-test-runner.js +55 -0
- package/src/commands/devlog-export-brains.js +27 -0
- package/src/commands/devlog-process.js +292 -0
- package/src/commands/devlog-watch.js +131 -0
- package/src/commands/feature-close.js +165 -0
- package/src/commands/gate-check.js +228 -0
- package/src/commands/health.js +214 -0
- package/src/commands/hooks-emit.js +253 -0
- package/src/commands/hooks-install.js +347 -0
- package/src/commands/init.js +54 -13
- package/src/commands/install.js +52 -13
- package/src/commands/learning-auto-promote.js +195 -0
- package/src/commands/learning-evolve.js +364 -0
- package/src/commands/learning-export.js +103 -0
- package/src/commands/learning-rollback.js +164 -0
- package/src/commands/live.js +59 -1
- package/src/commands/pattern-detect.js +33 -0
- package/src/commands/preflight-context.js +30 -0
- package/src/commands/preflight.js +208 -0
- package/src/commands/pulse-update.js +130 -0
- package/src/commands/recovery.js +43 -0
- package/src/commands/runner-daemon.js +274 -0
- package/src/commands/runner-plan.js +70 -0
- package/src/commands/runner-queue-from-plan.js +166 -0
- package/src/commands/runner-queue.js +189 -0
- package/src/commands/runner-run.js +129 -0
- package/src/commands/runtime.js +47 -1
- package/src/commands/sandbox.js +37 -0
- package/src/commands/self-implement-loop.js +256 -0
- package/src/commands/session-guard.js +218 -0
- package/src/commands/setup-context.js +22 -2
- package/src/commands/setup.js +178 -0
- package/src/commands/sizing.js +165 -0
- package/src/commands/skill.js +144 -32
- package/src/commands/spec-checkpoint.js +177 -0
- package/src/commands/spec-status.js +79 -0
- package/src/commands/spec-sync.js +190 -0
- package/src/commands/spec-tasks.js +288 -0
- package/src/commands/squad-autorun.js +1220 -0
- package/src/commands/squad-bus.js +217 -0
- package/src/commands/squad-card.js +149 -0
- package/src/commands/squad-daemon.js +134 -0
- package/src/commands/squad-dependency-graph.js +164 -0
- package/src/commands/squad-review.js +106 -0
- package/src/commands/squad-scaffold.js +55 -0
- package/src/commands/squad-tool-register.js +157 -0
- package/src/commands/state-save.js +122 -0
- package/src/commands/tool-registry-cmd.js +232 -0
- package/src/commands/update.js +9 -0
- package/src/commands/verify-gate.js +572 -0
- package/src/commands/workflow-execute.js +241 -0
- package/src/constants.js +18 -0
- package/src/context-cache.js +159 -0
- package/src/context-search.js +326 -0
- package/src/design-variation-catalog.js +503 -0
- package/src/i18n/messages/en.js +32 -2
- package/src/i18n/messages/es.js +30 -2
- package/src/i18n/messages/fr.js +30 -2
- package/src/i18n/messages/pt-BR.js +32 -2
- package/src/install-animation.js +260 -0
- package/src/install-profile.js +143 -0
- package/src/install-wizard.js +475 -0
- package/src/installer.js +44 -10
- package/src/lib/health-check.js +158 -0
- package/src/lib/hook-protocol.js +76 -0
- package/src/mcp/apps/squad-dashboard/app.js +163 -0
- package/src/mcp/apps/squad-dashboard/index.html +261 -0
- package/src/mcp/apps/squad-dashboard/mcp-manifest.json +23 -0
- package/src/mcp/resources/squad-state.js +130 -0
- package/src/parser.js +7 -1
- package/src/preflight-engine.js +443 -0
- package/src/recovery-context-session.js +154 -0
- package/src/runner/cascade.js +97 -0
- package/src/runner/cli-launcher.js +109 -0
- package/src/runner/plan-importer.js +63 -0
- package/src/runner/queue-store.js +159 -0
- package/src/runtime-store.js +158 -4
- package/src/sandbox.js +177 -0
- package/src/squad/agent-teams-adapter.js +264 -0
- package/src/squad/brief-validator.js +350 -0
- package/src/squad/bus-bridge.js +140 -0
- package/src/squad/context-compactor.js +265 -0
- package/src/squad/cross-ai-synthesizer.js +250 -0
- package/src/squad/hooks-generator.js +196 -0
- package/src/squad/inter-squad-events.js +175 -0
- package/src/squad/intra-bus.js +345 -0
- package/src/squad/learning-extractor.js +213 -0
- package/src/squad/pattern-detector.js +365 -0
- package/src/squad/preflight-context.js +296 -0
- package/src/squad/recovery-context.js +242 -71
- package/src/squad/reflection.js +365 -0
- package/src/squad/squad-scaffold.js +177 -0
- package/src/squad/state-manager.js +310 -0
- package/src/squad/task-decomposer.js +652 -0
- package/src/squad/verify-gate.js +303 -0
- package/src/tool-executor.js +94 -0
- package/src/updater.js +10 -3
- package/src/worker-runner.js +186 -1
- package/template/.aioson/agents/analyst.md +119 -3
- package/template/.aioson/agents/architect.md +98 -0
- package/template/.aioson/agents/design-hybrid-forge.md +141 -0
- package/template/.aioson/agents/dev.md +335 -14
- package/template/.aioson/agents/deyvin.md +117 -2
- package/template/.aioson/agents/discovery-design-doc.md +44 -0
- package/template/.aioson/agents/genome.md +14 -0
- package/template/.aioson/agents/neo.md +78 -1
- package/template/.aioson/agents/orache.md +50 -4
- package/template/.aioson/agents/orchestrator.md +197 -1
- package/template/.aioson/agents/pm.md +93 -0
- package/template/.aioson/agents/product.md +77 -4
- package/template/.aioson/agents/profiler-enricher.md +14 -0
- package/template/.aioson/agents/profiler-forge.md +14 -0
- package/template/.aioson/agents/profiler-researcher.md +14 -0
- package/template/.aioson/agents/qa.md +249 -19
- package/template/.aioson/agents/setup.md +144 -12
- package/template/.aioson/agents/sheldon.md +237 -11
- package/template/.aioson/agents/site-forge.md +1753 -0
- package/template/.aioson/agents/squad.md +162 -0
- package/template/.aioson/agents/tester.md +209 -0
- package/template/.aioson/agents/ux-ui.md +34 -1
- package/template/.aioson/brains/README.md +128 -0
- package/template/.aioson/brains/_index.json +16 -0
- package/template/.aioson/brains/scripts/query.js +103 -0
- package/template/.aioson/brains/site-forge/visual-patterns.brain.json +205 -0
- package/template/.aioson/config.md +158 -13
- package/template/.aioson/constitution.md +33 -0
- package/template/.aioson/context/forensics/.gitkeep +0 -0
- package/template/.aioson/context/project-pulse.md +34 -0
- package/template/.aioson/context/seeds/seed-example.md +27 -0
- package/template/.aioson/context/user-profile.md +42 -0
- package/template/.aioson/docs/LAYERS.md +79 -0
- package/template/.aioson/docs/README.md +76 -0
- package/template/.aioson/docs/example-external-api-context.md +72 -0
- package/template/.aioson/locales/en/agents/architect.md +17 -0
- package/template/.aioson/locales/en/agents/dev.md +79 -13
- package/template/.aioson/locales/en/agents/orache.md +6 -0
- package/template/.aioson/locales/en/agents/orchestrator.md +24 -0
- package/template/.aioson/locales/en/agents/product.md +50 -0
- package/template/.aioson/locales/en/agents/setup.md +33 -1
- package/template/.aioson/locales/en/agents/sheldon.md +115 -0
- package/template/.aioson/locales/en/agents/squad.md +14 -0
- package/template/.aioson/locales/en/agents/tester.md +6 -0
- package/template/.aioson/locales/es/agents/analyst.md +2 -0
- package/template/.aioson/locales/es/agents/architect.md +19 -0
- package/template/.aioson/locales/es/agents/dev.md +64 -4
- package/template/.aioson/locales/es/agents/deyvin.md +2 -0
- package/template/.aioson/locales/es/agents/discovery-design-doc.md +2 -0
- package/template/.aioson/locales/es/agents/genome.md +2 -0
- package/template/.aioson/locales/es/agents/neo.md +2 -0
- package/template/.aioson/locales/es/agents/orache.md +2 -0
- package/template/.aioson/locales/es/agents/orchestrator.md +26 -0
- package/template/.aioson/locales/es/agents/pair.md +2 -0
- package/template/.aioson/locales/es/agents/pm.md +2 -0
- package/template/.aioson/locales/es/agents/product.md +52 -0
- package/template/.aioson/locales/es/agents/profiler-enricher.md +2 -0
- package/template/.aioson/locales/es/agents/profiler-forge.md +2 -0
- package/template/.aioson/locales/es/agents/profiler-researcher.md +2 -0
- package/template/.aioson/locales/es/agents/qa.md +2 -0
- package/template/.aioson/locales/es/agents/setup.md +35 -1
- package/template/.aioson/locales/es/agents/sheldon.md +117 -0
- package/template/.aioson/locales/es/agents/squad.md +16 -0
- package/template/.aioson/locales/es/agents/tester.md +9 -0
- package/template/.aioson/locales/es/agents/ux-ui.md +2 -0
- package/template/.aioson/locales/fr/agents/analyst.md +2 -0
- package/template/.aioson/locales/fr/agents/architect.md +19 -0
- package/template/.aioson/locales/fr/agents/dev.md +64 -4
- package/template/.aioson/locales/fr/agents/deyvin.md +2 -0
- package/template/.aioson/locales/fr/agents/discovery-design-doc.md +2 -0
- package/template/.aioson/locales/fr/agents/genome.md +2 -0
- package/template/.aioson/locales/fr/agents/neo.md +2 -0
- package/template/.aioson/locales/fr/agents/orache.md +2 -0
- package/template/.aioson/locales/fr/agents/orchestrator.md +26 -0
- package/template/.aioson/locales/fr/agents/pair.md +2 -0
- package/template/.aioson/locales/fr/agents/pm.md +2 -0
- package/template/.aioson/locales/fr/agents/product.md +52 -0
- package/template/.aioson/locales/fr/agents/profiler-enricher.md +2 -0
- package/template/.aioson/locales/fr/agents/profiler-forge.md +2 -0
- package/template/.aioson/locales/fr/agents/profiler-researcher.md +2 -0
- package/template/.aioson/locales/fr/agents/qa.md +2 -0
- package/template/.aioson/locales/fr/agents/setup.md +35 -1
- package/template/.aioson/locales/fr/agents/sheldon.md +117 -0
- package/template/.aioson/locales/fr/agents/squad.md +16 -0
- package/template/.aioson/locales/fr/agents/tester.md +9 -0
- package/template/.aioson/locales/fr/agents/ux-ui.md +2 -0
- package/template/.aioson/locales/pt-BR/agents/analyst.md +64 -3
- package/template/.aioson/locales/pt-BR/agents/architect.md +42 -0
- package/template/.aioson/locales/pt-BR/agents/dev.md +147 -14
- package/template/.aioson/locales/pt-BR/agents/deyvin.md +47 -0
- package/template/.aioson/locales/pt-BR/agents/neo.md +62 -1
- package/template/.aioson/locales/pt-BR/agents/orchestrator.md +158 -2
- package/template/.aioson/locales/pt-BR/agents/pm.md +95 -1
- package/template/.aioson/locales/pt-BR/agents/product.md +145 -18
- package/template/.aioson/locales/pt-BR/agents/qa.md +16 -0
- package/template/.aioson/locales/pt-BR/agents/setup.md +134 -19
- package/template/.aioson/locales/pt-BR/agents/sheldon.md +132 -1
- package/template/.aioson/locales/pt-BR/agents/squad.md +14 -0
- package/template/.aioson/locales/pt-BR/agents/tester.md +449 -0
- package/template/.aioson/rules/README.md +69 -0
- package/template/.aioson/rules/data-format-convention.md +136 -0
- package/template/.aioson/rules/example-monetary-values.md +30 -0
- package/template/.aioson/schemas/squad-manifest.schema.json +124 -3
- 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/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/pt.squarespace.com/.skill-meta.json +31 -0
- package/template/.aioson/skills/design/pt.squarespace.com/SKILL.md +66 -0
- package/template/.aioson/skills/design/pt.squarespace.com/references/components.md +368 -0
- package/template/.aioson/skills/design/pt.squarespace.com/references/design-tokens.md +150 -0
- package/template/.aioson/skills/design/pt.squarespace.com/references/motion.md +270 -0
- package/template/.aioson/skills/design/pt.squarespace.com/references/patterns.md +189 -0
- package/template/.aioson/skills/design/pt.squarespace.com/references/websites.md +165 -0
- package/template/.aioson/skills/process/aioson-spec-driven/SKILL.md +46 -0
- package/template/.aioson/skills/process/aioson-spec-driven/references/analyst.md +30 -0
- package/template/.aioson/skills/process/aioson-spec-driven/references/approval-gates.md +109 -0
- package/template/.aioson/skills/process/aioson-spec-driven/references/architect.md +23 -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/dev.md +47 -0
- package/template/.aioson/skills/process/aioson-spec-driven/references/deyvin.md +27 -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 +101 -0
- package/template/.aioson/skills/process/aioson-spec-driven/references/product.md +25 -0
- package/template/.aioson/skills/process/aioson-spec-driven/references/qa.md +30 -0
- package/template/.aioson/skills/process/aioson-spec-driven/references/sheldon.md +25 -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 +147 -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 +306 -0
- package/template/.aioson/skills/process/design-hybrid-forge/references/pair-compatibility.md +149 -0
- package/template/.aioson/skills/process/design-hybrid-forge/references/quality-gates.md +208 -0
- package/template/.aioson/skills/process/design-hybrid-forge/references/variation-library.md +125 -0
- package/template/.aioson/skills/process/simplify/SKILL.md +173 -0
- package/template/.aioson/skills/static/context-budget-guide.md +46 -0
- package/template/.aioson/skills/static/harness-sensors.md +74 -0
- package/template/.aioson/skills/static/multi-agent-patterns.md +43 -0
- package/template/.aioson/skills/static/react-motion-patterns.md +22 -0
- package/template/.aioson/skills/static/static-html-patterns/checklists.md +43 -0
- package/template/.aioson/skills/static/static-html-patterns/css-tokens.md +609 -0
- package/template/.aioson/skills/static/static-html-patterns/motion.md +193 -0
- package/template/.aioson/skills/static/static-html-patterns/premium.md +711 -0
- package/template/.aioson/skills/static/static-html-patterns/structure.md +209 -0
- package/template/.aioson/skills/static/static-html-patterns/utilities.md +190 -0
- package/template/.aioson/skills/static/static-html-patterns.md +58 -1913
- package/template/.aioson/skills/static/threejs-patterns.md +929 -0
- package/template/.aioson/skills/static/web-research-cache.md +112 -0
- package/template/.aioson/tasks/implementation-plan.md +21 -1
- package/template/.claude/commands/aioson/agent/design-hybrid-forge.md +5 -0
- package/template/.claude/commands/aioson/agent/orache.md +5 -0
- package/template/.claude/commands/aioson/agent/sheldon.md +5 -0
- package/template/.claude/commands/aioson/agent/site-forge.md +5 -0
- package/template/AGENTS.md +75 -1
- package/template/CLAUDE.md +31 -0
- package/template/OPENCODE.md +4 -0
- package/template/researchs/.gitkeep +0 -0
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* aioson workflow:execute — orchestrate the full agent workflow for a feature.
|
|
5
|
+
*
|
|
6
|
+
* Uses agent:prompt, gate:check, pulse:update, feature:close as building blocks.
|
|
7
|
+
* Always supports --dry-run to preview the plan without executing.
|
|
8
|
+
*
|
|
9
|
+
* Usage:
|
|
10
|
+
* aioson workflow:execute . --feature=checkout --tool=claude --dry-run
|
|
11
|
+
* aioson workflow:execute . --feature=checkout --tool=claude
|
|
12
|
+
* aioson workflow:execute . --feature=checkout --tool=claude --start-from=dev
|
|
13
|
+
* aioson workflow:execute . --feature=checkout --json --dry-run
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
const path = require('node:path');
|
|
17
|
+
const { execSync } = require('node:child_process');
|
|
18
|
+
const {
|
|
19
|
+
detectClassification,
|
|
20
|
+
scanArtifacts,
|
|
21
|
+
readPhaseGates
|
|
22
|
+
} = require('../preflight-engine');
|
|
23
|
+
|
|
24
|
+
const BAR = '━'.repeat(45);
|
|
25
|
+
|
|
26
|
+
const WORKFLOW_BY_CLASSIFICATION = {
|
|
27
|
+
MICRO: [
|
|
28
|
+
{ agent: 'dev', gate_before: null, gate_after: null, description: 'Direct implementation' }
|
|
29
|
+
],
|
|
30
|
+
SMALL: [
|
|
31
|
+
{ agent: 'product', gate_before: null, gate_after: null, description: 'Generate PRD' },
|
|
32
|
+
{ agent: 'sheldon', gate_before: null, gate_after: null, description: 'Enrich PRD (recommended)', optional: true },
|
|
33
|
+
{ agent: 'analyst', gate_before: null, gate_after: 'A', description: 'Map requirements + spec' },
|
|
34
|
+
{ agent: 'dev', gate_before: 'A', gate_after: 'C', description: 'Implementation' },
|
|
35
|
+
{ agent: 'qa', gate_before: 'C', gate_after: 'D', description: 'QA + feature closure' }
|
|
36
|
+
],
|
|
37
|
+
MEDIUM: [
|
|
38
|
+
{ agent: 'product', gate_before: null, gate_after: null, description: 'Generate PRD' },
|
|
39
|
+
{ agent: 'sheldon', gate_before: null, gate_after: null, description: 'Enrich PRD (required)', optional: false },
|
|
40
|
+
{ agent: 'analyst', gate_before: null, gate_after: 'A', description: 'Map requirements + spec' },
|
|
41
|
+
{ agent: 'architect', gate_before: 'A', gate_after: 'B', description: 'Architecture design' },
|
|
42
|
+
{ agent: 'ux-ui', gate_before: 'A', gate_after: 'B', description: 'UI/UX design', optional: true },
|
|
43
|
+
{ agent: 'pm', gate_before: 'B', gate_after: null, description: 'Backlog + PM plan' },
|
|
44
|
+
{ agent: 'dev', gate_before: 'C', gate_after: 'C', description: 'Implementation' },
|
|
45
|
+
{ agent: 'qa', gate_before: 'C', gate_after: 'D', description: 'QA + feature closure' }
|
|
46
|
+
]
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
const GATE_NAMES = { A: 'requirements', B: 'design', C: 'plan', D: 'execution' };
|
|
50
|
+
|
|
51
|
+
async function buildExecutionPlan(targetDir, slug, classification, startFrom) {
|
|
52
|
+
const steps = WORKFLOW_BY_CLASSIFICATION[classification] || WORKFLOW_BY_CLASSIFICATION.SMALL;
|
|
53
|
+
const artifacts = await scanArtifacts(targetDir, slug);
|
|
54
|
+
const gates = await readPhaseGates(targetDir, slug);
|
|
55
|
+
|
|
56
|
+
const plan = [];
|
|
57
|
+
let stepNum = 1;
|
|
58
|
+
let startFromReached = !startFrom;
|
|
59
|
+
|
|
60
|
+
for (const step of steps) {
|
|
61
|
+
if (startFrom && !startFromReached) {
|
|
62
|
+
if (step.agent === startFrom) startFromReached = true;
|
|
63
|
+
else continue;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
// Determine if step can be skipped (artifact already exists)
|
|
67
|
+
let skip = false;
|
|
68
|
+
let skipReason = null;
|
|
69
|
+
|
|
70
|
+
if (step.agent === 'product' && artifacts.prd.exists) {
|
|
71
|
+
skip = true; skipReason = 'prd already exists';
|
|
72
|
+
} else if (step.agent === 'sheldon' && artifacts.sheldon_enrichment.exists) {
|
|
73
|
+
skip = true; skipReason = 'sheldon enrichment already exists';
|
|
74
|
+
} else if (step.agent === 'analyst' && artifacts.requirements.exists && gates.requirements === 'approved') {
|
|
75
|
+
skip = true; skipReason = 'requirements + Gate A already approved';
|
|
76
|
+
} else if (step.agent === 'architect' && artifacts.architecture.exists && gates.design === 'approved') {
|
|
77
|
+
skip = true; skipReason = 'architecture + Gate B already approved';
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
plan.push({
|
|
81
|
+
step: stepNum++,
|
|
82
|
+
agent: step.agent,
|
|
83
|
+
description: step.description,
|
|
84
|
+
gate_before: step.gate_before,
|
|
85
|
+
gate_after: step.gate_after,
|
|
86
|
+
optional: step.optional || false,
|
|
87
|
+
skip,
|
|
88
|
+
skip_reason: skipReason
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
return plan;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
function runCommand(cmd) {
|
|
96
|
+
try {
|
|
97
|
+
execSync(cmd, { stdio: 'inherit' });
|
|
98
|
+
return { ok: true };
|
|
99
|
+
} catch (err) {
|
|
100
|
+
return { ok: false, error: err.message };
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
async function runWorkflowExecute({ args, options = {}, logger }) {
|
|
105
|
+
const targetDir = path.resolve(process.cwd(), args[0] || '.');
|
|
106
|
+
const slug = options.feature ? String(options.feature) : null;
|
|
107
|
+
const tool = options.tool ? String(options.tool) : 'claude';
|
|
108
|
+
const dryRun = Boolean(options['dry-run'] || options.dry);
|
|
109
|
+
const startFrom = options['start-from'] ? String(options['start-from']) : null;
|
|
110
|
+
const skipOptional = Boolean(options['skip-optional']);
|
|
111
|
+
|
|
112
|
+
if (!slug) {
|
|
113
|
+
if (options.json) return { ok: false, reason: 'missing_feature' };
|
|
114
|
+
logger.log('--feature=<slug> is required.');
|
|
115
|
+
return { ok: false };
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
let classification = await detectClassification(targetDir, slug);
|
|
119
|
+
if (!classification) classification = options.classification ? String(options.classification).toUpperCase() : 'SMALL';
|
|
120
|
+
|
|
121
|
+
const plan = await buildExecutionPlan(targetDir, slug, classification, startFrom);
|
|
122
|
+
const activePlan = plan.filter((s) => !s.skip && !(skipOptional && s.optional));
|
|
123
|
+
const skippedPlan = plan.filter((s) => s.skip);
|
|
124
|
+
|
|
125
|
+
if (dryRun || options.json) {
|
|
126
|
+
const result = {
|
|
127
|
+
ok: true,
|
|
128
|
+
feature: slug,
|
|
129
|
+
classification,
|
|
130
|
+
tool,
|
|
131
|
+
dry_run: true,
|
|
132
|
+
steps: plan,
|
|
133
|
+
active_steps: activePlan.length,
|
|
134
|
+
skipped_steps: skippedPlan.length
|
|
135
|
+
};
|
|
136
|
+
|
|
137
|
+
if (options.json) return result;
|
|
138
|
+
|
|
139
|
+
logger.log('');
|
|
140
|
+
logger.log(`Workflow Execution Plan — ${slug} (${classification})`);
|
|
141
|
+
logger.log(BAR);
|
|
142
|
+
|
|
143
|
+
for (const step of plan) {
|
|
144
|
+
const icon = step.skip ? '○ (skip)' : `Step ${step.step}:`;
|
|
145
|
+
const optional = step.optional ? ' (optional)' : '';
|
|
146
|
+
const gateInfo = step.gate_after ? ` → Gate ${step.gate_after} check` : '';
|
|
147
|
+
const skipInfo = step.skip ? ` — ${step.skip_reason}` : '';
|
|
148
|
+
logger.log(`${icon} @${step.agent}${optional} — ${step.description}${gateInfo}${skipInfo}`);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
logger.log('');
|
|
152
|
+
logger.log(`Gates enforced: ${plan.filter((s) => s.gate_after && !s.skip).map((s) => s.gate_after).join(', ') || 'none'}`);
|
|
153
|
+
logger.log(`Active sessions: ${activePlan.length} | Skipped: ${skippedPlan.length}`);
|
|
154
|
+
logger.log('');
|
|
155
|
+
logger.log('Run without --dry-run to execute.');
|
|
156
|
+
logger.log('');
|
|
157
|
+
|
|
158
|
+
return result;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
// Execute
|
|
162
|
+
logger.log('');
|
|
163
|
+
logger.log(`Workflow Execution — ${slug} (${classification})`);
|
|
164
|
+
logger.log(BAR);
|
|
165
|
+
|
|
166
|
+
let completed = 0;
|
|
167
|
+
let failed = 0;
|
|
168
|
+
const executionLog = [];
|
|
169
|
+
|
|
170
|
+
for (const step of plan) {
|
|
171
|
+
if (step.skip) {
|
|
172
|
+
logger.log(`[skip] @${step.agent} — ${step.skip_reason}`);
|
|
173
|
+
executionLog.push({ step: step.step, agent: step.agent, status: 'skipped', reason: step.skip_reason });
|
|
174
|
+
continue;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
if (skipOptional && step.optional) {
|
|
178
|
+
logger.log(`[skip] @${step.agent} — optional, skipped`);
|
|
179
|
+
executionLog.push({ step: step.step, agent: step.agent, status: 'skipped', reason: 'optional' });
|
|
180
|
+
continue;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
// Gate check before
|
|
184
|
+
if (step.gate_before) {
|
|
185
|
+
logger.log(`[Gate ${step.gate_before} check] pre-step ${step.step}...`);
|
|
186
|
+
const gateCmd = `aioson gate:check ${targetDir} --feature=${slug} --gate=${step.gate_before}`;
|
|
187
|
+
const gateResult = runCommand(gateCmd);
|
|
188
|
+
if (!gateResult.ok) {
|
|
189
|
+
logger.log(`[Gate ${step.gate_before}] BLOCKED — cannot proceed with @${step.agent}`);
|
|
190
|
+
executionLog.push({ step: step.step, agent: step.agent, status: 'blocked', gate: step.gate_before });
|
|
191
|
+
failed++;
|
|
192
|
+
break;
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
logger.log(`[Step ${step.step}/${activePlan.length}] @${step.agent} — ${step.description}...`);
|
|
197
|
+
const agentCmd = `aioson agent:prompt ${targetDir} --agent=${step.agent} --feature=${slug} --tool=${tool}`;
|
|
198
|
+
const agentResult = runCommand(agentCmd);
|
|
199
|
+
|
|
200
|
+
if (!agentResult.ok) {
|
|
201
|
+
logger.log(`[Step ${step.step}] @${step.agent} FAILED`);
|
|
202
|
+
executionLog.push({ step: step.step, agent: step.agent, status: 'failed' });
|
|
203
|
+
failed++;
|
|
204
|
+
break;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
// Gate check after
|
|
208
|
+
if (step.gate_after) {
|
|
209
|
+
logger.log(`[Gate ${step.gate_after} check] post-step ${step.step}...`);
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
// Pulse update
|
|
213
|
+
const pulseCmd = `aioson pulse:update ${targetDir} --agent=${step.agent} --feature=${slug} --action="${step.description}" 2>/dev/null || true`;
|
|
214
|
+
runCommand(pulseCmd);
|
|
215
|
+
|
|
216
|
+
executionLog.push({ step: step.step, agent: step.agent, status: 'completed' });
|
|
217
|
+
completed++;
|
|
218
|
+
logger.log(`[Step ${step.step}] @${step.agent} ✓`);
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
const allDone = completed === activePlan.length;
|
|
222
|
+
if (allDone) {
|
|
223
|
+
logger.log('');
|
|
224
|
+
logger.log(`Workflow complete: ${slug} → done`);
|
|
225
|
+
logger.log(`Total sessions: ${completed}`);
|
|
226
|
+
} else {
|
|
227
|
+
logger.log('');
|
|
228
|
+
logger.log(`Workflow stopped: ${completed} completed, ${failed} failed.`);
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
return {
|
|
232
|
+
ok: allDone,
|
|
233
|
+
feature: slug,
|
|
234
|
+
classification,
|
|
235
|
+
completed,
|
|
236
|
+
failed,
|
|
237
|
+
execution_log: executionLog
|
|
238
|
+
};
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
module.exports = { runWorkflowExecute };
|
package/src/constants.js
CHANGED
|
@@ -33,6 +33,8 @@ const MANAGED_FILES = [
|
|
|
33
33
|
'.aioson/agents/squad.md',
|
|
34
34
|
'.aioson/agents/orache.md',
|
|
35
35
|
'.aioson/agents/genome.md',
|
|
36
|
+
'.aioson/agents/design-hybrid-forge.md',
|
|
37
|
+
'.aioson/agents/site-forge.md',
|
|
36
38
|
'.aioson/agents/profiler-researcher.md',
|
|
37
39
|
'.aioson/agents/profiler-enricher.md',
|
|
38
40
|
'.aioson/agents/profiler-forge.md',
|
|
@@ -349,6 +351,22 @@ const AGENT_DEFINITIONS = [
|
|
|
349
351
|
dependsOn: [],
|
|
350
352
|
output: '.aioson/genomes/[slug].md + .aioson/genomes/[slug].meta.json + optional binding in .aioson/squads/{slug}/squad.md or .aioson/squads/{slug}/squad.manifest.json'
|
|
351
353
|
},
|
|
354
|
+
{
|
|
355
|
+
id: 'design-hybrid-forge',
|
|
356
|
+
displayName: 'Design Hybrid Forge',
|
|
357
|
+
command: '@design-hybrid-forge',
|
|
358
|
+
path: '.aioson/agents/design-hybrid-forge.md',
|
|
359
|
+
dependsOn: ['.aioson/context/project.context.md'],
|
|
360
|
+
output: '.aioson/installed-skills/{hybrid-slug}/SKILL.md + .aioson/installed-skills/{hybrid-slug}/references/ + .aioson/installed-skills/{hybrid-slug}/previews/ + .aioson/installed-skills/{hybrid-slug}/.skill-meta.json'
|
|
361
|
+
},
|
|
362
|
+
{
|
|
363
|
+
id: 'site-forge',
|
|
364
|
+
displayName: 'Site Forge',
|
|
365
|
+
command: '@site-forge',
|
|
366
|
+
path: '.aioson/agents/site-forge.md',
|
|
367
|
+
dependsOn: ['.aioson/context/project.context.md'],
|
|
368
|
+
output: 'src/components/*.tsx + src/app/page.tsx + docs/research/{hostname}/ + public/images/{hostname}/'
|
|
369
|
+
},
|
|
352
370
|
{
|
|
353
371
|
id: 'profiler-researcher',
|
|
354
372
|
displayName: 'Profiler Researcher',
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const fs = require('node:fs/promises');
|
|
4
|
+
const path = require('node:path');
|
|
5
|
+
const os = require('node:os');
|
|
6
|
+
const crypto = require('node:crypto');
|
|
7
|
+
|
|
8
|
+
const CACHE_DIR = path.join(os.homedir(), '.aioson', 'temp');
|
|
9
|
+
const MAX_AGE_MS = 24 * 60 * 60 * 1000; // 24h
|
|
10
|
+
const META_FILE = 'sessions.json';
|
|
11
|
+
|
|
12
|
+
function nowIso() {
|
|
13
|
+
return new Date().toISOString();
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
function generateSessionId() {
|
|
17
|
+
return crypto.randomBytes(8).toString('hex');
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
async function ensureDir(dir) {
|
|
21
|
+
await fs.mkdir(dir, { recursive: true });
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
async function readMeta(cacheDir) {
|
|
25
|
+
const p = path.join(cacheDir, META_FILE);
|
|
26
|
+
try {
|
|
27
|
+
return JSON.parse(await fs.readFile(p, 'utf8'));
|
|
28
|
+
} catch {
|
|
29
|
+
return { sessions: {} };
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
async function writeMeta(cacheDir, meta) {
|
|
34
|
+
const p = path.join(cacheDir, META_FILE);
|
|
35
|
+
await ensureDir(cacheDir);
|
|
36
|
+
await fs.writeFile(p, JSON.stringify(meta, null, 2), 'utf8');
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Save a context snapshot to the RAM cache (shadow file in ~/.aioson/temp/).
|
|
41
|
+
* @param {string} content — context content to save
|
|
42
|
+
* @param {object} metadata — { goal?, agent?, projectDir? }
|
|
43
|
+
* @param {object} opts — { cacheDir?, sessionId? }
|
|
44
|
+
* @returns {{ ok: boolean, sessionId: string, path: string }}
|
|
45
|
+
*/
|
|
46
|
+
async function saveContextShadow(content, metadata = {}, opts = {}) {
|
|
47
|
+
const cacheDir = opts.cacheDir || CACHE_DIR;
|
|
48
|
+
const sessionId = opts.sessionId || generateSessionId();
|
|
49
|
+
const sessionDir = path.join(cacheDir, sessionId);
|
|
50
|
+
|
|
51
|
+
await ensureDir(sessionDir);
|
|
52
|
+
|
|
53
|
+
const contentPath = path.join(sessionDir, 'context.md');
|
|
54
|
+
await fs.writeFile(contentPath, content, 'utf8');
|
|
55
|
+
|
|
56
|
+
const entry = {
|
|
57
|
+
sessionId,
|
|
58
|
+
path: contentPath,
|
|
59
|
+
createdAt: nowIso(),
|
|
60
|
+
metadata: {
|
|
61
|
+
goal: metadata.goal || '',
|
|
62
|
+
agent: metadata.agent || '',
|
|
63
|
+
projectDir: metadata.projectDir || ''
|
|
64
|
+
},
|
|
65
|
+
size: content.length
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
const meta = await readMeta(cacheDir);
|
|
69
|
+
meta.sessions[sessionId] = entry;
|
|
70
|
+
await writeMeta(cacheDir, meta);
|
|
71
|
+
|
|
72
|
+
return { ok: true, sessionId, path: contentPath };
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* List all cached sessions, newest first.
|
|
77
|
+
* @param {object} opts — { cacheDir? }
|
|
78
|
+
* @returns {Array<session_entry>}
|
|
79
|
+
*/
|
|
80
|
+
async function listSessions(opts = {}) {
|
|
81
|
+
const cacheDir = opts.cacheDir || CACHE_DIR;
|
|
82
|
+
const meta = await readMeta(cacheDir);
|
|
83
|
+
const sessions = Object.values(meta.sessions || {});
|
|
84
|
+
sessions.sort((a, b) => {
|
|
85
|
+
return new Date(b.createdAt) - new Date(a.createdAt);
|
|
86
|
+
});
|
|
87
|
+
return sessions;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Restore a cached context by sessionId.
|
|
92
|
+
* @param {string} sessionId
|
|
93
|
+
* @param {object} opts — { cacheDir?, query? }
|
|
94
|
+
* @returns {{ ok: boolean, content: string, metadata: object }|null}
|
|
95
|
+
*/
|
|
96
|
+
async function restoreContext(sessionId, opts = {}) {
|
|
97
|
+
const cacheDir = opts.cacheDir || CACHE_DIR;
|
|
98
|
+
const meta = await readMeta(cacheDir);
|
|
99
|
+
const entry = meta.sessions[sessionId];
|
|
100
|
+
|
|
101
|
+
if (!entry) {
|
|
102
|
+
return { ok: false, error: 'session_not_found' };
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
let content;
|
|
106
|
+
try {
|
|
107
|
+
content = await fs.readFile(entry.path, 'utf8');
|
|
108
|
+
} catch {
|
|
109
|
+
return { ok: false, error: 'file_not_found', sessionId };
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
// If query is provided, extract relevant excerpt
|
|
113
|
+
if (opts.query) {
|
|
114
|
+
const lines = content.split('\n');
|
|
115
|
+
const qLower = opts.query.toLowerCase();
|
|
116
|
+
const relevant = lines.filter(l => l.toLowerCase().includes(qLower));
|
|
117
|
+
if (relevant.length > 0) {
|
|
118
|
+
content = relevant.join('\n');
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
return { ok: true, sessionId, content, metadata: entry.metadata };
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* Remove sessions older than maxAge ms.
|
|
127
|
+
* @param {object} opts — { cacheDir?, maxAge? }
|
|
128
|
+
* @returns {{ removed: number }}
|
|
129
|
+
*/
|
|
130
|
+
async function cleanup(opts = {}) {
|
|
131
|
+
const cacheDir = opts.cacheDir || CACHE_DIR;
|
|
132
|
+
const maxAge = opts.maxAge !== undefined ? opts.maxAge : MAX_AGE_MS;
|
|
133
|
+
const cutoff = Date.now() - maxAge + 1;
|
|
134
|
+
|
|
135
|
+
const meta = await readMeta(cacheDir);
|
|
136
|
+
const sessions = meta.sessions || {};
|
|
137
|
+
let removed = 0;
|
|
138
|
+
|
|
139
|
+
for (const [id, entry] of Object.entries(sessions)) {
|
|
140
|
+
const createdMs = new Date(entry.createdAt).getTime();
|
|
141
|
+
if (createdMs < cutoff) {
|
|
142
|
+
// Remove session dir
|
|
143
|
+
try {
|
|
144
|
+
await fs.rm(path.join(cacheDir, id), { recursive: true, force: true });
|
|
145
|
+
} catch {
|
|
146
|
+
// best-effort
|
|
147
|
+
}
|
|
148
|
+
delete sessions[id];
|
|
149
|
+
removed++;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
meta.sessions = sessions;
|
|
154
|
+
await writeMeta(cacheDir, meta);
|
|
155
|
+
|
|
156
|
+
return { removed };
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
module.exports = { saveContextShadow, listSessions, restoreContext, cleanup };
|