|
| 1 | +--- |
| 2 | +name: jira-bridge |
| 3 | +description: | |
| 4 | + Bridge groomed Jira tickets to GitHub Issues for fullsend agent processing. Reads a Jira ticket, creates a GitHub Issue in the target repo with fullsend-compatible formatting, and links both sides. Trigger on "bridge ticket", "jira to github", "jira-bridge RHIDP-1234", "send to fullsend", or any Jira key with bridging intent. |
| 5 | +compatibility: "acli or jira-cli on PATH. gh CLI authenticated. Target repos must have fullsend installed." |
| 6 | +--- |
| 7 | + |
| 8 | +<essential_principles> |
| 9 | + |
| 10 | +# Jira-to-GitHub Bridge |
| 11 | + |
| 12 | +Create GitHub Issues from Jira tickets so fullsend agents can pick them up and implement them. This skill is the second step after `jira-groom` — it assumes the ticket is already agent-ready (score 10+ on the readiness rubric). |
| 13 | + |
| 14 | +The skill does three things: |
| 15 | + |
| 16 | +1. Reads the Jira ticket and extracts structured information |
| 17 | +2. Creates a GitHub Issue with fullsend-compatible formatting |
| 18 | +3. Links both sides (Jira comment with GH link, GH issue body with Jira link) |
| 19 | + |
| 20 | +</essential_principles> |
| 21 | + |
| 22 | +<intake> |
| 23 | + |
| 24 | +## Usage |
| 25 | + |
| 26 | +``` |
| 27 | +jira-bridge <TICKET-KEY> # Bridge to auto-detected repo |
| 28 | +jira-bridge <TICKET-KEY> --repo owner/name # Bridge to specific repo |
| 29 | +jira-bridge <TICKET-KEY> --dry-run # Show what would be created, don't file |
| 30 | +jira-bridge --batch <JQL> --repo owner/name # Bridge multiple tickets |
| 31 | +``` |
| 32 | + |
| 33 | +**Wait for response before proceeding.** |
| 34 | + |
| 35 | +</intake> |
| 36 | + |
| 37 | +<routing> |
| 38 | + |
| 39 | +### Routing rules |
| 40 | + |
| 41 | +1. **Ticket key provided**: Fetch Jira ticket → detect target repo → create GitHub Issue → link both sides. |
| 42 | +2. **Ticket key + `--repo`**: Skip repo detection, use the specified repo. |
| 43 | +3. **Ticket key + `--dry-run`**: Show the GitHub Issue that would be created. No mutations. |
| 44 | +4. **`--batch` + JQL + `--repo`**: Bridge multiple tickets to the same repo. Confirm before filing. |
| 45 | +5. **No argument**: Ask for a ticket key. |
| 46 | + |
| 47 | +</routing> |
| 48 | + |
| 49 | +## How It Works |
| 50 | + |
| 51 | +### Step 1 — Fetch and validate the Jira ticket |
| 52 | + |
| 53 | +Read the ticket: |
| 54 | + |
| 55 | +```bash |
| 56 | +acli jira workitem view <KEY> --json |
| 57 | +``` |
| 58 | + |
| 59 | +Fall back to `jira issue view <KEY>` if acli is unavailable. |
| 60 | + |
| 61 | +**Validate agent-readiness**: Run a quick score against the `jira-groom` rubric (load `../jira-groom/references/agent-readiness.md`). If score < 7: |
| 62 | + |
| 63 | +> "This ticket scores {score}/12 on agent-readiness. Run `jira-groom <KEY>` first to improve it, or proceed anyway? [groom/proceed/cancel]" |
| 64 | +
|
| 65 | +If score is 7-9, note the weak dimensions but proceed. |
| 66 | + |
| 67 | +### Step 2 — Detect target repository |
| 68 | + |
| 69 | +Resolution order: |
| 70 | + |
| 71 | +1. **`--repo` flag**: Use as-is. |
| 72 | +2. **`repo:` label on Jira ticket**: Extract repo name from label value. Map to full `owner/name` using the repo mapping in `references/repo-mapping.md`. |
| 73 | +3. **Component field**: Map Jira component to a repo using `references/repo-mapping.md`. |
| 74 | +4. **Ask the user**: Present known repos from the mapping file, let them pick. |
| 75 | + |
| 76 | +Verify the repo exists and has fullsend installed: |
| 77 | + |
| 78 | +```bash |
| 79 | +gh repo view <owner/name> --json name,owner |
| 80 | +``` |
| 81 | + |
| 82 | +### Step 3 — Check for existing GitHub Issues |
| 83 | + |
| 84 | +Search for duplicates before creating: |
| 85 | + |
| 86 | +```bash |
| 87 | +gh issue list --repo <owner/name> --state open --search "<jira key OR summary keywords>" |
| 88 | +``` |
| 89 | + |
| 90 | +If a match exists: |
| 91 | + |
| 92 | +> "Found existing issue #{number}: '{title}'. Is this the same work? [skip/link/create-anyway]" |
| 93 | +
|
| 94 | +- **skip**: Don't create. Optionally add Jira link to existing issue. |
| 95 | +- **link**: Link Jira ticket to existing issue (comment on both sides). Done. |
| 96 | +- **create-anyway**: Proceed with new issue. |
| 97 | + |
| 98 | +### Step 4 — Create the GitHub Issue |
| 99 | + |
| 100 | +Build the issue using the template in `references/issue-template.md`. |
| 101 | + |
| 102 | +```bash |
| 103 | +gh issue create --repo <owner/name> \ |
| 104 | + --title "<title>" \ |
| 105 | + --label "fullsend" \ |
| 106 | + --body "$(cat <<'EOF' |
| 107 | +<body> |
| 108 | +EOF |
| 109 | +)" |
| 110 | +``` |
| 111 | + |
| 112 | +**Labels**: Always add `fullsend` so the triage agent picks it up. Add additional labels based on ticket type: |
| 113 | + |
| 114 | +| Jira type | GitHub labels | |
| 115 | +|-----------|--------------| |
| 116 | +| Bug | `fullsend`, `bug` | |
| 117 | +| Story/Task | `fullsend`, `enhancement` | |
| 118 | +| Vulnerability/CVE | `fullsend`, `security` | |
| 119 | +| Investigation (`needs-investigation`) | `fullsend`, `needs-investigation` | |
| 120 | + |
| 121 | +### Step 5 — Link both sides |
| 122 | + |
| 123 | +**On Jira** — add a comment: |
| 124 | + |
| 125 | +``` |
| 126 | +acli jira workitem comment --key <KEY> --comment "Bridged to GitHub: <issue-url>" --yes |
| 127 | +``` |
| 128 | + |
| 129 | +**On GitHub** — the Jira link is already in the issue body (from the template). |
| 130 | + |
| 131 | +### Step 6 — Report |
| 132 | + |
| 133 | +```markdown |
| 134 | +Bridged: <JIRA-KEY> → <owner/name>#<number> |
| 135 | + Jira: https://redhat.atlassian.net/browse/<KEY> |
| 136 | + GitHub: <issue-url> |
| 137 | + Score: <readiness-score>/12 |
| 138 | +``` |
| 139 | + |
| 140 | +## Reference Files |
| 141 | + |
| 142 | +| File | Load when... | |
| 143 | +|------|-------------| |
| 144 | +| `references/issue-template.md` | Always — GitHub Issue body template with fullsend-compatible formatting | |
| 145 | +| `references/repo-mapping.md` | Repo detection — maps Jira components/labels to GitHub repos | |
| 146 | +| `../jira-groom/references/agent-readiness.md` | Validation — agent-readiness scoring before bridge | |
| 147 | + |
| 148 | +## Relationship to Other Skills |
| 149 | + |
| 150 | +- **`jira-groom`**: Prerequisite — grooms tickets to agent-readiness. Bridge validates the score before proceeding. |
| 151 | +- **`rhdh-jira`**: Provides Jira infrastructure (acli, fields, workflows). Bridge uses the same tooling but doesn't duplicate it. |
| 152 | +- **fullsend triage agent**: Downstream consumer — picks up the GitHub Issue created by this skill. |
| 153 | + |
| 154 | +## Error Handling |
| 155 | + |
| 156 | +| Error | Action | |
| 157 | +|-------|--------| |
| 158 | +| Jira ticket not found | "Ticket <KEY> not found." | |
| 159 | +| Target repo not found | "Repository <owner/name> not found or no access." | |
| 160 | +| `gh issue create` fails | Show error. Common cause: missing labels (create them first). | |
| 161 | +| No repo detected | Ask user to specify with `--repo`. | |
| 162 | +| Ticket already bridged | Check Jira comments for existing "Bridged to GitHub" link. Ask before creating a second issue. | |
0 commit comments