3.7 KiB
3.7 KiB
Skill: create-pr
Create a Bitbucket pull request from a PAISY worktree branch.
Invoked by
🎫 JiraOps mode (or 🪃 Orchestrator delegating to JiraOps)
Required Inputs
| Input | Source | Example |
|---|---|---|
TICKET_KEY |
Jira issue key | ESIDEPAISY-12081 |
MODULE |
PAISY module name | eau, eubp, svmeldungen |
Output
- Bitbucket PR created targeting
currentbranch - Jira comment with PR link added
- BigMind fact stored
Steps
1. Get current branch
cd /Users/pplate/git/paisy-<TICKET_KEY>
git branch --show-current
Expected format: current/feature/<module>/<TICKET_KEY>-<desc> or current/bugfix/<module>/<TICKET_KEY>-<desc>
2. Ensure all changes are committed
cd /Users/pplate/git/paisy-<TICKET_KEY>
git status
If uncommitted changes exist, warn the user before proceeding.
3. Push branch to origin
cd /Users/pplate/git/paisy-<TICKET_KEY>
git push -u origin <BRANCH>
4. Gather diff statistics
cd /Users/pplate/git/paisy-<TICKET_KEY>
git diff origin/current --stat
git diff origin/current --name-only
Use the stats to build the PR description.
5. Read Jira ticket for context
ticket = retrieve_ticket_details(TICKET_KEY)
# Extract: summary, description for PR title/description
6. Compose PR title and description
PR title format (German):
<TICKET_KEY>: <Jira summary>
PR description template (German):
## Jira
<TICKET_KEY>: <summary>
## Beschreibung
<Brief description of what was changed and why, derived from Jira ticket and plan doc>
## Änderungen
<List of changed files grouped by component, from git diff --stat>
### <Component 1>
- `<file1>` — <what changed>
- `<file2>` — <what changed>
### <Component 2>
- `<file3>` — <what changed>
## Tests
- <N> Unit-Tests
- <M> Integrationstests
- Alle Tests bestanden ✅
## Checkliste
- [ ] Code Review durchgeführt
- [ ] Tests bestanden
- [ ] Flyway-Migrationen geprüft (H2 + Oracle)
- [ ] Keine `src.gen/` Änderungen
7. Create the pull request
create_pull_request(
project_key="ESIDEPAISY",
repo_slug="paisy",
title=f"{TICKET_KEY}: {summary}",
description=<composed description>,
from_branch=<BRANCH>,
to_branch="current"
)
8. Add Jira comment with PR link
add_comment_to_ticket(
issue_key=TICKET_KEY,
comment=f"*Pull Request erstellt*\n\nBranch: {BRANCH}\nPR: [PR #{pr_id}|<pr_url>]\n\nÄnderungen: {N} Dateien geändert, {M} neu"
)
9. Store in BigMind
memory_store_fact(
category="codebase",
fact=f"{TICKET_KEY}: PR #{pr_id} created — {BRANCH} → current. {N} files changed."
)
Expected Output
- Branch pushed to origin
- Bitbucket PR created with German title/description
- Jira comment added with PR link
- BigMind fact stored
Error Handling
| Error | Resolution |
|---|---|
| Branch not pushed | Run git push -u origin <BRANCH> first |
| Uncommitted changes | Warn user, suggest git add + git commit |
| PR already exists | Check list_prs_for_repository for existing PR from same branch |
| Merge conflicts | Run git fetch origin current && git merge origin/current in worktree, resolve conflicts |
| No diff (empty PR) | Branch is identical to current — nothing to merge |
Conventions
- PR title: always starts with
TICKET_KEY:for Jira auto-linking - PR description: German (matches Jira language)
- Target branch: always
current(nevermasterormain) - Repo:
project_key="ESIDEPAISY",repo_slug="paisy" - One PR per ticket — don't create multiple PRs for the same branch
Language
- PR title and description: German
- Branch names, file paths: English as-is
- Jira comment: German