repomix
できること
このスキルは、ローカルやGitHub上のコードのプロジェクトを、AIが読める1つのファイルにまとめます。開発者や、コードベースを素早く理解したい人向けです。
使う場面
- ✓なじみのないリポジトリを調べたり、理解したりしたいとき。
- ✓認証など、ある機能に関するコードをすべて見つけたいとき。
- ✓プロジェクトがどれくらいのトークンを使うか知りたいとき。
スキルのリンク
https://github.com/yamadashy/repomix/blob/main/.agents/clawhub/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“facebook/reactのリポジトリをまとめて、主なコンポーネントと、状態がどこで管理されているかを示してください。”
毎週5つの新しいスキル。1分で読めます。
仕組み
エージェントは、ローカルのフォルダまたはリモートのGitHubリポジトリに対してRepomixのツールを実行します。無視のファイルを尊重し、セキュリティの問題を確認して、AIが読むための構造化された出力ファイルを書きます。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)をGitHubからそのまま表示しています。
Repomix — Codebase Packer & Analyzer
Pack entire codebases into a single, AI-friendly file for analysis. Repomix intelligently collects repository files, respects .gitignore, runs security checks, and generates structured output optimized for LLM consumption.
When to Use
- "Analyze this repo" / "Explore this codebase"
- "What's the structure of facebook/react?"
- "Find all authentication-related code"
- "How many tokens is this project?"
- "Pack this repo for AI analysis"
- "Show me the main components of vercel/next.js"
Quick Reference
Pack a Remote Repository
npx repomix@latest --remote <owner/repo> --output /tmp/<repo-name>-analysis.xml
Always output to a temporary directory (/tmp on Unix, %TEMP% on Windows) for remote repositories to avoid polluting the user's working directory.
Pack a Local Directory
npx repomix@latest [directory] --output /tmp/<name>-analysis.xml
Key Options
| Option | Description |
|---|---|
--style <format> |
Output format: xml (default, recommended), markdown, plain, json |
--compress |
Tree-sitter compression (~70% token reduction) — use for large repos |
--include <patterns> |
Include only matching patterns (e.g., "src/**/*.ts,**/*.md") |
--ignore <patterns> |
Additional ignore patterns |
--output <path> |
Custom output path (default: repomix-output.xml) |
--remote-branch <name> |
Specific branch, tag, or commit (for remote repos) |
Workflow
Step 1: Pack the Repository
Choose the appropriate command based on the target:
# Remote repository (always output to /tmp)
npx repomix@latest --remote yamadashy/repomix --output /tmp/repomix-analysis.xml
# Large remote repo with compression
npx repomix@latest --remote facebook/react --compress --output /tmp/react-analysis.xml
# Local directory
npx repomix@latest ./src --output /tmp/src-analysis.xml
# Specific file types only
npx repomix@latest --include "**/*.{ts,tsx,js,jsx}" --output /tmp/filtered-analysis.xml
Step 2: Check Command Output
The command displays:
- Files processed: Number of files included
- Total characters: Size of content
- Total tokens: Estimated AI tokens
- Output file location: Where the file was saved
Note the output file location for subsequent analysis.
Step 3: Analyze the Output
Structure overview:
- Search for the file tree section (near the beginning of the output)
- Check the metrics summary for overall statistics
Search for patterns (use the output file path from Step 2):
# Find exports and main entry points
grep -iE "export.*function|export.*class" <output-file>
# Search with context
grep -iE -A 5 -B 5 "authentication|auth" <output-file>
# Find API endpoints
grep -iE "router|route|endpoint|api" <output-file>
# Find database models
grep -iE "model|schema|database|query" <output-file>
Read specific sections using offset/limit for large outputs.
Step 4: Report Findings
- Metrics: Files, tokens, size from command output
- Structure: Directory layout from file tree analysis
- Key findings: Based on pattern search results
- Next steps: Suggestions for deeper exploration
Best Practices
- Use
--compressfor large repos (>100k lines) to reduce token usage by ~70% - Use pattern search first before reading entire output files
- Use a temporary directory for output (
/tmpon Unix,%TEMP%on Windows) to keep the user's workspace clean - Use
--includeto focus on specific parts of a codebase - XML is the default and recommended format — it has clear file boundaries for structured analysis
Output Formats
| Format | Best For |
|---|---|
| XML (default) | Structured analysis, clear file boundaries |
| Markdown | Human-readable documentation |
| Plain | Simple grep-friendly output |
| JSON | Programmatic/machine analysis |
Error Handling
- Command fails: Check error message, verify repository URL/path, check permissions
- Output too large: Use
--compress, narrow scope with--include - Network issues (remote): Verify connection, suggest local clone as alternative
- Pattern not found: Try alternative patterns, check file tree to verify files exist
Security
Repomix automatically excludes potentially sensitive files (API keys, credentials, .env files) through built-in security checks. Trust its security defaults unless the user explicitly requ
よくある質問
GitHubのリポジトリでも使えますか?
はい、ローカルのフォルダだけでなく、リモートのGitHubリポジトリもまとめられます。
.gitignoreは尊重されますか?
はい、.gitignoreを尊重し、出力に対してセキュリティの確認を行います。
出力はどこに保存されますか?
リモートのリポジトリの場合は一時フォルダに保存されるので、作業フォルダはすっきり保たれます。
詳細
作者による元の説明
Pack and analyze codebases into AI-friendly single files using Repomix. Use when the user wants to explore repositories, analyze code structure, find patterns, check token counts, or prepare codebase context for AI analysis. Supports both local directories and remote GitHub repositories.
repo: yamadashy/repomix
人気
- GitHubのスター
- 29k
- ランキング
- #9760
- ライセンス
- MIT
- 更新日
- 2026/11/1
コメント
- …
このリポジトリの他のスキル
agent-carnet
29kエージェントが、セッションをまたいで残る短いメモを保存し、探し、整理できるよう支援します。メモは使われるたびに30日の期限がリセットされ、使われないメモはゴミ箱に移ります。
contextual-commit
29kエージェントが、変更内容だけでなく、その変更をなぜ行ったかを、本文の構造化されたメモで記録するgitのコミットメッセージを書けるよう支援します。
repomix-explorer
29kエージェントが、ローカルでもリモートでも、なじみのないコードベースをまとめて出力を読み、構造を説明しパターンを見つけられるよう支援します。
似ているスキル
diffs
394k編集内容の実際の共有可能な差分を、手書きの要約ではなく、ビューアーのリンクや画像ファイルとして作成するようエージェントを支援します。
coding-agent
394kCodex、Claude Code、OpenCodeに大きめのコーディング作業をバックグラウンドのワーカーとして渡し、その進捗を確認するようエージェントを支援します。
gh-issues
394kGitHubのイシューを探し、取り組むものを選び、修正を含むプルリクエストを開くようエージェントを支援します。レビューコメントへの対応も含みます。