bmalph 1.0.0 → 2.2.1
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/LICENSE +21 -0
- package/README.md +398 -217
- package/bmad/bmm/agents/analyst.agent.yaml +43 -36
- package/bmad/bmm/agents/architect.agent.yaml +29 -28
- package/bmad/bmm/agents/dev.agent.yaml +38 -38
- package/bmad/bmm/agents/pm.agent.yaml +44 -46
- package/bmad/bmm/agents/qa.agent.yaml +58 -0
- package/bmad/bmm/agents/quick-flow-solo-dev.agent.yaml +32 -32
- package/bmad/bmm/agents/sm.agent.yaml +37 -36
- package/bmad/bmm/agents/tech-writer/tech-writer-sidecar/documentation-standards.md +223 -223
- package/bmad/bmm/agents/tech-writer/tech-writer.agent.yaml +46 -45
- package/bmad/bmm/agents/ux-designer.agent.yaml +27 -26
- package/bmad/bmm/data/project-context-template.md +26 -26
- package/bmad/bmm/module-help.csv +31 -31
- package/bmad/bmm/module.yaml +50 -44
- package/bmad/bmm/teams/default-party.csv +20 -21
- package/bmad/bmm/teams/team-fullstack.yaml +12 -12
- package/bmad/bmm/workflows/1-analysis/create-product-brief/product-brief.template.md +10 -10
- package/bmad/bmm/workflows/1-analysis/create-product-brief/steps/step-01-init.md +177 -177
- package/bmad/bmm/workflows/1-analysis/create-product-brief/steps/step-01b-continue.md +161 -161
- package/bmad/bmm/workflows/1-analysis/create-product-brief/steps/step-02-vision.md +199 -199
- package/bmad/bmm/workflows/1-analysis/create-product-brief/steps/step-03-users.md +202 -202
- package/bmad/bmm/workflows/1-analysis/create-product-brief/steps/step-04-metrics.md +205 -205
- package/bmad/bmm/workflows/1-analysis/create-product-brief/steps/step-05-scope.md +219 -219
- package/bmad/bmm/workflows/1-analysis/create-product-brief/steps/step-06-complete.md +162 -162
- package/bmad/bmm/workflows/1-analysis/create-product-brief/workflow.md +57 -58
- package/bmad/bmm/workflows/1-analysis/research/domain-steps/step-01-init.md +137 -137
- package/bmad/bmm/workflows/1-analysis/research/domain-steps/step-02-domain-analysis.md +229 -229
- package/bmad/bmm/workflows/1-analysis/research/domain-steps/step-03-competitive-landscape.md +238 -238
- package/bmad/bmm/workflows/1-analysis/research/domain-steps/step-04-regulatory-focus.md +206 -206
- package/bmad/bmm/workflows/1-analysis/research/domain-steps/step-05-technical-trends.md +234 -234
- package/bmad/bmm/workflows/1-analysis/research/domain-steps/step-06-research-synthesis.md +443 -443
- package/bmad/bmm/workflows/1-analysis/research/market-steps/step-01-init.md +182 -182
- package/bmad/bmm/workflows/1-analysis/research/market-steps/step-02-customer-behavior.md +237 -237
- package/bmad/bmm/workflows/1-analysis/research/market-steps/step-03-customer-pain-points.md +249 -249
- package/bmad/bmm/workflows/1-analysis/research/market-steps/step-04-customer-decisions.md +259 -259
- package/bmad/bmm/workflows/1-analysis/research/market-steps/step-05-competitive-analysis.md +177 -177
- package/bmad/bmm/workflows/1-analysis/research/market-steps/step-06-research-completion.md +475 -475
- package/bmad/bmm/workflows/1-analysis/research/research.template.md +29 -29
- package/bmad/bmm/workflows/1-analysis/research/technical-steps/step-01-init.md +137 -137
- package/bmad/bmm/workflows/1-analysis/research/technical-steps/step-02-technical-overview.md +239 -239
- package/bmad/bmm/workflows/1-analysis/research/technical-steps/step-03-integration-patterns.md +248 -248
- package/bmad/bmm/workflows/1-analysis/research/technical-steps/step-04-architectural-patterns.md +202 -202
- package/bmad/bmm/workflows/1-analysis/research/technical-steps/step-05-implementation-research.md +233 -239
- package/bmad/bmm/workflows/1-analysis/research/technical-steps/step-06-research-synthesis.md +486 -486
- package/bmad/bmm/workflows/1-analysis/research/workflow-domain-research.md +54 -0
- package/bmad/bmm/workflows/1-analysis/research/workflow-market-research.md +54 -0
- package/bmad/bmm/workflows/1-analysis/research/workflow-technical-research.md +54 -0
- package/bmad/bmm/workflows/2-plan-workflows/{prd → create-prd}/data/domain-complexity.csv +14 -12
- package/bmad/bmm/workflows/2-plan-workflows/{prd → create-prd}/data/prd-purpose.md +197 -197
- package/bmad/bmm/workflows/2-plan-workflows/{prd → create-prd}/data/project-types.csv +10 -10
- package/bmad/bmm/workflows/2-plan-workflows/{prd → create-prd}/steps-c/step-01-init.md +191 -191
- package/bmad/bmm/workflows/2-plan-workflows/{prd → create-prd}/steps-c/step-01b-continue.md +153 -153
- package/bmad/bmm/workflows/2-plan-workflows/{prd → create-prd}/steps-c/step-02-discovery.md +224 -224
- package/bmad/bmm/workflows/2-plan-workflows/create-prd/steps-c/step-02b-vision.md +154 -0
- package/bmad/bmm/workflows/2-plan-workflows/create-prd/steps-c/step-02c-executive-summary.md +170 -0
- package/bmad/bmm/workflows/2-plan-workflows/{prd → create-prd}/steps-c/step-03-success.md +226 -226
- package/bmad/bmm/workflows/2-plan-workflows/{prd → create-prd}/steps-c/step-04-journeys.md +213 -213
- package/bmad/bmm/workflows/2-plan-workflows/{prd → create-prd}/steps-c/step-05-domain.md +207 -207
- package/bmad/bmm/workflows/2-plan-workflows/{prd → create-prd}/steps-c/step-06-innovation.md +226 -226
- package/bmad/bmm/workflows/2-plan-workflows/{prd → create-prd}/steps-c/step-07-project-type.md +237 -237
- package/bmad/bmm/workflows/2-plan-workflows/{prd → create-prd}/steps-c/step-08-scoping.md +228 -228
- package/bmad/bmm/workflows/2-plan-workflows/{prd → create-prd}/steps-c/step-09-functional.md +231 -231
- package/bmad/bmm/workflows/2-plan-workflows/{prd → create-prd}/steps-c/step-10-nonfunctional.md +242 -242
- package/bmad/bmm/workflows/2-plan-workflows/{prd → create-prd}/steps-c/step-11-polish.md +217 -217
- package/bmad/bmm/workflows/2-plan-workflows/{prd → create-prd}/steps-c/step-12-complete.md +124 -124
- package/bmad/bmm/workflows/2-plan-workflows/{prd → create-prd}/steps-e/step-e-01-discovery.md +247 -247
- package/bmad/bmm/workflows/2-plan-workflows/{prd → create-prd}/steps-e/step-e-01b-legacy-conversion.md +208 -208
- package/bmad/bmm/workflows/2-plan-workflows/{prd → create-prd}/steps-e/step-e-02-review.md +249 -249
- package/bmad/bmm/workflows/2-plan-workflows/{prd → create-prd}/steps-e/step-e-03-edit.md +253 -253
- package/bmad/bmm/workflows/2-plan-workflows/{prd → create-prd}/steps-e/step-e-04-complete.md +168 -168
- package/bmad/bmm/workflows/2-plan-workflows/{prd → create-prd}/steps-v/step-v-01-discovery.md +226 -218
- package/bmad/bmm/workflows/2-plan-workflows/{prd → create-prd}/steps-v/step-v-02-format-detection.md +191 -191
- package/bmad/bmm/workflows/2-plan-workflows/{prd → create-prd}/steps-v/step-v-02b-parity-check.md +209 -209
- package/bmad/bmm/workflows/2-plan-workflows/{prd → create-prd}/steps-v/step-v-03-density-validation.md +174 -174
- package/bmad/bmm/workflows/2-plan-workflows/{prd → create-prd}/steps-v/step-v-04-brief-coverage-validation.md +214 -214
- package/bmad/bmm/workflows/2-plan-workflows/{prd → create-prd}/steps-v/step-v-05-measurability-validation.md +228 -228
- package/bmad/bmm/workflows/2-plan-workflows/{prd → create-prd}/steps-v/step-v-06-traceability-validation.md +217 -217
- package/bmad/bmm/workflows/2-plan-workflows/{prd → create-prd}/steps-v/step-v-07-implementation-leakage-validation.md +205 -205
- package/bmad/bmm/workflows/2-plan-workflows/{prd → create-prd}/steps-v/step-v-08-domain-compliance-validation.md +243 -243
- package/bmad/bmm/workflows/2-plan-workflows/{prd → create-prd}/steps-v/step-v-09-project-type-validation.md +263 -263
- package/bmad/bmm/workflows/2-plan-workflows/{prd → create-prd}/steps-v/step-v-10-smart-validation.md +209 -209
- package/bmad/bmm/workflows/2-plan-workflows/{prd → create-prd}/steps-v/step-v-11-holistic-quality-validation.md +264 -264
- package/bmad/bmm/workflows/2-plan-workflows/{prd → create-prd}/steps-v/step-v-12-completeness-validation.md +242 -242
- package/bmad/bmm/workflows/2-plan-workflows/{prd → create-prd}/steps-v/step-v-13-report-complete.md +231 -231
- package/bmad/bmm/workflows/2-plan-workflows/{prd → create-prd}/templates/prd-template.md +10 -10
- package/bmad/bmm/workflows/2-plan-workflows/create-prd/workflow-create-prd.md +63 -0
- package/bmad/bmm/workflows/2-plan-workflows/create-prd/workflow-edit-prd.md +65 -0
- package/bmad/bmm/workflows/2-plan-workflows/create-prd/workflow-validate-prd.md +63 -0
- package/bmad/bmm/workflows/2-plan-workflows/create-ux-design/steps/step-01-init.md +135 -135
- package/bmad/bmm/workflows/2-plan-workflows/create-ux-design/steps/step-01b-continue.md +127 -127
- package/bmad/bmm/workflows/2-plan-workflows/create-ux-design/steps/step-02-discovery.md +190 -190
- package/bmad/bmm/workflows/2-plan-workflows/create-ux-design/steps/step-03-core-experience.md +216 -216
- package/bmad/bmm/workflows/2-plan-workflows/create-ux-design/steps/step-04-emotional-response.md +219 -219
- package/bmad/bmm/workflows/2-plan-workflows/create-ux-design/steps/step-05-inspiration.md +234 -234
- package/bmad/bmm/workflows/2-plan-workflows/create-ux-design/steps/step-06-design-system.md +252 -252
- package/bmad/bmm/workflows/2-plan-workflows/create-ux-design/steps/step-07-defining-experience.md +254 -254
- package/bmad/bmm/workflows/2-plan-workflows/create-ux-design/steps/step-08-visual-foundation.md +224 -224
- package/bmad/bmm/workflows/2-plan-workflows/create-ux-design/steps/step-09-design-directions.md +224 -224
- package/bmad/bmm/workflows/2-plan-workflows/create-ux-design/steps/step-10-user-journeys.md +241 -241
- package/bmad/bmm/workflows/2-plan-workflows/create-ux-design/steps/step-11-component-strategy.md +248 -248
- package/bmad/bmm/workflows/2-plan-workflows/create-ux-design/steps/step-12-ux-patterns.md +237 -237
- package/bmad/bmm/workflows/2-plan-workflows/create-ux-design/steps/step-13-responsive-accessibility.md +264 -264
- package/bmad/bmm/workflows/2-plan-workflows/create-ux-design/steps/step-14-complete.md +171 -171
- package/bmad/bmm/workflows/2-plan-workflows/create-ux-design/ux-design-template.md +13 -13
- package/bmad/bmm/workflows/2-plan-workflows/create-ux-design/workflow.md +42 -43
- package/bmad/bmm/workflows/3-solutioning/check-implementation-readiness/steps/step-01-document-discovery.md +184 -190
- package/bmad/bmm/workflows/3-solutioning/check-implementation-readiness/steps/step-02-prd-analysis.md +172 -178
- package/bmad/bmm/workflows/3-solutioning/check-implementation-readiness/steps/step-03-epic-coverage-validation.md +173 -179
- package/bmad/bmm/workflows/3-solutioning/check-implementation-readiness/steps/step-04-ux-alignment.md +133 -139
- package/bmad/bmm/workflows/3-solutioning/check-implementation-readiness/steps/step-05-epic-quality-review.md +245 -252
- package/bmad/bmm/workflows/3-solutioning/check-implementation-readiness/steps/step-06-final-assessment.md +129 -135
- package/bmad/bmm/workflows/3-solutioning/check-implementation-readiness/templates/readiness-report-template.md +4 -4
- package/bmad/bmm/workflows/3-solutioning/check-implementation-readiness/workflow.md +54 -55
- package/bmad/bmm/workflows/3-solutioning/create-architecture/architecture-decision-template.md +12 -12
- package/bmad/bmm/workflows/3-solutioning/create-architecture/data/domain-complexity.csv +12 -10
- package/bmad/bmm/workflows/3-solutioning/create-architecture/data/project-types.csv +6 -6
- package/bmad/bmm/workflows/3-solutioning/create-architecture/steps/step-01-init.md +153 -153
- package/bmad/bmm/workflows/3-solutioning/create-architecture/steps/step-01b-continue.md +164 -164
- package/bmad/bmm/workflows/3-solutioning/create-architecture/steps/step-02-context.md +224 -224
- package/bmad/bmm/workflows/3-solutioning/create-architecture/steps/step-03-starter.md +331 -331
- package/bmad/bmm/workflows/3-solutioning/create-architecture/steps/step-04-decisions.md +318 -318
- package/bmad/bmm/workflows/3-solutioning/create-architecture/steps/step-05-patterns.md +359 -359
- package/bmad/bmm/workflows/3-solutioning/create-architecture/steps/step-06-structure.md +379 -379
- package/bmad/bmm/workflows/3-solutioning/create-architecture/steps/step-07-validation.md +359 -359
- package/bmad/bmm/workflows/3-solutioning/create-architecture/steps/step-08-complete.md +76 -76
- package/bmad/bmm/workflows/3-solutioning/create-architecture/workflow.md +49 -50
- package/bmad/bmm/workflows/3-solutioning/create-epics-and-stories/steps/step-01-validate-prerequisites.md +259 -259
- package/bmad/bmm/workflows/3-solutioning/create-epics-and-stories/steps/step-02-design-epics.md +233 -233
- package/bmad/bmm/workflows/3-solutioning/create-epics-and-stories/steps/step-03-create-stories.md +272 -272
- package/bmad/bmm/workflows/3-solutioning/create-epics-and-stories/steps/step-04-final-validation.md +149 -149
- package/bmad/bmm/workflows/3-solutioning/create-epics-and-stories/templates/epics-template.md +57 -57
- package/bmad/bmm/workflows/3-solutioning/create-epics-and-stories/workflow.md +58 -59
- package/bmad/bmm/workflows/4-implementation/code-review/checklist.md +23 -23
- package/bmad/bmm/workflows/4-implementation/code-review/instructions.xml +226 -226
- package/bmad/bmm/workflows/4-implementation/code-review/workflow.yaml +44 -51
- package/bmad/bmm/workflows/4-implementation/correct-course/checklist.md +288 -288
- package/bmad/bmm/workflows/4-implementation/correct-course/instructions.md +207 -206
- package/bmad/bmm/workflows/4-implementation/correct-course/workflow.yaml +54 -60
- package/bmad/bmm/workflows/4-implementation/create-story/checklist.md +358 -358
- package/bmad/bmm/workflows/4-implementation/create-story/instructions.xml +346 -345
- package/bmad/bmm/workflows/4-implementation/create-story/template.md +49 -49
- package/bmad/bmm/workflows/4-implementation/create-story/workflow.yaml +53 -61
- package/bmad/bmm/workflows/4-implementation/dev-story/checklist.md +80 -80
- package/bmad/bmm/workflows/4-implementation/dev-story/instructions.xml +410 -410
- package/bmad/bmm/workflows/4-implementation/dev-story/workflow.yaml +21 -27
- package/bmad/bmm/workflows/4-implementation/retrospective/instructions.md +1444 -1443
- package/bmad/bmm/workflows/4-implementation/retrospective/workflow.yaml +53 -58
- package/bmad/bmm/workflows/4-implementation/sprint-planning/checklist.md +33 -33
- package/bmad/bmm/workflows/4-implementation/sprint-planning/instructions.md +226 -225
- package/bmad/bmm/workflows/4-implementation/sprint-planning/sprint-status-template.yaml +55 -55
- package/bmad/bmm/workflows/4-implementation/sprint-planning/workflow.yaml +47 -54
- package/bmad/bmm/workflows/4-implementation/sprint-status/instructions.md +230 -229
- package/bmad/bmm/workflows/4-implementation/sprint-status/workflow.yaml +25 -36
- package/bmad/bmm/workflows/bmad-quick-flow/quick-dev/steps/step-01-mode-detection.md +174 -156
- package/bmad/bmm/workflows/bmad-quick-flow/quick-dev/steps/step-02-context-gathering.md +118 -120
- package/bmad/bmm/workflows/bmad-quick-flow/quick-dev/steps/step-03-execute.md +111 -113
- package/bmad/bmm/workflows/bmad-quick-flow/quick-dev/steps/step-04-self-check.md +111 -113
- package/bmad/bmm/workflows/bmad-quick-flow/quick-dev/steps/step-05-adversarial-review.md +104 -106
- package/bmad/bmm/workflows/bmad-quick-flow/quick-dev/steps/step-06-resolve-findings.md +146 -140
- package/bmad/bmm/workflows/bmad-quick-flow/quick-dev/workflow.md +50 -50
- package/bmad/bmm/workflows/bmad-quick-flow/quick-spec/steps/step-01-understand.md +191 -189
- package/bmad/bmm/workflows/bmad-quick-flow/quick-spec/steps/step-02-investigate.md +144 -144
- package/bmad/bmm/workflows/bmad-quick-flow/quick-spec/steps/step-03-generate.md +127 -128
- package/bmad/bmm/workflows/bmad-quick-flow/quick-spec/steps/step-04-review.md +200 -191
- package/bmad/bmm/workflows/bmad-quick-flow/quick-spec/tech-spec-template.md +74 -74
- package/bmad/bmm/workflows/bmad-quick-flow/quick-spec/workflow.md +79 -79
- package/bmad/bmm/workflows/document-project/checklist.md +245 -245
- package/bmad/bmm/workflows/document-project/documentation-requirements.csv +12 -12
- package/bmad/bmm/workflows/document-project/instructions.md +130 -221
- package/bmad/bmm/workflows/document-project/templates/deep-dive-template.md +345 -345
- package/bmad/bmm/workflows/document-project/templates/index-template.md +169 -169
- package/bmad/bmm/workflows/document-project/templates/project-overview-template.md +103 -103
- package/bmad/bmm/workflows/document-project/templates/project-scan-report-schema.json +160 -160
- package/bmad/bmm/workflows/document-project/templates/source-tree-template.md +135 -135
- package/bmad/bmm/workflows/document-project/workflow.yaml +22 -30
- package/bmad/bmm/workflows/document-project/workflows/deep-dive-instructions.md +298 -298
- package/bmad/bmm/workflows/document-project/workflows/deep-dive.yaml +31 -31
- package/bmad/bmm/workflows/document-project/workflows/full-scan-instructions.md +1106 -1106
- package/bmad/bmm/workflows/document-project/workflows/full-scan.yaml +31 -31
- package/bmad/bmm/workflows/generate-project-context/project-context-template.md +21 -0
- package/bmad/bmm/workflows/generate-project-context/steps/step-01-discover.md +184 -0
- package/bmad/bmm/workflows/generate-project-context/steps/step-02-generate.md +318 -0
- package/bmad/bmm/workflows/generate-project-context/steps/step-03-complete.md +278 -0
- package/bmad/bmm/workflows/generate-project-context/workflow.md +49 -0
- package/bmad/bmm/workflows/qa/automate/checklist.md +33 -0
- package/bmad/bmm/workflows/qa/automate/instructions.md +110 -0
- package/bmad/bmm/workflows/qa/automate/workflow.yaml +44 -0
- package/bmad/core/agents/bmad-master.agent.yaml +30 -30
- package/bmad/core/module-help.csv +9 -11
- package/bmad/core/module.yaml +25 -25
- package/bmad/core/tasks/editorial-review-prose.xml +102 -91
- package/bmad/core/tasks/editorial-review-structure.xml +209 -198
- package/bmad/core/tasks/help.md +85 -0
- package/bmad/core/tasks/index-docs.xml +64 -64
- package/bmad/core/tasks/review-adversarial-general.xml +48 -48
- package/bmad/core/tasks/shard-doc.xml +107 -108
- package/bmad/core/tasks/workflow.xml +234 -234
- package/bmad/core/workflows/advanced-elicitation/methods.csv +51 -51
- package/bmad/core/workflows/advanced-elicitation/workflow.xml +116 -116
- package/bmad/core/workflows/brainstorming/brain-methods.csv +61 -61
- package/bmad/core/workflows/brainstorming/steps/step-01-session-setup.md +197 -197
- package/bmad/core/workflows/brainstorming/steps/step-01b-continue.md +122 -122
- package/bmad/core/workflows/brainstorming/steps/step-02a-user-selected.md +225 -225
- package/bmad/core/workflows/brainstorming/steps/step-02b-ai-recommended.md +237 -237
- package/bmad/core/workflows/brainstorming/steps/step-02c-random-selection.md +209 -209
- package/bmad/core/workflows/brainstorming/steps/step-02d-progressive-flow.md +264 -264
- package/bmad/core/workflows/brainstorming/steps/step-03-technique-execution.md +399 -399
- package/bmad/core/workflows/brainstorming/steps/step-04-idea-organization.md +303 -303
- package/bmad/core/workflows/brainstorming/template.md +15 -15
- package/bmad/core/workflows/brainstorming/workflow.md +58 -58
- package/bmad/core/workflows/party-mode/steps/step-01-agent-loading.md +138 -138
- package/bmad/core/workflows/party-mode/steps/step-02-discussion-orchestration.md +187 -187
- package/bmad/core/workflows/party-mode/steps/step-03-graceful-exit.md +168 -157
- package/bmad/core/workflows/party-mode/workflow.md +194 -194
- package/bundled-versions.json +3 -0
- package/dist/cli.js +61 -6
- package/dist/commands/check-updates.d.ts +5 -0
- package/dist/commands/check-updates.js +63 -0
- package/dist/commands/doctor.d.ts +39 -1
- package/dist/commands/doctor.js +348 -79
- package/dist/commands/init.d.ts +2 -0
- package/dist/commands/init.js +41 -15
- package/dist/commands/status.d.ts +7 -1
- package/dist/commands/status.js +111 -42
- package/dist/commands/upgrade.d.ts +7 -1
- package/dist/commands/upgrade.js +43 -12
- package/dist/installer.d.ts +19 -2
- package/dist/installer.js +305 -66
- package/dist/transition/artifacts.d.ts +2 -0
- package/dist/transition/artifacts.js +46 -0
- package/dist/transition/context.d.ts +19 -0
- package/dist/transition/context.js +261 -0
- package/dist/transition/fix-plan.d.ts +15 -0
- package/dist/transition/fix-plan.js +94 -0
- package/dist/transition/index.d.ts +9 -0
- package/dist/transition/index.js +16 -0
- package/dist/transition/orchestration.d.ts +2 -0
- package/dist/transition/orchestration.js +243 -0
- package/dist/transition/specs-changelog.d.ts +3 -0
- package/dist/transition/specs-changelog.js +75 -0
- package/dist/transition/specs-index.d.ts +22 -0
- package/dist/transition/specs-index.js +157 -0
- package/dist/transition/story-parsing.d.ts +7 -0
- package/dist/transition/story-parsing.js +124 -0
- package/dist/transition/tech-stack.d.ts +3 -0
- package/dist/transition/tech-stack.js +79 -0
- package/dist/transition/types.d.ts +60 -0
- package/dist/transition/types.js +1 -0
- package/dist/utils/config.d.ts +4 -0
- package/dist/utils/config.js +14 -4
- package/dist/utils/constants.d.ts +70 -0
- package/dist/utils/constants.js +97 -0
- package/dist/utils/dryrun.d.ts +7 -0
- package/dist/utils/dryrun.js +48 -0
- package/dist/utils/errors.d.ts +63 -0
- package/dist/utils/errors.js +86 -0
- package/dist/utils/file-system.d.ts +24 -0
- package/dist/utils/file-system.js +99 -0
- package/dist/utils/github.d.ts +83 -0
- package/dist/utils/github.js +230 -0
- package/dist/utils/json.js +3 -3
- package/dist/utils/logger.d.ts +6 -0
- package/dist/utils/logger.js +27 -0
- package/dist/utils/state.d.ts +4 -7
- package/dist/utils/state.js +147 -26
- package/dist/utils/validate.d.ts +40 -0
- package/dist/utils/validate.js +175 -1
- package/package.json +75 -59
- package/ralph/RALPH-REFERENCE.md +412 -0
- package/ralph/lib/circuit_breaker.sh +463 -330
- package/ralph/lib/date_utils.sh +104 -53
- package/ralph/lib/enable_core.sh +815 -0
- package/ralph/lib/response_analyzer.sh +884 -768
- package/ralph/lib/task_sources.sh +577 -0
- package/ralph/lib/timeout_utils.sh +145 -145
- package/ralph/lib/wizard_utils.sh +547 -0
- package/ralph/ralph_import.sh +636 -0
- package/ralph/ralph_loop.sh +1793 -1391
- package/ralph/ralph_monitor.sh +125 -0
- package/ralph/templates/AGENT.md +158 -158
- package/ralph/templates/PROMPT.md +285 -292
- package/ralph/templates/fix_plan.md +27 -27
- package/ralph/templates/ralphrc.template +102 -0
- package/ralph/templates/specs/.gitkeep +1 -1
- package/slash-commands/advanced-elicitation.md +1 -1
- package/slash-commands/adversarial-review.md +1 -1
- package/slash-commands/analyst.md +1 -1
- package/slash-commands/architect.md +1 -1
- package/slash-commands/bmad-help.md +1 -1
- package/slash-commands/bmalph-implement.md +152 -152
- package/slash-commands/brainstorm-project.md +1 -1
- package/slash-commands/brainstorming.md +1 -1
- package/slash-commands/correct-course.md +1 -1
- package/slash-commands/create-architecture.md +1 -1
- package/slash-commands/create-brief.md +1 -1
- package/slash-commands/create-epics-stories.md +1 -1
- package/slash-commands/create-prd.md +1 -1
- package/slash-commands/create-story.md +1 -1
- package/slash-commands/create-ux.md +1 -1
- package/slash-commands/dev.md +1 -1
- package/slash-commands/document-project.md +1 -1
- package/slash-commands/domain-research.md +1 -1
- package/slash-commands/editorial-prose.md +1 -1
- package/slash-commands/editorial-structure.md +1 -1
- package/slash-commands/execute-workflow.md +1 -1
- package/slash-commands/generate-project-context.md +1 -0
- package/slash-commands/implementation-readiness.md +1 -1
- package/slash-commands/index-docs.md +1 -1
- package/slash-commands/market-research.md +1 -1
- package/slash-commands/party-mode.md +1 -1
- package/slash-commands/pm.md +1 -1
- package/slash-commands/qa-automate.md +1 -0
- package/slash-commands/qa.md +1 -0
- package/slash-commands/quick-dev.md +1 -1
- package/slash-commands/quick-flow-solo-dev.md +1 -1
- package/slash-commands/retrospective.md +1 -1
- package/slash-commands/shard-doc.md +1 -1
- package/slash-commands/sm.md +1 -1
- package/slash-commands/sprint-planning.md +1 -1
- package/slash-commands/sprint-status.md +1 -1
- package/slash-commands/tech-spec.md +1 -1
- package/slash-commands/tech-writer.md +1 -0
- package/slash-commands/technical-research.md +1 -1
- package/slash-commands/ux-designer.md +1 -1
- package/slash-commands/validate-architecture.md +1 -1
- package/slash-commands/validate-brief.md +1 -1
- package/slash-commands/validate-epics-stories.md +1 -1
- package/slash-commands/validate-prd.md +1 -1
- package/slash-commands/validate-story.md +1 -1
- package/slash-commands/validate-ux.md +1 -1
- package/bmad/bmm/agents/tea.agent.yaml +0 -63
- package/bmad/bmm/sub-modules/claude-code/config.yaml +0 -4
- package/bmad/bmm/sub-modules/claude-code/injections.yaml +0 -242
- package/bmad/bmm/sub-modules/claude-code/readme.md +0 -87
- package/bmad/bmm/testarch/knowledge/adr-quality-readiness-checklist.md +0 -350
- package/bmad/bmm/testarch/knowledge/api-request.md +0 -442
- package/bmad/bmm/testarch/knowledge/api-testing-patterns.md +0 -843
- package/bmad/bmm/testarch/knowledge/auth-session.md +0 -552
- package/bmad/bmm/testarch/knowledge/burn-in.md +0 -273
- package/bmad/bmm/testarch/knowledge/ci-burn-in.md +0 -675
- package/bmad/bmm/testarch/knowledge/component-tdd.md +0 -486
- package/bmad/bmm/testarch/knowledge/contract-testing.md +0 -957
- package/bmad/bmm/testarch/knowledge/data-factories.md +0 -500
- package/bmad/bmm/testarch/knowledge/email-auth.md +0 -721
- package/bmad/bmm/testarch/knowledge/error-handling.md +0 -725
- package/bmad/bmm/testarch/knowledge/feature-flags.md +0 -750
- package/bmad/bmm/testarch/knowledge/file-utils.md +0 -463
- package/bmad/bmm/testarch/knowledge/fixture-architecture.md +0 -401
- package/bmad/bmm/testarch/knowledge/fixtures-composition.md +0 -382
- package/bmad/bmm/testarch/knowledge/intercept-network-call.md +0 -430
- package/bmad/bmm/testarch/knowledge/log.md +0 -429
- package/bmad/bmm/testarch/knowledge/network-error-monitor.md +0 -405
- package/bmad/bmm/testarch/knowledge/network-first.md +0 -486
- package/bmad/bmm/testarch/knowledge/network-recorder.md +0 -527
- package/bmad/bmm/testarch/knowledge/nfr-criteria.md +0 -670
- package/bmad/bmm/testarch/knowledge/overview.md +0 -286
- package/bmad/bmm/testarch/knowledge/playwright-config.md +0 -730
- package/bmad/bmm/testarch/knowledge/probability-impact.md +0 -601
- package/bmad/bmm/testarch/knowledge/recurse.md +0 -421
- package/bmad/bmm/testarch/knowledge/risk-governance.md +0 -615
- package/bmad/bmm/testarch/knowledge/selective-testing.md +0 -732
- package/bmad/bmm/testarch/knowledge/selector-resilience.md +0 -527
- package/bmad/bmm/testarch/knowledge/test-healing-patterns.md +0 -644
- package/bmad/bmm/testarch/knowledge/test-levels-framework.md +0 -473
- package/bmad/bmm/testarch/knowledge/test-priorities-matrix.md +0 -373
- package/bmad/bmm/testarch/knowledge/test-quality.md +0 -664
- package/bmad/bmm/testarch/knowledge/timing-debugging.md +0 -372
- package/bmad/bmm/testarch/knowledge/visual-debugging.md +0 -524
- package/bmad/bmm/testarch/tea-index.csv +0 -35
- package/bmad/bmm/workflows/1-analysis/research/market-steps/step-02-customer-insights.md +0 -200
- package/bmad/bmm/workflows/1-analysis/research/workflow.md +0 -173
- package/bmad/bmm/workflows/2-plan-workflows/prd/validation-report-prd-workflow.md +0 -433
- package/bmad/bmm/workflows/2-plan-workflows/prd/workflow.md +0 -150
- package/bmad/bmm/workflows/bmad-quick-flow/quick-dev/data/project-levels.yaml +0 -59
- package/bmad/bmm/workflows/excalidraw-diagrams/_shared/excalidraw-library.json +0 -90
- package/bmad/bmm/workflows/excalidraw-diagrams/_shared/excalidraw-templates.yaml +0 -127
- package/bmad/bmm/workflows/excalidraw-diagrams/create-dataflow/checklist.md +0 -39
- package/bmad/bmm/workflows/excalidraw-diagrams/create-dataflow/instructions.md +0 -130
- package/bmad/bmm/workflows/excalidraw-diagrams/create-dataflow/workflow.yaml +0 -27
- package/bmad/bmm/workflows/excalidraw-diagrams/create-diagram/checklist.md +0 -43
- package/bmad/bmm/workflows/excalidraw-diagrams/create-diagram/instructions.md +0 -141
- package/bmad/bmm/workflows/excalidraw-diagrams/create-diagram/workflow.yaml +0 -27
- package/bmad/bmm/workflows/excalidraw-diagrams/create-flowchart/checklist.md +0 -49
- package/bmad/bmm/workflows/excalidraw-diagrams/create-flowchart/instructions.md +0 -241
- package/bmad/bmm/workflows/excalidraw-diagrams/create-flowchart/workflow.yaml +0 -27
- package/bmad/bmm/workflows/excalidraw-diagrams/create-wireframe/checklist.md +0 -38
- package/bmad/bmm/workflows/excalidraw-diagrams/create-wireframe/instructions.md +0 -133
- package/bmad/bmm/workflows/excalidraw-diagrams/create-wireframe/workflow.yaml +0 -27
- package/bmad/bmm/workflows/testarch/atdd/atdd-checklist-template.md +0 -363
- package/bmad/bmm/workflows/testarch/atdd/checklist.md +0 -374
- package/bmad/bmm/workflows/testarch/atdd/instructions.md +0 -806
- package/bmad/bmm/workflows/testarch/atdd/workflow.yaml +0 -47
- package/bmad/bmm/workflows/testarch/automate/checklist.md +0 -582
- package/bmad/bmm/workflows/testarch/automate/instructions.md +0 -1324
- package/bmad/bmm/workflows/testarch/automate/workflow.yaml +0 -54
- package/bmad/bmm/workflows/testarch/ci/checklist.md +0 -247
- package/bmad/bmm/workflows/testarch/ci/github-actions-template.yaml +0 -198
- package/bmad/bmm/workflows/testarch/ci/gitlab-ci-template.yaml +0 -149
- package/bmad/bmm/workflows/testarch/ci/instructions.md +0 -536
- package/bmad/bmm/workflows/testarch/ci/workflow.yaml +0 -47
- package/bmad/bmm/workflows/testarch/framework/checklist.md +0 -320
- package/bmad/bmm/workflows/testarch/framework/instructions.md +0 -481
- package/bmad/bmm/workflows/testarch/framework/workflow.yaml +0 -49
- package/bmad/bmm/workflows/testarch/nfr-assess/checklist.md +0 -407
- package/bmad/bmm/workflows/testarch/nfr-assess/instructions.md +0 -726
- package/bmad/bmm/workflows/testarch/nfr-assess/nfr-report-template.md +0 -461
- package/bmad/bmm/workflows/testarch/nfr-assess/workflow.yaml +0 -49
- package/bmad/bmm/workflows/testarch/test-design/checklist.md +0 -407
- package/bmad/bmm/workflows/testarch/test-design/instructions.md +0 -1158
- package/bmad/bmm/workflows/testarch/test-design/test-design-architecture-template.md +0 -213
- package/bmad/bmm/workflows/testarch/test-design/test-design-qa-template.md +0 -286
- package/bmad/bmm/workflows/testarch/test-design/test-design-template.md +0 -294
- package/bmad/bmm/workflows/testarch/test-design/workflow.yaml +0 -71
- package/bmad/bmm/workflows/testarch/test-review/checklist.md +0 -472
- package/bmad/bmm/workflows/testarch/test-review/instructions.md +0 -628
- package/bmad/bmm/workflows/testarch/test-review/test-review-template.md +0 -390
- package/bmad/bmm/workflows/testarch/test-review/workflow.yaml +0 -48
- package/bmad/bmm/workflows/testarch/trace/checklist.md +0 -642
- package/bmad/bmm/workflows/testarch/trace/instructions.md +0 -1030
- package/bmad/bmm/workflows/testarch/trace/trace-template.md +0 -675
- package/bmad/bmm/workflows/testarch/trace/workflow.yaml +0 -57
- package/bmad/core/resources/excalidraw/README.md +0 -160
- package/bmad/core/resources/excalidraw/excalidraw-helpers.md +0 -127
- package/bmad/core/resources/excalidraw/library-loader.md +0 -50
- package/bmad/core/resources/excalidraw/validate-json-instructions.md +0 -79
- package/bmad/core/tasks/bmad-help.md +0 -62
- package/dist/commands/guide.d.ts +0 -1
- package/dist/commands/guide.js +0 -19
- package/dist/commands/implement.d.ts +0 -1
- package/dist/commands/implement.js +0 -83
- package/dist/commands/plan.d.ts +0 -5
- package/dist/commands/plan.js +0 -44
- package/dist/commands/reset.d.ts +0 -5
- package/dist/commands/reset.js +0 -35
- package/dist/commands/resume.d.ts +0 -1
- package/dist/commands/resume.js +0 -44
- package/dist/commands/start.d.ts +0 -5
- package/dist/commands/start.js +0 -54
- package/dist/transition.d.ts +0 -52
- package/dist/transition.js +0 -656
- package/slash-commands/atdd.md +0 -1
- package/slash-commands/continuous-integration.md +0 -1
- package/slash-commands/create-dataflow.md +0 -1
- package/slash-commands/create-diagram.md +0 -1
- package/slash-commands/create-flowchart.md +0 -1
- package/slash-commands/create-wireframe.md +0 -1
- package/slash-commands/nfr-assess.md +0 -1
- package/slash-commands/tea.md +0 -1
- package/slash-commands/test-automate.md +0 -1
- package/slash-commands/test-design.md +0 -1
- package/slash-commands/test-framework.md +0 -1
- package/slash-commands/test-review.md +0 -1
- package/slash-commands/test-trace.md +0 -1
- package/slash-commands/validate-test-design.md +0 -1
|
@@ -0,0 +1,412 @@
|
|
|
1
|
+
# Ralph Reference Guide
|
|
2
|
+
|
|
3
|
+
This reference guide provides essential information for troubleshooting and understanding Ralph's autonomous development loop.
|
|
4
|
+
|
|
5
|
+
## Table of Contents
|
|
6
|
+
|
|
7
|
+
1. [Configuration Files](#configuration-files)
|
|
8
|
+
2. [Project Configuration (.ralphrc)](#project-configuration-ralphrc)
|
|
9
|
+
3. [Session Management](#session-management)
|
|
10
|
+
4. [Circuit Breaker](#circuit-breaker)
|
|
11
|
+
5. [Exit Detection](#exit-detection)
|
|
12
|
+
6. [Live Streaming](#live-streaming)
|
|
13
|
+
7. [Troubleshooting](#troubleshooting)
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## Configuration Files
|
|
18
|
+
|
|
19
|
+
Ralph uses several files within the `.ralph/` directory:
|
|
20
|
+
|
|
21
|
+
| File | Purpose |
|
|
22
|
+
|------|---------|
|
|
23
|
+
| `.ralph/PROMPT.md` | Main prompt that drives each loop iteration |
|
|
24
|
+
| `.ralph/fix_plan.md` | Prioritized task list that Ralph follows |
|
|
25
|
+
| `.ralph/@AGENT.md` | Build and run instructions maintained by Ralph |
|
|
26
|
+
| `.ralph/status.json` | Real-time status tracking (JSON format) |
|
|
27
|
+
| `.ralph/logs/` | Execution logs for each loop iteration |
|
|
28
|
+
| `.ralph/.ralph_session` | Current session state |
|
|
29
|
+
| `.ralph/.circuit_breaker_state` | Circuit breaker state |
|
|
30
|
+
| `.ralph/live.log` | Live streaming output file for monitoring |
|
|
31
|
+
| `.ralph/.loop_start_sha` | Git HEAD SHA captured at loop start for progress detection |
|
|
32
|
+
| `.ralphrc` (project root) | Project-specific configuration (tools, thresholds, session settings) |
|
|
33
|
+
|
|
34
|
+
### Rate Limiting
|
|
35
|
+
|
|
36
|
+
- Default: 100 API calls per hour (configurable via `--calls` flag or `.ralphrc`)
|
|
37
|
+
- Automatic hourly reset with countdown display
|
|
38
|
+
- Call tracking persists across script restarts
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
## Project Configuration (.ralphrc)
|
|
43
|
+
|
|
44
|
+
Ralph supports a `.ralphrc` configuration file at the project root for per-project settings.
|
|
45
|
+
|
|
46
|
+
### Precedence
|
|
47
|
+
|
|
48
|
+
Environment variables > `.ralphrc` > script defaults
|
|
49
|
+
|
|
50
|
+
### Available Settings
|
|
51
|
+
|
|
52
|
+
| Variable | Default | Description |
|
|
53
|
+
|----------|---------|-------------|
|
|
54
|
+
| `PROJECT_NAME` | `my-project` | Project name for prompts and logging |
|
|
55
|
+
| `PROJECT_TYPE` | `unknown` | Project type (javascript, typescript, python, rust, go) |
|
|
56
|
+
| `MAX_CALLS_PER_HOUR` | `100` | Rate limit for API calls |
|
|
57
|
+
| `CLAUDE_TIMEOUT_MINUTES` | `15` | Timeout per Claude Code invocation |
|
|
58
|
+
| `CLAUDE_OUTPUT_FORMAT` | `json` | Output format (json or text) |
|
|
59
|
+
| `ALLOWED_TOOLS` | `Write,Read,Edit,Bash(git *),Bash(npm *),Bash(pytest)` | Comma-separated allowed tools |
|
|
60
|
+
| `SESSION_CONTINUITY` | `true` | Maintain context across loops |
|
|
61
|
+
| `SESSION_EXPIRY_HOURS` | `24` | Session expiration time |
|
|
62
|
+
| `RALPH_VERBOSE` | `false` | Enable verbose logging |
|
|
63
|
+
| `CB_NO_PROGRESS_THRESHOLD` | `3` | Loops with no progress before circuit opens |
|
|
64
|
+
| `CB_SAME_ERROR_THRESHOLD` | `5` | Loops with same error before circuit opens |
|
|
65
|
+
| `CB_OUTPUT_DECLINE_THRESHOLD` | `70` | Output decline percentage threshold |
|
|
66
|
+
| `CB_COOLDOWN_MINUTES` | `30` | Minutes before OPEN auto-recovers to HALF_OPEN |
|
|
67
|
+
| `CB_AUTO_RESET` | `false` | Reset circuit to CLOSED on startup |
|
|
68
|
+
| `TASK_SOURCES` | `local` | Where to import tasks from (local, beads, github) |
|
|
69
|
+
|
|
70
|
+
### Generation
|
|
71
|
+
|
|
72
|
+
bmalph copies `ralphrc.template` to `.ralph/.ralphrc` during `bmalph init`. Existing `.ralphrc` files are preserved during upgrades.
|
|
73
|
+
|
|
74
|
+
---
|
|
75
|
+
|
|
76
|
+
## Session Management
|
|
77
|
+
|
|
78
|
+
Ralph maintains session continuity across loop iterations using `--resume` with explicit session IDs.
|
|
79
|
+
|
|
80
|
+
### Session Continuity
|
|
81
|
+
|
|
82
|
+
Ralph uses `--resume <session_id>` instead of `--continue` to resume sessions. This ensures Ralph only resumes its own sessions and avoids hijacking active Claude Code sessions the user may have open.
|
|
83
|
+
|
|
84
|
+
### Session Files
|
|
85
|
+
|
|
86
|
+
| File | Purpose |
|
|
87
|
+
|------|---------|
|
|
88
|
+
| `.ralph/.ralph_session` | Current session ID and timestamps |
|
|
89
|
+
| `.ralph/.ralph_session_history` | History of last 50 session transitions |
|
|
90
|
+
| `.ralph/.claude_session_id` | Claude Code CLI session persistence |
|
|
91
|
+
|
|
92
|
+
### Session Lifecycle
|
|
93
|
+
|
|
94
|
+
Sessions are automatically reset when:
|
|
95
|
+
- Circuit breaker opens (stagnation detected)
|
|
96
|
+
- Manual interrupt (Ctrl+C / SIGINT)
|
|
97
|
+
- Project completion (graceful exit)
|
|
98
|
+
- Manual circuit breaker reset (`ralph --reset-circuit`)
|
|
99
|
+
- Manual session reset (`ralph --reset-session`)
|
|
100
|
+
|
|
101
|
+
### Session Expiration
|
|
102
|
+
|
|
103
|
+
Sessions expire after 24 hours (configurable via `SESSION_EXPIRY_HOURS` in `.ralphrc`). When expired:
|
|
104
|
+
- A new session is created automatically
|
|
105
|
+
- Previous context is not preserved
|
|
106
|
+
- Session history records the transition
|
|
107
|
+
|
|
108
|
+
### Session State Structure
|
|
109
|
+
|
|
110
|
+
```json
|
|
111
|
+
{
|
|
112
|
+
"session_id": "uuid-string",
|
|
113
|
+
"created_at": "ISO-timestamp",
|
|
114
|
+
"last_used": "ISO-timestamp",
|
|
115
|
+
"reset_at": "ISO-timestamp (if reset)",
|
|
116
|
+
"reset_reason": "reason string (if reset)"
|
|
117
|
+
}
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
---
|
|
121
|
+
|
|
122
|
+
## Circuit Breaker
|
|
123
|
+
|
|
124
|
+
The circuit breaker prevents runaway loops by detecting stagnation.
|
|
125
|
+
|
|
126
|
+
### States
|
|
127
|
+
|
|
128
|
+
| State | Description | Action |
|
|
129
|
+
|-------|-------------|--------|
|
|
130
|
+
| **CLOSED** | Normal operation | Loop continues |
|
|
131
|
+
| **HALF_OPEN** | Monitoring after recovery | Testing if issue resolved |
|
|
132
|
+
| **OPEN** | Halted due to stagnation | Loop stops |
|
|
133
|
+
|
|
134
|
+
### Thresholds
|
|
135
|
+
|
|
136
|
+
| Threshold | Default | Description |
|
|
137
|
+
|-----------|---------|-------------|
|
|
138
|
+
| `CB_NO_PROGRESS_THRESHOLD` | 3 | Open circuit after N loops with no file changes |
|
|
139
|
+
| `CB_SAME_ERROR_THRESHOLD` | 5 | Open circuit after N loops with repeated errors |
|
|
140
|
+
| `CB_OUTPUT_DECLINE_THRESHOLD` | 70% | Open circuit if output declines by >N% |
|
|
141
|
+
| `CB_PERMISSION_DENIAL_THRESHOLD` | 2 | Open circuit after N loops with permission denials |
|
|
142
|
+
| `CB_COOLDOWN_MINUTES` | 30 | Minutes before OPEN auto-recovers to HALF_OPEN |
|
|
143
|
+
| `CB_AUTO_RESET` | false | Reset to CLOSED on startup (bypasses cooldown) |
|
|
144
|
+
|
|
145
|
+
### Permission Denial Detection
|
|
146
|
+
|
|
147
|
+
When Claude Code is denied permission to execute commands, Ralph:
|
|
148
|
+
1. Detects permission denials from the JSON output
|
|
149
|
+
2. Halts the loop with reason `permission_denied`
|
|
150
|
+
3. Displays guidance to update `ALLOWED_TOOLS` in `.ralphrc`
|
|
151
|
+
|
|
152
|
+
### Auto-Recovery Cooldown
|
|
153
|
+
|
|
154
|
+
After `CB_COOLDOWN_MINUTES` (default: 30) in OPEN state, the circuit auto-transitions to HALF_OPEN. From HALF_OPEN, if progress is detected, circuit goes to CLOSED; otherwise back to OPEN.
|
|
155
|
+
|
|
156
|
+
Set `CB_AUTO_RESET=true` in `.ralphrc` to bypass cooldown entirely and reset to CLOSED on startup.
|
|
157
|
+
|
|
158
|
+
### Circuit Breaker State Structure
|
|
159
|
+
|
|
160
|
+
```json
|
|
161
|
+
{
|
|
162
|
+
"state": "CLOSED|HALF_OPEN|OPEN",
|
|
163
|
+
"consecutive_no_progress": 0,
|
|
164
|
+
"consecutive_same_error": 0,
|
|
165
|
+
"consecutive_permission_denials": 0,
|
|
166
|
+
"last_progress_loop": 5,
|
|
167
|
+
"total_opens": 0,
|
|
168
|
+
"reason": "string (when OPEN)",
|
|
169
|
+
"opened_at": "ISO-timestamp (when OPEN)",
|
|
170
|
+
"current_loop": 10
|
|
171
|
+
}
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
### Recovery
|
|
175
|
+
|
|
176
|
+
To reset the circuit breaker:
|
|
177
|
+
```bash
|
|
178
|
+
ralph --reset-circuit
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
---
|
|
182
|
+
|
|
183
|
+
## Exit Detection
|
|
184
|
+
|
|
185
|
+
Ralph uses multiple mechanisms to detect when to exit the loop.
|
|
186
|
+
|
|
187
|
+
### Exit Conditions
|
|
188
|
+
|
|
189
|
+
| Condition | Threshold | Description |
|
|
190
|
+
|-----------|-----------|-------------|
|
|
191
|
+
| Consecutive done signals | 2 | Exit on repeated completion signals |
|
|
192
|
+
| Test-only loops | 3 | Exit if too many test-only iterations |
|
|
193
|
+
| Fix plan complete | All [x] | Exit when all tasks are marked complete |
|
|
194
|
+
| EXIT_SIGNAL + completion_indicators | Both | Dual verification for project completion |
|
|
195
|
+
|
|
196
|
+
### EXIT_SIGNAL Gate
|
|
197
|
+
|
|
198
|
+
The `completion_indicators` exit condition requires dual verification:
|
|
199
|
+
|
|
200
|
+
| completion_indicators | EXIT_SIGNAL | Result |
|
|
201
|
+
|-----------------------|-------------|--------|
|
|
202
|
+
| >= 2 | `true` | **Exit** ("project_complete") |
|
|
203
|
+
| >= 2 | `false` | **Continue** (Claude still working) |
|
|
204
|
+
| >= 2 | missing | **Continue** (defaults to false) |
|
|
205
|
+
| < 2 | `true` | **Continue** (threshold not met) |
|
|
206
|
+
|
|
207
|
+
**Rationale:** Natural language patterns like "done" or "complete" can trigger false positives during productive work. By requiring Claude's explicit EXIT_SIGNAL confirmation, Ralph avoids exiting mid-iteration.
|
|
208
|
+
|
|
209
|
+
When Claude outputs `STATUS: COMPLETE` with `EXIT_SIGNAL: false`, the explicit `false` takes precedence. This allows marking a phase complete while indicating more phases remain.
|
|
210
|
+
|
|
211
|
+
### RALPH_STATUS Block
|
|
212
|
+
|
|
213
|
+
Claude should include this status block at the end of each response:
|
|
214
|
+
|
|
215
|
+
```
|
|
216
|
+
---RALPH_STATUS---
|
|
217
|
+
STATUS: IN_PROGRESS | COMPLETE | BLOCKED
|
|
218
|
+
TASKS_COMPLETED_THIS_LOOP: <number>
|
|
219
|
+
FILES_MODIFIED: <number>
|
|
220
|
+
TESTS_STATUS: PASSING | FAILING | NOT_RUN
|
|
221
|
+
WORK_TYPE: IMPLEMENTATION | TESTING | DOCUMENTATION | REFACTORING
|
|
222
|
+
EXIT_SIGNAL: false | true
|
|
223
|
+
RECOMMENDATION: <one line summary of what to do next>
|
|
224
|
+
---END_RALPH_STATUS---
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
### When to Set EXIT_SIGNAL: true
|
|
228
|
+
|
|
229
|
+
Set EXIT_SIGNAL to **true** when ALL conditions are met:
|
|
230
|
+
1. All items in fix_plan.md are marked [x]
|
|
231
|
+
2. All tests are passing (or no tests exist for valid reasons)
|
|
232
|
+
3. No errors or warnings in the last execution
|
|
233
|
+
4. All requirements from specs/ are implemented
|
|
234
|
+
5. Nothing meaningful left to implement
|
|
235
|
+
|
|
236
|
+
### Progress Detection
|
|
237
|
+
|
|
238
|
+
Ralph detects progress through both uncommitted file changes AND git commits made within a loop. Before each loop, Ralph captures `git rev-parse HEAD`; if HEAD changes during the loop, committed files count as progress alongside working tree changes.
|
|
239
|
+
|
|
240
|
+
---
|
|
241
|
+
|
|
242
|
+
## Live Streaming
|
|
243
|
+
|
|
244
|
+
Ralph supports real-time streaming output with the `--live` flag.
|
|
245
|
+
|
|
246
|
+
### Usage
|
|
247
|
+
|
|
248
|
+
```bash
|
|
249
|
+
ralph --live # Live streaming output
|
|
250
|
+
ralph --monitor --live # Live streaming with tmux monitoring
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
### How It Works
|
|
254
|
+
|
|
255
|
+
- Switches output format to `stream-json` and pipes through `jq` for human-readable display
|
|
256
|
+
- Shows text deltas and tool invocations in real-time
|
|
257
|
+
- Requires `jq` and `stdbuf` (from coreutils); falls back to background mode if unavailable
|
|
258
|
+
|
|
259
|
+
### Monitoring Layout
|
|
260
|
+
|
|
261
|
+
When using `--monitor` with `--live`, tmux creates a 3-pane layout:
|
|
262
|
+
- **Left pane:** Ralph loop with live streaming
|
|
263
|
+
- **Right-top pane:** `tail -f .ralph/live.log` (Claude Code live output)
|
|
264
|
+
- **Right-bottom pane:** `ralph-monitor` (status dashboard)
|
|
265
|
+
|
|
266
|
+
---
|
|
267
|
+
|
|
268
|
+
## Troubleshooting
|
|
269
|
+
|
|
270
|
+
### Common Issues
|
|
271
|
+
|
|
272
|
+
#### Ralph exits too early
|
|
273
|
+
|
|
274
|
+
**Symptoms:** Loop stops before work is complete
|
|
275
|
+
|
|
276
|
+
**Causes:**
|
|
277
|
+
- EXIT_SIGNAL set to true prematurely
|
|
278
|
+
- completion_indicators triggered by natural language
|
|
279
|
+
- All fix_plan.md items marked complete
|
|
280
|
+
|
|
281
|
+
**Solutions:**
|
|
282
|
+
1. Ensure EXIT_SIGNAL is only true when genuinely complete
|
|
283
|
+
2. Add remaining tasks to fix_plan.md
|
|
284
|
+
3. Check `.ralph/.response_analysis` for exit reasons
|
|
285
|
+
|
|
286
|
+
#### Ralph doesn't exit when complete
|
|
287
|
+
|
|
288
|
+
**Symptoms:** Loop continues with busywork
|
|
289
|
+
|
|
290
|
+
**Causes:**
|
|
291
|
+
- EXIT_SIGNAL not being set to true
|
|
292
|
+
- fix_plan.md has unmarked items
|
|
293
|
+
- completion_indicators threshold not met
|
|
294
|
+
|
|
295
|
+
**Solutions:**
|
|
296
|
+
1. Ensure RALPH_STATUS block is included in responses
|
|
297
|
+
2. Set EXIT_SIGNAL: true when all work is done
|
|
298
|
+
3. Mark all completed items in fix_plan.md
|
|
299
|
+
|
|
300
|
+
#### Circuit breaker opens unexpectedly
|
|
301
|
+
|
|
302
|
+
**Symptoms:** "OPEN - stagnation detected" message
|
|
303
|
+
|
|
304
|
+
**Causes:**
|
|
305
|
+
- Same error recurring across loops
|
|
306
|
+
- No file changes for multiple loops
|
|
307
|
+
- Output volume declining significantly
|
|
308
|
+
|
|
309
|
+
**Solutions:**
|
|
310
|
+
1. Check `.ralph/logs/` for the recurring error
|
|
311
|
+
2. Fix the underlying issue causing the error
|
|
312
|
+
3. Reset circuit breaker: `ralph --reset-circuit`
|
|
313
|
+
|
|
314
|
+
#### Permission denied halts loop
|
|
315
|
+
|
|
316
|
+
**Symptoms:** "OPEN - permission_denied" message
|
|
317
|
+
|
|
318
|
+
**Causes:**
|
|
319
|
+
- Claude Code denied permission to run commands
|
|
320
|
+
- `ALLOWED_TOOLS` in `.ralphrc` too restrictive
|
|
321
|
+
|
|
322
|
+
**Solutions:**
|
|
323
|
+
1. Update `ALLOWED_TOOLS` in `.ralphrc` to include needed tools
|
|
324
|
+
2. Reset circuit breaker: `ralph --reset-circuit`
|
|
325
|
+
3. Common tools: `Write,Read,Edit,Bash(git *),Bash(npm *),Bash(pytest)`
|
|
326
|
+
|
|
327
|
+
#### Session expires mid-project
|
|
328
|
+
|
|
329
|
+
**Symptoms:** Context lost, session age > 24h
|
|
330
|
+
|
|
331
|
+
**Causes:**
|
|
332
|
+
- Long gaps between loop iterations
|
|
333
|
+
- Session not being refreshed
|
|
334
|
+
|
|
335
|
+
**Solutions:**
|
|
336
|
+
1. Sessions are designed to expire after 24h (configurable via `SESSION_EXPIRY_HOURS`)
|
|
337
|
+
2. Start a new session with `ralph --reset-session`
|
|
338
|
+
3. Context will be rebuilt from fix_plan.md and specs/
|
|
339
|
+
|
|
340
|
+
### Diagnostic Commands
|
|
341
|
+
|
|
342
|
+
```bash
|
|
343
|
+
# Check Ralph status
|
|
344
|
+
ralph --status
|
|
345
|
+
|
|
346
|
+
# Check circuit breaker state
|
|
347
|
+
ralph --circuit-status
|
|
348
|
+
|
|
349
|
+
# Reset circuit breaker
|
|
350
|
+
ralph --reset-circuit
|
|
351
|
+
|
|
352
|
+
# Auto-reset circuit breaker (bypasses cooldown)
|
|
353
|
+
ralph --auto-reset-circuit
|
|
354
|
+
|
|
355
|
+
# Reset session
|
|
356
|
+
ralph --reset-session
|
|
357
|
+
|
|
358
|
+
# Enable live streaming
|
|
359
|
+
ralph --live
|
|
360
|
+
|
|
361
|
+
# Live streaming with monitoring
|
|
362
|
+
ralph --monitor --live
|
|
363
|
+
```
|
|
364
|
+
|
|
365
|
+
### Log Files
|
|
366
|
+
|
|
367
|
+
Loop execution logs are stored in `.ralph/logs/`:
|
|
368
|
+
- Each loop iteration creates a timestamped log file
|
|
369
|
+
- Logs contain Claude's output and status information
|
|
370
|
+
- Use logs to diagnose issues with specific iterations
|
|
371
|
+
|
|
372
|
+
### Status File Structure
|
|
373
|
+
|
|
374
|
+
`.ralph/status.json`:
|
|
375
|
+
```json
|
|
376
|
+
{
|
|
377
|
+
"timestamp": "ISO-timestamp",
|
|
378
|
+
"loop_count": 10,
|
|
379
|
+
"calls_made_this_hour": 25,
|
|
380
|
+
"max_calls_per_hour": 100,
|
|
381
|
+
"last_action": "description",
|
|
382
|
+
"status": "running|paused|complete",
|
|
383
|
+
"exit_reason": "reason (if exited)",
|
|
384
|
+
"next_reset": "timestamp for rate limit reset"
|
|
385
|
+
}
|
|
386
|
+
```
|
|
387
|
+
|
|
388
|
+
---
|
|
389
|
+
|
|
390
|
+
## Error Detection
|
|
391
|
+
|
|
392
|
+
Ralph uses two-stage error filtering to eliminate false positives.
|
|
393
|
+
|
|
394
|
+
### Stage 1: JSON Field Filtering
|
|
395
|
+
Filters out JSON field patterns like `"is_error": false` that contain the word "error" but aren't actual errors.
|
|
396
|
+
|
|
397
|
+
### Stage 2: Actual Error Detection
|
|
398
|
+
Detects real error messages:
|
|
399
|
+
- Error prefixes: `Error:`, `ERROR:`, `error:`
|
|
400
|
+
- Context-specific: `]: error`, `Link: error`
|
|
401
|
+
- Occurrences: `Error occurred`, `failed with error`
|
|
402
|
+
- Exceptions: `Exception`, `Fatal`, `FATAL`
|
|
403
|
+
|
|
404
|
+
### Multi-line Error Matching
|
|
405
|
+
Ralph verifies ALL error lines appear in ALL recent history files before declaring a stuck loop, preventing false negatives when multiple distinct errors occur.
|
|
406
|
+
|
|
407
|
+
---
|
|
408
|
+
|
|
409
|
+
## Further Reading
|
|
410
|
+
|
|
411
|
+
- [BMAD-METHOD Documentation](https://github.com/bmad-code-org/BMAD-METHOD)
|
|
412
|
+
- [Ralph Repository](https://github.com/snarktank/ralph)
|