repomix
Repository packaging for AI/LLM analysis. Capabilities: pack repos into single files, generate AI-friendly context, codebase snapshots, security audit prep, filter/exclude patterns, token counting, multiple output formats. Actions: pack, generate, export, analyze repositories for LLMs. Keywords: Repomix, repository packaging, LLM context, AI analysis, codebase snapshot, Claude context, ChatGPT context, Gemini context, code packaging, token count, file filtering, security audit, third-party library analysis, context window, single file output. Use when: packaging codebases for AI, generating LLM context, creating codebase snapshots, analyzing third-party libraries, preparing security audits, feeding repos to Claude/ChatGPT/Gemini.
What this skill does
# Repomix Skill
Repomix is a powerful tool that packs entire repositories into single, AI-friendly files. Perfect for when you need to feed codebases to Large Language Models (LLMs) or other AI tools like Claude, ChatGPT, and Gemini.
## When to Use This Skill
Use this skill when:
- User needs to package a codebase for AI analysis
- Preparing repository context for LLM consumption
- Generating codebase snapshots for documentation
- Analyzing third-party libraries or repositories
- Creating AI-friendly representations of code projects
- Investigating bugs across large codebases
- Performing security audits on repositories
- Generating context for implementation planning
## Core Capabilities
### 1. Repository Packaging
Repomix packages entire repositories into single files with:
- AI-optimized formatting with clear separators
- Multiple output formats (XML, Markdown, JSON, Plain text)
- Git-aware processing (respects .gitignore)
- Token counting for LLM context management
- Security checks for sensitive information
### 2. Remote Repository Support
Can process remote repositories without cloning:
- Shorthand: `npx repomix --remote yamadashy/repomix`
- Full URL: `npx repomix --remote https://github.com/owner/repo`
- Specific commits: `npx repomix --remote https://github.com/owner/repo/commit/hash`
### 3. Comment Removal
Strips comments from supported languages when needed:
- Supported: HTML, CSS, JavaScript, TypeScript, Vue, Svelte, Python, PHP, Ruby, C, C#, Java, Go, Rust, Swift, Kotlin, Dart, Shell, YAML
- Enable with: `--remove-comments` or config file
## Installation
Check if installed first:
```bash
repomix --version
```
Install using preferred method:
```bash
# npm
npm install -g repomix
# yarn
yarn global add repomix
# bun
bun add -g repomix
# Homebrew (macOS/Linux)
brew install repomix
```
## Basic Usage
### Package Current Directory
```bash
# Basic packaging (generates repomix-output.xml)
repomix
# Specify output format
repomix --style markdown
repomix --style json
repomix --style plain
# Custom output path
repomix -o custom-output.xml
```
### Package Specific Directory
```bash
repomix /path/to/directory
```
### Package Remote Repository
```bash
# Shorthand format
npx repomix --remote owner/repo
# Full URL
npx repomix --remote https://github.com/owner/repo
# Specific commit
npx repomix --remote https://github.com/owner/repo/commit/abc123
```
## Command Line Options
### File Selection
```bash
# Include specific patterns
repomix --include "src/**/*.ts,*.md"
# Ignore additional patterns
repomix -i "tests/**,*.test.js"
# Disable .gitignore rules
repomix --no-gitignore
# Disable default ignore patterns
repomix --no-default-patterns
```
### Output Configuration
```bash
# Output format
repomix --style markdown # or xml, json, plain
# Output file path
repomix -o output.md
# Remove comments
repomix --remove-comments
# Show line numbers
repomix --no-line-numbers # disable line numbers
```
### Security & Analysis
```bash
# Run security checks
repomix --no-security-check # disable security scanning
# Copy to clipboard
repomix --copy # copy output to clipboard
# Verbose output
repomix --verbose
```
### Configuration
```bash
# Use custom config file
repomix -c custom-config.json
# Initialize new config
repomix --init # creates repomix.config.json
```
## Configuration File
Create `repomix.config.json` in project root:
```json
{
"output": {
"filePath": "repomix-output.xml",
"style": "xml",
"removeComments": false,
"showLineNumbers": true,
"copyToClipboard": false
},
"include": ["**/*"],
"ignore": {
"useGitignore": true,
"useDefaultPatterns": true,
"customPatterns": [
"additional-folder",
"**/*.log",
"**/tmp/**"
]
},
"security": {
"enableSecurityCheck": true
}
}
```
## Ignore Patterns
### .repomixignore File
Create `.repomixignore` for Repomix-specific ignore patterns (same format as .gitignore):
```
# Build artifacts
dist/
build/
*.min.js
# Test files
**/*.test.ts
**/*.spec.ts
coverage/
# Large files
*.mp4
*.zip
# Sensitive files
.env*
secrets/
```
### Precedence Order
1. CLI ignore patterns (`-i` flag)
2. `.repomixignore` file
3. Custom patterns in config file
4. `.gitignore` file (if enabled)
5. Default patterns (if enabled)
## Output Formats
### XML Format (Default)
Best for structured AI consumption:
```bash
repomix --style xml
```
### Markdown Format
Human-readable with syntax highlighting:
```bash
repomix --style markdown
```
### JSON Format
For programmatic processing:
```bash
repomix --style json
```
### Plain Text
Simple concatenation:
```bash
repomix --style plain
```
## Use Cases & Examples
### 1. Code Review Preparation
```bash
# Package feature branch for AI review
repomix --include "src/**/*.ts" --remove-comments -o feature-review.md --style markdown
```
### 2. Security Audit
```bash
# Package third-party library for analysis
npx repomix --remote vendor/library --style xml -o audit.xml
```
### 3. Documentation Generation
```bash
# Package with docs and code
repomix --include "src/**,docs/**,*.md" --style markdown -o context.md
```
### 4. Bug Investigation
```bash
# Package specific modules
repomix --include "src/auth/**,src/api/**" -o debug-context.xml
```
### 5. Implementation Planning
```bash
# Full codebase context for planning
repomix --remove-comments --copy
```
## Token Management
Repomix automatically counts tokens for:
- Individual files
- Total repository
- Per-format output
Use token counts to manage LLM context limits:
- Claude: ~200K tokens
- GPT-4: ~128K tokens
- GPT-3.5: ~16K tokens
## Security Considerations
### Sensitive Data Detection
Repomix uses Secretlint to detect:
- API keys and tokens
- Passwords and credentials
- Private keys
- AWS secrets
- Database connection strings
Disable if needed:
```bash
repomix --no-security-check
```
### Best Practices
1. Always review output before sharing
2. Use `.repomixignore` for sensitive files
3. Enable security checks for unknown codebases
4. Avoid packaging `.env` files
5. Check for hardcoded credentials
## Performance Optimization
### Large Repositories
Repomix uses worker threads for parallel processing:
- Efficiently handles large codebases
- Example: facebook/react processed 29x faster (123s → 4s)
### Optimization Tips
```bash
# Exclude unnecessary files
repomix -i "node_modules/**,dist/**,*.min.js"
# Process specific directories only
repomix --include "src/**/*.ts"
# Disable line numbers for smaller output
repomix --no-line-numbers
```
## Workflow Integration
### With Claude Code
```bash
# Package and analyze in one workflow
repomix --style markdown --copy
# Then paste into Claude for analysis
```
### With CI/CD
```bash
# Generate codebase snapshot for releases
repomix --style markdown -o release-snapshot.md
```
### With Git Hooks
```bash
# Pre-commit hook to generate context
repomix --include "src/**" -o .context/latest.xml
```
## Common Patterns
### Full Repository Package
```bash
repomix --remove-comments --style markdown -o full-repo.md
```
### Source Code Only
```bash
repomix --include "src/**/*.{ts,tsx,js,jsx}" -i "**/*.test.*"
```
### Documentation Bundle
```bash
repomix --include "**/*.md,docs/**" --style markdown
```
### TypeScript Project
```bash
repomix --include "**/*.ts,**/*.tsx" --remove-comments --no-line-numbers
```
### Remote Analysis
```bash
npx repomix --remote owner/repo --style xml -o analysis.xml
```
## Troubleshooting
### Issue: Output Too Large
```bash
# Exclude unnecessary files
repomix -i "node_modules/**,dist/**,coverage/**"
# Process specific directories
repomix --include "src/**"
```
### Issue: Missing Files
```bash
# Disable .gitignore rules
repomix --no-gitignore
# Check ignore patterns
cat .repomixignore
```
### Issue: Sensitive Data Warnings
```bash
# Review flagged files
# Add to .repomixignore
# Or disable checks: --no-security-check
```
## Implementation Workflow
When user requests repoRelated in AI Agents
skill-development
IncludedComprehensive meta-skill for creating, managing, validating, auditing, and distributing Claude Code skills and slash commands (unified in v2.1.3+). Provides skill templates, creation workflows, validation patterns, audit checklists, naming conventions, YAML frontmatter guidance, progressive disclosure examples, and best practices lookup. Use when creating new skills, validating existing skills, auditing skill quality, understanding skill architecture, needing skill templates, learning about YAML frontmatter requirements, progressive disclosure patterns, tool restrictions (allowed-tools), skill composition, skill naming conventions, troubleshooting skill activation issues, creating custom slash commands, configuring command frontmatter, using command arguments ($ARGUMENTS, $1, $2), bash execution in commands, file references in commands, command namespacing, plugin commands, MCP slash commands, Skill tool configuration, or deciding between skills vs slash commands. Delegates to docs-management skill for official documentation.
reprompter
IncludedTransform messy prompts into well-structured, effective prompts — single or multi-agent. Use when: "reprompt", "reprompt this", "clean up this prompt", "structure my prompt", rough text needing XML tags and best practices, "reprompter teams", "repromptception", "run with quality", "smart run", "smart agents", multi-agent tasks, audits, parallel work, anything going to agent teams. Don't use when: simple Q&A, pure chat, immediate execution-only tasks. See "Don't Use When" section for details. Outputs: Structured XML/Markdown prompt, quality score (before/after), optional team brief + per-agent sub-prompts, agent team output files. Success criteria: Single mode quality score ≥ 7/10; Repromptception per-agent prompt quality score 8+/10; all required sections present, actionable and specific.
adaptive-compaction
IncludedAdaptive add-on policy and recovery layer that decides WHEN to compact, prune, snapshot, or fork -- replacing fixed-percent auto-compaction across Claude Code, Codex, and MCP-capable hosts. Trigger on auto-compact timing or damage: "when should I compact", "is it safe to compact now or start a fresh session", "auto-compact fires too early/mid-task", "switching to an unrelated task but the window still has space", "context rot", "answers get worse the longer the session runs", "the agent forgot the plan or my decisions after it summarized", "add a layer on top that manages context without changing the agent", raising autoCompactWindow to give the policy room, or installing/tuning a cross-tool compaction policy or PreCompact hook -- even when "compaction" is never said but the problem is context-window pressure or post-summarization memory loss. Do NOT use to summarize a conversation, build RAG, write a summarization prompt (decides WHEN not HOW), or answer max-context-length trivia.
agent-skill-creator
IncludedCreate cross-platform agent skills from workflow descriptions. Activates when users ask to create an agent, automate a repetitive workflow, create a custom skill, or need advanced agent creation. Triggers on phrases like create agent for, automate workflow, create skill for, every day I have to, daily I need to, turn process into agent, need to automate, create a cross-platform skill, validate this skill, export this skill, migrate this skill. Supports single skills, multi-agent suites, transcript processing, template-based creation, interactive configuration, cross-platform export, and spec validation.
llm-wiki
IncludedUse when building or maintaining a persistent personal knowledge base (second brain) in Obsidian where an LLM incrementally ingests sources, updates entity/concept pages, maintains cross-references, and keeps a synthesis current. Triggers include "second brain", "Obsidian wiki", "personal knowledge management", "ingest this paper/article/book", "build a research wiki", "compound knowledge", "Memex", or whenever the user wants knowledge to accumulate across sessions instead of being re-derived by RAG on every query.
skill-master
IncludedAgent Skills authoring, evaluation, and optimization. Create, edit, validate, benchmark, and improve skills following the agentskills.io specification. Use when designing SKILL.md files, structuring skill folders (references, scripts, assets), ingesting external documentation into skills, running trigger evals, benchmarking skill quality, optimizing descriptions, or performing blind A/B comparisons. Keywords: agentskills.io, SKILL.md, skill authoring, eval, benchmark, trigger optimization.