qe-code-intelligence
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.
Best use case
qe-code-intelligence is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
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.
Teams using qe-code-intelligence should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/qe-code-intelligence/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How qe-code-intelligence Compares
| Feature / Agent | qe-code-intelligence | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
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.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
Related Guides
AI Agents for Coding
Browse AI agent skills for coding, debugging, testing, refactoring, code review, and developer workflows across Claude, Cursor, and Codex.
Best AI Skills for Claude
Explore the best AI skills for Claude and Claude Code across coding, research, workflow automation, documentation, and agent operations.
SKILL.md Source
# 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/
```
## 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-intelligenceRelated Skills
ReasoningBank Intelligence
Implement adaptive learning with ReasoningBank for pattern recognition, strategy optimization, and continuous improvement. Use when building self-learning agents, optimizing workflows, or implementing meta-cognitive systems.
qe-defect-intelligence
Predicts defect-prone code using change frequency, complexity metrics, and historical bug patterns. Use when predicting defects before they escape, analyzing root causes of test failures, learning from past defect patterns, or implementing proactive quality management.
qe-visual-testing-advanced
Advanced visual regression testing with pixel-perfect comparison, AI-powered diff analysis, responsive design validation, and cross-browser visual consistency. Use when detecting UI regressions, validating designs, or ensuring visual consistency.
qe-verification-quality
Comprehensive truth scoring, code quality verification, and automatic rollback system with 0.95 accuracy threshold for ensuring high-quality agent outputs and codebase reliability.
qe-testability-scoring
AI-powered testability assessment using 10 principles of intrinsic testability with Playwright and optional Vibium integration. Evaluates web applications against Observability, Controllability, Algorithmic Simplicity, Transparency, Stability, Explainability, Unbugginess, Smallness, Decomposability, and Similarity. Use when assessing software testability, evaluating test readiness, identifying testability improvements, or generating testability reports.
qe-test-reporting-analytics
Advanced test reporting, quality dashboards, predictive analytics, trend analysis, and executive reporting for QE metrics. Use when communicating quality status, tracking trends, or making data-driven decisions.
qe-test-idea-rewriting
Transform passive 'Verify X' test descriptions into active, observable test actions. Use when test ideas lack specificity, use vague language, or fail quality validation. Converts to action-verb format for clearer, more testable descriptions.
qe-test-environment-management
Test environment provisioning, infrastructure as code for testing, Docker/Kubernetes for test environments, service virtualization, and cost optimization. Use when managing test infrastructure, ensuring environment parity, or optimizing testing costs.
qe-test-design-techniques
Systematic test design with boundary value analysis, equivalence partitioning, decision tables, state transition testing, and combinatorial testing. Use when designing comprehensive test cases, reducing redundant tests, or ensuring systematic coverage.
qe-test-data-management
Strategic test data generation, management, and privacy compliance. Use when creating test data, handling PII, ensuring GDPR/CCPA compliance, or scaling data generation for realistic testing scenarios.
qe-test-automation-strategy
Design and implement effective test automation with proper pyramid, patterns, and CI/CD integration. Use when building automation frameworks or improving test efficiency.
qe-technical-writing
Write clear, engaging technical content from real experience. Use when writing blog posts, documentation, tutorials, or technical articles.