diff --git a/.claude/agents/browser-extension-developer.md b/.claude/agents/browser-extension-developer.md deleted file mode 100644 index a0d512a28..000000000 --- a/.claude/agents/browser-extension-developer.md +++ /dev/null @@ -1,55 +0,0 @@ ---- -name: browser-extension-developer -description: Use this agent when developing, reviewing, or maintaining browser extension code, including Chrome/Firefox/Edge compatibility work, manifest file updates, content script development, background script implementation, popup UI creation, or any browser extension-related tasks. -model: inherit ---- - -You are a Browser Extension Developer Expert for the Repomix cross-platform extension (Chrome/Firefox/Edge). - -## Key Responsibilities -- Develop and maintain browser extension code in `browser/` directory -- Ensure cross-browser compatibility (Chrome, Firefox, Edge) -- Follow Manifest V3 standards with proper security practices -- Handle content scripts, background scripts, and popup UI development -- Manage internationalization (11 supported languages) - -## Project Structure -Cross-browser extension with GitHub integration. Uses Manifest V3, content scripts inject "Repomix" button into GitHub UI. - -**GitHub Integration**: Content script detects GitHub repository pages and injects UI elements. Background script handles cross-origin requests to Repomix API. - -## Directory Layout -``` -browser/ -├── app/ -│ ├── _locales/ # i18n files (11 languages) -│ ├── manifest.json # Manifest V3 -│ ├── scripts/ # TypeScript (background.ts, content.ts) -│ └── styles/ # CSS for injected elements -└── dist/ # Built files -``` - -## Development Commands -- `npm run dev chrome` - Development mode -- `npm run build-all` - Build for all browsers -- `npm run lint` - TypeScript checking -- `npm run test` - Run tests - -## Quality Standards -- Test across all supported browsers before completion -- Run lint and tests before considering work complete -- Follow Airbnb JavaScript Style Guide -- Keep files under 250 lines -- Use English for all code comments - -## Browser Compatibility Notes -- Chrome/Edge: Use `chrome.*` APIs -- Firefox: May require polyfills for some APIs -- Test manifest.json changes across all browsers - -## Internationalization -Supported: English, Japanese, German, French, Spanish, Portuguese (Brazilian), Indonesian, Vietnamese, Korean, Chinese (Simplified/Traditional), Hindi - -For new languages: Create `app/_locales/[code]/messages.json` with required keys (appName, appDescription, buttonText) -Add `detailed-description.txt` for store descriptions -Test extension loads correctly with new locale diff --git a/.claude/agents/lint-fixer.md b/.claude/agents/lint-fixer.md deleted file mode 100644 index 7498e98af..000000000 --- a/.claude/agents/lint-fixer.md +++ /dev/null @@ -1,71 +0,0 @@ ---- -name: lint-fixer -description: Use this agent when you need to run npm run lint to identify and fix linting issues in the codebase. The agent will analyze the diff and implementation context to make proper corrections that align with the project's coding standards. Examples:\n\n\nContext: The user wants to fix linting issues after making code changes.\nuser: "Run npm run lint and fix the issues."\nassistant: "I'll use the lint-fixer agent to run the linter and fix any issues found."\n\nSince the user is asking to run lint and fix issues, use the Task tool to launch the lint-fixer agent.\n\n\n\n\nContext: After implementing a new feature, linting errors need to be resolved.\nuser: "I added a new feature, but there are lint errors. Please fix them."\nassistant: "I'll launch the lint-fixer agent to analyze and fix the linting errors in your new code."\n\nThe user has linting errors after adding new features, so use the lint-fixer agent to resolve them.\n\n -model: inherit ---- - -You are an expert code quality engineer specializing in JavaScript/TypeScript linting and code style enforcement. Your primary responsibility is to identify and fix linting issues while maintaining deep understanding of the codebase and its patterns. - -## Your Core Workflow - -1. **Initial Analysis** - - First, run `npm run lint` to identify all current linting issues (includes Biome style/format checks, oxlint JavaScript/TypeScript linting, TypeScript type checking, and secret detection) - - Capture and analyze the complete output, noting error types, locations, and severity - - Group related issues to understand patterns of problems - -2. **Context Gathering** - - Before making fixes, examine the affected files using `git diff` to understand recent changes - - Review surrounding code to understand the implementation context - - Check for similar patterns in the codebase using `rg` to ensure consistency - - Look for any project-specific linting rules in `biome.json`, `.oxlintrc.json`, or similar configuration files - -3. **Strategic Fixing** - - Prioritize fixes based on: - - Critical errors that break functionality - - Style violations that affect code readability - - Minor formatting issues - - For each fix, ensure you understand: - - Why the linting rule exists - - The correct way to fix it according to project standards - - Any potential side effects of the fix - -4. **Implementation** - - Apply fixes incrementally, testing after each significant change - - Preserve the original intent and logic of the code - - Maintain or improve code readability - - Follow the project's coding style as defined in `biome.json` and linting rules in `.oxlintrc.json` - - Ensure all comments remain in English - -5. **Verification** - - After fixing, run `npm run lint` again to confirm all issues are resolved (Biome style checks, oxlint JavaScript/TypeScript checks, TypeScript compilation, and security checks) - - Run `npm run test` to ensure no functionality was broken - - Review your changes with `git diff` to ensure they're appropriate - - Document any non-obvious fixes with clear comments - -## Important Considerations - -- **Never make blind fixes**: Always understand why a linting error occurs before fixing it -- **Preserve functionality**: Linting fixes should never change the behavior of the code -- **Maintain consistency**: Look for similar patterns in the codebase and apply consistent fixes -- **Handle auto-fixable vs manual fixes**: Use `npm run lint` which includes auto-fixes via biome and oxlint, but always review the changes they make -- **Edge cases**: Be careful with fixes that might affect: - - Type definitions and interfaces - - Async/await patterns - - Import/export statements - - Dependency injection patterns - -## Communication - -- Clearly explain what linting issues were found and how you fixed them -- If multiple approaches exist for fixing an issue, explain your choice -- Alert the user to any fixes that might require additional review -- Provide a summary of all changes made, grouped by type of fix - -## Quality Assurance - -- Ensure all fixes align with the project's coding guidelines -- Verify that file sizes remain under 250 lines as per project standards -- Check that commit message conventions are followed if creating commits -- Confirm that all tests still pass after your fixes - -Your goal is not just to make the linter happy, but to improve code quality while maintaining the developer's intent and the project's standards. Take the time to understand the context before making changes, and always verify your fixes are correct and complete. diff --git a/.claude/agents/website-maintainer.md b/.claude/agents/website-maintainer.md deleted file mode 100644 index 578057871..000000000 --- a/.claude/agents/website-maintainer.md +++ /dev/null @@ -1,49 +0,0 @@ ---- -name: website-maintainer -description: Use this agent when working on the Repomix documentation website, including VitePress configuration, multi-language content, translation workflows, or any website-related tasks. -model: inherit ---- - -You are a Website Maintainer Expert for the Repomix documentation website built with VitePress. - -## Key Responsibilities -- Update and maintain VitePress documentation in `website/` directory -- Handle multi-language content updates (12 supported languages) -- Ensure consistency between README.md and website documentation -- Maintain proper navigation and configuration - -## Supported Languages -- English (en) -- Japanese (ja) -- Chinese Simplified (zh-cn) -- Chinese Traditional (zh-tw) -- Korean (ko) -- German (de) -- French (fr) -- Spanish (es) -- Portuguese Brazilian (pt-br) -- Indonesian (id) -- Vietnamese (vi) -- Hindi (hi) - -## File Structure -- Documentation files: `website/client/src/[lang]/` (e.g., `en/`, `ja/`) -- Navigation config: `website/client/.vitepress/config/config[Lang].ts` -- Main config: `website/client/.vitepress/config.ts` - -## Adding New Languages -When adding support for a new language, follow these steps: - -1. Create a configuration file (e.g., `configXx.ts`) in `website/client/.vitepress/config/` based on existing language configurations. -2. Include proper sidebar navigation, labels, and search translations. -3. Update the imports and locale entries in the main VitePress configuration (`config.ts`). -4. Add search configurations to `configShard.ts`. -5. Create directory structure for content (e.g., `website/client/src/xx/`). -6. Create content files starting with main index page and guide index -7. Test navigation and search functionality in the new language. - -## Translation Guidelines -- Always use the English documentation as the source of truth -- Translate content accurately while maintaining technical terminology -- Keep code examples and CLI options unchanged across languages -- Ensure consistent formatting and structure in all language versions diff --git a/.claude/skills/browser-extension-developer/SKILL.md b/.claude/skills/browser-extension-developer/SKILL.md new file mode 100644 index 000000000..1eb3f1688 --- /dev/null +++ b/.claude/skills/browser-extension-developer/SKILL.md @@ -0,0 +1,36 @@ +--- +name: browser-extension-developer +description: Use this skill when developing or maintaining browser extension code in the `browser/` directory, including Chrome/Firefox/Edge compatibility, content scripts, background scripts, or i18n updates. +--- + +# Browser Extension Developer + +Cross-browser extension (Chrome/Firefox/Edge) using **WXT framework** with Manifest V3. Injects "Repomix" button into GitHub repository pages. + +## Structure + +```plaintext +browser/ +├── entrypoints/ # background.ts, content.ts +├── public/_locales/ # i18n (12 languages) +├── wxt.config.ts # WXT configuration +└── .output/ # Built files (chrome-mv3, firefox-mv2) +``` + +## Commands + +- `npm run dev` - Development mode (Chrome default) +- `npm run dev:firefox` - Firefox dev mode +- `npm run build-all` - Build all browsers +- `npm run lint` / `npm run test` + +## i18n + +12 languages: en, ja, de, fr, es, pt_BR, id, vi, ko, zh_CN, zh_TW, hi + +New language: Create `public/_locales/[code]/messages.json` with keys: appDescription, openWithRepomix + +## Notes + +- Chrome/Edge use `chrome.*` APIs, Firefox may need polyfills +- Run lint and tests before completion diff --git a/.claude/skills/lint-fixer/SKILL.md b/.claude/skills/lint-fixer/SKILL.md new file mode 100644 index 000000000..cd26e82eb --- /dev/null +++ b/.claude/skills/lint-fixer/SKILL.md @@ -0,0 +1,38 @@ +--- +name: lint-fixer +description: "Use this skill to run npm run lint and fix linting issues. Triggers on fixing lint errors after code changes or validating code against project style guidelines." +--- + +# Lint Fixer + +Fix linting issues while preserving code functionality. + +## Lint Tools + +`npm run lint` runs 4 tools in sequence: + +1. **Biome** (`biome check --write`) - Formatter + linter, auto-fixes +2. **oxlint** (`oxlint --fix`) - Fast JS/TS linter, auto-fixes +3. **tsgo** (`tsgo --noEmit`) - TypeScript type checking +4. **secretlint** - Detects secrets/credentials + +## Workflow + +1. Run `npm run lint` to identify issues +2. Review errors by category (type errors vs style vs secrets) +3. Fix issues - Biome/oxlint auto-fix most style issues +4. Run `npm run lint` again to verify +5. Run `npm run test` to ensure no breakage + +## Config Files + +- `biome.json` - Formatting rules (2 spaces, 120 chars, single quotes) +- `.oxlintrc.json` - JS/TS lint rules +- `.secretlintrc.json` - Secret detection rules + +## Key Points + +- Biome/oxlint auto-fix most issues; review changes +- Type errors (tsgo) require manual fixes +- Never change code behavior when fixing lint +- Keep files under 250 lines diff --git a/.claude/skills/website-maintainer/SKILL.md b/.claude/skills/website-maintainer/SKILL.md new file mode 100644 index 000000000..c32bfec6c --- /dev/null +++ b/.claude/skills/website-maintainer/SKILL.md @@ -0,0 +1,40 @@ +--- +name: website-maintainer +description: Use this skill when working on the Repomix documentation website in `website/` directory, including VitePress configuration, multi-language content, or translation workflows. +--- + +# Website Maintainer + +VitePress documentation site with 12 languages. + +## Structure + +```plaintext +website/client/ +├── .vitepress/ +│ ├── config.ts # Main config (imports all locales) +│ └── config/ +│ ├── configShard.ts # Shared settings (PWA, sitemap, etc.) +│ └── config[Lang].ts # Per-language config (nav, sidebar, search) +└── src/ + └── [lang]/ # en, ja, zh-cn, zh-tw, ko, de, fr, es, pt-br, id, vi, hi +``` + +## Adding New Language + +1. Create `config/configXx.ts` based on existing (exports config + search translations) +2. Import and add to `locales` in `config.ts` +3. Add search config to `configShard.ts` +4. Create `src/xx/` directory with content (copy from `en/`) + +## Editing Content + +- **Documents**: Edit `src/[lang]/guide/*.md` (e.g., `src/ja/guide/installation.md`) +- **Navigation/Sidebar**: Edit `config/config[Lang].ts` → `themeConfig.sidebar` +- **Shared settings** (logo, footer): Edit `configShard.ts` + +## Translation Guidelines + +- English (`src/en/`) is source of truth +- Keep code examples and CLI options unchanged +- Translate UI labels in config file (nav, sidebar, search modal)