bmad-method 6.0.3 → 6.0.5-next.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/.augment/code_review_guidelines.yaml +2 -42
- package/.claude/skills/bmad-os-findings-triage/SKILL.md +6 -0
- package/.claude/skills/bmad-os-findings-triage/prompts/agent-prompt.md +104 -0
- package/.claude/skills/bmad-os-findings-triage/prompts/instructions.md +286 -0
- package/.claude/skills/bmad-os-review-pr/SKILL.md +1 -1
- package/.claude/skills/bmad-os-review-pr/prompts/instructions.md +63 -6
- package/.claude/skills/bmad-os-review-prompt/SKILL.md +177 -0
- package/.claude/skills/bmad-os-root-cause-analysis/SKILL.md +12 -0
- package/.claude/skills/bmad-os-root-cause-analysis/prompts/instructions.md +74 -0
- package/.github/ISSUE_TEMPLATE/config.yaml +1 -1
- package/.github/ISSUE_TEMPLATE/documentation.yaml +1 -1
- package/.github/workflows/publish.yaml +243 -0
- package/CHANGELOG.md +32 -0
- package/CONTRIBUTING.md +1 -1
- package/README.md +8 -8
- package/README_CN.md +121 -0
- package/docs/_STYLE_GUIDE.md +10 -10
- package/docs/explanation/brainstorming.md +1 -1
- package/docs/explanation/party-mode.md +1 -1
- package/docs/explanation/preventing-agent-conflicts.md +1 -1
- package/docs/explanation/project-context.md +15 -15
- package/docs/explanation/quick-flow.md +9 -9
- package/docs/how-to/established-projects.md +7 -7
- package/docs/how-to/get-answers-about-bmad.md +2 -2
- package/docs/how-to/install-bmad.md +16 -6
- package/docs/how-to/project-context.md +2 -2
- package/docs/how-to/quick-fixes.md +5 -5
- package/docs/how-to/shard-large-documents.md +1 -1
- package/docs/how-to/upgrade-to-v6.md +8 -5
- package/docs/index.md +2 -2
- package/docs/reference/agents.md +14 -14
- package/docs/reference/commands.md +64 -70
- package/docs/reference/testing.md +1 -1
- package/docs/reference/workflow-map.md +19 -19
- package/docs/tutorials/getting-started.md +34 -34
- package/docs/zh-cn/404.md +9 -0
- package/docs/zh-cn/_STYLE_GUIDE.md +370 -0
- package/docs/zh-cn/explanation/advanced-elicitation.md +62 -0
- package/docs/zh-cn/explanation/adversarial-review.md +71 -0
- package/docs/zh-cn/explanation/brainstorming.md +43 -0
- package/docs/zh-cn/explanation/established-projects-faq.md +60 -0
- package/docs/zh-cn/explanation/party-mode.md +79 -0
- package/docs/zh-cn/explanation/preventing-agent-conflicts.md +137 -0
- package/docs/zh-cn/explanation/project-context.md +176 -0
- package/docs/zh-cn/explanation/quick-flow.md +93 -0
- package/docs/zh-cn/explanation/why-solutioning-matters.md +90 -0
- package/docs/zh-cn/how-to/customize-bmad.md +182 -0
- package/docs/zh-cn/how-to/established-projects.md +134 -0
- package/docs/zh-cn/how-to/get-answers-about-bmad.md +144 -0
- package/docs/zh-cn/how-to/install-bmad.md +105 -0
- package/docs/zh-cn/how-to/non-interactive-installation.md +181 -0
- package/docs/zh-cn/how-to/project-context.md +152 -0
- package/docs/zh-cn/how-to/quick-fixes.md +140 -0
- package/docs/zh-cn/how-to/shard-large-documents.md +86 -0
- package/docs/zh-cn/how-to/upgrade-to-v6.md +120 -0
- package/docs/zh-cn/index.md +69 -0
- package/docs/zh-cn/reference/agents.md +41 -0
- package/docs/zh-cn/reference/commands.md +166 -0
- package/docs/zh-cn/reference/modules.md +94 -0
- package/docs/zh-cn/reference/testing.md +122 -0
- package/docs/zh-cn/reference/workflow-map.md +104 -0
- package/docs/zh-cn/roadmap.mdx +152 -0
- package/docs/zh-cn/tutorials/getting-started.md +300 -0
- package/package.json +1 -1
- package/src/bmm/agents/analyst.agent.yaml +1 -1
- package/src/bmm/agents/bmad-skill-manifest.yaml +39 -0
- package/src/bmm/agents/dev.agent.yaml +2 -2
- package/src/bmm/agents/pm.agent.yaml +1 -1
- package/src/bmm/agents/qa.agent.yaml +1 -1
- package/src/bmm/agents/quick-flow-solo-dev.agent.yaml +6 -2
- package/src/bmm/agents/sm.agent.yaml +4 -4
- package/src/bmm/agents/tech-writer/bmad-skill-manifest.yaml +3 -0
- package/src/bmm/agents/tech-writer/tech-writer.agent.yaml +1 -1
- package/src/bmm/module-help.csv +11 -10
- package/src/bmm/workflows/1-analysis/create-product-brief/bmad-skill-manifest.yaml +3 -0
- package/src/bmm/workflows/1-analysis/create-product-brief/steps/step-02-vision.md +1 -1
- package/src/bmm/workflows/1-analysis/create-product-brief/steps/step-03-users.md +1 -1
- package/src/bmm/workflows/1-analysis/create-product-brief/steps/step-04-metrics.md +1 -1
- package/src/bmm/workflows/1-analysis/create-product-brief/steps/step-05-scope.md +1 -1
- package/src/bmm/workflows/1-analysis/create-product-brief/steps/step-06-complete.md +1 -1
- package/src/bmm/workflows/1-analysis/research/bmad-skill-manifest.yaml +14 -0
- package/src/bmm/workflows/2-plan-workflows/create-prd/bmad-skill-manifest.yaml +14 -0
- package/src/bmm/workflows/2-plan-workflows/create-prd/steps-c/step-02-discovery.md +1 -1
- package/src/bmm/workflows/2-plan-workflows/create-prd/steps-c/step-02b-vision.md +1 -1
- package/src/bmm/workflows/2-plan-workflows/create-prd/steps-c/step-02c-executive-summary.md +1 -1
- package/src/bmm/workflows/2-plan-workflows/create-prd/steps-c/step-03-success.md +1 -1
- package/src/bmm/workflows/2-plan-workflows/create-prd/steps-c/step-04-journeys.md +1 -1
- package/src/bmm/workflows/2-plan-workflows/create-prd/steps-c/step-05-domain.md +1 -1
- package/src/bmm/workflows/2-plan-workflows/create-prd/steps-c/step-06-innovation.md +1 -1
- package/src/bmm/workflows/2-plan-workflows/create-prd/steps-c/step-07-project-type.md +1 -1
- package/src/bmm/workflows/2-plan-workflows/create-prd/steps-c/step-08-scoping.md +1 -1
- package/src/bmm/workflows/2-plan-workflows/create-prd/steps-c/step-09-functional.md +1 -1
- package/src/bmm/workflows/2-plan-workflows/create-prd/steps-c/step-10-nonfunctional.md +1 -1
- package/src/bmm/workflows/2-plan-workflows/create-prd/steps-c/step-11-polish.md +1 -1
- package/src/bmm/workflows/2-plan-workflows/create-prd/steps-c/step-12-complete.md +1 -1
- package/src/bmm/workflows/2-plan-workflows/create-prd/steps-e/step-e-01-discovery.md +1 -1
- package/src/bmm/workflows/2-plan-workflows/create-prd/steps-e/step-e-02-review.md +1 -1
- package/src/bmm/workflows/2-plan-workflows/create-prd/steps-v/step-v-01-discovery.md +1 -1
- package/src/bmm/workflows/2-plan-workflows/create-prd/steps-v/step-v-10-smart-validation.md +1 -1
- package/src/bmm/workflows/2-plan-workflows/create-prd/steps-v/step-v-11-holistic-quality-validation.md +1 -1
- package/src/bmm/workflows/2-plan-workflows/create-prd/steps-v/step-v-13-report-complete.md +1 -1
- package/src/bmm/workflows/2-plan-workflows/create-ux-design/bmad-skill-manifest.yaml +3 -0
- package/src/bmm/workflows/2-plan-workflows/create-ux-design/steps/step-02-discovery.md +1 -1
- package/src/bmm/workflows/2-plan-workflows/create-ux-design/steps/step-03-core-experience.md +2 -2
- package/src/bmm/workflows/2-plan-workflows/create-ux-design/steps/step-04-emotional-response.md +2 -2
- package/src/bmm/workflows/2-plan-workflows/create-ux-design/steps/step-05-inspiration.md +2 -2
- package/src/bmm/workflows/2-plan-workflows/create-ux-design/steps/step-06-design-system.md +2 -2
- package/src/bmm/workflows/2-plan-workflows/create-ux-design/steps/step-07-defining-experience.md +2 -2
- package/src/bmm/workflows/2-plan-workflows/create-ux-design/steps/step-08-visual-foundation.md +2 -2
- package/src/bmm/workflows/2-plan-workflows/create-ux-design/steps/step-09-design-directions.md +2 -2
- package/src/bmm/workflows/2-plan-workflows/create-ux-design/steps/step-10-user-journeys.md +2 -2
- package/src/bmm/workflows/2-plan-workflows/create-ux-design/steps/step-11-component-strategy.md +2 -2
- package/src/bmm/workflows/2-plan-workflows/create-ux-design/steps/step-12-ux-patterns.md +2 -2
- package/src/bmm/workflows/2-plan-workflows/create-ux-design/steps/step-13-responsive-accessibility.md +2 -2
- package/src/bmm/workflows/2-plan-workflows/create-ux-design/steps/step-14-complete.md +1 -1
- package/src/bmm/workflows/3-solutioning/check-implementation-readiness/bmad-skill-manifest.yaml +3 -0
- package/src/bmm/workflows/3-solutioning/check-implementation-readiness/steps/step-06-final-assessment.md +1 -1
- package/src/bmm/workflows/3-solutioning/create-architecture/bmad-skill-manifest.yaml +3 -0
- package/src/bmm/workflows/3-solutioning/create-architecture/steps/step-02-context.md +2 -2
- package/src/bmm/workflows/3-solutioning/create-architecture/steps/step-03-starter.md +2 -2
- package/src/bmm/workflows/3-solutioning/create-architecture/steps/step-04-decisions.md +2 -2
- package/src/bmm/workflows/3-solutioning/create-architecture/steps/step-05-patterns.md +2 -2
- package/src/bmm/workflows/3-solutioning/create-architecture/steps/step-06-structure.md +2 -2
- package/src/bmm/workflows/3-solutioning/create-architecture/steps/step-07-validation.md +2 -2
- package/src/bmm/workflows/3-solutioning/create-architecture/steps/step-08-complete.md +1 -1
- package/src/bmm/workflows/3-solutioning/create-epics-and-stories/bmad-skill-manifest.yaml +3 -0
- package/src/bmm/workflows/3-solutioning/create-epics-and-stories/steps/step-01-validate-prerequisites.md +1 -1
- package/src/bmm/workflows/3-solutioning/create-epics-and-stories/steps/step-02-design-epics.md +1 -1
- package/src/bmm/workflows/3-solutioning/create-epics-and-stories/steps/step-03-create-stories.md +1 -1
- package/src/bmm/workflows/3-solutioning/create-epics-and-stories/steps/step-04-final-validation.md +2 -2
- package/src/bmm/workflows/4-implementation/code-review/bmad-skill-manifest.yaml +3 -0
- package/src/bmm/workflows/4-implementation/code-review/discover-inputs.md +88 -0
- package/src/bmm/workflows/4-implementation/code-review/workflow.md +271 -0
- package/src/bmm/workflows/4-implementation/correct-course/bmad-skill-manifest.yaml +3 -0
- package/src/bmm/workflows/4-implementation/correct-course/checklist.md +1 -1
- package/src/bmm/workflows/4-implementation/correct-course/{instructions.md → workflow.md} +79 -12
- package/src/bmm/workflows/4-implementation/create-story/bmad-skill-manifest.yaml +3 -0
- package/src/bmm/workflows/4-implementation/create-story/checklist.md +9 -10
- package/src/bmm/workflows/4-implementation/create-story/discover-inputs.md +88 -0
- package/src/bmm/workflows/4-implementation/create-story/workflow.md +388 -0
- package/src/bmm/workflows/4-implementation/dev-story/bmad-skill-manifest.yaml +3 -0
- package/src/bmm/workflows/4-implementation/dev-story/{instructions.xml → workflow.md} +49 -2
- package/src/bmm/workflows/4-implementation/retrospective/bmad-skill-manifest.yaml +3 -0
- package/src/bmm/workflows/4-implementation/retrospective/{instructions.md → workflow.md} +64 -23
- package/src/bmm/workflows/4-implementation/sprint-planning/bmad-skill-manifest.yaml +3 -0
- package/src/bmm/workflows/4-implementation/sprint-planning/sprint-status-template.yaml +1 -0
- package/src/bmm/workflows/4-implementation/sprint-planning/{instructions.md → workflow.md} +55 -10
- package/src/bmm/workflows/4-implementation/sprint-status/bmad-skill-manifest.yaml +3 -0
- package/src/bmm/workflows/4-implementation/sprint-status/{instructions.md → workflow.md} +45 -8
- package/src/bmm/workflows/bmad-quick-flow/bmad-quick-dev-new-preview/SKILL.md +6 -0
- package/src/bmm/workflows/bmad-quick-flow/bmad-quick-dev-new-preview/bmad-skill-manifest.yaml +1 -0
- package/src/bmm/workflows/bmad-quick-flow/bmad-quick-dev-new-preview/steps/step-01-clarify-and-route.md +54 -0
- package/src/bmm/workflows/bmad-quick-flow/bmad-quick-dev-new-preview/steps/step-02-plan.md +39 -0
- package/src/bmm/workflows/bmad-quick-flow/bmad-quick-dev-new-preview/steps/step-03-implement.md +35 -0
- package/src/bmm/workflows/bmad-quick-flow/bmad-quick-dev-new-preview/steps/step-04-review.md +55 -0
- package/src/bmm/workflows/bmad-quick-flow/bmad-quick-dev-new-preview/steps/step-05-present.md +19 -0
- package/src/bmm/workflows/bmad-quick-flow/bmad-quick-dev-new-preview/tech-spec-template.md +90 -0
- package/src/bmm/workflows/bmad-quick-flow/bmad-quick-dev-new-preview/workflow.md +84 -0
- package/src/bmm/workflows/bmad-quick-flow/quick-dev/bmad-skill-manifest.yaml +3 -0
- package/src/bmm/workflows/bmad-quick-flow/quick-dev/steps/step-05-adversarial-review.md +8 -14
- package/src/bmm/workflows/bmad-quick-flow/quick-dev/workflow.md +1 -1
- package/src/bmm/workflows/bmad-quick-flow/quick-spec/bmad-skill-manifest.yaml +3 -0
- package/src/bmm/workflows/bmad-quick-flow/quick-spec/steps/step-04-review.md +4 -6
- package/src/bmm/workflows/bmad-quick-flow/quick-spec/workflow.md +1 -1
- package/src/bmm/workflows/document-project/bmad-skill-manifest.yaml +3 -0
- package/src/bmm/workflows/document-project/instructions.md +5 -7
- package/src/bmm/workflows/document-project/workflow.md +39 -0
- package/src/bmm/workflows/document-project/workflows/deep-dive-instructions.md +0 -1
- package/src/bmm/workflows/document-project/workflows/deep-dive-workflow.md +42 -0
- package/src/bmm/workflows/document-project/workflows/full-scan-instructions.md +0 -1
- package/src/bmm/workflows/document-project/workflows/full-scan-workflow.md +42 -0
- package/src/bmm/workflows/generate-project-context/bmad-skill-manifest.yaml +3 -0
- package/src/bmm/workflows/generate-project-context/steps/step-02-generate.md +2 -2
- package/src/bmm/workflows/qa-generate-e2e-tests/bmad-skill-manifest.yaml +3 -0
- package/src/bmm/workflows/qa-generate-e2e-tests/checklist.md +1 -1
- package/src/bmm/workflows/qa-generate-e2e-tests/{instructions.md → workflow.md} +40 -7
- package/src/core/agents/bmad-master.agent.yaml +1 -1
- package/src/core/agents/bmad-skill-manifest.yaml +3 -0
- package/src/core/module-help.csv +3 -2
- package/src/core/module.yaml +1 -1
- package/src/core/tasks/bmad-help/SKILL.md +6 -0
- package/src/core/tasks/bmad-help/bmad-skill-manifest.yaml +1 -0
- package/src/core/tasks/{help.md → bmad-help/workflow.md} +6 -4
- package/src/core/tasks/bmad-review-adversarial-general/SKILL.md +6 -0
- package/src/core/tasks/bmad-review-adversarial-general/bmad-skill-manifest.yaml +1 -0
- package/src/core/tasks/bmad-review-adversarial-general/workflow.md +32 -0
- package/src/core/tasks/bmad-review-edge-case-hunter/SKILL.md +6 -0
- package/src/core/tasks/bmad-review-edge-case-hunter/bmad-skill-manifest.yaml +1 -0
- package/src/core/tasks/bmad-review-edge-case-hunter/workflow.md +62 -0
- package/src/core/tasks/bmad-skill-manifest.yaml +19 -0
- package/src/core/workflows/advanced-elicitation/bmad-skill-manifest.yaml +3 -0
- package/src/core/workflows/advanced-elicitation/workflow.md +138 -0
- package/src/core/workflows/brainstorming/bmad-skill-manifest.yaml +3 -0
- package/src/core/workflows/brainstorming/steps/step-01-session-setup.md +31 -18
- package/src/core/workflows/brainstorming/steps/step-01b-continue.md +1 -1
- package/src/core/workflows/brainstorming/steps/step-03-technique-execution.md +3 -3
- package/src/core/workflows/brainstorming/steps/step-04-idea-organization.md +2 -2
- package/src/core/workflows/brainstorming/workflow.md +5 -3
- package/src/core/workflows/party-mode/bmad-skill-manifest.yaml +3 -0
- package/src/core/workflows/party-mode/workflow.md +1 -1
- package/src/utility/agent-components/activation-steps.txt +2 -2
- package/src/utility/agent-components/handler-multi.txt +1 -2
- package/test/adversarial-review-tests/README.md +3 -3
- package/test/adversarial-review-tests/test-cases.yaml +2 -2
- package/test/fixtures/agent-schema/valid/menu/multiple-menu-items.agent.yaml +1 -1
- package/test/fixtures/agent-schema/valid/menu-commands/all-command-types.agent.yaml +1 -1
- package/test/fixtures/agent-schema/valid/menu-commands/multiple-commands.agent.yaml +1 -2
- package/test/fixtures/file-refs-csv/valid/bmm-style.csv +1 -1
- package/test/test-file-refs-csv.js +1 -1
- package/test/test-install-to-bmad.js +154 -0
- package/test/test-installation-components.js +1586 -2
- package/test/test-workflow-path-regex.js +88 -0
- package/tools/cli/installers/install-messages.yaml +1 -1
- package/tools/cli/installers/lib/core/installer.js +34 -1
- package/tools/cli/installers/lib/core/manifest-generator.js +332 -41
- package/tools/cli/installers/lib/ide/_base-ide.js +24 -15
- package/tools/cli/installers/lib/ide/_config-driven.js +547 -53
- package/tools/cli/installers/lib/ide/manager.js +26 -62
- package/tools/cli/installers/lib/ide/platform-codes.yaml +116 -29
- package/tools/cli/installers/lib/ide/shared/agent-command-generator.js +1 -0
- package/tools/cli/installers/lib/ide/shared/bmad-artifacts.js +7 -0
- package/tools/cli/installers/lib/ide/shared/path-utils.js +68 -3
- package/tools/cli/installers/lib/ide/shared/skill-manifest.js +90 -0
- package/tools/cli/installers/lib/ide/shared/task-tool-command-generator.js +2 -0
- package/tools/cli/installers/lib/ide/shared/workflow-command-generator.js +6 -145
- package/tools/cli/installers/lib/ide/templates/agent-command-template.md +1 -1
- package/tools/cli/installers/lib/ide/templates/combined/default-workflow.md +1 -1
- package/tools/cli/installers/lib/ide/templates/combined/gemini-workflow-yaml.toml +1 -1
- package/tools/cli/installers/lib/ide/templates/combined/gemini-workflow.toml +1 -1
- package/tools/cli/installers/lib/ide/templates/combined/opencode-agent.md +1 -1
- package/tools/cli/installers/lib/ide/templates/combined/opencode-task.md +0 -1
- package/tools/cli/installers/lib/ide/templates/combined/opencode-tool.md +0 -1
- package/tools/cli/installers/lib/ide/templates/combined/opencode-workflow-yaml.md +0 -1
- package/tools/cli/installers/lib/ide/templates/combined/opencode-workflow.md +0 -1
- package/tools/cli/installers/lib/modules/manager.js +9 -132
- package/tools/cli/lib/agent/compiler.js +1 -10
- package/tools/cli/lib/agent-analyzer.js +2 -14
- package/tools/cli/lib/yaml-xml-builder.js +1 -18
- package/tools/docs/native-skills-migration-checklist.md +281 -0
- package/tools/platform-codes.yaml +1 -1
- package/tools/schema/agent.js +1 -3
- package/tools/validate-file-refs.js +2 -0
- package/website/astro.config.mjs +24 -3
- package/website/src/content/config.ts +2 -1
- package/website/src/content/i18n/zh-CN.json +28 -0
- package/src/bmm/workflows/4-implementation/code-review/instructions.xml +0 -227
- package/src/bmm/workflows/4-implementation/code-review/workflow.yaml +0 -43
- package/src/bmm/workflows/4-implementation/correct-course/workflow.yaml +0 -53
- package/src/bmm/workflows/4-implementation/create-story/instructions.xml +0 -346
- package/src/bmm/workflows/4-implementation/create-story/workflow.yaml +0 -52
- package/src/bmm/workflows/4-implementation/dev-story/workflow.yaml +0 -20
- package/src/bmm/workflows/4-implementation/retrospective/workflow.yaml +0 -52
- package/src/bmm/workflows/4-implementation/sprint-planning/workflow.yaml +0 -47
- package/src/bmm/workflows/4-implementation/sprint-status/workflow.yaml +0 -25
- package/src/bmm/workflows/document-project/workflow.yaml +0 -22
- package/src/bmm/workflows/document-project/workflows/deep-dive.yaml +0 -31
- package/src/bmm/workflows/document-project/workflows/full-scan.yaml +0 -31
- package/src/bmm/workflows/qa-generate-e2e-tests/workflow.yaml +0 -42
- package/src/core/tasks/review-adversarial-general.xml +0 -49
- package/src/core/tasks/workflow.xml +0 -235
- package/src/core/workflows/advanced-elicitation/workflow.xml +0 -118
- package/src/utility/agent-components/handler-validate-workflow.txt +0 -7
- package/src/utility/agent-components/handler-workflow.txt +0 -10
- package/tools/cli/installers/lib/ide/codex.js +0 -440
- package/tools/cli/installers/lib/ide/github-copilot.js +0 -699
- package/tools/cli/installers/lib/ide/kilo.js +0 -269
- package/tools/cli/installers/lib/ide/rovodev.js +0 -257
- package/tools/cli/installers/lib/ide/templates/combined/default-workflow-yaml.md +0 -14
- package/tools/cli/installers/lib/ide/templates/combined/kiro-workflow-yaml.md +0 -15
- package/tools/cli/installers/lib/ide/templates/workflow-command-template.md +0 -13
- package/tools/cli/installers/lib/ide/templates/workflow-commander.md +0 -5
|
@@ -1,440 +0,0 @@
|
|
|
1
|
-
const path = require('node:path');
|
|
2
|
-
const os = require('node:os');
|
|
3
|
-
const fs = require('fs-extra');
|
|
4
|
-
const yaml = require('yaml');
|
|
5
|
-
const { BaseIdeSetup } = require('./_base-ide');
|
|
6
|
-
const { WorkflowCommandGenerator } = require('./shared/workflow-command-generator');
|
|
7
|
-
const { AgentCommandGenerator } = require('./shared/agent-command-generator');
|
|
8
|
-
const { TaskToolCommandGenerator } = require('./shared/task-tool-command-generator');
|
|
9
|
-
const { getTasksFromBmad } = require('./shared/bmad-artifacts');
|
|
10
|
-
const { toDashPath, customAgentDashName } = require('./shared/path-utils');
|
|
11
|
-
const prompts = require('../../../lib/prompts');
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Codex setup handler (CLI mode)
|
|
15
|
-
*/
|
|
16
|
-
class CodexSetup extends BaseIdeSetup {
|
|
17
|
-
constructor() {
|
|
18
|
-
super('codex', 'Codex', false);
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* Setup Codex configuration
|
|
23
|
-
* @param {string} projectDir - Project directory
|
|
24
|
-
* @param {string} bmadDir - BMAD installation directory
|
|
25
|
-
* @param {Object} options - Setup options
|
|
26
|
-
*/
|
|
27
|
-
async setup(projectDir, bmadDir, options = {}) {
|
|
28
|
-
if (!options.silent) await prompts.log.info(`Setting up ${this.name}...`);
|
|
29
|
-
|
|
30
|
-
// Always use CLI mode
|
|
31
|
-
const mode = 'cli';
|
|
32
|
-
|
|
33
|
-
const { artifacts, counts } = await this.collectClaudeArtifacts(projectDir, bmadDir, options);
|
|
34
|
-
|
|
35
|
-
// Clean up old .codex/prompts locations (both global and project)
|
|
36
|
-
const oldGlobalDir = this.getOldCodexPromptDir(null, 'global');
|
|
37
|
-
await this.clearOldBmadFiles(oldGlobalDir, options);
|
|
38
|
-
const oldProjectDir = this.getOldCodexPromptDir(projectDir, 'project');
|
|
39
|
-
await this.clearOldBmadFiles(oldProjectDir, options);
|
|
40
|
-
|
|
41
|
-
// Install to .agents/skills
|
|
42
|
-
const destDir = this.getCodexSkillsDir(projectDir);
|
|
43
|
-
await fs.ensureDir(destDir);
|
|
44
|
-
await this.clearOldBmadSkills(destDir, options);
|
|
45
|
-
|
|
46
|
-
// Collect and write agent skills
|
|
47
|
-
const agentGen = new AgentCommandGenerator(this.bmadFolderName);
|
|
48
|
-
const { artifacts: agentArtifacts } = await agentGen.collectAgentArtifacts(bmadDir, options.selectedModules || []);
|
|
49
|
-
const agentCount = await this.writeSkillArtifacts(destDir, agentArtifacts, 'agent-launcher');
|
|
50
|
-
|
|
51
|
-
// Collect and write task skills
|
|
52
|
-
const tasks = await getTasksFromBmad(bmadDir, options.selectedModules || []);
|
|
53
|
-
const taskArtifacts = [];
|
|
54
|
-
for (const task of tasks) {
|
|
55
|
-
const content = await this.readAndProcessWithProject(
|
|
56
|
-
task.path,
|
|
57
|
-
{
|
|
58
|
-
module: task.module,
|
|
59
|
-
name: task.name,
|
|
60
|
-
},
|
|
61
|
-
projectDir,
|
|
62
|
-
);
|
|
63
|
-
taskArtifacts.push({
|
|
64
|
-
type: 'task',
|
|
65
|
-
name: task.name,
|
|
66
|
-
displayName: task.name,
|
|
67
|
-
module: task.module,
|
|
68
|
-
path: task.path,
|
|
69
|
-
sourcePath: task.path,
|
|
70
|
-
relativePath: path.join(task.module, 'tasks', `${task.name}.md`),
|
|
71
|
-
content,
|
|
72
|
-
});
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
const ttGen = new TaskToolCommandGenerator(this.bmadFolderName);
|
|
76
|
-
const taskSkillArtifacts = taskArtifacts.map((artifact) => ({
|
|
77
|
-
...artifact,
|
|
78
|
-
content: ttGen.generateCommandContent(artifact, artifact.type),
|
|
79
|
-
}));
|
|
80
|
-
const tasksWritten = await this.writeSkillArtifacts(destDir, taskSkillArtifacts, 'task');
|
|
81
|
-
|
|
82
|
-
// Collect and write workflow skills
|
|
83
|
-
const workflowGenerator = new WorkflowCommandGenerator(this.bmadFolderName);
|
|
84
|
-
const { artifacts: workflowArtifacts } = await workflowGenerator.collectWorkflowArtifacts(bmadDir);
|
|
85
|
-
const workflowCount = await this.writeSkillArtifacts(destDir, workflowArtifacts, 'workflow-command');
|
|
86
|
-
|
|
87
|
-
const written = agentCount + workflowCount + tasksWritten;
|
|
88
|
-
|
|
89
|
-
if (!options.silent) {
|
|
90
|
-
await prompts.log.success(
|
|
91
|
-
`${this.name} configured: ${counts.agents} agents, ${counts.workflows} workflows, ${counts.tasks} tasks, ${written} skills → ${destDir}`,
|
|
92
|
-
);
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
return {
|
|
96
|
-
success: true,
|
|
97
|
-
mode,
|
|
98
|
-
artifacts,
|
|
99
|
-
counts,
|
|
100
|
-
destination: destDir,
|
|
101
|
-
written,
|
|
102
|
-
};
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
/**
|
|
106
|
-
* Detect Codex installation by checking for BMAD skills
|
|
107
|
-
*/
|
|
108
|
-
async detect(projectDir) {
|
|
109
|
-
const dir = this.getCodexSkillsDir(projectDir || process.cwd());
|
|
110
|
-
|
|
111
|
-
if (await fs.pathExists(dir)) {
|
|
112
|
-
try {
|
|
113
|
-
const entries = await fs.readdir(dir);
|
|
114
|
-
if (entries && entries.some((entry) => entry && typeof entry === 'string' && entry.startsWith('bmad'))) {
|
|
115
|
-
return true;
|
|
116
|
-
}
|
|
117
|
-
} catch {
|
|
118
|
-
// Ignore errors
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
return false;
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
/**
|
|
126
|
-
* Collect Claude-style artifacts for Codex export.
|
|
127
|
-
* Returns the normalized artifact list for further processing.
|
|
128
|
-
*/
|
|
129
|
-
async collectClaudeArtifacts(projectDir, bmadDir, options = {}) {
|
|
130
|
-
const selectedModules = options.selectedModules || [];
|
|
131
|
-
const artifacts = [];
|
|
132
|
-
|
|
133
|
-
// Generate agent launchers
|
|
134
|
-
const agentGen = new AgentCommandGenerator(this.bmadFolderName);
|
|
135
|
-
const { artifacts: agentArtifacts } = await agentGen.collectAgentArtifacts(bmadDir, selectedModules);
|
|
136
|
-
|
|
137
|
-
for (const artifact of agentArtifacts) {
|
|
138
|
-
artifacts.push({
|
|
139
|
-
type: 'agent',
|
|
140
|
-
module: artifact.module,
|
|
141
|
-
sourcePath: artifact.sourcePath,
|
|
142
|
-
relativePath: artifact.relativePath,
|
|
143
|
-
content: artifact.content,
|
|
144
|
-
});
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
const tasks = await getTasksFromBmad(bmadDir, selectedModules);
|
|
148
|
-
for (const task of tasks) {
|
|
149
|
-
const content = await this.readAndProcessWithProject(
|
|
150
|
-
task.path,
|
|
151
|
-
{
|
|
152
|
-
module: task.module,
|
|
153
|
-
name: task.name,
|
|
154
|
-
},
|
|
155
|
-
projectDir,
|
|
156
|
-
);
|
|
157
|
-
|
|
158
|
-
artifacts.push({
|
|
159
|
-
type: 'task',
|
|
160
|
-
name: task.name,
|
|
161
|
-
displayName: task.name,
|
|
162
|
-
module: task.module,
|
|
163
|
-
path: task.path,
|
|
164
|
-
sourcePath: task.path,
|
|
165
|
-
relativePath: path.join(task.module, 'tasks', `${task.name}.md`),
|
|
166
|
-
content,
|
|
167
|
-
});
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
const workflowGenerator = new WorkflowCommandGenerator(this.bmadFolderName);
|
|
171
|
-
const { artifacts: workflowArtifacts, counts: workflowCounts } = await workflowGenerator.collectWorkflowArtifacts(bmadDir);
|
|
172
|
-
artifacts.push(...workflowArtifacts);
|
|
173
|
-
|
|
174
|
-
return {
|
|
175
|
-
artifacts,
|
|
176
|
-
counts: {
|
|
177
|
-
agents: agentArtifacts.length,
|
|
178
|
-
tasks: tasks.length,
|
|
179
|
-
workflows: workflowCounts.commands,
|
|
180
|
-
workflowLaunchers: workflowCounts.launchers,
|
|
181
|
-
},
|
|
182
|
-
};
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
getCodexSkillsDir(projectDir) {
|
|
186
|
-
if (!projectDir) {
|
|
187
|
-
throw new Error('projectDir is required for project-scoped skill installation');
|
|
188
|
-
}
|
|
189
|
-
return path.join(projectDir, '.agents', 'skills');
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
/**
|
|
193
|
-
* Get the old .codex/prompts directory for cleanup purposes
|
|
194
|
-
*/
|
|
195
|
-
getOldCodexPromptDir(projectDir = null, location = 'global') {
|
|
196
|
-
if (location === 'project' && projectDir) {
|
|
197
|
-
return path.join(projectDir, '.codex', 'prompts');
|
|
198
|
-
}
|
|
199
|
-
return path.join(os.homedir(), '.codex', 'prompts');
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
/**
|
|
203
|
-
* Write artifacts as Agent Skills (agentskills.io format).
|
|
204
|
-
* Each artifact becomes a directory containing SKILL.md.
|
|
205
|
-
* @param {string} destDir - Base skills directory
|
|
206
|
-
* @param {Array} artifacts - Artifacts to write
|
|
207
|
-
* @param {string} artifactType - Type filter (e.g., 'agent-launcher', 'workflow-command', 'task')
|
|
208
|
-
* @returns {number} Number of skills written
|
|
209
|
-
*/
|
|
210
|
-
async writeSkillArtifacts(destDir, artifacts, artifactType) {
|
|
211
|
-
let writtenCount = 0;
|
|
212
|
-
|
|
213
|
-
for (const artifact of artifacts) {
|
|
214
|
-
// Filter by type if the artifact has a type field
|
|
215
|
-
if (artifact.type && artifact.type !== artifactType) {
|
|
216
|
-
continue;
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
// Get the dash-format name (e.g., bmad-bmm-create-prd.md) and remove .md
|
|
220
|
-
const flatName = toDashPath(artifact.relativePath);
|
|
221
|
-
const skillName = flatName.replace(/\.md$/, '');
|
|
222
|
-
|
|
223
|
-
// Create skill directory
|
|
224
|
-
const skillDir = path.join(destDir, skillName);
|
|
225
|
-
await fs.ensureDir(skillDir);
|
|
226
|
-
|
|
227
|
-
// Transform content: rewrite frontmatter for skills format
|
|
228
|
-
const skillContent = this.transformToSkillFormat(artifact.content, skillName);
|
|
229
|
-
|
|
230
|
-
// Write SKILL.md with platform-native line endings
|
|
231
|
-
const platformContent = skillContent.replaceAll('\n', os.EOL);
|
|
232
|
-
await fs.writeFile(path.join(skillDir, 'SKILL.md'), platformContent, 'utf8');
|
|
233
|
-
writtenCount++;
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
return writtenCount;
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
/**
|
|
240
|
-
* Transform artifact content from Codex prompt format to Agent Skills format.
|
|
241
|
-
* Removes disable-model-invocation, ensures name matches directory.
|
|
242
|
-
* @param {string} content - Original content with YAML frontmatter
|
|
243
|
-
* @param {string} skillName - Skill name (must match directory name)
|
|
244
|
-
* @returns {string} Transformed content
|
|
245
|
-
*/
|
|
246
|
-
transformToSkillFormat(content, skillName) {
|
|
247
|
-
// Normalize line endings so body matches rebuilt frontmatter (both LF)
|
|
248
|
-
content = content.replaceAll('\r\n', '\n').replaceAll('\r', '\n');
|
|
249
|
-
|
|
250
|
-
// Parse frontmatter
|
|
251
|
-
const fmMatch = content.match(/^---\r?\n([\s\S]*?)\r?\n---\r?\n?([\s\S]*)$/);
|
|
252
|
-
if (!fmMatch) {
|
|
253
|
-
// No frontmatter -- wrap with minimal frontmatter
|
|
254
|
-
const fm = yaml.stringify({ name: skillName, description: skillName }).trimEnd();
|
|
255
|
-
return `---\n${fm}\n---\n\n${content}`;
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
const frontmatter = fmMatch[1];
|
|
259
|
-
const body = fmMatch[2];
|
|
260
|
-
|
|
261
|
-
// Parse frontmatter with yaml library to handle all quoting variants
|
|
262
|
-
let description;
|
|
263
|
-
try {
|
|
264
|
-
const parsed = yaml.parse(frontmatter);
|
|
265
|
-
description = parsed?.description || `${skillName} skill`;
|
|
266
|
-
} catch {
|
|
267
|
-
description = `${skillName} skill`;
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
// Build new frontmatter with only skills-spec fields, let yaml handle quoting
|
|
271
|
-
const newFrontmatter = yaml.stringify({ name: skillName, description }, { lineWidth: 0 }).trimEnd();
|
|
272
|
-
return `---\n${newFrontmatter}\n---\n${body}`;
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
/**
|
|
276
|
-
* Remove existing BMAD skill directories from the skills directory.
|
|
277
|
-
*/
|
|
278
|
-
async clearOldBmadSkills(destDir, options = {}) {
|
|
279
|
-
if (!(await fs.pathExists(destDir))) {
|
|
280
|
-
return;
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
let entries;
|
|
284
|
-
try {
|
|
285
|
-
entries = await fs.readdir(destDir);
|
|
286
|
-
} catch (error) {
|
|
287
|
-
if (!options.silent) await prompts.log.warn(`Warning: Could not read directory ${destDir}: ${error.message}`);
|
|
288
|
-
return;
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
if (!entries || !Array.isArray(entries)) {
|
|
292
|
-
return;
|
|
293
|
-
}
|
|
294
|
-
|
|
295
|
-
for (const entry of entries) {
|
|
296
|
-
if (!entry || typeof entry !== 'string') {
|
|
297
|
-
continue;
|
|
298
|
-
}
|
|
299
|
-
if (!entry.startsWith('bmad')) {
|
|
300
|
-
continue;
|
|
301
|
-
}
|
|
302
|
-
|
|
303
|
-
const entryPath = path.join(destDir, entry);
|
|
304
|
-
try {
|
|
305
|
-
await fs.remove(entryPath);
|
|
306
|
-
} catch (error) {
|
|
307
|
-
if (!options.silent) {
|
|
308
|
-
await prompts.log.message(` Skipping ${entry}: ${error.message}`);
|
|
309
|
-
}
|
|
310
|
-
}
|
|
311
|
-
}
|
|
312
|
-
}
|
|
313
|
-
|
|
314
|
-
/**
|
|
315
|
-
* Clean old BMAD files from legacy .codex/prompts directories.
|
|
316
|
-
*/
|
|
317
|
-
async clearOldBmadFiles(destDir, options = {}) {
|
|
318
|
-
if (!(await fs.pathExists(destDir))) {
|
|
319
|
-
return;
|
|
320
|
-
}
|
|
321
|
-
|
|
322
|
-
let entries;
|
|
323
|
-
try {
|
|
324
|
-
entries = await fs.readdir(destDir);
|
|
325
|
-
} catch (error) {
|
|
326
|
-
// Directory exists but can't be read - skip cleanup
|
|
327
|
-
if (!options.silent) await prompts.log.warn(`Warning: Could not read directory ${destDir}: ${error.message}`);
|
|
328
|
-
return;
|
|
329
|
-
}
|
|
330
|
-
|
|
331
|
-
if (!entries || !Array.isArray(entries)) {
|
|
332
|
-
return;
|
|
333
|
-
}
|
|
334
|
-
|
|
335
|
-
for (const entry of entries) {
|
|
336
|
-
// Skip non-strings or undefined entries
|
|
337
|
-
if (!entry || typeof entry !== 'string') {
|
|
338
|
-
continue;
|
|
339
|
-
}
|
|
340
|
-
if (!entry.startsWith('bmad')) {
|
|
341
|
-
continue;
|
|
342
|
-
}
|
|
343
|
-
|
|
344
|
-
const entryPath = path.join(destDir, entry);
|
|
345
|
-
try {
|
|
346
|
-
await fs.remove(entryPath);
|
|
347
|
-
} catch (error) {
|
|
348
|
-
if (!options.silent) {
|
|
349
|
-
await prompts.log.message(` Skipping ${entry}: ${error.message}`);
|
|
350
|
-
}
|
|
351
|
-
}
|
|
352
|
-
}
|
|
353
|
-
}
|
|
354
|
-
|
|
355
|
-
async readAndProcessWithProject(filePath, metadata, projectDir) {
|
|
356
|
-
const rawContent = await fs.readFile(filePath, 'utf8');
|
|
357
|
-
const content = rawContent.replaceAll('\r\n', '\n').replaceAll('\r', '\n');
|
|
358
|
-
return super.processContent(content, metadata, projectDir);
|
|
359
|
-
}
|
|
360
|
-
|
|
361
|
-
/**
|
|
362
|
-
* Get instructions for project-specific installation
|
|
363
|
-
* @param {string} projectDir - Optional project directory
|
|
364
|
-
* @param {string} destDir - Optional destination directory
|
|
365
|
-
* @returns {string} Instructions text
|
|
366
|
-
*/
|
|
367
|
-
getProjectSpecificInstructions(projectDir = null, destDir = null) {
|
|
368
|
-
const lines = [
|
|
369
|
-
'Project-Specific Codex Configuration',
|
|
370
|
-
'',
|
|
371
|
-
`Skills installed to: ${destDir || '<project>/.agents/skills'}`,
|
|
372
|
-
'',
|
|
373
|
-
'Codex automatically discovers skills in .agents/skills/ at and above the current directory and in your home directory.',
|
|
374
|
-
'No additional configuration is needed.',
|
|
375
|
-
];
|
|
376
|
-
|
|
377
|
-
return lines.join('\n');
|
|
378
|
-
}
|
|
379
|
-
|
|
380
|
-
/**
|
|
381
|
-
* Cleanup Codex configuration - cleans both new .agents/skills and old .codex/prompts
|
|
382
|
-
*/
|
|
383
|
-
async cleanup(projectDir = null) {
|
|
384
|
-
// Clean old .codex/prompts locations
|
|
385
|
-
const oldGlobalDir = this.getOldCodexPromptDir(null, 'global');
|
|
386
|
-
await this.clearOldBmadFiles(oldGlobalDir);
|
|
387
|
-
|
|
388
|
-
if (projectDir) {
|
|
389
|
-
const oldProjectDir = this.getOldCodexPromptDir(projectDir, 'project');
|
|
390
|
-
await this.clearOldBmadFiles(oldProjectDir);
|
|
391
|
-
|
|
392
|
-
// Clean new .agents/skills location
|
|
393
|
-
const destDir = this.getCodexSkillsDir(projectDir);
|
|
394
|
-
await this.clearOldBmadSkills(destDir);
|
|
395
|
-
}
|
|
396
|
-
}
|
|
397
|
-
|
|
398
|
-
/**
|
|
399
|
-
* Install a custom agent launcher for Codex as an Agent Skill
|
|
400
|
-
* @param {string} projectDir - Project directory
|
|
401
|
-
* @param {string} agentName - Agent name (e.g., "fred-commit-poet")
|
|
402
|
-
* @param {string} agentPath - Path to compiled agent (relative to project root)
|
|
403
|
-
* @param {Object} metadata - Agent metadata
|
|
404
|
-
* @returns {Object|null} Info about created skill
|
|
405
|
-
*/
|
|
406
|
-
async installCustomAgentLauncher(projectDir, agentName, agentPath, metadata) {
|
|
407
|
-
const destDir = this.getCodexSkillsDir(projectDir);
|
|
408
|
-
|
|
409
|
-
// Skill name from the dash name (without .md)
|
|
410
|
-
const skillName = customAgentDashName(agentName).replace(/\.md$/, '');
|
|
411
|
-
const skillDir = path.join(destDir, skillName);
|
|
412
|
-
await fs.ensureDir(skillDir);
|
|
413
|
-
|
|
414
|
-
const description = metadata?.description || `${agentName} agent`;
|
|
415
|
-
const fm = yaml.stringify({ name: skillName, description }).trimEnd();
|
|
416
|
-
const skillContent =
|
|
417
|
-
`---\n${fm}\n---\n` +
|
|
418
|
-
"\nYou must fully embody this agent's persona and follow all activation instructions exactly as specified. NEVER break character until given an exit command.\n" +
|
|
419
|
-
'\n<agent-activation CRITICAL="TRUE">\n' +
|
|
420
|
-
`1. LOAD the FULL agent file from @${agentPath}\n` +
|
|
421
|
-
'2. READ its entire contents - this contains the complete agent persona, menu, and instructions\n' +
|
|
422
|
-
'3. FOLLOW every step in the <activation> section precisely\n' +
|
|
423
|
-
'4. DISPLAY the welcome/greeting as instructed\n' +
|
|
424
|
-
'5. PRESENT the numbered menu\n' +
|
|
425
|
-
'6. WAIT for user input before proceeding\n' +
|
|
426
|
-
'</agent-activation>\n';
|
|
427
|
-
|
|
428
|
-
// Write with platform-native line endings
|
|
429
|
-
const platformContent = skillContent.replaceAll('\n', os.EOL);
|
|
430
|
-
const skillPath = path.join(skillDir, 'SKILL.md');
|
|
431
|
-
await fs.writeFile(skillPath, platformContent, 'utf8');
|
|
432
|
-
|
|
433
|
-
return {
|
|
434
|
-
path: path.relative(projectDir, skillPath),
|
|
435
|
-
command: `$${skillName}`,
|
|
436
|
-
};
|
|
437
|
-
}
|
|
438
|
-
}
|
|
439
|
-
|
|
440
|
-
module.exports = { CodexSetup };
|