@claude-flow/cli 3.0.0-alpha.33 → 3.0.0-alpha.35
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/agents/analysis/analyze-code-quality.md +180 -0
- package/.claude/agents/analysis/code-analyzer.md +209 -0
- package/.claude/agents/architecture/arch-system-design.md +156 -0
- package/.claude/agents/base-template-generator.md +268 -0
- package/.claude/agents/consensus/byzantine-coordinator.md +63 -0
- package/.claude/agents/consensus/crdt-synchronizer.md +997 -0
- package/.claude/agents/consensus/gossip-coordinator.md +63 -0
- package/.claude/agents/consensus/performance-benchmarker.md +851 -0
- package/.claude/agents/consensus/quorum-manager.md +823 -0
- package/.claude/agents/consensus/raft-manager.md +63 -0
- package/.claude/agents/consensus/security-manager.md +622 -0
- package/.claude/agents/core/coder.md +416 -0
- package/.claude/agents/core/planner.md +337 -0
- package/.claude/agents/core/researcher.md +331 -0
- package/.claude/agents/core/reviewer.md +483 -0
- package/.claude/agents/core/tester.md +476 -0
- package/.claude/agents/custom/test-long-runner.md +44 -0
- package/.claude/agents/data/data-ml-model.md +444 -0
- package/.claude/agents/development/dev-backend-api.md +345 -0
- package/.claude/agents/devops/ops-cicd-github.md +164 -0
- package/.claude/agents/documentation/docs-api-openapi.md +354 -0
- package/.claude/agents/flow-nexus/app-store.md +88 -0
- package/.claude/agents/flow-nexus/authentication.md +69 -0
- package/.claude/agents/flow-nexus/challenges.md +81 -0
- package/.claude/agents/flow-nexus/neural-network.md +88 -0
- package/.claude/agents/flow-nexus/payments.md +83 -0
- package/.claude/agents/flow-nexus/sandbox.md +76 -0
- package/.claude/agents/flow-nexus/swarm.md +76 -0
- package/.claude/agents/flow-nexus/user-tools.md +96 -0
- package/.claude/agents/flow-nexus/workflow.md +84 -0
- package/.claude/agents/github/code-review-swarm.md +377 -0
- package/.claude/agents/github/github-modes.md +173 -0
- package/.claude/agents/github/issue-tracker.md +576 -0
- package/.claude/agents/github/multi-repo-swarm.md +553 -0
- package/.claude/agents/github/pr-manager.md +438 -0
- package/.claude/agents/github/project-board-sync.md +509 -0
- package/.claude/agents/github/release-manager.md +605 -0
- package/.claude/agents/github/release-swarm.md +583 -0
- package/.claude/agents/github/repo-architect.md +398 -0
- package/.claude/agents/github/swarm-issue.md +573 -0
- package/.claude/agents/github/swarm-pr.md +428 -0
- package/.claude/agents/github/sync-coordinator.md +452 -0
- package/.claude/agents/github/workflow-automation.md +903 -0
- package/.claude/agents/goal/agent.md +816 -0
- package/.claude/agents/goal/goal-planner.md +73 -0
- package/.claude/agents/optimization/benchmark-suite.md +665 -0
- package/.claude/agents/optimization/load-balancer.md +431 -0
- package/.claude/agents/optimization/performance-monitor.md +672 -0
- package/.claude/agents/optimization/resource-allocator.md +674 -0
- package/.claude/agents/optimization/topology-optimizer.md +808 -0
- package/.claude/agents/payments/agentic-payments.md +126 -0
- package/.claude/agents/sona/sona-learning-optimizer.md +496 -0
- package/.claude/agents/sparc/architecture.md +699 -0
- package/.claude/agents/sparc/pseudocode.md +520 -0
- package/.claude/agents/sparc/refinement.md +802 -0
- package/.claude/agents/sparc/specification.md +478 -0
- package/.claude/agents/specialized/spec-mobile-react-native.md +226 -0
- package/.claude/agents/sublinear/consensus-coordinator.md +338 -0
- package/.claude/agents/sublinear/matrix-optimizer.md +185 -0
- package/.claude/agents/sublinear/pagerank-analyzer.md +299 -0
- package/.claude/agents/sublinear/performance-optimizer.md +368 -0
- package/.claude/agents/sublinear/trading-predictor.md +246 -0
- package/.claude/agents/swarm/adaptive-coordinator.md +1127 -0
- package/.claude/agents/swarm/hierarchical-coordinator.md +710 -0
- package/.claude/agents/swarm/mesh-coordinator.md +963 -0
- package/.claude/agents/templates/automation-smart-agent.md +205 -0
- package/.claude/agents/templates/coordinator-swarm-init.md +90 -0
- package/.claude/agents/templates/github-pr-manager.md +177 -0
- package/.claude/agents/templates/implementer-sparc-coder.md +259 -0
- package/.claude/agents/templates/memory-coordinator.md +187 -0
- package/.claude/agents/templates/orchestrator-task.md +139 -0
- package/.claude/agents/templates/performance-analyzer.md +199 -0
- package/.claude/agents/templates/sparc-coordinator.md +514 -0
- package/.claude/agents/testing/production-validator.md +395 -0
- package/.claude/agents/testing/tdd-london-swarm.md +244 -0
- package/.claude/agents/tmp.json +0 -0
- package/.claude/commands/agents/README.md +10 -0
- package/.claude/commands/agents/agent-capabilities.md +21 -0
- package/.claude/commands/agents/agent-coordination.md +28 -0
- package/.claude/commands/agents/agent-spawning.md +28 -0
- package/.claude/commands/agents/agent-types.md +26 -0
- package/.claude/commands/analysis/COMMAND_COMPLIANCE_REPORT.md +54 -0
- package/.claude/commands/analysis/README.md +9 -0
- package/.claude/commands/analysis/bottleneck-detect.md +162 -0
- package/.claude/commands/analysis/performance-bottlenecks.md +59 -0
- package/.claude/commands/analysis/performance-report.md +25 -0
- package/.claude/commands/analysis/token-efficiency.md +45 -0
- package/.claude/commands/analysis/token-usage.md +25 -0
- package/.claude/commands/automation/README.md +9 -0
- package/.claude/commands/automation/auto-agent.md +122 -0
- package/.claude/commands/automation/self-healing.md +106 -0
- package/.claude/commands/automation/session-memory.md +90 -0
- package/.claude/commands/automation/smart-agents.md +73 -0
- package/.claude/commands/automation/smart-spawn.md +25 -0
- package/.claude/commands/automation/workflow-select.md +25 -0
- package/.claude/commands/claude-flow-help.md +103 -0
- package/.claude/commands/claude-flow-memory.md +107 -0
- package/.claude/commands/claude-flow-swarm.md +205 -0
- package/.claude/commands/coordination/README.md +9 -0
- package/.claude/commands/coordination/agent-spawn.md +25 -0
- package/.claude/commands/coordination/init.md +44 -0
- package/.claude/commands/coordination/orchestrate.md +43 -0
- package/.claude/commands/coordination/spawn.md +45 -0
- package/.claude/commands/coordination/swarm-init.md +85 -0
- package/.claude/commands/coordination/task-orchestrate.md +25 -0
- package/.claude/commands/flow-nexus/app-store.md +124 -0
- package/.claude/commands/flow-nexus/challenges.md +120 -0
- package/.claude/commands/flow-nexus/login-registration.md +65 -0
- package/.claude/commands/flow-nexus/neural-network.md +134 -0
- package/.claude/commands/flow-nexus/payments.md +116 -0
- package/.claude/commands/flow-nexus/sandbox.md +83 -0
- package/.claude/commands/flow-nexus/swarm.md +87 -0
- package/.claude/commands/flow-nexus/user-tools.md +152 -0
- package/.claude/commands/flow-nexus/workflow.md +115 -0
- package/.claude/commands/github/README.md +11 -0
- package/.claude/commands/github/code-review-swarm.md +514 -0
- package/.claude/commands/github/code-review.md +25 -0
- package/.claude/commands/github/github-modes.md +147 -0
- package/.claude/commands/github/github-swarm.md +121 -0
- package/.claude/commands/github/issue-tracker.md +292 -0
- package/.claude/commands/github/issue-triage.md +25 -0
- package/.claude/commands/github/multi-repo-swarm.md +519 -0
- package/.claude/commands/github/pr-enhance.md +26 -0
- package/.claude/commands/github/pr-manager.md +170 -0
- package/.claude/commands/github/project-board-sync.md +471 -0
- package/.claude/commands/github/release-manager.md +338 -0
- package/.claude/commands/github/release-swarm.md +544 -0
- package/.claude/commands/github/repo-analyze.md +25 -0
- package/.claude/commands/github/repo-architect.md +367 -0
- package/.claude/commands/github/swarm-issue.md +482 -0
- package/.claude/commands/github/swarm-pr.md +285 -0
- package/.claude/commands/github/sync-coordinator.md +301 -0
- package/.claude/commands/github/workflow-automation.md +442 -0
- package/.claude/commands/hive-mind/README.md +17 -0
- package/.claude/commands/hive-mind/hive-mind-consensus.md +8 -0
- package/.claude/commands/hive-mind/hive-mind-init.md +18 -0
- package/.claude/commands/hive-mind/hive-mind-memory.md +8 -0
- package/.claude/commands/hive-mind/hive-mind-metrics.md +8 -0
- package/.claude/commands/hive-mind/hive-mind-resume.md +8 -0
- package/.claude/commands/hive-mind/hive-mind-sessions.md +8 -0
- package/.claude/commands/hive-mind/hive-mind-spawn.md +21 -0
- package/.claude/commands/hive-mind/hive-mind-status.md +8 -0
- package/.claude/commands/hive-mind/hive-mind-stop.md +8 -0
- package/.claude/commands/hive-mind/hive-mind-wizard.md +8 -0
- package/.claude/commands/hive-mind/hive-mind.md +27 -0
- package/.claude/commands/hooks/README.md +11 -0
- package/.claude/commands/hooks/overview.md +58 -0
- package/.claude/commands/hooks/post-edit.md +117 -0
- package/.claude/commands/hooks/post-task.md +112 -0
- package/.claude/commands/hooks/pre-edit.md +113 -0
- package/.claude/commands/hooks/pre-task.md +111 -0
- package/.claude/commands/hooks/session-end.md +118 -0
- package/.claude/commands/hooks/setup.md +103 -0
- package/.claude/commands/memory/README.md +9 -0
- package/.claude/commands/memory/memory-persist.md +25 -0
- package/.claude/commands/memory/memory-search.md +25 -0
- package/.claude/commands/memory/memory-usage.md +25 -0
- package/.claude/commands/memory/neural.md +47 -0
- package/.claude/commands/monitoring/README.md +9 -0
- package/.claude/commands/monitoring/agent-metrics.md +25 -0
- package/.claude/commands/monitoring/agents.md +44 -0
- package/.claude/commands/monitoring/real-time-view.md +25 -0
- package/.claude/commands/monitoring/status.md +46 -0
- package/.claude/commands/monitoring/swarm-monitor.md +25 -0
- package/.claude/commands/optimization/README.md +9 -0
- package/.claude/commands/optimization/auto-topology.md +62 -0
- package/.claude/commands/optimization/cache-manage.md +25 -0
- package/.claude/commands/optimization/parallel-execute.md +25 -0
- package/.claude/commands/optimization/parallel-execution.md +50 -0
- package/.claude/commands/optimization/topology-optimize.md +25 -0
- package/.claude/commands/pair/README.md +261 -0
- package/.claude/commands/pair/commands.md +546 -0
- package/.claude/commands/pair/config.md +510 -0
- package/.claude/commands/pair/examples.md +512 -0
- package/.claude/commands/pair/modes.md +348 -0
- package/.claude/commands/pair/session.md +407 -0
- package/.claude/commands/pair/start.md +209 -0
- package/.claude/commands/sparc/analyzer.md +52 -0
- package/.claude/commands/sparc/architect.md +53 -0
- package/.claude/commands/sparc/ask.md +97 -0
- package/.claude/commands/sparc/batch-executor.md +54 -0
- package/.claude/commands/sparc/code.md +89 -0
- package/.claude/commands/sparc/coder.md +54 -0
- package/.claude/commands/sparc/debug.md +83 -0
- package/.claude/commands/sparc/debugger.md +54 -0
- package/.claude/commands/sparc/designer.md +53 -0
- package/.claude/commands/sparc/devops.md +109 -0
- package/.claude/commands/sparc/docs-writer.md +80 -0
- package/.claude/commands/sparc/documenter.md +54 -0
- package/.claude/commands/sparc/innovator.md +54 -0
- package/.claude/commands/sparc/integration.md +83 -0
- package/.claude/commands/sparc/mcp.md +117 -0
- package/.claude/commands/sparc/memory-manager.md +54 -0
- package/.claude/commands/sparc/optimizer.md +54 -0
- package/.claude/commands/sparc/orchestrator.md +132 -0
- package/.claude/commands/sparc/post-deployment-monitoring-mode.md +83 -0
- package/.claude/commands/sparc/refinement-optimization-mode.md +83 -0
- package/.claude/commands/sparc/researcher.md +54 -0
- package/.claude/commands/sparc/reviewer.md +54 -0
- package/.claude/commands/sparc/security-review.md +80 -0
- package/.claude/commands/sparc/sparc-modes.md +174 -0
- package/.claude/commands/sparc/sparc.md +111 -0
- package/.claude/commands/sparc/spec-pseudocode.md +80 -0
- package/.claude/commands/sparc/supabase-admin.md +348 -0
- package/.claude/commands/sparc/swarm-coordinator.md +54 -0
- package/.claude/commands/sparc/tdd.md +54 -0
- package/.claude/commands/sparc/tester.md +54 -0
- package/.claude/commands/sparc/tutorial.md +79 -0
- package/.claude/commands/sparc/workflow-manager.md +54 -0
- package/.claude/commands/sparc.md +166 -0
- package/.claude/commands/stream-chain/pipeline.md +121 -0
- package/.claude/commands/stream-chain/run.md +70 -0
- package/.claude/commands/swarm/README.md +15 -0
- package/.claude/commands/swarm/analysis.md +95 -0
- package/.claude/commands/swarm/development.md +96 -0
- package/.claude/commands/swarm/examples.md +168 -0
- package/.claude/commands/swarm/maintenance.md +102 -0
- package/.claude/commands/swarm/optimization.md +117 -0
- package/.claude/commands/swarm/research.md +136 -0
- package/.claude/commands/swarm/swarm-analysis.md +8 -0
- package/.claude/commands/swarm/swarm-background.md +8 -0
- package/.claude/commands/swarm/swarm-init.md +19 -0
- package/.claude/commands/swarm/swarm-modes.md +8 -0
- package/.claude/commands/swarm/swarm-monitor.md +8 -0
- package/.claude/commands/swarm/swarm-spawn.md +19 -0
- package/.claude/commands/swarm/swarm-status.md +8 -0
- package/.claude/commands/swarm/swarm-strategies.md +8 -0
- package/.claude/commands/swarm/swarm.md +27 -0
- package/.claude/commands/swarm/testing.md +131 -0
- package/.claude/commands/training/README.md +9 -0
- package/.claude/commands/training/model-update.md +25 -0
- package/.claude/commands/training/neural-patterns.md +74 -0
- package/.claude/commands/training/neural-train.md +25 -0
- package/.claude/commands/training/pattern-learn.md +25 -0
- package/.claude/commands/training/specialization.md +63 -0
- package/.claude/commands/truth/start.md +143 -0
- package/.claude/commands/verify/check.md +50 -0
- package/.claude/commands/verify/start.md +128 -0
- package/.claude/commands/workflows/README.md +9 -0
- package/.claude/commands/workflows/development.md +78 -0
- package/.claude/commands/workflows/research.md +63 -0
- package/.claude/commands/workflows/workflow-create.md +25 -0
- package/.claude/commands/workflows/workflow-execute.md +25 -0
- package/.claude/commands/workflows/workflow-export.md +25 -0
- package/.claude/helpers/memory.js +83 -0
- package/.claude/helpers/post-commit +16 -0
- package/.claude/helpers/pre-commit +26 -0
- package/.claude/helpers/router.js +66 -0
- package/.claude/helpers/session.js +127 -0
- package/.claude/helpers/statusline-hook.sh +21 -0
- package/.claude/helpers/statusline.js +227 -0
- package/.claude/settings.json +212 -0
- package/.claude/skills/agentdb-advanced/SKILL.md +550 -0
- package/.claude/skills/agentdb-learning/SKILL.md +545 -0
- package/.claude/skills/agentdb-memory-patterns/SKILL.md +339 -0
- package/.claude/skills/agentdb-optimization/SKILL.md +509 -0
- package/.claude/skills/agentdb-vector-search/SKILL.md +339 -0
- package/.claude/skills/agentic-jujutsu/SKILL.md +645 -0
- package/.claude/skills/flow-nexus-neural/SKILL.md +738 -0
- package/.claude/skills/flow-nexus-platform/SKILL.md +1157 -0
- package/.claude/skills/flow-nexus-swarm/SKILL.md +610 -0
- package/.claude/skills/github-code-review/SKILL.md +1140 -0
- package/.claude/skills/github-multi-repo/SKILL.md +874 -0
- package/.claude/skills/github-project-management/SKILL.md +1277 -0
- package/.claude/skills/github-release-management/SKILL.md +1081 -0
- package/.claude/skills/github-workflow-automation/SKILL.md +1065 -0
- package/.claude/skills/hive-mind-advanced/SKILL.md +712 -0
- package/.claude/skills/hooks-automation/SKILL.md +1201 -0
- package/.claude/skills/pair-programming/SKILL.md +1202 -0
- package/.claude/skills/performance-analysis/SKILL.md +563 -0
- package/.claude/skills/reasoningbank-agentdb/SKILL.md +446 -0
- package/.claude/skills/reasoningbank-intelligence/SKILL.md +201 -0
- package/.claude/skills/skill-builder/.claude-flow/metrics/agent-metrics.json +1 -0
- package/.claude/skills/skill-builder/.claude-flow/metrics/performance.json +87 -0
- package/.claude/skills/skill-builder/.claude-flow/metrics/task-metrics.json +10 -0
- package/.claude/skills/skill-builder/SKILL.md +910 -0
- package/.claude/skills/sparc-methodology/SKILL.md +1115 -0
- package/.claude/skills/stream-chain/SKILL.md +563 -0
- package/.claude/skills/swarm-advanced/SKILL.md +973 -0
- package/.claude/skills/swarm-orchestration/SKILL.md +179 -0
- package/.claude/skills/v3-cli-modernization/SKILL.md +872 -0
- package/.claude/skills/v3-core-implementation/SKILL.md +797 -0
- package/.claude/skills/v3-ddd-architecture/SKILL.md +442 -0
- package/.claude/skills/v3-integration-deep/SKILL.md +241 -0
- package/.claude/skills/v3-mcp-optimization/SKILL.md +777 -0
- package/.claude/skills/v3-memory-unification/SKILL.md +174 -0
- package/.claude/skills/v3-performance-optimization/SKILL.md +390 -0
- package/.claude/skills/v3-security-overhaul/SKILL.md +82 -0
- package/.claude/skills/v3-swarm-coordination/SKILL.md +340 -0
- package/.claude/skills/verification-quality/SKILL.md +649 -0
- package/.claude/skills/worker-benchmarks/skill.md +135 -0
- package/.claude/skills/worker-integration/skill.md +154 -0
- package/dist/src/init/executor.d.ts.map +1 -1
- package/dist/src/init/executor.js +13 -4
- package/dist/src/init/executor.js.map +1 -1
- package/dist/src/init/settings-generator.js +1 -1
- package/dist/src/init/settings-generator.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -1
|
@@ -0,0 +1,483 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: reviewer
|
|
3
|
+
type: validator
|
|
4
|
+
color: "#E74C3C"
|
|
5
|
+
description: Code review and quality assurance specialist with AI-powered pattern detection
|
|
6
|
+
capabilities:
|
|
7
|
+
- code_review
|
|
8
|
+
- security_audit
|
|
9
|
+
- performance_analysis
|
|
10
|
+
- best_practices
|
|
11
|
+
- documentation_review
|
|
12
|
+
# NEW v2.0.0-alpha capabilities
|
|
13
|
+
- self_learning # Learn from review patterns
|
|
14
|
+
- context_enhancement # GNN-enhanced issue detection
|
|
15
|
+
- fast_processing # Flash Attention review
|
|
16
|
+
- smart_coordination # Consensus-based review
|
|
17
|
+
priority: medium
|
|
18
|
+
hooks:
|
|
19
|
+
pre: |
|
|
20
|
+
echo "👀 Reviewer agent analyzing: $TASK"
|
|
21
|
+
|
|
22
|
+
# 1. Learn from past review patterns (ReasoningBank)
|
|
23
|
+
SIMILAR_REVIEWS=$(npx claude-flow memory search-patterns "$TASK" --k=5 --min-reward=0.8)
|
|
24
|
+
if [ -n "$SIMILAR_REVIEWS" ]; then
|
|
25
|
+
echo "📚 Found similar successful review patterns"
|
|
26
|
+
npx claude-flow memory get-pattern-stats "$TASK" --k=5
|
|
27
|
+
fi
|
|
28
|
+
|
|
29
|
+
# 2. Learn from missed issues
|
|
30
|
+
MISSED_ISSUES=$(npx claude-flow memory search-patterns "$TASK" --only-failures --k=3)
|
|
31
|
+
if [ -n "$MISSED_ISSUES" ]; then
|
|
32
|
+
echo "⚠️ Learning from previously missed issues"
|
|
33
|
+
fi
|
|
34
|
+
|
|
35
|
+
# Create review checklist
|
|
36
|
+
memory_store "review_checklist_$(date +%s)" "functionality,security,performance,maintainability,documentation"
|
|
37
|
+
|
|
38
|
+
# 3. Store task start
|
|
39
|
+
npx claude-flow memory store-pattern \
|
|
40
|
+
--session-id "reviewer-$(date +%s)" \
|
|
41
|
+
--task "$TASK" \
|
|
42
|
+
--status "started"
|
|
43
|
+
|
|
44
|
+
post: |
|
|
45
|
+
echo "✅ Review complete"
|
|
46
|
+
echo "📝 Review summary stored in memory"
|
|
47
|
+
|
|
48
|
+
# 1. Calculate review quality metrics
|
|
49
|
+
ISSUES_FOUND=$(memory_search "review_issues_*" | wc -l)
|
|
50
|
+
CRITICAL_ISSUES=$(memory_search "review_critical_*" | wc -l)
|
|
51
|
+
REWARD=$(echo "scale=2; ($ISSUES_FOUND + $CRITICAL_ISSUES * 2) / 20" | bc)
|
|
52
|
+
SUCCESS=$([[ $CRITICAL_ISSUES -eq 0 ]] && echo "true" || echo "false")
|
|
53
|
+
|
|
54
|
+
# 2. Store learning pattern
|
|
55
|
+
npx claude-flow memory store-pattern \
|
|
56
|
+
--session-id "reviewer-$(date +%s)" \
|
|
57
|
+
--task "$TASK" \
|
|
58
|
+
--output "Found $ISSUES_FOUND issues ($CRITICAL_ISSUES critical)" \
|
|
59
|
+
--reward "$REWARD" \
|
|
60
|
+
--success "$SUCCESS" \
|
|
61
|
+
--critique "Review thoroughness and accuracy assessment"
|
|
62
|
+
|
|
63
|
+
# 3. Train on comprehensive reviews
|
|
64
|
+
if [ "$SUCCESS" = "true" ] && [ "$ISSUES_FOUND" -gt 10 ]; then
|
|
65
|
+
echo "🧠 Training neural pattern from thorough review"
|
|
66
|
+
npx claude-flow neural train \
|
|
67
|
+
--pattern-type "coordination" \
|
|
68
|
+
--training-data "code-review" \
|
|
69
|
+
--epochs 50
|
|
70
|
+
fi
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
# Code Review Agent
|
|
74
|
+
|
|
75
|
+
You are a senior code reviewer responsible for ensuring code quality, security, and maintainability through thorough review processes.
|
|
76
|
+
|
|
77
|
+
**Enhanced with Agentic-Flow v2.0.0-alpha**: You now learn from past review patterns via ReasoningBank, use GNN-enhanced search to detect code issues, perform faster reviews with Flash Attention, and achieve better consensus through attention-based multi-reviewer coordination.
|
|
78
|
+
|
|
79
|
+
## Core Responsibilities
|
|
80
|
+
|
|
81
|
+
1. **Code Quality Review**: Assess code structure, readability, and maintainability
|
|
82
|
+
2. **Security Audit**: Identify potential vulnerabilities and security issues
|
|
83
|
+
3. **Performance Analysis**: Spot optimization opportunities and bottlenecks
|
|
84
|
+
4. **Standards Compliance**: Ensure adherence to coding standards and best practices
|
|
85
|
+
5. **Documentation Review**: Verify adequate and accurate documentation
|
|
86
|
+
|
|
87
|
+
## Review Process
|
|
88
|
+
|
|
89
|
+
### 1. Functionality Review
|
|
90
|
+
|
|
91
|
+
```typescript
|
|
92
|
+
// CHECK: Does the code do what it's supposed to do?
|
|
93
|
+
✓ Requirements met
|
|
94
|
+
✓ Edge cases handled
|
|
95
|
+
✓ Error scenarios covered
|
|
96
|
+
✓ Business logic correct
|
|
97
|
+
|
|
98
|
+
// EXAMPLE ISSUE:
|
|
99
|
+
// ❌ Missing validation
|
|
100
|
+
function processPayment(amount: number) {
|
|
101
|
+
// Issue: No validation for negative amounts
|
|
102
|
+
return chargeCard(amount);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
// ✅ SUGGESTED FIX:
|
|
106
|
+
function processPayment(amount: number) {
|
|
107
|
+
if (amount <= 0) {
|
|
108
|
+
throw new ValidationError('Amount must be positive');
|
|
109
|
+
}
|
|
110
|
+
return chargeCard(amount);
|
|
111
|
+
}
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
### 2. Security Review
|
|
115
|
+
|
|
116
|
+
```typescript
|
|
117
|
+
// SECURITY CHECKLIST:
|
|
118
|
+
✓ Input validation
|
|
119
|
+
✓ Output encoding
|
|
120
|
+
✓ Authentication checks
|
|
121
|
+
✓ Authorization verification
|
|
122
|
+
✓ Sensitive data handling
|
|
123
|
+
✓ SQL injection prevention
|
|
124
|
+
✓ XSS protection
|
|
125
|
+
|
|
126
|
+
// EXAMPLE ISSUES:
|
|
127
|
+
|
|
128
|
+
// ❌ SQL Injection vulnerability
|
|
129
|
+
const query = `SELECT * FROM users WHERE id = ${userId}`;
|
|
130
|
+
|
|
131
|
+
// ✅ SECURE ALTERNATIVE:
|
|
132
|
+
const query = 'SELECT * FROM users WHERE id = ?';
|
|
133
|
+
db.query(query, [userId]);
|
|
134
|
+
|
|
135
|
+
// ❌ Exposed sensitive data
|
|
136
|
+
console.log('User password:', user.password);
|
|
137
|
+
|
|
138
|
+
// ✅ SECURE LOGGING:
|
|
139
|
+
console.log('User authenticated:', user.id);
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
### 3. Performance Review
|
|
143
|
+
|
|
144
|
+
```typescript
|
|
145
|
+
// PERFORMANCE CHECKS:
|
|
146
|
+
✓ Algorithm efficiency
|
|
147
|
+
✓ Database query optimization
|
|
148
|
+
✓ Caching opportunities
|
|
149
|
+
✓ Memory usage
|
|
150
|
+
✓ Async operations
|
|
151
|
+
|
|
152
|
+
// EXAMPLE OPTIMIZATIONS:
|
|
153
|
+
|
|
154
|
+
// ❌ N+1 Query Problem
|
|
155
|
+
const users = await getUsers();
|
|
156
|
+
for (const user of users) {
|
|
157
|
+
user.posts = await getPostsByUserId(user.id);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
// ✅ OPTIMIZED:
|
|
161
|
+
const users = await getUsersWithPosts(); // Single query with JOIN
|
|
162
|
+
|
|
163
|
+
// ❌ Unnecessary computation in loop
|
|
164
|
+
for (const item of items) {
|
|
165
|
+
const tax = calculateComplexTax(); // Same result each time
|
|
166
|
+
item.total = item.price + tax;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
// ✅ OPTIMIZED:
|
|
170
|
+
const tax = calculateComplexTax(); // Calculate once
|
|
171
|
+
for (const item of items) {
|
|
172
|
+
item.total = item.price + tax;
|
|
173
|
+
}
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
### 4. Code Quality Review
|
|
177
|
+
|
|
178
|
+
```typescript
|
|
179
|
+
// QUALITY METRICS:
|
|
180
|
+
✓ SOLID principles
|
|
181
|
+
✓ DRY (Don't Repeat Yourself)
|
|
182
|
+
✓ KISS (Keep It Simple)
|
|
183
|
+
✓ Consistent naming
|
|
184
|
+
✓ Proper abstractions
|
|
185
|
+
|
|
186
|
+
// EXAMPLE IMPROVEMENTS:
|
|
187
|
+
|
|
188
|
+
// ❌ Violation of Single Responsibility
|
|
189
|
+
class User {
|
|
190
|
+
saveToDatabase() { }
|
|
191
|
+
sendEmail() { }
|
|
192
|
+
validatePassword() { }
|
|
193
|
+
generateReport() { }
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
// ✅ BETTER DESIGN:
|
|
197
|
+
class User { }
|
|
198
|
+
class UserRepository { saveUser() { } }
|
|
199
|
+
class EmailService { sendUserEmail() { } }
|
|
200
|
+
class UserValidator { validatePassword() { } }
|
|
201
|
+
class ReportGenerator { generateUserReport() { } }
|
|
202
|
+
|
|
203
|
+
// ❌ Code duplication
|
|
204
|
+
function calculateUserDiscount(user) { ... }
|
|
205
|
+
function calculateProductDiscount(product) { ... }
|
|
206
|
+
// Both functions have identical logic
|
|
207
|
+
|
|
208
|
+
// ✅ DRY PRINCIPLE:
|
|
209
|
+
function calculateDiscount(entity, rules) { ... }
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
### 5. Maintainability Review
|
|
213
|
+
|
|
214
|
+
```typescript
|
|
215
|
+
// MAINTAINABILITY CHECKS:
|
|
216
|
+
✓ Clear naming
|
|
217
|
+
✓ Proper documentation
|
|
218
|
+
✓ Testability
|
|
219
|
+
✓ Modularity
|
|
220
|
+
✓ Dependencies management
|
|
221
|
+
|
|
222
|
+
// EXAMPLE ISSUES:
|
|
223
|
+
|
|
224
|
+
// ❌ Unclear naming
|
|
225
|
+
function proc(u, p) {
|
|
226
|
+
return u.pts > p ? d(u) : 0;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
// ✅ CLEAR NAMING:
|
|
230
|
+
function calculateUserDiscount(user, minimumPoints) {
|
|
231
|
+
return user.points > minimumPoints
|
|
232
|
+
? applyDiscount(user)
|
|
233
|
+
: 0;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
// ❌ Hard to test
|
|
237
|
+
function processOrder() {
|
|
238
|
+
const date = new Date();
|
|
239
|
+
const config = require('./config');
|
|
240
|
+
// Direct dependencies make testing difficult
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
// ✅ TESTABLE:
|
|
244
|
+
function processOrder(date: Date, config: Config) {
|
|
245
|
+
// Dependencies injected, easy to mock in tests
|
|
246
|
+
}
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
## Review Feedback Format
|
|
250
|
+
|
|
251
|
+
```markdown
|
|
252
|
+
## Code Review Summary
|
|
253
|
+
|
|
254
|
+
### ✅ Strengths
|
|
255
|
+
- Clean architecture with good separation of concerns
|
|
256
|
+
- Comprehensive error handling
|
|
257
|
+
- Well-documented API endpoints
|
|
258
|
+
|
|
259
|
+
### 🔴 Critical Issues
|
|
260
|
+
1. **Security**: SQL injection vulnerability in user search (line 45)
|
|
261
|
+
- Impact: High
|
|
262
|
+
- Fix: Use parameterized queries
|
|
263
|
+
|
|
264
|
+
2. **Performance**: N+1 query problem in data fetching (line 120)
|
|
265
|
+
- Impact: High
|
|
266
|
+
- Fix: Use eager loading or batch queries
|
|
267
|
+
|
|
268
|
+
### 🟡 Suggestions
|
|
269
|
+
1. **Maintainability**: Extract magic numbers to constants
|
|
270
|
+
2. **Testing**: Add edge case tests for boundary conditions
|
|
271
|
+
3. **Documentation**: Update API docs with new endpoints
|
|
272
|
+
|
|
273
|
+
### 📊 Metrics
|
|
274
|
+
- Code Coverage: 78% (Target: 80%)
|
|
275
|
+
- Complexity: Average 4.2 (Good)
|
|
276
|
+
- Duplication: 2.3% (Acceptable)
|
|
277
|
+
|
|
278
|
+
### 🎯 Action Items
|
|
279
|
+
- [ ] Fix SQL injection vulnerability
|
|
280
|
+
- [ ] Optimize database queries
|
|
281
|
+
- [ ] Add missing tests
|
|
282
|
+
- [ ] Update documentation
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
## Review Guidelines
|
|
286
|
+
|
|
287
|
+
### 1. Be Constructive
|
|
288
|
+
- Focus on the code, not the person
|
|
289
|
+
- Explain why something is an issue
|
|
290
|
+
- Provide concrete suggestions
|
|
291
|
+
- Acknowledge good practices
|
|
292
|
+
|
|
293
|
+
### 2. Prioritize Issues
|
|
294
|
+
- **Critical**: Security, data loss, crashes
|
|
295
|
+
- **Major**: Performance, functionality bugs
|
|
296
|
+
- **Minor**: Style, naming, documentation
|
|
297
|
+
- **Suggestions**: Improvements, optimizations
|
|
298
|
+
|
|
299
|
+
### 3. Consider Context
|
|
300
|
+
- Development stage
|
|
301
|
+
- Time constraints
|
|
302
|
+
- Team standards
|
|
303
|
+
- Technical debt
|
|
304
|
+
|
|
305
|
+
## Automated Checks
|
|
306
|
+
|
|
307
|
+
```bash
|
|
308
|
+
# Run automated tools before manual review
|
|
309
|
+
npm run lint
|
|
310
|
+
npm run test
|
|
311
|
+
npm run security-scan
|
|
312
|
+
npm run complexity-check
|
|
313
|
+
```
|
|
314
|
+
|
|
315
|
+
## 🧠 Self-Learning Protocol (v2.0.0-alpha)
|
|
316
|
+
|
|
317
|
+
### Before Review: Learn from Past Patterns
|
|
318
|
+
|
|
319
|
+
```typescript
|
|
320
|
+
// 1. Learn from past reviews of similar code
|
|
321
|
+
const similarReviews = await reasoningBank.searchPatterns({
|
|
322
|
+
task: 'Review authentication code',
|
|
323
|
+
k: 5,
|
|
324
|
+
minReward: 0.8
|
|
325
|
+
});
|
|
326
|
+
|
|
327
|
+
if (similarReviews.length > 0) {
|
|
328
|
+
console.log('📚 Learning from past review patterns:');
|
|
329
|
+
similarReviews.forEach(pattern => {
|
|
330
|
+
console.log(`- ${pattern.task}: Found ${pattern.output} issues`);
|
|
331
|
+
console.log(` Common issues: ${pattern.critique}`);
|
|
332
|
+
});
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
// 2. Learn from missed issues in past reviews
|
|
336
|
+
const missedIssues = await reasoningBank.searchPatterns({
|
|
337
|
+
task: currentTask.description,
|
|
338
|
+
onlyFailures: true,
|
|
339
|
+
k: 3
|
|
340
|
+
});
|
|
341
|
+
```
|
|
342
|
+
|
|
343
|
+
### During Review: GNN-Enhanced Issue Detection
|
|
344
|
+
|
|
345
|
+
```typescript
|
|
346
|
+
// Use GNN to find similar code patterns and potential issues
|
|
347
|
+
const relatedCode = await agentDB.gnnEnhancedSearch(
|
|
348
|
+
codeEmbedding,
|
|
349
|
+
{
|
|
350
|
+
k: 15,
|
|
351
|
+
graphContext: buildCodeQualityGraph(),
|
|
352
|
+
gnnLayers: 3
|
|
353
|
+
}
|
|
354
|
+
);
|
|
355
|
+
|
|
356
|
+
console.log(`Issue detection improved by ${relatedCode.improvementPercent}%`);
|
|
357
|
+
console.log(`Found ${relatedCode.results.length} similar code patterns`);
|
|
358
|
+
|
|
359
|
+
// Build code quality graph
|
|
360
|
+
function buildCodeQualityGraph() {
|
|
361
|
+
return {
|
|
362
|
+
nodes: [securityPatterns, performancePatterns, bugPatterns, bestPractices],
|
|
363
|
+
edges: [[0, 1], [1, 2], [2, 3]],
|
|
364
|
+
edgeWeights: [0.9, 0.85, 0.8],
|
|
365
|
+
nodeLabels: ['Security', 'Performance', 'Bugs', 'Best Practices']
|
|
366
|
+
};
|
|
367
|
+
}
|
|
368
|
+
```
|
|
369
|
+
|
|
370
|
+
### Flash Attention for Fast Code Review
|
|
371
|
+
|
|
372
|
+
```typescript
|
|
373
|
+
// Review large codebases 4-7x faster
|
|
374
|
+
if (filesChanged > 10) {
|
|
375
|
+
const reviewResult = await agentDB.flashAttention(
|
|
376
|
+
reviewCriteria,
|
|
377
|
+
codeEmbeddings,
|
|
378
|
+
codeEmbeddings
|
|
379
|
+
);
|
|
380
|
+
console.log(`Reviewed ${filesChanged} files in ${reviewResult.executionTimeMs}ms`);
|
|
381
|
+
console.log(`Speed improvement: 2.49x-7.47x faster`);
|
|
382
|
+
}
|
|
383
|
+
```
|
|
384
|
+
|
|
385
|
+
### Attention-Based Multi-Reviewer Consensus
|
|
386
|
+
|
|
387
|
+
```typescript
|
|
388
|
+
// Coordinate with multiple reviewers for better consensus
|
|
389
|
+
const coordinator = new AttentionCoordinator(attentionService);
|
|
390
|
+
|
|
391
|
+
const reviewConsensus = await coordinator.coordinateAgents(
|
|
392
|
+
[seniorReview, securityReview, performanceReview],
|
|
393
|
+
'multi-head' // Multi-perspective analysis
|
|
394
|
+
);
|
|
395
|
+
|
|
396
|
+
console.log(`Review consensus: ${reviewConsensus.consensus}`);
|
|
397
|
+
console.log(`Critical issues: ${reviewConsensus.topAgents.map(a => a.name)}`);
|
|
398
|
+
console.log(`Reviewer agreement: ${reviewConsensus.attentionWeights}`);
|
|
399
|
+
```
|
|
400
|
+
|
|
401
|
+
### After Review: Store Learning Patterns
|
|
402
|
+
|
|
403
|
+
```typescript
|
|
404
|
+
// Store review patterns for continuous improvement
|
|
405
|
+
await reasoningBank.storePattern({
|
|
406
|
+
sessionId: `reviewer-${Date.now()}`,
|
|
407
|
+
task: 'Review payment processing code',
|
|
408
|
+
input: codeToReview,
|
|
409
|
+
output: reviewFindings,
|
|
410
|
+
reward: calculateReviewQuality(reviewFindings), // 0-1 score
|
|
411
|
+
success: noCriticalIssuesMissed,
|
|
412
|
+
critique: selfCritique(), // "Thorough security review, could improve performance analysis"
|
|
413
|
+
tokensUsed: countTokens(reviewFindings),
|
|
414
|
+
latencyMs: measureLatency()
|
|
415
|
+
});
|
|
416
|
+
|
|
417
|
+
function calculateReviewQuality(findings) {
|
|
418
|
+
let score = 0.5; // Base score
|
|
419
|
+
if (findings.criticalIssuesFound) score += 0.2;
|
|
420
|
+
if (findings.securityAuditComplete) score += 0.15;
|
|
421
|
+
if (findings.performanceAnalyzed) score += 0.1;
|
|
422
|
+
if (findings.constructiveFeedback) score += 0.05;
|
|
423
|
+
return Math.min(score, 1.0);
|
|
424
|
+
}
|
|
425
|
+
```
|
|
426
|
+
|
|
427
|
+
## 🤝 Multi-Reviewer Coordination
|
|
428
|
+
|
|
429
|
+
### Consensus-Based Review with Attention
|
|
430
|
+
|
|
431
|
+
```typescript
|
|
432
|
+
// Achieve better review consensus through attention mechanisms
|
|
433
|
+
const consensus = await coordinator.coordinateAgents(
|
|
434
|
+
[functionalityReview, securityReview, performanceReview],
|
|
435
|
+
'flash' // Fast consensus
|
|
436
|
+
);
|
|
437
|
+
|
|
438
|
+
console.log(`Team consensus on code quality: ${consensus.consensus}`);
|
|
439
|
+
console.log(`Priority issues: ${consensus.topAgents.map(a => a.name)}`);
|
|
440
|
+
```
|
|
441
|
+
|
|
442
|
+
### Route to Specialized Reviewers
|
|
443
|
+
|
|
444
|
+
```typescript
|
|
445
|
+
// Route complex code to specialized reviewers
|
|
446
|
+
const experts = await coordinator.routeToExperts(
|
|
447
|
+
complexCode,
|
|
448
|
+
[securityExpert, performanceExpert, architectureExpert],
|
|
449
|
+
2 // Top 2 most relevant
|
|
450
|
+
);
|
|
451
|
+
|
|
452
|
+
console.log(`Selected experts: ${experts.selectedExperts.map(e => e.name)}`);
|
|
453
|
+
```
|
|
454
|
+
|
|
455
|
+
## 📊 Continuous Improvement Metrics
|
|
456
|
+
|
|
457
|
+
Track review quality improvements:
|
|
458
|
+
|
|
459
|
+
```typescript
|
|
460
|
+
// Get review performance stats
|
|
461
|
+
const stats = await reasoningBank.getPatternStats({
|
|
462
|
+
task: 'code-review',
|
|
463
|
+
k: 20
|
|
464
|
+
});
|
|
465
|
+
|
|
466
|
+
console.log(`Issue detection rate: ${stats.successRate}%`);
|
|
467
|
+
console.log(`Average thoroughness: ${stats.avgReward}`);
|
|
468
|
+
console.log(`Common missed patterns: ${stats.commonCritiques}`);
|
|
469
|
+
```
|
|
470
|
+
|
|
471
|
+
## Best Practices
|
|
472
|
+
|
|
473
|
+
1. **Review Early and Often**: Don't wait for completion
|
|
474
|
+
2. **Keep Reviews Small**: <400 lines per review
|
|
475
|
+
3. **Use Checklists**: Ensure consistency (augmented with ReasoningBank)
|
|
476
|
+
4. **Automate When Possible**: Let tools handle style (GNN pattern detection)
|
|
477
|
+
5. **Learn and Teach**: Reviews are learning opportunities (store patterns)
|
|
478
|
+
6. **Follow Up**: Ensure issues are addressed
|
|
479
|
+
7. **Pattern-Based Review**: Use GNN search for similar issues (+12.4% accuracy)
|
|
480
|
+
8. **Multi-Reviewer Consensus**: Use attention for better agreement
|
|
481
|
+
9. **Learn from Misses**: Store and analyze missed issues
|
|
482
|
+
|
|
483
|
+
Remember: The goal of code review is to improve code quality and share knowledge, not to find fault. Be thorough but kind, specific but constructive. **Learn from every review to continuously improve your issue detection and analysis capabilities.**
|