From cursor-blame
通过 git commit 反查产生该 commit 的 Cursor AI 对话,查看文件级行归因、AI 贡献占比、模型追踪、对话上下文。支持 GitLab MR URL 批量分析。当用户提及"cursor blame"、"AI 代码归因"、"这个 commit 是 AI 写的吗"、"查看 AI 对话"、"AI 贡献统计"、"哪些代码是 AI 生成的"、"追溯 commit 对话"、"AI 代码占比"、"这个文件哪些是 AI 写的"、commit hash + "对话"/"conversation"、"MR"、"merge request"、"合并请求" 时触发。也适用于用户想了解某段代码的 AI 生成上下文、查看 Cursor 对话历史、或分析项目的 AI 辅助编码情况。
How this skill is triggered — by the user, by Claude, or both
Slash command
/cursor-blame:cursor-blameThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
本地版 Cursor Blame,通过读取 Cursor 本地数据库,实现四大功能:
本地版 Cursor Blame,通过读取 Cursor 本地数据库,实现四大功能:
Cursor 在本地存储的 AI 代码追踪数据:
~/.cursor/ai-tracking/ai-code-tracking.db -- commit 评分 + 行级归因 + conversationId~/Library/Application Support/Cursor/User/globalStorage/state.vscdb -- 对话元数据 + 消息内容脚本路径(相对于本 SKILL.md):scripts/cursor_blame.py
纯 Python 标准库实现,无需安装依赖。
python3 {SCRIPT_PATH} commit <commit-hash> [-v]
查看一个 commit 的完整 AI 归因报告:
-v 展开对话的完整消息自动处理 merge commit: 检测到 merge commit 时自动展开分析内部的实际 commit。
python3 {SCRIPT_PATH} file <filepath> [-L <range>] [--no-lines]
结合 git blame 与 AI tracking 数据,为文件每一行标注:
输出包含:
--no-lines 隐藏)-L 1,20 限制行范围,语法同 git blame -L。
python3 {SCRIPT_PATH} blame <commit-hash> [-s] [-n 20]
追溯 commit 关联的 Cursor 对话并显示完整消息。当需要看对话详情时使用。
python3 {SCRIPT_PATH} log [--since YYYY-MM-DD] [--until YYYY-MM-DD] [-n 50]
python3 {SCRIPT_PATH} chat <conversation-id> [-s]
python3 {SCRIPT_PATH} mr <gitlab-mr-url> [-v]
粘贴 GitLab MR 地址,自动拉取 MR 中的所有 commit 并逐个分析 AI 归因:
GITLAB_PRIVATE_TOKEN 环境变量访问私有仓库URL 格式示例:https://git.taimei.com/tmxc/eimage/eimage-front/-/merge_requests/2164
自动检测: 直接传入 MR URL 作为参数即可,无需显式指定 mr 子命令。
python3 {SCRIPT_PATH} stats
脚本路径: 用本 SKILL.md 同级 scripts/cursor_blame.py 的绝对路径。
工作目录: commit/file/blame 命令必须在目标 git 仓库目录下执行。先确认用户指定的 commit/file 属于哪个仓库。
选择命令:
commit(概览)或 blame(看对话)mr(批量分析 MR 内所有 commit)filestatslog解读输出:
composer = Cursor Composer/Agent 生成tab = Cursor Tab 自动补全human = 人工编写v2AiPercentage 是 Cursor 官方的 AI 代码百分比Merge commit: commit 命令自动检测并展开 merge commit 内部的实际 commit。
输出规则: 脚本执行后,原样输出程序结果,不要总结、改写或省略。用户需要看到完整的原始输出。
Creates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.
npx claudepluginhub taimei-1024/cursor-plugins --plugin cursor-blame