Skip to content

feat: add raise-pr and bug-fix skills with Jira integration (v0.7.0)#54

Open
its-mitesh-kumar wants to merge 9 commits into
redhat-developer:mainfrom
its-mitesh-kumar:feat/raise-pr-skill
Open

feat: add raise-pr and bug-fix skills with Jira integration (v0.7.0)#54
its-mitesh-kumar wants to merge 9 commits into
redhat-developer:mainfrom
its-mitesh-kumar:feat/raise-pr-skill

Conversation

@its-mitesh-kumar

@its-mitesh-kumar its-mitesh-kumar commented Jul 3, 2026

Copy link
Copy Markdown
Member

Summary

  • Adds raise-pr skill that automates the full PR workflow (detect workspace, build, generate changeset, commit, push, create PR) for both rhdh-plugins and community-plugins monorepos
  • Auto-detects which repo you're in via git remote -v and adapts PR template, npm scope, and upstream target accordingly
  • Supports --a auto-approve mode to skip all approval gates for unattended workflows
  • Dual-source input — accepts both Jira issues (key or URL) and GitHub issues (URL or #N) as bug references
  • Dual-repo support — works with both redhat-developer/rhdh-plugins and backstage/community-plugins, with repo-specific PR templates, commit conventions, and issue-linking rules
  • Built-in Jira integration — branch naming, commit trailers, PR ## Fixed section, post-PR comment, issue transition to Review, and web link via REST API
  • Built-in GitHub issue integration — Fixes in PR body for auto-close, post-PR comment, label management
  • Adds bug-fix skill for end-to-end bug fixing with two modes: full-e2e (UI bugs with Playwright before/after recordings) and no-e2e (backend bugs with unit/integration test verification)
  • Agent-readiness triage gate — validates issue completeness before attempting a fix; adds not-ready-for-agent label and a missing-info comment if details are insufficient
  • Readiness check — verifies required tools (gh, acli/MCP, yarn, node, ffmpeg) with visual PASS/WARN indicators before starting work
  • Automated GIF embedding — uploads before/after GIFs to the feature branch via GitHub Contents API with DCO-compliant Signed-off-by trailers
  • Screenshot + DOM diagnosis — captures screenshots, DOM snapshots, and computed styles during reproduction for deeper root-cause analysis
  • Auto-generated Test Plan — PR descriptions include a reviewer-facing verification checklist derived from issue steps-to-reproduce
  • Reviewer disclaimer — bug-fix PRs include a note asking reviewers to verify thoroughly before merging
  • Community-plugins isolation — Jira information never leaks into community-plugins PRs (no Jira keys in body, trailers, or commit messages)
  • --no-verify mode for bug-fix to skip the user verification gate and auto-chain into raise-pr --a
  • Bumps version to v0.7.0

Architecture

bug-fix and raise-pr

Context

Extracts and generalizes the existing Cursor command (rhdh-plugins/.cursor/commands/pr.md) and its #3679 enhancement into a portable agent skill that works across both plugin monorepos.

The raise-pr skill has first-class issue support — any PR linked to a Jira issue gets automatic branch naming (fix/<workspace>-<JIRA-KEY>-<slug>), a Fixes: commit trailer, a ## Fixed section in the PR body, post-PR Jira comment via MCP, issue transition to Review via ACLI, and web link via REST API. GitHub issues get Fixes <url> in the PR body for auto-close, a post-PR comment, and label updates.

The bug-fix skill chains into raise-pr after reproducing and fixing a bug. For UI bugs (full-e2e mode): writes a Playwright reproduction test with video recording, captures diagnostic context (screenshot + DOM + computed styles), applies the fix, captures before/after recordings, converts to GIFs, generates a test plan, and creates the PR with embedded visual evidence. For backend bugs (no-e2e mode): checks existing tests or writes a temporary repro unit test, diagnoses and fixes, verifies tests pass, deletes the temp test, and chains into raise-pr.

Before any fix attempt, the skill validates the issue has sufficient detail (steps to reproduce, expected behavior, component/workspace). Issues missing required fields are automatically labeled not-ready-for-agent with a comment listing what's needed.

How to Use

Prerequisites

Install

Install from local checkout (while PR is unmerged):

cd /path/to/rhdh-plugins
npx skills add /path/to/rhdh-skill --skill bug-fix
npx skills add /path/to/rhdh-skill --skill raise-pr

After merge:

npx skills add redhat-developer/rhdh-skill --skill bug-fix
npx skills add redhat-developer/rhdh-skill --skill raise-pr

Invoke

# From a Jira issue
bug-fix RHDHBUGS-1234
bug-fix https://redhat.atlassian.net/browse/RHDHBUGS-1234

# From a GitHub issue
bug-fix https://github.com/redhat-developer/rhdh-plugins/issues/607
bug-fix https://github.com/backstage/community-plugins/issues/3574

# Skip verification gate
bug-fix RHDHBUGS-1234 --no-verify

What it does

  1. Detects input source — determines if the input is a Jira issue or GitHub issue
  2. Readiness check — verifies required tools are available (gh, acli/MCP, yarn, node, ffmpeg) with visual PASS/WARN indicators
  3. Fetches the issue (summary, description, steps to reproduce, component) from Jira REST/MCP or GitHub CLI
  4. Triage gate — validates the issue has sufficient detail for automated fixing; labels not-ready-for-agent if missing info
  5. Identifies workspace and repo — maps the issue component/labels to a workspace (e.g., "Lightspeed" → workspaces/lightspeed) and determines if the target is rhdh-plugins or community-plugins
  6. Discovers e2e infrastructure and decides mode (full-e2e for UI bugs, no-e2e for backend bugs)
  7. Reproduces the bug — Playwright test with video recording (full-e2e) or unit test verification (no-e2e)
  8. Captures diagnostic context — screenshot, DOM snapshot, computed styles (full-e2e mode)
  9. Diagnoses and applies the fix
  10. Verifies the fix — re-runs tests, captures "after" recording (full-e2e)
  11. Generates a Test Plan — markdown checklist from steps-to-reproduce
  12. Chains into raise-pr — builds, generates changeset, commits with DCO, pushes, uploads GIFs, creates PR with conditional sections, performs post-PR issue updates (Jira: comment + transition + web link; GitHub: comment + auto-close)

Using raise-pr standalone

# With a Jira issue
raise-pr RHDHBUGS-1234
raise-pr https://redhat.atlassian.net/browse/RHIDP-15252

# With a GitHub issue
raise-pr https://github.com/redhat-developer/rhdh-plugins/issues/607

PR Body Sections (conditional)

Section Included when...
## Description Always
## Fixed issue_source is set (Jira for rhdh-plugins only; GitHub for both repos)
## UI before changes / ## UI after changes recordings provided (full-e2e mode, GIFs uploaded to branch)
## Test Plan test_plan provided by caller
## Checklist Always (repo-specific template)
## Note issue_source is present (bug-fix invoked raise-pr)

Key Design Decisions

  • Dual-source, dual-repo — The skills detect issue source (Jira/GitHub) and target repo (rhdh-plugins/community-plugins) independently, adapting behavior for each combination.
  • Community-plugins isolation — Jira information never appears in community-plugins PRs. Internal Jira tracking stays internal; only GitHub issue links are used in public PRs.
  • Agent-readiness triage — Issues are validated for completeness before any fix attempt, preventing wasted effort on underspecified bugs.
  • GIF upload happens BEFORE gh pr create — GIFs are uploaded to the fork branch via GitHub Contents API with DCO-compliant Signed-off-by trailers, and the resulting raw.githubusercontent.com URLs are embedded directly in the PR body.
  • Screenshot + DOM capture in diagnosis — The agent captures runtime state (screenshot, outerHTML, computed styles) before any fix is applied, providing concrete evidence for root-cause identification.
  • Two verification modes — Full-e2e (Playwright) for UI bugs, no-e2e (unit/integration tests) for backend bugs. Temporary repro tests are deleted before PR in both modes.
  • Post-PR issue sync — Jira issues get comment + transition to Review + web link; GitHub issues get comment + auto-close via Fixes keyword.

Files

raise-pr skill

  • New: skills/raise-pr/SKILL.md — 11-step workflow with repo auto-detection, --a auto-approve mode, dual-source issue resolution, GIF upload via Contents API, and post-PR issue updates (Jira comment/transition/web-link, GitHub comment/auto-close)
  • New: skills/raise-pr/references/repo-profiles.md — per-repo config with conditional PR body templates, community-plugins Jira isolation rules, and DCO requirements
  • New: skills/raise-pr/references/jira-input.md — shared Jira key/URL parsing logic and REST API patterns (fetch, web link, comment, transition)

bug-fix skill

  • New: skills/bug-fix/SKILL.md — multi-step workflow with dual-source input, readiness check, triage gate, workspace/repo detection, full-e2e and no-e2e modes, --no-verify flag
  • New: skills/bug-fix/references/workspace-map.md — Jira component and GitHub label to workspace mapping for both rhdh-plugins and community-plugins, with cross-cutting component disambiguation
  • New: skills/bug-fix/references/github-input.md — GitHub issue URL parsing and gh CLI patterns for fetching, commenting, and labeling
  • New: skills/bug-fix/references/e2e-patterns.md — shared Playwright patterns across all workspaces
  • New: skills/bug-fix/references/video-recording.md — Playwright video config, ffmpeg conversion, and automated GitHub Contents API embedding

Shared

  • Modified: docs/agents/triage-labels.md — updated with not-ready-for-agent label for agent-readiness triage gate

Metadata

  • Modified: README.md — added Bug Fix section, updated raise-pr description
  • Modified: pyproject.toml, .claude-plugin/plugin.json, .claude-plugin/marketplace.json — version bump to 0.7.0

Test plan

  • uv run pytest passes (321 passed, 1 pre-existing failure unrelated to this PR)
  • Skill structure tests pass (test_skill_structure.py)
  • Marketplace/version tests pass (test_marketplace.py)
  • Install via npx skills add redhat-developer/rhdh-skill --skill raise-pr and verify issue input parsing (Jira + GitHub)
  • Install via npx skills add redhat-developer/rhdh-skill --skill bug-fix and verify trigger phrases
  • Test raise-pr with a Jira key: verify branch name, commit trailer, PR body, and post-PR Jira comment/transition/web-link
  • Test raise-pr with a GitHub issue: verify PR body Fixes link, post-PR comment, auto-close behavior
  • Test bug-fix with an RHDHBUGS issue: verify full workflow including triage gate, screenshot capture, test plan generation, GIF upload, and PR creation
  • Test bug-fix targeting community-plugins: verify no Jira info leaks into PR body or commit messages
  • Test bug-fix --no-verify: verify it auto-chains into raise-pr --a without pausing

Signed-off-by: its-mitesh-kumar <itsmiteshkumar98@gmail.com>
Signed-off-by: its-mitesh-kumar <itsmiteshkumar98@gmail.com>
@its-mitesh-kumar its-mitesh-kumar changed the title feat: add raise-pr skill for automated PR workflows (v0.7.0) feat: add raise-pr and bug-fix skills with Jira integration (v0.7.0) Jul 3, 2026
Signed-off-by: its-mitesh-kumar <itsmiteshkumar98@gmail.com>
Signed-off-by: its-mitesh-kumar <itsmiteshkumar98@gmail.com>
Signed-off-by: its-mitesh-kumar <itsmiteshkumar98@gmail.com>
Signed-off-by: its-mitesh-kumar <itsmiteshkumar98@gmail.com>
@its-mitesh-kumar

Copy link
Copy Markdown
Member Author

Raise PR Test : redhat-developer/rhdh-plugins#3708 (comment)

@durandom durandom left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review

Ambitious PR adding two full skills (`raise-pr` + `bug-fix`) that automate the PR lifecycle and end-to-end bug fixing with Playwright recordings. The architecture is well-thought-out — `bug-fix` chains into `raise-pr` with a clean caller-context contract.

What's good

  • Repo profiles (`repo-profiles.md`) — auto-detection via `git remote -v` with separate templates for rhdh-plugins vs community-plugins is practical
  • Baseline diffing — capturing `git status --porcelain` before builds to filter out pre-existing dirty files in Step 7 is clever and prevents accidental staging of unrelated changes
  • Video recording workflow — the principled approach (write repro test → fail → capture before → fix → pass → capture after) with hard gates at each step prevents out-of-order execution
  • GitHub Contents API for GIF upload — embedding recordings directly in the PR description via branch-committed files that auto-delete on merge is clean
  • Jira input parsing (`jira-input.md`) — handles all common input formats (bare key, browse URL, URL without scheme, URL with query params)
  • Changeset generation rules — correctly scoping to `plugins/` only, ignoring `packages/`, and checking published paths is right

Issues

  1. Cursor-specific references. Several places reference Cursor-specific constructs:

    • `CallMcpTool: server="user-jira"` in Step 11 — not portable to Claude Code or other agents
    • `required_permissions: ["all"]` in `preflight_system_limits` — Cursor Shell tool concept
    • The Prerequisites mention "Cursor" specifically for MCP setup

    Consider abstracting the MCP calls behind a generic pattern (e.g., "use your agent's Jira MCP tool to add a comment") and noting Cursor as one implementation option.

  2. PR size. Two full skills (700+ lines of SKILL.md each) plus 3 reference files in one PR is a lot to review. If this hasn't been through internal testing yet, consider splitting `raise-pr` into its own PR — it's independently useful and simpler to validate. `bug-fix` can follow as a separate PR that chains into it.

  3. `workspace-map.md` will go stale. The Jira Component → workspace mapping is hardcoded. Consider generating this from the workspace directories + some metadata, or at least noting a date/version.

  4. `ulimit -n 65536` in principles. This is macOS-specific (Linux typically has higher defaults). The principle should note this is primarily for macOS development.

  5. Version conflict. This bumps 0.6.1 → 0.7.0. PR #58 also bumps 0.6.1 → 0.7.0. If both need to be v0.7.0 (minor for new skills), only one can merge with that version.

Recommendation

The skills are well-designed. Address the Cursor-specific portability concerns and consider splitting into two PRs for easier review. Needs version coordination with #58.

Signed-off-by: its-mitesh-kumar <itsmiteshkumar98@gmail.com>
Signed-off-by: its-mitesh-kumar <itsmiteshkumar98@gmail.com>

# Conflicts:
#	.claude-plugin/marketplace.json
#	.claude-plugin/plugin.json
#	uv.lock
@its-mitesh-kumar

Copy link
Copy Markdown
Member Author

@durandom Thanks for the thorough review! Addressing each point:

1. Cursor-specific references — Fixed. Removed all Cursor-specific constructs (CallMcpTool, server="user-jira", required_permissions: ["all"]). MCP calls now use generic language (e.g., "Use the Jira MCP add_jira_comment tool") and Prerequisites reference "your agent environment" instead of Cursor specifically.

2. PR size — Keeping as one PR since bug-fix chains into raise-pr via a caller-context contract — testing them together covers more scenarios in less time than reviewing separately.

Tested end-to-end on two real issues:

3. workspace-map.md staleness3. workspace-map.md staleness — Added a "Last verified: July 2026" date stamp to make staleness visible. The skill now falls back to asking the user when a component doesn't match, so a stale table is safe rather than silently broken. Also added fuzzy matching (lowercase + hyphenate) and cross-cutting component disambiguation for components like "Localization" that span multiple workspaces. Auto-generating the map from workspace directories at runtime is a good idea — will explore that as a follow-up.

4. ulimit -n 65536 — Fixed. Added a note clarifying this is primarily needed on macOS (default limit 256). Linux typically defaults to 1024+ and may not require it.

5. Version conflict — Currently keeping v0.7.0 — if #58 merges first, I'll bump to v0.8.0 before this one goes in.


Since the review, also added:

  • Dual-source input — accepts both Jira issues and GitHub issues
  • backstage/community-plugins support with Jira isolation (no Jira info leaks into public PRs)
  • Agent-readiness triage gatenot-ready-for-agent label + missing-info comment for underspecified issues
  • --no-verify mode for unattended workflows
  • Backend bug support — no-e2e mode with unit/integration test verification
  • Post-PR Jira sync — web link + transition to Review via REST API
  • DCO-compliant Signed-off-by for GIF upload commits

Hence I have updated the PR description and architecture diagram.

Cc: @christoph-jerolimov @Eswaraiahsapram @lokanandaprabhu @sanketpathak

@its-mitesh-kumar

its-mitesh-kumar commented Jul 14, 2026

Copy link
Copy Markdown
Member Author

First bug fix PR redhat-developer/rhdh-plugins#3741 raised by using these both skill which was invoked using bug-fix https://redhat.atlassian.net/browse/RHDHBUGS-3245 --no-verify has been reviewed, verified and merged 🥳

Signed-off-by: its-mitesh-kumar <itsmiteshkumar98@gmail.com>
@its-mitesh-kumar

Copy link
Copy Markdown
Member Author

Another PR redhat-developer/rhdh-plugins#3846 successfully merged , which was fixed/raised using bug-fix https://github.com/redhat-developer/rhdh-plugins/issues/3845 --no-verify. With zero human in loop.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants