帮助追踪作者在分支上的代码贡献并输出简表
复制安装指令,让 AI 自动完成配置 · 推荐新手
请帮我安装 askskill 上的 "author-contributions" 技能: 1. 下载 https://raw.githubusercontent.com/microsoft/vscode/main/.github/skills/author-contributions/SKILL.md 2. 保存为 ~/.claude/skills/author-contributions/SKILL.md 3. 装好后重载技能,告诉我可以用了
请作为子代理,找出作者“张三”在分支 feature/login 相对 main 的所有贡献文件,追踪重命名,并返回表格:Status、File Path、Lines(+/-) 和总计。
输出包含 DIRECT / VIA_RENAME 的文件清单,以及每个文件的增减行数和总计。
请比较 release-v2.1 和 upstream,确认作者“李四”直接或通过重命名影响了哪些最终会合并的文件,返回可读表格。
给出最终会进入合并的文件中,哪些属于该作者的直接贡献或重命名贡献。
当你想知道某位作者在某个分支上实际改了哪些文件时,可以用它追踪提交与重命名链路。适合在合并前做归属核对。
文件被多次改名后,仍可回溯作者最初贡献到的路径,避免把重构后的文件误判为别人的工作。
适合把某作者相关的变更整理成简洁表格,方便人或 LLM 快速查看。
该文档说明了如何在分支与上游之间,找出某位作者实际贡献过的所有文件,并通过提交记录与重命名链路回溯归属。它强调应作为子代理运行,先精确匹配作者身份,再收集直接提交、全分支重命名映射和合并差异文件,最后输出包含状态、文件路径和增减行数的简洁表格。
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.
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.
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).
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).
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}.
git diff --name-only <upstream>..<branch>
These are the files that will actually land when the branch merges.
For each file in step 4:
author_files → DIRECTauthor_files → VIA_RENAMEgit diff --stat <upstream>..<branch> -- <file1> <file2> ...
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**
.py script, run it, then delete it.--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.contrib/chat/ → agentSessions/ → sessions/. The rename map must be walked transitively.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')
…
它会比较分支与上游,找出某个作者贡献到的文件,并追踪文件重命名后的归属。最终返回一个简洁表格。
需要目标作者、分支名和上游分支名。作者身份要尽量精确匹配 git 里的真实姓名和邮箱。
会。文档要求建立全分支的重命名映射,并沿着多跳重命名链追踪到最终文件。
帮助用户为当前会话生成或更新运行命令,便于一键启动与调试项目。
帮助你编写 Hook 配置文件,以执行策略校验并自动化代理生命周期事件。
帮助用户更新 GitHub Copilot 的 CLI 或 SDK 到较新版本。
分析 V8 堆快照,定位内存泄漏、对象滞留与 GC 后存活原因
将当前会话分支的修改合并回基础分支,便于整合开发成果。
在隔离环境启动 VS Code OSS,便于联动自动化操作与多进程调试。
帮助用户解读 Git diff 变更,标注风险并生成代码审查检查清单。
将 AI 生成的代码改动按主题分组为待提交候选,审核后再落库。
检测代码修改中被遗漏的协同变更文件与 C# 成员,降低漏改风险
为 AI 与 IDE 提供混合检索能力,快速在代码仓库中按行定位并引用相关代码。
对本地或PR分支执行结构化代码审查,帮助提交或发布前发现问题。
为 AI 助手提供代码审查,检查本地改动、分支差异与补丁文件质量。