Skip to main content
skill CX Codex

qe-code-intelligence — Claude Code skill: semantic code search

qe-code-intelligence builds a semantic code index, dependency graphs and knowledge graphs. Helps understand unfamiliar codebases, trace call chains, and find code by meaning rather than keywords.

MIT 122 installs ★ 533 updated 2026-10-25

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add proffesor-for-testing/agentic-qe --skill qe-code-intelligence -a claude-code
Open on GitHub

What qe-code-intelligence does

The skill indexes code into a knowledge graph (classes, functions, types, relationships), generates embeddings, and searches semantically. aqe code index src/ --incremental indexes only changed files. aqe code search "authentication middleware" finds code by task description. aqe code impact src/services/UserService.ts --depth 3 shows what breaks if you edit the file.

Sub-agents handle the work: qe-kg-builder parses files and extracts entities, qe-dependency-mapper maps imports and calls, qe-impact-analyzer calculates change consequences. The graph is stored in AgentDB, search runs on vector embeddings with a default similarity threshold of 0.7.

Indexing fails on repositories over 50K LOC. Agent-based search has an 18% success rate; for simple queries, grep is faster. The skill claims 80% token reduction but may skip critical files — verify results manually. Before first use, initialize the fleet: aqe init.

What it helps with

  • understand unfamiliar code without reading the entire codebase
  • find functions by task description, not by name
  • build dependency graphs and see what breaks when you change a file
  • reduce context size for the agent by selecting only relevant code
  • trace call chains and imports across multiple levels

Example prompts for the agent

  • Index src/ and find everything related to user authentication
  • Build a dependency graph for src/services/OrderService.ts three levels deep
  • Show which files will break if I change UserService.ts

How to install qe-code-intelligence

1Skills CLI (Vercel)

npx skills add proffesor-for-testing/agentic-qe --skill qe-code-intelligence -a claude-code

2Manually: put the files in place

~/.claude/skills/qe-code-intelligence/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/qe-code-intelligence/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about qe-code-intelligence

How to install qe-code-intelligence in Claude Code?

Run npx skills add proffesor-for-testing/agentic-qe --skill qe-code-intelligence -a claude-code, the skill appears in ~/.claude/skills/qe-code-intelligence/SKILL.md.

What does qe-code-intelligence do?

Builds a semantic code index, dependency graphs, and searches code by meaning. Helps understand unfamiliar codebases, trace calls, and reduce context for the agent.

Why does indexing fail on large repositories?

The skill cannot handle codebases over 50K LOC. Index individual modules with aqe code index src/module/ --incremental instead of the entire repository at once.

Source text

SKILL.md · MIT
---
name: "qe-code-intelligence"
description: "Builds semantic code indexes, maps dependency graphs, and performs intelligent code search across large codebases. Use when understanding unfamiliar code, tracing call chains, analyzing import dependencies, or reducing context window usage through targeted retrieval."
trust_tier: 3
validation:
  schema_path: schemas/output.json
  validator_path: scripts/validate-config.json
  eval_path: evals/qe-code-intelligence.yaml
---

# QE Code Intelligence

## Purpose

Guide the use of v3's code intelligence capabilities including knowledge graph construction, semantic code search, dependency mapping, and context-aware code understanding with significant token reduction.

## Activation

- When understanding unfamiliar code
- When searching for code semantically
- When analyzing dependencies
- When building code knowledge graphs
- When reducing context for AI operations

## Quick Start

```bash
# Index codebase into knowledge graph
aqe code index src/ --incremental

# Semantic code search
aqe code search "authentication middleware"

# Analyze change impact
aqe code impact src/services/UserService.ts --depth 3

# Map dependencies
aqe code deps src/

# Analyze complexity and find hotspots
aqe code complexity src/

# Generate C4 architecture diagrams (Mermaid) with a confidence score
aqe code c4 .
```

## Agent Workflow

```typescript
// Build knowledge graph
Task("Index codebase", `
  Build knowledge graph for the project:
  - Parse all TypeScript files in src/
  - Extract entities (classes, functions, types)
  - Map relationships (imports, calls, inheritance)
  - Generate embeddings for semantic search
  Store in AgentDB vector database.
`, "qe-kg-builder")

// Semantic search
Task("Find relevant code", `
  Search for code related to "user authentication flow":
  - Use semantic similarity (not just keyword)
  - Include related functions and types
  - Rank by relevance score
  - Return with minimal context (80% token reduction)
`, "qe-code-intelligence")
```

## Knowledge Graph Operations

### 1. Codebase Indexing

```typescript
await knowledgeGraph.index({
  source: 'src/**/*.ts',
  extraction: {
    entities: ['class', 'function', 'interface', 'type', 'variable'],
    relationships: ['imports', 'calls', 'extends', 'implements', 'uses'],
    metadata: ['jsdoc', 'complexity', 'lines']
  },
  embeddings: {
    model: 'code-embedding',
    dimensions: 384,
    normalize: true
  },
  incremental: true  // Only index changed files
});
```

### 2. Semantic Search

```typescript
await semanticSearcher.search({
  query: 'payment processing with stripe',
  options: {
    similarity: 'cosine',
    threshold: 0.7,
    limit: 20,
    includeContext: true
  },
  filters: {
    fileTypes: ['.ts', '.tsx'],
    excludePaths: ['node_modules', 'dist']
  }
});
```

### 3. Dependency Analysis

```typescript
await dependencyMapper.analyze({
  entry: 'src/services/OrderService.ts',
  depth: 3,
  direction: 'both',  // imports and importedBy
  output: {
    graph: true,
    metrics: {
      afferentCoupling: true,
      efferentCoupling: true,
      instability: true
    }
  }
});
```

## Token Reduction Strategy

```typescript
// Get context with 80% token reduction
const context = await codeIntelligence.getOptimizedContext({
  query: 'implement user registration',
  budget: 4000,  // max tokens
  strategy: {
    relevanceRanking: true,
    summarization: true,
    codeCompression: true,
    deduplication: true
  },
  include: {
    signatures: true,
    implementations: 'relevant-only',
    comments: 'essential',
    examples: 'top-3'
  }
});
```

## Knowledge Graph Schema

```typescript
interface KnowledgeGraph {
  entities: {
    id: string;
    type: 'class' | 'function' | 'interface' | 'type' | 'file';
    name: string;
    file: string;
    line: number;
    embedding: number[];
    metadata: Record<string, any>;
  }[];
  relationships: {
    source: string;
    target: string;
    type: 'imports' | 'calls' | 'extends' | 'implements' | 'uses';
    weight: number;
  }[];
  indexes: {
    byName: Map<string, string[]>;
    byFile: Map<string, string[]>;
    byType: Map<string, string[]>;
  };
}
```

## Search Results

```typescript
interface SearchResult {
  entity: {
    name: string;
    type: string;
    file: string;
    line: number;
  };
  relevance: number;
  snippet: string;
  context: {
    before: string[];
    after: string[];
    related: string[];
  };
  explanation: string;
}
```

## CLI Examples

```bash
# Full reindex
aqe code index src/

# Incremental index (changed files only)
aqe code index src/ --incremental

# Index only files changed since a git ref
aqe code index . --git-since HEAD~5

# Semantic code search
aqe code search "database connection"

# Change impact analysis
aqe code impact src/services/UserService.ts

# Dependency mapping
aqe code deps src/ --depth 5

# Complexity metrics and hotspots
aqe code complexity src/ --format json
```

## Gotchas

- WARNING: code-intelligence domain has 18% success rate — prefer direct grep/glob over agent-based code search for simple queries
- Knowledge graph construction fails on repos >50K LOC — scope to specific modules
- Semantic search returns irrelevant results without domain-specific embeddings — always verify search results manually
- Agent claims "80% token reduction" but may skip critical context — verify key files are included in results
- Fleet must be initialized before using: run `aqe health` to diagnose, or `aqe init` to re-initialize if you get initialization errors

## Coordination

**Primary Agents**: qe-kg-builder, qe-dependency-mapper, qe-impact-analyzer, qe-code-complexity
**Coordinator**: qe-code-intelligence
**Related Skills**: qe-test-generation, qe-defect-intelligence

© proffesor-for-testing · MIT · proffesor-for-testing/agentic-qe

Similar skills

All skills for Testing and QA →

From the same set73

The whole set →
tdd-london-chicago tdd-london-chicago — a skill for choosing London or Chicago TDD, using mocks or real objects, and moving through the Red–Green–Refactor cycle. CX Codex +1 124installs qe-chaos-resilience qe-chaos-resilience — a skill for Claude Code, Codex, Cursor and other agents that injects controlled faults into distributed systems and checks recovery behavior. Runs during circuit breaker, failover, and retry logic validation. CX Codex +1 123installs consultancy-practices consultancy-practices is a Claude Code skill that applies software quality consulting practices: it identifies client pain, prioritizes work by impact and effort, and transfers knowledge. CX Codex +1 122installs mutation-testing Skill runs mutation testing: mutates code (operators, boundaries, logic), runs tests, and counts surviving mutants — weak spots in your test suite. CX Codex +1 122installs qe-test-execution qe-test-execution orchestrates Jest, Vitest, and Playwright suites using the aqe CLI with parallel workers, affected-test selection, and flaky test retries. CX Codex +1 122installs qe-learning-optimization qe-learning-optimization optimizes QE agents through transfer learning across test frameworks, Bayesian hyperparameter tuning, and A/B experiments. CX Codex +1 121installs qe-security-compliance qe-security-compliance runs code security audits, dependency vulnerability scans, secret detection, and compliance checks for OWASP and SOC2. CX Codex +1 120installs testability-scoring testability-scoring scores web application testability against 10 principles and produces a report. Use it to check test readiness and find areas that make testing harder. CX Codex +1 119installs

Project sponsors

Companies that keep this analytics open