beads/examples
Dmitry Verkhoturov ed915036c9
fix: backward-compatible JSONL import for all pre-v1.0 formats (#3021)
* fix: backward-compatible JSONL import for all pre-v1.0 formats

Three breaking changes accumulated across versions that prevent
importing old JSONL data:

1. Comment.ID changed from int64 to string in v1.0 — old JSONL
   with numeric comment IDs crashes the importer. Add custom
   UnmarshalJSON that accepts both types.

2. "wisp" field renamed to "ephemeral" in v0.38 — JSONL from
   v0.35–v0.37 silently loses the ephemeral flag. Map the old
   field name during import.

3. BondRef.proto_id renamed to source_id — old JSONL silently
   loses bond source references. Accept proto_id as alias.

Also improve auto-import error messaging: when upgrade recovery
fails, tell the user their data is safe and suggest bd init
--from-jsonl instead of silently swallowing the error.

* fix: use American English spelling for misspell linter

* test: add unit tests for backward-compatible UnmarshalJSON and legacy import

- TestCommentUnmarshalJSON: string IDs, numeric IDs (pre-v1.0),
  zero, large numbers, missing ID, invalid JSON
- TestBondRefUnmarshalJSON: source_id, proto_id (legacy),
  both fields (precedence), neither, invalid JSON
- TestImportFromLocalJSONL_LegacyFormats: numeric comment IDs
  survive import, wisp→ephemeral mapping (true/false/absent)
2026-04-04 22:34:12 -07:00
..
bash-agent docs(claim): standardize start-work semantics to --claim (#2070) 2026-02-24 22:11:39 -08:00
bd-example-extension-go feat(init): add --database flag to configure existing server database (#2102) 2026-02-24 22:26:07 -08:00
claude-desktop-mcp bd sync: 2025-11-26 18:07:01 2025-11-26 18:07:01 -08:00
compaction Update link to install script (#867) 2026-01-03 12:53:58 -08:00
contributor-workflow docs: remove stale JSONL references from ~73 markdown files (bd-9ni.4) 2026-02-22 22:18:02 -08:00
library-usage fix: backward-compatible JSONL import for all pre-v1.0 formats (#3021) 2026-04-04 22:34:12 -07:00
linear-workflow docs(claim): standardize start-work semantics to --claim (#2070) 2026-02-24 22:11:39 -08:00
multi-phase-development docs(claim): standardize start-work semantics to --claim (#2070) 2026-02-24 22:11:39 -08:00
multiple-personas docs(claim): standardize start-work semantics to --claim (#2070) 2026-02-24 22:11:39 -08:00
protected-branch fix(docs): purge stale bd sync/import/--branch refs + add CI doc validation (GH#2522) 2026-03-11 13:25:40 -07:00
python-agent refactor: Remove legacy MCP Agent Mail integration (bd-6gd) 2025-12-17 23:14:23 -08:00
startup-hooks feat: Add agent upgrade awareness documentation and tooling 2025-11-23 16:29:56 -08:00
team-workflow fix(docs): purge stale bd sync/import/--branch refs + add CI doc validation (GH#2522) 2026-03-11 13:25:40 -07:00
README.md docs(claim): standardize start-work semantics to --claim (#2070) 2026-02-24 22:11:39 -08:00

Beads Examples

This directory contains examples of how to integrate bd with AI agents and workflows.

Examples

Agent Integration

Tools & Utilities

  • monitor-webui/ - Standalone web interface for real-time issue monitoring and visualization
  • git-hooks/ - Pre-configured git hooks for automatic Dolt sync

Workflow Patterns

Quick Start

# Try the Python agent example
cd python-agent
python agent.py

# Try the bash agent example
cd bash-agent
./agent.sh

# Install git hooks
cd git-hooks
./install.sh

# REMOVED (bd-4c74): branch-merge demo - hash IDs eliminate collision resolution

Creating Your Own Agent

The basic agent workflow:

  1. Find ready work: bd ready --json --limit 1
  2. Claim the task: bd update <id> --claim --json
  3. Do the work: Execute the task
  4. Discover new issues: bd create "Found bug" --json
  5. Link discoveries: bd dep add <new-id> <parent-id> --type discovered-from
  6. Complete the task: bd close <id> --reason "Done" --json

All commands support --json for easy parsing.