PluginBench
Skill
Official
Review
Audit score 70

author-contributions

microsoft/vscode

Identify all files a specific author contributed to on a branch vs upstream, tracing code through renames.

What is author-contributions?

This skill finds every file a specific author edited on a branch compared to its upstream (e.g., main), accounting for file renames and moves. Use it when you need to audit authorship, answer "what did this person change?", or verify contributions before a merge.

  • Matches author identity exactly using git log
  • Collects all files directly committed by the author
  • Builds a rename map across all commits to trace file moves
  • Classifies contributions as DIRECT or VIA_RENAME
  • Returns a markdown table with file paths and line changes
  • Handles multi-hop renames (file moved multiple times)

How to install author-contributions

npx skills add https://github.com/microsoft/vscode --skill author-contributions
Prerequisites
  • Git repository with commit history
  • Author's exact git identity (name and email as they appear in git log)
  • Access to the repository and both the branch and upstream branch
Claude Code
Cursor
Windsurf
Cline

How to use author-contributions

  1. 1.Resolve the author's exact git identity by running `git log --format="%an <%ae>"` on the branch
  2. 2.Delegate to a subagent with the author name, branch, and upstream (e.g., main)
  3. 3.The subagent will execute git commands to collect author commits and build a rename map
  4. 4.Review the returned markdown table showing Status (DIRECT or VIA_RENAME), File Path, and line changes
  5. 5.Use the summary line to see total files and aggregate +/- lines changed

Use cases

Good for
  • Audit what code a specific developer contributed to a feature branch before merging
  • Verify authorship of files in a pull request to ensure correct attribution
  • Track contributions when files have been renamed or moved during development
  • Generate a report of all changes by an author across a branch for code review
  • Identify which files will be affected by an author's changes when merged to main
Who it's for
  • Code reviewers auditing pull requests
  • Engineering managers tracking developer contributions
  • DevOps/release engineers verifying authorship before merges
  • Developers investigating who changed specific code

author-contributions FAQ

How do I find the author's exact git identity?

Run `git log --format="%an <%ae>" <upstream>..<branch> | sort -u` to see all author names on the branch. Match the person you're looking for to their exact string—short usernames won't match full display names. Use `git log` output or the GitHub MCP `get_me` tool to resolve the correct full name.

What's the difference between DIRECT and VIA_RENAME?

DIRECT means the author edited the file directly in a commit on this branch. VIA_RENAME means the author edited the file under an old name, but it was renamed or moved later (by any author), and the current name is what will merge upstream.

Why do some files the author touched not appear in the output?

Only files that exist in the final merge diff (files that will actually land when the branch merges) are reported. Files the author edited but were later deleted entirely won't appear because they won't reach upstream.

Can this handle files that were moved multiple times?

Yes. The skill builds a rename map across all commits and walks chains transitively. A file moved from `contrib/chat/` → `agentSessions/` → `sessions/` will be traced back to find if the author edited any ancestor name.

Should I run this as a subagent?

Yes. This skill involves many sequential git commands and is best delegated to a subagent. Provide the author name, branch, and upstream, and the subagent will return a concise markdown table.

Full instructions (SKILL.md)

Source of truth, from microsoft/vscode.


name: author-contributions description: Identify all files a specific author contributed to on a branch vs its upstream, tracing code through renames. Use when asked who edited what, what code an author contributed, or to audit authorship before a merge. This skill should be run as a subagent — it performs many git operations and returns a concise table.

When asked to find all files a specific author contributed to on a branch (compared to main or another upstream), follow this procedure. The goal is to produce a simple table that both humans and LLMs can consume.

Run as a Subagent

This skill involves many sequential git commands. Delegate it to a subagent with a prompt like:

Find every file that author "Full Name" contributed to on branch <branch> compared to <upstream>. Trace contributions through file renames. Return a markdown table with columns: Status (DIRECT or VIA_RENAME), File Path, and Lines (+/-). Include a summary line at the end.

Procedure

1. Identify the author's exact git identity

git log --format="%an <%ae>" <upstream>..<branch> | sort -u

Match the requested person to their exact --author= string. Do not guess — short usernames won't match full display names (resolve via git log or the GitHub MCP get_me tool).

2. Collect all files the author directly committed to

git log --author="<Exact Name>" --format="%H" <upstream>..<branch>

For each commit hash, extract touched files:

git diff-tree --no-commit-id --name-only -r <hash>

Union all results into a set (author_files).

3. Build rename map across the entire branch

For every commit on the branch (not just the author's), extract renames:

git diff-tree --no-commit-id -r -M <hash>

Parse lines with R status to build a map: new_path → {old_paths}.

4. Get the merge diff file list

git diff --name-only <upstream>..<branch>

These are the files that will actually land when the branch merges.

5. Classify each file in the merge diff

For each file in step 4:

  • If it's in author_filesDIRECT
  • Else, walk the rename map transitively (follow chains: current → old → older) and check if any ancestor is in author_filesVIA_RENAME
  • Otherwise → not this author's contribution

6. Get diff stats

git diff --stat <upstream>..<branch> -- <file1> <file2> ...

7. Return the table

Format the result as a markdown table:

| Status | File | +/- |
|--------|------|-----|
| DIRECT | src/vs/foo/bar.ts | +120/-5 |
| VIA_RENAME | src/vs/baz/qux.ts | +300 |
| ... | ... | ... |

**Total: N files, +X/-Y lines**

Important Notes

  • Use Python for the heavy lifting. Shell loops with inline comments break in zsh. Write a temp .py script, run it, then delete it.
  • Author matching is exact. Always run step 1 first. --author does substring matching but you must verify the right person is matched (e.g., don't match "Joshua Smith" when looking for "Josh S."). Use the GitHub MCP get_me tool or git log output to resolve the correct full name.
  • Renames can be multi-hop. A file may have moved contrib/chat/agentSessions/sessions/. The rename map must be walked transitively.
  • Only report files in the merge diff (step 4). Files the author touched that were later deleted entirely should not appear — they won't land in the upstream.
  • The rename map must include all authors' commits, not just the target author's. Other people often do the rename commits (e.g., bulk refactors/moves).

Example Python Script

import subprocess, os

os.chdir('<repo_root>')
UPSTREAM = 'main'
AUTHOR = '<Author Name>'  # Resolve via `git log` or GitHub MCP `get_me`

# Step 2: author's files
commits = subprocess.check_output(
    ['git', 'log', f'--author={AUTHOR}', '--format=%H', f'{UPSTREAM}..HEAD'],
    text=True).strip().split('\n')
author_files = set()
for h in (c for c in commits if c):
    files = subprocess.check_output(
        ['git', 'diff-tree', '--no-commit-id', '--name-only', '-r', h],
        text=True).strip().split('\n')
    author_files.update(f for f in files if f)

# Step 3: rename map from ALL commits
all_commits = subprocess.check_output(
    ['git', 'log', '--format=%H', f'{UPSTREAM}..HEAD'],
    text=True).strip().split('\n')
rename_map = {}  # new_name -> set(old_names)
for h in (c for c in all_commits if c):
    out = subprocess.check_output(
        ['git', 'diff-tree', '--no-commit-id', '-r', '-M', h],
        text=True, timeout=5).strip()
    for line in out.split('\n'):
        if not line:
            continue
        parts = line.split('\t')
        if len(parts) >= 3 and 'R' in parts[0]:
            rename_map.setdefault(parts[2], set()).add(parts[1])

# Step 4: merge diff
diff_files = subprocess.check_output(
    ['git', 'diff', '--name-only', f'{UPSTREAM}..HEAD'],
    text=True).strip().split('\n')

# Step 5: classify
results = []
for f in (x for x in diff_files if x):
    if f in author_files:
        results.append(('DIRECT', f))
    else:
        # walk rename chain
        chain, to_check = set(), [f]
        while to_check:
            cur = to_check.pop()
            if cur in chain:
                continue
            chain.add(cur)
            to_check.extend(rename_map.get(cur, []))
        chain.discard(f)
        if chain & author_files:
            results.append(('VIA_RENAME', f))

# Step 6: stats
if results:
    stat = subprocess.check_output(
        ['git', 'diff', '--stat', f'{UPSTREAM}..HEAD', '--'] +
        [f for _, f in results], text=True)
    print(stat)

# Step 7: table
for kind, f in sorted(results, key=lambda x: x[1]):
    print(f'| {kind:12s} | {f} |')
print(f'\nTotal: {len(results)} files')

Alternative Script

After following the process above, run this script to cross-check files touched by an author against the branch diff. You can do this both with an without src/vs/sessions.

AUTHOR=""

# 1. Find commits by author on this branch (not on main)
git log main...HEAD --author="$AUTHOR" --format="%H"

# 2. Get unique files touched across all those commits, excluding src/vs/sessions/
git log main...HEAD --author="$AUTHOR" --format="%H" \
  | xargs -I{} git diff-tree --no-commit-id -r --name-only {} \
  | sort -u \
  | grep -v '^src/vs/sessions/'

# 3. Cross-reference with branch diff to keep only files still changed vs main
git log main...HEAD --author="$AUTHOR" --format="%H" \
  | xargs -I{} git diff-tree --no-commit-id -r --name-only {} \
  | sort -u \
  | grep -v '^src/vs/sessions/' \
  | while read f; do git diff main...HEAD --name-only -- "$f" 2>/dev/null; done \
  | sort -u