agentleFS
VECTORG99VECTORG99/acf/skills/04-pr-context/SKILL.md

pr-context

Skill2 starsChanged 3 months agoMITView on GitHub

Phase 4 of ACF. Builds a PR body that carries the issue's acceptance criteria, test commands, CI check names, and scope lock. Use when ACF delegates PR creation, or when the user asks to "open a PR", or "create a pull request with context".

  • Commits and pushes

1 other project uses a version of this.

Adopted by

Most recently taken up by

  • Other versions1 project uses a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 1

    1. Joshua-Palamuttam/workbench-template★ 3same name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • In this repository10 other files it gives its agents.

The file

We split this skill into the rules it gives an agent

7 rules. About 0 are common, 3 are distinctive, and 4 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Do not assume the base branch is main.

    line 71
  2. Very specific:

    Use the detected base branch in --base for gh pr create and in the pre-launch checklist.

    line 85
  3. Distinctive:

    Verify CI checks start running

    line 120
  4. Distinctive:

    If frontend-preview was used, attach the screenshot to the PR

    line 121
  5. Very specific:

    gh not authenticated: run gh auth status. If not authed, report "gh not authenticated — run gh auth login and retry." Save the draft.

    line 130
  6. Very specific:

    GitHub API rate limits: if gh pr create fails with a rate limit error, save the draft and report "Rate limited — retry after [reset time].

    line 132
  7. Very specific:

    Commands fail: if gh pr create fails (network, permissions, branch push failure), save the draft and report the error.

    line 137

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

PR-Context

Produces PR bodies that give reviewers (human or AI) everything needed to verify the change — without re-reading the issue or the codebase.

Prerequisites

  • Context-load snapshot is complete (test commands, CI check names)
  • The issue being closed is known (from issue-craft or stack-audit)
  • Implementation is complete and tests pass locally

PR Body Structure

## Summary
[1-2 sentences: what changed and why]

## Closes
Closes #N

## Scope Lock
- [x] This PR stays within the issue scope
- [ ] Out-of-scope changes: [none / list]

## Changes
- `path/to/file` — [what changed, one line per file]
- `path/to/test` — [test added/modified]

## Verification
- [x] `[test command 1 from context-load]` — [N tests pass]
- [x] `[test command 2 from context-load]` — [N tests pass]
- [x] `[build command]` — build succeeds
- [x] `[typecheck command]` — no new errors

## CI Checks Expected
- [ ] `[check name 1]` (from workflow: `[workflow file]`)
- [ ] `[check name 2]` (from workflow: `[workflow file]`)

## Acceptance Criteria
- [x] [AC 1 from issue — copied verbatim]
- [x] [AC 2 from issue — copied verbatim]
- [ ] [AC 3 — if not yet verified, leave unchecked]

## Production Plan (if applicable)
- Verification: [how to verify in production]
- Rollback: [how to revert]

Rules

  1. Closes #N is mandatory — every PR must reference an issue
  2. AC are copied verbatim from the issue — don't paraphrase
  3. Test commands are exact — from context-load, not invented
  4. CI check names are real — from workflow files, not guessed
  5. Scope lock is explicit — checkbox confirming no out-of-scope changes
  6. Unverified AC stay unchecked — don't lie about verification status

Base Branch Detection

Do not assume the base branch is main. Detect it automatically:

  1. Primary method — read the remote HEAD symbolic ref:
    git symbolic-ref refs/remotes/origin/HEAD 2>/dev/null \
      | sed 's@^refs/remotes/origin/@@'
  2. Fallback — query the repo's default branch via gh:
    gh repo view --json defaultBranchRef --jq '.defaultBranchRef.name'
  3. Last resort — if both fail, default to main but warn the user: "Could not detect base branch — assuming main. Verify with git branch -r."

Use the detected base branch in --base for gh pr create and in the pre-launch checklist.

Pre-Launch Checklist

Before gh pr create:

  • All tests pass locally (exact commands from context-load)
  • Build succeeds
  • No secrets, API keys, or tokens in the diff
  • PR body has Closes #N
  • AC checkboxes match actual verification status
  • CI check names match workflow job names
  • Branch is based on the detected base branch (see Base Branch Detection)
  • Branch naming follows convention (feature/, fix/, etc.)

Launch

# Detect base branch (do not assume "main")
BASE=$(git symbolic-ref refs/remotes/origin/HEAD 2>/dev/null \
  | sed 's@^refs/remotes/origin/@@' || \
  gh repo view --json defaultBranchRef --jq '.defaultBranchRef.name')

gh pr create \
  --title "fix: flashlight uses :FireServer() instead of :Fire()" \
  --body-file /tmp/pr-body.md \
  --base "$BASE" \
  --head fix/flashlight-fireserver

Record the PR number in the progress file.

Post-Launch

  • Verify CI checks start running
  • If frontend-preview was used, attach the screenshot to the PR
  • Monitor for scc-failing-checks or equivalent labels (if the project uses autonomous SDLC labels)

Error Handling

  • gh CLI not installed: pr-context cannot create PRs without gh. Report "gh CLI not found — PR body saved to /tmp/pr-body.md. Install gh to create: https://cli.github.com/" and save the draft.
  • gh not authenticated: run gh auth status. If not authed, report "gh not authenticated — run gh auth login and retry." Save the draft.
  • GitHub API rate limits: if gh pr create fails with a rate limit error, save the draft and report "Rate limited — retry after [reset time]. PR body at /tmp/pr-body.md."
  • Base branch detection fails: see Base Branch Detection — fall back to main with a warning. Do not silently assume main.
  • Commands fail: if gh pr create fails (network, permissions, branch push failure), save the draft and report the error. Do not lose the PR body.

Example

Complete PR body for a bug fix:

## Summary
Fixed the flashlight tool to use `:FireServer()` instead of `:Fire()` so the
server authorizes the action before it replicates.

## Closes
Closes #17

## Scope Lock
- [x] This PR stays within the issue scope
- [ ] Out-of-scope changes: none

## Changes
- `src/client/Controllers/ToolController.luau` — changed `:Fire()` to `:FireServer()`
- `scripts/test_tools.luau` — added regression test for server authorization

## Verification
- [x] `lune run scripts/test_core.luau` — 26 tests pass
- [x] `selene src/` — no new lint warnings
- [x] `luau-analyze src/` — no new type errors

## CI Checks Expected
- [ ] `test (lune)` (from workflow: `.github/workflows/ci.yml`)
- [ ] `type-check (luau-analyze)` (from workflow: `.github/workflows/ci.yml`)

## Acceptance Criteria
- [x] `ToolController:activateTool()` calls `:FireServer()` instead of `:Fire()`
- [x] Regression test added in `scripts/test_tools.luau`
- [x] 26 tests pass — `lune run scripts/test_core.luau`

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.