Token导航 LogoToken导航TokenDH.com
研究检索需要联网github未标认证来源可访问clear审计未展示

cleanup-author-references清理作者参考文献

Agent Skill

用于辅助安全审计、权限检查、凭据风险、认证流程和常见漏洞排查。它适合让 Agent 梳理敏感配置、检查依赖风险、分析鉴权逻辑或生成安全复核清单。使用时不能把工具输出直接当最终结论,涉及密钥、令牌、用户数据或生产系统时,应先确认最小权限、脱敏方式和操作边界。

总安装

16,728

周安装

751

GitHub Stars

公开资料未说明

下载量

10,695
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:cleanup-author-references(清理作者参考文献)
来源仓库:https://github.com/pstuart/pstuart
仓库路径:skills/cleanup-author-references
安装命令:
npx skills add pstuart/pstuart --skill "cleanup-author-references"
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

AgentSkills.tonpx skills
npx skills add pstuart/pstuart --skill "cleanup-author-references"

简介

用于辅助安全审计与权限检查。

  • 适合分析凭据风险、认证流程和常见漏洞排查。
  • 使用时不能将工具输出直接当作最终结论。
  • 安装命令:npx skills add pstuart/pstuart --skill "cleanup-author-references"。
  • 适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

SKILL.md

Cleanup Author References Skill

Overview

This skill removes AI authorship references from git repositories, cleaning up:

  • "🤖 Generated with Claude Code" lines
  • "Co-Authored-By: Claude..." lines (case-insensitive)
  • "Co-authored-by: Claude..." lines
  • Other mentions of Claude in commit messages
  • Branch names containing "claude" references

Prerequisites

git-filter-repo is required - it's the modern, safe way to rewrite git history.

# Install via Homebrew (macOS)
brew install git-filter-repo

# Or via pip
pip install git-filter-repo

Pre-Cleanup Checklist

Before running cleanup:

  1. Backup your repository - history rewriting is destructive
  2. Ensure working directory is clean - no uncommitted changes
  3. Coordinate with team - force pushes will be required
  4. Note current remote - you'll need to re-add it after cleanup
# Check status
git status

# Store remote URL for later
git remote get-url origin

# Create a backup branch
git branch backup-before-cleanup

Cleanup Commands

Step 1: Preview Affected Commits

First, see which commits will be modified:

# Find commits mentioning claude (case-insensitive)
git log --all --oneline --grep="claude" -i

# Count affected commits
git log --all --oneline --grep="claude" -i | wc -l

# Find Co-Authored-By mentions
git log --all --oneline --grep="Co-Authored-By.*Claude" -i

# Find Generated with Claude Code
git log --all --oneline --grep="Generated with.*Claude" -i

Step 2: Run git-filter-repo

IMPORTANT: git-filter-repo requires a fresh clone OR the --force flag. It also removes the origin remote as a safety measure.

# Store remote URL before cleanup
REMOTE_URL=$(git remote get-url origin 2>/dev/null || echo "")

# Run the cleanup with message callback
git-filter-repo --message-callback '
import re
msg = message.decode("utf-8", errors="replace")

# Patterns to remove
patterns = [
    # Generated with Claude Code (with and without emoji/link)
    r"\n*\s*🤖\s*Generated with \[Claude Code\]\(https://claude\.com/claude-code\)\s*\n*",
    r"\n*\s*🤖\s*Generated with Claude Code\s*\n*",
    r"\n*\s*Generated with \[Claude Code\]\(https://claude\.com/claude-code\)\s*\n*",
    r"\n*\s*Generated with Claude Code\s*\n*",
    # Co-Authored-By variations
    r"\n*\s*Co-Authored-By:\s*Claude[^\n]*\n*",
    r"\n*\s*Co-authored-by:\s*Claude[^\n]*\n*",
    r"\n*\s*co-authored-by:\s*Claude[^\n]*\n*",
    # Anthropic email variations
    r"\n*\s*Co-Authored-By:[^\n]*@anthropic\.com[^\n]*\n*",
    r"\n*\s*Co-authored-by:[^\n]*@anthropic\.com[^\n]*\n*",
]

for pattern in patterns:
    msg = re.sub(pattern, "\n", msg, flags=re.IGNORECASE)

# Clean up excessive newlines
msg = msg.rstrip() + "\n"
msg = re.sub(r"\n{3,}", "\n\n", msg)

return msg.encode("utf-8")
' --force

# Re-add the remote if it existed
if [ -n "$REMOTE_URL" ]; then
    git remote add origin "$REMOTE_URL"
fi

Step 3: Verify Cleanup

# Check for any remaining Claude references
git log --all --oneline --grep="claude" -i

# Should return empty or 0
git log --all --oneline --grep="claude" -i | wc -l

# Check for remaining Co-Authored-By
git log --all --grep="Co-Authored-By.*Claude" -i

Step 4: Force Push (if needed)

WARNING: This rewrites remote history. Coordinate with your team.

# Force push all branches
git push origin --force --all

# Force push tags
git push origin --force --tags

Branch Name Cleanup

If you have branches with "claude" in the name:

# List branches containing "claude"
git branch -a | grep -i claude

# Rename a local branch
git branch -m old-claude-branch new-branch-name

# Delete remote branch and push renamed one
git push origin :old-claude-branch
git push origin -u new-branch-name

Batch Cleanup Script

For cleaning multiple repositories at once, create this script:

#!/bin/bash
# cleanup_repos.sh - Clean Claude references from multiple repos

REPOS_DIR="${1:-.}"
cd "$REPOS_DIR"

for dir in */; do
    if [ -d "$dir/.git" ]; then
        echo "=== Processing $dir ==="
        cd "$dir"

        # Check for Claude references
        COUNT=$(git log --all --oneline --grep="claude" -i 2>/dev/null | wc -l | tr -d ' ')

        if [ "$COUNT" -gt 0 ]; then
            echo "Found $COUNT commits with Claude references"

            # Store remote
            REMOTE=$(git remote get-url origin 2>/dev/null || echo "")

            # Run cleanup
            git-filter-repo --message-callback '
import re
msg = message.decode("utf-8", errors="replace")
patterns = [
    r"\n*\s*🤖\s*Generated with \[Claude Code\]\(https://claude\.com/claude-code\)\s*\n*",
    r"\n*\s*🤖\s*Generated with Claude Code\s*\n*",
    r"\n*\s*Co-Authored-By:\s*Claude[^\n]*\n*",
    r"\n*\s*Co-authored-by:\s*Claude[^\n]*\n*",
]
for pattern in patterns:
    msg = re.sub(pattern, "\n", msg, flags=re.IGNORECASE)
msg = msg.rstrip() + "\n"
msg = re.sub(r"\n{3,}", "\n\n", msg)
return msg.encode("utf-8")
' --force

            # Restore remote
            if [ -n "$REMOTE" ]; then
                git remote add origin "$REMOTE"
            fi

            echo "Cleaned $dir"
        else
            echo "No Claude references found in $dir"
        fi

        cd ..
    fi
done

Dry Run / Preview Mode

To preview what would be changed without modifying anything:

# Clone to a temp directory for testing
git clone --mirror . /tmp/test-cleanup
cd /tmp/test-cleanup

# Run cleanup on the test clone
git-filter-repo --message-callback '...' --force

# Compare before/after
git log --all --oneline | head -20

# Clean up test directory
rm -rf /tmp/test-cleanup

Troubleshooting

"refusing to run on a repo that already has history"

Solution: Use --force flag or start with a fresh clone.

"git-filter-repo: command not found"

Solution: Install git-filter-repo:

brew install git-filter-repo
# or
pip install git-filter-repo

Remote was removed

This is expected behavior. Re-add it:

git remote add origin <your-remote-url>

Team members have old history

After force pushing, team members need to:

git fetch origin
git reset --hard origin/main  # or their branch

Safety Notes

  • Always backup before rewriting history
  • Coordinate force pushes with team members
  • This modifies commit hashes - any external references (issues, PRs) may break
  • Consider using git reflog as emergency recovery within 90 days

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

windsurf

25.33%
按下载量换算2,709

Codex

24.36%
按下载量换算2,605

Claude Code

16.29%
按下载量换算1,742

Antigravity

12.79%
按下载量换算1,368

Gemini CLI

8.31%
按下载量换算889

trae

3.28%
按下载量换算351

安全审计

暂无安全审计结果可展示。

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills