Spec: Beads Task Tracking and GitHub Issues Sync
Status: SUPERSEDED β This approach has been superseded by spec-kit tasks and GitHub issues. The spec is retained for historical reference.
Overviewβ
Establish beads (bd) as the primary task tracking system for AI Platform Engineering, with bidirectional synchronization to GitHub Issues for external visibility and collaboration.
Motivationβ
Current Stateβ
- Beads is installed but not fully integrated into the development workflow
- GitHub Issues are used externally but disconnected from local task tracking
- AI coding agents need local issue context without web UI access
- Team members juggle between beads CLI and GitHub web interface
Goalsβ
- Single Source of Truth: Beads as the primary interface for developers and AI agents
- External Visibility: GitHub Issues for stakeholders, contributors, and public visibility
- Bidirectional Sync: Changes flow both ways automatically
- AI-Native Workflow: CLI-first design enables seamless AI agent integration
Scopeβ
In Scopeβ
- Beads β GitHub Issues sync (export)
- GitHub Issues β Beads sync (import)
- Field mapping (priority, type, status, labels)
- Cursor/AI agent integration guidelines
- Team onboarding documentation
Out of Scopeβ
- GitHub Projects integration
- Jira/Linear sync (future consideration)
- Real-time webhooks (batch sync is sufficient)
Designβ
Architectureβ
βββββββββββββββββββββββ βββββββββββββββββββββββ
β Developer/AI β β External Users β
β (CLI: bd) β β (Web: GitHub) β
βββββββββββ¬ββββββββββββ βββββββββββ¬ββββββββββββ
β β
βΌ βΌ
βββββββββββββββββββββββ βββββββββββββββββββββββ
β .beads/issues.jsonlββββββΊβ GitHub Issues β
β (Local Storage) β β (cnoe-io/ai- β
β β β platform- β
βββββββββββββββββββββββ β engineering) β
β βββββββββββββββββββββββ
βΌ
βββββββββββββββββββββββ
β Git Repository β
β (bd sync) β
βββββββββββββββββββββββ
Field Mappingβ
| Beads Field | GitHub Field | Notes |
|---|---|---|
id | Label: beads:<id> | For linking back to beads |
title | Title | Direct mapping |
description | Body | Markdown preserved |
status: open | State: open | Direct mapping |
status: closed/done | State: closed | Direct mapping |
status: in_progress | Label: in-progress | Custom label |
priority: 1 | Label: P1 | Priority 1 - High |
priority: 2 | Label: P2 | Priority 2 - Medium |
issue_type: epic | Label: epic | Custom label |
issue_type: task | Label: task | Custom label |
external_ref | N/A | Stores GitHub issue number |
labels | Labels | Direct mapping |
assignee | Assignees | Username mapping needed |
Sync Commandsβ
# Export beads to GitHub Issues
bd gh export [--dry-run] [--all|--open|<issue-id>]
# Import GitHub Issues to beads
bd gh import [--dry-run] [--all|--open|<issue-number>]
# Full bidirectional sync
bd gh sync [--dry-run]
# Link existing beads issue to GitHub issue
bd link <beads-id> gh-<issue-number>
Implementation Using gh CLIβ
Until native beads-GitHub integration exists, use shell scripts with GitHub CLI:
# Export single beads issue to GitHub
bd show <id> --json | jq -r '...' | gh issue create \
--title "$TITLE" \
--body "$BODY" \
--label "beads:$ID,$PRIORITY,$TYPE"
# Import GitHub issue to beads
gh issue view <number> --json title,body,state,labels | \
jq -r '...' | bd create --from-json
# Sync status changes
gh issue list --json number,state,labels | \
while read issue; do
bd update <matched-id> --status <mapped-status>
done
Components Affectedβ
-
.beads/configuration -
.cursorrules(workflow documentation) -
AGENTS.md(agent instructions) - Scripts (
scripts/beads-gh-sync.sh) - Documentation (
docs/)
Acceptance Criteriaβ
Core Syncβ
- Export beads issue creates GitHub Issue with correct fields
- Import GitHub Issue creates beads issue with correct fields
-
external_reflinks beads ID to GitHub Issue number - Status changes sync bidirectionally
- Labels/priority sync correctly
Integrationβ
- AI agents can use
bdcommands for task management -
bd syncworks with git push/pull workflow - Team can use either interface (beads CLI or GitHub web)
Documentationβ
- Beads workflow documented in
.cursorrules - Agent instructions in
AGENTS.mdare complete - Team onboarding guide created
- Sync script documented with examples
Implementation Planβ
Phase 1: Beads Configuration (Complete)β
- Initialize beads in repository
- Create
.beads/config.yaml - Add
AGENTS.mdwith bd quick reference - Document "Landing the Plane" workflow
Phase 2: Cursor/AI Integrationβ
- Update
.cursorruleswith beads workflow - Add beads commands to code review checklist
- Document issue creation for remaining work
- Add beads status updates to session completion
Phase 3: GitHub Sync Script β β
- Create
scripts/sync_beads_to_github.sh - Implement export: beads β GitHub
- Implement import: GitHub β beads (not yet implemented)
- Add
--dry-runmode for safety - Handle duplicate detection via
beads-idin issue body - Makefile targets:
beads-gh-issues-sync,beads-gh-issues-sync-run
Phase 4: Documentation & Onboardingβ
- Create team onboarding documentation
- Add beads section to
CONTRIBUTING.md - Document sync workflow
- Create troubleshooting guide
Testing Strategyβ
-
Manual testing:
- Create issue in beads, export to GitHub, verify fields
- Create issue in GitHub, import to beads, verify fields
- Change status in one system, sync, verify update
- Test conflict scenarios
-
Integration tests:
- Test sync script with mock issues
- Verify
bd sync+git pushworkflow
Rollout Planβ
- Phase 1: Complete beads setup (done)
- Phase 2: Add Cursor integration rules
- Phase 3: Deploy sync script, test with small issue set
- Phase 4: Full team adoption with documentation
Relatedβ
- Beads Issue:
ai-platform-engineering-34j(Sync beads with GitHub Issues) - Beads Issue:
ai-platform-engineering-4cp(Implement beads tracking) - Beads Issue:
ai-platform-engineering-9wk(Document beads in workspace rules) - Beads Repository: github.com/steveyegge/beads
Appendix: Cursor Rules Integrationβ
Add to .cursorrules:
## Beads Task Tracking
**Location**: `.beads/`
### Essential Commands
\`\`\`bash
bd ready # Find available work
bd show <id> # View issue details
bd create "title" # Create new issue
bd update <id> --status in_progress # Claim work
bd close <id> # Complete work
bd sync # Sync with git
\`\`\`
### Workflow Integration
1. **Starting Work**: `bd ready` β `bd update <id> --status in_progress`
2. **During Work**: Reference issue ID in commits
3. **Completing Work**: `bd close <id>` β `bd sync` β `git push`
4. **Remaining Work**: `bd create "Follow-up task"` for anything incomplete
### Session Completion (Landing the Plane)
Before ending any session:
1. Create issues for remaining work: `bd create "..."`
2. Update issue status: `bd close <id>` or `bd update <id> --status blocked`
3. Sync and push: `bd sync && git push`