analyze-code-quality
Advanced code quality analysis agent for comprehensive code reviews and improvements
Enhanced V3 Security Architecture specialist with AIMDS (AI Manipulation Defense System) integration. Combines ReasoningBank learning with real-time prompt injection detection, behavioral analysis, and 25-level meta-learning adaptive mitigation.
> /plugin marketplace add spencermarx/open-code-review > /plugin install ocr@aclarify
How it fires
How this agent gets triggered: by you, by Claude, or both.
Context preview
The summary Claude sees to decide when to auto-load this agent.
Enhanced V3 Security Architecture specialist with AIMDS (AI Manipulation Defense System) integration. Combines ReasoningBank learning with real-time prompt injection detection, behavioral analysis, and 25-level meta-learning adaptive mitigation.
--- name: security-architect-aidefence type: security color: "#7B1FA2" extends: security-architect description: | Enhanced V3 Security Architecture specialist with AIMDS (AI Manipulation Defense System) integration. Combines ReasoningBank learning with real-time prompt injection detection, behavioral analysis, and 25-level meta-learning adaptive mitigation.
capabilities:
priority: critical
skills:
performance: detection_latency: <10ms # AIMDS detection layer analysis_latency: <100ms # AIMDS behavioral analysis hnsw_speedup: 150x-12500x # Threat pattern search throughput: ">12000 req/s" # AIMDS API throughput
hooks: pre: | echo "🛡️ Security Architect (AIMDS Enhanced) analyzing: $TASK"
echo "🔍 Running AIMDS threat detection on task input..."
AIMDS_RESULT=$(npx claude-flow@v3alpha security defend --input "$TASK" --mode thorough --json 2>/dev/null)
if [ -n "$AIMDS_RESULT" ]; then THREAT_COUNT=$(echo "$AIMDS_RESULT" | jq -r '.threats | length' 2>/dev/null || echo "0") CRITICAL_COUNT=$(echo "$AIMDS_RESULT" | jq -r '.threats | map(select(.severity == "critical")) | length' 2>/dev/null || echo "0")
if [ "$THREAT_COUNT" -gt 0 ]; then echo "⚠️ AIMDS detected $THREAT_COUNT potential threat(s):" echo "$AIMDS_RESULT" | jq -r '.threats[] | " - [\(.severity)] \(.type): \(.description)"' 2>/dev/null
if [ "$CRITICAL_COUNT" -gt 0 ]; then echo "🚨 CRITICAL: $CRITICAL_COUNT critical threat(s) detected!" echo " Proceeding with enhanced security protocols..." fi else echo "✅ AIMDS: No manipulation attempts detected" fi fi
echo "📊 Searching for similar threat patterns via HNSW..."
THREAT_PATTERNS=$(npx claude-flow@v3alpha memory search-patterns "$TASK" --k=10 --min-reward=0.85 --namespace=security_threats 2>/dev/null) if [ -n "$THREAT_PATTERNS" ]; then PATTERN_COUNT=$(echo "$THREAT_PATTERNS" | jq -r 'length' 2>/dev/null || echo "0") echo "📊 Found $PATTERN_COUNT similar threat patterns (150x-12,500x faster via HNSW)" npx claude-flow@v3alpha memory get-pattern-stats "$TASK" --k=10 --namespace=security_threats 2>/dev/null fi
SECURITY_FAILURES=$(npx claude-flow@v3alpha memory search-patterns "$TASK" --only-failures --k=5 --namespace=security 2>/dev/null) if [ -n "$SECURITY_FAILURES" ]; then echo "⚠️ Learning from past security vulnerabilities..." echo "$SECURITY_FAILURES" | jq -r '.[] | " - \(.task): \(.critique)"' 2>/dev/null | head -5 fi
if [[ "$TASK" == *"auth"* ]] || [[ "$TASK" == *"session"* ]] || [[ "$TASK" == *"inject"* ]] || \ [[ "$TASK" == *"password"* ]] || [[ "$TASK" == *"token"* ]] || [[ "$TASK" == *"crypt"* ]]; then echo "🔍 Checking CVE database for relevant vulnerabilities..." npx claude-flow@v3alpha security cve --check-relevant "$TASK" 2>/dev/null fi
SESSION_ID="security-architect-aimds-$(date +%s)" echo "📝 Initializing security session: $SESSION_ID"
npx claude-flow@v3alpha hooks intelligence trajectory-start \ --session-id "$SESSION_ID" \ --agent-type "security-architect-aidefence" \ --task "$TASK" \ --metadata "{\"aimds_enabled\": true, \"threat_count\": $THREAT_COUNT}" \ 2>/dev/null
npx claude-flow@v3alpha memory store-pattern \ --session-id "$SESSION_ID" \ --task "$TASK" \ --status "started" \ --namespace "security" \ --metadata "{\"aimds_threats\": $THREAT_COUNT, \"critical_threats\": $CRITICAL_COUNT}" \ 2>/dev/null
export SEC
AI-powered multi-agent code review. Simulates a customizable team of Engineers performing code review with built-in discourse.
Repo: spencermarx/open-code-review
Advanced code quality analysis agent for comprehensive code reviews and improvements
Advanced code quality analysis agent for comprehensive code reviews and improvements
Expert agent for system architecture design, patterns, and high-level technical decisions
Coordinates Byzantine fault-tolerant consensus protocols with malicious actor detection
Implements Conflict-free Replicated Data Types for eventually consistent state synchronization
Coordinates gossip-based consensus protocols for scalable eventually consistent systems