一键导入
qe-code-intelligence
Knowledge graph-based code understanding with semantic search and 80% token reduction through intelligent context retrieval.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Knowledge graph-based code understanding with semantic search and 80% token reduction through intelligent context retrieval.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
| inclusion | auto |
| name | qe-code-intelligence |
| description | Knowledge graph-based code understanding with semantic search and 80% token reduction through intelligent context retrieval. |
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.
# 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 .
// 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")
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
});
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']
}
});
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
}
}
});
// 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'
}
});
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[]>;
};
}
interface SearchResult {
entity: {
name: string;
type: string;
file: string;
line: number;
};
relevance: number;
snippet: string;
context: {
before: string[];
after: string[];
related: string[];
};
explanation: string;
}
# 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
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
Evaluates code quality through complexity analysis, lint results, code smell detection, and test health metrics. Use when assessing deployment readiness, configuring quality gates, scoring a codebase for release, or generating quality reports with pass/fail verdicts.
Evaluates code quality through complexity analysis, lint results, code smell detection, and test health metrics. Use when assessing deployment readiness, configuring quality gates, scoring a codebase for release, or generating quality reports with pass/fail verdicts.
Generates durable-first tests — invariants, contracts, and property-based tests at boundaries that survive a reimplementation — plus unit, integration, and e2e coverage. Use when creating tests for new or changed code, filling coverage gaps, or migrating test suites between Jest, Vitest, and Playwright.
Generates durable-first tests — invariants, contracts, and property-based tests at boundaries that survive a reimplementation — plus unit, integration, and e2e coverage. Use when creating tests for new or changed code, filling coverage gaps, or migrating test suites between Jest, Vitest, and Playwright.
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.
Comprehensive truth scoring, code quality verification, and automatic rollback system with 0.95 accuracy threshold for ensuring high-quality agent outputs and codebase reliability.