-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
feat(config): Reorganize agent rules and instructions #683
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,136 @@ | ||
| --- | ||
| description: Core project guidelines for the Repomix codebase. Apply these rules when working on any code, documentation, or configuration files within the Repomix project. | ||
| --- | ||
|
|
||
| # Repomix Project Structure and Overview | ||
|
|
||
| This document provides a structural overview of the Repomix project, designed to aid AI code assistants (like Copilot) in understanding the codebase. | ||
|
|
||
| Please refer to `README.md` for a complete and up-to-date project overview, and `CONTRIBUTING.md` for implementation guidelines and contribution procedures. | ||
|
|
||
| ## Project Overview | ||
|
|
||
| Repomix is a tool that packs the contents of a software repository into a single file, making it easier for AI systems to analyze and process the codebase. It supports various output formats (XML, Markdown, or plain text), ignores files based on configurable patterns, and performs security checks to exclude potentially sensitive information. | ||
|
|
||
| ## Directory Structure | ||
|
|
||
| The project is organized into the following directories: | ||
|
|
||
| ``` | ||
| repomix/ | ||
| ├── browser/ # Browser extension source code. | ||
| ├── src/ # Main source code | ||
| │ ├── cli/ # Command-line interface logic (argument parsing, command handling, output) | ||
| │ ├── config/ # Configuration loading, schema, and defaults | ||
| │ ├── core/ # Core logic of Repomix | ||
| │ │ ├── file/ # File handling (reading, processing, searching, tree structure generation, git commands) | ||
| │ │ ├── metrics/ # Calculating code metrics (character count, token count) | ||
| │ │ ├── output/ # Output generation (different styles, headers, etc.) | ||
| │ │ ├── packager/ # Orchestrates file collection, processing, output, and clipboard operations. | ||
| │ │ ├── security/ # Security checks to exclude sensitive files | ||
| │ │ ├── mcp/ # MCP server integration (packaging codebases for AI analysis) | ||
| │ │ ├── tokenCount/ # Token counting using Tiktoken | ||
| │ │ └── treeSitter/ # Code parsing using Tree-sitter and language-specific queries | ||
| │ └── shared/ # Shared utilities and types (error handling, logging, helper functions) | ||
| ├── tests/ # Unit and integration tests (organized mirroring src/) | ||
| │ ├── cli/ | ||
| │ ├── config/ | ||
| │ ├── core/ | ||
| │ ├── integration-tests/ | ||
| │ ├── shared/ | ||
| │ └── testing/ | ||
| └── website/ # Documentation website (VitePress). | ||
| ``` | ||
|
|
||
|
|
||
|
|
||
| # Coding Guidelines | ||
| - Follow the Airbnb JavaScript Style Guide. | ||
| - Split files into smaller, focused units when appropriate: | ||
| - Aim to keep code files under 250 lines. If a file exceeds 250 lines, split it into multiple files based on functionality. | ||
| - Add comments to clarify non-obvious logic. **Ensure all comments are written in English.** | ||
| - Provide corresponding unit tests for all new features. | ||
| - After implementation, verify changes by running: | ||
| ```bash | ||
| npm run lint # Ensure code style compliance | ||
| npm run test # Verify all tests pass | ||
| ``` | ||
|
|
||
| ## Commit Messages | ||
| - Follow the [Conventional Commits](https://www.conventionalcommits.org/) specification for all commit messages | ||
| - Always include a scope in your commit messages | ||
| - Format: `type(scope): Description` | ||
| ``` | ||
| # Examples: | ||
| feat(cli): Add new --no-progress flag | ||
| fix(security): Handle special characters in file paths | ||
| docs(website): Update installation guide | ||
| style(website): Update GitHub sponsor button color | ||
| refactor(core): Split packager into smaller modules | ||
| test(cli): Add tests for new CLI options | ||
| ``` | ||
| - Types: feat, fix, docs, style, refactor, test, chore, etc. | ||
| - Scope should indicate the affected part of the codebase (cli, core, website, security, etc.) | ||
| - Description should be clear and concise in present tense | ||
| - Description must start with a capital letter | ||
|
|
||
| ## Pull Request Guidelines | ||
| - All pull requests must follow the template: | ||
| ```md | ||
| <!-- Please include a summary of the changes --> | ||
|
|
||
| ## Checklist | ||
|
|
||
| - [ ] Run `npm run test` | ||
| - [ ] Run `npm run lint` | ||
| ``` | ||
| - Include a clear summary of the changes at the top of the pull request description | ||
| - Reference any related issues using the format `#issue-number` | ||
|
|
||
| ## PR Review Guidelines | ||
| When reviewing pull requests, provide thoughtful feedback on: | ||
| - Code quality and best practices | ||
| - Potential bugs or issues | ||
| - Suggestions for improvements | ||
| - Overall architecture and design decisions | ||
|
|
||
| ## Dependencies and Testing | ||
| - Inject dependencies through a deps object parameter for testability | ||
| - Example: | ||
| ```typescript | ||
| export const functionName = async ( | ||
| param1: Type1, | ||
| param2: Type2, | ||
| deps = { | ||
| defaultFunction1, | ||
| defaultFunction2, | ||
| } | ||
| ) => { | ||
| // Use deps.defaultFunction1() instead of direct call | ||
| }; | ||
| ``` | ||
| - Mock dependencies by passing test doubles through deps object | ||
| - Use vi.mock() only when dependency injection is not feasible | ||
|
|
||
| ## Generate Comprehensive Output | ||
| - Include all content without abbreviation, unless specified otherwise | ||
| - Optimize for handling large codebases while maintaining output quality | ||
|
|
||
| # GitHub Release Note Guidelines | ||
| When writing release notes, please follow these guidelines: | ||
|
|
||
| - When referencing issues or PRs, use the gh command to verify the content: | ||
| ```bash | ||
| gh issue view <issue-number> # For checking issue content | ||
| gh pr view <pr-number> # For checking PR content | ||
| ``` | ||
| This helps ensure accuracy in release note descriptions. | ||
|
|
||
| Please retrieve and reference the latest release notes from `.github/releases/` as they contain past release examples. | ||
yamadashy marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| ## Other Project-Specific Rules | ||
|
|
||
| For specialized areas of the codebase, please also refer to: | ||
|
|
||
| - **[browser-extension.md](.agents/rules/browser-extension.md)** - Guidelines for browser extension development (Chrome/Firefox/Edge compatibility, manifest files, content scripts) | ||
| - **[website.md](.agents/rules/website.md)** - Guidelines for documentation website (multi-language support, VitePress configuration, translation workflows) | ||
This file contains hidden or 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,50 @@ | ||
| --- | ||
| description: Guidelines for developing the Repomix browser extension. Apply these rules when working on browser extension code, manifest files, content scripts, or internationalization. This includes Chrome/Firefox/Edge compatibility and GitHub integration features. | ||
yamadashy marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| --- | ||
|
|
||
| # Browser Extension Guidelines | ||
|
|
||
| This file provides guidance for working with the Repomix browser extension. | ||
|
|
||
| ## Project Overview | ||
|
|
||
| Cross-browser extension (Chrome/Firefox/Edge) that adds Repomix integration to GitHub repository pages. Uses Manifest V3 with content scripts to inject a "Repomix" button directly into GitHub's UI. | ||
|
|
||
| ## Directory Structure | ||
|
|
||
| ``` | ||
| browser/ | ||
| ├── app/ # Extension source code | ||
| │ ├── _locales/ # Internationalization files (11 languages) | ||
| │ ├── images/ # Extension icons (16px to 128px) | ||
| │ ├── manifest.json # Extension manifest (Manifest V3) | ||
| │ ├── scripts/ # TypeScript source files | ||
| │ │ ├── background.ts # Service worker (background script) | ||
| │ │ └── content.ts # Content script for GitHub integration | ||
| │ └── styles/ # CSS styles for injected elements | ||
| ├── dist/ # Built extension files (generated) | ||
| ├── promo/ # Store promotional materials | ||
| └── tests/ # Test files | ||
| ``` | ||
|
|
||
| ## Development Commands | ||
|
|
||
| ```bash | ||
| npm run dev chrome # Development mode for Chrome | ||
| npm run build-all # Build for all browsers | ||
| npm run lint # TypeScript type checking | ||
| npm run test # Run tests | ||
| npm run generate-icons # Generate icon set from SVG | ||
| ``` | ||
|
|
||
| ## Internationalization | ||
|
|
||
| ### Supported Languages (11 total) | ||
| English, Japanese, German, French, Spanish, Portuguese (Brazilian), Indonesian, Vietnamese, Korean, Chinese (Simplified/Traditional), Hindi. | ||
|
|
||
| ### Adding New Languages | ||
| 1. Create directory in `app/_locales/[language_code]/` | ||
| 2. Add `messages.json` with required keys: | ||
| - `appName`, `appDescription`, `buttonText` | ||
| 3. Add `detailed-description.txt` for store descriptions | ||
| 4. Test extension loads correctly with new locale | ||
2 changes: 1 addition & 1 deletion
2
.github/instructions/website.instructions.md → .agents/rules/website.md
This file contains hidden or 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 hidden or 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 |
|---|---|---|
| @@ -1,3 +1 @@ | ||
| # Important | ||
| - Follow all AI instructions in the `.github/instructions/` directory | ||
| - The base instructions are located in `.github/instructions/base.instructions.md` | ||
| Please make sure to check the rules written in `.agents/rules/base.md` as they contain important project-specific guidelines and instructions. | ||
yamadashy marked this conversation as resolved.
Show resolved
Hide resolved
yamadashy marked this conversation as resolved.
Show resolved
Hide resolved
|
||
This file contains hidden or 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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.