npx skills add ...
npx skills add factory-ai/factory-plugins --skill create-pr
npx skills add factory-ai/factory-plugins --skill create-pr
Create a pull request with Conventional Commits formatting, a templated body, and local verification. Use when the user asks to create a PR, open a PR, submit changes for review, or put code up for review.
Create a PR with proper conventions: local verification, Conventional Commits title, a templated body, and an optional linked ticket. This skill is language- and framework-agnostic — substitute your project's actual build, lint, test, and format commands where examples are shown.
Before starting, verify:
git log origin/<base-branch>..HEAD --oneline)git push -u origin HEAD if not)git status)Run in parallel:
Determine:
feat, fix, docs, refactor, test, chore, perf, ci, build, revertmonorepo / repo for cross-cutting changes)Skip this step if the PR only touches documentation, markdown files, or other non-code files. For any change that touches source files, run your project's verification commands locally before creating the PR.
Discover the commands by reading the repo root (e.g. Makefile, package.json, pyproject.toml, Cargo.toml, go.mod, build.gradle, mix.exs, Gemfile, composer.json, justfile, Taskfile.yml, README.md, or the CI workflow config). Use filter/target flags where available (e.g. turbo --filter, nx --projects, pnpm --filter, bazel //path/..., cargo -p <crate>, pytest <path>, go test ./<pkg>/...) to run only the affected portions — it is faster than running the whole repo.
Common verification categories to run when applicable:
Run the project's static type check or compile step if it has one.
Examples across ecosystems (use whatever the repo defines):
npm run typecheck, pnpm -r typecheck, tsc --noEmitmypy ., pyright, ty checkcargo checkgo build ./..., go vet ./..../gradlew compileJava, ./mvnw compileRun the project's linter and formatter. Prefer an autofix target if one exists.
Examples:
npm run fix, npm run lint, eslint ., prettier --check .ruff check --fix ., ruff format ., black ., flake8cargo clippy --all-targets, cargo fmt --checkgolangci-lint run, gofmt -l .shellcheck, shfmt -d .Run the unit/integration tests for affected packages.
Examples:
npm run test -- --filter=<workspace>, pnpm -r test, vitest run <path>, jest <path>pytest <path>, tox -e <env>, python -m unittestcargo test -p <crate>go test ./<pkg>/..../gradlew test, ./mvnw testbundle exec rspec <path>, rake testknip, ts-prune, vulture for Python, deadcode / unused for Go, cargo udeps for Rust).depcheck, pip check, cargo audit, bundle audit).package.json, requirements.txt, pyproject.toml, Cargo.toml, go.mod, Gemfile, etc.), run the install command (npm install, pnpm install, uv sync, poetry lock --no-update, cargo update -w, go mod tidy, bundle install) and commit any lockfile changes. CI commonly fails if the lockfile is out of date.stylelint, etc.) or asset linters if you changed those files.trivy, semgrep, gitleaks, etc.).If your org uses an issue tracker, ask the user whether to:
TEAM-1234, JIRA-567, #42)Most CI systems can be configured to require the ticket identifier in the PR body. Follow your org's convention.
Follow Conventional Commits: type(scope): description
type: feat, fix, docs, refactor, test, chore, perf, ci, build, revertscope: Name of the affected module/package/service/directory, or monorepo / repo for cross-cutting changes. Multiple scopes can be comma-separated: fix(a, b, c): ...Examples:
feat(web): add dark mode togglefix(cli, daemon): load shell env at entrypointfix(api): handle nil response from upstreamchore(repo): bump dependenciesFill in all sections from your PR template. A typical template has four sections:
If the body is long, write it to a temp file and use --body-file:
Return the PR URL to the user.
These are typical check categories that run on every PR. Map them to your repo's actual commands when adapting this skill.
| Category | What it does | How to find the local command |
|---|---|---|
| Typecheck / compile | Verifies the project compiles or passes static types | Check package.json, Makefile, pyproject.toml, Cargo.toml, go.mod, CI config |
| Lint | Enforces code style / correctness rules | Check for lint, check, or equivalent scripts in the repo root |
| Format | Enforces consistent formatting | Check for format, fmt, prettier, black, gofmt, rustfmt, etc. |
| Tests | Runs unit and integration tests | Check for test script / target |
| Dead code / unused exports | Flags unused code | Check for knip, ts-prune, vulture, cargo udeps, etc. |
| Dependency check | Flags unused / vulnerable dependencies | Check for depcheck, audit, cargo audit, etc. |
| Lockfile in sync | Fails if lockfile is stale relative to the manifest | Run your package manager's install command and commit the lockfile |
| PR Conventions | Validates branch name, semantic title, ticket presence | Follow the formatting rules above |
[A-Za-z0-9/-]).chore: and revert: types).dev, main, develop, trunk).chore:/revert:).gh pr create.gh pr create \
--base <base-branch> \
--head <branch-name> \
--title "<type>(<scope>): <description>" \
--body "<generated body>"gh pr create --base <base-branch> --head <branch> --title "..." --body-file /tmp/pr-body.md