--- name: openspec-beads-implement description: Integrates OpenSpec and Beads during implementation. Works on Beads issues and updates OpenSpec tasks automatically. Activates when user wants to implement a change using beads as tracker. --- # OpenSpec + Beads Implementation Skill This skill integrates both systems during implementation: uses Beads for work tracking and updates OpenSpec automatically. ## When to Activate - User runs `openspec apply ` AND beads is initialized - User says "implement this with beads", "work on " - User asks how to work with both systems ## Main Flow ### 1. Select Change ```bash openspec status --change "" --json ``` Same as openspec-apply-change. ### 2. Link with Beads ```bash bd list --labels "spec:" --json ``` **If no issues exist**: - Run openspec-to-beads first: `Skill: openspec-to-beads` - Or warn user that there are no beads for this change ### 3. Implementation Loop For each OpenSpec task: 1. **Find equivalent bead** - Search by title containing the task text - Use label `spec:` to filter 2. **Update status in Beads** ```bash bd update --status in_progress ``` 3. **Implement** the change 4. **Close bead** ```bash bd close --reason "Completed: " ``` 5. **Update OpenSpec** - In tasks.md: `- [ ]` → `- [x]` ### 4. Show Progress ``` ## Implementing: Beads: / | OpenSpec: / ``` ## Key Commands ### Search Issues by Spec ```bash bd list --labels "spec:" --json ``` ### View Issue Details ```bash bd show --json ``` ### Update Status ```bash bd update --status in_progress bd update --status open ``` ### Close Issue ```bash bd close --reason "Completed: " ``` ## Common Errors **No beads for this change:** ``` ⚠️ No beads found with label spec: Run first: Skill openspec-to-beads ``` **Beads not initialized:** ``` ⚠️ Beads is not initialized Run: bd init --prefix ``` **Issue blocked:** ``` ⚠️ Issue is blocked by: Use: bd show for details ``` ## Synchronization When all tasks are complete: - Beads issues should be "closed" - OpenSpec tasks.md should have `- [x]` in all Recommend to user: ```bash bd sync # Sync beads with git ``` ## Integration with Other Skills - **openspec-to-beads**: Creates beads from specs (pre-implementation) - **openspec-apply-change**: Flow without beads (fallback) - **openspec-archive-change**: Archive completed change ## Output Example ``` ## Implementing: add-auth Beads: 2/5 | OpenSpec: 2/5 ▶ Working on: bead-123 "add-auth: Implement login API" ✓ Completed ▶ Working on: bead-124 "add-auth: Create Login component" ✓ Completed 3 tasks remaining... ```