diff --git a/.agentic-qe/config.yaml b/.agentic-qe/config.yaml new file mode 100644 index 0000000..b2cd779 --- /dev/null +++ b/.agentic-qe/config.yaml @@ -0,0 +1,79 @@ +# Agentic QE v3 Configuration +# Generated by aqe init +# 2026-02-19T17:38:27.216Z +# +# NOTE: Your customizations are PRESERVED when you run "aqe init" again. +# You do NOT need to re-run "aqe init" after editing this file - changes +# take effect immediately. The following settings are merged on reinstall: +# - domains.enabled (custom domains like visual-accessibility) +# - domains.disabled +# - learning.enabled +# - hooks.* preferences +# - workers.enabled +# - agents.maxConcurrent and defaultTimeout + +version: "3.6.13" + +project: + name: "cf-devpod" + root: "/home/user/cf-devpod" + type: "single" + +learning: + enabled: true + embeddingModel: "transformer" + hnswConfig: + M: 8 + efConstruction: 100 + efSearch: 50 + qualityThreshold: 0.5 + promotionThreshold: 2 + pretrainedPatterns: true + +routing: + mode: "ml" + confidenceThreshold: 0.7 + feedbackEnabled: true + +workers: + enabled: + - "pattern-consolidator" + intervals: + pattern-consolidator: 1800000 + coverage-gap-scanner: 3600000 + flaky-test-detector: 7200000 + routing-accuracy-monitor: 900000 + maxConcurrent: 2 + daemonAutoStart: true + +hooks: + claudeCode: true + preCommit: false + ciIntegration: false + +skills: + install: true + installV2: true + installV3: true + overwrite: false + +domains: + enabled: + - "test-generation" + - "test-execution" + - "coverage-analysis" + - "quality-assessment" + - "defect-intelligence" + - "requirements-validation" + - "code-intelligence" + - "security-compliance" + - "contract-testing" + - "visual-accessibility" + - "chaos-resilience" + - "learning-optimization" + - "enterprise-integration" + disabled: + +agents: + maxConcurrent: 5 + defaultTimeout: 60000 diff --git a/.agentic-qe/data/learning-config.json b/.agentic-qe/data/learning-config.json new file mode 100644 index 0000000..d371d2e --- /dev/null +++ b/.agentic-qe/data/learning-config.json @@ -0,0 +1,13 @@ +{ + "embeddingModel": "transformer", + "hnswConfig": { + "M": 8, + "efConstruction": 100, + "efSearch": 50 + }, + "qualityThreshold": 0.5, + "promotionThreshold": 2, + "databasePath": "/home/user/cf-devpod/.agentic-qe/data/memory.db", + "hnswIndexPath": "/home/user/cf-devpod/.agentic-qe/data/hnsw/index.bin", + "initialized": "2026-02-19T17:38:24.021Z" +} \ No newline at end of file diff --git a/.agentic-qe/data/patterns/index.json b/.agentic-qe/data/patterns/index.json new file mode 100644 index 0000000..091a3c0 --- /dev/null +++ b/.agentic-qe/data/patterns/index.json @@ -0,0 +1,5 @@ +{ + "version": "3.6.13", + "domains": [], + "loadedAt": "2026-02-19T17:38:24.022Z" +} \ No newline at end of file diff --git a/.agentic-qe/memory.db-shm b/.agentic-qe/memory.db-shm new file mode 100644 index 0000000..c16dffc Binary files /dev/null and b/.agentic-qe/memory.db-shm differ diff --git a/.agentic-qe/workers/daemon.pid b/.agentic-qe/workers/daemon.pid new file mode 100644 index 0000000..673bb65 --- /dev/null +++ b/.agentic-qe/workers/daemon.pid @@ -0,0 +1 @@ +2575 \ No newline at end of file diff --git a/.agentic-qe/workers/pattern-consolidator.json b/.agentic-qe/workers/pattern-consolidator.json new file mode 100644 index 0000000..b96a347 --- /dev/null +++ b/.agentic-qe/workers/pattern-consolidator.json @@ -0,0 +1,8 @@ +{ + "name": "pattern-consolidator", + "enabled": true, + "interval": 1800000, + "projectRoot": "/home/user/cf-devpod", + "dataDir": "/home/user/cf-devpod/.agentic-qe/data", + "createdAt": "2026-02-19T17:38:25.645Z" +} \ No newline at end of file diff --git a/.agentic-qe/workers/registry.json b/.agentic-qe/workers/registry.json new file mode 100644 index 0000000..33bf1e4 --- /dev/null +++ b/.agentic-qe/workers/registry.json @@ -0,0 +1,15 @@ +{ + "version": "3.6.13", + "maxConcurrent": 2, + "workers": { + "pattern-consolidator": { + "name": "pattern-consolidator", + "enabled": true, + "interval": 1800000, + "lastRun": null, + "status": "pending" + } + }, + "createdAt": "2026-02-19T17:38:25.645Z", + "daemonPid": null +} \ No newline at end of file diff --git a/.agentic-qe/workers/start-daemon.cjs b/.agentic-qe/workers/start-daemon.cjs new file mode 100644 index 0000000..198907b --- /dev/null +++ b/.agentic-qe/workers/start-daemon.cjs @@ -0,0 +1,56 @@ +#!/usr/bin/env node +// AQE v3 Worker Daemon Startup Script (cross-platform) +// Generated by aqe init +// Starts the MCP server with background workers enabled + +const { existsSync, readFileSync, writeFileSync, appendFileSync } = require('fs'); +const { join } = require('path'); +const { spawn } = require('child_process'); + +const projectRoot = join(__dirname, '..', '..'); +const workersDir = join(projectRoot, '.agentic-qe', 'workers'); +const pidFile = join(workersDir, 'daemon.pid'); +const logFile = join(workersDir, 'daemon.log'); + +// Check if already running +if (existsSync(pidFile)) { + const pid = parseInt(readFileSync(pidFile, 'utf-8').trim(), 10); + try { process.kill(pid, 0); console.log('Daemon already running (PID: ' + pid + ')'); process.exit(0); } catch {} +} + +const ts = new Date().toISOString(); +appendFileSync(logFile, '[' + ts + '] Starting AQE v3 Worker Daemon...\n'); + +// Find the best way to run aqe-mcp +const candidates = [ + join(projectRoot, 'node_modules', '.bin', 'aqe-mcp'), + join(projectRoot, 'node_modules', 'agentic-qe', 'v3', 'dist', 'mcp', 'bundle.js'), +]; + +let mcpCmd, mcpArgs; +const binCandidate = candidates.find(c => existsSync(c)); + +if (binCandidate && binCandidate.endsWith('bundle.js')) { + mcpCmd = process.execPath; + mcpArgs = [binCandidate]; +} else if (binCandidate) { + mcpCmd = binCandidate; + mcpArgs = []; +} else { + mcpCmd = process.platform === 'win32' ? 'npx.cmd' : 'npx'; + mcpArgs = ['--yes', 'agentic-qe', 'mcp']; +} + +appendFileSync(logFile, '[' + ts + '] Using: ' + mcpCmd + ' ' + mcpArgs.join(' ') + '\n'); + +const env = { ...process.env, AQE_PROJECT_ROOT: projectRoot, AQE_LEARNING_ENABLED: 'true', AQE_WORKERS_ENABLED: 'true', AQE_HTTP_PORT: '0' }; +const child = spawn(mcpCmd, mcpArgs, { cwd: projectRoot, env, detached: true, stdio: ['ignore', 'pipe', 'pipe'] }); +child.stdout.on('data', d => appendFileSync(logFile, d)); +child.stderr.on('data', d => appendFileSync(logFile, d)); +child.unref(); + +writeFileSync(pidFile, String(child.pid)); +appendFileSync(logFile, '[' + ts + '] Daemon started with PID: ' + child.pid + '\n'); +console.log('AQE v3 Worker Daemon started (PID: ' + child.pid + ')'); +console.log('Log file: ' + logFile); +console.log('To stop: node ' + join(workersDir, 'stop-daemon.cjs')); diff --git a/.agentic-qe/workers/stop-daemon.cjs b/.agentic-qe/workers/stop-daemon.cjs new file mode 100644 index 0000000..fcc303e --- /dev/null +++ b/.agentic-qe/workers/stop-daemon.cjs @@ -0,0 +1,23 @@ +#!/usr/bin/env node +// AQE v3 Worker Daemon Stop Script (cross-platform) +// Generated by aqe init + +const { existsSync, readFileSync, unlinkSync } = require('fs'); +const { join } = require('path'); + +const workersDir = join(__dirname); +const pidFile = join(workersDir, 'daemon.pid'); + +if (!existsSync(pidFile)) { console.log('No PID file found - daemon may not be running'); process.exit(0); } + +const pid = parseInt(readFileSync(pidFile, 'utf-8').trim(), 10); +try { + process.kill(pid, 0); // Check if alive + console.log('Stopping daemon (PID: ' + pid + ')...'); + process.kill(pid, 'SIGTERM'); + try { unlinkSync(pidFile); } catch {} + console.log('Daemon stopped'); +} catch { + console.log('Daemon not running (stale PID file)'); + try { unlinkSync(pidFile); } catch {} +} diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 0000000..804b92c --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,352 @@ +# Claude Code Configuration - Claude Flow V3 + +## Behavioral Rules (Always Enforced) + +- Do what has been asked; nothing more, nothing less +- NEVER create files unless they're absolutely necessary for achieving your goal +- ALWAYS prefer editing an existing file to creating a new one +- NEVER proactively create documentation files (*.md) or README files unless explicitly requested +- NEVER save working files, text/mds, or tests to the root folder +- Never continuously check status after spawning a swarm — wait for results +- ALWAYS read a file before editing it +- NEVER commit secrets, credentials, or .env files + +## File Organization + +- NEVER save to root folder — use the directories below +- Use `/src` for source code files +- Use `/tests` for test files +- Use `/docs` for documentation and markdown files +- Use `/config` for configuration files +- Use `/scripts` for utility scripts +- Use `/examples` for example code + +## Project Architecture + +- Follow Domain-Driven Design with bounded contexts +- Keep files under 500 lines +- Use typed interfaces for all public APIs +- Prefer TDD London School (mock-first) for new code +- Use event sourcing for state changes +- Ensure input validation at system boundaries + +### Project Config + +- **Topology**: hierarchical-mesh +- **Max Agents**: 15 +- **Memory**: hybrid +- **HNSW**: Enabled +- **Neural**: Enabled + +## Build & Test + +```bash +# Build +npm run build + +# Test +npm test + +# Lint +npm run lint +``` + +- ALWAYS run tests after making code changes +- ALWAYS verify build succeeds before committing + +## Security Rules + +- NEVER hardcode API keys, secrets, or credentials in source files +- NEVER commit .env files or any file containing secrets +- Always validate user input at system boundaries +- Always sanitize file paths to prevent directory traversal +- Run `npx @claude-flow/cli@latest security scan` after security-related changes + +## Concurrency: 1 MESSAGE = ALL RELATED OPERATIONS + +- All operations MUST be concurrent/parallel in a single message +- Use Claude Code's Task tool for spawning agents, not just MCP +- ALWAYS batch ALL todos in ONE TodoWrite call (5-10+ minimum) +- ALWAYS spawn ALL agents in ONE message with full instructions via Task tool +- ALWAYS batch ALL file reads/writes/edits in ONE message +- ALWAYS batch ALL Bash commands in ONE message + +## Swarm Orchestration + +- MUST initialize the swarm using CLI tools when starting complex tasks +- MUST spawn concurrent agents using Claude Code's Task tool +- Never use CLI tools alone for execution — Task tool agents do the actual work +- MUST call CLI tools AND Task tool in ONE message for complex work + +### 3-Tier Model Routing (ADR-026) + +| Tier | Handler | Latency | Cost | Use Cases | +|------|---------|---------|------|-----------| +| **1** | Agent Booster (WASM) | <1ms | $0 | Simple transforms (var→const, add types) — Skip LLM | +| **2** | Haiku | ~500ms | $0.0002 | Simple tasks, low complexity (<30%) | +| **3** | Sonnet/Opus | 2-5s | $0.003-0.015 | Complex reasoning, architecture, security (>30%) | + +- Always check for `[AGENT_BOOSTER_AVAILABLE]` or `[TASK_MODEL_RECOMMENDATION]` before spawning agents +- Use Edit tool directly when `[AGENT_BOOSTER_AVAILABLE]` + +## Swarm Configuration & Anti-Drift + +- ALWAYS use hierarchical topology for coding swarms +- Keep maxAgents at 6-8 for tight coordination +- Use specialized strategy for clear role boundaries +- Use `raft` consensus for hive-mind (leader maintains authoritative state) +- Run frequent checkpoints via `post-task` hooks +- Keep shared memory namespace for all agents + +```bash +npx @claude-flow/cli@latest swarm init --topology hierarchical --max-agents 8 --strategy specialized +``` + +## Swarm Execution Rules + +- ALWAYS use `run_in_background: true` for all agent Task calls +- ALWAYS put ALL agent Task calls in ONE message for parallel execution +- After spawning, STOP — do NOT add more tool calls or check status +- Never poll TaskOutput or check swarm status — trust agents to return +- When agent results arrive, review ALL results before proceeding + +## V3 CLI Commands + +### Core Commands + +| Command | Subcommands | Description | +|---------|-------------|-------------| +| `init` | 4 | Project initialization | +| `agent` | 8 | Agent lifecycle management | +| `swarm` | 6 | Multi-agent swarm coordination | +| `memory` | 11 | AgentDB memory with HNSW search | +| `task` | 6 | Task creation and lifecycle | +| `session` | 7 | Session state management | +| `hooks` | 17 | Self-learning hooks + 12 workers | +| `hive-mind` | 6 | Byzantine fault-tolerant consensus | + +### Quick CLI Examples + +```bash +npx @claude-flow/cli@latest init --wizard +npx @claude-flow/cli@latest agent spawn -t coder --name my-coder +npx @claude-flow/cli@latest swarm init --v3-mode +npx @claude-flow/cli@latest memory search --query "authentication patterns" +npx @claude-flow/cli@latest doctor --fix +``` + +## Available Agents (60+ Types) + +### Core Development +`coder`, `reviewer`, `tester`, `planner`, `researcher` + +### Specialized +`security-architect`, `security-auditor`, `memory-specialist`, `performance-engineer` + +### Swarm Coordination +`hierarchical-coordinator`, `mesh-coordinator`, `adaptive-coordinator` + +### GitHub & Repository +`pr-manager`, `code-review-swarm`, `issue-tracker`, `release-manager` + +### SPARC Methodology +`sparc-coord`, `sparc-coder`, `specification`, `pseudocode`, `architecture` + +## Memory Commands Reference + +```bash +# Store (REQUIRED: --key, --value; OPTIONAL: --namespace, --ttl, --tags) +npx @claude-flow/cli@latest memory store --key "pattern-auth" --value "JWT with refresh" --namespace patterns + +# Search (REQUIRED: --query; OPTIONAL: --namespace, --limit, --threshold) +npx @claude-flow/cli@latest memory search --query "authentication patterns" + +# List (OPTIONAL: --namespace, --limit) +npx @claude-flow/cli@latest memory list --namespace patterns --limit 10 + +# Retrieve (REQUIRED: --key; OPTIONAL: --namespace) +npx @claude-flow/cli@latest memory retrieve --key "pattern-auth" --namespace patterns +``` + +## Quick Setup + +```bash +claude mcp add claude-flow -- npx -y @claude-flow/cli@latest +npx @claude-flow/cli@latest daemon start +npx @claude-flow/cli@latest doctor --fix +``` + +## Claude Code vs CLI Tools + +- Claude Code's Task tool handles ALL execution: agents, file ops, code generation, git +- CLI tools handle coordination via Bash: swarm init, memory, hooks, routing +- NEVER use CLI tools as a substitute for Task tool agents + +## Support + +- Documentation: https://github.com/ruvnet/claude-flow +- Issues: https://github.com/ruvnet/claude-flow/issues + + +## Agentic QE v3 + +This project uses **Agentic QE v3** - a Domain-Driven Quality Engineering platform with 13 bounded contexts, ReasoningBank learning, HNSW vector search, and Agent Teams coordination (ADR-064). + +--- + +### CRITICAL POLICIES + +#### Integrity Rule (ABSOLUTE) +- NO shortcuts, fake data, or false claims +- ALWAYS implement properly, verify before claiming success +- ALWAYS use real database queries for integration tests +- ALWAYS run actual tests, not assume they pass + +**We value the quality we deliver to our users.** + +#### Test Execution +- NEVER run `npm test` without `--run` flag (watch mode risk) +- Use: `npm test -- --run`, `npm run test:unit`, `npm run test:integration` when available + +#### Data Protection +- NEVER run `rm -f` on `.agentic-qe/` or `*.db` files without confirmation +- ALWAYS backup before database operations + +#### Git Operations +- NEVER auto-commit/push without explicit user request +- ALWAYS wait for user confirmation before git operations + +--- + +### Quick Reference + +```bash +# Run tests +npm test -- --run + +# Check quality +aqe quality assess + +# Generate tests +aqe test generate + +# Coverage analysis +aqe coverage +``` + +### Using AQE MCP Tools + +AQE exposes tools via MCP with the `mcp__agentic-qe__` prefix. You MUST call `fleet_init` before any other tool. + +#### 1. Initialize the Fleet (required first step) + +```typescript +mcp__agentic-qe__fleet_init({ + topology: "hierarchical", + maxAgents: 15, + memoryBackend: "hybrid" +}) +``` + +#### 2. Generate Tests + +```typescript +mcp__agentic-qe__test_generate_enhanced({ + targetPath: "src/services/auth.ts", + framework: "vitest", + strategy: "boundary-value" +}) +``` + +#### 3. Analyze Coverage + +```typescript +mcp__agentic-qe__coverage_analyze_sublinear({ + paths: ["src/"], + threshold: 80 +}) +``` + +#### 4. Assess Quality + +```typescript +mcp__agentic-qe__quality_assess({ + scope: "full", + includeMetrics: true +}) +``` + +#### 5. Store and Query Patterns (with learning persistence) + +```typescript +// Store a learned pattern +mcp__agentic-qe__memory_store({ + key: "patterns/coverage-gap/{timestamp}", + namespace: "learning", + value: { + pattern: "...", + confidence: 0.95, + type: "coverage-gap", + metadata: { /* domain-specific */ } + }, + persist: true +}) + +// Query stored patterns +mcp__agentic-qe__memory_query({ + pattern: "patterns/*", + namespace: "learning", + limit: 10 +}) +``` + +#### 6. Orchestrate Multi-Agent Tasks + +```typescript +mcp__agentic-qe__task_orchestrate({ + task: "Full quality assessment of auth module", + domains: ["test-generation", "coverage-analysis", "security-compliance"], + parallel: true +}) +``` + +### MCP Tool Reference + +| Tool | Description | +|------|-------------| +| `fleet_init` | Initialize QE fleet (MUST call first) | +| `fleet_status` | Get fleet health and agent status | +| `agent_spawn` | Spawn specialized QE agent | +| `test_generate_enhanced` | AI-powered test generation | +| `test_execute_parallel` | Parallel test execution with retry | +| `task_orchestrate` | Orchestrate multi-agent QE tasks | +| `coverage_analyze_sublinear` | O(log n) coverage analysis | +| `quality_assess` | Quality gate evaluation | +| `memory_store` | Store patterns with namespace + persist | +| `memory_query` | Query patterns by namespace/pattern | +| `security_scan_comprehensive` | SAST/DAST scanning | + +### Configuration + +- **Enabled Domains**: test-generation, test-execution, coverage-analysis, quality-assessment, defect-intelligence, requirements-validation (+7 more) +- **Learning**: Enabled (transformer embeddings) +- **Max Concurrent Agents**: 5 +- **Background Workers**: pattern-consolidator + +### V3 QE Agents + +V3 QE agents are in `.claude/agents/v3/`. Use with Task tool: + +```javascript +Task({ prompt: "Generate tests", subagent_type: "qe-test-architect", run_in_background: true }) +Task({ prompt: "Find coverage gaps", subagent_type: "qe-coverage-specialist", run_in_background: true }) +Task({ prompt: "Security audit", subagent_type: "qe-security-scanner", run_in_background: true }) +``` + +### Data Storage + +- **Memory Backend**: `.agentic-qe/memory.db` (SQLite) +- **Configuration**: `.agentic-qe/config.yaml` + +--- +*Generated by AQE v3 init - 2026-02-19T17:38:27.211Z* diff --git a/CLAUDE.md.backup b/CLAUDE.md.backup new file mode 100644 index 0000000..27c6e8f --- /dev/null +++ b/CLAUDE.md.backup @@ -0,0 +1,188 @@ +# Claude Code Configuration - Claude Flow V3 + +## Behavioral Rules (Always Enforced) + +- Do what has been asked; nothing more, nothing less +- NEVER create files unless they're absolutely necessary for achieving your goal +- ALWAYS prefer editing an existing file to creating a new one +- NEVER proactively create documentation files (*.md) or README files unless explicitly requested +- NEVER save working files, text/mds, or tests to the root folder +- Never continuously check status after spawning a swarm — wait for results +- ALWAYS read a file before editing it +- NEVER commit secrets, credentials, or .env files + +## File Organization + +- NEVER save to root folder — use the directories below +- Use `/src` for source code files +- Use `/tests` for test files +- Use `/docs` for documentation and markdown files +- Use `/config` for configuration files +- Use `/scripts` for utility scripts +- Use `/examples` for example code + +## Project Architecture + +- Follow Domain-Driven Design with bounded contexts +- Keep files under 500 lines +- Use typed interfaces for all public APIs +- Prefer TDD London School (mock-first) for new code +- Use event sourcing for state changes +- Ensure input validation at system boundaries + +### Project Config + +- **Topology**: hierarchical-mesh +- **Max Agents**: 15 +- **Memory**: hybrid +- **HNSW**: Enabled +- **Neural**: Enabled + +## Build & Test + +```bash +# Build +npm run build + +# Test +npm test + +# Lint +npm run lint +``` + +- ALWAYS run tests after making code changes +- ALWAYS verify build succeeds before committing + +## Security Rules + +- NEVER hardcode API keys, secrets, or credentials in source files +- NEVER commit .env files or any file containing secrets +- Always validate user input at system boundaries +- Always sanitize file paths to prevent directory traversal +- Run `npx @claude-flow/cli@latest security scan` after security-related changes + +## Concurrency: 1 MESSAGE = ALL RELATED OPERATIONS + +- All operations MUST be concurrent/parallel in a single message +- Use Claude Code's Task tool for spawning agents, not just MCP +- ALWAYS batch ALL todos in ONE TodoWrite call (5-10+ minimum) +- ALWAYS spawn ALL agents in ONE message with full instructions via Task tool +- ALWAYS batch ALL file reads/writes/edits in ONE message +- ALWAYS batch ALL Bash commands in ONE message + +## Swarm Orchestration + +- MUST initialize the swarm using CLI tools when starting complex tasks +- MUST spawn concurrent agents using Claude Code's Task tool +- Never use CLI tools alone for execution — Task tool agents do the actual work +- MUST call CLI tools AND Task tool in ONE message for complex work + +### 3-Tier Model Routing (ADR-026) + +| Tier | Handler | Latency | Cost | Use Cases | +|------|---------|---------|------|-----------| +| **1** | Agent Booster (WASM) | <1ms | $0 | Simple transforms (var→const, add types) — Skip LLM | +| **2** | Haiku | ~500ms | $0.0002 | Simple tasks, low complexity (<30%) | +| **3** | Sonnet/Opus | 2-5s | $0.003-0.015 | Complex reasoning, architecture, security (>30%) | + +- Always check for `[AGENT_BOOSTER_AVAILABLE]` or `[TASK_MODEL_RECOMMENDATION]` before spawning agents +- Use Edit tool directly when `[AGENT_BOOSTER_AVAILABLE]` + +## Swarm Configuration & Anti-Drift + +- ALWAYS use hierarchical topology for coding swarms +- Keep maxAgents at 6-8 for tight coordination +- Use specialized strategy for clear role boundaries +- Use `raft` consensus for hive-mind (leader maintains authoritative state) +- Run frequent checkpoints via `post-task` hooks +- Keep shared memory namespace for all agents + +```bash +npx @claude-flow/cli@latest swarm init --topology hierarchical --max-agents 8 --strategy specialized +``` + +## Swarm Execution Rules + +- ALWAYS use `run_in_background: true` for all agent Task calls +- ALWAYS put ALL agent Task calls in ONE message for parallel execution +- After spawning, STOP — do NOT add more tool calls or check status +- Never poll TaskOutput or check swarm status — trust agents to return +- When agent results arrive, review ALL results before proceeding + +## V3 CLI Commands + +### Core Commands + +| Command | Subcommands | Description | +|---------|-------------|-------------| +| `init` | 4 | Project initialization | +| `agent` | 8 | Agent lifecycle management | +| `swarm` | 6 | Multi-agent swarm coordination | +| `memory` | 11 | AgentDB memory with HNSW search | +| `task` | 6 | Task creation and lifecycle | +| `session` | 7 | Session state management | +| `hooks` | 17 | Self-learning hooks + 12 workers | +| `hive-mind` | 6 | Byzantine fault-tolerant consensus | + +### Quick CLI Examples + +```bash +npx @claude-flow/cli@latest init --wizard +npx @claude-flow/cli@latest agent spawn -t coder --name my-coder +npx @claude-flow/cli@latest swarm init --v3-mode +npx @claude-flow/cli@latest memory search --query "authentication patterns" +npx @claude-flow/cli@latest doctor --fix +``` + +## Available Agents (60+ Types) + +### Core Development +`coder`, `reviewer`, `tester`, `planner`, `researcher` + +### Specialized +`security-architect`, `security-auditor`, `memory-specialist`, `performance-engineer` + +### Swarm Coordination +`hierarchical-coordinator`, `mesh-coordinator`, `adaptive-coordinator` + +### GitHub & Repository +`pr-manager`, `code-review-swarm`, `issue-tracker`, `release-manager` + +### SPARC Methodology +`sparc-coord`, `sparc-coder`, `specification`, `pseudocode`, `architecture` + +## Memory Commands Reference + +```bash +# Store (REQUIRED: --key, --value; OPTIONAL: --namespace, --ttl, --tags) +npx @claude-flow/cli@latest memory store --key "pattern-auth" --value "JWT with refresh" --namespace patterns + +# Search (REQUIRED: --query; OPTIONAL: --namespace, --limit, --threshold) +npx @claude-flow/cli@latest memory search --query "authentication patterns" + +# List (OPTIONAL: --namespace, --limit) +npx @claude-flow/cli@latest memory list --namespace patterns --limit 10 + +# Retrieve (REQUIRED: --key; OPTIONAL: --namespace) +npx @claude-flow/cli@latest memory retrieve --key "pattern-auth" --namespace patterns +``` + +## Quick Setup + +```bash +claude mcp add claude-flow -- npx -y @claude-flow/cli@latest +npx @claude-flow/cli@latest daemon start +npx @claude-flow/cli@latest doctor --fix +``` + +## Claude Code vs CLI Tools + +- Claude Code's Task tool handles ALL execution: agents, file ops, code generation, git +- CLI tools handle coordination via Bash: swarm init, memory, hooks, routing +- NEVER use CLI tools as a substitute for Task tool agents + +## Support + +- Documentation: https://github.com/ruvnet/claude-flow +- Issues: https://github.com/ruvnet/claude-flow/issues