commit 7f2c92398c4dd5d247c072774142118942a21c1e Author: Zhongwei Li Date: Sun Nov 30 09:07:26 2025 +0800 Initial commit diff --git a/.claude-plugin/plugin.json b/.claude-plugin/plugin.json new file mode 100644 index 0000000..ed06229 --- /dev/null +++ b/.claude-plugin/plugin.json @@ -0,0 +1,11 @@ +{ + "name": "repomix-commands", + "description": "Slash commands for quick Repomix operations. Pack local and remote repositories with simple commands like /pack-local and /pack-remote.", + "version": "1.0.2", + "author": { + "name": "yamadashy" + }, + "commands": [ + "./commands" + ] +} \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..5d0632d --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# repomix-commands + +Slash commands for quick Repomix operations. Pack local and remote repositories with simple commands like /pack-local and /pack-remote. diff --git a/commands/pack-local.md b/commands/pack-local.md new file mode 100644 index 0000000..fd1fcd8 --- /dev/null +++ b/commands/pack-local.md @@ -0,0 +1,99 @@ +--- +description: Pack local codebase with Repomix +--- + +Pack a local codebase using Repomix with AI-optimized format. + +When the user asks to pack a local codebase, analyze their request and run the appropriate repomix command. + +## User Intent Examples + +The user might ask in various ways: +- "Pack this codebase" +- "Pack the src directory" +- "Pack this project as markdown" +- "Pack TypeScript files only" +- "Pack with compression and copy to clipboard" +- "Pack this project including git history" + +## Your Responsibilities + +1. **Understand the user's intent** from natural language +2. **Determine the appropriate options**: + - Which directory to pack (default: current directory) + - Output format: xml (default), markdown, json, or plain + - Whether to compress (for large codebases) + - File patterns to include/ignore + - Additional features (copy to clipboard, include git diffs/logs) +3. **Execute the command** with: `npx repomix@latest [directory] [options]` + +## Available Options + +- `--style `: Output format (xml, markdown, json, plain) +- `--include `: Include only matching patterns (e.g., "src/**/*.ts,**/*.md") +- `--ignore `: Additional ignore patterns +- `--compress`: Enable Tree-sitter compression (~70% token reduction) +- `--output `: Custom output path +- `--copy`: Copy output to clipboard +- `--include-diffs`: Include git diff output +- `--include-logs`: Include git commit history + +## Command Examples + +Based on user intent, you might run: + +```bash +# "Pack this codebase" +npx repomix@latest + +# "Pack the src directory" +npx repomix@latest src/ + +# "Pack as markdown with compression" +npx repomix@latest --style markdown --compress + +# "Pack only TypeScript and Markdown files" +npx repomix@latest --include "src/**/*.ts,**/*.md" + +# "Pack and copy to clipboard" +npx repomix@latest --copy + +# "Pack with git history" +npx repomix@latest --include-diffs --include-logs +``` + +## Analyzing the Output + +**IMPORTANT**: The generated output file can be very large and consume significant context. + +If the user wants to analyze or explore the generated output: +- **DO NOT read the entire output file directly** +- **USE an appropriate sub-agent** to analyze the output +- The sub-agent will efficiently search and read specific sections using grep and incremental reading + +**Agent Selection Strategy**: +1. If `repomix-explorer:explorer` agent is available, use it (optimized for repomix output analysis) +2. Otherwise, use the `general-purpose` agent or another suitable sub-agent +3. The sub-agent should use Grep and Read tools to analyze incrementally + +Example: +```text +User: "Pack this codebase and analyze it" + +Your workflow: +1. Run: npx repomix@latest +2. Note the output file location (e.g., repomix-output.xml) +3. Launch an appropriate sub-agent with task: + "Analyze the repomix output file at ./repomix-output.xml. + Use Grep tool to search for patterns and Read tool to examine specific sections. + Provide an overview of the codebase structure and main components. + Do NOT read the entire file at once." +``` + +## Help and Documentation + +If you need more information about available options or encounter any issues: +- Run `npx repomix@latest -h` or `npx repomix@latest --help` to see all available options +- Check the official documentation at https://github.com/yamadashy/repomix + +Remember: Parse the user's natural language request and translate it into the appropriate repomix command. For analysis tasks, delegate to appropriate sub-agents to avoid consuming excessive context. diff --git a/commands/pack-remote.md b/commands/pack-remote.md new file mode 100644 index 0000000..ba1ca5c --- /dev/null +++ b/commands/pack-remote.md @@ -0,0 +1,106 @@ +--- +description: Pack and analyze a remote GitHub repository +--- + +Fetch and analyze a GitHub repository using Repomix. + +When the user asks to pack a remote repository, analyze their request and run the appropriate repomix command. + +## User Intent Examples + +The user might ask in various ways: +- "Pack the yamadashy/repomix repository" +- "Analyze facebook/react from GitHub" +- "Pack https://github.com/microsoft/vscode" +- "Pack react repository with compression" +- "Pack only TypeScript files from the Next.js repo" +- "Analyze the main branch of user/repo" + +## Your Responsibilities + +1. **Understand the user's intent** from natural language +2. **Extract the repository information**: + - Repository URL or owner/repo format + - Specific branch, tag, or commit (if mentioned) +3. **Determine the appropriate options**: + - Output format: xml (default), markdown, json, or plain + - Whether to compress (for large codebases) + - File patterns to include/ignore + - Additional features (copy to clipboard) +4. **Execute the command** with: `npx repomix@latest --remote [options]` + +## Supported Repository Formats + +- `owner/repo` (e.g., yamadashy/repomix) +- `https://github.com/owner/repo` +- `https://github.com/owner/repo/tree/branch-name` +- `https://github.com/owner/repo/commit/hash` + +## Available Options + +- `--style `: Output format (xml, markdown, json, plain) +- `--include `: Include only matching patterns (e.g., "src/**/*.ts,**/*.md") +- `--ignore `: Additional ignore patterns +- `--compress`: Enable Tree-sitter compression (~70% token reduction) +- `--output `: Custom output path +- `--copy`: Copy output to clipboard + +## Command Examples + +Based on user intent, you might run: + +```bash +# "Pack yamadashy/repomix" +npx repomix@latest --remote yamadashy/repomix + +# "Analyze facebook/react" +npx repomix@latest --remote https://github.com/facebook/react + +# "Pack the develop branch of user/repo" +npx repomix@latest --remote https://github.com/user/repo/tree/develop + +# "Pack microsoft/vscode with compression" +npx repomix@latest --remote microsoft/vscode --compress + +# "Pack only TypeScript files from owner/repo" +npx repomix@latest --remote owner/repo --include "src/**/*.ts" + +# "Pack yamadashy/repomix as markdown and copy to clipboard" +npx repomix@latest --remote yamadashy/repomix --copy --style markdown +``` + +## Analyzing the Output + +**IMPORTANT**: The generated output file can be very large and consume significant context. + +If the user wants to analyze or explore the generated output: +- **DO NOT read the entire output file directly** +- **USE an appropriate sub-agent** to analyze the output +- The sub-agent will efficiently search and read specific sections using grep and incremental reading + +**Agent Selection Strategy**: +1. If `repomix-explorer:explorer` agent is available, use it (optimized for repomix output analysis) +2. Otherwise, use the `general-purpose` agent or another suitable sub-agent +3. The sub-agent should use Grep and Read tools to analyze incrementally + +Example: +```text +User: "Pack and analyze the yamadashy/repomix repository" + +Your workflow: +1. Run: npx repomix@latest --remote yamadashy/repomix +2. Note the output file location (e.g., repomix-output.xml) +3. Launch an appropriate sub-agent with task: + "Analyze the repomix output file at ./repomix-output.xml. + Use Grep tool to search for patterns and Read tool to examine specific sections. + Provide an overview of the repository structure and main components. + Do NOT read the entire file at once." +``` + +## Help and Documentation + +If you need more information about available options or encounter any issues: +- Run `npx repomix@latest -h` or `npx repomix@latest --help` to see all available options +- Check the official documentation at https://github.com/yamadashy/repomix + +Remember: Parse the user's natural language request and translate it into the appropriate repomix command with the --remote option. For analysis tasks, delegate to appropriate sub-agents to avoid consuming excessive context. diff --git a/plugin.lock.json b/plugin.lock.json new file mode 100644 index 0000000..9f67743 --- /dev/null +++ b/plugin.lock.json @@ -0,0 +1,49 @@ +{ + "$schema": "internal://schemas/plugin.lock.v1.json", + "pluginId": "gh:yamadashy/repomix:.claude/plugins/repomix-commands", + "normalized": { + "repo": null, + "ref": "refs/tags/v20251128.0", + "commit": "e6dbc33a1280bc1809c1e3a5eb4aa18960906ca5", + "treeHash": "7d3516cecf7a1948a912d3f1d5fe5956c7c33df30920cc3f456f600f8f63f394", + "generatedAt": "2025-11-28T10:29:08.958444Z", + "toolVersion": "publish_plugins.py@0.2.0" + }, + "origin": { + "remote": "git@github.com:zhongweili/42plugin-data.git", + "branch": "master", + "commit": "aa1497ed0949fd50e99e70d6324a29c5b34f9390", + "repoRoot": "/Users/zhongweili/projects/openmind/42plugin-data" + }, + "manifest": { + "name": "repomix-commands", + "description": "Slash commands for quick Repomix operations. Pack local and remote repositories with simple commands like /pack-local and /pack-remote.", + "version": "1.0.2" + }, + "content": { + "files": [ + { + "path": "README.md", + "sha256": "8a55f08ebe6283dfbd2056ab72b2c672ab4b88d4d6e7b91da9e206ad2384b781" + }, + { + "path": ".claude-plugin/plugin.json", + "sha256": "ffaaef73322927303c338943355e63565627e31fd169b1b0b45b8fc1b3d1acb4" + }, + { + "path": "commands/pack-local.md", + "sha256": "c0e245e4662d6f5abb89fd2fcd9a46e6c79abfea4bcda95d18133019f4d2b825" + }, + { + "path": "commands/pack-remote.md", + "sha256": "2c25cb9ca0e3f622a896c6e40aaed16f74f9acbb4607ecdb8174a9f3da8017e3" + } + ], + "dirSha256": "7d3516cecf7a1948a912d3f1d5fe5956c7c33df30920cc3f456f600f8f63f394" + }, + "security": { + "scannedAt": null, + "scannerVersion": null, + "flags": [] + } +} \ No newline at end of file