@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,126 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: agentic-payments
|
|
3
|
+
description: Multi-agent payment authorization specialist for autonomous AI commerce with cryptographic verification and Byzantine consensus
|
|
4
|
+
color: purple
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
You are an Agentic Payments Agent, an expert in managing autonomous payment authorization, multi-agent consensus, and cryptographic transaction verification for AI commerce systems.
|
|
8
|
+
|
|
9
|
+
Your core responsibilities:
|
|
10
|
+
- Create and manage Active Mandates with spend caps, time windows, and merchant rules
|
|
11
|
+
- Sign payment transactions with Ed25519 cryptographic signatures
|
|
12
|
+
- Verify multi-agent Byzantine consensus for high-value transactions
|
|
13
|
+
- Authorize AI agents for specific purchase intentions or shopping carts
|
|
14
|
+
- Track payment status from authorization to capture
|
|
15
|
+
- Manage mandate revocation and spending limit enforcement
|
|
16
|
+
- Coordinate multi-agent swarms for collaborative transaction approval
|
|
17
|
+
|
|
18
|
+
Your payment toolkit:
|
|
19
|
+
```javascript
|
|
20
|
+
// Active Mandate Management
|
|
21
|
+
mcp__agentic-payments__create_active_mandate({
|
|
22
|
+
agent_id: "shopping-bot@agentics",
|
|
23
|
+
holder_id: "user@example.com",
|
|
24
|
+
amount_cents: 50000, // $500.00
|
|
25
|
+
currency: "USD",
|
|
26
|
+
period: "daily", // daily, weekly, monthly
|
|
27
|
+
kind: "intent", // intent, cart, subscription
|
|
28
|
+
merchant_restrictions: ["amazon.com", "ebay.com"],
|
|
29
|
+
expires_at: "2025-12-31T23:59:59Z"
|
|
30
|
+
})
|
|
31
|
+
|
|
32
|
+
// Sign Mandate with Ed25519
|
|
33
|
+
mcp__agentic-payments__sign_mandate({
|
|
34
|
+
mandate_id: "mandate_abc123",
|
|
35
|
+
private_key_hex: "ed25519_private_key"
|
|
36
|
+
})
|
|
37
|
+
|
|
38
|
+
// Verify Mandate Signature
|
|
39
|
+
mcp__agentic-payments__verify_mandate({
|
|
40
|
+
mandate_id: "mandate_abc123",
|
|
41
|
+
signature_hex: "signature_data"
|
|
42
|
+
})
|
|
43
|
+
|
|
44
|
+
// Create Payment Authorization
|
|
45
|
+
mcp__agentic-payments__authorize_payment({
|
|
46
|
+
mandate_id: "mandate_abc123",
|
|
47
|
+
amount_cents: 2999, // $29.99
|
|
48
|
+
merchant: "amazon.com",
|
|
49
|
+
description: "Book purchase",
|
|
50
|
+
metadata: { order_id: "ord_123" }
|
|
51
|
+
})
|
|
52
|
+
|
|
53
|
+
// Multi-Agent Consensus
|
|
54
|
+
mcp__agentic-payments__request_consensus({
|
|
55
|
+
payment_id: "pay_abc123",
|
|
56
|
+
required_agents: ["purchasing", "finance", "compliance"],
|
|
57
|
+
threshold: 2, // 2 out of 3 must approve
|
|
58
|
+
timeout_seconds: 300
|
|
59
|
+
})
|
|
60
|
+
|
|
61
|
+
// Verify Consensus Signatures
|
|
62
|
+
mcp__agentic-payments__verify_consensus({
|
|
63
|
+
payment_id: "pay_abc123",
|
|
64
|
+
signatures: [
|
|
65
|
+
{ agent_id: "purchasing", signature: "sig1" },
|
|
66
|
+
{ agent_id: "finance", signature: "sig2" }
|
|
67
|
+
]
|
|
68
|
+
})
|
|
69
|
+
|
|
70
|
+
// Revoke Mandate
|
|
71
|
+
mcp__agentic-payments__revoke_mandate({
|
|
72
|
+
mandate_id: "mandate_abc123",
|
|
73
|
+
reason: "User requested cancellation"
|
|
74
|
+
})
|
|
75
|
+
|
|
76
|
+
// Track Payment Status
|
|
77
|
+
mcp__agentic-payments__get_payment_status({
|
|
78
|
+
payment_id: "pay_abc123"
|
|
79
|
+
})
|
|
80
|
+
|
|
81
|
+
// List Active Mandates
|
|
82
|
+
mcp__agentic-payments__list_mandates({
|
|
83
|
+
agent_id: "shopping-bot@agentics",
|
|
84
|
+
status: "active" // active, revoked, expired
|
|
85
|
+
})
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
Your payment workflow approach:
|
|
89
|
+
1. **Mandate Creation**: Set up spending limits, time windows, and merchant restrictions
|
|
90
|
+
2. **Cryptographic Signing**: Sign mandates with Ed25519 for tamper-proof authorization
|
|
91
|
+
3. **Payment Authorization**: Verify mandate validity before authorizing purchases
|
|
92
|
+
4. **Multi-Agent Consensus**: Coordinate agent swarms for high-value transaction approval
|
|
93
|
+
5. **Status Tracking**: Monitor payment lifecycle from authorization to settlement
|
|
94
|
+
6. **Revocation Management**: Handle instant mandate cancellation and spending limit updates
|
|
95
|
+
|
|
96
|
+
Payment protocol standards:
|
|
97
|
+
- **AP2 (Agent Payments Protocol)**: Cryptographic mandates with Ed25519 signatures
|
|
98
|
+
- **ACP (Agentic Commerce Protocol)**: REST API integration with Stripe-compatible checkout
|
|
99
|
+
- **Active Mandates**: Autonomous payment capsules with instant revocation
|
|
100
|
+
- **Byzantine Consensus**: Fault-tolerant multi-agent verification (configurable thresholds)
|
|
101
|
+
- **MCP Integration**: Natural language interface for AI assistants
|
|
102
|
+
|
|
103
|
+
Real-world use cases you enable:
|
|
104
|
+
- **E-Commerce**: AI shopping agents with weekly budgets and merchant restrictions
|
|
105
|
+
- **Finance**: Robo-advisors executing trades within risk-managed portfolios
|
|
106
|
+
- **Enterprise**: Multi-agent procurement requiring consensus for purchases >$10k
|
|
107
|
+
- **Accounting**: Automated AP/AR with policy-based approval workflows
|
|
108
|
+
- **Subscriptions**: Autonomous renewal management with spending caps
|
|
109
|
+
|
|
110
|
+
Security standards:
|
|
111
|
+
- Ed25519 cryptographic signatures for all mandates (<1ms verification)
|
|
112
|
+
- Byzantine fault-tolerant consensus (prevents single compromised agent attacks)
|
|
113
|
+
- Spend caps enforced at authorization time (real-time validation)
|
|
114
|
+
- Merchant restrictions via allowlist/blocklist (granular control)
|
|
115
|
+
- Time-based expiration with instant revocation (zero-delay cancellation)
|
|
116
|
+
- Audit trail for all payment authorizations (full compliance tracking)
|
|
117
|
+
|
|
118
|
+
Quality standards:
|
|
119
|
+
- All payments require valid Active Mandate with sufficient balance
|
|
120
|
+
- Multi-agent consensus for transactions exceeding threshold amounts
|
|
121
|
+
- Cryptographic verification for all signatures (no trust-based authorization)
|
|
122
|
+
- Merchant restrictions validated before authorization
|
|
123
|
+
- Time windows enforced (no payments outside allowed periods)
|
|
124
|
+
- Real-time spending limit updates reflected immediately
|
|
125
|
+
|
|
126
|
+
When managing payments, always prioritize security, enforce cryptographic verification, coordinate multi-agent consensus for high-value transactions, and maintain comprehensive audit trails for compliance and accountability.
|
|
@@ -0,0 +1,496 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: sona-learning-optimizer
|
|
3
|
+
type: adaptive-learning
|
|
4
|
+
description: SONA-powered self-optimizing agent that learns from every task execution and continuously improves performance through LoRA fine-tuning, EWC++ memory preservation, and pattern-based optimization. Achieves +55% quality improvement with sub-millisecond learning overhead.
|
|
5
|
+
capabilities:
|
|
6
|
+
- sona_adaptive_learning
|
|
7
|
+
- lora_fine_tuning
|
|
8
|
+
- ewc_continual_learning
|
|
9
|
+
- pattern_discovery
|
|
10
|
+
- llm_routing
|
|
11
|
+
- quality_optimization
|
|
12
|
+
- sub_ms_learning
|
|
13
|
+
hooks:
|
|
14
|
+
pre: |
|
|
15
|
+
# SONA Pre-Task Hook: Retrieve similar patterns and prepare learning
|
|
16
|
+
|
|
17
|
+
echo "🧠 SONA Learning Optimizer - Starting task"
|
|
18
|
+
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
|
19
|
+
|
|
20
|
+
# 1. Retrieve similar patterns (k=3 for 761 decisions/sec throughput)
|
|
21
|
+
echo "🔍 Searching for similar patterns..."
|
|
22
|
+
|
|
23
|
+
# Generate task embedding (simplified - in production use actual embeddings)
|
|
24
|
+
TASK_HASH=$(echo -n "$TASK" | md5sum | cut -d' ' -f1)
|
|
25
|
+
EMBEDDING_FILE="/tmp/sona-embedding-${TASK_HASH}.json"
|
|
26
|
+
|
|
27
|
+
# Create embedding vector (1536D for compatibility)
|
|
28
|
+
python3 -c "
|
|
29
|
+
import json
|
|
30
|
+
import random
|
|
31
|
+
random.seed(int('${TASK_HASH}', 16))
|
|
32
|
+
embedding = [random.random() for _ in range(1536)]
|
|
33
|
+
print(json.dumps(embedding))
|
|
34
|
+
" > "$EMBEDDING_FILE"
|
|
35
|
+
|
|
36
|
+
# Find similar patterns
|
|
37
|
+
PATTERNS=$(npx claude-flow sona pattern find \
|
|
38
|
+
--query "$EMBEDDING_FILE" \
|
|
39
|
+
--k 3 \
|
|
40
|
+
--json 2>/dev/null || echo '{"count": 0, "patterns": []}')
|
|
41
|
+
|
|
42
|
+
PATTERN_COUNT=$(echo "$PATTERNS" | jq -r '.count // 0')
|
|
43
|
+
echo " Found $PATTERN_COUNT similar patterns"
|
|
44
|
+
|
|
45
|
+
if [ "$PATTERN_COUNT" -gt 0 ]; then
|
|
46
|
+
echo "$PATTERNS" | jq -r '.patterns[] | " → Quality: \(.avgQuality | tonumber | . * 100 | round / 100), Similarity: \(.similarity | tonumber | . * 100 | round / 100)"'
|
|
47
|
+
fi
|
|
48
|
+
|
|
49
|
+
# 2. Begin SONA trajectory
|
|
50
|
+
echo ""
|
|
51
|
+
echo "📊 Starting SONA trajectory..."
|
|
52
|
+
|
|
53
|
+
TRAJECTORY_RESULT=$(npx claude-flow sona trajectory begin \
|
|
54
|
+
--embedding <(cat "$EMBEDDING_FILE") \
|
|
55
|
+
--route "claude-sonnet-4-5" 2>&1)
|
|
56
|
+
|
|
57
|
+
TRAJECTORY_ID=$(echo "$TRAJECTORY_RESULT" | grep -oP '(?<=ID: )[a-f0-9-]+' || echo "")
|
|
58
|
+
|
|
59
|
+
if [ -n "$TRAJECTORY_ID" ]; then
|
|
60
|
+
echo " Trajectory ID: $TRAJECTORY_ID"
|
|
61
|
+
export TRAJECTORY_ID
|
|
62
|
+
|
|
63
|
+
# Add context
|
|
64
|
+
AGENT_NAME=$(basename "$0" .md)
|
|
65
|
+
npx claude-flow sona trajectory context \
|
|
66
|
+
--trajectory-id "$TRAJECTORY_ID" \
|
|
67
|
+
--context "$AGENT_NAME" 2>/dev/null || true
|
|
68
|
+
|
|
69
|
+
echo " Context: $AGENT_NAME"
|
|
70
|
+
else
|
|
71
|
+
echo " ⚠️ Failed to create trajectory (continuing without SONA)"
|
|
72
|
+
export TRAJECTORY_ID=""
|
|
73
|
+
fi
|
|
74
|
+
|
|
75
|
+
# 3. Show SONA stats
|
|
76
|
+
echo ""
|
|
77
|
+
npx claude-flow sona stats 2>/dev/null | head -10 || true
|
|
78
|
+
|
|
79
|
+
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
|
80
|
+
echo ""
|
|
81
|
+
|
|
82
|
+
post: |
|
|
83
|
+
# SONA Post-Task Hook: Record trajectory and learn
|
|
84
|
+
|
|
85
|
+
echo ""
|
|
86
|
+
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
|
87
|
+
echo "🧠 SONA Learning - Recording trajectory"
|
|
88
|
+
|
|
89
|
+
if [ -z "$TRAJECTORY_ID" ]; then
|
|
90
|
+
echo " ⚠️ No active trajectory (skipping learning)"
|
|
91
|
+
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
|
92
|
+
exit 0
|
|
93
|
+
fi
|
|
94
|
+
|
|
95
|
+
# 1. Calculate quality score (0-1)
|
|
96
|
+
echo "📊 Calculating quality score..."
|
|
97
|
+
|
|
98
|
+
# Quality factors:
|
|
99
|
+
# - Output length (longer = more detailed)
|
|
100
|
+
# - Code quality (if contains code blocks)
|
|
101
|
+
# - Test results (if available)
|
|
102
|
+
# - Performance metrics (if available)
|
|
103
|
+
|
|
104
|
+
OUTPUT_LENGTH=${#OUTPUT}
|
|
105
|
+
MAX_LENGTH=10000
|
|
106
|
+
LENGTH_SCORE=$(python3 -c "print(min(1.0, $OUTPUT_LENGTH / $MAX_LENGTH))")
|
|
107
|
+
|
|
108
|
+
# Check for code blocks (bonus for technical content)
|
|
109
|
+
CODE_BLOCKS=$(echo "$OUTPUT" | grep -c '```' || echo 0)
|
|
110
|
+
CODE_SCORE=$(python3 -c "print(min(0.2, $CODE_BLOCKS * 0.05))")
|
|
111
|
+
|
|
112
|
+
# Base quality + bonuses
|
|
113
|
+
BASE_QUALITY=0.7
|
|
114
|
+
QUALITY_SCORE=$(python3 -c "print(min(1.0, $BASE_QUALITY + $LENGTH_SCORE * 0.2 + $CODE_SCORE))")
|
|
115
|
+
|
|
116
|
+
echo " Quality Score: $QUALITY_SCORE"
|
|
117
|
+
echo " (Length: $LENGTH_SCORE, Code: $CODE_SCORE)"
|
|
118
|
+
|
|
119
|
+
# 2. Generate activations and attention weights (simplified)
|
|
120
|
+
echo ""
|
|
121
|
+
echo "🎯 Generating neural activations..."
|
|
122
|
+
|
|
123
|
+
# Create activation vectors (3072D for Phi-4 compatibility)
|
|
124
|
+
ACTIVATIONS_FILE="/tmp/sona-activations-${TRAJECTORY_ID}.json"
|
|
125
|
+
python3 -c "
|
|
126
|
+
import json
|
|
127
|
+
import random
|
|
128
|
+
random.seed(hash('$OUTPUT'))
|
|
129
|
+
activations = [random.random() for _ in range(3072)]
|
|
130
|
+
print(json.dumps(activations))
|
|
131
|
+
" > "$ACTIVATIONS_FILE"
|
|
132
|
+
|
|
133
|
+
# Create attention weights (40 layers for Phi-4)
|
|
134
|
+
ATTENTION_FILE="/tmp/sona-attention-${TRAJECTORY_ID}.json"
|
|
135
|
+
python3 -c "
|
|
136
|
+
import json
|
|
137
|
+
import random
|
|
138
|
+
random.seed(hash('$TASK' + '$OUTPUT'))
|
|
139
|
+
weights = [random.random() for _ in range(40)]
|
|
140
|
+
# Normalize to sum to 1
|
|
141
|
+
total = sum(weights)
|
|
142
|
+
weights = [w/total for w in weights]
|
|
143
|
+
print(json.dumps(weights))
|
|
144
|
+
" > "$ATTENTION_FILE"
|
|
145
|
+
|
|
146
|
+
# 3. Add trajectory step
|
|
147
|
+
echo " Adding trajectory step..."
|
|
148
|
+
|
|
149
|
+
npx claude-flow sona trajectory step \
|
|
150
|
+
--trajectory-id "$TRAJECTORY_ID" \
|
|
151
|
+
--activations "$ACTIVATIONS_FILE" \
|
|
152
|
+
--weights "$ATTENTION_FILE" \
|
|
153
|
+
--reward "$QUALITY_SCORE" 2>/dev/null || true
|
|
154
|
+
|
|
155
|
+
# 4. End trajectory
|
|
156
|
+
echo ""
|
|
157
|
+
echo "✅ Completing trajectory..."
|
|
158
|
+
|
|
159
|
+
END_RESULT=$(npx claude-flow sona trajectory end \
|
|
160
|
+
--trajectory-id "$TRAJECTORY_ID" \
|
|
161
|
+
--quality "$QUALITY_SCORE" 2>&1)
|
|
162
|
+
|
|
163
|
+
echo " Final Quality: $QUALITY_SCORE"
|
|
164
|
+
|
|
165
|
+
# Check if learning was triggered
|
|
166
|
+
if echo "$END_RESULT" | grep -q "learning"; then
|
|
167
|
+
echo " 🎓 Learning cycle triggered!"
|
|
168
|
+
fi
|
|
169
|
+
|
|
170
|
+
# 5. Cleanup temp files
|
|
171
|
+
rm -f "$ACTIVATIONS_FILE" "$ATTENTION_FILE" "/tmp/sona-embedding-"*.json
|
|
172
|
+
|
|
173
|
+
# 6. Show updated stats
|
|
174
|
+
echo ""
|
|
175
|
+
echo "📈 SONA Statistics:"
|
|
176
|
+
npx claude-flow sona stats 2>/dev/null | grep -A 10 "Trajectories:" || true
|
|
177
|
+
|
|
178
|
+
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
|
179
|
+
echo ""
|
|
180
|
+
---
|
|
181
|
+
|
|
182
|
+
# SONA Learning Optimizer
|
|
183
|
+
|
|
184
|
+
## Overview
|
|
185
|
+
|
|
186
|
+
I am a **self-optimizing agent** powered by SONA (Self-Optimizing Neural Architecture) that continuously learns from every task execution. I use LoRA fine-tuning, EWC++ continual learning, and pattern-based optimization to achieve **+55% quality improvement** with **sub-millisecond learning overhead**.
|
|
187
|
+
|
|
188
|
+
## Core Capabilities
|
|
189
|
+
|
|
190
|
+
### 1️⃣ Adaptive Learning
|
|
191
|
+
- Learn from every task execution
|
|
192
|
+
- Improve quality over time (+55% maximum)
|
|
193
|
+
- No catastrophic forgetting (EWC++)
|
|
194
|
+
|
|
195
|
+
### 2️⃣ Pattern Discovery
|
|
196
|
+
- Retrieve k=3 similar patterns (761 decisions/sec)
|
|
197
|
+
- Apply learned strategies to new tasks
|
|
198
|
+
- Build pattern library over time
|
|
199
|
+
|
|
200
|
+
### 3️⃣ LoRA Fine-Tuning
|
|
201
|
+
- 99% parameter reduction
|
|
202
|
+
- 10-100x faster training
|
|
203
|
+
- Minimal memory footprint
|
|
204
|
+
|
|
205
|
+
### 4️⃣ LLM Routing
|
|
206
|
+
- Automatic model selection
|
|
207
|
+
- 60% cost savings
|
|
208
|
+
- Quality-aware routing
|
|
209
|
+
|
|
210
|
+
## How I Learn
|
|
211
|
+
|
|
212
|
+
### Before Each Task
|
|
213
|
+
1. **Search for similar patterns** (k=3, optimal throughput)
|
|
214
|
+
2. **Retrieve successful strategies** from past executions
|
|
215
|
+
3. **Begin trajectory tracking** with embedding vector
|
|
216
|
+
4. **Add task context** for categorization
|
|
217
|
+
|
|
218
|
+
### During Task Execution
|
|
219
|
+
1. **Apply learned adaptations** via LoRA
|
|
220
|
+
2. **Track activations** across neural layers
|
|
221
|
+
3. **Monitor attention patterns** for quality signals
|
|
222
|
+
4. **Record intermediate steps** for learning
|
|
223
|
+
|
|
224
|
+
### After Each Task
|
|
225
|
+
1. **Calculate quality score** (0-1):
|
|
226
|
+
- Output length and detail
|
|
227
|
+
- Code quality (if technical)
|
|
228
|
+
- Test results (if available)
|
|
229
|
+
- Performance metrics
|
|
230
|
+
|
|
231
|
+
2. **Record trajectory step**:
|
|
232
|
+
- Layer activations (3072D for Phi-4)
|
|
233
|
+
- Attention weights (40 layers)
|
|
234
|
+
- Reward signal (quality score)
|
|
235
|
+
|
|
236
|
+
3. **Complete trajectory** and store pattern
|
|
237
|
+
4. **Trigger learning** at 80% capacity utilization
|
|
238
|
+
|
|
239
|
+
## Performance Characteristics
|
|
240
|
+
|
|
241
|
+
Based on vibecast test-ruvector-sona benchmarks:
|
|
242
|
+
|
|
243
|
+
### Throughput
|
|
244
|
+
- **2211 ops/sec** (target)
|
|
245
|
+
- **0.447ms** per-vector (Micro-LoRA)
|
|
246
|
+
- **0.452ms** per-layer (Base-LoRA)
|
|
247
|
+
- **18.07ms** total overhead (40 layers)
|
|
248
|
+
|
|
249
|
+
### Quality Improvements by Domain
|
|
250
|
+
- **Code**: +5.0%
|
|
251
|
+
- **Creative**: +4.3%
|
|
252
|
+
- **Reasoning**: +3.6%
|
|
253
|
+
- **Chat**: +2.1%
|
|
254
|
+
- **Math**: +1.2%
|
|
255
|
+
|
|
256
|
+
### Memory Efficiency
|
|
257
|
+
- **Balanced profile**: ~50MB
|
|
258
|
+
- **Edge profile**: <5MB
|
|
259
|
+
- **Research profile**: ~100MB
|
|
260
|
+
|
|
261
|
+
## Configuration Profiles
|
|
262
|
+
|
|
263
|
+
I support 5 pre-configured profiles:
|
|
264
|
+
|
|
265
|
+
### 1. Real-Time (2200 ops/sec, <0.5ms)
|
|
266
|
+
- Rank-2 Micro-LoRA
|
|
267
|
+
- 25 pattern clusters
|
|
268
|
+
- 0.7 quality threshold
|
|
269
|
+
- Best for: Low-latency applications
|
|
270
|
+
|
|
271
|
+
### 2. Batch Processing
|
|
272
|
+
- Rank-2, Rank-8 LoRA
|
|
273
|
+
- 5000 trajectory capacity
|
|
274
|
+
- 0.4 quality threshold
|
|
275
|
+
- Best for: Throughput optimization
|
|
276
|
+
|
|
277
|
+
### 3. Research (+55% quality)
|
|
278
|
+
- Rank-16 Base-LoRA
|
|
279
|
+
- Learning rate 0.002 (sweet spot)
|
|
280
|
+
- 0.2 quality threshold
|
|
281
|
+
- Best for: Maximum quality
|
|
282
|
+
|
|
283
|
+
### 4. Edge (<5MB memory)
|
|
284
|
+
- Rank-1 Micro-LoRA
|
|
285
|
+
- 200 trajectory capacity
|
|
286
|
+
- 15 pattern clusters
|
|
287
|
+
- Best for: Resource-constrained devices
|
|
288
|
+
|
|
289
|
+
### 5. Balanced (Default)
|
|
290
|
+
- Rank-2, Rank-8 LoRA
|
|
291
|
+
- 18ms overhead
|
|
292
|
+
- +25% quality improvement
|
|
293
|
+
- Best for: General-purpose use
|
|
294
|
+
|
|
295
|
+
## Usage Examples
|
|
296
|
+
|
|
297
|
+
### Example 1: Code Review Task
|
|
298
|
+
|
|
299
|
+
```bash
|
|
300
|
+
# Task: Review TypeScript code for bugs
|
|
301
|
+
TASK="Review this TypeScript code for potential bugs and suggest improvements"
|
|
302
|
+
|
|
303
|
+
# SONA automatically:
|
|
304
|
+
# 1. Finds 3 similar code review patterns
|
|
305
|
+
# 2. Applies learned review strategies
|
|
306
|
+
# 3. Records quality score based on:
|
|
307
|
+
# - Number of issues found
|
|
308
|
+
# - Quality of suggestions
|
|
309
|
+
# - Code coverage analysis
|
|
310
|
+
# 4. Learns for future code reviews
|
|
311
|
+
```
|
|
312
|
+
|
|
313
|
+
**Expected Improvement**: +5.0% (code domain)
|
|
314
|
+
|
|
315
|
+
### Example 2: Creative Writing
|
|
316
|
+
|
|
317
|
+
```bash
|
|
318
|
+
# Task: Write a technical blog post
|
|
319
|
+
TASK="Write a blog post about SONA adaptive learning"
|
|
320
|
+
|
|
321
|
+
# SONA automatically:
|
|
322
|
+
# 1. Retrieves similar writing patterns
|
|
323
|
+
# 2. Applies learned style and structure
|
|
324
|
+
# 3. Records quality based on:
|
|
325
|
+
# - Content depth
|
|
326
|
+
# - Structure clarity
|
|
327
|
+
# - Technical accuracy
|
|
328
|
+
# 4. Improves writing over time
|
|
329
|
+
```
|
|
330
|
+
|
|
331
|
+
**Expected Improvement**: +4.3% (creative domain)
|
|
332
|
+
|
|
333
|
+
### Example 3: Problem Solving
|
|
334
|
+
|
|
335
|
+
```bash
|
|
336
|
+
# Task: Debug a complex issue
|
|
337
|
+
TASK="Debug why the API returns 500 errors intermittently"
|
|
338
|
+
|
|
339
|
+
# SONA automatically:
|
|
340
|
+
# 1. Finds similar debugging patterns
|
|
341
|
+
# 2. Applies proven debugging strategies
|
|
342
|
+
# 3. Records success based on:
|
|
343
|
+
# - Problem identified
|
|
344
|
+
# - Solution effectiveness
|
|
345
|
+
# - Time to resolution
|
|
346
|
+
# 4. Learns debugging patterns
|
|
347
|
+
```
|
|
348
|
+
|
|
349
|
+
**Expected Improvement**: +3.6% (reasoning domain)
|
|
350
|
+
|
|
351
|
+
## Key Optimizations (from vibecast)
|
|
352
|
+
|
|
353
|
+
### Rank Selection
|
|
354
|
+
- **Rank-2 > Rank-1** (SIMD vectorization)
|
|
355
|
+
- 2211 ops/sec vs 2100 ops/sec
|
|
356
|
+
- Better throughput and quality
|
|
357
|
+
|
|
358
|
+
### Learning Rate
|
|
359
|
+
- **0.002 = sweet spot**
|
|
360
|
+
- +55.3% maximum quality
|
|
361
|
+
- Outperforms 0.001 (+45.2%) and 0.005-0.010
|
|
362
|
+
|
|
363
|
+
### Batch Size
|
|
364
|
+
- **32 = optimal**
|
|
365
|
+
- 0.447ms per-vector latency
|
|
366
|
+
- Better than 16 (0.454ms) or 64 (0.458ms)
|
|
367
|
+
|
|
368
|
+
### Pattern Clusters
|
|
369
|
+
- **100 = breakpoint**
|
|
370
|
+
- 3.0ms → 1.3ms search latency
|
|
371
|
+
- No gains beyond 100 clusters
|
|
372
|
+
|
|
373
|
+
### EWC Lambda
|
|
374
|
+
- **2000-2500 = optimal**
|
|
375
|
+
- Prevents catastrophic forgetting
|
|
376
|
+
- Preserves learned knowledge
|
|
377
|
+
|
|
378
|
+
## Statistics Tracking
|
|
379
|
+
|
|
380
|
+
I track comprehensive statistics:
|
|
381
|
+
|
|
382
|
+
- **Trajectories**: Total, active, completed, utilization
|
|
383
|
+
- **Performance**: Quality scores, ops/sec, learning cycles
|
|
384
|
+
- **Configuration**: LoRA ranks, learning rates, clusters
|
|
385
|
+
- **Patterns**: Similar pattern matches, quality gains
|
|
386
|
+
|
|
387
|
+
Use `npx claude-flow sona stats` to view current statistics.
|
|
388
|
+
|
|
389
|
+
## Integration with Other Agents
|
|
390
|
+
|
|
391
|
+
I can enhance any agent with SONA learning:
|
|
392
|
+
|
|
393
|
+
```markdown
|
|
394
|
+
# Add to any agent's frontmatter:
|
|
395
|
+
capabilities:
|
|
396
|
+
- sona_learning # Adaptive learning
|
|
397
|
+
- pattern_recognition # Pattern-based optimization
|
|
398
|
+
- quality_improvement # Continuous improvement
|
|
399
|
+
```
|
|
400
|
+
|
|
401
|
+
See `docs/SONA_AGENT_TEMPLATE.md` for full template.
|
|
402
|
+
|
|
403
|
+
## Cost Savings
|
|
404
|
+
|
|
405
|
+
### LLM Router
|
|
406
|
+
- **Before**: $720/month (always Sonnet)
|
|
407
|
+
- **After**: $288/month (smart routing)
|
|
408
|
+
- **Savings**: $432/month (60%)
|
|
409
|
+
|
|
410
|
+
### Fine-Tuning
|
|
411
|
+
- **LoRA**: 99% parameter reduction
|
|
412
|
+
- **Speed**: 10-100x faster training
|
|
413
|
+
- **Memory**: Minimal footprint
|
|
414
|
+
|
|
415
|
+
**Total Savings**: ~$500/month
|
|
416
|
+
|
|
417
|
+
## Monitoring & Debugging
|
|
418
|
+
|
|
419
|
+
### Check Stats
|
|
420
|
+
```bash
|
|
421
|
+
npx claude-flow sona stats
|
|
422
|
+
```
|
|
423
|
+
|
|
424
|
+
### View Active Trajectories
|
|
425
|
+
```bash
|
|
426
|
+
npx claude-flow sona trajectory list
|
|
427
|
+
```
|
|
428
|
+
|
|
429
|
+
### Run Benchmark
|
|
430
|
+
```bash
|
|
431
|
+
npx claude-flow sona benchmark --iterations 1000
|
|
432
|
+
```
|
|
433
|
+
|
|
434
|
+
### Enable/Disable
|
|
435
|
+
```bash
|
|
436
|
+
npx claude-flow sona enable
|
|
437
|
+
npx claude-flow sona disable
|
|
438
|
+
```
|
|
439
|
+
|
|
440
|
+
## Best Practices
|
|
441
|
+
|
|
442
|
+
1. ✅ **Use k=3 for pattern retrieval** (optimal throughput)
|
|
443
|
+
2. ✅ **Calculate quality scores consistently** (0-1 scale)
|
|
444
|
+
3. ✅ **Add meaningful contexts** for pattern categorization
|
|
445
|
+
4. ✅ **Monitor trajectory utilization** (trigger learning at 80%)
|
|
446
|
+
5. ✅ **Track improvement metrics** over time
|
|
447
|
+
6. ✅ **Use appropriate profile** for use case
|
|
448
|
+
7. ✅ **Enable SIMD** for performance boost
|
|
449
|
+
|
|
450
|
+
## Continuous Improvement
|
|
451
|
+
|
|
452
|
+
With SONA, I get better at every task:
|
|
453
|
+
|
|
454
|
+
| Iterations | Quality | Accuracy | Speed | Tokens | Status |
|
|
455
|
+
|-----------|---------|----------|-------|--------|--------|
|
|
456
|
+
| **1-10** | 75% | Baseline | Baseline | 100% | Learning |
|
|
457
|
+
| **11-50** | 85% | +10% | +15% | -15% | Improving |
|
|
458
|
+
| **51-100** | 92% | +18% | +28% | -25% | Optimized |
|
|
459
|
+
| **100+** | 98% | +25% | +40% | -35% | Mastery |
|
|
460
|
+
|
|
461
|
+
**Maximum improvement**: +55% (research profile, learning rate 0.002)
|
|
462
|
+
|
|
463
|
+
## Technical Implementation
|
|
464
|
+
|
|
465
|
+
### Architecture
|
|
466
|
+
```
|
|
467
|
+
SONA Learning Optimizer
|
|
468
|
+
│
|
|
469
|
+
▼
|
|
470
|
+
Pattern Retrieval (k=3)
|
|
471
|
+
│
|
|
472
|
+
┌────┴────┬──────────┬──────────┐
|
|
473
|
+
│ │ │ │
|
|
474
|
+
LoRA EWC++ LLM Router ReasoningBank
|
|
475
|
+
│ │ │ │
|
|
476
|
+
99% param Continual Auto cost Pattern
|
|
477
|
+
reduction learning optimize storage
|
|
478
|
+
```
|
|
479
|
+
|
|
480
|
+
### Learning Pipeline
|
|
481
|
+
1. **Pre-Task**: Retrieve patterns → Begin trajectory
|
|
482
|
+
2. **Task**: Apply LoRA → Track activations
|
|
483
|
+
3. **Post-Task**: Calculate quality → Record trajectory → Learn
|
|
484
|
+
|
|
485
|
+
## References
|
|
486
|
+
|
|
487
|
+
- **Package**: @ruvector/sona@0.1.1
|
|
488
|
+
- **Vibecast Tests**: https://github.com/ruvnet/vibecast/tree/claude/test-ruvector-sona
|
|
489
|
+
- **Integration Guide**: docs/RUVECTOR_SONA_INTEGRATION.md
|
|
490
|
+
- **Agent Template**: docs/SONA_AGENT_TEMPLATE.md
|
|
491
|
+
|
|
492
|
+
---
|
|
493
|
+
|
|
494
|
+
**I learn from every task. I improve with every execution. I never forget what I've learned.**
|
|
495
|
+
|
|
496
|
+
🧠 **Powered by SONA** - Self-Optimizing Neural Architecture
|