Critical bug fixes and code quality improvements from brutal-honest-review. ## Critical Fixes (9/10 completed, 1 deferred) 1. Fixed Agent Pattern Isolation (CRITICAL) - Added SwarmMemoryManager.queryPatternsByAgent() - SQL filtering by agent_id in metadata - Each agent now isolated 2. Fixed Async Method Cascade - Changed getPatterns() to async - Fixed 10 callers across 6 files - Build passes 3. Fixed Misleading Logging - Added isRealAgentDB() detection - Honest mock vs real reporting 4. Consolidated Embedding Generation - Created EmbeddingGenerator utility - Removed 50+ duplicate lines 5. Added AgentDB Initialization Checks - Empty DB detection - HNSW index verification 6. Integration Test Suite - 26 new test cases - Error path coverage 7. Repository Cleanup - Removed 19 temp test files 8. New QE Skill: sherlock-review - Evidence-based investigative review - 38 QE skills total 9. Deferred: Wire Up Real Test Execution - Deferred to v1.9.0 (documented) ## Statistics - Fixes: 9/10 (90%, 1 deferred) - Files Modified: 16 - Files Created: 3 - Files Deleted: 19 - Integration Tests: 26 - Build: PASSING ## Breaking Changes - getPatterns() now async - add await 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
9.2 KiB
CLI Enhancement Task 1: .claude/skills Folder Creation - COMPLETED ✅
Date: October 20, 2025
Task: Implement .claude/skills folder creation during aqe init with QE Fleet skill filtering
Summary
Successfully implemented the .claude/skills folder creation and skill filtering during aqe init. The implementation ensures only the 17 QE Fleet skills are initialized, filtering out 25+ Claude Flow platform skills.
Changes Made
1. Directory Structure Update (src/cli/commands/init.ts:227)
Added .claude/skills to the directory creation list:
const dirs = [
// ... existing directories ...
'.claude', // For Claude Code integration
'.claude/agents', // Where agent definitions live
'.claude/skills', // Where QE skill definitions live (17 QE skills only) // ← NEW
'tests/unit',
// ... remaining directories ...
];
2. Method Call Addition (src/cli/commands/init.ts:243)
Added call to copySkillTemplates() after copyAgentTemplates():
// Copy agent templates from agentic-qe package
await this.copyAgentTemplates();
// Copy skill templates (only QE Fleet skills, not Claude Flow) // ← NEW
await this.copySkillTemplates(); // ← NEW
3. New Method: copySkillTemplates() (src/cli/commands/init.ts:700)
Implemented comprehensive skill copy logic with filtering:
/**
* Copy only the 17 QE Fleet skills (filters out Claude Flow skills)
*/
private static async copySkillTemplates(): Promise<void> {
console.log(chalk.cyan(' 🎯 Initializing QE Fleet skills...'));
// Define the 17 QE Fleet skills (from SKILLS-MAPPING.md)
const QE_FLEET_SKILLS = [
// Core Quality Practices (5)
'holistic-testing-pact',
'context-driven-testing',
'agentic-quality-engineering',
'exploratory-testing-advanced',
'risk-based-testing',
// Development Methodologies (3)
'tdd-london-chicago',
'xp-practices',
'refactoring-patterns',
// Testing Specializations (4)
'api-testing-patterns',
'performance-testing',
'security-testing',
'test-automation-strategy',
// Communication & Process (3)
'technical-writing',
'bug-reporting-excellence',
'code-review-quality',
// Professional Skills (2)
'consultancy-practices',
'quality-metrics'
];
// Find source path (supports multiple package locations)
const possiblePaths = [
path.join(__dirname, '../../../.claude/skills'), // From dist/cli/commands
path.join(process.cwd(), 'node_modules/agentic-qe/.claude/skills'),
path.join(process.cwd(), '../agentic-qe/.claude/skills') // Monorepo case
];
// Check all paths and select first existing path
let sourcePath: string | null = null;
for (const p of possiblePaths) {
const exists = await fs.pathExists(p);
if (exists && !sourcePath) {
sourcePath = p;
}
}
// Filter skills to only QE Fleet skills
const availableDirs = await fs.readdir(sourcePath);
const availableSkills = availableDirs.filter(name => {
const skillPath = path.join(sourcePath, name);
try {
return fs.statSync(skillPath).isDirectory();
} catch {
return false;
}
});
const qeSkillsToConfig = availableSkills.filter(skill =>
QE_FLEET_SKILLS.includes(skill)
);
// Copy each QE skill directory
let copiedCount = 0;
for (const skillName of qeSkillsToConfig) {
const sourceSkillPath = path.join(sourcePath, skillName);
const targetSkillPath = path.join(targetPath, skillName);
if (await fs.pathExists(targetSkillPath)) {
continue; // Skip if already exists
}
await fs.copy(sourceSkillPath, targetSkillPath);
copiedCount++;
}
// Verify exactly 17 skills
const finalSkillCount = await this.countSkillDirs(targetPath);
if (finalSkillCount === 17) {
console.log(chalk.green(' ✅ All 17 QE Fleet skills successfully initialized'));
}
}
4. Helper Method: countSkillDirs() (src/cli/commands/init.ts:833)
/**
* Count skill directories in .claude/skills
*/
private static async countSkillDirs(dirPath: string): Promise<number> {
if (!await fs.pathExists(dirPath)) return 0;
const items = await fs.readdir(dirPath);
let count = 0;
for (const item of items) {
const itemPath = path.join(dirPath, item);
try {
if (fs.statSync(itemPath).isDirectory()) {
count++;
}
} catch {
// Ignore errors
}
}
return count;
}
Features Implemented
✅ Directory Creation
.claude/skillsdirectory is created duringaqe init- Properly integrated into the directory structure list
✅ Skill Filtering
- Only 17 QE Fleet skills are copied
- 25+ Claude Flow skills are filtered out
- Uses hardcoded allow-list from
SKILLS-MAPPING.md
✅ Source Path Discovery
- Checks 3 possible source paths:
__dirname/../../../.claude/skills(from dist)node_modules/agentic-qe/.claude/skills(npm install)../agentic-qe/.claude/skills(monorepo)
- Uses first existing path
✅ Logging & Verification
- Console output shows:
- "🎯 Initializing QE Fleet skills..."
- "✓ Found skill templates at: "
- "📦 Found X total skills in source"
- "🎯 Filtering to 17 QE Fleet skills (excluding Claude Flow skills)"
- "✓ Copied X new QE skills"
- "📋 Total QE skills initialized: X"
- "✅ All 17 QE Fleet skills successfully initialized"
✅ Error Handling
- Graceful fallback if source not found
- Skips skills that already exist
- Warns if missing expected skills
Test Results
Unit Test (Logic Verification)
$ NODE_PATH=/workspaces/agentic-qe-cf/node_modules node /tmp/test-skills-copy.js
📦 Found 42 total skills in source
🎯 Filtering to 17 QE Fleet skills (excluding Claude Flow skills)
✅ Copied 17 QE skills
📋 Total skills in target: 17
✅ SUCCESS: Exactly 17 QE Fleet skills copied!
✅ SUCCESS: No Claude Flow skills found (properly filtered)
✅ SUCCESS: All 17 QE skills present
🔧 Filtered out 25 Claude Flow skills:
agentdb-advanced, agentdb-learning, agentdb-memory-patterns,
agentdb-optimization, agentdb-vector-search, flow-nexus-neural,
flow-nexus-platform, flow-nexus-swarm, github-code-review,
github-multi-repo, github-project-management, github-release-management,
github-workflow-automation, hive-mind-advanced, hooks-automation,
pair-programming, performance-analysis, reasoningbank-agentdb,
reasoningbank-intelligence, skill-builder, sparc-methodology,
stream-chain, swarm-advanced, swarm-orchestration, verification-quality
✅ ALL TESTS PASSED
QE Fleet Skills (17 Total)
Core Quality Practices (5)
- ✅
holistic-testing-pact - ✅
context-driven-testing - ✅
agentic-quality-engineering - ✅
exploratory-testing-advanced - ✅
risk-based-testing
Development Methodologies (3)
- ✅
tdd-london-chicago - ✅
xp-practices - ✅
refactoring-patterns
Testing Specializations (4)
- ✅
api-testing-patterns - ✅
performance-testing - ✅
security-testing - ✅
test-automation-strategy
Communication & Process (3)
- ✅
technical-writing - ✅
bug-reporting-excellence - ✅
code-review-quality
Professional Skills (2)
- ✅
consultancy-practices - ✅
quality-metrics
Filtered Out (Claude Flow Skills - 25 Total)
❌ AgentDB skills (5): agentdb-advanced, agentdb-learning, agentdb-memory-patterns, agentdb-optimization, agentdb-vector-search
❌ Flow Nexus skills (3): flow-nexus-neural, flow-nexus-platform, flow-nexus-swarm
❌ GitHub skills (5): github-code-review, github-multi-repo, github-project-management, github-release-management, github-workflow-automation
❌ Other platform skills (12): hive-mind-advanced, hooks-automation, pair-programming, performance-analysis, reasoningbank-agentdb, reasoningbank-intelligence, skill-builder, sparc-methodology, stream-chain, swarm-advanced, swarm-orchestration, verification-quality
Files Modified
src/cli/commands/init.ts- Line 227: Added
.claude/skillsto directory list - Line 243: Added
await this.copySkillTemplates()call - Lines 700-831: New
copySkillTemplates()method - Lines 833-849: New
countSkillDirs()helper method
- Line 227: Added
Build Status
$ npm run build
> agentic-qe@1.1.0 build
> tsc
✅ Build succeeded with no errors
Next Steps
Task 2: Implement aqe skills list command (CLI-ENHANCEMENT-ANALYSIS.md HIGH PRIORITY #2)
Task 3: Add skills field to agent definitions (CLI-ENHANCEMENT-ANALYSIS.md HIGH PRIORITY #3)
Success Metrics
- ✅
.claude/skillsdirectory created duringaqe init - ✅ Exactly 17 QE skills initialized (verified by test)
- ✅ 25 Claude Flow skills filtered out (verified by test)
- ✅ All 17 skills present and correct (verified by test)
- ✅ TypeScript compiles without errors
- ✅ Proper console logging with progress indicators
References
- Specification:
docs/CLI-ENHANCEMENT-ANALYSIS.md(Section 1) - Skills Mapping:
docs/SKILLS-MAPPING.md - Test Script:
/tmp/test-skills-copy.js - Implementation:
src/cli/commands/init.ts:700-849
Status: ✅ COMPLETED
Date Completed: October 20, 2025
Test Coverage: Unit tested (logic validation)
Integration Test: Pending full aqe init run