بنقرة واحدة
woocommerce-git-draft-pr
// Create a high-quality draft PR for the current branch. Use when the user says "create a PR", "draft PR", "open a PR", "make a PR", "push and create PR", or "submit PR".
// Create a high-quality draft PR for the current branch. Use when the user says "create a PR", "draft PR", "open a PR", "make a PR", "push and create PR", or "submit PR".
| name | woocommerce-git-draft-pr |
| description | Create a high-quality draft PR for the current branch. Use when the user says "create a PR", "draft PR", "open a PR", "make a PR", "push and create PR", or "submit PR". |
Create a concise, reviewer-friendly draft PR from the current branch.
git branch --show-currentgit log trunk..HEAD --format="%h %s" --reverse 2>/dev/null || echo "No commits ahead of trunk"git diff trunk...HEAD --stat 2>/dev/nullgit status --shortgit diff trunk...HEAD --name-only -- '*/changelog/*' 2>/dev/nullcat .github/PULL_REQUEST_TEMPLATE.mdVerify from dynamic context: not on trunk (stop if so), commits exist ahead of trunk (stop if none), no uncommitted changes (stop if dirty).
Base branch: use release/* if the branch was created from one, otherwise trunk.
From the dynamic context above (read full diffs only if the stat summary is ambiguous), determine:
#12345, fix/issue-12345)client/, templates/, CSS/SCSS, JSX/TSXExtract issue/PR refs from commits and branch name:
Closes # (Linear refs are internal — only reference GitHub issues in PRs).git log -S on touched lines) to find the introducing PR; omit Bug introduced in PR #XXXX. if not found.Use the PR template from the dynamic context above. Preserve HTML comments from the template in every retained section; several comments are automation markers or test fixtures for milestone, changelog, and other GitHub checks.
Title (under 70 chars, verb-first — the repo convention):
Fix <what was broken>, Add <what>, or other verb (Restore, Bump, Prepare, etc.)[Email Editor] Fix double margin-top in flex layoutfix:/feat: prefixes. No Linear ticket refs — Linear is internal, PRs are public.Body — depends on whether the change is plugin-affecting:
.ai/skills/, workflows)Use a simplified body with only these sections:
[x] unless a milestone will be assigned manually. Keep the surrounding template comments, including <!-- milestone-target-selection --> and <!-- /milestone-target-selection -->.Skip Screenshots, Testing instructions, Testing done, and Changelog sections entirely.
Use the full template:
Closes #1234. if applicable. For bugs: Bug introduced in PR #XXXX. (omit this line entirely if not a bug fix).[x] unless a milestone will be assigned manually. Keep the surrounding template comments, including <!-- milestone-target-selection --> and <!-- /milestone-target-selection -->.[x] with Significance, Type, and a user-facing Message. Keep the template comments in this section, including inline comments after headings such as #### Message <!-- Add a changelog message here -->.Do not strip HTML comments (<!-- -->) from retained template sections. They support PR automation and GitHub tests. Remove only unfilled placeholder lines that are actual visible placeholders (e.g., Closes # ., Bug introduced in PR # .).
State the generated title and body before executing.
git push -u origin $(git branch --show-current)
gh pr create --draft --title "<title>" --base <base-branch> --body "$(cat <<'PRBODY'
<full PR body>
PRBODY
)"
Output the PR URL. If UI changes need screenshots, remind the user.
Set up, start, stop, restart, verify, and troubleshoot the WooCommerce Core local development environment with wp-env and asset build watchers. Use when Codex is asked to run WooCommerce locally, prepare wp-env, watch WooCommerce builds, choose between full and targeted build/watch commands, diagnose localhost:8888, or explain local environment setup commands.
Commit uncommitted changes with well-crafted messages following WooCommerce repo conventions. Use when the user says "commit", "commit changes", "commit this", "git commit", or "save my work".
Identify performance issues in WooCommerce PHP code. Use when writing or reviewing code that loads collections of post-based objects (products, orders), renders product lists with images, reads multiple options in a loop or method, or writes SQL queries involving joins, aggregates, meta lookups, or range queries.
Run tests, linting, and quality checks for WooCommerce development. Use when running tests, fixing code style, or following the development workflow.
Add or modify WooCommerce backend PHP code following project conventions. Use when creating new classes, methods, hooks, or modifying existing backend code. **MUST be invoked before writing any PHP unit tests.**
Add or modify routes in the WooCommerce Store API (`/wc/store/v1/*`). Use when creating new Store API endpoints, modifying existing ones, or designing the schemas blocks and external integrations consume. Covers authentication, REST URL design, schema/response alignment, variation handling, idempotency, and common pitfalls.