본문으로 건너뛰기
cccskills
무료GitHub에 공개

code-semantic-search

Semantic code search using Phase 1 vector embeddings and Phase 2 hybrid search.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

설치 방법 보기

포함된 파일(10)

  • SKILL.md5.8 KB
  • commands/code-semantic-search.md120 B
  • hooks/post-execute.cjs318 B
  • hooks/pre-execute.cjs435 B
  • references/research-requirements.md370 B
  • rules/code-semantic-search.md269 B
  • schemas/input.schema.json554 B
  • schemas/output.schema.json264 B
  • scripts/main.cjs2.8 KB
  • templates/implementation-template.md194 B

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

Code Semantic Search

Overview

Semantic code search using Phase 1 vector embeddings and Phase 2 hybrid search (semantic + structural). Find code by meaning, not just keywords.

Core principle: Search code by what it does, not what it's called.

Phase 2: Hybrid Search

This skill now supports three search modes:

  1. Hybrid (Default):

    • Combines semantic + structural search
    • Best accuracy (95%+)
    • Slightly slower but still <150ms
    • Recommended for all searches
  2. Semantic-Only:

    • Uses only Phase 1 semantic vectors
    • Fastest (<50ms)
    • Good for conceptual searches
    • Use when structure doesn't matter
  3. Structural-Only:

    • Uses only ast-grep patterns
    • Precise for exact matches
    • Best for finding function/class definitions
    • Use when you need exact structural patterns

Performance Comparison

ModeSpeedAccuracyBest For
Hybrid<150ms95%General search
Semantic-only<50ms85%Concepts
Structural-only<50ms100%Exact patterns
Phase 1 only<50ms80%Legacy (fallback)

When to Use

Always:

  • Finding authentication logic without knowing function names
  • Searching for error handling patterns
  • Locating database queries
  • Finding similar code to a concept
  • Discovering implementation patterns

Don't Use:

  • Exact text matching (use Grep instead)
  • File name searches (use Glob instead)
  • Simple keyword searches (use ripgrep instead)

Usage Examples

Hybrid Search (Recommended)

// Basic hybrid search
Skill({ skill: 'code-semantic-search', args: 'find authentication logic' });

// With options
Skill({
  skill: 'code-semantic-search',
  args: 'database queries',
  options: {
    mode: 'hybrid',
    language: 'javascript',
    limit: 10,
  },
});

Semantic-Only Search

// Fast conceptual search
Skill({
  skill: 'code-semantic-search',
  args: 'find authentication',
  options: { mode: 'semantic-only' },
});

Structural-Only Search

// Exact pattern matching
Skill({
  skill: 'code-semantic-search',
  args: 'find function authenticate',
  options: { mode: 'structural-only' },
});

Implementation Reference

Hybrid Search: .claude/lib/code-indexing/hybrid-search.cjs

Query Analysis: .claude/lib/code-indexing/query-analyzer.cjs

Result Ranking: .claude/lib/code-indexing/result-ranker.cjs

Integration Points

  • developer: Code exploration, implementation discovery
  • architect: System understanding, pattern analysis
  • code-reviewer: Finding similar patterns, consistency checks
  • reverse-engineer: Understanding unfamiliar codebases
  • researcher: Research existing implementations

Iron Laws

  1. ALWAYS use hybrid mode (semantic + structural) for general searches — semantic-only misses exact matches; structural-only misses conceptual variants; hybrid provides 95% accuracy vs 85% for single mode.
  2. ALWAYS use ripgrep/keyword search first for fast keyword discovery — semantic search is for meaning-based queries; exact strings, function names, and filenames are found faster with ripgrep.
  3. NEVER use semantic search without a meaningful natural-language query — single-word or code-syntax queries produce poor semantic results; describe what the code does, not what it's called.
  4. ALWAYS combine with code-structural-search for precision refinement — start broad with semantic discovery, then use ast-grep patterns to find exact structural matches from the semantic results.
  5. NEVER ignore low-similarity results without checking them — similarity scores are approximations; a 0.7 score result may be more relevant than a 0.9 score result for uncommon patterns.

Anti-Patterns

Anti-PatternWhy It FailsCorrect Approach
Semantic search for exact string matchingSlower and less accurate than text searchUse ripgrep/Grep for exact keyword matching
Single-word queries ("auth")Too vague for semantic matching; returns noiseUse natural-language descriptions ("authentication token validation logic")
Using semantic-only mode for general searchesMisses structural variants; 85% vs 95% accuracyUse hybrid mode (default) for general queries
Ignoring search results that don't match expectationsSemantic results find surprising-but-relevant codeRead all results; unexpected matches are often the most valuable
Not combining with structural searchFinds concepts but not exact patternsUse semantic for discovery → structural for precision

Memory Protocol (MANDATORY)

Before starting: Read .claude/context/memory/learnings.md

After completing:

  • New pattern -> .claude/context/memory/learnings.md
  • Issue found -> .claude/context/memory/issues.md
  • Decision made -> .claude/context/memory/decisions.md

ASSUME INTERRUPTION: If it's not in memory, it didn't happen.

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Ensure accessibility in UI components including semantic HTML, ARIA attributes, keyboard navigation, and WCAG 2.2 AA compliance.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

oimiragieo/agent-studio422026년 7월 14일 업데이트

Use when you want to improve response quality through meta-cognitive reasoning. Applies 15+ reasoning methods to reconsider and refine initial outputs.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

oimiragieo/agent-studio422026년 7월 14일 업데이트

N-round opposing-stance debates for trade-off analysis. Assigns pro/con roles to agents, runs structured debate rounds with quality scoring, and produces a moderator synthesis with confidence-rated recommendation. Generalizable to architecture, technology, security, and design decisions.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

oimiragieo/agent-studio422026년 7월 14일 업데이트

Force adversarial code review stance that eliminates confirmation bias — reviewer must find issues or re-analyze

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

oimiragieo/agent-studio422026년 7월 14일 업데이트

Creates specialized AI agents on-demand when no existing agent matches a request. Use when the Router cannot find a suitable agent for a task. Enables self-evolution by generating persistent agents.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

oimiragieo/agent-studio422026년 7월 14일 업데이트

LLM-as-judge evaluation framework with 5-dimension rubric (accuracy, groundedness, coherence, completeness, helpfulness) for scoring AI-generated content quality with weighted composite scores and evidence citations

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

oimiragieo/agent-studio422026년 7월 14일 업데이트

oimiragieo의 스킬 모두 보기

이 스킬의 문제 신고