repoprompt について
RepoPrompt CLI でコードベースを調査し、タスク用のコンテキストをまとめるスキルです。構造表示、絞り込み検索、ファイル範囲の読み取りにより、不要な内容を抑えます。
主な機能
- 01ファイルツリーとコード構造の表示
- 02周辺行を含む検索
- 03指定範囲のファイル読み取り
- 04ファイル選択とワークスペース管理
- 05タスク用コンテキストの作成と出力
活用シーン
- 01不慣れなリポジトリの構造把握
- 02コード検索と関連行の確認
- 03コーディングタスク用コンテキストの準備
MCP 対応
MCP Server を有効にした RepoPrompt アプリの起動が必要です。CLI はそのサーバーと通信します。
インストール
コマンドをコピーしてターミナルで実行します。
$
npx skills add https:/ / github.com/ parcadei/ continuous-claude-v3 --skill repopromptインストール後、Claude Code で/repopromptを入力して読み込まれたか確認します。
詳細
RepoPrompt スキル
使用する場面
- コードベースの構造を調べる(ツリー、コードマップ)
- コンテキスト行付きでコードを検索する
- ファイル全体の内容を使わずにコードシグネチャを取得する(トークン効率に優れています)
- ファイルの一部を読み取る(特定の行範囲)
- タスク用のコンテキストを構築する
トークンの最適化
RepoPrompt は、生のファイル読み込みよりもトークン効率に優れています。
structure→ シグネチャのみ(全内容ではありません)read --start-line --limit→ ファイル全体ではなく一部を読み込みますsearch --context-lines→ 関連する一致箇所をコンテキスト付きで表示します
CLI の使用方法
# If installed to PATH (Settings → MCP Server → Install CLI to PATH)
rp-cli -e 'command'
# Or use the alias (configure in your shell)
repoprompt_cli -e 'command'
コマンドリファレンス
ファイルツリー
# Full tree
rp-cli -e 'tree'
# Folders only
rp-cli -e 'tree --mode folders'
# Selected files only
rp-cli -e 'tree --mode selected'
コード構造(コードマップ)- トークン効率に優れています
# Structure of specific paths
rp-cli -e 'structure src/auth/'
# Structure of selected files
rp-cli -e 'structure --scope selected'
# Limit results
rp-cli -e 'structure src/ --max-results 10'
検索
# Basic search
rp-cli -e 'search "pattern"'
# With context lines
rp-cli -e 'search "error" --context-lines 3'
# Filter by extension
rp-cli -e 'search "TODO" --extensions .ts,.tsx'
# Limit results
rp-cli -e 'search "function" --max-results 20'
ファイルの読み取り - トークン効率に優れています
# Full file
rp-cli -e 'read path/to/file.ts'
# Line range (slice)
rp-cli -e 'read path/to/file.ts --start-line 50 --limit 30'
# Last N lines (tail)
rp-cli -e 'read path/to/file.ts --start-line -20'
選択項目の管理
# Add files to selection
rp-cli -e 'select add src/auth/'
# Set selection (replace)
rp-cli -e 'select set src/api/ src/types/'
# Clear selection
rp-cli -e 'select clear'
# View current selection
rp-cli -e 'select get'
ワークスペースのコンテキスト
# Get full context
rp-cli -e 'context'
# Specific includes
rp-cli -e 'context --include prompt,selection,tree'
コマンドの連結
# Multiple operations
rp-cli -e 'select set src/auth/ && structure --scope selected && context'
ワークスペース
# List workspaces
rp-cli -e 'workspace list'
# List tabs
rp-cli -e 'workspace tabs'
# Switch workspace
rp-cli -e 'workspace switch "ProjectName"'
AI チャット(RepoPrompt のモデルを使用)
# Send to chat
rp-cli -e 'chat "How does the auth system work?"'
# Plan mode
rp-cli -e 'chat "Design a new feature" --mode plan'
コンテキストビルダー(AI によるファイル選択)
# Auto-select relevant files for a task
rp-cli -e 'builder "implement user authentication"'
ワークフロー用の省略フラグ
# Quick operations without -e syntax
rp-cli --workspace MyProject --select-set src/ --export-context ~/out.md
rp-cli --chat "How does auth work?"
rp-cli --builder "implement user authentication"
スクリプトファイル(.rp)
繰り返し実行するワークフローでは、コマンドをスクリプトに保存します。
# daily-export.rp
workspace switch Frontend
select set src/components/
context --all > ~/exports/frontend.md
次のコマンドで実行します。
rp-cli --exec-file ~/scripts/daily-export.rp
CLI フラグ
| フラグ | 目的 |
|---|---|
-e 'cmd' | コマンドを実行します |
-w <id> | 対象のウィンドウ ID |
-q | 静音モード |
-d <cmd> | コマンドの詳細なヘルプ |
--wait-for-server 5 | 接続を待機します(スクリプト向け) |
非同期操作(tmux)
builder のような時間のかかる操作には、非同期スクリプトを使用します。
# Start context builder async
uv run python -m runtime.harness scripts/repoprompt_async.py \
--action start --task "understand the auth system"
# With workspace switch
uv run python -m runtime.harness scripts/repoprompt_async.py \
--action start --workspace "MyProject" --task "explore API patterns"
# Check status
uv run python -m runtime.harness scripts/repoprompt_async.py --action status
# Get result when done
uv run python -m runtime.harness scripts/repoprompt_async.py --action result
# Kill if needed
uv run python -m runtime.harness scripts/repoprompt_async.py --action kill
注記
MCP サーバーを有効にした状態で RepoPrompt アプリを実行している必要があります。
コメント
Markdown 対応