feat: add raise-pr and bug-fix skills with Jira integration (v0.7.0)#54
feat: add raise-pr and bug-fix skills with Jira integration (v0.7.0)#54its-mitesh-kumar wants to merge 6 commits into
Conversation
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>
Signed-off-by: its-mitesh-kumar <itsmiteshkumar98@gmail.com>
Signed-off-by: its-mitesh-kumar <itsmiteshkumar98@gmail.com>
|
Raise PR Test : redhat-developer/rhdh-plugins#3708 (comment) |
durandom
left a comment
There was a problem hiding this comment.
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
-
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.
-
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.
-
`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.
-
`ulimit -n 65536` in principles. This is macOS-specific (Linux typically has higher defaults). The principle should note this is primarily for macOS development.
-
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.
Summary
raise-prskill that automates the full PR workflow (detect workspace, build, generate changeset, commit, push, create PR) for bothrhdh-pluginsandcommunity-pluginsmonoreposgit remote -vand adapts PR template, npm scope, and upstream target accordingly--aauto-approve mode to skip all approval gates for unattended workflowsbug-fixskill for end-to-end bug fixing from Jira tickets with Playwright-based before/after screen recordingsraw.githubusercontent.comURLs directly in the PR descriptionArchitecture
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-prskill has first-class Jira support — any PR linked to a Jira issue gets automatic branch naming (fix/<workspace>-<JIRA-KEY>-<slug>), aFixes:commit trailer, a## Fixedsection in the PR body, and a post-PR Jira comment via MCP.The
bug-fixskill chains intoraise-prafter reproducing and fixing a bug: it writes a Playwright reproduction test with video recording, captures diagnostic context (screenshot + DOM + computed styles) to pinpoint the root cause, applies the fix, captures before/after recordings, converts them to GIFs, generates a test plan for reviewers, and creates the PR with embedded visual evidence.How to Use
Prerequisites
ghCLI — GitHub CLI must be installed and authenticated (gh auth statusshould show logged in). Install: https://cli.github.com/rhdh-plugins(orcommunity-plugins)yarnavailable on PATHffmpegon PATH (for converting screen recordings to GIFs). Install if missing:which ffmpeg || brew install ffmpegInstall
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-prAfter merge:
Invoke
What it does
workspaces/lightspeed).webmrecordings to GIFs viaffmpegraise-pr— builds, generates changeset, commits, pushes, uploads GIFs to branch via GitHub Contents API, creates PR with before/after GIFs embedded + Test Plan + reviewer Note, then adds a comment on the Jira issueUsing raise-pr standalone with Jira
When a Jira key is provided,
raise-prautomatically:fix/<workspace>-<JIRA-KEY>-<slug>Fixes:trailer in the commit message## Fixedsection in the PR body with the Jira linkPR Body Sections (conditional)
The generated PR description includes these sections based on context:
## Description## Fixedjira_keyis provided## UI before changes/## UI after changesrecordingsare provided (GIFs uploaded to branch)## Test Plantest_planis provided by caller## Checklist## NoterecordingsANDjira_keyare present (automated bug-fix PR)Key Design Decisions
gh pr create— GIFs are uploaded to the fork branch via GitHub Contents API, and the resultingraw.githubusercontent.comURLs are embedded directly in the PR body. Nogh pr editor manual drag-and-drop needed.add_jira_commentMCP call (with correctbodyparam) is used post-PR. Web Link and Transition steps were removed because the corresponding MCP tools don't exist andacliis a paid third-party tool.outerHTML, computed styles) before any fix is applied, providing concrete evidence for root-cause identification rather than guessing from source alone.## Notesection reminding reviewers this was agent-generated and should be verified thoroughly.Files
raise-pr skill
skills/raise-pr/SKILL.md— 11-step workflow with repo auto-detection,--aauto-approve mode, Jira context resolution, GIF upload via Contents API, and post-PR Jira commentskills/raise-pr/references/repo-profiles.md— per-repo config (upstream remote, npm scope, PR body template with conditional Jira/recording/test-plan/note sections)skills/raise-pr/references/jira-input.md— shared Jira key/URL parsing logic and REST API patternsbug-fix skill
skills/bug-fix/SKILL.md— 8-step workflow (fetch Jira issue, identify workspace, reproduce with video, diagnose with screenshot+DOM capture, fix, verify, convert videos, generate test plan, chain into raise-pr)skills/bug-fix/references/workspace-map.md— Jira component to rhdh-plugins workspace directory mapping with runtime discovery instructionsskills/bug-fix/references/e2e-patterns.md— shared Playwright patterns across all workspaces (multi-locale, dual-mode, translation helpers, MUI patterns, repro test template)skills/bug-fix/references/video-recording.md— Playwright video config, ffmpeg conversion, and automated GitHub Contents API embedding workflowMetadata
README.md— added Bug Fix section, updated raise-pr description with Jira integration mentionpyproject.toml,.claude-plugin/plugin.json,.claude-plugin/marketplace.json— version bump to 0.7.0Test plan
uv run pytestpasses (321 passed, 1 pre-existing failure unrelated to this PR)test_skill_structure.py)test_marketplace.py)npx skills add redhat-developer/rhdh-skill --skill raise-prand verify Jira input parsingnpx skills add redhat-developer/rhdh-skill --skill bug-fixand verify trigger phrasesraise-prwith a Jira key: verify branch name, commit trailer, PR body, and post-PR Jira commentbug-fixwith an RHDHBUGS issue: verify full workflow including screenshot capture, test plan generation, GIF upload, and PR creation with embedded images