mdan-method 2.6.3
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/.mdan/config/config.yaml +36 -0
- package/.mdan/state/MDAN-STATE.template.json +39 -0
- package/AGENTS.md +308 -0
- package/AGENTS_LIST.md +946 -0
- package/ARCHITECTURE.md +590 -0
- package/CHANGELOG.md +1770 -0
- package/CONTRIBUTING.md +512 -0
- package/INSTALL.md +246 -0
- package/LICENSE +30 -0
- package/MDAN.fr.md +259 -0
- package/README.md +233 -0
- package/SECURITY.md +85 -0
- package/USAGE.md +368 -0
- package/app/__init__.py +5 -0
- package/app/cis/agents/__init__.py +31 -0
- package/app/cis/agents/brainstorming-coach/__init__.py +3 -0
- package/app/cis/agents/brainstorming-coach/agent.py +162 -0
- package/app/cis/agents/brainstorming-coach/prompt.yaml +53 -0
- package/app/cis/agents/creative-problem-solver/__init__.py +3 -0
- package/app/cis/agents/creative-problem-solver/agent.py +233 -0
- package/app/cis/agents/creative-problem-solver/prompt.yaml +74 -0
- package/app/cis/agents/design-thinking-coach/__init__.py +3 -0
- package/app/cis/agents/design-thinking-coach/agent.py +241 -0
- package/app/cis/agents/design-thinking-coach/prompt.yaml +77 -0
- package/app/cis/agents/innovation-strategist/__init__.py +3 -0
- package/app/cis/agents/innovation-strategist/agent.py +271 -0
- package/app/cis/agents/innovation-strategist/prompt.yaml +70 -0
- package/app/cis/agents/presentation-master/__init__.py +3 -0
- package/app/cis/agents/presentation-master/agent.py +420 -0
- package/app/cis/agents/presentation-master/prompt.yaml +62 -0
- package/app/cis/agents/storyteller/__init__.py +3 -0
- package/app/cis/agents/storyteller/agent.py +303 -0
- package/app/cis/agents/storyteller/prompt.yaml +99 -0
- package/app/core/__init__.py +5 -0
- package/app/core/agents/__init__.py +5 -0
- package/app/core/agents/mdan-master/__init__.py +7 -0
- package/app/core/agents/mdan-master/agent.py +302 -0
- package/app/core/agents/mdan-master/prompt.yaml +105 -0
- package/app/mmb/agents/__init__.py +24 -0
- package/app/mmb/agents/agent-builder/__init__.py +5 -0
- package/app/mmb/agents/agent-builder/agent.py +261 -0
- package/app/mmb/agents/agent-builder/prompt.yaml +48 -0
- package/app/mmb/agents/module-builder/__init__.py +5 -0
- package/app/mmb/agents/module-builder/agent.py +299 -0
- package/app/mmb/agents/module-builder/prompt.yaml +50 -0
- package/app/mmb/agents/workflow-builder/__init__.py +5 -0
- package/app/mmb/agents/workflow-builder/agent.py +318 -0
- package/app/mmb/agents/workflow-builder/prompt.yaml +52 -0
- package/app/mmm/agents/__init__.py +48 -0
- package/app/mmm/agents/analyst/__init__.py +7 -0
- package/app/mmm/agents/analyst/agent.py +384 -0
- package/app/mmm/agents/analyst/prompt.yaml +62 -0
- package/app/mmm/agents/architect/__init__.py +7 -0
- package/app/mmm/agents/architect/agent.py +300 -0
- package/app/mmm/agents/architect/prompt.yaml +66 -0
- package/app/mmm/agents/dev/__init__.py +7 -0
- package/app/mmm/agents/dev/agent.py +285 -0
- package/app/mmm/agents/dev/prompt.yaml +62 -0
- package/app/mmm/agents/pm/__init__.py +7 -0
- package/app/mmm/agents/pm/agent.py +417 -0
- package/app/mmm/agents/pm/prompt.yaml +64 -0
- package/app/mmm/agents/qa/__init__.py +7 -0
- package/app/mmm/agents/qa/agent.py +267 -0
- package/app/mmm/agents/qa/prompt.yaml +67 -0
- package/app/mmm/agents/quick-flow-solo-dev/__init__.py +7 -0
- package/app/mmm/agents/quick-flow-solo-dev/agent.py +319 -0
- package/app/mmm/agents/quick-flow-solo-dev/prompt.yaml +60 -0
- package/app/mmm/agents/sm/__init__.py +7 -0
- package/app/mmm/agents/sm/agent.py +357 -0
- package/app/mmm/agents/sm/prompt.yaml +61 -0
- package/app/mmm/agents/tech-writer/__init__.py +7 -0
- package/app/mmm/agents/tech-writer/agent.py +420 -0
- package/app/mmm/agents/tech-writer/prompt.yaml +70 -0
- package/app/mmm/agents/ux-designer/__init__.py +14 -0
- package/app/mmm/agents/ux-designer/agent.py +412 -0
- package/app/mmm/agents/ux-designer/prompt.yaml +37 -0
- package/app/packs/__init__.py +32 -0
- package/app/packs/db-optimization/__init__.py +13 -0
- package/app/packs/db-optimization/agents/__init__.py +11 -0
- package/app/packs/db-optimization/agents/db-performance-analyst/__init__.py +5 -0
- package/app/packs/db-optimization/agents/db-performance-analyst/agent.py +559 -0
- package/app/packs/db-optimization/agents/db-performance-analyst/prompt.yaml +63 -0
- package/app/packs/db-optimization/agents/indexing-specialist/__init__.py +5 -0
- package/app/packs/db-optimization/agents/indexing-specialist/agent.py +713 -0
- package/app/packs/db-optimization/agents/indexing-specialist/prompt.yaml +92 -0
- package/app/packs/db-optimization/agents/query-optimizer/__init__.py +5 -0
- package/app/packs/db-optimization/agents/query-optimizer/agent.py +566 -0
- package/app/packs/db-optimization/agents/query-optimizer/prompt.yaml +74 -0
- package/app/packs/devops-azure/__init__.py +13 -0
- package/app/packs/devops-azure/agents/__init__.py +11 -0
- package/app/packs/devops-azure/agents/azure-specialist/__init__.py +5 -0
- package/app/packs/devops-azure/agents/azure-specialist/agent.py +584 -0
- package/app/packs/devops-azure/agents/azure-specialist/prompt.yaml +301 -0
- package/app/packs/devops-azure/agents/cicd-architect/__init__.py +5 -0
- package/app/packs/devops-azure/agents/cicd-architect/agent.py +665 -0
- package/app/packs/devops-azure/agents/cicd-architect/prompt.yaml +409 -0
- package/app/packs/devops-azure/agents/devops-engineer/__init__.py +5 -0
- package/app/packs/devops-azure/agents/devops-engineer/agent.py +545 -0
- package/app/packs/devops-azure/agents/devops-engineer/prompt.yaml +263 -0
- package/app/packs/fintech/__init__.py +13 -0
- package/app/packs/fintech/agents/__init__.py +11 -0
- package/app/packs/fintech/agents/compliance-officer/__init__.py +5 -0
- package/app/packs/fintech/agents/compliance-officer/agent.py +449 -0
- package/app/packs/fintech/agents/compliance-officer/prompt.yaml +135 -0
- package/app/packs/fintech/agents/financial-analyst/__init__.py +5 -0
- package/app/packs/fintech/agents/financial-analyst/agent.py +392 -0
- package/app/packs/fintech/agents/financial-analyst/prompt.yaml +143 -0
- package/app/packs/fintech/agents/risk-manager/__init__.py +5 -0
- package/app/packs/fintech/agents/risk-manager/agent.py +664 -0
- package/app/packs/fintech/agents/risk-manager/prompt.yaml +240 -0
- package/app/tea/agents/tea/__init__.py +9 -0
- package/app/tea/agents/tea/agent.py +689 -0
- package/app/tea/agents/tea/prompt.yaml +100 -0
- package/cli/v1/mdan.py +421 -0
- package/cli/v1/mdan.sh +724 -0
- package/cli/v1/mdan_crewai.py +539 -0
- package/docs/404.md +9 -0
- package/docs/_STYLE_GUIDE.md +370 -0
- package/docs/explanation/advanced-elicitation.md +49 -0
- package/docs/explanation/adversarial-review.md +59 -0
- package/docs/explanation/brainstorming.md +33 -0
- package/docs/explanation/established-projects-faq.md +50 -0
- package/docs/explanation/party-mode.md +59 -0
- package/docs/explanation/preventing-agent-conflicts.md +112 -0
- package/docs/explanation/project-context.md +157 -0
- package/docs/explanation/quick-flow.md +73 -0
- package/docs/explanation/why-solutioning-matters.md +77 -0
- package/docs/how-to/customize-mdan.md +172 -0
- package/docs/how-to/established-projects.md +117 -0
- package/docs/how-to/get-answers-about-mdan.md +134 -0
- package/docs/how-to/install-mdan.md +97 -0
- package/docs/how-to/non-interactive-installation.md +171 -0
- package/docs/how-to/project-context.md +136 -0
- package/docs/how-to/quick-fixes.md +123 -0
- package/docs/how-to/shard-large-documents.md +78 -0
- package/docs/how-to/upgrade-to-v6.md +97 -0
- package/docs/index.md +59 -0
- package/docs/reference/agents.md +28 -0
- package/docs/reference/commands.md +151 -0
- package/docs/reference/modules.md +76 -0
- package/docs/reference/testing.md +106 -0
- package/docs/reference/workflow-map.md +89 -0
- package/docs/roadmap.mdx +136 -0
- package/docs/tutorials/getting-started.md +286 -0
- package/examples/crewai/crewai_auto_mode.py +62 -0
- package/examples/crewai/crewai_custom_crew.py +85 -0
- package/examples/crewai/crewai_debate.py +57 -0
- package/examples/crewai/crewai_with_serper.py +82 -0
- package/examples/crewai/crewai_with_sql.py +117 -0
- package/integrations/__init__.py +33 -0
- package/integrations/crewai/__init__.py +27 -0
- package/integrations/crewai/agents/__init__.py +21 -0
- package/integrations/crewai/agents/architect_agent.py +264 -0
- package/integrations/crewai/agents/dev_agent.py +271 -0
- package/integrations/crewai/agents/devops_agent.py +421 -0
- package/integrations/crewai/agents/doc_agent.py +388 -0
- package/integrations/crewai/agents/product_agent.py +203 -0
- package/integrations/crewai/agents/security_agent.py +386 -0
- package/integrations/crewai/agents/test_agent.py +358 -0
- package/integrations/crewai/agents/ux_agent.py +257 -0
- package/integrations/crewai/flows/__init__.py +13 -0
- package/integrations/crewai/flows/auto_flow.py +451 -0
- package/integrations/crewai/flows/build_flow.py +297 -0
- package/integrations/crewai/flows/debate_flow.py +422 -0
- package/integrations/crewai/flows/discovery_flow.py +267 -0
- package/integrations/crewai/orchestrator.py +558 -0
- package/integrations/crewai/skills/__init__.py +8 -0
- package/integrations/crewai/skills/skill_router.py +534 -0
- package/integrations/crewai/tools/__init__.py +11 -0
- package/integrations/crewai/tools/file_tool.py +355 -0
- package/integrations/crewai/tools/serper_tool.py +169 -0
- package/integrations/crewai/tools/sql_tool.py +435 -0
- package/integrations/docs/all-integrations.md +300 -0
- package/integrations/docs/cursor.md +74 -0
- package/integrations/docs/mcp.md +153 -0
- package/integrations/docs/windsurf.md +48 -0
- package/package.json +119 -0
- package/prompts/cis/brainstorming-coach.yaml +53 -0
- package/prompts/cis/creative-problem-solver.yaml +74 -0
- package/prompts/cis/design-thinking-coach.yaml +77 -0
- package/prompts/cis/innovation-strategist.yaml +70 -0
- package/prompts/cis/presentation-master.yaml +62 -0
- package/prompts/cis/storyteller.yaml +99 -0
- package/prompts/core/mdan-master.yaml +105 -0
- package/prompts/mmb/agent-builder.yaml +48 -0
- package/prompts/mmb/module-builder.yaml +50 -0
- package/prompts/mmb/workflow-builder.yaml +52 -0
- package/prompts/mmm/analyst.yaml +62 -0
- package/prompts/mmm/architect.yaml +66 -0
- package/prompts/mmm/dev.yaml +62 -0
- package/prompts/mmm/pm.yaml +64 -0
- package/prompts/mmm/qa.yaml +67 -0
- package/prompts/mmm/quick-flow-solo-dev.yaml +60 -0
- package/prompts/mmm/sm.yaml +61 -0
- package/prompts/mmm/tech-writer.yaml +70 -0
- package/prompts/mmm/ux-designer.yaml +33 -0
- package/prompts/packs/db-optimization/db-performance-analyst.yaml +63 -0
- package/prompts/packs/db-optimization/indexing-specialist.yaml +92 -0
- package/prompts/packs/db-optimization/query-optimizer.yaml +74 -0
- package/prompts/packs/devops-azure/azure-specialist.yaml +301 -0
- package/prompts/packs/devops-azure/cicd-architect.yaml +409 -0
- package/prompts/packs/devops-azure/devops-engineer.yaml +263 -0
- package/prompts/packs/fintech/compliance-officer.yaml +135 -0
- package/prompts/packs/fintech/financial-analyst.yaml +143 -0
- package/prompts/packs/fintech/risk-manager.yaml +240 -0
- package/prompts/tea/tea.yaml +100 -0
- package/requirements.txt +5 -0
- package/requirements_crewai.txt +37 -0
- package/src/agents/module-help.csv +31 -0
- package/src/agents/module.yaml +50 -0
- package/src/agents/team/analyst.agent.yaml +43 -0
- package/src/agents/team/architect.agent.yaml +29 -0
- package/src/agents/team/dev.agent.yaml +38 -0
- package/src/agents/team/pm.agent.yaml +44 -0
- package/src/agents/team/qa.agent.yaml +58 -0
- package/src/agents/team/quick-flow-solo-dev.agent.yaml +32 -0
- package/src/agents/team/sm.agent.yaml +37 -0
- package/src/agents/team/tech-writer/tech-writer-sidecar/documentation-standards.md +224 -0
- package/src/agents/team/tech-writer/tech-writer.agent.yaml +46 -0
- package/src/agents/team/ux-designer.agent.yaml +27 -0
- package/src/agents/teams/default-party.csv +20 -0
- package/src/agents/teams/team-fullstack.yaml +12 -0
- package/src/core/WIZARD-ENGINE.md +94 -0
- package/src/core/agents/mdan-master.agent.yaml +133 -0
- package/src/core/tasks/editorial-review-prose.xml +102 -0
- package/src/core/tasks/editorial-review-structure.xml +208 -0
- package/src/core/tasks/help.md +86 -0
- package/src/core/tasks/index-docs.xml +65 -0
- package/src/core/tasks/review-adversarial-general.xml +49 -0
- package/src/core/tasks/shard-doc.xml +108 -0
- package/src/core/tasks/workflow.xml +235 -0
- package/src/memory/MEMORY-AUTO.json +66 -0
- package/src/memory/MEMORY-SYSTEM.md +61 -0
- package/src/memory/v1-memory-system.md +197 -0
- package/src/memory/v1-resume-protocol.md +379 -0
- package/src/packs/db-optimization/agents/prompt.yaml +63 -0
- package/src/packs/devops-azure/agents/prompt.yaml +301 -0
- package/src/packs/fintech/agents/prompt.yaml +135 -0
- package/src/phases/auto/auto-01-load.md +165 -0
- package/src/phases/auto/auto-02-discover.md +207 -0
- package/src/phases/auto/auto-03-plan.md +509 -0
- package/src/phases/auto/auto-04-architect.md +567 -0
- package/src/phases/auto/auto-05-implement.md +713 -0
- package/src/phases/auto/auto-06-test.md +559 -0
- package/src/phases/auto/auto-07-deploy.md +510 -0
- package/src/phases/auto/auto-08-doc.md +970 -0
- package/src/phases/manual/01-discover.md +136 -0
- package/src/phases/manual/02-design.md +147 -0
- package/src/phases/manual/03-build.md +113 -0
- package/src/phases/manual/04-verify.md +107 -0
- package/src/phases/manual/05-ship.md +156 -0
- package/src/protocols/debate-protocol.md +58 -0
- package/src/protocols/universal-envelope.md +42 -0
- package/src/protocols/v1-debate-protocol.md +454 -0
- package/src/protocols/v1-universal-envelope.md +273 -0
- package/src/utility/agent-components/activation-rules.txt +6 -0
- package/src/utility/agent-components/activation-steps.txt +14 -0
- package/src/utility/agent-components/agent-command-header.md +1 -0
- package/src/utility/agent-components/agent.customize.template.yaml +41 -0
- package/src/utility/agent-components/handler-action.txt +4 -0
- package/src/utility/agent-components/handler-data.txt +5 -0
- package/src/utility/agent-components/handler-exec.txt +6 -0
- package/src/utility/agent-components/handler-multi.txt +14 -0
- package/src/utility/agent-components/handler-tmpl.txt +5 -0
- package/src/utility/agent-components/handler-validate-workflow.txt +7 -0
- package/src/utility/agent-components/handler-workflow.txt +10 -0
- package/src/utility/agent-components/menu-handlers.txt +6 -0
- package/src/wizards/01-discover/create-product-brief/steps/step-01-init.md +7 -0
- package/src/wizards/01-discover/create-product-brief/steps/step-02-vision.md +7 -0
- package/src/wizards/01-discover/create-product-brief/steps/step-03-users.md +7 -0
- package/src/wizards/01-discover/create-product-brief/steps/step-04-scope.md +7 -0
- package/src/wizards/01-discover/create-product-brief/steps/step-05-metrics.md +7 -0
- package/src/wizards/01-discover/create-product-brief/steps/step-06-complete.md +7 -0
- package/src/wizards/01-discover/create-product-brief/templates/product-brief.template.md +14 -0
- package/src/wizards/01-discover/create-product-brief/wizard.md +105 -0
- package/src/wizards/01-discover/research/domain-steps/step-01-init.md +137 -0
- package/src/wizards/01-discover/research/domain-steps/step-02-domain-analysis.md +229 -0
- package/src/wizards/01-discover/research/domain-steps/step-03-competitive-landscape.md +238 -0
- package/src/wizards/01-discover/research/domain-steps/step-04-regulatory-focus.md +206 -0
- package/src/wizards/01-discover/research/domain-steps/step-05-technical-trends.md +234 -0
- package/src/wizards/01-discover/research/domain-steps/step-06-research-synthesis.md +444 -0
- package/src/wizards/01-discover/research/market-steps/step-01-init.md +182 -0
- package/src/wizards/01-discover/research/market-steps/step-02-customer-behavior.md +237 -0
- package/src/wizards/01-discover/research/market-steps/step-03-customer-pain-points.md +249 -0
- package/src/wizards/01-discover/research/market-steps/step-04-customer-decisions.md +259 -0
- package/src/wizards/01-discover/research/market-steps/step-05-competitive-analysis.md +177 -0
- package/src/wizards/01-discover/research/market-steps/step-06-research-completion.md +476 -0
- package/src/wizards/01-discover/research/technical-steps/step-01-init.md +137 -0
- package/src/wizards/01-discover/research/technical-steps/step-02-technical-overview.md +239 -0
- package/src/wizards/01-discover/research/technical-steps/step-03-integration-patterns.md +248 -0
- package/src/wizards/01-discover/research/technical-steps/step-04-architectural-patterns.md +202 -0
- package/src/wizards/01-discover/research/technical-steps/step-05-implementation-research.md +233 -0
- package/src/wizards/01-discover/research/technical-steps/step-06-research-synthesis.md +487 -0
- package/src/wizards/01-discover/research/templates/research.template.md +29 -0
- package/src/wizards/01-discover/research/workflow-domain-research.md +54 -0
- package/src/wizards/01-discover/research/workflow-market-research.md +54 -0
- package/src/wizards/01-discover/research/workflow-technical-research.md +54 -0
- package/src/wizards/02-plan/create-prd/data/domain-complexity.csv +15 -0
- package/src/wizards/02-plan/create-prd/data/prd-purpose.md +197 -0
- package/src/wizards/02-plan/create-prd/data/project-types.csv +11 -0
- package/src/wizards/02-plan/create-prd/steps/step-01-init.md +191 -0
- package/src/wizards/02-plan/create-prd/steps/step-01b-continue.md +152 -0
- package/src/wizards/02-plan/create-prd/steps/step-02-discovery.md +224 -0
- package/src/wizards/02-plan/create-prd/steps/step-02b-vision.md +154 -0
- package/src/wizards/02-plan/create-prd/steps/step-02c-executive-summary.md +170 -0
- package/src/wizards/02-plan/create-prd/steps/step-03-success.md +226 -0
- package/src/wizards/02-plan/create-prd/steps/step-04-journeys.md +213 -0
- package/src/wizards/02-plan/create-prd/steps/step-05-domain.md +207 -0
- package/src/wizards/02-plan/create-prd/steps/step-06-innovation.md +226 -0
- package/src/wizards/02-plan/create-prd/steps/step-07-project-type.md +237 -0
- package/src/wizards/02-plan/create-prd/steps/step-08-scoping.md +228 -0
- package/src/wizards/02-plan/create-prd/steps/step-09-functional.md +231 -0
- package/src/wizards/02-plan/create-prd/steps/step-10-nonfunctional.md +242 -0
- package/src/wizards/02-plan/create-prd/steps/step-11-polish.md +217 -0
- package/src/wizards/02-plan/create-prd/steps/step-12-complete.md +124 -0
- package/src/wizards/02-plan/create-prd/templates/prd-template.md +10 -0
- package/src/wizards/02-plan/create-prd/wizard.md +63 -0
- package/src/wizards/02-plan/create-ux-design/steps/step-01-init.md +135 -0
- package/src/wizards/02-plan/create-ux-design/steps/step-01b-continue.md +127 -0
- package/src/wizards/02-plan/create-ux-design/steps/step-02-discovery.md +190 -0
- package/src/wizards/02-plan/create-ux-design/steps/step-03-core-experience.md +216 -0
- package/src/wizards/02-plan/create-ux-design/steps/step-04-emotional-response.md +219 -0
- package/src/wizards/02-plan/create-ux-design/steps/step-05-inspiration.md +234 -0
- package/src/wizards/02-plan/create-ux-design/steps/step-06-design-system.md +252 -0
- package/src/wizards/02-plan/create-ux-design/steps/step-07-defining-experience.md +254 -0
- package/src/wizards/02-plan/create-ux-design/steps/step-08-visual-foundation.md +224 -0
- package/src/wizards/02-plan/create-ux-design/steps/step-09-design-directions.md +224 -0
- package/src/wizards/02-plan/create-ux-design/steps/step-10-user-journeys.md +241 -0
- package/src/wizards/02-plan/create-ux-design/steps/step-11-component-strategy.md +248 -0
- package/src/wizards/02-plan/create-ux-design/steps/step-12-ux-patterns.md +237 -0
- package/src/wizards/02-plan/create-ux-design/steps/step-13-responsive-accessibility.md +264 -0
- package/src/wizards/02-plan/create-ux-design/steps/step-14-complete.md +171 -0
- package/src/wizards/02-plan/create-ux-design/templates/ux-design-template.md +13 -0
- package/src/wizards/02-plan/create-ux-design/wizard.md +42 -0
- package/src/wizards/03-architect/create-architecture/data/domain-complexity.csv +13 -0
- package/src/wizards/03-architect/create-architecture/data/project-types.csv +7 -0
- package/src/wizards/03-architect/create-architecture/steps/step-01-init.md +153 -0
- package/src/wizards/03-architect/create-architecture/steps/step-01b-continue.md +173 -0
- package/src/wizards/03-architect/create-architecture/steps/step-02-context.md +224 -0
- package/src/wizards/03-architect/create-architecture/steps/step-03-starter.md +329 -0
- package/src/wizards/03-architect/create-architecture/steps/step-04-decisions.md +318 -0
- package/src/wizards/03-architect/create-architecture/steps/step-05-patterns.md +359 -0
- package/src/wizards/03-architect/create-architecture/steps/step-06-structure.md +379 -0
- package/src/wizards/03-architect/create-architecture/steps/step-07-validation.md +359 -0
- package/src/wizards/03-architect/create-architecture/steps/step-08-complete.md +76 -0
- package/src/wizards/03-architect/create-architecture/templates/architecture-decision-template.md +12 -0
- package/src/wizards/03-architect/create-architecture/wizard.md +49 -0
- package/src/wizards/03-architect/create-epics/steps/step-01-validate-prerequisites.md +259 -0
- package/src/wizards/03-architect/create-epics/steps/step-02-design-epics.md +233 -0
- package/src/wizards/03-architect/create-epics/steps/step-03-create-stories.md +272 -0
- package/src/wizards/03-architect/create-epics/steps/step-04-final-validation.md +149 -0
- package/src/wizards/03-architect/create-epics/templates/epics-template.md +57 -0
- package/src/wizards/03-architect/create-epics/wizard.md +58 -0
- package/src/wizards/04-build/code-review/checklist.md +23 -0
- package/src/wizards/04-build/code-review/instructions.xml +227 -0
- package/src/wizards/04-build/code-review/workflow.yaml +43 -0
- package/src/wizards/04-build/dev-story/checklist.md +80 -0
- package/src/wizards/04-build/dev-story/instructions.xml +410 -0
- package/src/wizards/04-build/dev-story/workflow.yaml +20 -0
- package/src/wizards/04-build/sprint-planning/checklist.md +33 -0
- package/src/wizards/04-build/sprint-planning/instructions.md +226 -0
- package/src/wizards/04-build/sprint-planning/sprint-status-template.yaml +55 -0
- package/src/wizards/04-build/sprint-planning/workflow.yaml +47 -0
- package/src/wizards/05-ship/document-project/templates/deep-dive-template.md +345 -0
- package/src/wizards/05-ship/document-project/templates/index-template.md +169 -0
- package/src/wizards/05-ship/document-project/templates/project-overview-template.md +103 -0
- package/src/wizards/05-ship/document-project/templates/project-scan-report-schema.json +160 -0
- package/src/wizards/05-ship/document-project/templates/source-tree-template.md +135 -0
- package/src/wizards/05-ship/document-project/wizard.md +130 -0
- package/src/wizards/quick/quick-dev/steps/step-01-mode-detection.md +174 -0
- package/src/wizards/quick/quick-dev/steps/step-02-context-gathering.md +118 -0
- package/src/wizards/quick/quick-dev/steps/step-03-execute.md +111 -0
- package/src/wizards/quick/quick-dev/steps/step-04-self-check.md +111 -0
- package/src/wizards/quick/quick-dev/steps/step-05-adversarial-review.md +104 -0
- package/src/wizards/quick/quick-dev/steps/step-06-resolve-findings.md +146 -0
- package/src/wizards/quick/quick-dev/wizard.md +50 -0
- package/src/wizards/quick/quick-spec/steps/step-01-understand.md +189 -0
- package/src/wizards/quick/quick-spec/steps/step-02-investigate.md +143 -0
- package/src/wizards/quick/quick-spec/steps/step-03-generate.md +126 -0
- package/src/wizards/quick/quick-spec/steps/step-04-review.md +200 -0
- package/src/wizards/quick/quick-spec/templates/tech-spec-template.md +74 -0
- package/src/wizards/quick/quick-spec/wizard.md +79 -0
- package/src/wizards/special/brainstorming/methods/brain-methods.csv +62 -0
- package/src/wizards/special/brainstorming/steps/step-01-session-setup.md +197 -0
- package/src/wizards/special/brainstorming/steps/step-01b-continue.md +122 -0
- package/src/wizards/special/brainstorming/steps/step-02a-user-selected.md +225 -0
- package/src/wizards/special/brainstorming/steps/step-02b-ai-recommended.md +237 -0
- package/src/wizards/special/brainstorming/steps/step-02c-random-selection.md +209 -0
- package/src/wizards/special/brainstorming/steps/step-02d-progressive-flow.md +264 -0
- package/src/wizards/special/brainstorming/steps/step-03-technique-execution.md +399 -0
- package/src/wizards/special/brainstorming/steps/step-04-idea-organization.md +303 -0
- package/src/wizards/special/brainstorming/wizard.md +58 -0
- package/src/wizards/special/party-mode/steps/step-01-agent-loading.md +138 -0
- package/src/wizards/special/party-mode/steps/step-02-discussion-orchestration.md +187 -0
- package/src/wizards/special/party-mode/steps/step-03-graceful-exit.md +168 -0
- package/src/wizards/special/party-mode/wizard.md +194 -0
- package/test/README.md +295 -0
- package/test/adversarial-review-tests/README.md +56 -0
- package/test/adversarial-review-tests/sample-content.md +46 -0
- package/test/adversarial-review-tests/test-cases.yaml +103 -0
- package/test/fixtures/agent-schema/invalid/critical-actions/actions-as-string.agent.yaml +27 -0
- package/test/fixtures/agent-schema/invalid/critical-actions/empty-string-in-actions.agent.yaml +30 -0
- package/test/fixtures/agent-schema/invalid/menu/empty-menu.agent.yaml +22 -0
- package/test/fixtures/agent-schema/invalid/menu/missing-menu.agent.yaml +20 -0
- package/test/fixtures/agent-schema/invalid/menu-commands/empty-command-target.agent.yaml +25 -0
- package/test/fixtures/agent-schema/invalid/menu-commands/no-command-target.agent.yaml +24 -0
- package/test/fixtures/agent-schema/invalid/menu-triggers/camel-case.agent.yaml +25 -0
- package/test/fixtures/agent-schema/invalid/menu-triggers/compound-invalid-format.agent.yaml +25 -0
- package/test/fixtures/agent-schema/invalid/menu-triggers/compound-mismatched-kebab.agent.yaml +25 -0
- package/test/fixtures/agent-schema/invalid/menu-triggers/duplicate-triggers.agent.yaml +31 -0
- package/test/fixtures/agent-schema/invalid/menu-triggers/empty-trigger.agent.yaml +25 -0
- package/test/fixtures/agent-schema/invalid/menu-triggers/leading-asterisk.agent.yaml +25 -0
- package/test/fixtures/agent-schema/invalid/menu-triggers/snake-case.agent.yaml +25 -0
- package/test/fixtures/agent-schema/invalid/menu-triggers/trigger-with-spaces.agent.yaml +25 -0
- package/test/fixtures/agent-schema/invalid/metadata/empty-module-string.agent.yaml +26 -0
- package/test/fixtures/agent-schema/invalid/metadata/empty-name.agent.yaml +24 -0
- package/test/fixtures/agent-schema/invalid/metadata/extra-metadata-fields.agent.yaml +27 -0
- package/test/fixtures/agent-schema/invalid/metadata/missing-id.agent.yaml +23 -0
- package/test/fixtures/agent-schema/invalid/persona/empty-principles-array.agent.yaml +24 -0
- package/test/fixtures/agent-schema/invalid/persona/empty-string-in-principles.agent.yaml +27 -0
- package/test/fixtures/agent-schema/invalid/persona/extra-persona-fields.agent.yaml +27 -0
- package/test/fixtures/agent-schema/invalid/persona/missing-role.agent.yaml +24 -0
- package/test/fixtures/agent-schema/invalid/prompts/empty-content.agent.yaml +29 -0
- package/test/fixtures/agent-schema/invalid/prompts/extra-prompt-fields.agent.yaml +31 -0
- package/test/fixtures/agent-schema/invalid/prompts/missing-content.agent.yaml +28 -0
- package/test/fixtures/agent-schema/invalid/prompts/missing-id.agent.yaml +28 -0
- package/test/fixtures/agent-schema/invalid/top-level/empty-file.agent.yaml +5 -0
- package/test/fixtures/agent-schema/invalid/top-level/extra-top-level-keys.agent.yaml +28 -0
- package/test/fixtures/agent-schema/invalid/top-level/missing-agent-key.agent.yaml +11 -0
- package/test/fixtures/agent-schema/invalid/yaml-errors/invalid-indentation.agent.yaml +19 -0
- package/test/fixtures/agent-schema/invalid/yaml-errors/malformed-yaml.agent.yaml +18 -0
- package/test/fixtures/agent-schema/valid/critical-actions/empty-critical-actions.agent.yaml +24 -0
- package/test/fixtures/agent-schema/valid/critical-actions/no-critical-actions.agent.yaml +22 -0
- package/test/fixtures/agent-schema/valid/critical-actions/valid-critical-actions.agent.yaml +27 -0
- package/test/fixtures/agent-schema/valid/menu/multiple-menu-items.agent.yaml +31 -0
- package/test/fixtures/agent-schema/valid/menu/single-menu-item.agent.yaml +22 -0
- package/test/fixtures/agent-schema/valid/menu-commands/all-command-types.agent.yaml +38 -0
- package/test/fixtures/agent-schema/valid/menu-commands/multiple-commands.agent.yaml +24 -0
- package/test/fixtures/agent-schema/valid/menu-triggers/compound-triggers.agent.yaml +31 -0
- package/test/fixtures/agent-schema/valid/menu-triggers/kebab-case-triggers.agent.yaml +34 -0
- package/test/fixtures/agent-schema/valid/metadata/core-agent-with-module.agent.yaml +24 -0
- package/test/fixtures/agent-schema/valid/metadata/empty-module-name-in-path.agent.yaml +24 -0
- package/test/fixtures/agent-schema/valid/metadata/malformed-path-treated-as-core.agent.yaml +24 -0
- package/test/fixtures/agent-schema/valid/metadata/module-agent-correct.agent.yaml +24 -0
- package/test/fixtures/agent-schema/valid/metadata/module-agent-missing-module.agent.yaml +23 -0
- package/test/fixtures/agent-schema/valid/metadata/wrong-module-value.agent.yaml +24 -0
- package/test/fixtures/agent-schema/valid/persona/complete-persona.agent.yaml +24 -0
- package/test/fixtures/agent-schema/valid/prompts/empty-prompts.agent.yaml +24 -0
- package/test/fixtures/agent-schema/valid/prompts/no-prompts.agent.yaml +22 -0
- package/test/fixtures/agent-schema/valid/prompts/valid-prompts-minimal.agent.yaml +28 -0
- package/test/fixtures/agent-schema/valid/prompts/valid-prompts-with-description.agent.yaml +30 -0
- package/test/fixtures/agent-schema/valid/top-level/minimal-core-agent.agent.yaml +24 -0
- package/test/fixtures/file-refs-csv/invalid/all-empty-workflow.csv +3 -0
- package/test/fixtures/file-refs-csv/invalid/empty-data.csv +1 -0
- package/test/fixtures/file-refs-csv/invalid/no-workflow-column.csv +3 -0
- package/test/fixtures/file-refs-csv/invalid/unresolvable-vars.csv +3 -0
- package/test/fixtures/file-refs-csv/valid/bmm-style.csv +3 -0
- package/test/fixtures/file-refs-csv/valid/core-style.csv +3 -0
- package/test/fixtures/file-refs-csv/valid/minimal.csv +2 -0
- package/test/test-agent-schema.js +387 -0
- package/test/test-cli-integration.sh +159 -0
- package/test/test-file-refs-csv.js +133 -0
- package/test/test-installation-components.js +212 -0
- package/test/test-rehype-plugins.mjs +1050 -0
- package/test/unit-test-schema.js +133 -0
- package/tests/run_all_tests.py +80 -0
- package/tests/scenarios/cis/brainstorming-coach.test.py +150 -0
- package/tests/scenarios/cis/creative-problem-solver.test.py +167 -0
- package/tests/scenarios/cis/design-thinking-coach.test.py +177 -0
- package/tests/scenarios/cis/innovation-strategist.test.py +191 -0
- package/tests/scenarios/cis/presentation-master.test.py +240 -0
- package/tests/scenarios/cis/storyteller.test.py +324 -0
- package/tests/scenarios/core/mdan-master.test.py +281 -0
- package/tests/scenarios/mmb/agent-builder.test.py +124 -0
- package/tests/scenarios/mmb/module-builder.test.py +124 -0
- package/tests/scenarios/mmb/workflow-builder.test.py +124 -0
- package/tests/scenarios/mmm/analyst.test.py +138 -0
- package/tests/scenarios/mmm/architect.test.py +138 -0
- package/tests/scenarios/mmm/dev.test.py +138 -0
- package/tests/scenarios/mmm/pm.test.py +138 -0
- package/tests/scenarios/mmm/qa.test.py +138 -0
- package/tests/scenarios/mmm/quick-flow-solo-dev.test.py +138 -0
- package/tests/scenarios/mmm/sm.test.py +138 -0
- package/tests/scenarios/mmm/tech-writer.test.py +138 -0
- package/tests/scenarios/mmm/ux-designer.test.py +294 -0
- package/tests/scenarios/packs/db-optimization/db-performance-analyst.test.py +108 -0
- package/tests/scenarios/packs/db-optimization/indexing-specialist.test.py +108 -0
- package/tests/scenarios/packs/db-optimization/query-optimizer.test.py +106 -0
- package/tests/scenarios/packs/devops-azure/azure-specialist.test.py +125 -0
- package/tests/scenarios/packs/devops-azure/cicd-architect.test.py +122 -0
- package/tests/scenarios/packs/devops-azure/devops-engineer.test.py +128 -0
- package/tests/scenarios/packs/fintech/compliance-officer.test.py +165 -0
- package/tests/scenarios/packs/fintech/financial-analyst.test.py +184 -0
- package/tests/scenarios/packs/fintech/risk-manager.test.py +171 -0
- package/tests/scenarios/tea/tea.test.py +346 -0
- package/tests/simple_cis_test.py +285 -0
- package/tests/simple_db_optimization_test.py +199 -0
- package/tests/simple_devops_test.py +193 -0
- package/tests/simple_fintech_test.py +205 -0
- package/tests/simple_mmb_test.py +103 -0
- package/tests/simple_mmm_test.py +159 -0
- package/tests/simple_tea_test.py +80 -0
- package/tests/simple_test.py +111 -0
- package/tests/simple_ux_designer_test.py +144 -0
- package/tests/validate_yaml.py +86 -0
- package/tools/build-docs.mjs +463 -0
- package/tools/cli/README.md +60 -0
- package/tools/cli/commands/install.js +87 -0
- package/tools/cli/commands/status.js +65 -0
- package/tools/cli/commands/uninstall.js +167 -0
- package/tools/cli/external-official-modules.yaml +53 -0
- package/tools/cli/installers/install-messages.yaml +39 -0
- package/tools/cli/installers/lib/core/config-collector.js +1285 -0
- package/tools/cli/installers/lib/core/custom-module-cache.js +260 -0
- package/tools/cli/installers/lib/core/dependency-resolver.js +743 -0
- package/tools/cli/installers/lib/core/detector.js +223 -0
- package/tools/cli/installers/lib/core/ide-config-manager.js +157 -0
- package/tools/cli/installers/lib/core/installer.js +3162 -0
- package/tools/cli/installers/lib/core/manifest-generator.js +1081 -0
- package/tools/cli/installers/lib/core/manifest.js +1038 -0
- package/tools/cli/installers/lib/custom/handler.js +358 -0
- package/tools/cli/installers/lib/ide/_base-ide.js +665 -0
- package/tools/cli/installers/lib/ide/_config-driven.js +634 -0
- package/tools/cli/installers/lib/ide/codex.js +440 -0
- package/tools/cli/installers/lib/ide/github-copilot.js +699 -0
- package/tools/cli/installers/lib/ide/kilo.js +269 -0
- package/tools/cli/installers/lib/ide/manager.js +342 -0
- package/tools/cli/installers/lib/ide/platform-codes.js +100 -0
- package/tools/cli/installers/lib/ide/platform-codes.yaml +243 -0
- package/tools/cli/installers/lib/ide/rovodev.js +257 -0
- package/tools/cli/installers/lib/ide/shared/agent-command-generator.js +180 -0
- package/tools/cli/installers/lib/ide/shared/mdan-artifacts.js +174 -0
- package/tools/cli/installers/lib/ide/shared/module-injections.js +136 -0
- package/tools/cli/installers/lib/ide/shared/path-utils.js +299 -0
- package/tools/cli/installers/lib/ide/shared/task-tool-command-generator.js +366 -0
- package/tools/cli/installers/lib/ide/shared/workflow-command-generator.js +318 -0
- package/tools/cli/installers/lib/ide/templates/agent-command-template.md +14 -0
- package/tools/cli/installers/lib/ide/templates/combined/antigravity.md +8 -0
- package/tools/cli/installers/lib/ide/templates/combined/default-agent.md +15 -0
- package/tools/cli/installers/lib/ide/templates/combined/default-task.md +10 -0
- package/tools/cli/installers/lib/ide/templates/combined/default-tool.md +10 -0
- package/tools/cli/installers/lib/ide/templates/combined/default-workflow-yaml.md +14 -0
- package/tools/cli/installers/lib/ide/templates/combined/default-workflow.md +6 -0
- package/tools/cli/installers/lib/ide/templates/combined/gemini-agent.toml +14 -0
- package/tools/cli/installers/lib/ide/templates/combined/gemini-task.toml +11 -0
- package/tools/cli/installers/lib/ide/templates/combined/gemini-tool.toml +11 -0
- package/tools/cli/installers/lib/ide/templates/combined/gemini-workflow-yaml.toml +16 -0
- package/tools/cli/installers/lib/ide/templates/combined/gemini-workflow.toml +14 -0
- package/tools/cli/installers/lib/ide/templates/combined/kiro-agent.md +16 -0
- package/tools/cli/installers/lib/ide/templates/combined/kiro-task.md +9 -0
- package/tools/cli/installers/lib/ide/templates/combined/kiro-tool.md +9 -0
- package/tools/cli/installers/lib/ide/templates/combined/kiro-workflow-yaml.md +15 -0
- package/tools/cli/installers/lib/ide/templates/combined/kiro-workflow.md +7 -0
- package/tools/cli/installers/lib/ide/templates/combined/opencode-agent.md +15 -0
- package/tools/cli/installers/lib/ide/templates/combined/opencode-task.md +13 -0
- package/tools/cli/installers/lib/ide/templates/combined/opencode-tool.md +13 -0
- package/tools/cli/installers/lib/ide/templates/combined/opencode-workflow-yaml.md +16 -0
- package/tools/cli/installers/lib/ide/templates/combined/opencode-workflow.md +16 -0
- package/tools/cli/installers/lib/ide/templates/combined/rovodev.md +9 -0
- package/tools/cli/installers/lib/ide/templates/combined/trae.md +9 -0
- package/tools/cli/installers/lib/ide/templates/combined/windsurf-workflow.md +10 -0
- package/tools/cli/installers/lib/ide/templates/split/.gitkeep +0 -0
- package/tools/cli/installers/lib/ide/templates/workflow-command-template.md +13 -0
- package/tools/cli/installers/lib/ide/templates/workflow-commander.md +5 -0
- package/tools/cli/installers/lib/message-loader.js +83 -0
- package/tools/cli/installers/lib/modules/external-manager.js +136 -0
- package/tools/cli/installers/lib/modules/manager.js +1498 -0
- package/tools/cli/lib/activation-builder.js +165 -0
- package/tools/cli/lib/agent/compiler.js +525 -0
- package/tools/cli/lib/agent/installer.js +680 -0
- package/tools/cli/lib/agent/template-engine.js +152 -0
- package/tools/cli/lib/agent-analyzer.js +109 -0
- package/tools/cli/lib/agent-party-generator.js +194 -0
- package/tools/cli/lib/cli-utils.js +182 -0
- package/tools/cli/lib/config.js +213 -0
- package/tools/cli/lib/file-ops.js +204 -0
- package/tools/cli/lib/platform-codes.js +116 -0
- package/tools/cli/lib/project-root.js +77 -0
- package/tools/cli/lib/prompts.js +809 -0
- package/tools/cli/lib/ui.js +1936 -0
- package/tools/cli/lib/xml-handler.js +177 -0
- package/tools/cli/lib/xml-to-markdown.js +82 -0
- package/tools/cli/lib/yaml-format.js +245 -0
- package/tools/cli/lib/yaml-xml-builder.js +587 -0
- package/tools/cli/mdan-cli.js +106 -0
- package/tools/docs/_prompt-external-modules-page.md +59 -0
- package/tools/docs/fix-refs.md +91 -0
- package/tools/fix-doc-links.js +285 -0
- package/tools/format-workflow-md.js +263 -0
- package/tools/lib/xml-utils.js +13 -0
- package/tools/mdan-npx-wrapper.js +38 -0
- package/tools/migrate-custom-module-paths.js +124 -0
- package/tools/platform-codes.yaml +157 -0
- package/tools/schema/agent.js +491 -0
- package/tools/validate-agent-schema.js +110 -0
- package/tools/validate-doc-links.js +407 -0
- package/tools/validate-file-refs.js +554 -0
- package/tools/validate-svg-changes.sh +356 -0
- package/website/README.md +75 -0
- package/website/astro.config.mjs +136 -0
- package/website/public/favicon.ico +0 -0
- package/website/public/workflow-map-diagram.html +361 -0
- package/website/src/components/Banner.astro +62 -0
- package/website/src/components/Header.astro +96 -0
- package/website/src/components/MobileMenuFooter.astro +33 -0
- package/website/src/content/config.ts +6 -0
- package/website/src/lib/site-url.mjs +25 -0
- package/website/src/pages/404.astro +11 -0
- package/website/src/pages/robots.txt.ts +48 -0
- package/website/src/rehype-base-paths.js +112 -0
- package/website/src/rehype-markdown-links.js +119 -0
- package/website/src/styles/custom.css +805 -0
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Test: Valid core agent with only required fields
|
|
2
|
+
# Expected: PASS
|
|
3
|
+
# Path context: src/core/agents/minimal-core-agent.agent.yaml
|
|
4
|
+
|
|
5
|
+
agent:
|
|
6
|
+
metadata:
|
|
7
|
+
id: minimal-test
|
|
8
|
+
name: Minimal Test Agent
|
|
9
|
+
title: Minimal Test
|
|
10
|
+
icon: ๐งช
|
|
11
|
+
hasSidecar: false
|
|
12
|
+
|
|
13
|
+
persona:
|
|
14
|
+
role: Test agent with minimal configuration
|
|
15
|
+
identity: I am a minimal test agent used for schema validation testing.
|
|
16
|
+
communication_style: Clear and concise
|
|
17
|
+
principles:
|
|
18
|
+
- Validate schema requirements
|
|
19
|
+
- Demonstrate minimal valid structure
|
|
20
|
+
|
|
21
|
+
menu:
|
|
22
|
+
- trigger: help
|
|
23
|
+
description: Show help
|
|
24
|
+
action: display_help
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module,phase,name,workflow-file,description
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
module,phase,name,code,sequence,workflow-file,command,required,agent,options,description,output-location,outputs,
|
|
2
|
+
bmm,anytime,Document Project,DP,,_.mdan/bmm/workflows/document-project/workflow.yaml,mdan-bmm-document-project,false,analyst,Create Mode,"Analyze project",project-knowledge,*,
|
|
3
|
+
bmm,1-analysis,Brainstorm Project,BP,10,_.mdan/core/workflows/brainstorming/workflow.md,mdan-brainstorming,false,analyst,data=template.md,"Brainstorming",planning_artifacts,"session",
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
module,phase,name,code,sequence,workflow-file,command,required,agent,options,description,output-location,outputs
|
|
2
|
+
core,anytime,Brainstorming,BSP,,_.mdan/core/workflows/brainstorming/workflow.md,mdan-brainstorming,false,analyst,,"Generate ideas",{output_folder}/brainstorming.md,
|
|
3
|
+
core,anytime,Party Mode,PM,,_.mdan/core/workflows/party-mode/workflow.md,mdan-party-mode,false,facilitator,,"Multi-agent discussion",,
|
|
@@ -0,0 +1,387 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent Schema Validation Test Runner
|
|
3
|
+
*
|
|
4
|
+
* Runs all test fixtures and verifies expected outcomes.
|
|
5
|
+
* Reports pass/fail for each test and overall coverage statistics.
|
|
6
|
+
*
|
|
7
|
+
* Usage: node test/test-agent-schema.js
|
|
8
|
+
* Exit codes: 0 = all tests pass, 1 = test failures
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
const fs = require('node:fs');
|
|
12
|
+
const path = require('node:path');
|
|
13
|
+
const yaml = require('yaml');
|
|
14
|
+
const { validateAgentFile } = require('../tools/schema/agent.js');
|
|
15
|
+
const { glob } = require('glob');
|
|
16
|
+
|
|
17
|
+
// ANSI color codes
|
|
18
|
+
const colors = {
|
|
19
|
+
reset: '\u001B[0m',
|
|
20
|
+
green: '\u001B[32m',
|
|
21
|
+
red: '\u001B[31m',
|
|
22
|
+
yellow: '\u001B[33m',
|
|
23
|
+
blue: '\u001B[34m',
|
|
24
|
+
cyan: '\u001B[36m',
|
|
25
|
+
dim: '\u001B[2m',
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Parse test metadata from YAML comments
|
|
30
|
+
* @param {string} filePath
|
|
31
|
+
* @returns {{shouldPass: boolean, errorExpectation?: object, pathContext?: string}}
|
|
32
|
+
*/
|
|
33
|
+
function parseTestMetadata(filePath) {
|
|
34
|
+
const content = fs.readFileSync(filePath, 'utf8');
|
|
35
|
+
const lines = content.split('\n');
|
|
36
|
+
|
|
37
|
+
let shouldPass = true;
|
|
38
|
+
let pathContext = null;
|
|
39
|
+
const errorExpectation = {};
|
|
40
|
+
|
|
41
|
+
for (const line of lines) {
|
|
42
|
+
if (line.includes('Expected: PASS')) {
|
|
43
|
+
shouldPass = true;
|
|
44
|
+
} else if (line.includes('Expected: FAIL')) {
|
|
45
|
+
shouldPass = false;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// Parse error metadata
|
|
49
|
+
const codeMatch = line.match(/^# Error code: (.+)$/);
|
|
50
|
+
if (codeMatch) {
|
|
51
|
+
errorExpectation.code = codeMatch[1].trim();
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
const pathMatch = line.match(/^# Error path: (.+)$/);
|
|
55
|
+
if (pathMatch) {
|
|
56
|
+
errorExpectation.path = pathMatch[1].trim();
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
const messageMatch = line.match(/^# Error message: (.+)$/);
|
|
60
|
+
if (messageMatch) {
|
|
61
|
+
errorExpectation.message = messageMatch[1].trim();
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
const minimumMatch = line.match(/^# Error minimum: (\d+)$/);
|
|
65
|
+
if (minimumMatch) {
|
|
66
|
+
errorExpectation.minimum = parseInt(minimumMatch[1], 10);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
const expectedMatch = line.match(/^# Error expected: (.+)$/);
|
|
70
|
+
if (expectedMatch) {
|
|
71
|
+
errorExpectation.expected = expectedMatch[1].trim();
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
const receivedMatch = line.match(/^# Error received: (.+)$/);
|
|
75
|
+
if (receivedMatch) {
|
|
76
|
+
errorExpectation.received = receivedMatch[1].trim();
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
const keysMatch = line.match(/^# Error keys: \[(.+)\]$/);
|
|
80
|
+
if (keysMatch) {
|
|
81
|
+
errorExpectation.keys = keysMatch[1].split(',').map((k) => k.trim().replaceAll(/['"]/g, ''));
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
const contextMatch = line.match(/^# Path context: (.+)$/);
|
|
85
|
+
if (contextMatch) {
|
|
86
|
+
pathContext = contextMatch[1].trim();
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
return {
|
|
91
|
+
shouldPass,
|
|
92
|
+
errorExpectation: Object.keys(errorExpectation).length > 0 ? errorExpectation : null,
|
|
93
|
+
pathContext,
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Convert dot-notation path string to array (handles array indices)
|
|
99
|
+
* e.g., "agent.menu[0].trigger" => ["agent", "menu", 0, "trigger"]
|
|
100
|
+
*/
|
|
101
|
+
function parsePathString(pathString) {
|
|
102
|
+
return pathString
|
|
103
|
+
.replaceAll(/\[(\d+)\]/g, '.$1') // Convert [0] to .0
|
|
104
|
+
.split('.')
|
|
105
|
+
.map((part) => {
|
|
106
|
+
const num = parseInt(part, 10);
|
|
107
|
+
return isNaN(num) ? part : num;
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Validate error against expectations
|
|
113
|
+
* @param {object} error - Zod error issue
|
|
114
|
+
* @param {object} expectation - Expected error structure
|
|
115
|
+
* @returns {{valid: boolean, reason?: string}}
|
|
116
|
+
*/
|
|
117
|
+
function validateError(error, expectation) {
|
|
118
|
+
// Check error code
|
|
119
|
+
if (expectation.code && error.code !== expectation.code) {
|
|
120
|
+
return { valid: false, reason: `Expected code "${expectation.code}", got "${error.code}"` };
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
// Check error path
|
|
124
|
+
if (expectation.path) {
|
|
125
|
+
const expectedPath = parsePathString(expectation.path);
|
|
126
|
+
const actualPath = error.path;
|
|
127
|
+
|
|
128
|
+
if (JSON.stringify(expectedPath) !== JSON.stringify(actualPath)) {
|
|
129
|
+
return {
|
|
130
|
+
valid: false,
|
|
131
|
+
reason: `Expected path ${JSON.stringify(expectedPath)}, got ${JSON.stringify(actualPath)}`,
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
// For custom errors, strictly check message
|
|
137
|
+
if (expectation.code === 'custom' && expectation.message && error.message !== expectation.message) {
|
|
138
|
+
return {
|
|
139
|
+
valid: false,
|
|
140
|
+
reason: `Expected message "${expectation.message}", got "${error.message}"`,
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
// For Zod errors, check type-specific fields
|
|
145
|
+
if (expectation.minimum !== undefined && error.minimum !== expectation.minimum) {
|
|
146
|
+
return { valid: false, reason: `Expected minimum ${expectation.minimum}, got ${error.minimum}` };
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
if (expectation.expected && error.expected !== expectation.expected) {
|
|
150
|
+
return { valid: false, reason: `Expected type "${expectation.expected}", got "${error.expected}"` };
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
if (expectation.received && error.received !== expectation.received) {
|
|
154
|
+
return { valid: false, reason: `Expected received "${expectation.received}", got "${error.received}"` };
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
if (expectation.keys) {
|
|
158
|
+
const expectedKeys = expectation.keys.sort();
|
|
159
|
+
const actualKeys = (error.keys || []).sort();
|
|
160
|
+
if (JSON.stringify(expectedKeys) !== JSON.stringify(actualKeys)) {
|
|
161
|
+
return {
|
|
162
|
+
valid: false,
|
|
163
|
+
reason: `Expected keys ${JSON.stringify(expectedKeys)}, got ${JSON.stringify(actualKeys)}`,
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
return { valid: true };
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* Run a single test case
|
|
173
|
+
* @param {string} filePath
|
|
174
|
+
* @returns {{passed: boolean, message: string}}
|
|
175
|
+
*/
|
|
176
|
+
function runTest(filePath) {
|
|
177
|
+
const metadata = parseTestMetadata(filePath);
|
|
178
|
+
const { shouldPass, errorExpectation, pathContext } = metadata;
|
|
179
|
+
|
|
180
|
+
try {
|
|
181
|
+
const fileContent = fs.readFileSync(filePath, 'utf8');
|
|
182
|
+
let agentData;
|
|
183
|
+
|
|
184
|
+
try {
|
|
185
|
+
agentData = yaml.parse(fileContent);
|
|
186
|
+
} catch (parseError) {
|
|
187
|
+
// YAML parse error
|
|
188
|
+
if (shouldPass) {
|
|
189
|
+
return {
|
|
190
|
+
passed: false,
|
|
191
|
+
message: `Expected PASS but got YAML parse error: ${parseError.message}`,
|
|
192
|
+
};
|
|
193
|
+
}
|
|
194
|
+
return {
|
|
195
|
+
passed: true,
|
|
196
|
+
message: 'Got expected YAML parse error',
|
|
197
|
+
};
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
// Determine validation path
|
|
201
|
+
// If pathContext is specified in comments, use it; otherwise derive from fixture location
|
|
202
|
+
let validationPath = pathContext;
|
|
203
|
+
if (!validationPath) {
|
|
204
|
+
// Map fixture location to simulated src/ path
|
|
205
|
+
const relativePath = path.relative(path.join(__dirname, 'fixtures/agent-schema'), filePath);
|
|
206
|
+
const parts = relativePath.split(path.sep);
|
|
207
|
+
|
|
208
|
+
if (parts.includes('metadata') && parts[0] === 'valid') {
|
|
209
|
+
// Valid metadata tests: check if filename suggests module or core
|
|
210
|
+
const filename = path.basename(filePath);
|
|
211
|
+
if (filename.includes('module')) {
|
|
212
|
+
validationPath = 'src/bmm/agents/test.agent.yaml';
|
|
213
|
+
} else {
|
|
214
|
+
validationPath = 'src/core/agents/test.agent.yaml';
|
|
215
|
+
}
|
|
216
|
+
} else if (parts.includes('metadata') && parts[0] === 'invalid') {
|
|
217
|
+
// Invalid metadata tests: derive from filename
|
|
218
|
+
const filename = path.basename(filePath);
|
|
219
|
+
if (filename.includes('module') || filename.includes('wrong-module')) {
|
|
220
|
+
validationPath = 'src/bmm/agents/test.agent.yaml';
|
|
221
|
+
} else if (filename.includes('core')) {
|
|
222
|
+
validationPath = 'src/core/agents/test.agent.yaml';
|
|
223
|
+
} else {
|
|
224
|
+
validationPath = 'src/core/agents/test.agent.yaml';
|
|
225
|
+
}
|
|
226
|
+
} else {
|
|
227
|
+
// Default to core agent path
|
|
228
|
+
validationPath = 'src/core/agents/test.agent.yaml';
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
const result = validateAgentFile(validationPath, agentData);
|
|
233
|
+
|
|
234
|
+
if (result.success && shouldPass) {
|
|
235
|
+
return {
|
|
236
|
+
passed: true,
|
|
237
|
+
message: 'Validation passed as expected',
|
|
238
|
+
};
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
if (!result.success && !shouldPass) {
|
|
242
|
+
const actualError = result.error.issues[0];
|
|
243
|
+
|
|
244
|
+
// If we have error expectations, validate strictly
|
|
245
|
+
if (errorExpectation) {
|
|
246
|
+
const validation = validateError(actualError, errorExpectation);
|
|
247
|
+
|
|
248
|
+
if (!validation.valid) {
|
|
249
|
+
return {
|
|
250
|
+
passed: false,
|
|
251
|
+
message: `Error validation failed: ${validation.reason}`,
|
|
252
|
+
};
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
return {
|
|
256
|
+
passed: true,
|
|
257
|
+
message: `Got expected error (${errorExpectation.code}): ${actualError.message}`,
|
|
258
|
+
};
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
// No specific expectations - just check that it failed
|
|
262
|
+
return {
|
|
263
|
+
passed: true,
|
|
264
|
+
message: `Got expected validation error: ${actualError?.message}`,
|
|
265
|
+
};
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
if (result.success && !shouldPass) {
|
|
269
|
+
return {
|
|
270
|
+
passed: false,
|
|
271
|
+
message: 'Expected validation to FAIL but it PASSED',
|
|
272
|
+
};
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
if (!result.success && shouldPass) {
|
|
276
|
+
return {
|
|
277
|
+
passed: false,
|
|
278
|
+
message: `Expected validation to PASS but it FAILED: ${result.error.issues[0]?.message}`,
|
|
279
|
+
};
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
return {
|
|
283
|
+
passed: false,
|
|
284
|
+
message: 'Unexpected test state',
|
|
285
|
+
};
|
|
286
|
+
} catch (error) {
|
|
287
|
+
return {
|
|
288
|
+
passed: false,
|
|
289
|
+
message: `Test execution error: ${error.message}`,
|
|
290
|
+
};
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
/**
|
|
295
|
+
* Main test runner
|
|
296
|
+
*/
|
|
297
|
+
async function main() {
|
|
298
|
+
console.log(`${colors.cyan}โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ${colors.reset}`);
|
|
299
|
+
console.log(`${colors.cyan}โ Agent Schema Validation Test Suite โ${colors.reset}`);
|
|
300
|
+
console.log(`${colors.cyan}โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ${colors.reset}\n`);
|
|
301
|
+
|
|
302
|
+
// Find all test fixtures
|
|
303
|
+
const testFiles = await glob('test/fixtures/agent-schema/**/*.agent.yaml', {
|
|
304
|
+
cwd: path.join(__dirname, '..'),
|
|
305
|
+
absolute: true,
|
|
306
|
+
});
|
|
307
|
+
|
|
308
|
+
if (testFiles.length === 0) {
|
|
309
|
+
console.log(`${colors.yellow}โ ๏ธ No test fixtures found${colors.reset}`);
|
|
310
|
+
process.exit(0);
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
console.log(`Found ${colors.cyan}${testFiles.length}${colors.reset} test fixture(s)\n`);
|
|
314
|
+
|
|
315
|
+
// Group tests by category
|
|
316
|
+
const categories = {};
|
|
317
|
+
for (const testFile of testFiles) {
|
|
318
|
+
const relativePath = path.relative(path.join(__dirname, 'fixtures/agent-schema'), testFile);
|
|
319
|
+
const parts = relativePath.split(path.sep);
|
|
320
|
+
const validInvalid = parts[0]; // 'valid' or 'invalid'
|
|
321
|
+
const category = parts[1]; // 'top-level', 'metadata', etc.
|
|
322
|
+
|
|
323
|
+
const categoryKey = `${validInvalid}/${category}`;
|
|
324
|
+
if (!categories[categoryKey]) {
|
|
325
|
+
categories[categoryKey] = [];
|
|
326
|
+
}
|
|
327
|
+
categories[categoryKey].push(testFile);
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
// Run tests by category
|
|
331
|
+
let totalTests = 0;
|
|
332
|
+
let passedTests = 0;
|
|
333
|
+
const failures = [];
|
|
334
|
+
|
|
335
|
+
for (const [categoryKey, files] of Object.entries(categories).sort()) {
|
|
336
|
+
const [validInvalid, category] = categoryKey.split('/');
|
|
337
|
+
const categoryLabel = category.replaceAll('-', ' ').toUpperCase();
|
|
338
|
+
const validLabel = validInvalid === 'valid' ? 'โ
' : 'โ';
|
|
339
|
+
|
|
340
|
+
console.log(`${colors.blue}${validLabel} ${categoryLabel} (${validInvalid})${colors.reset}`);
|
|
341
|
+
|
|
342
|
+
for (const testFile of files) {
|
|
343
|
+
totalTests++;
|
|
344
|
+
const testName = path.basename(testFile, '.agent.yaml');
|
|
345
|
+
const result = runTest(testFile);
|
|
346
|
+
|
|
347
|
+
if (result.passed) {
|
|
348
|
+
passedTests++;
|
|
349
|
+
console.log(` ${colors.green}โ${colors.reset} ${testName} ${colors.dim}${result.message}${colors.reset}`);
|
|
350
|
+
} else {
|
|
351
|
+
console.log(` ${colors.red}โ${colors.reset} ${testName} ${colors.red}${result.message}${colors.reset}`);
|
|
352
|
+
failures.push({
|
|
353
|
+
file: path.relative(process.cwd(), testFile),
|
|
354
|
+
message: result.message,
|
|
355
|
+
});
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
console.log('');
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
// Summary
|
|
362
|
+
console.log(`${colors.cyan}โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ${colors.reset}`);
|
|
363
|
+
console.log(`${colors.cyan}Test Results:${colors.reset}`);
|
|
364
|
+
console.log(` Total: ${totalTests}`);
|
|
365
|
+
console.log(` Passed: ${colors.green}${passedTests}${colors.reset}`);
|
|
366
|
+
console.log(` Failed: ${passedTests === totalTests ? colors.green : colors.red}${totalTests - passedTests}${colors.reset}`);
|
|
367
|
+
console.log(`${colors.cyan}โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ${colors.reset}\n`);
|
|
368
|
+
|
|
369
|
+
// Report failures
|
|
370
|
+
if (failures.length > 0) {
|
|
371
|
+
console.log(`${colors.red}โ FAILED TESTS:${colors.reset}\n`);
|
|
372
|
+
for (const failure of failures) {
|
|
373
|
+
console.log(`${colors.red}โ${colors.reset} ${failure.file}`);
|
|
374
|
+
console.log(` ${failure.message}\n`);
|
|
375
|
+
}
|
|
376
|
+
process.exit(1);
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
console.log(`${colors.green}โจ All tests passed!${colors.reset}\n`);
|
|
380
|
+
process.exit(0);
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
// Run
|
|
384
|
+
main().catch((error) => {
|
|
385
|
+
console.error(`${colors.red}Fatal error:${colors.reset}`, error);
|
|
386
|
+
process.exit(1);
|
|
387
|
+
});
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# CLI Integration Tests for Agent Schema Validator
|
|
3
|
+
# Tests the CLI wrapper (tools/validate-agent-schema.js) behavior and error handling
|
|
4
|
+
# NOTE: Tests CLI functionality using temporary test fixtures
|
|
5
|
+
|
|
6
|
+
echo "========================================"
|
|
7
|
+
echo "CLI Integration Tests"
|
|
8
|
+
echo "========================================"
|
|
9
|
+
echo ""
|
|
10
|
+
|
|
11
|
+
# Colors
|
|
12
|
+
GREEN='\033[0;32m'
|
|
13
|
+
RED='\033[0;31m'
|
|
14
|
+
YELLOW='\033[1;33m'
|
|
15
|
+
NC='\033[0m' # No Color
|
|
16
|
+
|
|
17
|
+
PASSED=0
|
|
18
|
+
FAILED=0
|
|
19
|
+
|
|
20
|
+
# Get the repo root (assuming script is in test/ directory)
|
|
21
|
+
REPO_ROOT="$(cd "$(dirname "$0")/.." && pwd)"
|
|
22
|
+
|
|
23
|
+
# Create temp directory for test fixtures
|
|
24
|
+
TEMP_DIR=$(mktemp -d)
|
|
25
|
+
cleanup() {
|
|
26
|
+
rm -rf "$TEMP_DIR"
|
|
27
|
+
}
|
|
28
|
+
trap cleanup EXIT
|
|
29
|
+
|
|
30
|
+
# Test 1: CLI fails when no files found (exit 1)
|
|
31
|
+
echo "Test 1: CLI fails when no agent files found (should exit 1)"
|
|
32
|
+
mkdir -p "$TEMP_DIR/empty/src/core/agents"
|
|
33
|
+
OUTPUT=$(node "$REPO_ROOT/tools/validate-agent-schema.js" "$TEMP_DIR/empty" 2>&1)
|
|
34
|
+
EXIT_CODE=$?
|
|
35
|
+
if [ $EXIT_CODE -eq 1 ] && echo "$OUTPUT" | grep -q "No agent files found"; then
|
|
36
|
+
echo -e "${GREEN}โ${NC} CLI fails correctly when no files found (exit 1)"
|
|
37
|
+
PASSED=$((PASSED + 1))
|
|
38
|
+
else
|
|
39
|
+
echo -e "${RED}โ${NC} CLI failed to handle no files properly (exit code: $EXIT_CODE)"
|
|
40
|
+
FAILED=$((FAILED + 1))
|
|
41
|
+
fi
|
|
42
|
+
echo ""
|
|
43
|
+
|
|
44
|
+
# Test 2: CLI reports validation errors with exit code 1
|
|
45
|
+
echo "Test 2: CLI reports validation errors (should exit 1)"
|
|
46
|
+
mkdir -p "$TEMP_DIR/invalid/src/core/agents"
|
|
47
|
+
cat > "$TEMP_DIR/invalid/src/core/agents/bad.agent.yaml" << 'EOF'
|
|
48
|
+
agent:
|
|
49
|
+
metadata:
|
|
50
|
+
id: bad
|
|
51
|
+
name: Bad
|
|
52
|
+
title: Bad
|
|
53
|
+
icon: ๐งช
|
|
54
|
+
persona:
|
|
55
|
+
role: Test
|
|
56
|
+
identity: Test
|
|
57
|
+
communication_style: Test
|
|
58
|
+
principles: []
|
|
59
|
+
menu: []
|
|
60
|
+
EOF
|
|
61
|
+
OUTPUT=$(node "$REPO_ROOT/tools/validate-agent-schema.js" "$TEMP_DIR/invalid" 2>&1)
|
|
62
|
+
EXIT_CODE=$?
|
|
63
|
+
if [ $EXIT_CODE -eq 1 ] && echo "$OUTPUT" | grep -q "failed validation"; then
|
|
64
|
+
echo -e "${GREEN}โ${NC} CLI reports errors correctly (exit 1)"
|
|
65
|
+
PASSED=$((PASSED + 1))
|
|
66
|
+
else
|
|
67
|
+
echo -e "${RED}โ${NC} CLI failed to report errors (exit code: $EXIT_CODE)"
|
|
68
|
+
FAILED=$((FAILED + 1))
|
|
69
|
+
fi
|
|
70
|
+
echo ""
|
|
71
|
+
|
|
72
|
+
# Test 3: CLI discovers and counts agent files correctly
|
|
73
|
+
echo "Test 3: CLI discovers and counts agent files"
|
|
74
|
+
mkdir -p "$TEMP_DIR/valid/src/core/agents"
|
|
75
|
+
cat > "$TEMP_DIR/valid/src/core/agents/test1.agent.yaml" << 'EOF'
|
|
76
|
+
agent:
|
|
77
|
+
metadata:
|
|
78
|
+
id: test1
|
|
79
|
+
name: Test1
|
|
80
|
+
title: Test1
|
|
81
|
+
icon: ๐งช
|
|
82
|
+
persona:
|
|
83
|
+
role: Test
|
|
84
|
+
identity: Test
|
|
85
|
+
communication_style: Test
|
|
86
|
+
principles: [Test]
|
|
87
|
+
menu:
|
|
88
|
+
- trigger: help
|
|
89
|
+
description: Help
|
|
90
|
+
action: help
|
|
91
|
+
EOF
|
|
92
|
+
cat > "$TEMP_DIR/valid/src/core/agents/test2.agent.yaml" << 'EOF'
|
|
93
|
+
agent:
|
|
94
|
+
metadata:
|
|
95
|
+
id: test2
|
|
96
|
+
name: Test2
|
|
97
|
+
title: Test2
|
|
98
|
+
icon: ๐งช
|
|
99
|
+
persona:
|
|
100
|
+
role: Test
|
|
101
|
+
identity: Test
|
|
102
|
+
communication_style: Test
|
|
103
|
+
principles: [Test]
|
|
104
|
+
menu:
|
|
105
|
+
- trigger: help
|
|
106
|
+
description: Help
|
|
107
|
+
action: help
|
|
108
|
+
EOF
|
|
109
|
+
OUTPUT=$(node "$REPO_ROOT/tools/validate-agent-schema.js" "$TEMP_DIR/valid" 2>&1)
|
|
110
|
+
EXIT_CODE=$?
|
|
111
|
+
if [ $EXIT_CODE -eq 0 ] && echo "$OUTPUT" | grep -q "Found 2 agent file"; then
|
|
112
|
+
echo -e "${GREEN}โ${NC} CLI discovers and counts files correctly"
|
|
113
|
+
PASSED=$((PASSED + 1))
|
|
114
|
+
else
|
|
115
|
+
echo -e "${RED}โ${NC} CLI file discovery failed"
|
|
116
|
+
echo "Output: $OUTPUT"
|
|
117
|
+
FAILED=$((FAILED + 1))
|
|
118
|
+
fi
|
|
119
|
+
echo ""
|
|
120
|
+
|
|
121
|
+
# Test 4: CLI provides detailed error messages
|
|
122
|
+
echo "Test 4: CLI provides detailed error messages"
|
|
123
|
+
OUTPUT=$(node "$REPO_ROOT/tools/validate-agent-schema.js" "$TEMP_DIR/invalid" 2>&1)
|
|
124
|
+
if echo "$OUTPUT" | grep -q "Path:" && echo "$OUTPUT" | grep -q "Error:"; then
|
|
125
|
+
echo -e "${GREEN}โ${NC} CLI provides error details (Path and Error)"
|
|
126
|
+
PASSED=$((PASSED + 1))
|
|
127
|
+
else
|
|
128
|
+
echo -e "${RED}โ${NC} CLI error details missing"
|
|
129
|
+
FAILED=$((FAILED + 1))
|
|
130
|
+
fi
|
|
131
|
+
echo ""
|
|
132
|
+
|
|
133
|
+
# Test 5: CLI validates real MDAN agents (smoke test)
|
|
134
|
+
echo "Test 5: CLI validates actual MDAN agents (smoke test)"
|
|
135
|
+
OUTPUT=$(node "$REPO_ROOT/tools/validate-agent-schema.js" 2>&1)
|
|
136
|
+
EXIT_CODE=$?
|
|
137
|
+
if [ $EXIT_CODE -eq 0 ] && echo "$OUTPUT" | grep -qE "Found [0-9]+ agent file"; then
|
|
138
|
+
echo -e "${GREEN}โ${NC} CLI validates real MDAN agents successfully"
|
|
139
|
+
PASSED=$((PASSED + 1))
|
|
140
|
+
else
|
|
141
|
+
echo -e "${RED}โ${NC} CLI failed on real MDAN agents (exit code: $EXIT_CODE)"
|
|
142
|
+
FAILED=$((FAILED + 1))
|
|
143
|
+
fi
|
|
144
|
+
echo ""
|
|
145
|
+
|
|
146
|
+
# Summary
|
|
147
|
+
echo "========================================"
|
|
148
|
+
echo "Test Results:"
|
|
149
|
+
echo " Passed: ${GREEN}$PASSED${NC}"
|
|
150
|
+
echo " Failed: ${RED}$FAILED${NC}"
|
|
151
|
+
echo "========================================"
|
|
152
|
+
|
|
153
|
+
if [ $FAILED -eq 0 ]; then
|
|
154
|
+
echo -e "\n${GREEN}โจ All CLI integration tests passed!${NC}\n"
|
|
155
|
+
exit 0
|
|
156
|
+
else
|
|
157
|
+
echo -e "\n${RED}โ Some CLI integration tests failed${NC}\n"
|
|
158
|
+
exit 1
|
|
159
|
+
fi
|