repomix
Skill này làm gì
Skill này đóng gói một dự án mã, cục bộ hoặc trên GitHub, thành một file duy nhất mà AI có thể đọc. Skill dành cho lập trình viên và những người tò mò muốn hiểu nhanh một codebase.
Khi nào nên dùng
- ✓Khi bạn muốn khám phá hoặc hiểu một repository chưa quen.
- ✓Khi bạn cần tìm toàn bộ mã liên quan đến một tính năng, chẳng hạn xác thực.
- ✓Khi bạn muốn biết một dự án sẽ tốn bao nhiêu token.
Liên kết skill
https://github.com/yamadashy/repomix/blob/main/.agents/clawhub/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Hãy đóng gói repository facebook react và cho tôi thấy các component chính và nơi quản lý state.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Agent chạy công cụ Repomix trên thư mục cục bộ hoặc repository GitHub từ xa. Nó tôn trọng các file bỏ qua, kiểm tra vấn đề bảo mật và viết một file đầu ra có cấu trúc để AI đọc.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
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
Câu hỏi thường gặp
Skill có làm việc với repository GitHub không?
Có. Skill có thể đóng gói repository GitHub từ xa cũng như thư mục cục bộ.
Skill có tôn trọng .gitignore không?
Có. Skill tôn trọng .gitignore và chạy kiểm tra bảo mật trên đầu ra.
Đầu ra được lưu ở đâu?
Với repository từ xa, skill lưu vào thư mục tạm để thư mục làm việc của bạn luôn gọn gàng.
Chi tiết
Mô tả gốc của tác giả
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
Độ phổ biến
- Sao GitHub
- 29k
- Vị trí xếp hạng
- #9760
- Giấy phép
- MIT
- Cập nhật
- 1/11/2026
Bình luận
- …
Thêm skill từ kho mã này
agent-carnet
29kGiúp agent của bạn lưu, tìm và sắp xếp ghi chú ngắn qua nhiều phiên. Ghi chú được dùng sẽ làm mới bộ đếm 30 ngày, còn ghi chú không dùng sẽ vào thùng rác.
contextual-commit
29kGiúp agent của bạn viết thông điệp commit git ghi lại vì sao một thay đổi được thực hiện, không chỉ là thay đổi gì, bằng các ghi chú có cấu trúc trong phần thân.
repomix-explorer
29kGiúp agent của bạn khám phá một codebase chưa quen, cục bộ hoặc từ xa, bằng cách đóng gói và đọc kết quả để giải thích cấu trúc và tìm mẫu.
Skill tương tự
diffs
394kGiúp agent của bạn tạo một diff có thể chia sẻ về các chỉnh sửa, dưới dạng liên kết xem hoặc file ảnh, thay vì một bản tóm tắt viết tay.
coding-agent
394kGiúp agent của bạn giao một việc lập trình lớn cho Codex, Claude Code hoặc OpenCode chạy nền, rồi theo dõi tiến độ của nó.
gh-issues
394kGiúp agent của bạn tìm issue trên GitHub, chọn những issue cần xử lý và mở pull request với bản sửa, kể cả theo dõi nhận xét đánh giá.