agentleFS
abipalliabipalli/agent-skills/skills/stage-approve/SKILL.md

stage-approve

Skill1 starsChanged 19 days agoApache-2.0View on GitHub

Pipeline stage 5: apply the repo's approval policy, open the PR, merge or hand to a person. Loaded by a pipeline conductor such as feature-pipeline.

  • Commits and pushes

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    If the rebase changed anything, run $FP gates RUN_ID again.

    line 19
  2. Very specific:

    exit 0 (auto): every rule in run-ledger's policy passed.

    line 22
  3. Very specific:

    No AI attribution: no Co-authored-by or "Generated with" trailers.

    line 42
  4. Distinctive:

    If the merge is refused (branch protection, conflicts), go to 3b with the reason.

    line 52

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 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

stage-approve

AI review misses things a person would catch, so auto-approval exists for low stakes only and never replaces a repo's CODEOWNERS.

1. Rebase and decide

git -C <worktree> fetch origin && git -C <worktree> rebase <base>

If the rebase changed anything, run $FP gates RUN_ID again. Then run $FP approve RUN_ID, which records approve.decided:

  • exit 0 (auto): every rule in run-ledger's policy passed;
  • exit 3 (human): the output lists the reasons.

The policy is code, not judgement. Don't override an exit 3.

2. Open the PR

Open it either way:

git -C <worktree> push -u origin <branch>
gh pr create --repo <github> --head <branch> --base <base without origin/> [--draft] --title ... --body ...
$FP step RUN_ID approve pr.opened '{"pr": "<url>"}'
  • Open it as --draft unless the decision is auto and policy.auto_merge is true.
  • The PR body states the problem, the approach, the alternatives considered, how it was verified, the review rounds, and the approval decision with its reasons. It does not list commits or files.
  • No AI attribution: no Co-authored-by or "Generated with" trailers.

3a. Auto, with auto_merge: true

  1. gh pr merge <url> --squash. Don't pass --delete-branch: it would switch branches in the main checkout.
  2. git -C <checkout> push origin --delete <branch>
  3. git -C <checkout> worktree remove <worktree>
  4. $FP done RUN_ID '{"pr": "<url>", "merged": true}'

If the merge is refused (branch protection, conflicts), go to 3b with the reason.

3b. A person decides

Pause the run with $FP step RUN_ID approve hook.waiting '{"approval_note": "..."}'. A UI that mirrors runs shows it as a decision. If you are interactive, also ask with AskUserQuestion. Put the full case in front of them:

  • the scope brief, and the rescope_delta if there is one;
  • each spike's assumption, result and evidence;
  • what changed: tasks, files, check and gate results;
  • the panel's confirmed and plausible findings, non-blocking ones included;
  • the policy's reasons, your recommendation and why.

The options are approve, changes_requested (with notes) and reject. The answer arrives either in-session or as metadata.operator_decision on the run. Record it with hook.received, and put the answer in metadata so the merge guard sees it: $FP step RUN_ID approve hook.received '{"operator_decision": {"decision": "approve", "note": "", "via": "session", "at": "<ISO time>"}}'.

  • approve: merge as in 3a, or leave the merge to the person when they say so. Then $FP done.
  • changes_requested: send the notes to the same builder sessions, then rerun review.
  • reject: close the PR, leave the worktree for inspection, and run $FP done RUN_ID '{"rejected": true}'.

Record

{"approve": {"status": "ok", "verdict": "approved", "summary": "", "reasoning": "",
  "approval": {"decision": "auto|human", "reasons": []},
  "decision": {"choice": "approve|changes_requested|reject", "by": "policy|human", "notes": ""},
  "pr": "", "merged": false,
  "next": "stop"}}

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.