skills/create-pr/SKILL.md
Skill for pushing branch and creating pull requests with proper target branch detection and draft support. Use when user asks to "create PR", "push and create PR", "open a pull request", or says "/create-pr". Also invoked by /resolve workflow finalization phase. Do NOT use for reviewing PRs (use review-pr skill instead).
npx skillsauth add nicolas-codemate/claudecodeconfig create-prInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Finalization phase of ticket resolution: push the branch, create the pull request.
--wait-for-ci) - monitor PR checks, fix failures, retry (bounded)references/configuration.md — target branch sources, PR body templates,
ticket-config.json options, status file shape. Read it when a detection step is ambiguous
or when the project has custom PR config.references/ci-watch.md — the /goal loop that watches CI and fixes failures. Read it only
when Step 8 runs.CURRENT_BRANCH=$(git branch --show-current)
if [[ "$CURRENT_BRANCH" =~ ^(main|master|develop)$ ]]; then
echo "Error: Cannot create PR from protected branch"
exit 1
fi
git status --porcelain # uncommitted changes: ask in interactive mode, stash or fail in auto
git remote get-url origin || exit 1
git push -u origin "$CURRENT_BRANCH"
A rejected push is usually authentication, branch protection, or a stale local branch —
read the git output and act on what it says. Suggest git pull --rebase when behind.
gh pr view "$CURRENT_BRANCH" --json number,url 2>/dev/null
A PR already open for this branch means the skill is done: report its URL and stop.
Priority order (details in references/configuration.md): explicit --base, worktree status
file, ticket metadata, branch prefix pattern, project config, git default branch, fallback.
git ls-remote --heads origin "$TARGET_BRANCH"
If the target does not exist, list the available branches and ask which to use.
Title format: {type}: {ticket_title} ({ticket_id}) — the type comes from the branch prefix
(feat/, fix/, refactor/, docs/, chore/).
feat: Add CSV export for users (PROJ-123)
fix: Null pointer in login flow (PROJ-456)
Body: project PR template if the repository has one, built-in template otherwise, config
body_template above both. See references/configuration.md for the search paths and the
built-in template.
gh pr create \
--title "$PR_TITLE" \
--body "$PR_BODY" \
--base "$TARGET_BRANCH" \
${DRAFT:+--draft}
Draft resolution: --draft / --no-draft argument, else pr.draft_by_default in auto mode,
else ask in interactive mode.
Write the PR number, URL, draft flag and target into
.claude-work/{ticket-id}/status.json and mark the finalize phase completed.
Runs only when --wait-for-ci was passed or pr.wait_for_ci.enabled is true. Load
references/ci-watch.md and follow it. Otherwise the skill ends at Step 7.
AskUserQuestion:
question: "Pousser la branche et creer une PR ?"
header: "Finalisation"
options:
- label: "Oui, push + PR"
description: "Pousser la branche et creer la pull request"
- label: "Push seulement"
description: "Pousser sans creer de PR"
- label: "Non, plus tard"
description: "Terminer sans push"
AskUserQuestion:
question: "Creer la PR en mode draft ?"
header: "Draft"
options:
- label: "Oui, draft (Recommended)"
description: "PR en brouillon, a marquer ready apres review"
- label: "Non, ready for review"
description: "PR prete pour review immediate"
AskUserQuestion:
question: "Quelle branche cible pour la PR ?"
header: "Target"
options:
- label: "main (Recommended)"
description: "Branche principale"
- label: "develop"
description: "Branche de developpement"
- label: "{ticket_target}"
description: "Specifie dans le ticket"
--wait-for-ci not already set)AskUserQuestion:
question: "Surveiller la CI et tenter de fixer les echecs automatiquement ?"
header: "Watch CI"
options:
- label: "Non (Recommended)"
description: "Fin du flow apres creation PR. Tu reprends la main sur la CI."
- label: "Oui, max 3 fix-pushes"
description: "Lance /goal: surveille gh pr checks, tente un fix sur echec, push, retry max 3 fois."
- label: "Oui, max 5 fix-pushes"
description: "Pareil avec 5 tentatives. Pour les PRs ou plusieurs checks peuvent casser independamment."
## PR Created
- **Branch**: feat/proj-123-add-csv-export
- **Target**: main
- **PR**: #456
- **URL**: https://github.com/owner/repo/pull/456
- **Status**: Draft
When the PR already existed, report the same block under ## PR Already Exists with
"No action needed."
Invoked at the end of the /resolve workflow, after implementation.
Auto mode: always push, always create the PR if absent, use draft_by_default, enable CI
watch only if pr.wait_for_ci.enabled is true or --wait-for-ci was passed to /resolve.
Interactive mode: ask about push + PR, draft mode, target branch when ambiguous, and CI watch when the PR is not a draft (no point watching CI on a draft).
User-facing messages in French. Git commands and PR content in English.
development
Method to diagnose and raise the Lighthouse performance score of a public page (landing, marketing, home). Use when asked to improve Lighthouse/PageSpeed scores, when auditing the first uncached paint of a public page, or when a landing embedded in a SPA must reach a top score. Do NOT use for in-app screen performance (data loading, rendering). For a brand-new landing, the first recommendation is static HTML with no framework runtime — most of this skill exists for when that is not an option.
tools
Audits a project's Claude Code setup against real usage — mines the project's conversations (worktrees included), confronts the project's skills/agents/CLAUDE.md with best practices, and proposes adjustments or new skills/agents/rules. Use when the user asks to audit the project config, analyze project conversations, or find automation opportunities for the current project. Do NOT use for the global ~/.claude configuration (use /audit-config instead).
development
Coaching workflow orchestrator. Guides the developer through implementation without writing code.
development
Disciplined methodology for code architecture refactoring. Use when the user asks to refactor architecture, decouple code, restructure a family of classes, redesign an interface, or rename/reorganize a set of related components. Forces a big-picture analysis before any code is written. Do NOT use for simple bug fixes, feature additions, or single-file refactoring.