- outputGenerate: tests titled "throws RepomixError…" / "wraps … in
RepomixError" now assert the rejection is an instance of RepomixError
in addition to the message regex, matching the test names.
- LanguageParser: collapse the duplicate getParserForLang('javascript')
rejection assertions into a single .catch capture that checks both
type and message.
- calculateMetrics: vi.mocked(initTaskRunner).mockReset() before
mockReturnValueOnce so a future test that omits taskRunner can't
silently consume the override.
- packager: pre-attach a no-op .catch on the rejected warmupPromise so
vitest's unhandled-rejection detection doesn't fire before pack
awaits it. Production code mirrors this pattern in packager.ts:262.
The @xmldom/xmldom upgrade removed the errorHandler option and changed
documentElement to be nullable. Switch to the new onError callback and
add null checks so the test suite compiles and runs against the new API.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
When includeEmptyDirectories is enabled, buildOutputGeneratorContext
called searchFiles a second time just to obtain emptyDirPaths, despite
these already being computed during the initial file search in packager.
Changes:
- Capture emptyDirPaths from the initial searchFiles result in packager
and thread them through the pipeline (packager → produceOutput →
generateOutput/outputSplit → buildOutputGeneratorContext)
- Guard emptyDirPaths processing with includeEmptyDirectories check to
skip unnecessary work when the feature is disabled
- Fix split output path which was not receiving emptyDirPaths despite
the parameter being declared in produceOutput's signature
- Add tests for cache hit (searchFiles not called) and fallback paths
Local benchmark (repomix on itself, includeEmptyDirectories: true):
main: 696.6ms ± 4.2ms
branch: 637.1ms ± 2.6ms
Improvement: ~60ms (~8.5%)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Use a strict error handler for @xmldom/xmldom's DOMParser that throws on
all severity levels (warning, error, fatalError). By default, xmldom
silently continues parsing malformed XML, which could mask XMLBuilder
regressions. This ensures tests fail immediately on any XML well-formedness
issue.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
fast-xml-parser has accumulated 10 CVEs (6 in 2026 alone), with a recurring
pattern of incomplete fixes in its DOCTYPE/entity parser. Since Repomix only
uses the XMLBuilder functionality (not the parser), switching to
fast-xml-builder — the standalone builder package that fast-xml-parser v5
internally delegates to — eliminates 9/10 parser-side CVE noise while
maintaining identical behavior.
- Replace fast-xml-parser (831KB) with fast-xml-builder (176KB) as dependency
- Add @xmldom/xmldom as devDependency for XML validation in tests
- Update import in outputGenerate.ts (named → default export)
- Migrate test XML parsing from fast-xml-parser's XMLParser to @xmldom/xmldom's
DOMParser, providing cross-implementation validation of generated XML
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Remove unused imports (generateFileTree, treeToString) in fileTreeGenerate.test.ts
- Add filePathsByRoot parameter to generateOutput and produceOutput calls in tests
- Update expect assertions to include filePathsByRoot argument
When packing multiple directories, the directory tree output now shows
labeled sections like [cli]/, [config]/ to clarify which files belong
to which root directory.
- Add FilesByRoot interface and generateTreeStringWithRoots function
- Update output pipeline to pass file-to-root mapping
- Add unit tests for new tree generation functions
- Update existing tests for new function signatures
Closes#1023
Add test coverage for edge cases as suggested by CodeRabbit:
- Empty string input
- Paths with leading separators (/absolute/path.ts)
- Single separator (/)
Add comprehensive tests for generateSplitOutputParts:
- Test successful splitting into multiple parts when content exceeds limit
- Test git diff/log is only included in first part
Also optimize byteLength recalculation by tracking currentBytes variable
to avoid redundant getUtf8ByteLength() calls.
Add module-level caching for git operations to avoid repeated expensive
git commands during split output generation. This significantly improves
performance when generateOutput is called multiple times (O(N²) in split
output mode).
- Add fileChangeCountsCache for git log results (~133ms savings per call)
- Add gitAvailabilityCache for git installation/folder checks (~65ms savings)
- Extract sortFilesByChangeCounts helper function
- Add test for cache behavior verification
Adds a size-based output splitter via --split-output (kb/mb) and writes numbered parts without splitting within a top-level folder.
Also updates metrics aggregation for multi-part output and adds unit tests.
Reorganize skill generation code for better domain separation:
- Move files from core/output/skill/ to core/skill/ (5 files)
- Move writeSkillOutput.ts from core/packager/ to core/skill/
- Create packSkill.ts to encapsulate skill generation logic
- Simplify packager.ts by delegating skill generation to packSkill()
- Add re-exports in outputGenerate.ts for backward compatibility
This change improves code organization by:
- Separating skill domain from output domain
- Reducing packager.ts complexity
- Centralizing all skill-related code in one location
Remove generateGitDiffsSection and generateGitLogsSection functions
and their tests as they are no longer used in the skill generation flow.
These became dead code after removing git diffs/logs from skill output.
- Show all dependencies without truncation (removed 20/10 limits)
- Add runtime version detection (.node-version, .nvmrc, .tool-versions, etc.)
- Add configuration files section to tech-stack.md
- Move statistics section from SKILL.md to summary.md
- Update summary.md to use multi-file format language
- Increase largest files display from 5 to 10
- Improve generate_skill MCP tool description with skill types and paths
Add new features to improve skill output for understanding codebases:
- Add tech-stack.md: Auto-detect languages, frameworks, and dependencies
from package.json, requirements.txt, go.mod, Cargo.toml, etc.
- Add file statistics section to SKILL.md with language breakdown
and largest files list
- Rename structure.md to project-structure.md for clarity
- Add total lines count to SKILL.md header
Add Overview, Common Use Cases, and Tips sections to make the template
more actionable and instantly understandable. Remove redundant File Format
section (delegated to summary.md).
Changes:
- Add Overview section explaining when to use this skill
- Add Common Use Cases with concrete scenarios (understand feature, debug, find usages)
- Add Tips section for effective usage
- Remove File Format section to reduce redundancy
Restructure SKILL.md to be more practical and scannable:
- Add reference files table with descriptions
- Include Quick Reference section with concrete examples
- Show exact grep patterns for finding files
- Display file format examples for understanding structure
- Move statistics inline with header for brevity
Skill output is designed for referencing external codebases (e.g., GitHub
repositories) as persistent skills. Git diffs (uncommitted changes) and
git logs (commit history) are not meaningful in this context since:
- Remote repositories have no uncommitted changes
- Commit history is less relevant for reference skills
This simplifies the skill output to include only:
- SKILL.md
- references/summary.md
- references/structure.md
- references/files.md
Display the number of lines next to each file in the directory
structure section of skill output. This helps when using grep
to find specific files by line count.
Example:
src/
index.ts (42 lines)
utils.ts (128 lines)
Refactor and improve the skill generation feature based on code review:
- Split generateSkillOutput into generateSkillReferences and
generateSkillMdFromReferences to avoid double generation
- Add try-catch error handling to writeSkillOutput with proper
permission error messages
- Add unit tests for skillSectionGenerators (12 tests)
- Add validation tests for --skill-generate flag combinations
- Update createMockConfig to support skillGenerate and remoteUrl
Improve the Claude Agent Skills generation feature:
- Rename CLI option from --generate-skill to --skill-generate [name]
- Make skill name optional with auto-generation (repomix-reference-<folder>)
- Split skill output into multiple reference files:
- summary.md: Purpose, format description, and notes
- structure.md: Directory tree view
- files.md: Complete file contents
- git-diffs.md: Uncommitted changes (optional)
- git-logs.md: Recent commit history (optional)
- Move skill-related code to src/core/output/skill/ folder
- Extract shared language mapping to outputStyleUtils.ts
- Add 100+ language mappings for syntax highlighting
Implement Claude Agent Skills format output support for Repomix.
This feature was requested in issue #952 to enable seamless integration
with Claude Code's skill system.
New CLI option:
repomix --generate-skill <name>
Output structure:
.claude/skills/<name>/
├── SKILL.md # Entry point with YAML frontmatter
└── references/
└── codebase.md # Packed codebase in Markdown format
Features:
- Skill name auto-converts to kebab-case (max 64 chars)
- SKILL.md includes usage guidance for reading the codebase
- Incompatible with --stdout and --copy options
- MCP tool `generate_skill` for programmatic access
New files:
- src/core/output/skillUtils.ts
- src/core/output/outputStyles/skillStyle.ts
- src/core/packager/writeSkillOutput.ts
- src/mcp/tools/generateSkillTool.ts
Closes#952
Updated documentation for all supported languages to include:
- ignore.useDotIgnore configuration option
- --no-dot-ignore CLI flag
- .ignore file explanation and priority order
- Benefits of using .ignore file with ripgrep and ag tools
Also updated test files to include useDotIgnore in mock configs
to satisfy TypeScript type checking after adding the new
configuration option.
Languages updated:
- zh-cn (Simplified Chinese)
- zh-tw (Traditional Chinese)
- ko (Korean)
- vi (Vietnamese)
- id (Indonesian)
- hi (Hindi)
- fr (French)
- de (German)
- es (Spanish)
- pt-br (Brazilian Portuguese)
When --include-full-directory-structure flag is enabled, the tree now
displays all files in the repository (subject to ignore patterns), not
just files matching include patterns. This provides a more complete
view of the repository structure.
Changes:
- Add listFiles() function to scan all repository files
- Merge additional files into tree visualization
- Update tests to verify root-level files appear in tree
- Bump Biome schema to 2.2.6
- Improve Secretlint TypeScript type declarations
Updated biome from v1.9.4 to v2.2.4 to take advantage of latest linting improvements.
- Upgraded @biomejs/biome from ^1.9.4 to ^2.2.4
- Updated biome.json configuration for v2 compatibility:
- Changed schema to 2.2.4
- Updated file includes/ignores syntax
- Added Vue file overrides to disable noUnusedVariables/noUnusedImports
- Fixed all lint errors:
- Added radix parameter to parseInt calls
- Prefixed unused parameters with underscore
- Removed unused imports
- Fixed biome suppression comments
- Removed !important from CSS
- Added type ignores for Vue component definitions
All 325 files now pass lint with 0 warnings and 0 errors.
Add comprehensive JSON output style with camelCase naming convention:
- JSON output generates machine-readable format using JSON.stringify()
- Always uses parsable style for valid JSON structure
- Parameter names follow camelCase convention (fileSummary, userProvidedHeader, etc.)
- Includes CLI option, config schema, and interactive prompt support
- Comprehensive test coverage for unit and integration tests
- Error handling with clear unsupported style messages
This enables easier programmatic consumption of Repomix output for AI systems and automated tools.
This feature allows users to include git log information in the output to help AI understand development patterns and file change relationships.
Key changes:
- Added --include-logs and --include-logs-count CLI options
- Default to 50 commits, configurable via CLI and config file
- Includes commit date, message, and changed file paths (excludes commit hashes)
- Added security checks and metrics calculation for git logs
- Updated output templates to include git logs section
- Comprehensive test coverage and TypeScript fixes
Resolves user request for including git commit history to provide development context for AI analysis.
When output size exceeds JavaScript string limit, now displays the top 5 largest files with their sizes to help users identify which files to exclude. This makes it easier to decide which --ignore patterns to use.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Update generateSummaryPurpose function to accept RepomixConfigMerged
parameter
- Add logic to differentiate between entire codebase vs subset in
purpose description
- Update function call in outputGenerate.ts to pass config parameter
- Add comprehensive tests for both entire codebase and subset scenarios
Previously, the summary purpose section always claimed the file
contained "the entire repository's contents", even when repomix was
configured to process only a subset of files (e.g., with include
patterns). This created inconsistency with other parts of the output
that correctly indicated when only a subset was processed.
This change ensures the purpose section accurately describes the content
as either "the entire repository's contents" or "a subset of the
repository's contents that is considered the most important context"
based on the actual file selection configuration.
- Updated CLI options to use `--include-diffs` instead of `--diffs`.
- Refactored `printSummary` to accept a `PackResult` object for better data handling.
- Introduced `getStagedDiff` function to retrieve staged changes from git.
- Created `getGitDiffs` function to encapsulate logic for fetching both worktree and staged diffs.
- Modified output generation functions to include git diffs in various formats (markdown, XML, plain text).
- Updated tests to reflect changes in CLI options and output generation logic, ensuring proper handling of git diffs.
- Removed deprecated `diffContent` from config schema and adjusted related logic.