| name | task-sync |
| description | Bidirectional synchronization between beads and external task systems (GitHub, Jira, etc.). Use when: (1) User wants to sync tasks or issues with external systems, (2) Import external issues into beads, (3) Export beads to external systems, (4) User mentions 'sync', 'GitHub issues', 'Jira tickets', 'import bugs', or 'export tasks'. Orchestrates workflow and delegates to backend-specific skills. |
Task Sync
Orchestrate bidirectional synchronization between beads and external task tracking systems.
Decision Tree
When this skill loads, follow these steps:
1. Determine Sync Direction
Identify what the user wants:
- Import (external ā beads): User wants to fetch issues from external system into beads
- Export (beads ā external): User wants to push beads issues to external system
- Bidirectional: User wants to sync both directions with conflict resolution
If unclear from context, use question tool to ask user:
question({
questions: [{
header: "Sync Direction",
question: "What type of sync would you like to perform?",
options: [
{ label: "Import (external ā beads)", description: "Fetch external issues into beads" },
{ label: "Export (beads ā external)", description: "Push beads issues to external system" },
{ label: "Bidirectional", description: "Sync both directions with conflict detection" }
]
}]
})
2. Detect Backend System
Check which backend skills are available:
- Look for a skill that syncs with GitHub Issues
- Look for a skill that syncs with Jira (future)
- Look for other task system sync skills
If exactly one backend available ā use it automatically
If multiple backends available OR none ā ask user which system to sync with
3. Load Backend Skill
Load the appropriate backend skill for the detected task system using the skill tool.
Pass context about sync direction to backend. Backend follows workflows defined in reference files.
Import Workflow
High-level steps for importing external issues into beads:
- Backend fetches open issues from external system
- Check for duplicates (skip issues already imported by checking labels)
- Map external data to beads format (priority, labels, metadata)
- Create beads with appropriate labels (
source:external, system:ID)
- Show import summary to user (count, table of imported issues)
For detailed workflow: Load references/import-workflow.md
Export Workflow
High-level steps for exporting beads issues to external system:
- Identify eligible beads (no external ID label, appropriate types)
- Show summary to user with count and table
- Ask user confirmation: "Export all? Select specific? Cancel?"
- For each selected bead:
- Map beads data to external format
- Create external issue (backend-specific command)
- Capture external ID and add label to bead
- Show export summary (count, mappings, any errors)
For detailed workflow: Load references/export-workflow.md
Bidirectional Workflow
High-level steps for bidirectional sync with conflict detection:
- Run import workflow (external ā beads)
- Collect import results
- Detect potential conflicts between systems:
- Status conflicts (closed in one, open in other)
- Content conflicts (title/description changed in both)
- Metadata conflicts (priority changed in both)
- Show import summary including conflicts detected
- Run export workflow (beads ā external)
- Resolve conflicts using safety guidelines:
- Auto-resolve safe changes
- Ask user for conflict resolution
- Show final summary (import + export counts, conflicts resolved)
For detailed workflow: Load references/bidirectional-workflow.md
Safety Principles
Rule 1: Never Override Without Checking
Always compare states before updating. Show user what will change before applying sync.
Safe pattern:
Current state: GitHub issue #123 is open
Beads state: Issue is closed
Action: Close GitHub issue
Unsafe pattern:
ā Blindly overwriting without showing preview
ā No comparison of states
Rule 2: Agentic Decision Making
Model should make decisions autonomously for safe changes, but ask user for conflicts:
Auto-proceed (safe changes):
- Closing already-closed issue (no-op)
- Adding comments to existing issue
- Updating metadata (labels, priority) when only one side changed
Ask user (conflicts):
- Both systems changed same field (title, description)
- Status conflicts (closed vs open in different systems)
- Priority conflicts (changed in both systems)
- Deleting or major destructive operations
Rule 3: Show Summary Before Sync
Always preview before executing:
- What will be imported (count, list)
- What will be exported (count, list)
- Any conflicts detected (with options for resolution)
Example preview:
Import Summary:
- 5 new issues to import from GitHub
- 2 issues already imported (skipped)
Export Summary:
- 3 beads eligible for export
- 1 bead already exported (skipped)
Conflicts Detected:
- Issue #123: Title changed in both systems
- Issue #456: Closed in beads, open in GitHub
For conflict resolution guide: Load references/safety-guidelines.md
Metadata Conventions
Label Patterns
source:external - Issue was imported from external system
github:123 - Links to GitHub issue #123
jira:PROJ-456 - Links to Jira ticket PROJ-456
- (Pattern:
system:id for any external system)
Direction Tracking
How to determine sync direction from labels:
- Has
source:external + system:ID ā Imported FROM external (import source)
- Has
system:ID only (no source label) ā Created in beads, exported TO external
External ID Capture
When exporting beads to external system:
- Create external issue using backend-specific command
- Capture external ID from response
- Add label
system:ID to bead (e.g., github:123)
- Do NOT add
source:external label (indicates direction)