-
-
Notifications
You must be signed in to change notification settings - Fork 268
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(config): Add support for project instruction file
- Loading branch information
Showing
8 changed files
with
148 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# Repopack Project Instructions | ||
|
||
## Project Overview | ||
Repopack is a tool designed to pack an entire repository into a single, AI-friendly file. It's primarily used to prepare codebases for analysis by Large Language Models (LLMs) such as Claude, ChatGPT, and Gemini. | ||
|
||
## Key Design Principles | ||
1. **Simplicity**: The tool should be easy to use with minimal configuration. | ||
2. **Flexibility**: Users should be able to customize what's included or excluded in the output. | ||
3. **Security**: The tool should help prevent sensitive information from being accidentally included. | ||
4. **AI-Optimized**: The output should be formatted in a way that's easy for AI models to process and understand. | ||
|
||
## Project Structure | ||
- `src/`: Contains the source code | ||
- `cli/`: Command-line interface related code | ||
- `config/`: Configuration handling | ||
- `core/`: Core functionality (file processing, output generation, etc.) | ||
- `shared/`: Shared utilities | ||
- `tests/`: Contains all test files | ||
- `bin/`: Contains the executable scripts | ||
|
||
## Key Components | ||
1. **CLI (Command Line Interface)**: Handles user input and initiates the packing process. | ||
2. **Config Loader**: Manages loading and merging of configuration from various sources. | ||
3. **File Searcher**: Responsible for finding and filtering files based on include/ignore patterns. | ||
4. **File Sanitizer**: Processes individual files, handling encoding and optionally removing comments. | ||
5. **Output Generator**: Creates the final packed output in either plain text or XML format. | ||
6. **Security Checker**: Uses Secretlint to detect potentially sensitive information in files. | ||
|
||
## Important Rules and Conventions | ||
1. Use TypeScript for all new code. | ||
2. Follow the existing code style and use Prettier for formatting. | ||
3. Write unit tests for all new functionality. | ||
4. Use async/await for asynchronous operations. | ||
5. Use meaningful variable and function names that describe their purpose. | ||
6. Keep functions small and focused on a single task. | ||
7. Use dependency injection to improve testability. | ||
8. Handle errors gracefully and provide meaningful error messages. | ||
|
||
## Performance Considerations | ||
- Be mindful of memory usage when processing large repositories. | ||
- Use streams or chunked processing for large files when possible. | ||
- Avoid unnecessary file system operations. | ||
|
||
## Security Considerations | ||
- Never include sensitive information (like API keys) in the code. | ||
- Use Secretlint rules to detect potential security issues. | ||
- Be cautious when processing user-provided file paths to prevent directory traversal attacks. | ||
|
||
When analyzing or suggesting changes to the codebase, please keep these instructions in mind. Focus on maintaining the project's simplicity and flexibility while improving its functionality and performance. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters