{"id":"23b5a101-ed5d-433a-a9a5-09a295a294e1","shortId":"tGc9p6","kind":"skill","title":"pr-create","tagline":"Agent-driven PR creation skill. Validates branch, runs pre-push checklist, generates GIT-OS compliant PR title and body from commit history, detects stacked branches, then pushes and opens the PR via gh CLI.","description":"# PR Create — Agent-Driven Pull Request Skill\n\n## Trigger\n\nLoad this skill when a dev wants to **push code and open a pull request**:\n- \"Create a PR\"\n- \"Open a PR\"\n- \"Push and create PR\"\n- \"Submit this for review\"\n- \"Ship this branch\"\n\n**Do NOT use this skill for:** generating a branch name from a ticket (use `sprint`), or applying review fixes after a PR is open (use `pr-review`). This skill runs at the end of a feature — code is already written and committed.\n\nRead `.wednesday/skills/git-os/SKILL.md` before doing anything.\n\n## Flow\n\n```\n1. Validate branch name\n2. Run pre-push checklist\n3. Run coverage/Sonar (only if project has them configured)\n4. Extract ticket ID\n5. Generate PR title from commit history\n6. Detect stacked branch\n7. Build PR body → show to dev → wait for approval\n8. git push + gh pr create\n9. Return PR URL\n```\n\n---\n\n## Step 1 — Validate Branch Name\n\nCurrent branch must match: `feat|fix|chore|test|hotfix/<name>`\n\n```bash\ngit branch --show-current\n```\n\nIf it does not match — explain the correct format and **stop**. Do not proceed.\n\nExample valid names: `feat/user-auth`, `fix/WED-142-token-crash`, `chore/update-deps`\n\n---\n\n## Step 2 — Pre-Push Checklist\n\nRun in order. Stop and show the error output if any command fails.\n\n```bash\nnpm run lint\nnpm run format:check\nnpm run test\nnpm run build\n```\n\nIf a project does not have one of these scripts, skip it and note it was skipped.\n\n---\n\n## Step 3 — Coverage and Sonar (Conditional)\n\n**Only run this step if the project opted in during `ws-skills install`.** Check `.wednesday/config.json`:\n\n```bash\nnode -e \"const c=require('./.wednesday/config.json'); const cicd=c.cicd||{}; console.log(JSON.stringify({coverage:!!cicd.coverage,sonar:!!cicd.sonar}))\"\n```\n\n### If coverage enabled\n\nRun `npm run coverage` (if it exists). Capture first 20 lines of output as summary. If script fails, note it but do not block the PR.\n\n### If sonar enabled\n\nRun `npm run sonar`. Capture output and look for quality gate result. A **failed quality gate blocks the PR** — stop and show the reason. Otherwise, show summary.\n\n### Append to PR Body\n\nIf either ran successfully, add to the PR body:\n\n```markdown\n### Coverage\n<summary output from coverage script>\n\n### Sonar Analysis\n<quality gate + key metrics from sonar>\n```\n\n**If `.wednesday/config.json` does not exist or both are false** → skip this step entirely. Do not mention it.\n\n---\n\n## Step 4 — Extract Ticket ID\n\nLook for a Jira/Linear ticket pattern in the branch name: `[A-Z]+-\\d+`\n\n```\nfeat/WED-142-oauth   → WED-142\nfix/PROJ-88-crash    → PROJ-88\nfeat/add-auth        → (no ticket)\n```\n\n---\n\n## Step 5 — PR Title\n\nGet the first commit on this branch that is not in the base branch:\n\n```bash\ngit log --reverse --format=\"%s\" $(git merge-base HEAD origin/main)..HEAD | head -1\n```\n\nThe PR title IS this commit subject. It already follows GIT-OS format.\n\n---\n\n## Step 6 — Detect Stacked Branch\n\nGet the divergence point from main:\n\n```bash\ngit merge-base HEAD origin/main\n```\n\nCheck if any remote branch (not main, not the current branch) has this exact commit as its tip:\n\n```bash\ngit branch -r --format=\"%(refname:short) %(objectname:short)\"\n```\n\nIf a match is found → base branch is that feature branch (stacked PR).\nIf no match → base branch is `main`.\n\n---\n\n## Step 7 — Build PR Body and Get Approval\n\nBuild the PR body using the GIT-OS template. Fill what you can from context, leave placeholders for the dev.\n\n```markdown\n### Ticket Link\n<Linear/Jira URL if ticket ID found in branch name, otherwise: \"_No ticket — add link if applicable_\">\n\n---\n\n### Description\n<Summarise the commits on this branch in 2-3 sentences>\n\n<If stacked>\n> **Stacked PR** — base branch is `<base>`. Merge `<base>` first, then merge this.\n</If stacked>\n\n---\n\n### Steps to Test\n<!-- Fill in before requesting review -->\n\n---\n\n### GIFs\n<!-- Add screen recordings if UI changes -->\n```\n\n**Show the generated title and body to the dev. Ask:**\n> \"Ready to push and open this PR? You can edit the body above before I proceed.\"\n\n**Wait for explicit confirmation before continuing.** Do not push or create the PR until the dev approves.\n\n---\n\n## Step 8 — Push and Create PR\n\nOnly run after dev approval in Step 7.\n\n```bash\ngit push origin <current-branch>\ngh pr create --title \"<title>\" --base <base> --body \"<body>\"\n```\n\nReturn the PR URL from the `gh pr create` output.\n\n---\n\n## Tools\n\n| Action | Tool |\n|--------|------|\n| All git and gh CLI commands | `Bash` |\n| Read `package.json` to check available scripts | `Read` |\n| Read `git-os` SKILL.md | `Read` |\n\n## Error Handling\n\n| Situation | Action |\n|-----------|--------|\n| Branch name invalid | Explain correct format, stop |\n| Pre-push check fails | Show full error output, stop |\n| Sonar quality gate fails | Show gate reason, stop — do not push |\n| Dev does not confirm body | Wait — never auto-proceed |\n| `gh` not installed | Tell dev to install GitHub CLI: `brew install gh` |\n| Push fails (upstream conflict) | Show error, suggest `git pull --rebase` |\n| PR already exists | Show existing PR URL, stop |","tags":["create","agent","skills","wednesday-solutions","agent-skills","ai-agent-skills","ai-skills","claude-code","copilot","cursor","frontend-skills","vibe-coding"],"capabilities":["skill","source-wednesday-solutions","skill-pr-create","topic-agent-skills","topic-ai-agent-skills","topic-ai-skills","topic-claude-code","topic-copilot","topic-cursor","topic-frontend-skills","topic-vibe-coding","topic-vibe-coding-skills"],"categories":["ai-agent-skills"],"synonyms":[],"warnings":[],"endpointUrl":"https://skills.sh/wednesday-solutions/ai-agent-skills/pr-create","protocol":"skill","transport":"skills-sh","auth":{"type":"none","details":{"cli":"npx skills add wednesday-solutions/ai-agent-skills","source_repo":"https://github.com/wednesday-solutions/ai-agent-skills","install_from":"skills.sh"}},"qualityScore":"0.524","qualityRationale":"deterministic score 0.52 from registry signals: · indexed on github topic:agent-skills · 148 github stars · SKILL.md body (5,062 chars)","verified":false,"liveness":"unknown","lastLivenessCheck":null,"agentReviews":{"count":0,"score_avg":null,"cost_usd_avg":null,"success_rate":null,"latency_p50_ms":null,"narrative_summary":null,"summary_updated_at":null},"enrichmentModel":"deterministic:skill-github:v1","enrichmentVersion":1,"enrichedAt":"2026-05-02T12:54:45.124Z","embedding":null,"createdAt":"2026-04-18T22:09:42.176Z","updatedAt":"2026-05-02T12:54:45.124Z","lastSeenAt":"2026-05-02T12:54:45.124Z","tsv":"'-1':472 '-142':433 '-88':436 '/.wednesday/config.json':303 '1':131,186 '2':135,226 '20':325 '3':141,276 '4':150,413 '5':154,441 '6':161,488 '7':165,553,671 '8':175,659 '9':181 'a-z':427 'action':693,718 'add':380,596 'agent':5,44 'agent-driven':4,43 'alreadi':121,481,780 'analysi':388 'anyth':129 'append':372 'appli':98 'applic':599 'approv':174,559,657,668 'ask':624 'auto':755 'auto-proce':754 'avail':706 'base':456,467,502,537,548,603,680 'bash':199,244,297,458,498,523,672,701 'block':339,361 'bodi':25,168,375,384,556,563,620,636,681,751 'branch':11,31,81,90,133,164,188,191,201,425,450,457,491,509,515,525,538,542,549,591,604,719 'brew':766 'build':166,257,554,560 'c':301 'c.cicd':306 'captur':323,349 'check':251,295,505,705,729 'checklist':16,140,230 'chore':196 'chore/update-deps':224 'cicd':305 'cicd.coverage':310 'cicd.sonar':312 'cli':40,699,765 'code':59,119 'command':242,700 'commit':27,124,159,447,478,519 'compliant':21 'condit':280 'configur':149 'confirm':644,750 'conflict':772 'console.log':307 'const':300,304 'context':575 'continu':646 'correct':212,723 'coverag':277,309,314,319,386 'coverage/sonar':143 'creat':3,42,65,73,180,651,662,678,690 'creation':8 'current':190,204,514 'd':430 'descript':600 'detect':29,162,489 'dev':55,171,580,623,656,667,747,761 'diverg':494 'driven':6,45 'e':299 'edit':634 'either':377 'enabl':315,344 'end':115 'entir':407 'error':238,715,733,774 'exact':518 'exampl':219 'exist':322,399,781,783 'explain':210,722 'explicit':643 'extract':151,414 'fail':243,333,358,730,739,770 'fals':403 'feat':194 'feat/add-auth':437 'feat/user-auth':222 'feat/wed-142-oauth':431 'featur':118,541 'fill':570 'first':324,446,607 'fix':100,195 'fix/proj-88-crash':434 'fix/wed-142-token-crash':223 'flow':130 'follow':482 'format':213,250,462,486,527,724 'found':536,589 'full':732 'gate':355,360,390,738,741 'generat':17,88,155,617 'get':444,492,558 'gh':39,178,676,688,698,757,768 'gif':614 'git':19,176,200,459,464,484,499,524,567,673,696,711,776 'git-o':18,483,566,710 'github':764 'handl':716 'head':468,470,471,503 'histori':28,160 'hotfix':198 'id':153,416,588 'instal':294,759,763,767 'invalid':721 'jira/linear':420 'json.stringify':308 'key':391 'leav':576 'line':326 'linear/jira':584 'link':583,597 'lint':247 'load':50 'log':460 'look':352,417 'main':497,511,551 'markdown':385,581 'match':193,209,534,547 'mention':410 'merg':466,501,606,609 'merge-bas':465,500 'metric':392 'must':192 'name':91,134,189,221,426,592,720 'never':753 'node':298 'note':271,334 'npm':245,248,252,255,317,346 'objectnam':530 'one':264 'open':35,61,68,105,629 'opt':288 'order':233 'origin':675 'origin/main':469,504 'os':20,485,568,712 'otherwis':369,593 'output':239,328,350,691,734 'package.json':703 'pattern':422 'placehold':577 'point':495 'pr':2,7,22,37,41,67,70,74,103,108,156,167,179,183,341,363,374,383,442,474,544,555,562,602,631,653,663,677,684,689,779,784 'pr-creat':1 'pr-review':107 'pre':14,138,228,727 'pre-push':13,137,227,726 'proceed':218,640,756 'proj':435 'project':146,260,287 'pull':46,63,777 'push':15,33,58,71,139,177,229,627,649,660,674,728,746,769 'qualiti':354,359,389,737 'r':526 'ran':378 'read':125,702,708,709,714 'readi':625 'reason':368,742 'rebas':778 'refnam':528 'remot':508 'request':47,64 'requir':302 'result':356 'return':182,682 'revers':461 'review':78,99,109 'run':12,112,136,142,231,246,249,253,256,282,316,318,345,347,665 'script':267,332,707 'ship':79 'short':529,531 'show':169,203,236,366,370,615,731,740,773,782 'show-curr':202 'situat':717 'skill':9,48,52,86,111,293 'skill-pr-create' 'skill.md':713 'skip':268,274,404 'sonar':279,311,343,348,387,394,736 'source-wednesday-solutions' 'sprint':96 'stack':30,163,490,543,601 'step':185,225,275,284,406,412,440,487,552,611,658,670 'stop':215,234,364,725,735,743,786 'subject':479 'submit':75 'success':379 'suggest':775 'summari':330,371 'tell':760 'templat':569 'test':197,254,613 'ticket':94,152,415,421,439,582,587,595 'tip':522 'titl':23,157,443,475,618,679 'tool':692,694 'topic-agent-skills' 'topic-ai-agent-skills' 'topic-ai-skills' 'topic-claude-code' 'topic-copilot' 'topic-cursor' 'topic-frontend-skills' 'topic-vibe-coding' 'topic-vibe-coding-skills' 'trigger':49 'upstream':771 'url':184,585,685,785 'use':84,95,106,564 'valid':10,132,187,220 'via':38 'wait':172,641,752 'want':56 'wed':432 'wednesday/config.json':296,396 'wednesday/skills/git-os/skill.md':126 'written':122 'ws':292 'ws-skill':291 'z':429","prices":[{"id":"65fbfb9a-7609-42b0-9724-182c726c8ec9","listingId":"23b5a101-ed5d-433a-a9a5-09a295a294e1","amountUsd":"0","unit":"free","nativeCurrency":null,"nativeAmount":null,"chain":null,"payTo":null,"paymentMethod":"skill-free","isPrimary":true,"details":{"org":"wednesday-solutions","category":"ai-agent-skills","install_from":"skills.sh"},"createdAt":"2026-04-18T22:09:42.176Z"}],"sources":[{"listingId":"23b5a101-ed5d-433a-a9a5-09a295a294e1","source":"github","sourceId":"wednesday-solutions/ai-agent-skills/pr-create","sourceUrl":"https://github.com/wednesday-solutions/ai-agent-skills/tree/main/skills/pr-create","isPrimary":false,"firstSeenAt":"2026-04-18T22:09:42.176Z","lastSeenAt":"2026-05-02T12:54:45.124Z"}],"details":{"listingId":"23b5a101-ed5d-433a-a9a5-09a295a294e1","quickStartSnippet":null,"exampleRequest":null,"exampleResponse":null,"schema":null,"openapiUrl":null,"agentsTxtUrl":null,"citations":[],"useCases":[],"bestFor":[],"notFor":[],"kindDetails":{"org":"wednesday-solutions","slug":"pr-create","github":{"repo":"wednesday-solutions/ai-agent-skills","stars":148,"topics":["agent-skills","ai-agent-skills","ai-skills","claude-code","copilot","cursor","frontend-skills","product-engineering-skills","vibe-coding","vibe-coding-skills"],"license":"mit","html_url":"https://github.com/wednesday-solutions/ai-agent-skills","pushed_at":"2026-04-24T12:57:49Z","description":"Pre-configured agent skills for Vibe Coded projects. These skills provide AI coding assistants (Claude Code, Cursor, etc.) with specific guidelines for code quality and design standards.","skill_md_sha":"79f09f368616ba2282741fa47e040f3e8b54dd0b","skill_md_path":"skills/pr-create/SKILL.md","default_branch":"main","skill_tree_url":"https://github.com/wednesday-solutions/ai-agent-skills/tree/main/skills/pr-create"},"layout":"multi","source":"github","category":"ai-agent-skills","frontmatter":{"name":"pr-create","license":"MIT","description":"Agent-driven PR creation skill. Validates branch, runs pre-push checklist, generates GIT-OS compliant PR title and body from commit history, detects stacked branches, then pushes and opens the PR via gh CLI."},"skills_sh_url":"https://skills.sh/wednesday-solutions/ai-agent-skills/pr-create"},"updatedAt":"2026-05-02T12:54:45.124Z"}}