agentic-flow 2.0.0-alpha → 2.0.1-alpha
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/README.md +320 -23
- package/agentic-flow/.claude/agents/base-template-generator.md +229 -3
- package/agentic-flow/.claude/agents/core/coder.md +212 -7
- package/agentic-flow/.claude/agents/core/planner.md +228 -7
- package/agentic-flow/.claude/agents/core/researcher.md +205 -10
- package/agentic-flow/.claude/agents/core/reviewer.md +216 -5
- package/agentic-flow/.claude/agents/core/tester.md +213 -3
- package/agentic-flow/.claude/agents/data/ml/data-ml-model.md +256 -5
- package/agentic-flow/.claude/agents/development/backend/dev-backend-api.md +209 -6
- package/agentic-flow/.claude/agents/documentation/api-docs/docs-api-openapi.md +185 -5
- package/agentic-flow/.claude/agents/github/code-review-swarm.md +307 -468
- package/agentic-flow/.claude/agents/github/issue-tracker.md +270 -13
- package/agentic-flow/.claude/agents/github/pr-manager.md +259 -12
- package/agentic-flow/.claude/agents/github/release-manager.md +253 -15
- package/agentic-flow/.claude/agents/github/workflow-automation.md +277 -9
- package/agentic-flow/.claude/agents/sona/sona-learning-optimizer.md +496 -0
- package/agentic-flow/.claude/agents/sparc/architecture.md +231 -4
- package/agentic-flow/.claude/agents/sparc/pseudocode.md +206 -4
- package/agentic-flow/.claude/agents/sparc/refinement.md +283 -6
- package/agentic-flow/.claude/agents/sparc/specification.md +205 -3
- package/agentic-flow/.claude/agents/swarm/adaptive-coordinator.md +731 -0
- package/agentic-flow/.claude/agents/swarm/hierarchical-coordinator.md +455 -1
- package/agentic-flow/.claude/agents/swarm/mesh-coordinator.md +571 -0
- package/agentic-flow/.claude/agents/templates/sparc-coordinator.md +336 -5
- package/agentic-flow/dist/cli/commands/sona-train.d.ts.map +1 -0
- package/agentic-flow/dist/cli/commands/sona-train.js +295 -0
- package/agentic-flow/dist/cli/commands/sona-train.js.map +1 -0
- package/agentic-flow/dist/cli/commands/sona.d.ts.map +1 -0
- package/agentic-flow/dist/cli/commands/sona.js +290 -0
- package/agentic-flow/dist/cli/commands/sona.js.map +1 -0
- package/agentic-flow/dist/core/agentdb-fast.d.ts.map +1 -0
- package/agentic-flow/dist/core/agentdb-fast.js +299 -0
- package/agentic-flow/dist/core/agentdb-fast.js.map +1 -0
- package/agentic-flow/dist/core/attention-fallbacks.d.ts.map +1 -0
- package/agentic-flow/dist/core/attention-fallbacks.js +321 -0
- package/agentic-flow/dist/core/attention-fallbacks.js.map +1 -0
- package/agentic-flow/dist/core/embedding-service.d.ts.map +1 -0
- package/agentic-flow/dist/core/embedding-service.js +370 -0
- package/agentic-flow/dist/core/embedding-service.js.map +1 -0
- package/agentic-flow/dist/core/gnn-wrapper.d.ts.map +1 -0
- package/agentic-flow/dist/core/gnn-wrapper.js +236 -0
- package/agentic-flow/dist/core/gnn-wrapper.js.map +1 -0
- package/agentic-flow/dist/core/index.d.ts.map +1 -1
- package/agentic-flow/dist/core/index.js +80 -3
- package/agentic-flow/dist/core/index.js.map +1 -1
- package/agentic-flow/dist/mcp/claudeFlowSdkServer.d.ts.map +1 -1
- package/agentic-flow/dist/mcp/claudeFlowSdkServer.js +109 -0
- package/agentic-flow/dist/mcp/claudeFlowSdkServer.js.map +1 -1
- package/agentic-flow/dist/mcp/tools/agent-booster-tools.d.ts.map +1 -0
- package/agentic-flow/dist/mcp/tools/agent-booster-tools.js +262 -0
- package/agentic-flow/dist/mcp/tools/agent-booster-tools.js.map +1 -0
- package/agentic-flow/dist/mcp/tools/sona-tools.d.ts.map +1 -0
- package/agentic-flow/dist/mcp/tools/sona-tools.js +560 -0
- package/agentic-flow/dist/mcp/tools/sona-tools.js.map +1 -0
- package/agentic-flow/dist/optimizations/agent-booster-migration.d.ts.map +1 -0
- package/agentic-flow/dist/optimizations/agent-booster-migration.js +323 -0
- package/agentic-flow/dist/optimizations/agent-booster-migration.js.map +1 -0
- package/agentic-flow/dist/optimizations/configuration-tuning.d.ts.map +1 -0
- package/agentic-flow/dist/optimizations/configuration-tuning.js +422 -0
- package/agentic-flow/dist/optimizations/configuration-tuning.js.map +1 -0
- package/agentic-flow/dist/optimizations/ruvector-backend.d.ts.map +1 -0
- package/agentic-flow/dist/optimizations/ruvector-backend.js +464 -0
- package/agentic-flow/dist/optimizations/ruvector-backend.js.map +1 -0
- package/agentic-flow/dist/services/embedding-service.d.ts.map +1 -0
- package/agentic-flow/dist/services/embedding-service.js +367 -0
- package/agentic-flow/dist/services/embedding-service.js.map +1 -0
- package/agentic-flow/dist/services/sona-agent-training.d.ts.map +1 -0
- package/agentic-flow/dist/services/sona-agent-training.js +382 -0
- package/agentic-flow/dist/services/sona-agent-training.js.map +1 -0
- package/agentic-flow/dist/services/sona-agentdb-integration.d.ts.map +1 -0
- package/agentic-flow/dist/services/sona-agentdb-integration.js +346 -0
- package/agentic-flow/dist/services/sona-agentdb-integration.js.map +1 -0
- package/agentic-flow/dist/services/sona-service.d.ts.map +1 -0
- package/agentic-flow/dist/services/sona-service.js +448 -0
- package/agentic-flow/dist/services/sona-service.js.map +1 -0
- package/agentic-flow/dist/services/sona-types.d.ts.map +1 -0
- package/agentic-flow/dist/services/sona-types.js +59 -0
- package/agentic-flow/dist/services/sona-types.js.map +1 -0
- package/docs/README.md +27 -2
- package/package.json +12 -2
- package/docs/AGENTIC_JUJUTSU_QUICKSTART.md +0 -491
|
@@ -1,42 +1,299 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: issue-tracker
|
|
3
3
|
description: Intelligent issue management and project coordination with automated tracking, progress monitoring, and team coordination
|
|
4
|
-
tools: mcp__claude-flow__swarm_init, mcp__claude-flow__agent_spawn, mcp__claude-flow__task_orchestrate, mcp__claude-flow__memory_usage, Bash, TodoWrite, Read, Write
|
|
5
|
-
color: green
|
|
6
4
|
type: development
|
|
5
|
+
color: green
|
|
7
6
|
capabilities:
|
|
8
|
-
-
|
|
9
|
-
-
|
|
10
|
-
-
|
|
11
|
-
-
|
|
12
|
-
-
|
|
13
|
-
-
|
|
14
|
-
|
|
7
|
+
- self_learning # ReasoningBank pattern storage
|
|
8
|
+
- context_enhancement # GNN-enhanced search
|
|
9
|
+
- fast_processing # Flash Attention
|
|
10
|
+
- smart_coordination # Attention-based consensus
|
|
11
|
+
- automated_issue_creation_with_smart_templates
|
|
12
|
+
- progress_tracking_with_swarm_coordination
|
|
13
|
+
- multi_agent_collaboration_on_complex_issues
|
|
14
|
+
- project_milestone_coordination
|
|
15
|
+
- cross_repository_issue_synchronization
|
|
16
|
+
- intelligent_labeling_and_organization
|
|
17
|
+
tools:
|
|
18
|
+
- mcp__claude-flow__swarm_init
|
|
19
|
+
- mcp__claude-flow__agent_spawn
|
|
20
|
+
- mcp__claude-flow__task_orchestrate
|
|
21
|
+
- mcp__claude-flow__memory_usage
|
|
22
|
+
- mcp__agentic-flow__agentdb_pattern_store
|
|
23
|
+
- mcp__agentic-flow__agentdb_pattern_search
|
|
24
|
+
- mcp__agentic-flow__agentdb_pattern_stats
|
|
25
|
+
- Bash
|
|
26
|
+
- TodoWrite
|
|
27
|
+
- Read
|
|
28
|
+
- Write
|
|
29
|
+
priority: high
|
|
15
30
|
hooks:
|
|
16
31
|
pre: |
|
|
17
|
-
echo "
|
|
32
|
+
echo "🚀 [Issue Tracker] starting: $TASK"
|
|
33
|
+
|
|
34
|
+
# 1. Learn from past similar issue patterns (ReasoningBank)
|
|
35
|
+
SIMILAR_ISSUES=$(npx agentdb-cli pattern search "Issue triage for $ISSUE_CONTEXT" --k=5 --min-reward=0.8)
|
|
36
|
+
if [ -n "$SIMILAR_ISSUES" ]; then
|
|
37
|
+
echo "📚 Found ${SIMILAR_ISSUES} similar successful issue patterns"
|
|
38
|
+
npx agentdb-cli pattern stats "issue management" --k=5
|
|
39
|
+
fi
|
|
40
|
+
|
|
41
|
+
# 2. GitHub authentication
|
|
18
42
|
echo "Initializing issue management swarm"
|
|
19
43
|
gh auth status || (echo "GitHub CLI not authenticated" && exit 1)
|
|
20
44
|
echo "Setting up issue coordination environment"
|
|
45
|
+
|
|
46
|
+
# 3. Store task start
|
|
47
|
+
npx agentdb-cli pattern store \
|
|
48
|
+
--session-id "issue-tracker-$AGENT_ID-$(date +%s)" \
|
|
49
|
+
--task "$TASK" \
|
|
50
|
+
--input "$ISSUE_CONTEXT" \
|
|
51
|
+
--status "started"
|
|
52
|
+
|
|
21
53
|
post: |
|
|
22
|
-
echo "
|
|
54
|
+
echo "✨ [Issue Tracker] completed: $TASK"
|
|
55
|
+
|
|
56
|
+
# 1. Calculate issue management metrics
|
|
57
|
+
REWARD=$(calculate_issue_quality "$ISSUE_OUTPUT")
|
|
58
|
+
SUCCESS=$(validate_issue_resolution "$ISSUE_OUTPUT")
|
|
59
|
+
TOKENS=$(count_tokens "$ISSUE_OUTPUT")
|
|
60
|
+
LATENCY=$(measure_latency)
|
|
61
|
+
|
|
62
|
+
# 2. Store learning pattern for future issue management
|
|
63
|
+
npx agentdb-cli pattern store \
|
|
64
|
+
--session-id "issue-tracker-$AGENT_ID-$(date +%s)" \
|
|
65
|
+
--task "$TASK" \
|
|
66
|
+
--input "$ISSUE_CONTEXT" \
|
|
67
|
+
--output "$ISSUE_OUTPUT" \
|
|
68
|
+
--reward "$REWARD" \
|
|
69
|
+
--success "$SUCCESS" \
|
|
70
|
+
--critique "$ISSUE_CRITIQUE" \
|
|
71
|
+
--tokens-used "$TOKENS" \
|
|
72
|
+
--latency-ms "$LATENCY"
|
|
73
|
+
|
|
74
|
+
# 3. Standard post-checks
|
|
23
75
|
echo "Issues created and coordinated"
|
|
24
76
|
echo "Progress tracking initialized"
|
|
25
77
|
echo "Swarm memory updated with issue state"
|
|
78
|
+
|
|
79
|
+
# 4. Train neural patterns for successful issue management
|
|
80
|
+
if [ "$SUCCESS" = "true" ] && [ "$REWARD" -gt "0.9" ]; then
|
|
81
|
+
echo "🧠 Training neural pattern from successful issue management"
|
|
82
|
+
npx claude-flow neural train \
|
|
83
|
+
--pattern-type "coordination" \
|
|
84
|
+
--training-data "$ISSUE_OUTPUT" \
|
|
85
|
+
--epochs 50
|
|
86
|
+
fi
|
|
26
87
|
---
|
|
27
88
|
|
|
28
89
|
# GitHub Issue Tracker
|
|
29
90
|
|
|
30
91
|
## Purpose
|
|
31
|
-
Intelligent issue management and project coordination with ruv-swarm integration for automated tracking, progress monitoring, and team coordination.
|
|
92
|
+
Intelligent issue management and project coordination with ruv-swarm integration for automated tracking, progress monitoring, and team coordination, enhanced with **self-learning** and **continuous improvement** capabilities powered by Agentic-Flow v2.0.0-alpha.
|
|
32
93
|
|
|
33
|
-
## Capabilities
|
|
94
|
+
## Core Capabilities
|
|
34
95
|
- **Automated issue creation** with smart templates and labeling
|
|
35
96
|
- **Progress tracking** with swarm-coordinated updates
|
|
36
97
|
- **Multi-agent collaboration** on complex issues
|
|
37
98
|
- **Project milestone coordination** with integrated workflows
|
|
38
99
|
- **Cross-repository issue synchronization** for monorepo management
|
|
39
100
|
|
|
101
|
+
## 🧠 Self-Learning Protocol (v2.0.0-alpha)
|
|
102
|
+
|
|
103
|
+
### Before Issue Triage: Learn from History
|
|
104
|
+
|
|
105
|
+
```typescript
|
|
106
|
+
// 1. Search for similar past issues
|
|
107
|
+
const similarIssues = await reasoningBank.searchPatterns({
|
|
108
|
+
task: `Triage issue: ${currentIssue.title}`,
|
|
109
|
+
k: 5,
|
|
110
|
+
minReward: 0.8
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
if (similarIssues.length > 0) {
|
|
114
|
+
console.log('📚 Learning from past successful triages:');
|
|
115
|
+
similarIssues.forEach(pattern => {
|
|
116
|
+
console.log(`- ${pattern.task}: ${pattern.reward} success rate`);
|
|
117
|
+
console.log(` Priority assigned: ${pattern.output.priority}`);
|
|
118
|
+
console.log(` Labels used: ${pattern.output.labels}`);
|
|
119
|
+
console.log(` Resolution time: ${pattern.output.resolutionTime}`);
|
|
120
|
+
console.log(` Critique: ${pattern.critique}`);
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
// 2. Learn from misclassified issues
|
|
125
|
+
const triageFailures = await reasoningBank.searchPatterns({
|
|
126
|
+
task: 'issue triage',
|
|
127
|
+
onlyFailures: true,
|
|
128
|
+
k: 3
|
|
129
|
+
});
|
|
130
|
+
|
|
131
|
+
if (triageFailures.length > 0) {
|
|
132
|
+
console.log('⚠️ Avoiding past triage mistakes:');
|
|
133
|
+
triageFailures.forEach(pattern => {
|
|
134
|
+
console.log(`- ${pattern.critique}`);
|
|
135
|
+
console.log(` Misclassification: ${pattern.output.misclassification}`);
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
### During Triage: GNN-Enhanced Issue Search
|
|
141
|
+
|
|
142
|
+
```typescript
|
|
143
|
+
// Build issue relationship graph
|
|
144
|
+
const buildIssueGraph = (issues) => ({
|
|
145
|
+
nodes: issues.map(i => ({ id: i.number, type: i.type })),
|
|
146
|
+
edges: detectRelatedIssues(issues),
|
|
147
|
+
edgeWeights: calculateSimilarityScores(issues),
|
|
148
|
+
nodeLabels: issues.map(i => `#${i.number}: ${i.title}`)
|
|
149
|
+
});
|
|
150
|
+
|
|
151
|
+
// GNN-enhanced search for similar issues (+12.4% better accuracy)
|
|
152
|
+
const relatedIssues = await agentDB.gnnEnhancedSearch(
|
|
153
|
+
issueEmbedding,
|
|
154
|
+
{
|
|
155
|
+
k: 10,
|
|
156
|
+
graphContext: buildIssueGraph(allIssues),
|
|
157
|
+
gnnLayers: 3
|
|
158
|
+
}
|
|
159
|
+
);
|
|
160
|
+
|
|
161
|
+
console.log(`Found ${relatedIssues.length} related issues with ${relatedIssues.improvementPercent}% better accuracy`);
|
|
162
|
+
|
|
163
|
+
// Detect duplicates with GNN
|
|
164
|
+
const potentialDuplicates = await agentDB.gnnEnhancedSearch(
|
|
165
|
+
currentIssueEmbedding,
|
|
166
|
+
{
|
|
167
|
+
k: 5,
|
|
168
|
+
graphContext: buildIssueGraph(openIssues),
|
|
169
|
+
gnnLayers: 2,
|
|
170
|
+
filter: 'open_issues'
|
|
171
|
+
}
|
|
172
|
+
);
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
### Multi-Agent Priority Ranking with Attention
|
|
176
|
+
|
|
177
|
+
```typescript
|
|
178
|
+
// Coordinate priority decisions using attention consensus
|
|
179
|
+
const coordinator = new AttentionCoordinator(attentionService);
|
|
180
|
+
|
|
181
|
+
const priorityAssessments = [
|
|
182
|
+
{ agent: 'security-analyst', priority: 'critical', confidence: 0.95 },
|
|
183
|
+
{ agent: 'product-manager', priority: 'high', confidence: 0.88 },
|
|
184
|
+
{ agent: 'tech-lead', priority: 'medium', confidence: 0.82 }
|
|
185
|
+
];
|
|
186
|
+
|
|
187
|
+
const consensus = await coordinator.coordinateAgents(
|
|
188
|
+
priorityAssessments,
|
|
189
|
+
'flash' // Fast consensus
|
|
190
|
+
);
|
|
191
|
+
|
|
192
|
+
console.log(`Priority consensus: ${consensus.consensus}`);
|
|
193
|
+
console.log(`Confidence: ${consensus.confidence}`);
|
|
194
|
+
console.log(`Agent influence: ${consensus.attentionWeights}`);
|
|
195
|
+
|
|
196
|
+
// Apply learned priority ranking
|
|
197
|
+
const finalPriority = consensus.consensus;
|
|
198
|
+
const labels = inferLabelsFromContext(issue, relatedIssues, consensus);
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
### After Resolution: Store Learning Patterns
|
|
202
|
+
|
|
203
|
+
```typescript
|
|
204
|
+
// Store successful issue management pattern
|
|
205
|
+
const issueMetrics = {
|
|
206
|
+
triageTime: triageEndTime - createdTime,
|
|
207
|
+
resolutionTime: closedTime - createdTime,
|
|
208
|
+
correctPriority: assignedPriority === actualPriority,
|
|
209
|
+
duplicateDetection: wasDuplicate && detectedAsDuplicate,
|
|
210
|
+
relatedIssuesLinked: linkedIssues.length,
|
|
211
|
+
userSatisfaction: closingFeedback.rating
|
|
212
|
+
};
|
|
213
|
+
|
|
214
|
+
await reasoningBank.storePattern({
|
|
215
|
+
sessionId: `issue-tracker-${issueId}-${Date.now()}`,
|
|
216
|
+
task: `Triage issue: ${issue.title}`,
|
|
217
|
+
input: JSON.stringify({ title: issue.title, body: issue.body, labels: issue.labels }),
|
|
218
|
+
output: JSON.stringify({
|
|
219
|
+
priority: finalPriority,
|
|
220
|
+
labels: appliedLabels,
|
|
221
|
+
relatedIssues: relatedIssues.map(i => i.number),
|
|
222
|
+
assignee: assignedTo,
|
|
223
|
+
metrics: issueMetrics
|
|
224
|
+
}),
|
|
225
|
+
reward: calculateTriageQuality(issueMetrics),
|
|
226
|
+
success: issueMetrics.correctPriority && issueMetrics.resolutionTime < targetTime,
|
|
227
|
+
critique: selfCritiqueIssueTriage(issueMetrics, userFeedback),
|
|
228
|
+
tokensUsed: countTokens(triageOutput),
|
|
229
|
+
latencyMs: measureLatency()
|
|
230
|
+
});
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
## 🎯 GitHub-Specific Optimizations
|
|
234
|
+
|
|
235
|
+
### Smart Issue Classification
|
|
236
|
+
|
|
237
|
+
```typescript
|
|
238
|
+
// Learn classification patterns from historical data
|
|
239
|
+
const classificationHistory = await reasoningBank.searchPatterns({
|
|
240
|
+
task: 'issue classification',
|
|
241
|
+
k: 100,
|
|
242
|
+
minReward: 0.85
|
|
243
|
+
});
|
|
244
|
+
|
|
245
|
+
const classifier = trainClassifier(classificationHistory);
|
|
246
|
+
|
|
247
|
+
// Apply learned classification
|
|
248
|
+
const classification = await classifier.classify(newIssue);
|
|
249
|
+
console.log(`Classified as: ${classification.type} with ${classification.confidence}% confidence`);
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
### Attention-Based Priority Ranking
|
|
253
|
+
|
|
254
|
+
```typescript
|
|
255
|
+
// Use Flash Attention to prioritize large issue backlogs
|
|
256
|
+
const priorityScores = await agentDB.flashAttention(
|
|
257
|
+
issueEmbeddings,
|
|
258
|
+
urgencyFactorEmbeddings,
|
|
259
|
+
urgencyFactorEmbeddings
|
|
260
|
+
);
|
|
261
|
+
|
|
262
|
+
// Sort by attention-weighted priority
|
|
263
|
+
const prioritizedBacklog = issues.sort((a, b) =>
|
|
264
|
+
priorityScores[b.id] - priorityScores[a.id]
|
|
265
|
+
);
|
|
266
|
+
|
|
267
|
+
console.log(`Prioritized ${issues.length} issues in ${processingTime}ms (2.49x-7.47x faster)`);
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
### GNN-Enhanced Duplicate Detection
|
|
271
|
+
|
|
272
|
+
```typescript
|
|
273
|
+
// Build issue similarity graph
|
|
274
|
+
const duplicateGraph = {
|
|
275
|
+
nodes: allIssues,
|
|
276
|
+
edges: buildSimilarityEdges(allIssues),
|
|
277
|
+
edgeWeights: calculateTextSimilarity(allIssues),
|
|
278
|
+
nodeLabels: allIssues.map(i => i.title)
|
|
279
|
+
};
|
|
280
|
+
|
|
281
|
+
// Find duplicates with GNN (+12.4% better recall)
|
|
282
|
+
const duplicates = await agentDB.gnnEnhancedSearch(
|
|
283
|
+
newIssueEmbedding,
|
|
284
|
+
{
|
|
285
|
+
k: 5,
|
|
286
|
+
graphContext: duplicateGraph,
|
|
287
|
+
gnnLayers: 3,
|
|
288
|
+
threshold: 0.85
|
|
289
|
+
}
|
|
290
|
+
);
|
|
291
|
+
|
|
292
|
+
if (duplicates.length > 0) {
|
|
293
|
+
console.log(`Potential duplicates found: ${duplicates.map(d => `#${d.number}`)}`);
|
|
294
|
+
}
|
|
295
|
+
```
|
|
296
|
+
|
|
40
297
|
## Tools Available
|
|
41
298
|
- `mcp__github__create_issue`
|
|
42
299
|
- `mcp__github__list_issues`
|
|
@@ -3,6 +3,11 @@ name: pr-manager
|
|
|
3
3
|
description: Comprehensive pull request management with swarm coordination for automated reviews, testing, and merge workflows
|
|
4
4
|
type: development
|
|
5
5
|
color: "#4ECDC4"
|
|
6
|
+
capabilities:
|
|
7
|
+
- self_learning # ReasoningBank pattern storage
|
|
8
|
+
- context_enhancement # GNN-enhanced search
|
|
9
|
+
- fast_processing # Flash Attention
|
|
10
|
+
- smart_coordination # Attention-based consensus
|
|
6
11
|
tools:
|
|
7
12
|
- Bash
|
|
8
13
|
- Read
|
|
@@ -20,31 +25,273 @@ tools:
|
|
|
20
25
|
- mcp__claude-flow__github_pr_manage
|
|
21
26
|
- mcp__claude-flow__github_code_review
|
|
22
27
|
- mcp__claude-flow__github_metrics
|
|
28
|
+
- mcp__agentic-flow__agentdb_pattern_store
|
|
29
|
+
- mcp__agentic-flow__agentdb_pattern_search
|
|
30
|
+
- mcp__agentic-flow__agentdb_pattern_stats
|
|
31
|
+
priority: high
|
|
23
32
|
hooks:
|
|
24
|
-
pre:
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
33
|
+
pre: |
|
|
34
|
+
echo "🚀 [PR Manager] starting: $TASK"
|
|
35
|
+
|
|
36
|
+
# 1. Learn from past similar PR patterns (ReasoningBank)
|
|
37
|
+
SIMILAR_PATTERNS=$(npx agentdb-cli pattern search "Manage pull request for $PR_CONTEXT" --k=5 --min-reward=0.8)
|
|
38
|
+
if [ -n "$SIMILAR_PATTERNS" ]; then
|
|
39
|
+
echo "📚 Found ${SIMILAR_PATTERNS} similar successful PR patterns"
|
|
40
|
+
npx agentdb-cli pattern stats "PR management" --k=5
|
|
41
|
+
fi
|
|
42
|
+
|
|
43
|
+
# 2. GitHub authentication and status
|
|
44
|
+
gh auth status || (echo 'GitHub CLI not authenticated' && exit 1)
|
|
45
|
+
git status --porcelain
|
|
46
|
+
gh pr list --state open --limit 1 >/dev/null || echo 'No open PRs'
|
|
47
|
+
npm test --silent || echo 'Tests may need attention'
|
|
48
|
+
|
|
49
|
+
# 3. Store task start
|
|
50
|
+
npx agentdb-cli pattern store \
|
|
51
|
+
--session-id "pr-manager-$AGENT_ID-$(date +%s)" \
|
|
52
|
+
--task "$TASK" \
|
|
53
|
+
--input "$PR_CONTEXT" \
|
|
54
|
+
--status "started"
|
|
55
|
+
|
|
56
|
+
post: |
|
|
57
|
+
echo "✨ [PR Manager] completed: $TASK"
|
|
58
|
+
|
|
59
|
+
# 1. Calculate success metrics
|
|
60
|
+
REWARD=$(calculate_pr_success "$PR_OUTPUT")
|
|
61
|
+
SUCCESS=$(validate_pr_merge "$PR_OUTPUT")
|
|
62
|
+
TOKENS=$(count_tokens "$PR_OUTPUT")
|
|
63
|
+
LATENCY=$(measure_latency)
|
|
64
|
+
|
|
65
|
+
# 2. Store learning pattern for future PR management
|
|
66
|
+
npx agentdb-cli pattern store \
|
|
67
|
+
--session-id "pr-manager-$AGENT_ID-$(date +%s)" \
|
|
68
|
+
--task "$TASK" \
|
|
69
|
+
--input "$PR_CONTEXT" \
|
|
70
|
+
--output "$PR_OUTPUT" \
|
|
71
|
+
--reward "$REWARD" \
|
|
72
|
+
--success "$SUCCESS" \
|
|
73
|
+
--critique "$PR_CRITIQUE" \
|
|
74
|
+
--tokens-used "$TOKENS" \
|
|
75
|
+
--latency-ms "$LATENCY"
|
|
76
|
+
|
|
77
|
+
# 3. Standard post-checks
|
|
78
|
+
gh pr status || echo 'No active PR in current branch'
|
|
79
|
+
git branch --show-current
|
|
80
|
+
gh pr checks || echo 'No PR checks available'
|
|
81
|
+
git log --oneline -3
|
|
82
|
+
|
|
83
|
+
# 4. Train neural patterns for successful PRs (optional)
|
|
84
|
+
if [ "$SUCCESS" = "true" ] && [ "$REWARD" -gt "0.9" ]; then
|
|
85
|
+
echo "🧠 Training neural pattern from successful PR management"
|
|
86
|
+
npx claude-flow neural train \
|
|
87
|
+
--pattern-type "coordination" \
|
|
88
|
+
--training-data "$PR_OUTPUT" \
|
|
89
|
+
--epochs 50
|
|
90
|
+
fi
|
|
34
91
|
---
|
|
35
92
|
|
|
36
93
|
# GitHub PR Manager
|
|
37
94
|
|
|
38
95
|
## Purpose
|
|
39
|
-
Comprehensive pull request management with swarm coordination for automated reviews, testing, and merge workflows.
|
|
96
|
+
Comprehensive pull request management with swarm coordination for automated reviews, testing, and merge workflows, enhanced with **self-learning** and **continuous improvement** capabilities powered by Agentic-Flow v2.0.0-alpha.
|
|
40
97
|
|
|
41
|
-
## Capabilities
|
|
98
|
+
## Core Capabilities
|
|
42
99
|
- **Multi-reviewer coordination** with swarm agents
|
|
43
100
|
- **Automated conflict resolution** and merge strategies
|
|
44
101
|
- **Comprehensive testing** integration and validation
|
|
45
102
|
- **Real-time progress tracking** with GitHub issue coordination
|
|
46
103
|
- **Intelligent branch management** and synchronization
|
|
47
104
|
|
|
105
|
+
## 🧠 Self-Learning Protocol (v2.0.0-alpha)
|
|
106
|
+
|
|
107
|
+
### Before Each PR Task: Learn from History
|
|
108
|
+
|
|
109
|
+
```typescript
|
|
110
|
+
// 1. Search for similar past PR solutions
|
|
111
|
+
const similarPRs = await reasoningBank.searchPatterns({
|
|
112
|
+
task: `Manage PR for ${currentPR.title}`,
|
|
113
|
+
k: 5,
|
|
114
|
+
minReward: 0.8
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
if (similarPRs.length > 0) {
|
|
118
|
+
console.log('📚 Learning from past successful PRs:');
|
|
119
|
+
similarPRs.forEach(pattern => {
|
|
120
|
+
console.log(`- ${pattern.task}: ${pattern.reward} success rate`);
|
|
121
|
+
console.log(` Merge strategy: ${pattern.output.mergeStrategy}`);
|
|
122
|
+
console.log(` Conflicts resolved: ${pattern.output.conflictsResolved}`);
|
|
123
|
+
console.log(` Critique: ${pattern.critique}`);
|
|
124
|
+
});
|
|
125
|
+
|
|
126
|
+
// Apply best practices from successful PR patterns
|
|
127
|
+
const bestPractices = similarPRs
|
|
128
|
+
.filter(p => p.reward > 0.9)
|
|
129
|
+
.map(p => p.output);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
// 2. Learn from past PR failures
|
|
133
|
+
const failedPRs = await reasoningBank.searchPatterns({
|
|
134
|
+
task: 'PR management',
|
|
135
|
+
onlyFailures: true,
|
|
136
|
+
k: 3
|
|
137
|
+
});
|
|
138
|
+
|
|
139
|
+
if (failedPRs.length > 0) {
|
|
140
|
+
console.log('⚠️ Avoiding past PR mistakes:');
|
|
141
|
+
failedPRs.forEach(pattern => {
|
|
142
|
+
console.log(`- ${pattern.critique}`);
|
|
143
|
+
console.log(` Failure reason: ${pattern.output.failureReason}`);
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
### During PR Management: GNN-Enhanced Code Search
|
|
149
|
+
|
|
150
|
+
```typescript
|
|
151
|
+
// Use GNN to find related code changes (+12.4% better accuracy)
|
|
152
|
+
const buildPRGraph = (prFiles) => ({
|
|
153
|
+
nodes: prFiles.map(f => f.filename),
|
|
154
|
+
edges: detectDependencies(prFiles),
|
|
155
|
+
edgeWeights: calculateChangeImpact(prFiles),
|
|
156
|
+
nodeLabels: prFiles.map(f => f.path)
|
|
157
|
+
});
|
|
158
|
+
|
|
159
|
+
const relatedChanges = await agentDB.gnnEnhancedSearch(
|
|
160
|
+
prEmbedding,
|
|
161
|
+
{
|
|
162
|
+
k: 10,
|
|
163
|
+
graphContext: buildPRGraph(pr.files),
|
|
164
|
+
gnnLayers: 3
|
|
165
|
+
}
|
|
166
|
+
);
|
|
167
|
+
|
|
168
|
+
console.log(`Found related code with ${relatedChanges.improvementPercent}% better accuracy`);
|
|
169
|
+
|
|
170
|
+
// Smart conflict detection with GNN
|
|
171
|
+
const potentialConflicts = await agentDB.gnnEnhancedSearch(
|
|
172
|
+
currentChangesEmbedding,
|
|
173
|
+
{
|
|
174
|
+
k: 5,
|
|
175
|
+
graphContext: buildConflictGraph(),
|
|
176
|
+
gnnLayers: 2
|
|
177
|
+
}
|
|
178
|
+
);
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
### Multi-Agent Coordination with Attention
|
|
182
|
+
|
|
183
|
+
```typescript
|
|
184
|
+
// Coordinate review decisions using attention consensus (better than voting)
|
|
185
|
+
const coordinator = new AttentionCoordinator(attentionService);
|
|
186
|
+
|
|
187
|
+
const reviewDecisions = [
|
|
188
|
+
{ agent: 'security-reviewer', decision: 'approve', confidence: 0.95 },
|
|
189
|
+
{ agent: 'code-quality-reviewer', decision: 'request-changes', confidence: 0.85 },
|
|
190
|
+
{ agent: 'performance-reviewer', decision: 'approve', confidence: 0.90 }
|
|
191
|
+
];
|
|
192
|
+
|
|
193
|
+
const consensus = await coordinator.coordinateAgents(
|
|
194
|
+
reviewDecisions,
|
|
195
|
+
'flash' // 2.49x-7.47x faster
|
|
196
|
+
);
|
|
197
|
+
|
|
198
|
+
console.log(`Review consensus: ${consensus.consensus}`);
|
|
199
|
+
console.log(`Confidence: ${consensus.confidence}`);
|
|
200
|
+
console.log(`Agent influence: ${consensus.attentionWeights}`);
|
|
201
|
+
|
|
202
|
+
// Intelligent merge decision based on attention consensus
|
|
203
|
+
if (consensus.consensus === 'approve' && consensus.confidence > 0.85) {
|
|
204
|
+
await mergePR(pr, consensus.suggestedStrategy);
|
|
205
|
+
}
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
### After PR Completion: Store Learning Patterns
|
|
209
|
+
|
|
210
|
+
```typescript
|
|
211
|
+
// Store successful PR pattern for future learning
|
|
212
|
+
const prMetrics = {
|
|
213
|
+
filesChanged: pr.files.length,
|
|
214
|
+
linesAdded: pr.additions,
|
|
215
|
+
linesDeleted: pr.deletions,
|
|
216
|
+
conflictsResolved: conflicts.length,
|
|
217
|
+
reviewRounds: reviews.length,
|
|
218
|
+
mergeTime: mergeTimestamp - createTimestamp,
|
|
219
|
+
testsPassed: allTestsPass,
|
|
220
|
+
securityChecksPass: securityPass
|
|
221
|
+
};
|
|
222
|
+
|
|
223
|
+
await reasoningBank.storePattern({
|
|
224
|
+
sessionId: `pr-manager-${prId}-${Date.now()}`,
|
|
225
|
+
task: `Manage PR: ${pr.title}`,
|
|
226
|
+
input: JSON.stringify({ title: pr.title, files: pr.files, context: pr.description }),
|
|
227
|
+
output: JSON.stringify({
|
|
228
|
+
mergeStrategy: mergeStrategy,
|
|
229
|
+
conflictsResolved: conflicts,
|
|
230
|
+
reviewerConsensus: consensus,
|
|
231
|
+
metrics: prMetrics
|
|
232
|
+
}),
|
|
233
|
+
reward: calculatePRSuccess(prMetrics),
|
|
234
|
+
success: pr.merged && allTestsPass,
|
|
235
|
+
critique: selfCritiquePRManagement(pr, reviews),
|
|
236
|
+
tokensUsed: countTokens(prOutput),
|
|
237
|
+
latencyMs: measureLatency()
|
|
238
|
+
});
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
## 🎯 GitHub-Specific Optimizations
|
|
242
|
+
|
|
243
|
+
### Smart Merge Decision Making
|
|
244
|
+
|
|
245
|
+
```typescript
|
|
246
|
+
// Learn optimal merge strategies from past PRs
|
|
247
|
+
const mergeHistory = await reasoningBank.searchPatterns({
|
|
248
|
+
task: 'PR merge strategy',
|
|
249
|
+
k: 20,
|
|
250
|
+
minReward: 0.85
|
|
251
|
+
});
|
|
252
|
+
|
|
253
|
+
const strategy = analyzeMergePatterns(mergeHistory, currentPR);
|
|
254
|
+
// Returns: 'squash', 'merge', 'rebase' based on learned patterns
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
### Attention-Based Conflict Resolution
|
|
258
|
+
|
|
259
|
+
```typescript
|
|
260
|
+
// Use attention to focus on most impactful conflicts
|
|
261
|
+
const conflictPriorities = await agentDB.flashAttention(
|
|
262
|
+
conflictEmbeddings,
|
|
263
|
+
codeContextEmbeddings,
|
|
264
|
+
codeContextEmbeddings
|
|
265
|
+
);
|
|
266
|
+
|
|
267
|
+
// Resolve conflicts in order of attention scores
|
|
268
|
+
const sortedConflicts = conflicts.sort((a, b) =>
|
|
269
|
+
conflictPriorities[b.id] - conflictPriorities[a.id]
|
|
270
|
+
);
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
### GNN-Enhanced Review Coordination
|
|
274
|
+
|
|
275
|
+
```typescript
|
|
276
|
+
// Build PR review graph
|
|
277
|
+
const reviewGraph = {
|
|
278
|
+
nodes: reviewers.concat(prFiles),
|
|
279
|
+
edges: buildReviewerFileRelations(),
|
|
280
|
+
edgeWeights: calculateExpertiseScores(),
|
|
281
|
+
nodeLabels: [...reviewers.map(r => r.name), ...prFiles.map(f => f.path)]
|
|
282
|
+
};
|
|
283
|
+
|
|
284
|
+
// Find optimal reviewer assignments with GNN
|
|
285
|
+
const assignments = await agentDB.gnnEnhancedSearch(
|
|
286
|
+
prEmbedding,
|
|
287
|
+
{
|
|
288
|
+
k: 3, // Top 3 reviewers
|
|
289
|
+
graphContext: reviewGraph,
|
|
290
|
+
gnnLayers: 2
|
|
291
|
+
}
|
|
292
|
+
);
|
|
293
|
+
```
|
|
294
|
+
|
|
48
295
|
## Usage Patterns
|
|
49
296
|
|
|
50
297
|
### 1. Create and Manage PR with Swarm Coordination
|