Communitygithub.com

repo-scan

ブートストラップポインタ。外部のrepo-scanスキルを固定されたレビュー可能なコミットからインストールします。repo-scanを実行する前にインストールが必要な場合に使用します。このECCポインタ自体は監査を実行しません。

repo-scan とは?

repo-scanは、クロススタックのソースコード資産監査を実行するための外部スキルをインストールするブートストラップポインタです。C++、Android、iOS、Webなどの異なるエコシステムにまたがるコードベースを分析し、プロジェクトコード、サードパーティコード、ビルド成果物を自動分類します。50以上の既知ライブラリの検出、ファイルごとの4段階評価(Core Asset / Extract & Merge / Rebuild / Deprecate)、インタラクティブなHTMLレポート生成などの機能を提供します。このスキルは主にClaude CodeなどのAIエージェントプラットフォームで使用され、大規模なレガシーコードベースの構造把握や、monorepo再編成前の依存関係監査に役立ちます。インストール後、エージェントをリロードしてrepo-scanを呼び出すことで本格的なスキャンが開始されます。

対応✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/affaan-m/everything-claude-code/tree/main/skills/repo-scan

お気に入りのAIに質問する

このエージェントスキルを事前に読み込んだ状態で新しいチャットを開きます。

ドキュメント

repo-scan は何をしますか?

各エコシステムには独自の依存関係マネージャーがありますが、C++、Android、iOS、Webを横断して「どの程度のコードが実際にあなたのものか」「何がサードパーティか」「何がデッドウェイトか」を教えてくれるツールはありませんでした。

使用タイミング

  • 大規模なレガシーコードベースを引き継ぎ、構造的な概要が必要な場合
  • 大規模リファクタリングの前 — コア、重複、デッドコードを特定するため
  • ソースコードに直接埋め込まれているサードパーティ依存関係(パッケージマネージャーで宣言されていないもの)を監査する場合
  • monorepo再編成のためのアーキテクチャ決定記録を準備する場合

インストール

# 最初にクローンして、固定コミットをインストール前にレビューできるようにする
set -euo pipefail

REPO_SCAN_COMMIT=2742664ebcad1450c208eda0ae45d3c17fad5dd8
REPO_SCAN_INSTALL_DIR="${CLAUDE_CONFIG_DIR:-$HOME/.claude}/skills/repo-scan"
REPO_SCAN_INSTALL_PARENT="$(dirname "$REPO_SCAN_INSTALL_DIR")"
mkdir -p "$REPO_SCAN_INSTALL_PARENT"
REPO_SCAN_TMP="$(mktemp -d "$REPO_SCAN_INSTALL_PARENT/.repo-scan-install.XXXXXX")"
REPO_SCAN_TOKEN="${REPO_SCAN_TMP##*.}"
REPO_SCAN_STAGE="$REPO_SCAN_TMP/stage-$REPO_SCAN_TOKEN"
REPO_SCAN_BACKUP="$REPO_SCAN_TMP/backup-$REPO_SCAN_TOKEN"
REPO_SCAN_LOCK="$REPO_SCAN_INSTALL_PARENT/.repo-scan-install.lock"
REPO_SCAN_KEEP_TMP=0
REPO_SCAN_LOCK_HELD=0
REPO_SCAN_MV_HAS_NO_TARGET=0
cleanup_repo_scan_install() {
  if [ "$REPO_SCAN_KEEP_TMP" -eq 0 ]; then
    rm -rf -- "$REPO_SCAN_TMP"
  fi
  if [ "$REPO_SCAN_LOCK_HELD" -eq 1 ] && ! rmdir -- "$REPO_SCAN_LOCK"; then
    printf 'Could not release installation lock at %s\n' "$REPO_SCAN_LOCK" >&2
  fi
}
trap cleanup_repo_scan_install EXIT
mkdir "$REPO_SCAN_TMP/mv-probe-source"
if mv -T -- "$REPO_SCAN_TMP/mv-probe-source" \
  "$REPO_SCAN_TMP/mv-probe-destination" 2>/dev/null; then
  REPO_SCAN_MV_HAS_NO_TARGET=1
  rmdir "$REPO_SCAN_TMP/mv-probe-destination"
else
  rmdir "$REPO_SCAN_TMP/mv-probe-source"
fi
move_repo_scan_dir() {
  REPO_SCAN_MOVE_SOURCE=$1
  REPO_SCAN_MOVE_DESTINATION=$2
  REPO_SCAN_MOVE_NAME=${REPO_SCAN_MOVE_SOURCE##*/}
  if [ -e "$REPO_SCAN_MOVE_DESTINATION" ] || [ -L "$REPO_SCAN_MOVE_DESTINATION" ]; then
    return 1
  fi
  if [ "$REPO_SCAN_MV_HAS_NO_TARGET" -eq 1 ]; then
    mv -T -- "$REPO_SCAN_MOVE_SOURCE" "$REPO_SCAN_MOVE_DESTINATION"
    return
  fi
  if ! mv -- "$REPO_SCAN_MOVE_SOURCE" "$REPO_SCAN_MOVE_DESTINATION"; then
    return 1
  fi
  if [ -e "$REPO_SCAN_MOVE_DESTINATION/$REPO_SCAN_MOVE_NAME" ] || \
    [ -L "$REPO_SCAN_MOVE_DESTINATION/$REPO_SCAN_MOVE_NAME" ]; then
    if ! mv -- "$REPO_SCAN_MOVE_DESTINATION/$REPO_SCAN_MOVE_NAME" \
      "$REPO_SCAN_MOVE_SOURCE"; then
      REPO_SCAN_KEEP_TMP=1
      printf 'Move conflict recovery failed; staged data remains at %s\n' \
        "$REPO_SCAN_MOVE_DESTINATION/$REPO_SCAN_MOVE_NAME" >&2
    fi
    return 1
  fi
}

git clone --filter=blob:none --no-checkout \
  https://github.com/haibindev/repo-scan.git "$REPO_SCAN_TMP/source"
git -C "$REPO_SCAN_TMP/source" checkout --detach "$REPO_SCAN_COMMIT"
mkdir -p "$REPO_SCAN_STAGE"
git -C "$REPO_SCAN_TMP/source" archive "$REPO_SCAN_COMMIT" | \
  tar -xf - -C "$REPO_SCAN_STAGE"

# インストールを承認する前に "$REPO_SCAN_TMP/source" をレビューしてください。
printf 'Type install to replace %s after reviewing the pinned source: ' \
  "$REPO_SCAN_INSTALL_DIR" >&2
read -r REPO_SCAN_CONFIRM
if [ "$REPO_SCAN_CONFIRM" != install ]; then
  printf 'Installation cancelled.\n' >&2
  exit 1
fi
if ! mkdir -- "$REPO_SCAN_LOCK" 2>/dev/null; then
  printf 'Another repo-scan installation holds the lock at %s\n' \
    "$REPO_SCAN_LOCK" >&2
  exit 1
fi
REPO_SCAN_LOCK_HELD=1

if [ -e "$REPO_SCAN_INSTALL_DIR" ] || [ -L "$REPO_SCAN_INSTALL_DIR" ]; then
  move_repo_scan_dir "$REPO_SCAN_INSTALL_DIR" "$REPO_SCAN_BACKUP"
fi
if ! move_repo_scan_dir "$REPO_SCAN_STAGE" "$REPO_SCAN_INSTALL_DIR"; then
  if [ -e "$REPO_SCAN_BACKUP" ] || [ -L "$REPO_SCAN_BACKUP" ]; then
    if [ -e "$REPO_SCAN_INSTALL_DIR" ] || [ -L "$REPO_SCAN_INSTALL_DIR" ]; then
      REPO_SCAN_KEEP_TMP=1
      printf 'Replacement failed and target was recreated; previous installation preserved at %s\n' \
        "$REPO_SCAN_BACKUP" >&2
    elif ! move_repo_scan_dir "$REPO_SCAN_BACKUP" "$REPO_SCAN_INSTALL_DIR"; then
      REPO_SCAN_KEEP_TMP=1
      printf 'Replacement and rollback failed; previous installation preserved at %s\n' \
        "$REPO_SCAN_BACKUP" >&2
    fi
  fi
  exit 1
fi

エージェントスキルをインストールする前にソースをレビューしてください。

インストールが完了するのはブートストラップのみです。エージェントハーネスをリロードし、再度 repo-scan を呼び出してください。このECCポインタは外部スキルをインストールしますが、スキャン自体は実行しません。

コア機能

機能説明
クロススタックスキャンC/C++、Java/Android、iOS (OC/Swift)、Web (TS/JS/Vue) を1回のパスで処理
ファイル分類すべてのファイルをプロジェクトコード、サードパーティ、ビルド成果物にタグ付け
ライブラリ検出50以上の既知ライブラリ(FFmpeg、Boost、OpenSSL…)とバージョン抽出
4段階評価コア資産(Core Asset)/抽出&マージ(Extract & Merge)/再構築(Rebuild)/非推奨(Deprecate)
HTMLレポートドリルダウンナビゲーション付きダークテーマのインタラクティブページ
モノレポ対応階層的スキャンとサマリー+サブプロジェクトレポート

分析深度レベル

レベル読み取りファイル数使用例
fastモジュールあたり1-2巨大ディレクトリのクイックインベントリ
standardモジュールあたり2-5依存関係+アーキテクチャチェックを含むデフォルト監査
deepモジュールあたり5-10スレッド安全性、メモリ管理、API一貫性を追加
full全ファイルマージ前の包括的レビュー

動作の仕組み

  1. リポジトリ表面を分類: ファイルを列挙し、それぞれをプロジェクトコード、埋め込みサードパーティコード、ビルド成果物としてタグ付けします。
  2. 埋め込みライブラリを検出: ディレクトリ名、ヘッダー、ライセンスファイル、バージョンマーカーを検査し、バンドルされた依存関係と推定バージョンを特定します。
  3. 各モジュールをスコアリング: ファイルをモジュールまたはサブシステムごとにグループ化し、所有権、重複、メンテナンスコストに基づいて4つの評価のいずれかを割り当てます。
  4. 構造的リスクを強調: デッドウェイトの成果物、重複したラッパー、古いベンダーコード、抽出・再構築・非推奨すべきモジュールを指摘します。
  5. レポートを生成: 簡潔なサマリーと、モジュールごとのドリルダウンが可能なインタラクティブHTML出力を返し、非同期で監査をレビューできるようにします。

例

50,000ファイルのC++モノレポでの実績:

  • 本番環境で今も使用されているFFmpeg 2.x(2015年製)を発見
  • 同一のSDKラッパーが3回重複しているのを発見
  • 636 MBのコミットされたDebug/ipch/objビルド成果物を特定
  • 分類結果: 3 MBのプロジェクトコード 対 596 MBのサードパーティコード

ベストプラクティス

  • 初回監査は standard 深度から開始する
  • 100以上のモジュールがあるモノレポでは fast を使用してクイックインベントリを取得する
  • リファクタリング対象としてフラグが立てられたモジュールに対しては deep を段階的に実行する
  • サブプロジェクト間の重複検出のためにクロスモジュール分析をレビューする

リンク

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

accessibility

Design, implement, and audit inclusive digital products using WCAG 2.2 Level AA. Use when building or auditing UI that must meet WCAG 2.2 Level AA, or when reviewing a change for keyboard, contrast, or screen-reader support.

affaan-m/claude-api

Anthropic Claude API patterns for Python and TypeScript. Covers Messages API, streaming, tool use, vision, extended thinking, batches, prompt caching, and Claude Agent SDK. Use when building applications with the Claude API or Anthropic SDKs.

affaan-m/everything-claude-code

End-to-end marketing campaign planning and execution. Covers audience research, positioning, campaign angle definition, landing page copy, email sequences, social posts, ad copy, short-form video scripts, and content calendars. Use as the orchestration layer for multi-channel product launches. Use when planning or executing a multi-channel product launch, or producing landing page, email, social, or ad copy.

affaan-m/everything-claude-code

Development conventions and patterns for everything-claude-code. JavaScript project with conventional commits.

affaan-m/everything-claude-code-conventions

Development conventions and patterns for everything-claude-code. JavaScript project with conventional commits.

affaan-m/frontend-design

Create distinctive, production-grade frontend interfaces with high design quality. Use when the user asks to build web components, pages, or applications and the visual direction matters as much as the code quality.

affaan-m/gget

gget CLI and Python workflow for quick genomic database queries, sequence lookup, BLAST-style searches, enrichment checks, and reproducible bioinformatics evidence logs.

affaan-m/literature-review

Systematic literature-review workflow for academic, biomedical, technical, and scientific topics, including search planning, source screening, synthesis, citation checks, and evidence logging.

affaan-m/motion-ui

Production-ready UI motion system for React/Next.js. Use when implementing animations, transitions, or motion patterns.

affaan-m/project-guidelines-example

Example project-specific skill template based on a real production application.

affaan-m/pubmed-database

Direct PubMed and NCBI E-utilities search workflows for biomedical literature, MeSH queries, PMID lookup, citation retrieval, and API-backed literature monitoring.

affaan-m/scholar-evaluation

Structured scholarly-work evaluation for papers, proposals, literature reviews, methods sections, evidence quality, citation support, and research-writing feedback.

affaan-m/uspto-database

USPTO patent and trademark data workflow for official record lookup, PatentSearch queries, TSDR checks, assignment data, and reproducible IP research logs.

agent-architecture-audit

Full-stack diagnostic for agent and LLM applications. Audits the 12-layer agent stack for wrapper regression, memory pollution, tool discipline failures, hidden repair loops, and rendering corruption. Produces severity-ranked findings with code-first fixes. Essential for developers building agent applications, autonomous loops, or any LLM-powered feature. Use when an agent or LLM feature misbehaves and the failing layer is unknown, or before shipping an agent stack.

agent-eval

Head-to-head comparison of coding agents (Claude Code, Aider, Codex, etc.) on custom tasks with pass rate, cost, time, and consistency metrics. Use when choosing between coding agents, or when a change to an agent setup needs measured pass rate, cost, and time rather than an impression.

agent-harness-construction

Design and optimize AI agent action spaces, tool definitions, and observation formatting for higher completion rates. Use when defining or revising an agent

agentic-engineering

Operate as an agentic engineer using eval-first execution, decomposition, and cost-aware model routing. Use when planning or executing engineering work that agents will carry out end to end.

agentic-os

Build persistent multi-agent operating systems on Claude Code. Covers kernel architecture, specialist agents, slash commands, file-based memory, scheduled automation, and state management without external databases. Use when building a persistent multi-agent system on Claude Code with its own memory, commands, and scheduling.

agent-introspection-debugging

Structured self-debugging workflow for AI agent failures using capture, diagnosis, contained recovery, and introspection reports. Use when an agent run fails and you need a reproducible diagnosis instead of a retry.

agent-payment-x402

Add x402 payment execution to AI agents with per-task budgets, spending controls, and non-custodial wallets. Supports Base through agentwallet-sdk and X Layer through OKX Payments / OKX Agent Payments Protocol. Use when an agent must pay for something itself and needs per-task budgets, spending controls, and a non-custodial wallet.

関連スキル