docs: add reverse mode documentation with examples

- Add --reverse flag to tree command documentation
- Document normal vs reverse mode differences
- Add comprehensive reverse mode section with use cases
- Update examples to show both directions
This commit is contained in:
David Laing
2025-10-27 09:19:00 +00:00
parent 28b7fed0ec
commit 2035e02a34

View File

@@ -21,6 +21,11 @@ Manage dependencies between beads issues.
- **tree**: Show dependency tree for an issue
- $1: "tree"
- $2: Issue ID
- Flags:
- `--reverse`: Show dependent tree (what was discovered from this) instead of dependency tree (what blocks this)
- `--json`: Output as JSON
- `--max-depth N`: Limit tree depth (default: 50)
- `--show-all-paths`: Show all paths (no deduplication for diamond dependencies)
- **cycles**: Detect dependency cycles
@@ -34,5 +39,29 @@ Manage dependencies between beads issues.
## Examples
- `bd dep add bd-10 bd-20 --type blocks`: bd-10 blocks bd-20
- `bd dep tree bd-20`: Show what blocks bd-20 and what bd-20 blocks
- `bd dep tree bd-20`: Show what blocks bd-20 (dependency tree going UP)
- `bd dep tree bd-1 --reverse`: Show what was discovered from bd-1 (dependent tree going DOWN)
- `bd dep tree bd-1 --reverse --max-depth 3`: Show discovery tree with depth limit
- `bd dep cycles`: Check for circular dependencies
## Reverse Mode: Discovery Trees
The `--reverse` flag inverts the tree direction to show **dependents** instead of **dependencies**:
**Normal mode** (`bd dep tree ISSUE`):
- Shows what blocks you (dependency tree)
- Answers: "What must I complete before I can work on this?"
- Tree flows **UP** toward prerequisites
**Reverse mode** (`bd dep tree ISSUE --reverse`):
- Shows what was discovered from you (dependent tree)
- Answers: "What work was discovered while working on this?"
- Tree flows **DOWN** from goal to discovered tasks
- Perfect for visualizing work breakdown and discovery chains
**Use Cases:**
- Document project evolution and how work expanded from initial goal
- Share "how we got here" context with stakeholders
- Visualize work breakdown structure from epics
- Track discovery chains (what led to what)
- Show yak shaving journeys in retrospectives