Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .agent/SKILL_INVENTORY.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Skill inventory — ${PROJECT_NAME}

**Last reviewed:** 2026-11-28. Companion to [SKILL_CHANGE_AST10_REVIEW.md](SKILL_CHANGE_AST10_REVIEW.md)
**Last reviewed:** 2026-11-29. Companion to [SKILL_CHANGE_AST10_REVIEW.md](SKILL_CHANGE_AST10_REVIEW.md)
and [SKILL_COMPILATION.md](SKILL_COMPILATION.md).
Update this file (new row or **Last reviewed** date) in the same PR as any skill change.

Expand All @@ -26,6 +26,7 @@ commands or edit code/config as part of its procedure.
| cross-pc-ssh | Work in the same repository on a paired Windows PC over SSH: locate the peer checkout by root commit and normalized origin (any drive or root folder), re-verify it before each command, read-only status/ls/cat (secret-looking files refused)/allowlisted git, and a headless `claude -p` (Read/Grep/Glob only) or `codex exec -s read-only` (`--allow-edits` only with user approval). All remote strings travel as base64; paths stay inside the checkout; no key or sshd setup; remote-PowerShell quoting reference | L2 | 2026-11-27 |
| repo-inventory | Compare checkouts of the same repos across PCs: snapshot a projects folder (remote key, default branch and origin SHA, HEAD, branches with ahead/behind/gone/unpushed, worktrees, dirty counts, stashes, in-progress ops) with read-only git, exchange it through the share (`private/host-profile/repos-<host>.json`, atomic), over ssh or as a 16 KB digest, then compare hosts (exit 1 on drift) and print a SAFE / NEEDS HUMAN sync plan it never runs. Repos match by normalized remote plus an alias map for renames | L2 | 2026-11-27 |
| commit-and-push | Stage, commit, and push with git safety rules; pairs with release-bump (**compiled harness**) | L2 | 2026-11-19 |
| fast-forward | Level the default branch with origin and land the intended tracked changes: fetch, `--ff-only` pull (stop on overlap with dirty files), commit staged-by-path changes on a short-lived branch, push, PR against the repo's own default branch, merge pinned to the full SHA (merge origin and regenerate on conflict, no force), fast-forward to 0/0, `branch -d`. Untracked files untouched. User-typed only | L2 | 2026-11-29 |
| critical-commit-audit | Deep post-commit hunt for high-severity bugs | L2 | 2026-07-01 |
| eval | Capture task quality signals to agent memory (**compiled harness**) | L2 | 2026-07-21 |
| export-chat | Export the Cursor agent transcript to Markdown or the clipboard, like Claude Code `/export` | L2 | 2026-10-01 |
Expand Down
7 changes: 7 additions & 0 deletions .agent/setup/library.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,13 @@
"global": true,
"projects": []
},
{
"id": "fast-forward",
"source": ".claude/skills/fast-forward",
"pack": "global",
"global": true,
"projects": []
},
{
"id": "commit-conventions",
"source": ".claude/skills/commit-conventions",
Expand Down
128 changes: 128 additions & 0 deletions .agents/skills/fast-forward/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
---
name: fast-forward
description: "Bring the default branch of the current repository level with its remote and land the local work that belongs there: fetch, fast-forward the default branch, commit the intended tracked changes on a short-lived branch, push it, open a PR against the repository's own default branch, merge it pinned to the pushed commit, fast-forward the local default branch to the merge, and delete the branch. Leaves untracked and unrelated files alone. Runs only when the user types /fast-forward."
capability: "Sync a checkout's default branch with origin and land its intended tracked changes through a pinned PR merge, never by force or a direct push to the default branch."
side_effect_level: remote_write
approval_required: true
requires_tools: "git and gh, authenticated for the repository's own remote."
output_schema: "The default branch's position before and after (ahead/behind counts and short SHAs), what was committed (paths and the commit), the PR and its merge commit, the final ahead/behind of 0/0, and every file left untouched with the reason."
risk_class: medium
disable-model-invocation: true
---

# Fast-forward

`/fast-forward` means: **make my default branch match the remote, and land the work that belongs on it.**
Typing it approves one commit of the intended tracked changes, one push of a new branch, one PR and its
merge. It is not standing approval, and it never force-pushes, rewrites history or pushes straight to the
default branch.

How this differs from neighbours:
- `commit-and-push` commits and pushes a branch; it doesn't merge or fast-forward the default branch.
- `/merge-pr` and `/ship-pr` merge an existing PR on CI evidence. `/fast-forward` opens its own small PR
and merges it in the same run, so keep it for changes that need no review: tracker snapshots,
generated files, docs the user already approved.
- Syncing an upstream repository **into** a fork is a different job (some projects have their own
skill for it). `/fast-forward` only talks to the repository's own `origin`.

## 1. Confirm the target

- **The repository and its default branch.** Read `gh repo view --json nameWithOwner,defaultBranchRef`
for `origin`. In a fork, `gh` defaults to the parent repository, so name the repository on every
`gh` call (`--repo <owner>/<name>`). If the project's notes name a read-only upstream, never write to it.
- **This checkout is on the default branch,** or can switch to it cleanly. If it's on another branch
with work in progress, stop and ask; that branch isn't yours to move.
- **Another session may share this checkout.** If one is active here (`ListAgents`, a held tracker ticket,
a running build), ask before switching branches.

## 2. Fetch and fast-forward

```bash
git fetch origin
git rev-list --left-right --count HEAD...origin/<default> # "<ahead> <behind>"
```

- **Behind only (`0 N`):** `git pull --ff-only origin <default>`. Dirty tracked files are fine when the
incoming commits don't touch them. Check with `git log HEAD..origin/<default> -- <dirty paths>` first.
If they do touch them, stop and report the overlap; don't stash, reset or merge over someone's edits.
- **Ahead (`N 0` or `N M`):** local commits exist on the default branch. Don't push them directly. Move
them to the step-3 branch, or stop and ask if they aren't clearly the user's. `git switch -c <branch>`
keeps the commits and the working tree, then `git branch -f <default> origin/<default>` moves only the
default branch's pointer back. Never use `git reset` for this: it can discard the dirty tracked files
this step allows.
- **Never** `git pull` without `--ff-only`, and never `--rebase` or `--force` on the default branch.

## 3. Commit the intended changes on a branch

- **Decide what belongs.** List `git status --short`. Commit only tracked changes the user's request
covers, or that this run produced: a tracker snapshot, a regenerated file. Show the diff stat.
- **Untracked files stay untracked** unless the user names them. They are often local notes, exports,
device presets or machine config (`mcp_config.json`, `*.local.*`, `.env*`). List them in the report.
- **Secrets gate before the push:** scan the staged diff (`git diff --cached`) for tokens, keys,
machine-local paths and personal identities. A hit blocks the push. For a PUBLIC repository
(`gh repo view --json visibility`), follow `commit-and-push`'s public-repo checks too.
- Branch `chore/<topic>-<YYYY-MM-DD>` (or the project's pattern, such as `af/<ticket>-<slug>`). Stage
paths explicitly (`git add <path>`, never `git add -A`), and commit with a Conventional Commit message
and the attribution lines the session asks for.
- Nothing to commit? Skip steps 3–5 and report that the default branch only fast-forwarded.

## 4. Push and open the PR

```bash
git push origin <branch>
gh pr create --repo <owner>/<name> --base <default> --head <branch> --title "<subject>" --body-file <body.md>
```

Push without `-u`: an upstream setting writes branch tracking into `.git/config`. The body says what
changed and why it needs no review. Reference the ticket (`Refs <id>`) when the
project tracks work.

## 5. Merge pinned to the pushed commit

- **Same gate as `/merge-pr`.** Wait about five minutes after the push for checks to register. Then
**every** run and check on the pushed SHA (`gh run list --commit <full sha>`, plus the commit's
check-runs and status) must have completed green. Anything pending, failing or skipped-only, a
`mergeStateStatus` of `BLOCKED`, or a conflict means stop: hand it to `/ship-pr` or the user. If the
repository has CI but no run registered, or no CI at all, hand the merge to `/merge-pr`, which proves
that case and runs the checks locally. Don't merge on a guess.
- Check that the PR's `headRefOid` equals `git rev-parse HEAD`, so the merge lands exactly the commit
you checked.
- Use the method the repository's recent PRs used, pinned to the **full 40-character SHA** (a short SHA
is rejected):

```bash
gh pr merge <n> --repo <owner>/<name> --merge --delete-branch --match-head-commit $(git rev-parse HEAD)
```
- **"The merge commit cannot be cleanly created":** the default branch moved. Fetch, merge
`origin/<default>` into the branch, and resolve the conflicts. Regenerate generated files rather than
hand-merging them. Re-run the checks, push (no force), then merge again on the new head.

## 6. Fast-forward the local default branch

```bash
git switch <default>
git pull --ff-only origin <default>
git rev-list --left-right --count HEAD...origin/<default> # must print "0 0"
git branch -d <branch> # -d, not -D: it must be merged
```

`gh pr merge --delete-branch` removes the remote branch, often switches the local checkout, and may
already have deleted the local branch, so a failing `git branch -d` there is harmless. Check
`gh pr view <n> --json state,mergeCommit` rather than trusting its exit code.

## Report

```markdown
**<default>** is level with origin at <sha> (was <ahead> ahead, <behind> behind).

- Committed <paths> as <sha> on <branch>; PR #<n> merged as <merge sha>; branch deleted.
- Left untouched: <untracked or unrelated files, one line each, with why>.
```

## Never

- Push directly to the default branch, force-push, rebase or reset a branch with others' work.
- Stash, discard or commit files the user didn't ask for, including untracked ones.
- Merge past a pending or failing required check, a `BLOCKED` state or a requested change.
- Open the PR against an upstream or parent repository the project treats as read-only.
- Delete a branch with `-D`, or delete a branch that isn't merged.
128 changes: 128 additions & 0 deletions .claude/skills/fast-forward/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
---
name: fast-forward
description: "Bring the default branch of the current repository level with its remote and land the local work that belongs there: fetch, fast-forward the default branch, commit the intended tracked changes on a short-lived branch, push it, open a PR against the repository's own default branch, merge it pinned to the pushed commit, fast-forward the local default branch to the merge, and delete the branch. Leaves untracked and unrelated files alone. Runs only when the user types /fast-forward."
capability: "Sync a checkout's default branch with origin and land its intended tracked changes through a pinned PR merge, never by force or a direct push to the default branch."
side_effect_level: remote_write
approval_required: true
requires_tools: "git and gh, authenticated for the repository's own remote."
output_schema: "The default branch's position before and after (ahead/behind counts and short SHAs), what was committed (paths and the commit), the PR and its merge commit, the final ahead/behind of 0/0, and every file left untouched with the reason."
risk_class: medium
disable-model-invocation: true
---

# Fast-forward

`/fast-forward` means: **make my default branch match the remote, and land the work that belongs on it.**
Typing it approves one commit of the intended tracked changes, one push of a new branch, one PR and its
merge. It is not standing approval, and it never force-pushes, rewrites history or pushes straight to the
default branch.

How this differs from neighbours:
- `commit-and-push` commits and pushes a branch; it doesn't merge or fast-forward the default branch.
- `/merge-pr` and `/ship-pr` merge an existing PR on CI evidence. `/fast-forward` opens its own small PR
and merges it in the same run, so keep it for changes that need no review: tracker snapshots,
generated files, docs the user already approved.
- Syncing an upstream repository **into** a fork is a different job (some projects have their own
skill for it). `/fast-forward` only talks to the repository's own `origin`.

## 1. Confirm the target

- **The repository and its default branch.** Read `gh repo view --json nameWithOwner,defaultBranchRef`
for `origin`. In a fork, `gh` defaults to the parent repository, so name the repository on every
`gh` call (`--repo <owner>/<name>`). If the project's notes name a read-only upstream, never write to it.
- **This checkout is on the default branch,** or can switch to it cleanly. If it's on another branch
with work in progress, stop and ask; that branch isn't yours to move.
- **Another session may share this checkout.** If one is active here (`ListAgents`, a held tracker ticket,
a running build), ask before switching branches.

## 2. Fetch and fast-forward

```bash
git fetch origin
git rev-list --left-right --count HEAD...origin/<default> # "<ahead> <behind>"
```

- **Behind only (`0 N`):** `git pull --ff-only origin <default>`. Dirty tracked files are fine when the
incoming commits don't touch them. Check with `git log HEAD..origin/<default> -- <dirty paths>` first.
If they do touch them, stop and report the overlap; don't stash, reset or merge over someone's edits.
- **Ahead (`N 0` or `N M`):** local commits exist on the default branch. Don't push them directly. Move
them to the step-3 branch, or stop and ask if they aren't clearly the user's. `git switch -c <branch>`
keeps the commits and the working tree, then `git branch -f <default> origin/<default>` moves only the
default branch's pointer back. Never use `git reset` for this: it can discard the dirty tracked files
this step allows.
- **Never** `git pull` without `--ff-only`, and never `--rebase` or `--force` on the default branch.

## 3. Commit the intended changes on a branch

- **Decide what belongs.** List `git status --short`. Commit only tracked changes the user's request
covers, or that this run produced: a tracker snapshot, a regenerated file. Show the diff stat.
- **Untracked files stay untracked** unless the user names them. They are often local notes, exports,
device presets or machine config (`mcp_config.json`, `*.local.*`, `.env*`). List them in the report.
- **Secrets gate before the push:** scan the staged diff (`git diff --cached`) for tokens, keys,
machine-local paths and personal identities. A hit blocks the push. For a PUBLIC repository
(`gh repo view --json visibility`), follow `commit-and-push`'s public-repo checks too.
- Branch `chore/<topic>-<YYYY-MM-DD>` (or the project's pattern, such as `af/<ticket>-<slug>`). Stage
paths explicitly (`git add <path>`, never `git add -A`), and commit with a Conventional Commit message
and the attribution lines the session asks for.
- Nothing to commit? Skip steps 3–5 and report that the default branch only fast-forwarded.

## 4. Push and open the PR

```bash
git push origin <branch>
gh pr create --repo <owner>/<name> --base <default> --head <branch> --title "<subject>" --body-file <body.md>
```

Push without `-u`: an upstream setting writes branch tracking into `.git/config`. The body says what
changed and why it needs no review. Reference the ticket (`Refs <id>`) when the
project tracks work.

## 5. Merge pinned to the pushed commit

- **Same gate as `/merge-pr`.** Wait about five minutes after the push for checks to register. Then
**every** run and check on the pushed SHA (`gh run list --commit <full sha>`, plus the commit's
check-runs and status) must have completed green. Anything pending, failing or skipped-only, a
`mergeStateStatus` of `BLOCKED`, or a conflict means stop: hand it to `/ship-pr` or the user. If the
repository has CI but no run registered, or no CI at all, hand the merge to `/merge-pr`, which proves
that case and runs the checks locally. Don't merge on a guess.
- Check that the PR's `headRefOid` equals `git rev-parse HEAD`, so the merge lands exactly the commit
you checked.
- Use the method the repository's recent PRs used, pinned to the **full 40-character SHA** (a short SHA
is rejected):

```bash
gh pr merge <n> --repo <owner>/<name> --merge --delete-branch --match-head-commit $(git rev-parse HEAD)
```
- **"The merge commit cannot be cleanly created":** the default branch moved. Fetch, merge
`origin/<default>` into the branch, and resolve the conflicts. Regenerate generated files rather than
hand-merging them. Re-run the checks, push (no force), then merge again on the new head.

## 6. Fast-forward the local default branch

```bash
git switch <default>
git pull --ff-only origin <default>
git rev-list --left-right --count HEAD...origin/<default> # must print "0 0"
git branch -d <branch> # -d, not -D: it must be merged
```

`gh pr merge --delete-branch` removes the remote branch, often switches the local checkout, and may
already have deleted the local branch, so a failing `git branch -d` there is harmless. Check
`gh pr view <n> --json state,mergeCommit` rather than trusting its exit code.

## Report

```markdown
**<default>** is level with origin at <sha> (was <ahead> ahead, <behind> behind).

- Committed <paths> as <sha> on <branch>; PR #<n> merged as <merge sha>; branch deleted.
- Left untouched: <untracked or unrelated files, one line each, with why>.
```

## Never

- Push directly to the default branch, force-push, rebase or reset a branch with others' work.
- Stash, discard or commit files the user didn't ask for, including untracked ones.
- Merge past a pending or failing required check, a `BLOCKED` state or a requested change.
- Open the PR against an upstream or parent repository the project treats as read-only.
- Delete a branch with `-D`, or delete a branch that isn't merged.
Loading