Add a Claude Code skill that imports open Gitea issues as beads: - Uses 'tea issues' to list open issues - Checks existing beads to avoid duplicates - Detects issue type (bug/feature/task) from content - Creates beads with P2 priority and Gitea issue URL in notes - Reports summary of imported vs skipped issues Implements bead: nixos-configs-tdf
3.2 KiB
3.2 KiB
description
| description |
|---|
| Import open Gitea issues as beads, skipping already-imported ones |
Import Gitea Issues as Beads
This skill imports open Gitea issues as beads, checking for duplicates to avoid re-importing already tracked issues.
Prerequisites
teaCLI must be installed and configured for the repositorybd(beads) CLI must be installed- Must be in a git repository with a Gitea/Forgejo remote
Workflow
Step 1: Get open Gitea issues
List all open issues using tea:
tea issues
This returns a table with columns: INDEX, TITLE, LABELS, MILESTONE
Step 2: Get existing beads
List all current beads to check what's already imported:
bd list
Also check bead notes for issue URLs to identify imports:
bd list --json | jq -r '.[] | select(.notes != null) | .notes' | grep -oP 'issues/\K\d+'
Step 3: Check for already-linked PRs
Check if any open PRs reference beads (skip these issues as they're being worked on):
tea pr list
Look for PRs with:
- Bead ID in title:
[nixos-configs-xxx] - Bead reference in body:
Implements bead:orBead ID:
Step 4: For each untracked issue, create a bead
For each issue not already tracked:
-
Get full issue details:
tea issue [ISSUE_NUMBER] -
Determine bead type based on issue content:
- "bug" - if issue mentions bug, error, broken, fix, crash
- "feature" - if issue mentions feature, add, new, enhancement
- "task" - default for other issues
-
Create the bead:
bd add "[ISSUE_TITLE]" \ --type=[TYPE] \ --priority=P2 \ --notes="Gitea issue: [ISSUE_URL] Original issue description: [ISSUE_BODY]"Note: The
--notesflag accepts multi-line content.
Step 5: Report results
Present a summary:
## Gitea Issues Import Summary
### Imported as Beads
| Issue | Title | Bead ID | Type |
|-------|-------|---------|------|
| #5 | Add dark mode | nixos-configs-abc | feature |
| #3 | Config broken on reboot | nixos-configs-def | bug |
### Skipped (Already Tracked)
| Issue | Title | Reason |
|-------|-------|--------|
| #4 | Update flake | Existing bead: nixos-configs-xyz |
| #2 | Refactor roles | PR #7 references bead |
### Skipped (Other)
| Issue | Title | Reason |
|-------|-------|--------|
| #1 | Discussion: future plans | No actionable work |
Type Detection Heuristics
Keywords to detect issue type:
Bug indicators (case-insensitive):
- bug, error, broken, fix, crash, fail, issue, problem, wrong, not working
Feature indicators (case-insensitive):
- feature, add, new, enhancement, implement, support, request, want, would be nice
Task (default):
- Anything not matching bug or feature patterns
Error Handling
- tea not configured: Report error and exit
- bd not available: Report error and exit
- Issue already has bead: Skip and report in summary
- Issue is a PR: Skip (tea shows PRs and issues separately)
Notes
- Default priority is P2; adjust manually after import if needed
- Issue labels from Gitea are not automatically mapped to bead tags
- Run this periodically to catch new issues
- After import, use
bd readyto see which beads can be worked on