Communitygithub.com

repo-scan

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

repo-scan とは?

このスキルは、外部リポジトリ「repo-scan」を固定されたコミットハッシュから安全にインストールするためのブートストラップポインターです。repo-scanは、C++、Android(Java/Kotlin)、iOS(Objective-C/Swift)、Web(TypeScript/JavaScript/Vue)など、複数のスタックを横断してソースコードアセットを一括でスキャンし、プロジェクトコード、サードパーティコード、ビルドアーティファクトを自動分類します。50以上の既知ライブラリ(FFmpeg、Boost、OpenSSLなど)をバージョン付きで検出し、各モジュールに対して「コアアセット」「抽出&マージ」「再構築」「非推奨」の4段階の判定を提供します。結果はインタラクティブなHTMLレポートとして出力され、モノレポ構成にも対応した階層的なスキャンが可能です。インストール時にはソースコードをレビューしてから実行することを促すため、セキュリティと信頼性が確保されています。

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

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

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

ドキュメント

repo-scan は何をしますか?

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

使用するタイミング

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

インストール

# まずクローンして、固定されたコミットをインストール前にレビューできるようにする
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 'インストールロック %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 '移動の競合からの回復に失敗しました。ステージングデータは %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 '固定されたソースをレビューした後、%s を置き換えるには install と入力してください: ' \
  "$REPO_SCAN_INSTALL_DIR" >&2
read -r REPO_SCAN_CONFIRM
if [ "$REPO_SCAN_CONFIRM" != install ]; then
  printf 'インストールがキャンセルされました。\n' >&2
  exit 1
fi
if ! mkdir -- "$REPO_SCAN_LOCK" 2>/dev/null; then
  printf '別のrepo-scanインストールがロック %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 '置き換えに失敗し、ターゲットが再作成されました。以前のインストールは %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 '置き換えとロールバックに失敗しました。以前のインストールは %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段階判定コアアセット / 抽出&マージ / 再構築 / 非推奨
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のプロジェクトコード vs 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/content-engine

Create platform-native content systems for X, LinkedIn, TikTok, YouTube, newsletters, and repurposed multi-platform campaigns. Use when the user wants social posts, threads, scripts, content calendars, or one source asset adapted cleanly across platforms.

affaan-m/ECC

Multi-platform content distribution across X, LinkedIn, Threads, and Bluesky. Adapts content per platform using content-engine patterns. Never posts identical content cross-platform. Use when the user wants to distribute content across social platforms.

affaan-m/fal-ai-media

Unified media generation via fal.ai MCP — image, video, and audio. Covers text-to-image (Nano Banana), text/image-to-video (Seedance, Kling, Veo 3), text-to-speech (CSM-1B), and video-to-audio (ThinkSound). Use when the user wants to generate images, videos, or audio with AI.

affaan-m/manim-video

日本語翻訳:このファイルは manim-video 用の日本語翻訳が必要です

affaan-m/remotion-video-creation

Remotion のベストプラクティス - React で動画を作成する。3D、アニメーション、音声、字幕、チャート、トランジションなどをカバーするドメイン固有の29のルール。

affaan-m/video-editing

AI-assisted video editing workflows for cutting, structuring, and augmenting real footage. Covers the full pipeline from raw capture through FFmpeg, Remotion, ElevenLabs, fal.ai, and final polish in Descript or CapCut. Use when the user wants to edit video, cut footage, create vlogs, or build video content.

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.

agent-self-evaluation

Use after completing any non-trivial task. The agent self-rates its output on 5 axes — accuracy, completeness, clarity, actionability, conciseness — with concrete evidence per criterion. Produces a structured 1-5 scorecard with specific improvement suggestions.

agent-sort

Build an evidence-backed ECC install plan for a specific repo by sorting skills, commands, rules, hooks, and extras into DAILY vs LIBRARY buckets using parallel repo-aware review passes. Use when ECC should be trimmed to what a project actually needs instead of loading the full bundle.

ai-first-engineering

Engineering operating model for teams where AI agents generate a large share of implementation output. Use when setting team process, review gates, or ownership rules for a codebase largely written by agents.

ai-regression-testing

Regression testing strategies for AI-assisted development. Sandbox-mode API testing without database dependencies, automated bug-check workflows, and patterns to catch AI blind spots where the same model writes and reviews code. Use when adding regression coverage to AI-assisted code, or when the same model both wrote and reviewed a change.

android-clean-architecture

Clean Architecture patterns for Android and Kotlin Multiplatform projects — module structure, dependency rules, UseCases, Repositories, and data layer patterns. Use when structuring modules, layers, or data flow in an Android or KMP project.

angular-developer

Generates Angular code and provides architectural guidance. Trigger when creating projects, components, or services, or for best practices on reactivity (signals, linkedSignal, resource), forms, dependency injection, routing, SSR, accessibility (ARIA), animations, styling (component styles, Tailwind CSS), testing, or CLI tooling.

関連スキル