Skip to content
Agentmart
Submit a tool

extract-author-changes

Loads context for the current branch's PR-scope changes (merge-base to HEAD), including uncommitted edits, then confirms without summarizing.

Skill by enricogolfieri

IndexedUnlicense★ 1
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/enricogolfieri-extract-author-changes

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Loads context for the current branch's PR-scope changes (merge-base to HEAD), including uncommitted edits, then confirms without summarizing. Use when starting a session and the user wants branch/PR context for follow-up work. Optional author filter only when they ask for "my commits only."

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/extract-author-changes

What's inside

Skill name
extract-author-changes
Description
Loads context for the current branch's PR-scope changes (merge-base to HEAD), including uncommitted edits, then confirms without summarizing. Use when starting a session and the user wants branch/PR context for follow-up work. Optional author filter only when they ask for "my commits only."
License
Unlicense
Instructions
167 lines in SKILL.md · view on GitHub

Files (1)

  • SKILL.md

SKILL.md (first lines)

# Extract Branch / PR Changes

Load **what the PR shows** — the diff from the merge-base of the PR base branch to `HEAD` — not a two-dot range filtered by `git config user.email`.

This skill loads change context into the session. It does not run tests and does not summarize unless the user explicitly asks.

## Defaults

Unless the user says otherwise:

1. **Scope:** PR-style three-dot range (`<base>...HEAD`), same as GitHub’s “Files changed”
2. **Base ref resolution** (first match wins):
   - User-provided base (e.g. `origin/master`, parent stack branch)
   - Open PR for current branch: `gh pr view --json baseRefName` → `origin/<baseRefName>`
   - Upstream tracking branch: merge-base of `@{upstream}` and `HEAD`
   - `origin/master`
3. **Author filter:** **off** by default. Enable only when the user asks for their commits only (`--author`, “my changes”, “what I authored”).
4. **Output:** exactly `Context loaded.` (no summary, file list, or explanation)

Ask a clarifying question only if base ref cannot be resolved (no upstream, no PR, fetch failed) and the user did not name a base.

## Extraction Workflow

```text
Branch / PR Change Extraction Progress
- [ ] Identify branch, resolved PR base ref, merge-base
- [ ] Collect commits and diff in <base>...HEAD (three-dot)
- [ ] Optional: filter commits by author if user requested
- [ ] Collect uncommitted local edits separately
- [ ] Sanity-check scope (HEAD included, not empty/wrong)
- [ ] Confirm context loaded
```

### 1) Identify scope

```bash
git branch --show-current
git fetch origin --quiet  # best-effort; continue if it fails

# Resolve base (examples — use the first that applies)
# gh pr view --json baseRefName,headRefName -q '.baseRefName' 2>/dev/null
# git rev-parse --abbrev-ref @{upstream} 2>/dev/null
# Default: origin/master

base_ref="origin/master"   # replace with resolved base
merge_base="$(git merge-base "$base_ref" HEAD)"
```

Record internally: `branch`, `base_ref`, `merge_base`, `three_dot_range="${base_ref}...HEAD"`.

**Three-dot vs two-dot**

| Syntax | Meaning | Use for PR scope? |
|--------|---------|-------------------|
| `base...HEAD` | Changes since **merge-base**(base, HEAD) | **Yes** — matches GitHub PR |
| `base..HEAD` | All commits reachable from HEAD but not base | No — includes unrelated history on long branches |

### 2) PR-scope commits and diff (primary)

Always collect the full PR-scope patch first:

```bash
git log --date=short --format='%h %ad %an <%ae> %s' "${base_ref}...HEAD"
git diff --stat "${base_ref}...HEAD"
git diff --name-status "${base_ref}...HEAD"
```

If a PR exists for this branch, prefer matching GitHub exactly:

```bash
gh pr diff          # patch
gh pr view --json commits,files,baseRefName,headRefName
```

For file-level history, walk PR-scope commits (not `git show` on an author-filtered subset unless step 2b ran):

```bash
git log --format='%H' "${base_ref}...HEAD" |
while read -r commit; do
  git show --stat --name-status --format='commit %h %s' "$commit"
done
```

### 2b) Optional — author filter only on request

When the user wants **only their commits** within the PR range:

```bash
author_pattern="$(git config user.email)"
# if empty: author_pattern="$(git config user.name)"

git log --date=short --format='%h %ad %an <%ae> %s' \
  "${base_ref}...HEAD" --author="$author_pattern"
```

**Sanity checks** (run when author filter is used):

```bash
# HEAD should appear in PR-scope log
git log -1 --format='%h %ae %s' HEAD

# If author log is empty OR does not include recent HEAD work, warn internally:
# author filter missed branch tip — PR-scope diff (step 2) is still authoritative
```

Do **not** replace PR-scope diff with `origin/master..HEAD --author=...`; that misses other authors’ work on the same PR and picks up wrong commits when `git config` ≠ branch author.

### 3) Local working tree (always separate)

```bash
git status --short
git diff --name-status
git diff --stat
git diff --cached --name-status
git diff --cached --stat
```

Keep mentally separate: **`PR scope`** (`<base>...HEAD` plus optional author subset) vs **`Working tree`** (uncommitted).

From enricogolfieri/workspace-mongo, Unlicense.

More from enricogolfieri/workspace-mongo

Signals

Stars
1
Forks
0
Open issues
0
Last commit (this folder)
Jun 15, 2026 (4 months ago)

From GitHub (fetched Oct 24, 2026).

Details

License
Unlicense
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from enricogolfieri

Cite this page

extract-author-changes skill. Agent Mart. https://agentmart.dev/skills/enricogolfieri-extract-author-changes (last updated 2026-10-24)