AGENT SKILL

pr

Use when creating or updating a pull request. Analyzes the change against the base branch, writes a concise title and structured body, and returns them to the guarded publication engine.

License 许可
Apache-2.0
最近更新
2026-11-14
Stars
★ 7
Forks
2

01 前言 Front Matter

name
pr
phase
ship
requires
[]
standalone
true
description
Use when creating or updating a pull request. Analyzes the change against the base branch, writes a concise title and structured body, and returns them to the guarded publication engine.
enforcement
advisory
disable-model-invocation
true

02 资源文件 1

03 SKILL.md 正文

Purpose

Creates high-quality pull requests by analyzing the actual changes, not parroting planning artifacts. The PR should tell a reviewer what changed, why, and how to verify it — nothing more. Publication is engine-owned: return the title and body to the guarded remote write and PR operation.

Practices

1. Gather Context

Collect everything needed to understand the PR. Run these in parallel:

# Determine base branch (main or master)
git remote show origin | grep 'HEAD branch'

# Full commit log for this branch
git log --oneline <base>..HEAD

# Stat summary of all changes
git diff --stat <base>..HEAD

# Targeted hunks for the files whose behavior the PR must explain
git diff <base>..HEAD -- <path>

Do not print the whole branch diff when the stat shows a large change: a PR body needs the shape of the change, and a multi-thousand-line diff costs far more context than the prose it informs. Read the full diff only when it is small.

Also check for harness artifacts that provide motivation context:

  • .docs/specs/*.md — design docs (the "why")
  • .docs/stories/*.md — acceptance criteria
  • .pipeline/conduct-state.json — feature name if available

2. Analyze Changes

Read the diff carefully and categorize what changed:

  • New files — what do they introduce?
  • Modified files — what behavior changed?
  • Deleted files — what was removed and why?
  • Migrations — any schema changes?
  • Tests — what's covered?
  • Config/infra — docker, CI, dependencies?

Group changes by logical area (e.g., "Notifications module", "Auth projection", "Alembic migrations"), not by file path.

3. Write the Title

Check for project conventions first:

Look for PR title format conventions in the project's CLAUDE.md under a ### PR Title Format heading (or similar). Projects may specify their preferred format (conventional commits, ticket prefixes, etc.). If found, follow those conventions instead of the defaults below.

Common project convention examples:

  • Conventional Commits: feat: add notification channel, fix(auth): resolve token expiry
  • Ticket prefix: [PROJ-123] Add notification channel
  • Type/scope: feat(notifications): add in-app channel

Default rules (when no project convention is defined):

  • Under 72 characters — hard limit, no exceptions
  • Imperative mood — "Add notifications module" not "Added" or "Adding"
  • Specific — "Add in-app notification channel with persistence" not "Update notifications"
  • No periods at the end
  • If the PR does multiple things, summarize at the highest useful level

Good: Add Alembic migration baseline and register notifications router Bad: Generate a full Alembic migration baseline for all existing database tables in the project...

4. Write the Body

Use this structure. Every section must earn its place — omit sections that add no value.

## Why

1-3 sentences explaining the motivation. What problem does this solve? Why now?
Link to design doc or issue if relevant.

## What Changed

Organized by logical area, not by file. Each area gets a brief explanation of what
changed and why. Use bullet points.

### [Area Name] (e.g., "Alembic Migrations")
- Created baseline migrations for all 11 modules (X tables total)
- Consolidated users + notifications into single migration for FK ordering

### [Area Name] (e.g., "Notifications Module")
- Registered notifications router in main.py (was defined but never mounted)
- Added PgInAppChannel for persistent notification storage

## Testing

How was this verified? Be specific:
- `pytest` — N tests passing, M new
- Manual verification steps taken
- Migration tested: `alembic upgrade head` on clean DB

## Notes for Reviewers (optional)

Anything a reviewer should pay attention to:
- Areas of uncertainty
- Trade-offs made
- Things intentionally left out of scope

Anti-patterns to avoid:

  • Restating the title in the body
  • Listing every file changed (the diff shows that)
  • Pasting raw planning artifacts (stories, specs) into the body
  • Generic filler ("This PR implements the feature as described in the plan")
  • Bullet points that just name files without explaining what changed

5. Pre-Push Verification

GATE: /finish owns local completion verification.

Before pushing:

  1. Completion result — reuse the current passing result already reported by /finish; do not launch the project's aggregate test command from /pr.
  2. Linter — npm run lint, standardrb, ruff check ., or equivalent. Must pass.
  3. Type checker — npx tsc --noEmit, mypy ., or equivalent (if project uses one). Must pass.

If completion verification has not reported a current pass, STOP and route back to /finish; do not infer a pass or run the aggregate command here. If the linter or type checker fails, fix it and re-run that check. Do NOT push with known failures — this wastes CI minutes and blocks the PR.

6. Create or Update the PR

Publication is engine-owned. Do not invoke a remote Git write or a GitHub write from this host skill. The finish/publication engine resolves canonical repository and feature provenance, performs the guarded push and PR create/update, and reports a typed result. For an independently supported single GitHub operation, write its closed request JSON and invoke only:

ai-conductor github-operation --request-file <request.json>

The request accepts only the registered operation schema; it never accepts raw gh or git arguments. A refusal, failure, or partial result is non-success: stop and surface the result rather than attempting a fallback write. The host supplies no approval hook; when a registered shared operation needs approval, the engine binds it to that exact canonical request.

For feature-branch publication, return the authored title/body to the finish/publication engine. During FINISH, write .pipeline/finish-pr-prose.json with version, title, and body; the engine validates the handoff and performs the PR title and body write. It owns the guarded remote write and PR operation; do not substitute a direct command, including a force or lease variant. Report the returned PR URL after an executed result.

Engine Behavior — Halt-PR Rehabilitation (automated after PR is created/updated). When the engine creates or updates a PR that replaces a reused halt PR (one with title prefixed needs-remediation: or the needs-remediation label), your job is to generate fresh title and body content as described in §3 and §4 above for the FINISH handoff. You do NOT need to remove the halt signal or clear the label yourself — the conductor's finish step automatically rehabilitates the PR after you complete:

  • The engine removes the needs-remediation label (if present)
  • The engine rewrites the title to remove needs-remediation: prefix (if stale)
  • The engine injects or updates the Closes reference to match the implementation
  • The engine flips the PR from draft to ready (if it was drafted)
  • The engine posts the halt history (original halt title, banner, halt reason) as a PR comment

This means your fresh title/body (from §3 and §4) and the engine's rehabilitation happen in sequence. The finish completion gate verifies the final PR state does NOT start with needs-remediation: (adr-2026-07-03-halt-pr-rehabilitation-at-finish).

The body is always the plain template — authoring its handoff content is YOUR job, and the engine writes it to the PR. A rehabilitated PR gets the same body shape as a clean first-pass finish: ## Why / ## What Changed / ## Testing (+ optional ## Notes for Reviewers) and the Closes #N reference. Never write remediation prose, halt narrative, "rehabilitated from…" footnotes, or recovery history into the body — that content belongs in the engine-posted PR comment. The engine's deterministic body floor exists only as a last resort when /pr did not run at all; if the handoff concerns a floored body (<!-- conductor:pr-body-floor -->), return real prose while keeping every ai-conductor:step region and its markers unchanged.

7. Verify

  • [ ] Title is under 72 characters
  • [ ] Title uses imperative mood
  • [ ] Body "Why" section explains motivation, not just what
  • [ ] Body "What Changed" is organized by logical area
  • [ ] No file-by-file listing in the body
  • [ ] No pasted planning artifacts or boilerplate
  • [ ] Testing section describes actual verification performed
  • [ ] Completion verification already passed; /pr launched no aggregate test command
  • [ ] Publication engine reported an executed result and returned the PR URL
  • [ ] A refused, failed, or partial guarded result was surfaced with no fallback write
  • [ ] PR URL displayed to user

04 同仓库更多 Skills

jstoup111
jstoup111/ai-conductor

build-review-dependency-hygiene

Judge whether a feature diff adds unnecessary, insufficiently pinned, or license-incompatible dependencies.

★ 7
jstoup111
jstoup111/ai-conductor

writing-system-tests

Use BEFORE implementing any feature that has stories in .docs/stories/ — generates failing acceptance specs from acceptance criteria as the RED phase of TDD. Generates HTTP/request-level acceptance tests for headless/API projects, end-to-end UI tests for projects with a frontend, using the project's own test framework and directory conventions.

内容创作者前端开发写作与文案
★ 7
jstoup111
jstoup111/ai-conductor

verify-claims

Use only when an active workflow is about to rely on a nontrivial factual claim or assumption for a spec, plan, ADR, finding, or code decision. Do not invoke for casual questions, status reports, restatements, or trivially verifiable mechanics.

★ 7
jstoup111
jstoup111/ai-conductor

tdd

Use when implementing any feature or bugfix. Five-step cycle: RED → DOMAIN → GREEN → DOMAIN → COMMIT. Enforces test-first development with domain integrity review at every phase boundary.

★ 7
jstoup111
jstoup111/ai-conductor

stories

Use only within active engineer/conduct DECIDE after architecture approval, when a committed `.docs/stories` acceptance artifact is required. Do not invoke for general user-story examples, requirements discussion, or direct implementation requests.

★ 7
jstoup111
jstoup111/ai-conductor

stack-land

Use when an operator needs to land reviewed manual changes on the correct closed child of a stacked feature. Operator-invoked only: inspect ownership, propose the safe child with evidence, and require confirmation before opening the landing.

★ 7