skills/bd-sync/SKILL.md
Synchronize OpenSpec changes with beads epics. Audit gaps, import changes, update existing epics, find untracked work.
npx skillsauth add tmsjngx0/mindcontext-core bd-syncInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Unified skill for managing synchronization between OpenSpec changes and beads epics. All analysis is delegated to specialized agents; this skill is a thin router.
| Subcommand | Agent | Purpose |
|------------|-------|---------|
| audit | mindcontext-core:sync-auditor | Report gaps and quality between OpenSpec and beads |
| import | mindcontext-core:beads-builder | Import OpenSpec change to implementation-ready beads |
| import --lite | mindcontext-core:sync-importer | Import as lightweight tracking beads |
| update | mindcontext-core:sync-updater | Sync existing epic with evolving tasks.md |
| specgap | mindcontext-core:specgap-scanner | Find untracked work |
/bd-sync # Same as /bd-sync audit
/bd-sync audit # Full sync report
/bd-sync audit --missing # Only untracked OpenSpec changes
/bd-sync audit --orphans # Only orphaned beads epics
/bd-sync audit --drift # Only completion status drift
/bd-sync audit --quality # Include bead content quality assessment
/bd-sync import <change> # Import (implementation-ready beads, default)
/bd-sync import <change> --lite # Import (lightweight tracking beads)
/bd-sync import <change> --skip-tdd # Skip TDD test-bead-first (TDD is default ON)
/bd-sync import <change> --containment=full # Force containment level
/bd-sync import <change> --max-bead-size=300 # Custom decomposition threshold
/bd-sync import --all # Import all untracked changes
/bd-sync import <change> --dry-run # Preview without creating
/bd-sync update <change> # Sync spec -> beads
/bd-sync update <change> --direction=beads-to-spec
/bd-sync update <change> --direction=both
/bd-sync update --all # Update all tracked changes
/bd-sync specgap # Find untracked commits (last 7 days)
/bd-sync specgap --since=2w # Custom date range
/bd-sync specgap --todos # Also scan for TODO/FIXME
/bd-sync specgap --create # Interactively create tasks for gaps
Parse $ARGUMENTS to determine subcommand:
Gather context (bash):
ls openspec/changes/ 2>/dev/null | grep -v archive
br list -t epic
Parse flags:
--missing -> Only untracked changes--orphans -> Only orphaned epics--drift -> Only completion drift--quality -> Add bead content quality assessmentLaunch agent: mindcontext-core:sync-auditor
quality_check: true if --quality flag presentDisplay report: Format the agent's JSON as a readable table
/bd-sync import <name>)tracking-only beads with suggestion: /bd-sync import <name> to upgradeHandle filters: If flag present, show only that section
Validate change exists:
test -d "openspec/changes/$CHANGE_NAME" || echo "Change not found"
Parse flags:
--lite -> Lightweight tracking beads (sync-importer agent)--skip-tdd -> Skip TDD test-bead-first generation (TDD is ON by default)--containment=full|hybrid|ref -> Override auto-detection--max-bead-size=N -> Decomposition threshold (default 200)--dry-run -> Preview without creating--all -> Import all untracked changesHandle --all flag: If --all, get untracked list from audit and loop
Route to agent:
If --lite flag is present:
Launch mindcontext-core:sync-importer (Sonnet, lightweight)
If --lite flag is NOT present (default):
Read spec files and pass content to agent:
cat "openspec/changes/$CHANGE_NAME/proposal.md"
cat "openspec/changes/$CHANGE_NAME/design.md" 2>/dev/null || true
cat "openspec/changes/$CHANGE_NAME/tasks.md"
cat "openspec/changes/$CHANGE_NAME/tests.md" 2>/dev/null || true
find "openspec/changes/$CHANGE_NAME/specs" -name "*.md" -exec cat {} \; 2>/dev/null || true
Launch mindcontext-core:beads-builder (Opus, full quality)
br create and returns structured resultDisplay results:
Handle --dry-run: If dry-run, tell the agent to describe what would be created without executing br create
Find existing epic:
br list -t epic -l "openspec:$CHANGE_NAME"
Gather current state:
br list --parent $EPIC_ID
cat "openspec/changes/$CHANGE_NAME/tasks.md"
Determine direction: Default spec-to-beads, or from --direction flag
Launch agent: mindcontext-core:sync-updater
Display results: Show what was created/closed/updated
For beads-to-spec: If checkbox_updates returned, ask user before editing tasks.md:
AskUserQuestion: "Update these checkboxes in tasks.md? [list changes]"
Apply edits only if user confirms.
Parse options: --since (default 7d), --todos flag, --create flag
Gather context:
git log --oneline --since="$SINCE"
br list --json
Launch agent: mindcontext-core:specgap-scanner
Display report: Format as readable list with counts
Handle --create: If --create flag, for each untracked item:
AskUserQuestion: "Create beads task for: [commit/todo/file]? (y/n/skip)"
Create tasks for confirmed items.
tools
Bootstrap a project to use mctx by injecting a managed block into AGENTS.md. Tool-agnostic guidance every agent reads. Runs `mctx init` and shows the diff. Use when starting a new project, onboarding a repo, or asked to "init mctx" / "add mctx guidance" / "set up AGENTS.md".
development
Test-Driven Development workflow following Kent Beck's methodology. Auto-loads when user asks about "tdd", "test driven", "red green refactor", "write tests first".
testing
Analyze current session and generate a self-contained context prompt for the next Claude session. Includes project context, decisions, next steps, and tech stack. Use when ending a work session.
tools
Summarize current project state after a long break. Analyzes recent git history, beads issues, and memory to produce a one-page orientation. Use when returning to a project cold, or when asking "what was I doing", "where did I leave off".