Compare commits
7 Commits
665d6446d6
...
383a70c8cd
| Author | SHA1 | Date |
|---|---|---|
|
|
383a70c8cd | |
|
|
5abdca3b4c | |
|
|
6bfc937bd3 | |
|
|
72a9325a40 | |
|
|
5ed436cda0 | |
|
|
fbde5a0cd4 | |
|
|
57c74f0868 |
|
|
@ -0,0 +1,12 @@
|
|||
---
|
||||
name: bmad-os-root-cause-analysis
|
||||
description: Analyzes a bug-fix commit or PR and produces a structured Root Cause Analysis report covering what went wrong, why, and what guardrails failed.
|
||||
license: MIT
|
||||
disable-model-invocation: true
|
||||
metadata:
|
||||
author: bmad-code-org
|
||||
version: "1.0.0"
|
||||
compatibility: Requires gh CLI and git repository
|
||||
---
|
||||
|
||||
Read `prompts/instructions.md` and execute.
|
||||
|
|
@ -0,0 +1,74 @@
|
|||
# Bug-Fix Root Cause Analysis
|
||||
|
||||
Analyze a bug-fix commit or PR and produce a structured Root Cause Analysis report.
|
||||
|
||||
## Principles
|
||||
|
||||
- **Direct attribution.** This report names the individual who introduced the defect. Industry convention advocates blameless postmortems. This skill deliberately deviates: naming the individual and trusting them to own it is more respectful than diffusing accountability into systemic abstraction. Direct, factual, not accusatory. If authorship can't be determined confidently, say so.
|
||||
- **Pyramid communication.** The executive summary must convey the full picture. A reader who stops after the first paragraph gets the gist. Everything else is supporting evidence.
|
||||
|
||||
## Preflight
|
||||
|
||||
Verify `gh auth status` and that you're in a git repository. Stop with a clear message if either fails.
|
||||
|
||||
## Execution
|
||||
|
||||
1. **Identify the fix.** Accept whatever the user provides — commit SHA, PR, issue, description. Resolve to the specific fix commit/PR using `gh` and `git`. If ambiguous, ask. Confirm the change is actually a bug fix before proceeding.
|
||||
2. **Gather evidence.** Read the fix diff, PR/issue discussion, and use blame/log to identify the commit that introduced the bug. Collect timeline data.
|
||||
3. **Analyze.** Apply 5 Whys. Classify the root cause. Identify contributing factors.
|
||||
4. **Evaluate guardrails.** Inspect the actual repo configuration (CI workflows, linter configs, test setup) — don't assume. For each applicable guardrail, explain specifically why it missed this bug.
|
||||
5. **Write the report** to `_bmad-output/rca-reports/rca-{YYYY-MM-DD}-{slug}.md`. Present the executive summary in chat.
|
||||
|
||||
## Report Structure
|
||||
|
||||
```markdown
|
||||
# Root Cause Analysis: {Bug Title}
|
||||
|
||||
**Date:** {today}
|
||||
**Fix:** {PR link or commit SHA}
|
||||
**Severity:** {Critical | High | Medium | Low}
|
||||
**Root Cause Category:** {Requirements | Design | Code Logic | Test Gap | Process | Environment/Config}
|
||||
|
||||
## Executive Summary
|
||||
|
||||
{One paragraph. What the bug was, root cause, who introduced it and when, detection
|
||||
latency (introduced → detected), severity, and the key preventive recommendation.}
|
||||
|
||||
## What Was the Problem?
|
||||
|
||||
## When Did It Happen?
|
||||
|
||||
| Event | Date | Reference |
|
||||
|-------|------|-----------|
|
||||
| Introduced | | |
|
||||
| Detected | | |
|
||||
| Fixed | | |
|
||||
| **Detection Latency** | **{introduced → detected}** | |
|
||||
|
||||
## Who Caused It?
|
||||
|
||||
{Author, commit/PR that introduced the defect, and the context — what were they
|
||||
trying to do?}
|
||||
|
||||
## How Did It Happen?
|
||||
|
||||
## Why Did It Happen?
|
||||
|
||||
{5 Whys analysis. Root cause category. Contributing factors.}
|
||||
|
||||
## Failed Guardrails Analysis
|
||||
|
||||
| Guardrail | In Place? | Why It Failed |
|
||||
|-----------|-----------|---------------|
|
||||
| | | |
|
||||
|
||||
**Most Critical Failure:** {Which one mattered most and why.}
|
||||
|
||||
## Resolution
|
||||
|
||||
## Corrective & Preventive Actions
|
||||
|
||||
| # | Action | Type | Priority |
|
||||
|---|--------|------|----------|
|
||||
| | | {Prevent/Detect/Mitigate} | |
|
||||
```
|
||||
|
|
@ -5,7 +5,7 @@
|
|||
[](https://nodejs.org)
|
||||
[](https://discord.gg/gk8jAdXWmj)
|
||||
|
||||
**Breakthrough Method of Agile AI Driven Development** — An AI-driven agile development module for the BMad Method Module Ecosystem, the best and most comprehensive Agile AI Driven Development framework that has true scale-adaptive intelligence that adjusts from bug fixes to enterprise systems.
|
||||
**Build More Architect Dreams** — An AI-driven agile development module for the BMad Method Module Ecosystem, the best and most comprehensive Agile AI Driven Development framework that has true scale-adaptive intelligence that adjusts from bug fixes to enterprise systems.
|
||||
|
||||
**100% free and open source.** No paywalls. No gated content. No gated Discord. We believe in empowering everyone, not just those who can pay for a gated community or courses.
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ title: Welcome to the BMad Method
|
|||
description: AI-driven development framework with specialized agents, guided workflows, and intelligent planning
|
||||
---
|
||||
|
||||
The BMad Method (**B**reakthrough **M**ethod of **A**gile AI **D**riven Development) is an AI-driven development framework module within the BMad Method Ecosystem that helps you build software through the whole process from ideation and planning all the way through agentic implementation. It provides specialized AI agents, guided workflows, and intelligent planning that adapts to your project's complexity, whether you're fixing a bug or building an enterprise platform.
|
||||
The BMad Method (**B**uild **M**ore **A**rchitect **D**reams) is an AI-driven development framework module within the BMad Method Ecosystem that helps you build software through the whole process from ideation and planning all the way through agentic implementation. It provides specialized AI agents, guided workflows, and intelligent planning that adapts to your project's complexity, whether you're fixing a bug or building an enterprise platform.
|
||||
|
||||
If you're comfortable working with AI coding assistants like Claude, Cursor, or GitHub Copilot, you're ready to get started.
|
||||
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
{
|
||||
"name": "bmad-method",
|
||||
"version": "6.0.2",
|
||||
"version": "6.0.3",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "bmad-method",
|
||||
"version": "6.0.2",
|
||||
"version": "6.0.3",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@clack/core": "^1.0.0",
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"$schema": "https://json.schemastore.org/package.json",
|
||||
"name": "bmad-method",
|
||||
"version": "6.0.2",
|
||||
"version": "6.0.3",
|
||||
"description": "Breakthrough Method of Agile AI-driven Development",
|
||||
"keywords": [
|
||||
"agile",
|
||||
|
|
|
|||
|
|
@ -453,6 +453,15 @@ LOAD and execute from: {project-root}/{{bmadFolderName}}/{{path}}
|
|||
* @param {string} projectDir - Project directory
|
||||
*/
|
||||
async cleanup(projectDir, options = {}) {
|
||||
// Migrate legacy target directories (e.g. .opencode/agent → .opencode/agents)
|
||||
if (this.installerConfig?.legacy_targets) {
|
||||
if (!options.silent) await prompts.log.message(' Migrating legacy directories...');
|
||||
for (const legacyDir of this.installerConfig.legacy_targets) {
|
||||
await this.cleanupTarget(projectDir, legacyDir, options);
|
||||
await this.removeEmptyParents(projectDir, legacyDir);
|
||||
}
|
||||
}
|
||||
|
||||
// Clean all target directories
|
||||
if (this.installerConfig?.targets) {
|
||||
const parentDirs = new Set();
|
||||
|
|
@ -532,24 +541,37 @@ LOAD and execute from: {project-root}/{{bmadFolderName}}/{{path}}
|
|||
}
|
||||
}
|
||||
/**
|
||||
* Recursively remove empty directories walking up from dir toward projectDir
|
||||
* Walk up ancestor directories from relativeDir toward projectDir, removing each if empty
|
||||
* Stops at projectDir boundary — never removes projectDir itself
|
||||
* @param {string} projectDir - Project root (boundary)
|
||||
* @param {string} relativeDir - Relative directory to start from
|
||||
*/
|
||||
async removeEmptyParents(projectDir, relativeDir) {
|
||||
const resolvedProject = path.resolve(projectDir);
|
||||
let current = relativeDir;
|
||||
let last = null;
|
||||
while (current && current !== '.' && current !== last) {
|
||||
last = current;
|
||||
const fullPath = path.join(projectDir, current);
|
||||
const fullPath = path.resolve(projectDir, current);
|
||||
// Boundary guard: never traverse outside projectDir
|
||||
if (!fullPath.startsWith(resolvedProject + path.sep) && fullPath !== resolvedProject) break;
|
||||
try {
|
||||
if (!(await fs.pathExists(fullPath))) break;
|
||||
if (!(await fs.pathExists(fullPath))) {
|
||||
// Dir already gone — advance current; last is reset at top of next iteration
|
||||
current = path.dirname(current);
|
||||
continue;
|
||||
}
|
||||
const remaining = await fs.readdir(fullPath);
|
||||
if (remaining.length > 0) break;
|
||||
await fs.rmdir(fullPath);
|
||||
} catch {
|
||||
break;
|
||||
} catch (error) {
|
||||
// ENOTEMPTY: TOCTOU race (file added between readdir and rmdir) — skip level, continue upward
|
||||
// ENOENT: dir removed by another process between pathExists and rmdir — skip level, continue upward
|
||||
if (error.code === 'ENOTEMPTY' || error.code === 'ENOENT') {
|
||||
current = path.dirname(current);
|
||||
continue;
|
||||
}
|
||||
break; // fatal error (e.g. EACCES) — stop upward walk
|
||||
}
|
||||
current = path.dirname(current);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -131,11 +131,14 @@ platforms:
|
|||
category: ide
|
||||
description: "OpenCode terminal coding assistant"
|
||||
installer:
|
||||
legacy_targets:
|
||||
- .opencode/agent
|
||||
- .opencode/command
|
||||
targets:
|
||||
- target_dir: .opencode/agent
|
||||
- target_dir: .opencode/agents
|
||||
template_type: opencode
|
||||
artifact_types: [agents]
|
||||
- target_dir: .opencode/command
|
||||
- target_dir: .opencode/commands
|
||||
template_type: opencode
|
||||
artifact_types: [workflows, tasks, tools]
|
||||
|
||||
|
|
@ -191,6 +194,8 @@ platforms:
|
|||
# template_type: string # Default template type to use
|
||||
# header_template: string (optional) # Override for header/frontmatter template
|
||||
# body_template: string (optional) # Override for body/content template
|
||||
# legacy_targets: array (optional) # Old target dirs to clean up on reinstall (migration)
|
||||
# - string # Relative path, e.g. .opencode/agent
|
||||
# targets: array (optional) # For multi-target installations
|
||||
# - target_dir: string
|
||||
# template_type: string
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
name: '{{name}}'
|
||||
mode: all
|
||||
description: '{{description}}'
|
||||
---
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
---
|
||||
name: '{{name}}'
|
||||
description: '{{description}}'
|
||||
---
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
---
|
||||
name: '{{name}}'
|
||||
description: '{{description}}'
|
||||
---
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
---
|
||||
name: '{{name}}'
|
||||
description: '{{description}}'
|
||||
---
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
---
|
||||
name: '{{name}}'
|
||||
description: '{{description}}'
|
||||
---
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue