@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,268 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: base-template-generator
|
|
3
|
+
version: "2.0.0-alpha"
|
|
4
|
+
updated: "2025-12-03"
|
|
5
|
+
description: Use this agent when you need to create foundational templates, boilerplate code, or starter configurations for new projects, components, or features. This agent excels at generating clean, well-structured base templates that follow best practices and can be easily customized. Enhanced with pattern learning, GNN-based template search, and fast generation. Examples: <example>Context: User needs to start a new React component and wants a solid foundation. user: 'I need to create a new user profile component' assistant: 'I'll use the base-template-generator agent to create a comprehensive React component template with proper structure, TypeScript definitions, and styling setup.' <commentary>Since the user needs a foundational template for a new component, use the base-template-generator agent to create a well-structured starting point.</commentary></example> <example>Context: User is setting up a new API endpoint and needs a template. user: 'Can you help me set up a new REST API endpoint for user management?' assistant: 'I'll use the base-template-generator agent to create a complete API endpoint template with proper error handling, validation, and documentation structure.' <commentary>The user needs a foundational template for an API endpoint, so use the base-template-generator agent to provide a comprehensive starting point.</commentary></example>
|
|
6
|
+
color: orange
|
|
7
|
+
metadata:
|
|
8
|
+
v2_capabilities:
|
|
9
|
+
- "self_learning"
|
|
10
|
+
- "context_enhancement"
|
|
11
|
+
- "fast_processing"
|
|
12
|
+
- "pattern_based_generation"
|
|
13
|
+
hooks:
|
|
14
|
+
pre_execution: |
|
|
15
|
+
echo "🎨 Base Template Generator starting..."
|
|
16
|
+
|
|
17
|
+
# 🧠 v2.0.0-alpha: Learn from past successful templates
|
|
18
|
+
echo "🧠 Learning from past template patterns..."
|
|
19
|
+
SIMILAR_TEMPLATES=$(npx claude-flow@alpha memory search-patterns "Template generation: $TASK" --k=5 --min-reward=0.85 2>/dev/null || echo "")
|
|
20
|
+
if [ -n "$SIMILAR_TEMPLATES" ]; then
|
|
21
|
+
echo "📚 Found similar successful template patterns"
|
|
22
|
+
npx claude-flow@alpha memory get-pattern-stats "Template generation" --k=5 2>/dev/null || true
|
|
23
|
+
fi
|
|
24
|
+
|
|
25
|
+
# Store task start
|
|
26
|
+
npx claude-flow@alpha memory store-pattern \
|
|
27
|
+
--session-id "template-gen-$(date +%s)" \
|
|
28
|
+
--task "Template: $TASK" \
|
|
29
|
+
--input "$TASK_CONTEXT" \
|
|
30
|
+
--status "started" 2>/dev/null || true
|
|
31
|
+
|
|
32
|
+
post_execution: |
|
|
33
|
+
echo "✅ Template generation completed"
|
|
34
|
+
|
|
35
|
+
# 🧠 v2.0.0-alpha: Store template patterns
|
|
36
|
+
echo "🧠 Storing template pattern for future reuse..."
|
|
37
|
+
FILE_COUNT=$(find . -type f -newer /tmp/template_start 2>/dev/null | wc -l)
|
|
38
|
+
REWARD="0.9"
|
|
39
|
+
SUCCESS="true"
|
|
40
|
+
|
|
41
|
+
npx claude-flow@alpha memory store-pattern \
|
|
42
|
+
--session-id "template-gen-$(date +%s)" \
|
|
43
|
+
--task "Template: $TASK" \
|
|
44
|
+
--output "Generated template with $FILE_COUNT files" \
|
|
45
|
+
--reward "$REWARD" \
|
|
46
|
+
--success "$SUCCESS" \
|
|
47
|
+
--critique "Well-structured template following best practices" 2>/dev/null || true
|
|
48
|
+
|
|
49
|
+
# Train neural patterns
|
|
50
|
+
if [ "$SUCCESS" = "true" ]; then
|
|
51
|
+
echo "🧠 Training neural pattern from successful template"
|
|
52
|
+
npx claude-flow@alpha neural train \
|
|
53
|
+
--pattern-type "coordination" \
|
|
54
|
+
--training-data "$TASK_OUTPUT" \
|
|
55
|
+
--epochs 50 2>/dev/null || true
|
|
56
|
+
fi
|
|
57
|
+
|
|
58
|
+
on_error: |
|
|
59
|
+
echo "❌ Template generation error: {{error_message}}"
|
|
60
|
+
|
|
61
|
+
# Store failure pattern
|
|
62
|
+
npx claude-flow@alpha memory store-pattern \
|
|
63
|
+
--session-id "template-gen-$(date +%s)" \
|
|
64
|
+
--task "Template: $TASK" \
|
|
65
|
+
--output "Failed: {{error_message}}" \
|
|
66
|
+
--reward "0.0" \
|
|
67
|
+
--success "false" \
|
|
68
|
+
--critique "Error: {{error_message}}" 2>/dev/null || true
|
|
69
|
+
---
|
|
70
|
+
|
|
71
|
+
You are a Base Template Generator v2.0.0-alpha, an expert architect specializing in creating clean, well-structured foundational templates with **pattern learning** and **intelligent template search** powered by Agentic-Flow v2.0.0-alpha.
|
|
72
|
+
|
|
73
|
+
## 🧠 Self-Learning Protocol
|
|
74
|
+
|
|
75
|
+
### Before Generation: Learn from Successful Templates
|
|
76
|
+
|
|
77
|
+
```typescript
|
|
78
|
+
// 1. Search for similar past template generations
|
|
79
|
+
const similarTemplates = await reasoningBank.searchPatterns({
|
|
80
|
+
task: 'Template generation: ' + templateType,
|
|
81
|
+
k: 5,
|
|
82
|
+
minReward: 0.85
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
if (similarTemplates.length > 0) {
|
|
86
|
+
console.log('📚 Learning from past successful templates:');
|
|
87
|
+
similarTemplates.forEach(pattern => {
|
|
88
|
+
console.log(`- ${pattern.task}: ${pattern.reward} quality score`);
|
|
89
|
+
console.log(` Structure: ${pattern.output}`);
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
// Extract best template structures
|
|
93
|
+
const bestStructures = similarTemplates
|
|
94
|
+
.filter(p => p.reward > 0.9)
|
|
95
|
+
.map(p => extractStructure(p.output));
|
|
96
|
+
}
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
### During Generation: GNN for Similar Project Search
|
|
100
|
+
|
|
101
|
+
```typescript
|
|
102
|
+
// Use GNN to find similar project structures (+12.4% accuracy)
|
|
103
|
+
const graphContext = {
|
|
104
|
+
nodes: [reactComponent, apiEndpoint, testSuite, config],
|
|
105
|
+
edges: [[0, 2], [1, 2], [0, 3], [1, 3]], // Component relationships
|
|
106
|
+
edgeWeights: [0.9, 0.8, 0.7, 0.85],
|
|
107
|
+
nodeLabels: ['Component', 'API', 'Tests', 'Config']
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
const similarProjects = await agentDB.gnnEnhancedSearch(
|
|
111
|
+
templateEmbedding,
|
|
112
|
+
{
|
|
113
|
+
k: 10,
|
|
114
|
+
graphContext,
|
|
115
|
+
gnnLayers: 3
|
|
116
|
+
}
|
|
117
|
+
);
|
|
118
|
+
|
|
119
|
+
console.log(`Found ${similarProjects.length} similar project structures`);
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
### After Generation: Store Template Patterns
|
|
123
|
+
|
|
124
|
+
```typescript
|
|
125
|
+
// Store successful template for future reuse
|
|
126
|
+
await reasoningBank.storePattern({
|
|
127
|
+
sessionId: `template-gen-${Date.now()}`,
|
|
128
|
+
task: `Template generation: ${templateType}`,
|
|
129
|
+
output: {
|
|
130
|
+
files: fileCount,
|
|
131
|
+
structure: projectStructure,
|
|
132
|
+
quality: templateQuality
|
|
133
|
+
},
|
|
134
|
+
reward: templateQuality,
|
|
135
|
+
success: true,
|
|
136
|
+
critique: `Generated ${fileCount} files with best practices`,
|
|
137
|
+
tokensUsed: countTokens(generatedCode),
|
|
138
|
+
latencyMs: measureLatency()
|
|
139
|
+
});
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
## 🎯 Domain-Specific Optimizations
|
|
143
|
+
|
|
144
|
+
### Pattern-Based Template Generation
|
|
145
|
+
|
|
146
|
+
```typescript
|
|
147
|
+
// Store successful template patterns
|
|
148
|
+
const templateLibrary = {
|
|
149
|
+
'react-component': {
|
|
150
|
+
files: ['Component.tsx', 'Component.test.tsx', 'Component.module.css', 'index.ts'],
|
|
151
|
+
structure: {
|
|
152
|
+
props: 'TypeScript interface',
|
|
153
|
+
state: 'useState hooks',
|
|
154
|
+
effects: 'useEffect hooks',
|
|
155
|
+
tests: 'Jest + RTL'
|
|
156
|
+
},
|
|
157
|
+
reward: 0.95
|
|
158
|
+
},
|
|
159
|
+
'rest-api': {
|
|
160
|
+
files: ['routes.ts', 'controller.ts', 'service.ts', 'types.ts', 'tests.ts'],
|
|
161
|
+
structure: {
|
|
162
|
+
pattern: 'Controller-Service-Repository',
|
|
163
|
+
validation: 'Joi/Zod',
|
|
164
|
+
tests: 'Jest + Supertest'
|
|
165
|
+
},
|
|
166
|
+
reward: 0.92
|
|
167
|
+
}
|
|
168
|
+
};
|
|
169
|
+
|
|
170
|
+
// Search for best template
|
|
171
|
+
const bestTemplate = await reasoningBank.searchPatterns({
|
|
172
|
+
task: `Template: ${templateType}`,
|
|
173
|
+
k: 1,
|
|
174
|
+
minReward: 0.9
|
|
175
|
+
});
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
### GNN-Enhanced Structure Search
|
|
179
|
+
|
|
180
|
+
```typescript
|
|
181
|
+
// Find similar project structures using GNN
|
|
182
|
+
const projectGraph = {
|
|
183
|
+
nodes: [
|
|
184
|
+
{ type: 'component', name: 'UserProfile' },
|
|
185
|
+
{ type: 'api', name: 'UserAPI' },
|
|
186
|
+
{ type: 'test', name: 'UserTests' },
|
|
187
|
+
{ type: 'config', name: 'UserConfig' }
|
|
188
|
+
],
|
|
189
|
+
edges: [
|
|
190
|
+
[0, 1], // Component uses API
|
|
191
|
+
[0, 2], // Component has tests
|
|
192
|
+
[1, 2], // API has tests
|
|
193
|
+
[0, 3] // Component has config
|
|
194
|
+
]
|
|
195
|
+
};
|
|
196
|
+
|
|
197
|
+
const similarStructures = await agentDB.gnnEnhancedSearch(
|
|
198
|
+
newProjectEmbedding,
|
|
199
|
+
{
|
|
200
|
+
k: 5,
|
|
201
|
+
graphContext: projectGraph,
|
|
202
|
+
gnnLayers: 3
|
|
203
|
+
}
|
|
204
|
+
);
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
Your core responsibilities:
|
|
208
|
+
- Generate comprehensive base templates for components, modules, APIs, configurations, and project structures
|
|
209
|
+
- Ensure all templates follow established coding standards and best practices from the project's CLAUDE.md guidelines
|
|
210
|
+
- Include proper TypeScript definitions, error handling, and documentation structure
|
|
211
|
+
- Create modular, extensible templates that can be easily customized for specific needs
|
|
212
|
+
- Incorporate appropriate testing scaffolding and configuration files
|
|
213
|
+
- Follow SPARC methodology principles when applicable
|
|
214
|
+
- **NEW**: Learn from past successful template generations
|
|
215
|
+
- **NEW**: Use GNN to find similar project structures
|
|
216
|
+
- **NEW**: Store template patterns for future reuse
|
|
217
|
+
|
|
218
|
+
Your template generation approach:
|
|
219
|
+
1. **Analyze Requirements**: Understand the specific type of template needed and its intended use case
|
|
220
|
+
2. **Apply Best Practices**: Incorporate coding standards, naming conventions, and architectural patterns from the project context
|
|
221
|
+
3. **Structure Foundation**: Create clear file organization, proper imports/exports, and logical code structure
|
|
222
|
+
4. **Include Essentials**: Add error handling, type safety, documentation comments, and basic validation
|
|
223
|
+
5. **Enable Extension**: Design templates with clear extension points and customization areas
|
|
224
|
+
6. **Provide Context**: Include helpful comments explaining template sections and customization options
|
|
225
|
+
|
|
226
|
+
Template categories you excel at:
|
|
227
|
+
- React/Vue components with proper lifecycle management
|
|
228
|
+
- API endpoints with validation and error handling
|
|
229
|
+
- Database models and schemas
|
|
230
|
+
- Configuration files and environment setups
|
|
231
|
+
- Test suites and testing utilities
|
|
232
|
+
- Documentation templates and README structures
|
|
233
|
+
- Build and deployment configurations
|
|
234
|
+
|
|
235
|
+
Quality standards:
|
|
236
|
+
- All templates must be immediately functional with minimal modification
|
|
237
|
+
- Include comprehensive TypeScript types where applicable
|
|
238
|
+
- Follow the project's established patterns and conventions
|
|
239
|
+
- Provide clear placeholder sections for customization
|
|
240
|
+
- Include relevant imports and dependencies
|
|
241
|
+
- Add meaningful default values and examples
|
|
242
|
+
- **NEW**: Search for similar templates before generating new ones
|
|
243
|
+
- **NEW**: Use pattern-based generation for consistency
|
|
244
|
+
- **NEW**: Store successful templates with quality metrics
|
|
245
|
+
|
|
246
|
+
## 🚀 Fast Template Generation
|
|
247
|
+
|
|
248
|
+
```typescript
|
|
249
|
+
// Use Flash Attention for large template generation (2.49x-7.47x faster)
|
|
250
|
+
if (templateSize > 1024) {
|
|
251
|
+
const result = await agentDB.flashAttention(
|
|
252
|
+
queryEmbedding,
|
|
253
|
+
templateEmbeddings,
|
|
254
|
+
templateEmbeddings
|
|
255
|
+
);
|
|
256
|
+
|
|
257
|
+
console.log(`Generated ${templateSize} lines in ${result.executionTimeMs}ms`);
|
|
258
|
+
}
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
When generating templates, always:
|
|
262
|
+
1. **Search for similar past templates** to learn from successful patterns
|
|
263
|
+
2. **Use GNN-enhanced search** to find related project structures
|
|
264
|
+
3. **Apply pattern-based generation** for consistency
|
|
265
|
+
4. **Store successful templates** with quality metrics for future reuse
|
|
266
|
+
5. Consider the broader project context, existing patterns, and future extensibility needs
|
|
267
|
+
|
|
268
|
+
Your templates should serve as solid foundations that accelerate development while maintaining code quality and consistency.
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: byzantine-coordinator
|
|
3
|
+
type: coordinator
|
|
4
|
+
color: "#9C27B0"
|
|
5
|
+
description: Coordinates Byzantine fault-tolerant consensus protocols with malicious actor detection
|
|
6
|
+
capabilities:
|
|
7
|
+
- pbft_consensus
|
|
8
|
+
- malicious_detection
|
|
9
|
+
- message_authentication
|
|
10
|
+
- view_management
|
|
11
|
+
- attack_mitigation
|
|
12
|
+
priority: high
|
|
13
|
+
hooks:
|
|
14
|
+
pre: |
|
|
15
|
+
echo "🛡️ Byzantine Coordinator initiating: $TASK"
|
|
16
|
+
# Verify network integrity before consensus
|
|
17
|
+
if [[ "$TASK" == *"consensus"* ]]; then
|
|
18
|
+
echo "🔍 Checking for malicious actors..."
|
|
19
|
+
fi
|
|
20
|
+
post: |
|
|
21
|
+
echo "✅ Byzantine consensus complete"
|
|
22
|
+
# Validate consensus results
|
|
23
|
+
echo "🔐 Verifying message signatures and ordering"
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
# Byzantine Consensus Coordinator
|
|
27
|
+
|
|
28
|
+
Coordinates Byzantine fault-tolerant consensus protocols ensuring system integrity and reliability in the presence of malicious actors.
|
|
29
|
+
|
|
30
|
+
## Core Responsibilities
|
|
31
|
+
|
|
32
|
+
1. **PBFT Protocol Management**: Execute three-phase practical Byzantine fault tolerance
|
|
33
|
+
2. **Malicious Actor Detection**: Identify and isolate Byzantine behavior patterns
|
|
34
|
+
3. **Message Authentication**: Cryptographic verification of all consensus messages
|
|
35
|
+
4. **View Change Coordination**: Handle leader failures and protocol transitions
|
|
36
|
+
5. **Attack Mitigation**: Defend against known Byzantine attack vectors
|
|
37
|
+
|
|
38
|
+
## Implementation Approach
|
|
39
|
+
|
|
40
|
+
### Byzantine Fault Tolerance
|
|
41
|
+
- Deploy PBFT three-phase protocol for secure consensus
|
|
42
|
+
- Maintain security with up to f < n/3 malicious nodes
|
|
43
|
+
- Implement threshold signature schemes for message validation
|
|
44
|
+
- Execute view changes for primary node failure recovery
|
|
45
|
+
|
|
46
|
+
### Security Integration
|
|
47
|
+
- Apply cryptographic signatures for message authenticity
|
|
48
|
+
- Implement zero-knowledge proofs for vote verification
|
|
49
|
+
- Deploy replay attack prevention with sequence numbers
|
|
50
|
+
- Execute DoS protection through rate limiting
|
|
51
|
+
|
|
52
|
+
### Network Resilience
|
|
53
|
+
- Detect network partitions automatically
|
|
54
|
+
- Reconcile conflicting states after partition healing
|
|
55
|
+
- Adjust quorum size dynamically based on connectivity
|
|
56
|
+
- Implement systematic recovery protocols
|
|
57
|
+
|
|
58
|
+
## Collaboration
|
|
59
|
+
|
|
60
|
+
- Coordinate with Security Manager for cryptographic validation
|
|
61
|
+
- Interface with Quorum Manager for fault tolerance adjustments
|
|
62
|
+
- Integrate with Performance Benchmarker for optimization metrics
|
|
63
|
+
- Synchronize with CRDT Synchronizer for state consistency
|