/project-toolkit:push-prfrom project-toolkit
Commits working tree changes, pushes the branch, and opens a pull request with the repository template filled in from the real diff. Invoked by saying 'push and open a PR', 'open a pull request', or 'push this branch'.
Ships in project-toolkit. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Commit, push, and open a pull request whose body is adapted from the real diff rather than copied from the template.
Migrated from .claude/commands/push-pr.md under ADR-064, which makes skills the
single user-invocable surface. The scoped allowed-tools grant, the
identity-hardened python3 -I form, and both vendor-portability declarations
carry over unchanged: they are the security contract, not formatting.
push and open a PR, open a pull request, push this branch,
commit and push
git statusgit diff HEADgit branch --show-currentBased on the above changes:
Create a new branch if on main.
fix/parser-log-enrichment).Read @.github/PULL_REQUEST_TEMPLATE.md. Step 3 seeds it into the body file; use this copy only when the seeded file holds the marker alone.
Run the secure path allocator:
( for d in "${CLAUDE_PLUGIN_ROOT}" "${COPILOT_PLUGIN_ROOT}" .claude; do if [ -n "$d" ] && [ -f "$d/lib/ptk_run.py" ]; then exec python3 -I "$d/lib/ptk_run.py" skills/github/scripts/pr/new_pr.py --prepare-body-file; fi; done; echo "ptk_run: no plugin root holds lib/ptk_run.py" >&2; exit 2 )
<!-- replace with PR body -->, followed by the
repository PR template. Use the Edit tool to fill the template sections in
that exact file, then delete the marker line. A body that still contains the
marker text anywhere is rejected.<!-- Brief description --> unfilled## Acceptance criteria heading with - [ ] or * [ ] bullets. The Validate Spec Coverage job reads these from the PR body, not the linked issue. When the PR links a spec or an issue, an unchecked box or a missing section makes the deterministic check report FAIL, and that FAIL does not block the merge, so check a box only once the criterion is actually met. Numbered criteria are not recognized.Check the title and body file before the push, which can take minutes:
( for d in "${CLAUDE_PLUGIN_ROOT}" "${COPILOT_PLUGIN_ROOT}" .claude; do if [ -n "$d" ] && [ -f "$d/lib/ptk_run.py" ]; then exec python3 -I "$d/lib/ptk_run.py" skills/github/scripts/pr/new_pr.py --preflight --title "<conventional commit title>" --body-file ".project-toolkit/scratch/pr-body-<returned-uuid>.md"; fi; done; echo "ptk_run: no plugin root holds lib/ptk_run.py" >&2; exit 2 )
--preflight checks the title format and the body file: its path, that it is a regular UTF-8 file, and that the placeholder line is gone.
It makes no network call and creates nothing. The dash and escaped newline
checks still run at step 7. Fix a rejection here.
Check that the body names only files the diff touches, before the push. The
required Validate PR check fails on a path the diff does not touch, and the
fix costs a CI round after the PR opens. Commit first: local mode reads
committed HEAD only, so an uncommitted file reads as not in the diff. Run
the local mode, which reads the same body file and
git diff origin/main...HEAD with no network call:
uv run --frozen python -I scripts/validation/pr_description.py --body-file ".project-toolkit/scratch/pr-body-<returned-uuid>.md" --base origin/main
File mentioned but not in diff.
Stop. If every flagged path appears in git status, commit instead of
editing the body. Otherwise edit the body file (remove the path, move it
out of the change heading, or wrap it in a code fence), then re-run until
it exits 0.origin/main, pass --base with the ref the PR targets, such as
<remote>/<default-branch>. Do not skip the step.description-validation-bypass label. A human maintainer
decides that.scripts/validation/pr_description.py, such as a plugin
install, cannot run this step. Say it was not run, and compare every
path under the change heading (inline code, bold, list item, or link) to
git diff --name-only origin/main...HEAD by hand.Push the branch to origin.
Create a pull request using the new_pr skill script:
( for d in "${CLAUDE_PLUGIN_ROOT}" "${COPILOT_PLUGIN_ROOT}" .claude; do if [ -n "$d" ] && [ -f "$d/lib/ptk_run.py" ]; then exec python3 -I "$d/lib/ptk_run.py" skills/github/scripts/pr/new_pr.py --title "<conventional commit title>" --body-file ".project-toolkit/scratch/pr-body-<returned-uuid>.md"; fi; done; echo "ptk_run: no plugin root holds lib/ptk_run.py" >&2; exit 2 )
--head "<branch>" inside the command, before its ; fi. Words after the closing ) run as a separate command. Running the command from the worktree itself needs no --head, because new_pr.py uses the current branch. Never remove the worktree to open the PR. Push the branch first, since gh resolves the head on the remote. new_pr.py exits 2 and prints the push command when origin lacks the branch.<!-- replace with PR body --> line. --prepare-body-file creates a unique path that passes the path check.feat: Add feature, fix(auth): Resolve bug)Closes #<number>: auto-closes issue when PR mergesFixes #<number>: auto-fixes issue when PR mergesResolves #<number>: auto-resolves issue when PR mergesUse this only on Windows, and only when step 3 exits 2 with
ERROR: secure PR body files are not supported on Windows. Every other
platform keeps the allocator mandatory. The allocator needs directory file
descriptors and owner-only modes that Windows does not provide.
new_pr.py accepts --body '<text>' in place of --body-file. That path
never calls the allocator or its file reader. The helper still runs the same
title, dash, and escaped newline checks, then hands the body to gh on
stdin, never as a command-line argument to gh.
Skip --prepare-body-file. Fill the PR template from step 2 into the body
text yourself, with the same rules as step 3.
Step 4 preflight: pass --body '<body text>' instead of --body-file. It
checks the title only, since there is no file to check.
Step 5: pr_description.py --body-file reads any readable file. Run
mkdir -p .project-toolkit/scratch first, because the allocator refused
before it created that directory. Create pr-body-windows.md in it with
Write and expect one permission prompt. Later Edit fixes after a step 5
exit 1 stay inside the scoped Edit grant.
Step 7: run the same command with the body text inline:
( for d in "${CLAUDE_PLUGIN_ROOT}" "${COPILOT_PLUGIN_ROOT}" .claude; do if [ -n "$d" ] && [ -f "$d/lib/ptk_run.py" ]; then exec python3 -I "$d/lib/ptk_run.py" skills/github/scripts/pr/new_pr.py --title "<conventional commit title>" --body '<body text>'; fi; done; echo "ptk_run: no plugin root holds lib/ptk_run.py" >&2; exit 2 )
--body text. Step 5
checked the file, so every edit made there must reach this command.'\''. In PowerShell,
use a single-quoted here-string (@' ... '@). Never use double quotes:
bash runs each backtick code span as a command and expands $name, and
PowerShell treats the backtick as an escape and also expands $.\n. If the escaped
newline check fails, its message says to pass --body-file. That is the
refused path on Windows, so fix the line breaks instead.new_pr.py, then
to validate_pr_description.py. If the command fails for length, trim
the body and keep every required template section.--skip-validation. The fallback changes how the body arrives,
not which checks it must pass.You have the capability to call multiple tools in a single response. You MUST do all of the above in a single message. Do not use any other tools or do anything else. Do not send any other text or messages besides these tool calls.
pr_description.py --body-file run exited 0 before the push, or its absence stated--body fallback, with step 5 still run)## Acceptance criteria heading present with - [ ] bullets, checked only where met| Avoid | Why | Instead |
|---|---|---|
| Storing the allocator path in a shell variable | Each tool call runs a fresh shell, so the variable is empty on the next call and the body lands nowhere | Copy the returned path literally into the next call |
| Copying the template verbatim | Ships placeholder comments as the PR description, and the spec-coverage job reads them | Adapt every section from the diff |
| Numbered acceptance criteria | The Validate Spec Coverage job reads - [ ] and * [ ] only, so numbered items are invisible to it | Use checkbox bullets |
| Checking a criterion box before it is met | The signal reports a pass the PR does not have, and the FAIL it should have shown does not block merge | Check a box only once the criterion holds |
Widening the allowed-tools grant to bare Bash | Removes the CWE-78 argument scoping that makes this skill safe to auto-approve | Add a specific scoped entry |
new_pr.py. A non-GitHub forge swaps that
helper; the template-adaptation rules in step 4 are forge-independent.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub rjmurillo/ai-agents --plugin project-toolkit105 skills in this plugin
/adr-generatorCreate comprehensive Architectural Decision Records (ADRs). Researches the destination directory to detect existing template conventions, gathers context, determines next ADR number, generates the ADR, validates completeness, and saves. Supports multiple ADR formats (MADR, Nygard, Alexandrian, project canonical). Use when documenting technical decisions, creating new ADR files, or capturing rationale so future readers can revisit a choice. Use when you say "write an ADR", "document this decision", "document these design choices", "record why we chose this", "capture the rationale", or "for future maintainers", or when creating an ADR-like markdown file under docs/decisions/, docs/adr/, docs/architecture/, architecture/decisions/, or .project-toolkit/architecture/. Do NOT use to debate or review an existing ADR (use adr-review)./adr-reviewMulti-agent debate orchestration for Architecture Decision Records. Automatically triggers on ADR create/edit/delete. Coordinates architect, critic, independent-thinker, security, analyst, and high-level-advisor agents in structured debate rounds until consensus. Use when you say "review this ADR", when an ADR is created/edited/deleted, or when reviewing, accepting, or updating a decision file under .project-toolkit/architecture/, docs/architecture/, docs/decisions/, docs/adr/, or architecture/decisions/, including intent like "review this decision record" or "check this rationale for future maintainers". Do NOT use to author a new ADR (use adr-generator).Other plugins' skills for the same job