AgentSkillsCN

Matrix Repomix

当用户提出“打包仓库”“合并仓库”“获取外部代码”“打包 GitHub 仓库”“从仓库中获取代码”,或需要为上下文分析而打包外部仓库时,应使用此技能。

SKILL.md
--- frontmatter
name: Matrix Repomix
description: This skill should be used when the user asks to "pack repository", "repomix", "fetch external code", "pack github repo", "get code from repository", or needs to pack external repositories for context analysis.
user-invocable: true
allowed-tools:
  - mcp__plugin_matrix_matrix__matrix_repomix

Matrix Repomix

Pack external repositories for context using a two-phase flow that minimizes token consumption.

Usage

Use the matrix_repomix MCP tool with the target repository and query.

Phase 1: Index (No Tokens)

Call with target and query to get file suggestions:

code
target: "anthropics/anthropic-cookbook"
query: "tool use implementation"

Returns suggested files with token estimates. Ask the user to confirm before proceeding.

Phase 2: Pack (With Confirmation)

After user confirms, call again with confirmedFiles:

code
target: "anthropics/anthropic-cookbook"
query: "tool use implementation"
confirmedFiles: ["path/to/file1.py", "path/to/file2.py"]

Parameters

  • target (required) - GitHub shorthand (owner/repo) or local path
  • query (required) - What implementation to search for
  • branch - Git branch (default: HEAD)
  • confirmedFiles - Files to pack (from Phase 1)
  • maxTokens - Maximum tokens for output (default: 30000)
  • maxFiles - Maximum files to suggest (default: 15)
  • cacheTTLHours - Cache duration (default: 24)

Key Features

  • Query-first semantic search using Matrix embeddings
  • Token estimates BEFORE consumption
  • Smart exclusions (tests, docs, configs, node_modules)
  • GitHub API for file tree (no content fetch until pack)
  • 24h cache for index, configurable for pack results