@pjmendonca/devflow 1.19.0 → 1.20.1
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/hooks/session-startup.sh +20 -0
- package/.claude/settings.json +0 -4
- package/.claude/skills/dashboard/SKILL.md +118 -0
- package/CHANGELOG.md +26 -0
- package/README.md +2 -2
- package/bin/devflow-dashboard.js +10 -0
- package/bin/devflow-swarm.js +11 -0
- package/bin/devflow.js +2 -0
- package/package.json +3 -1
- package/tooling/.automation/memory/knowledge/kg_integration-test.json +212 -1
- package/tooling/.automation/memory/knowledge/kg_test-story.json +710 -2
- package/tooling/.automation/memory/shared/shared_integration-test.json +61 -1
- package/tooling/.automation/memory/shared/shared_test-story.json +181 -1
- package/tooling/.automation/memory/shared/shared_test.json +313 -1
- package/tooling/.automation/memory/shared/shared_validation-check.json +66 -1
- package/tooling/.automation/validation/history/2026-01-16_val_0b81ec2f.json +41 -0
- package/tooling/.automation/validation/history/2026-01-16_val_26c18e64.json +32 -0
- package/tooling/.automation/validation/history/2026-01-16_val_32af0152.json +32 -0
- package/tooling/.automation/validation/history/2026-01-16_val_353d1569.json +32 -0
- package/tooling/.automation/validation/history/2026-01-16_val_39e3c143.json +59 -0
- package/tooling/.automation/validation/history/2026-01-16_val_77fb42e4.json +32 -0
- package/tooling/.automation/validation/history/2026-01-16_val_a0752656.json +41 -0
- package/tooling/.automation/validation/history/2026-01-16_val_a29213b0.json +41 -0
- package/tooling/.automation/validation/history/2026-01-16_val_a9375d4c.json +32 -0
- package/tooling/.automation/validation/history/2026-01-16_val_c147bbdf.json +32 -0
- package/tooling/.automation/validation/history/2026-01-16_val_d06ccf8d.json +32 -0
- package/tooling/.automation/validation/history/2026-01-16_val_d6a80295.json +59 -0
- package/tooling/.automation/validation/history/2026-01-16_val_dce5005d.json +41 -0
- package/tooling/.automation/validation/history/2026-01-16_val_e53b3a63.json +32 -0
- package/tooling/.automation/validation/history/2026-01-18_val_108c18cf.json +32 -0
- package/tooling/.automation/validation/history/2026-01-18_val_35ee606f.json +32 -0
- package/tooling/.automation/validation/history/2026-01-18_val_3fc7268b.json +41 -0
- package/tooling/.automation/validation/history/2026-01-18_val_49f0bb17.json +32 -0
- package/tooling/.automation/validation/history/2026-01-18_val_53c928d2.json +59 -0
- package/tooling/.automation/validation/history/2026-01-18_val_55604791.json +32 -0
- package/tooling/.automation/validation/history/2026-01-18_val_67e695f0.json +41 -0
- package/tooling/.automation/validation/history/2026-01-18_val_82784713.json +41 -0
- package/tooling/.automation/validation/history/2026-01-18_val_94a8e584.json +32 -0
- package/tooling/.automation/validation/history/2026-01-18_val_95353af0.json +32 -0
- package/tooling/.automation/validation/history/2026-01-18_val_9a046f3a.json +32 -0
- package/tooling/.automation/validation/history/2026-01-18_val_b3443d2e.json +32 -0
- package/tooling/.automation/validation/history/2026-01-18_val_bfd298f4.json +32 -0
- package/tooling/.automation/validation/history/2026-01-18_val_cfc2a362.json +32 -0
- package/tooling/.automation/validation/history/2026-01-18_val_e581a3d2.json +41 -0
- package/tooling/scripts/lib/__init__.py +1 -3
- package/tooling/scripts/lib/agent_router.py +0 -4
- package/tooling/scripts/lib/cost_display.py +7 -1
- package/tooling/scripts/lib/swarm_orchestrator.py +14 -12
- package/tooling/scripts/live_dashboard.py +832 -0
- package/tooling/scripts/new-doc.py +1 -1
- package/tooling/scripts/run-collab.py +3 -47
- package/tooling/scripts/run-story.py +21 -9
- package/tooling/scripts/setup-checkpoint-service.py +1 -1
- package/.claude/commands/pair.md +0 -23
- package/tooling/scripts/lib/pair_programming.py +0 -688
|
@@ -5,7 +5,6 @@ Collaborative Story Runner - Unified CLI for Agent Collaboration
|
|
|
5
5
|
Integrates all collaboration features:
|
|
6
6
|
- Agent routing (auto-select best agents)
|
|
7
7
|
- Swarm mode (multi-agent debate)
|
|
8
|
-
- Pair programming (DEV + REVIEWER interleaved)
|
|
9
8
|
- Shared memory and knowledge graph
|
|
10
9
|
- Automatic handoffs
|
|
11
10
|
|
|
@@ -15,13 +14,11 @@ Usage:
|
|
|
15
14
|
Modes:
|
|
16
15
|
--auto Auto-route to best agents (default)
|
|
17
16
|
--swarm Multi-agent debate/consensus
|
|
18
|
-
--pair DEV + REVIEWER pair programming
|
|
19
17
|
--sequential Traditional sequential pipeline
|
|
20
18
|
|
|
21
19
|
Examples:
|
|
22
20
|
python run-collab.py 3-5 --auto
|
|
23
21
|
python run-collab.py 3-5 --swarm --agents ARCHITECT,DEV,REVIEWER
|
|
24
|
-
python run-collab.py 3-5 --pair
|
|
25
22
|
python run-collab.py "fix login bug" --auto
|
|
26
23
|
"""
|
|
27
24
|
|
|
@@ -38,10 +35,10 @@ from typing import Optional
|
|
|
38
35
|
SCRIPT_DIR = Path(__file__).parent
|
|
39
36
|
sys.path.insert(0, str(SCRIPT_DIR / "lib"))
|
|
40
37
|
|
|
41
|
-
from platform import IS_MACOS, IS_WINDOWS
|
|
42
|
-
|
|
43
38
|
from colors import Colors
|
|
44
39
|
|
|
40
|
+
from lib.platform import IS_MACOS, IS_WINDOWS
|
|
41
|
+
|
|
45
42
|
|
|
46
43
|
def detect_claude_cli() -> Optional[str]:
|
|
47
44
|
"""Detect Claude CLI across platforms.
|
|
@@ -158,7 +155,6 @@ def get_cache_dir() -> Path:
|
|
|
158
155
|
# Import collaboration modules
|
|
159
156
|
from lib.agent_handoff import HandoffGenerator, create_handoff # noqa: E402
|
|
160
157
|
from lib.agent_router import AgentRouter, RoutingResult # noqa: E402
|
|
161
|
-
from lib.pair_programming import PairConfig, PairSession # noqa: E402
|
|
162
158
|
from lib.shared_memory import get_knowledge_graph, get_shared_memory, share_learning # noqa: E402
|
|
163
159
|
from lib.swarm_orchestrator import ConsensusType, SwarmConfig, SwarmOrchestrator # noqa: E402
|
|
164
160
|
|
|
@@ -182,7 +178,7 @@ def print_banner():
|
|
|
182
178
|
{Colors.CYAN}╔═══════════════════════════════════════════════════════════════╗
|
|
183
179
|
║ DEVFLOW COLLABORATIVE STORY RUNNER ║
|
|
184
180
|
╠═══════════════════════════════════════════════════════════════╣
|
|
185
|
-
║ Multi-agent collaboration with swarm
|
|
181
|
+
║ Multi-agent collaboration with swarm and auto-routing ║
|
|
186
182
|
╚═══════════════════════════════════════════════════════════════╝{Colors.END}
|
|
187
183
|
""")
|
|
188
184
|
|
|
@@ -213,9 +209,6 @@ def run_auto_mode(story_key: str, task: str, args: argparse.Namespace):
|
|
|
213
209
|
if result.workflow == "swarm":
|
|
214
210
|
print(f"\n{Colors.YELLOW}-> Using swarm mode for multi-agent collaboration{Colors.END}")
|
|
215
211
|
return run_swarm_mode(story_key, task, result.agents, args)
|
|
216
|
-
elif result.workflow == "pair":
|
|
217
|
-
print(f"\n{Colors.YELLOW}-> Using pair programming mode{Colors.END}")
|
|
218
|
-
return run_pair_mode(story_key, task, args)
|
|
219
212
|
else:
|
|
220
213
|
print(f"\n{Colors.YELLOW}-> Using sequential execution{Colors.END}")
|
|
221
214
|
return run_sequential_mode(story_key, task, result.agents, args)
|
|
@@ -245,29 +238,6 @@ def run_swarm_mode(story_key: str, task: str, agents: list[str], args: argparse.
|
|
|
245
238
|
return result
|
|
246
239
|
|
|
247
240
|
|
|
248
|
-
def run_pair_mode(story_key: str, task: str, args: argparse.Namespace):
|
|
249
|
-
"""Run pair programming mode."""
|
|
250
|
-
print_section("Pair Programming Mode", "DEV + REVIEWER interleaved")
|
|
251
|
-
|
|
252
|
-
config = PairConfig(
|
|
253
|
-
max_revisions_per_chunk=args.max_revisions,
|
|
254
|
-
verbose=not args.quiet,
|
|
255
|
-
dev_model=args.model,
|
|
256
|
-
reviewer_model=args.model,
|
|
257
|
-
)
|
|
258
|
-
|
|
259
|
-
session = PairSession(story_key, task, config)
|
|
260
|
-
result = session.run()
|
|
261
|
-
|
|
262
|
-
# Print result
|
|
263
|
-
print(f"\n{Colors.GREEN}{result.to_summary()}{Colors.END}")
|
|
264
|
-
|
|
265
|
-
# Save result
|
|
266
|
-
save_result(story_key, "pair", result.to_dict())
|
|
267
|
-
|
|
268
|
-
return result
|
|
269
|
-
|
|
270
|
-
|
|
271
241
|
def run_sequential_mode(story_key: str, task: str, agents: list[str], args: argparse.Namespace):
|
|
272
242
|
"""Run sequential agent execution with handoffs."""
|
|
273
243
|
print_section("Sequential Mode", f"Pipeline: {' -> '.join(agents)}")
|
|
@@ -400,7 +370,6 @@ def parse_args():
|
|
|
400
370
|
Examples:
|
|
401
371
|
python run-collab.py 3-5 --auto
|
|
402
372
|
python run-collab.py 3-5 --swarm --agents ARCHITECT,DEV,REVIEWER
|
|
403
|
-
python run-collab.py 3-5 --pair --max-revisions 3
|
|
404
373
|
python run-collab.py "fix login bug" --auto
|
|
405
374
|
python run-collab.py 3-5 --memory # Show shared memory
|
|
406
375
|
python run-collab.py 3-5 --query "What did ARCHITECT decide about auth?"
|
|
@@ -416,7 +385,6 @@ Examples:
|
|
|
416
385
|
"--auto", action="store_true", default=True, help="Auto-route to best agents (default)"
|
|
417
386
|
)
|
|
418
387
|
mode_group.add_argument("--swarm", action="store_true", help="Multi-agent swarm/debate mode")
|
|
419
|
-
mode_group.add_argument("--pair", action="store_true", help="DEV + REVIEWER pair programming")
|
|
420
388
|
mode_group.add_argument(
|
|
421
389
|
"--sequential", action="store_true", help="Traditional sequential pipeline"
|
|
422
390
|
)
|
|
@@ -448,14 +416,6 @@ Examples:
|
|
|
448
416
|
)
|
|
449
417
|
parser.add_argument("--parallel", action="store_true", help="Enable parallel agent execution")
|
|
450
418
|
|
|
451
|
-
# Pair programming options
|
|
452
|
-
parser.add_argument(
|
|
453
|
-
"--max-revisions",
|
|
454
|
-
type=int,
|
|
455
|
-
default=3,
|
|
456
|
-
help="Max revisions per chunk in pair mode (default: 3)",
|
|
457
|
-
)
|
|
458
|
-
|
|
459
419
|
# General options
|
|
460
420
|
parser.add_argument(
|
|
461
421
|
"--model",
|
|
@@ -601,10 +561,6 @@ def main():
|
|
|
601
561
|
agents = ["ARCHITECT", "DEV", "REVIEWER"]
|
|
602
562
|
run_swarm_mode(story_key, task, agents, args)
|
|
603
563
|
|
|
604
|
-
elif args.pair:
|
|
605
|
-
print("Pair Programming")
|
|
606
|
-
run_pair_mode(story_key, task, args)
|
|
607
|
-
|
|
608
564
|
elif args.sequential:
|
|
609
565
|
print("Sequential")
|
|
610
566
|
if not agents:
|
|
@@ -39,13 +39,13 @@ SCRIPT_DIR = Path(__file__).parent
|
|
|
39
39
|
# Add lib directory for imports
|
|
40
40
|
sys.path.insert(0, str(SCRIPT_DIR / "lib"))
|
|
41
41
|
|
|
42
|
-
from platform import IS_WINDOWS, get_platform
|
|
43
|
-
|
|
44
42
|
from colors import Colors
|
|
45
43
|
|
|
44
|
+
from lib.platform import IS_WINDOWS, get_platform
|
|
45
|
+
|
|
46
46
|
# Try to import context monitor
|
|
47
47
|
try:
|
|
48
|
-
from context_monitor import ContextMonitor, StatusLine
|
|
48
|
+
from context_monitor import ContextMonitor, StatusLine
|
|
49
49
|
|
|
50
50
|
HAS_CONTEXT_MONITOR = True
|
|
51
51
|
except ImportError:
|
|
@@ -208,11 +208,15 @@ class NativeRunner:
|
|
|
208
208
|
print("Recommendation: Save checkpoint NOW and clear session.")
|
|
209
209
|
self._trigger_auto_checkpoint("emergency")
|
|
210
210
|
elif level == ContextLevel.CRITICAL:
|
|
211
|
-
print(
|
|
211
|
+
print(
|
|
212
|
+
f"\n{Colors.BOLD_RED}[CRITICAL]{Colors.RESET} Context at {state.context_usage_percent:.0f}%"
|
|
213
|
+
)
|
|
212
214
|
print("Recommendation: Consider wrapping up and checkpointing soon.")
|
|
213
215
|
self._trigger_auto_checkpoint("critical")
|
|
214
216
|
elif level == ContextLevel.WARNING:
|
|
215
|
-
print(
|
|
217
|
+
print(
|
|
218
|
+
f"\n{Colors.YELLOW}[WARNING]{Colors.RESET} Context at {state.context_usage_percent:.0f}%"
|
|
219
|
+
)
|
|
216
220
|
print(f"~{state.exchanges_remaining} exchanges remaining before compaction.")
|
|
217
221
|
|
|
218
222
|
def _trigger_auto_checkpoint(self, reason: str):
|
|
@@ -223,7 +227,9 @@ class NativeRunner:
|
|
|
223
227
|
from context_checkpoint import ContextCheckpointManager
|
|
224
228
|
|
|
225
229
|
manager = ContextCheckpointManager()
|
|
226
|
-
context_level =
|
|
230
|
+
context_level = (
|
|
231
|
+
self.context_monitor.state.context_usage_ratio if self.context_monitor else 0.0
|
|
232
|
+
)
|
|
227
233
|
checkpoint_file = manager.create_checkpoint(context_level, reason=reason)
|
|
228
234
|
print(f"[CHECKPOINT] Saved to: {checkpoint_file.name}")
|
|
229
235
|
|
|
@@ -438,11 +444,15 @@ class NativeRunner:
|
|
|
438
444
|
# Print header with status line
|
|
439
445
|
print(f"{Colors.DIM}{'─' * 70}{Colors.RESET}")
|
|
440
446
|
print(f"{Colors.BOLD}DEVFLOW STORY RUNNER{Colors.RESET}")
|
|
441
|
-
print(
|
|
447
|
+
print(
|
|
448
|
+
f"Story: {self.args.story_key} | Model: {self.args.model} | Budget: ${self.args.budget:.2f}"
|
|
449
|
+
)
|
|
442
450
|
if self.validation_enabled:
|
|
443
451
|
print("Validation: Enabled")
|
|
444
452
|
if self.context_monitor:
|
|
445
|
-
print(
|
|
453
|
+
print(
|
|
454
|
+
f"Context Monitor: Active (window: {self.context_monitor.state.context_window:,} tokens)"
|
|
455
|
+
)
|
|
446
456
|
print(f"{Colors.DIM}{'─' * 70}{Colors.RESET}")
|
|
447
457
|
print()
|
|
448
458
|
|
|
@@ -470,7 +480,9 @@ class NativeRunner:
|
|
|
470
480
|
|
|
471
481
|
# Set initial activity state
|
|
472
482
|
if self.context_monitor:
|
|
473
|
-
self.context_monitor.set_current_activity(
|
|
483
|
+
self.context_monitor.set_current_activity(
|
|
484
|
+
total_phases=total_phases, phases_completed=0
|
|
485
|
+
)
|
|
474
486
|
|
|
475
487
|
# Context phase
|
|
476
488
|
if run_context:
|
package/.claude/commands/pair.md
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Run pair programming mode (DEV + REVIEWER interleaved)
|
|
3
|
-
argument-hint: <story-key>
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
Run Devflow pair programming for: $ARGUMENTS
|
|
7
|
-
|
|
8
|
-
Execute: `npx @pjmendonca/devflow pair $ARGUMENTS`
|
|
9
|
-
|
|
10
|
-
This runs DEV and REVIEWER in an interleaved pair programming mode:
|
|
11
|
-
- DEV implements code in small, reviewable chunks
|
|
12
|
-
- REVIEWER provides immediate feedback after each chunk
|
|
13
|
-
- DEV addresses issues before continuing to next chunk
|
|
14
|
-
- Results in higher quality code with fewer late-stage revisions
|
|
15
|
-
|
|
16
|
-
Benefits:
|
|
17
|
-
- Real-time feedback loops during implementation
|
|
18
|
-
- Issues caught early, not at final review
|
|
19
|
-
- Better knowledge sharing between agents
|
|
20
|
-
- Higher approval rates
|
|
21
|
-
|
|
22
|
-
Example:
|
|
23
|
-
- `/pair 3-5` - Run pair programming for story 3-5
|