This tutorial covers how to add the [Repomix MCP Server](https://github.com/yamadashy/repomix) as a Goose extension to enable automated repository packing, codebase analysis, architecture summaries, test generation, and code exploration, all while compressing the codebase to minimize token usage and stay within your LLM's context limits.
[Launch the installer](goose://extension?cmd=npx&arg=-y&arg=repomix&arg=--mcp&id=repomix&name=Repomix&description=Pack%20repositories%20into%20AI-friendly%20formats%20for%20Goose)
1. [Launch the installer](goose://extension?cmd=npx&arg=-y&arg=repomix&arg=--mcp&id=repomix&name=Repomix&description=Pack%20repositories%20into%20AI-friendly%20formats%20for%20Goose)
2. Press `Yes` to confirm the installation
3. Click `Save Configuration`
4. Scroll to the top and click `Exit` from the upper left corner
In this example, I’ll show you how to use Goose with the Repomix Extension to analyze the compressed Axios repository. Goose will focus on the `lib/core/Axios.js` file, explain its role in the architecture, spot missing tests, write new unit tests, and suggest improvements to the testing strategy and code maintainability.
By compressing the entire codebase into an AI-friendly format, Repomix helps Goose stay within token limits while providing detailed, file-specific insights.
### Goose Prompt
> Review the file lib/core/Axios.js from the Axios repository and identify any missing unit tests needed to thoroughly cover its core functions and classes. Explain the role this file plays in the overall Axios architecture, how it integrates with other modules, and how well it is currently tested. Write new unit tests to improve coverage, and recommend improvements to the testing strategy or refactoring opportunities to make the code more maintainable.
### Goose Output
:::note CLI
I'll help analyze the Axios.js core file and its testing coverage. Let's break this down into steps:
1. First, let's fetch and examine the Axios repository using repomix
2. Then analyze the specific file and its related tests
3. Finally provide recommendations and new unit tests
Let's start by getting the repository:
--- Pack Remote Repository ---
Now let's read the core Axios.js file and its related test files:
--- Read Repomix Output ---
Based on my analysis of the Axios codebase, I'll provide you with a comprehensive overview of the project structure and create an improved README. Let me break this down into sections:
**Role in Axios Architecture**
The `Axios.js` file is one of the most critical core components of the Axios library. It serves several key purposes:
1. Request Handling: It contains the main `Axios` class that processes and dispatches HTTP requests
2. Configuration Management: Handles merging of default configs with request-specific configs
3. Interceptor Management: Manages request and response interceptors
4. HTTP Method Convenience: Provides convenience methods for different HTTP verbs (get, post, etc.)
The file integrates with other core modules through:
- `InterceptorManager` for handling request/response interceptors
- `dispatchRequest` for making the actual HTTP requests
- `mergeConfig` for configuration processing
- `buildFullPath` for URL resolution
- `AxiosHeaders` for header management
**Current Test Coverage Analysis**
The current test coverage for Axios.js is fairly good but has some gaps. Looking at the test files:
// Interceptor chain building mixed with request logic
// Suggested
class InterceptorChain {
constructor(request, config) {
this.request = request;
this.config = config;
this.chain = [];
}
addRequestInterceptors(interceptors) {
// Add request interceptors
}
addResponseInterceptors(interceptors) {
// Add response interceptors
}
execute() {
// Execute chain
}
}
```
These improvements would make the code more maintainable and easier to test, while also improving error handling and separation of concerns.
The current test coverage is good but could be improved in these specific areas to ensure more robust functionality. The suggested new tests and refactoring opportunities would help catch edge cases and make the code more maintainable.