speckit-chore-pr
Open a pull request for the implemented chore, linking the tracked issue
- License 许可
- MIT
- 最近更新
- 2026-11-14
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- speckit-chore-pr
- metadata
- { "author": "github-spec-kit", "source": "chore:commands/speckit.chore.pr.md" }
- description
- Open a pull request for the implemented chore, linking the tracked issue
- compatibility
- Requires spec-kit project structure with .specify/ directory
03 SKILL.md 正文
Open Chore Pull Request
Open a GitHub pull request for the chore recorded by
/speckit-chore-implement. This command reads
.specify/chores/<slug>/implement.md (and issue.md if the chore was reported)
and creates a PR via the gh CLI from the current branch, linking the issue. If
gh or a GitHub remote is unavailable, it writes a ready-to-paste PR draft instead.
This command is the natural follow-up when
chore.implementwas run with--branch/--worktree: the current branch is the chore branch (e.g.chore/<slug>) and the PR opens from it.
User Input
$ARGUMENTS
Accept any of:
slug=<chore-slug>or--slug <chore-slug>or a bare slug-like token.- A path that contains the slug (e.g.
.specify/chores/logo-swap/). - Nothing — fall back to context (see Slug Resolution).
Slug Resolution
Resolve CHORE_SLUG in this order, stopping at the first match:
- Explicit user input — a slug passed in
$ARGUMENTS(any of the forms above). - Conversation context — if the current session has just run
/speckit-chore-implement(orchore.issue), the slug it reported is the working slug. Reuse it without re-prompting. - Single candidate on disk — list
.specify/chores/*/implement.md. If exactly one chore has animplement.md, use it. - Disambiguate:
- Interactive mode: ask the user which chore to open a PR for and list the candidates.
- Automated mode: stop with an error listing the candidates. Do not guess.
Once resolved, set CHORE_SLUG and CHORE_DIR = .specify/chores/<CHORE_SLUG>.
Prerequisites
CHORE_DIR/implement.mdMUST exist. If it does not, stop and instruct the user to run/speckit-chore-implementfirst.- Confirm the current branch is the chore branch (created by
chore.implement --branch, or whatever branch holds the change). If the working tree is onmain/masterwith uncommitted changes, warn the user and ask which branch to open the PR from before continuing. - Detect GitHub context (same as
chore.issue):git rev-parse --is-inside-work-treeandgit config --get remote.origin.urlto parseowner/repo; only proceed live when the remote isgithub.com.command -v ghandgh auth statusto confirm the CLI and auth.- If
gh/GitHub remote/auth is unavailable, write a draft (see Graceful Degradation).
Execution
-
Read the records
- Read
CHORE_DIR/implement.mdfor the summary, changed files, and status. - Read
CHORE_DIR/issue.md(if present) for the issue number/URL to link.
- Read
-
Derive the PR title and body
- Title: a concise imperative from the implement summary (e.g.
Swap generic logos for giraffe brand). Prefix with the slug only if it aids traceability (e.g.[logo-swap] Swap ...). - Body: combine the implement Summary, the Changes table, the Verification result, and a link to the assessment:
Assessment: .specify/chores/<CHORE_SLUG>/assessment.md. - If
CHORE_DIR/issue.mdexists, appendCloses #<issue-number>.(or the full issue URL) so GitHub links and auto-closes the issue on merge. - Write the body to
CHORE_DIR/pr-body.md.
- Title: a concise imperative from the implement summary (e.g.
-
Open the PR (live path)
- Determine the base branch: prefer the repository default (usually
main/master); allow the user to override withbase=<branch>in$ARGUMENTS. - Run (do not use
--json: olderghversions reject it — capture the URL from stdout instead):gh pr create --base <base> --title "<title>" --body-file CHORE_DIR/pr-body.md - On success
ghprints the new PR URL (e.g.https://github.com/<owner>/<repo>/pull/42) to stdout. Capture that line and extract the URL and the PR number (the trailing digits after/pull/). - If the push of the current branch fails, run
git push -u origin <current-branch>and retry thegh pr create. - If
gh/GitHub remote/auth/network is unavailable, skip to Graceful Degradation below.
- Determine the base branch: prefer the repository default (usually
-
Record the PR
- Write
CHORE_DIR/pr.md:# Chore PR: <short title> - **Slug**: <CHORE_SLUG> - **Opened**: <ISO 8601 date> - **PR**: <number> - **URL**: <https://github.com/<owner>/<repo>/pull/<number>> - **Branch**: <current-branch> - **Issue**: <number or "n/a"> <One-line summary of what the PR contains.>
- Write
-
Graceful Degradation (no live creation)
- When
gh/GitHub remote/auth is unavailable, writeCHORE_DIR/pr-draft.mdwith the title + body and tell the user to open the PR manually (or re-run once authenticated). Do not error.
- When
-
Report back with:
- The slug, the PR URL (or draft path), and the branch it opened from.
Guardrails
- This command creates an external GitHub PR only — it never edits repository source code beyond pushing the already-applied chore branch.
- It only reads
implement.md/issue.mdand writes insideCHORE_DIR(pr.md/pr-body.md/pr-draft.md). - Never claim the issue is closed unless
Closes #<number>was included and the PR was actually opened. - Do not force-push or rewrite history; only push the current chore branch with
-u.
04 同仓库更多 Skills
speckit-tdd-verify
Audit TDD discipline by delegating to zfa tdd verify (mutation testing, evidence integrity); the LLM interprets the verdict and drives remediation
speckit-tdd-setup
Detect the test stack and write .specify/memory/tdd-profile.md; zuraffa-wired projects record zfa commands as the engine
speckit-tdd-run
Drive the red-green-refactor loop by delegating to zfa tdd run (deterministic engine); the LLM handles only honest stops — fixing genuine reds and remediation — never re-driving what zfa drives
speckit-tdd-plan
Derive the feature's test list by delegating to zfa tdd plan (deterministic engine); falls back to LLM-guided derivation only when zfa is unavailable
speckit-spec-stats-runs
On-demand execution — reads verified suite command from .specify/memory/tdd-profile.md, runs it for selected specs (--all, spec id/slug, or default active feature), captures pass/fail + duration + tail, appends run record to .specify/stats/runs.json, refreshes dashboard health column
speckit-spec-stats-report
Main generator — scans all specs/*/, derives per-feature stage, task progress, health, last updated; when the TDD extension is installed, adds a deep TDD table (acceptance/unit/characterization counts, DONE, loop mode, tasks.md state); renders dashboard to configurable output path and writes .specify/stats/stats.json snapshot