スキル一覧に戻る
whiteboardev

codebase-index

by whiteboardev

0🍴 0📅 2026年1月15日
GitHubで見るManusで実行

SKILL.md


name: codebase-index description: Index project files for semantic code search. Supports incremental updates, progress tracking, and batch embedding generation. metadata: subagent: summarizer version: "1.0" category: code-search allowed-tools: Bash(bun:*)

Codebase Indexing

Index source code for semantic search with vector embeddings.

State Machine

START → VALIDATE_PATH → CHECK_EXISTING
     ├→ NEW_INDEX ────┐
     └→ INCREMENTAL ──┴→ INDEX → [SUCCESS | PARTIAL] → REPORT → END

Execution

Path A: Subagent (preferred)

Task(
  subagent_type: "summarizer",
  prompt: "Index codebase at PATH for project PROJECT_ID with name NAME"
)

Path B: Direct scripts

# Validate path first
bun .opencode/skills/codebase/lib/scripts/validate-path.ts PATH

# Check if already indexed
bun .opencode/skills/codebase/lib/scripts/check-existing.ts PROJECT_ID PATH

# Run indexing
bun .opencode/skills/codebase/index.ts PROJECT_ID NAME PATH

Commands

Validate Path

bun .opencode/skills/codebase/lib/scripts/validate-path.ts PATH [--quiet]

Checks:

  • Path exists and is directory
  • Counts indexable files
  • Estimates chunks
  • Detects languages

Check Existing

bun .opencode/skills/codebase/lib/scripts/check-existing.ts PROJECT_ID PATH [--quiet]

Exit codes:

  • 0 = exists (incremental recommended)
  • 2 = not found (full index needed)

Index Codebase

bun .opencode/skills/codebase/index.ts PROJECT_ID NAME PATH [OPTIONS]

Options:

  • --dry-run: Preview without indexing
  • --quiet: JSON output only

Exit codes:

  • 0 = success
  • 1 = error
  • 2 = partial failure (< 90% coverage)

Get Status

bun .opencode/skills/codebase/lib/scripts/status.ts CODEBASE_ID [--quiet]

Exit codes:

  • 0 = healthy (excellent/good)
  • 2 = stale (> 24 hours old)
  • 3 = unhealthy (< 90% coverage)

Environment Variables

VariableDefaultDescription
BRAINY_API_URLhttp://localhost:3090API endpoint
BRAINY_PROJECT_ID3afb861a-...Default project
INDEX_EXTENSIONS.ts,.js,.py,.go,.rs,.mdFile types to index
INDEX_EXCLUDE_DIRSnode_modules,.git,dist,buildDirectories to skip
INDEX_CHUNK_SIZE100Lines per chunk
INDEX_EMBEDDING_BATCH10Embeddings per batch
INDEX_MAX_FILES0Max files per run (0=unlimited)

Workflow

New Codebase

  1. lib/scripts/validate-path.ts → confirm valid
  2. lib/scripts/check-existing.ts → exits 2 (not found)
  3. index.ts → creates codebase + full index

Incremental Update

  1. lib/scripts/check-existing.ts → exits 0 (exists)
  2. index.ts → detects changes, indexes diff

Health Indicators

StatusEmojiMeaning
Excellent🟢Fresh (< 8h), full coverage
Good🟡Recent (8-24h), good coverage
Stale🟠Old (> 24h), may miss changes
Unhealthy🔴Low coverage (< 90%)

Output Example

━━━ Codebase Indexing ━━━
   Project: 3afb861a-b783-45a6-bba2-4b6d96468aeb
   Name: BrAIny
   Path: /home/dev/projects/brainy
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

🔍 Checking for existing codebase...
   Mode: Incremental update

🚀 Starting indexing...
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

🔄 Reindexing existing codebase...

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📊 Results
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

   ├─ New files: 3 📝
   ├─ Modified: 2 ✏️
   ├─ Deleted: 0 🗑️
   ├─ Total chunks: 45
   └─ Indexed: 45

   Embedding coverage: 100%
   Duration: 12.3s

✅ Indexing complete!
   Codebase ID: xyz-789
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

スコア

総合スコア

50/100

リポジトリの品質指標に基づく評価

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

0/10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

レビュー

💬

レビュー機能は近日公開予定です