devsquad 3.6.0__py3-none-any.whl
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.
- devsquad-3.6.0.dist-info/METADATA +944 -0
- devsquad-3.6.0.dist-info/RECORD +95 -0
- devsquad-3.6.0.dist-info/WHEEL +5 -0
- devsquad-3.6.0.dist-info/entry_points.txt +2 -0
- devsquad-3.6.0.dist-info/licenses/LICENSE +21 -0
- devsquad-3.6.0.dist-info/top_level.txt +2 -0
- scripts/__init__.py +0 -0
- scripts/ai_semantic_matcher.py +512 -0
- scripts/alert_manager.py +505 -0
- scripts/api/__init__.py +43 -0
- scripts/api/models.py +386 -0
- scripts/api/routes/__init__.py +20 -0
- scripts/api/routes/dispatch.py +348 -0
- scripts/api/routes/lifecycle.py +330 -0
- scripts/api/routes/metrics_gates.py +347 -0
- scripts/api_server.py +318 -0
- scripts/auth.py +451 -0
- scripts/cli/__init__.py +1 -0
- scripts/cli/cli_visual.py +642 -0
- scripts/cli.py +1094 -0
- scripts/collaboration/__init__.py +212 -0
- scripts/collaboration/_version.py +1 -0
- scripts/collaboration/agent_briefing.py +656 -0
- scripts/collaboration/ai_semantic_matcher.py +260 -0
- scripts/collaboration/anchor_checker.py +281 -0
- scripts/collaboration/anti_rationalization.py +470 -0
- scripts/collaboration/async_integration_example.py +255 -0
- scripts/collaboration/batch_scheduler.py +149 -0
- scripts/collaboration/checkpoint_manager.py +561 -0
- scripts/collaboration/ci_feedback_adapter.py +351 -0
- scripts/collaboration/code_map_generator.py +247 -0
- scripts/collaboration/concern_pack_loader.py +352 -0
- scripts/collaboration/confidence_score.py +496 -0
- scripts/collaboration/config_loader.py +188 -0
- scripts/collaboration/consensus.py +244 -0
- scripts/collaboration/context_compressor.py +533 -0
- scripts/collaboration/coordinator.py +668 -0
- scripts/collaboration/dispatcher.py +1636 -0
- scripts/collaboration/dual_layer_context.py +128 -0
- scripts/collaboration/enhanced_worker.py +539 -0
- scripts/collaboration/feature_usage_tracker.py +206 -0
- scripts/collaboration/five_axis_consensus.py +334 -0
- scripts/collaboration/input_validator.py +401 -0
- scripts/collaboration/integration_example.py +287 -0
- scripts/collaboration/intent_workflow_mapper.py +350 -0
- scripts/collaboration/language_parsers.py +269 -0
- scripts/collaboration/lifecycle_protocol.py +1446 -0
- scripts/collaboration/llm_backend.py +453 -0
- scripts/collaboration/llm_cache.py +448 -0
- scripts/collaboration/llm_cache_async.py +347 -0
- scripts/collaboration/llm_retry.py +387 -0
- scripts/collaboration/llm_retry_async.py +389 -0
- scripts/collaboration/mce_adapter.py +597 -0
- scripts/collaboration/memory_bridge.py +1607 -0
- scripts/collaboration/models.py +537 -0
- scripts/collaboration/null_providers.py +297 -0
- scripts/collaboration/operation_classifier.py +289 -0
- scripts/collaboration/output_slicer.py +225 -0
- scripts/collaboration/performance_monitor.py +462 -0
- scripts/collaboration/permission_guard.py +865 -0
- scripts/collaboration/prompt_assembler.py +756 -0
- scripts/collaboration/prompt_variant_generator.py +483 -0
- scripts/collaboration/protocols.py +267 -0
- scripts/collaboration/report_formatter.py +352 -0
- scripts/collaboration/retrospective.py +279 -0
- scripts/collaboration/role_matcher.py +92 -0
- scripts/collaboration/role_template_market.py +352 -0
- scripts/collaboration/rule_collector.py +678 -0
- scripts/collaboration/scratchpad.py +346 -0
- scripts/collaboration/skill_registry.py +151 -0
- scripts/collaboration/skillifier.py +878 -0
- scripts/collaboration/standardized_role_template.py +317 -0
- scripts/collaboration/task_completion_checker.py +237 -0
- scripts/collaboration/test_quality_guard.py +695 -0
- scripts/collaboration/unified_gate_engine.py +598 -0
- scripts/collaboration/usage_tracker.py +309 -0
- scripts/collaboration/user_friendly_error.py +176 -0
- scripts/collaboration/verification_gate.py +312 -0
- scripts/collaboration/warmup_manager.py +635 -0
- scripts/collaboration/worker.py +513 -0
- scripts/collaboration/workflow_engine.py +684 -0
- scripts/dashboard.py +1088 -0
- scripts/generate_benchmark_report.py +786 -0
- scripts/history_manager.py +604 -0
- scripts/mcp_server.py +289 -0
- skills/__init__.py +32 -0
- skills/dispatch/handler.py +52 -0
- skills/intent/handler.py +59 -0
- skills/registry.py +67 -0
- skills/retrospective/__init__.py +0 -0
- skills/retrospective/handler.py +125 -0
- skills/review/handler.py +356 -0
- skills/security/handler.py +454 -0
- skills/test/__init__.py +0 -0
- skills/test/handler.py +78 -0
|
@@ -0,0 +1,944 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: devsquad
|
|
3
|
+
Version: 3.6.0
|
|
4
|
+
Summary: Multi-Role AI Task Orchestrator — one task in, multi-role AI collaboration, one conclusion out (Production Ready)
|
|
5
|
+
Author: DevSquad Team
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/lulin70/DevSquad
|
|
8
|
+
Project-URL: Documentation, https://github.com/lulin70/DevSquad#readme
|
|
9
|
+
Project-URL: Repository, https://github.com/lulin70/DevSquad
|
|
10
|
+
Project-URL: Issues, https://github.com/lulin70/DevSquad/issues
|
|
11
|
+
Keywords: ai,multi-agent,orchestration,llm,collaboration
|
|
12
|
+
Classifier: Development Status :: 4 - Beta
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
20
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
21
|
+
Requires-Python: >=3.9
|
|
22
|
+
Description-Content-Type: text/markdown
|
|
23
|
+
License-File: LICENSE
|
|
24
|
+
Requires-Dist: pyyaml>=6.0
|
|
25
|
+
Requires-Dist: fastapi>=0.100.0
|
|
26
|
+
Requires-Dist: uvicorn[standard]>=0.23.0
|
|
27
|
+
Requires-Dist: pydantic>=2.0
|
|
28
|
+
Provides-Extra: openai
|
|
29
|
+
Requires-Dist: openai>=1.0; extra == "openai"
|
|
30
|
+
Provides-Extra: anthropic
|
|
31
|
+
Requires-Dist: anthropic>=0.18; extra == "anthropic"
|
|
32
|
+
Provides-Extra: carrymem
|
|
33
|
+
Requires-Dist: carrymem[devsquad]>=0.2.8; extra == "carrymem"
|
|
34
|
+
Provides-Extra: mcp
|
|
35
|
+
Requires-Dist: mcp>=0.9; extra == "mcp"
|
|
36
|
+
Provides-Extra: monitoring
|
|
37
|
+
Requires-Dist: psutil>=5.9; extra == "monitoring"
|
|
38
|
+
Provides-Extra: api
|
|
39
|
+
Requires-Dist: fastapi>=0.100.0; extra == "api"
|
|
40
|
+
Requires-Dist: uvicorn[standard]>=0.23.0; extra == "api"
|
|
41
|
+
Requires-Dist: pydantic>=2.0; extra == "api"
|
|
42
|
+
Provides-Extra: visualization
|
|
43
|
+
Requires-Dist: streamlit>=1.28.0; extra == "visualization"
|
|
44
|
+
Requires-Dist: jupyter>=1.0; extra == "visualization"
|
|
45
|
+
Provides-Extra: alerts
|
|
46
|
+
Requires-Dist: slack-sdk>=3.20; extra == "alerts"
|
|
47
|
+
Provides-Extra: dev
|
|
48
|
+
Requires-Dist: pytest>=7.0; extra == "dev"
|
|
49
|
+
Requires-Dist: pytest-asyncio>=0.21; extra == "dev"
|
|
50
|
+
Requires-Dist: black>=23.0; extra == "dev"
|
|
51
|
+
Requires-Dist: flake8>=6.0; extra == "dev"
|
|
52
|
+
Requires-Dist: mypy>=1.0; extra == "dev"
|
|
53
|
+
Provides-Extra: all
|
|
54
|
+
Requires-Dist: devsquad[alerts,anthropic,api,carrymem,dev,mcp,monitoring,openai,visualization]; extra == "all"
|
|
55
|
+
Dynamic: license-file
|
|
56
|
+
|
|
57
|
+
# DevSquad — Multi-Role AI Task Orchestrator
|
|
58
|
+
|
|
59
|
+
<p align="center">
|
|
60
|
+
<strong>One task → Multi-role AI collaboration → One conclusion</strong>
|
|
61
|
+
<br>
|
|
62
|
+
<em>Production Ready | V3.6.0</em>
|
|
63
|
+
</p>
|
|
64
|
+
|
|
65
|
+
<p align="center">
|
|
66
|
+
<img alt="Python" src="https://img.shields.io/badge/Python-3.9+-blue?logo=python&logoColor=white" />
|
|
67
|
+
<img alt="License" src="https://img.shields.io/badge/License-MIT-green" />
|
|
68
|
+
<img alt="Tests" src="https://img.shields.io/badge/Tests-1548%20passing-brightgreen" />
|
|
69
|
+
<img alt="Version" src="https://img.shields.io/badge/V3.6.0-success" />
|
|
70
|
+
<img alt="CI" src="https://img.shields.io/badge/CI-GitHub_Actions-blue?logo=githubactions" />
|
|
71
|
+
<img alt="Quality" src="https://img.shields.io/badge/Code%20Quality-4.3%2F5%20%E2%98%85%E2%98%85%E2%98%85%E2%98%85%E2%98%86-blue" />
|
|
72
|
+
<img alt="Security" src="https://img.shields.io/badge/Security-5%2F5%20%E2%98%85%E2%98%85%E2%98%85%E2%98%85%E2%98%85-success" />
|
|
73
|
+
</p>
|
|
74
|
+
|
|
75
|
+
<p align="center">
|
|
76
|
+
<img alt="Architecture" src="https://img.shields.io/badge/Architecture-Plan_C_Layered-blueviolet" />
|
|
77
|
+
<img alt="API" src="https://img.shields.io/badge/API-FastAPI-009688?logo=fastapi" />
|
|
78
|
+
<img alt="Dashboard" src="https://img.shields.io/badge/Dashboard-Streamlit-red?logo=streamlit" />
|
|
79
|
+
<img alt="Auth" src="https://img.shields.io/badge/Auth-RBAC-green" />
|
|
80
|
+
<img alt="Alerts" src="https://img.shields.io/badge/Alerts-Multi_Channel-orange" />
|
|
81
|
+
<img alt="Database" src="https://img.shields.io/badge/Database-SQLite-blue" />
|
|
82
|
+
</p>
|
|
83
|
+
|
|
84
|
+
---
|
|
85
|
+
|
|
86
|
+
## 🚀 V3.6.0: Anchor Check & Retrospective Enhancement Release
|
|
87
|
+
|
|
88
|
+
**DevSquad V3.6.0** adds AnchorChecker for milestone anchor verification, RetrospectiveEngine for independent retrospectives, FeatureUsageTracker for data-driven feature optimization, StructuredGoal for structured goal management, and FallbackBackend for automatic backend failover — making multi-agent collaboration more reliable, self-improving, and observable.
|
|
89
|
+
|
|
90
|
+
### 🎯 Quick Start (4 Ways to Use DevSquad)
|
|
91
|
+
|
|
92
|
+
#### 0️⃣ First Time? Start Here!
|
|
93
|
+
```bash
|
|
94
|
+
# Interactive setup wizard (1-2 minutes)
|
|
95
|
+
python scripts/cli.py init
|
|
96
|
+
|
|
97
|
+
# Then start collaborating!
|
|
98
|
+
devsquad dispatch -t "your task description"
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
#### 1️⃣ Interactive Web Dashboard (Recommended)
|
|
102
|
+
```bash
|
|
103
|
+
# Start Streamlit dashboard with authentication
|
|
104
|
+
streamlit run scripts/dashboard.py
|
|
105
|
+
|
|
106
|
+
# Open http://localhost:8501
|
|
107
|
+
# Login with: admin / admin123
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
#### 2️⃣ REST API Server
|
|
111
|
+
```bash
|
|
112
|
+
# Install dependencies
|
|
113
|
+
pip install fastapi uvicorn
|
|
114
|
+
|
|
115
|
+
# Start API server
|
|
116
|
+
uvicorn scripts.api_server:app --host 0.0.0.0 --port 8000 --reload
|
|
117
|
+
|
|
118
|
+
# Access Swagger UI: http://localhost:8000/docs
|
|
119
|
+
# Access ReDoc: http://localhost:8000/redoc
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
#### 3️⃣ Command Line Interface
|
|
123
|
+
```bash
|
|
124
|
+
# Standard CLI usage
|
|
125
|
+
python scripts/cli.py lifecycle build
|
|
126
|
+
|
|
127
|
+
# Enhanced visual output
|
|
128
|
+
python scripts/cli.py lifecycle build --visual --verbose
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
---
|
|
132
|
+
|
|
133
|
+
## 🏗️ Architecture Overview
|
|
134
|
+
|
|
135
|
+
```
|
|
136
|
+
┌─────────────────────────────────────────────────────────────┐
|
|
137
|
+
│ User Access Layer │
|
|
138
|
+
│ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │
|
|
139
|
+
│ │ Streamlit │ │ FastAPI REST │ │ CLI/Notebook │ │
|
|
140
|
+
│ │ Dashboard │ │ API Server │ │ (Existing) │ │
|
|
141
|
+
│ │ (Auth+HTTPS) │ │ (Swagger) │ │ │ │
|
|
142
|
+
│ └──────┬───────┘ └──────┬───────┘ └──────────────┘ │
|
|
143
|
+
└─────────┼───────────────┼───────────────────────────────────┘
|
|
144
|
+
│ │
|
|
145
|
+
▼ ▼
|
|
146
|
+
┌─────────────────────────────────────────────────────────────┐
|
|
147
|
+
│ Business Logic Layer │
|
|
148
|
+
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │
|
|
149
|
+
│ │AuthManager │ │AlertManager │ │HistoryMgr │ │
|
|
150
|
+
│ │(RBAC Auth) │ │(Multi-Chnl) │ │(SQLite TSDB)│ │
|
|
151
|
+
│ └─────────────┘ └─────────────┘ └─────────────┘ │
|
|
152
|
+
│ ┌─────────────────────────────────────────────┐ │
|
|
153
|
+
│ │ LifecycleProtocol (11-Phase Engine) │ │
|
|
154
|
+
│ │ UnifiedGateEngine + CheckpointManager │ │
|
|
155
|
+
│ └─────────────────────────────────────────────┘ │
|
|
156
|
+
└─────────────────────────┬───────────────────────────────────┘
|
|
157
|
+
│
|
|
158
|
+
▼
|
|
159
|
+
┌─────────────────────────────────────────────────────────────┐
|
|
160
|
+
│ Data Persistence Layer │
|
|
161
|
+
│ ┌────────────┐ ┌────────────┐ ┌────────────────────────┐ │
|
|
162
|
+
│ │ SQLite DB │ │ YAML Config│ │ Checkpoint Files │ │
|
|
163
|
+
│ │ (History) │ │ (Deploy) │ │ (Lifecycle State) │ │
|
|
164
|
+
│ └────────────┘ └────────────┘ └────────────────────────┘ │
|
|
165
|
+
└─────────────────────────────────────────────────────────────┘
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
---
|
|
169
|
+
|
|
170
|
+
## ✨ Key Features (V3.6.0)
|
|
171
|
+
|
|
172
|
+
### ⚓ AnchorChecker (NEW)
|
|
173
|
+
Milestone anchor verification that ensures critical checkpoints are properly validated before proceeding:
|
|
174
|
+
- **Anchor Point Definition** — Define mandatory validation anchors at key lifecycle milestones
|
|
175
|
+
- **Cross-Phase Verification** — Verify consistency between phase outputs and anchor criteria
|
|
176
|
+
- **Drift Detection** — Detect when project execution drifts from defined anchor points
|
|
177
|
+
- **Auto-Recovery** — Suggest corrective actions when anchor checks fail
|
|
178
|
+
|
|
179
|
+
### 🔄 RetrospectiveEngine (NEW)
|
|
180
|
+
Independent retrospective mechanism for continuous improvement after each dispatch cycle:
|
|
181
|
+
- **Post-Dispatch Review** — Automatically analyze what went well and what could improve
|
|
182
|
+
- **Pattern Extraction** — Extract reusable patterns from successful collaborations
|
|
183
|
+
- **Anti-Pattern Detection** — Identify recurring issues and suggest process improvements
|
|
184
|
+
- **Metric Trend Analysis** — Track quality metrics across dispatches to spot degradation
|
|
185
|
+
|
|
186
|
+
### 📊 FeatureUsageTracker (NEW)
|
|
187
|
+
Thread-safe feature invocation counter for data-driven feature optimization:
|
|
188
|
+
- **Invocation Tracking** — Count every feature call (dispatch, anchor_check, retrospective, consensus, etc.)
|
|
189
|
+
- **Usage Reports** — Top features, unused features, low-usage features with markdown export
|
|
190
|
+
- **Auto-Persist** — Periodic JSON persistence every 100 ticks
|
|
191
|
+
- **30 Known Features** — Pre-registered feature set covering all DevSquad capabilities
|
|
192
|
+
|
|
193
|
+
### 🎯 StructuredGoal (NEW)
|
|
194
|
+
Structured goal management that decomposes high-level objectives into trackable, verifiable sub-goals:
|
|
195
|
+
- **Goal Decomposition** — Break complex objectives into hierarchical sub-goals with clear criteria
|
|
196
|
+
- **Progress Tracking** — Real-time progress measurement against defined goal structure
|
|
197
|
+
- **Dependency Mapping** — Visualize and manage dependencies between sub-goals
|
|
198
|
+
- **Completion Verification** — Automated verification that goals meet their success criteria
|
|
199
|
+
|
|
200
|
+
### 🔀 FallbackBackend (NEW)
|
|
201
|
+
Automatic backend failover that ensures LLM availability even when primary backends are down:
|
|
202
|
+
- **Health Monitoring** — Continuous health checks for all configured LLM backends
|
|
203
|
+
- **Automatic Failover** — Seamlessly switch to backup backend when primary fails
|
|
204
|
+
- **Priority-Based Routing** — Configure backend priority order (e.g., OpenAI → Anthropic → Mock)
|
|
205
|
+
- **Recovery Detection** — Automatically restore primary backend when it recovers
|
|
206
|
+
|
|
207
|
+
### 🔐 Authentication & Authorization
|
|
208
|
+
- **Multi-user support** with role-based access control (RBAC)
|
|
209
|
+
- **Three roles**: Admin (full access), Operator (execute), Viewer (read-only)
|
|
210
|
+
- **Secure password hashing** with SHA-256
|
|
211
|
+
- **Session management** for Streamlit dashboard
|
|
212
|
+
- **OAuth2 support** (optional, for enterprise deployments)
|
|
213
|
+
|
|
214
|
+
### 🌐 REST API (FastAPI)
|
|
215
|
+
- **10+ endpoints** for complete lifecycle management
|
|
216
|
+
- **Automatic OpenAPI/Swagger** documentation at `/docs`
|
|
217
|
+
- **CORS middleware** for cross-origin requests
|
|
218
|
+
- **Request timing** and comprehensive logging
|
|
219
|
+
- **Standardized error responses**
|
|
220
|
+
|
|
221
|
+
**Key Endpoints:**
|
|
222
|
+
```
|
|
223
|
+
Lifecycle:
|
|
224
|
+
GET /api/v1/lifecycle/phases → List all 11 phases
|
|
225
|
+
POST /api/v1/lifecycle/actions → Execute phase actions
|
|
226
|
+
GET /api/v1/lifecycle/status → Current status
|
|
227
|
+
|
|
228
|
+
Metrics:
|
|
229
|
+
GET /api/v1/metrics/current → Real-time metrics
|
|
230
|
+
GET /api/v1/metrics/history → Historical data
|
|
231
|
+
|
|
232
|
+
Gates:
|
|
233
|
+
GET /api/v1/gates/status → All gate statuses
|
|
234
|
+
POST /api/v1/gates/check → Check specific gate
|
|
235
|
+
|
|
236
|
+
System:
|
|
237
|
+
GET /api/v1/health → Health check
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
### 🔔 Alert Notification System
|
|
241
|
+
- **4 severity levels**: INFO, WARNING, ERROR, CRITICAL
|
|
242
|
+
- **Multiple channels**: Console, Slack, Email, Webhook
|
|
243
|
+
- **Rate limiting** to prevent alert spam (configurable)
|
|
244
|
+
- **Deduplication** within time window
|
|
245
|
+
- **Alert history** tracking and statistics
|
|
246
|
+
|
|
247
|
+
### 📊 Historical Data Storage (SQLite)
|
|
248
|
+
- **Metrics snapshots** with time-range queries
|
|
249
|
+
- **Alert history** with acknowledgment tracking
|
|
250
|
+
- **API request logs** with performance metrics
|
|
251
|
+
- **Lifecycle events** audit trail
|
|
252
|
+
- **Automatic cleanup** with configurable retention
|
|
253
|
+
|
|
254
|
+
### 📈 Visualization & Monitoring
|
|
255
|
+
- **Streamlit Dashboard**: Real-time monitoring with authentication
|
|
256
|
+
- **CLI Visual Module**: Rich terminal output with colors and icons
|
|
257
|
+
- **Jupyter Notebook**: Interactive 10-section tutorial
|
|
258
|
+
- **Benchmark Reports**: HTML/JSON performance reports
|
|
259
|
+
|
|
260
|
+
---
|
|
261
|
+
|
|
262
|
+
## 🧩 Layered Sub-Skill Architecture (V3.6.0)
|
|
263
|
+
|
|
264
|
+
> DevSquad provides **6 atomic sub-skills** that can be used independently or together.
|
|
265
|
+
> Each sub-skill is a thin wrapper (~50 lines) importing existing core modules — no duplicated logic.
|
|
266
|
+
|
|
267
|
+
```
|
|
268
|
+
skills/
|
|
269
|
+
├── dispatch/ → DispatchSkill — MultiAgentDispatcher (7-role orchestration)
|
|
270
|
+
├── intent/ → IntentSkill — IntentWorkflowMapper (6 intents × 3 languages)
|
|
271
|
+
├── review/ → ReviewSkill — FiveAxisConsensusEngine (5-axis code review)
|
|
272
|
+
├── security/ → SecuritySkill — InputValidator + OperationClassifier + PermissionGuard
|
|
273
|
+
├── test/ → TestSkill — TestQualityGuard + test strategy generation
|
|
274
|
+
└── retrospective/ → RetroSkill — RetrospectiveEngine + pattern extraction
|
|
275
|
+
```
|
|
276
|
+
|
|
277
|
+
### Sub-Skill Quick Reference
|
|
278
|
+
|
|
279
|
+
| Skill | Core Method | Wraps | Mock Mode |
|
|
280
|
+
|-------|------------|-------|:---------:|
|
|
281
|
+
| `dispatch` | `run(task, roles, mode)` | MultiAgentDispatcher | ✅ |
|
|
282
|
+
| `intent` | `detect(text, lang)` | IntentWorkflowMapper | ✅ |
|
|
283
|
+
| `review` | `review(code)` | FiveAxisConsensusEngine | ✅ |
|
|
284
|
+
| `security` | `scan_input(text)` | InputValidator + OpClassifier | ✅ |
|
|
285
|
+
| `test` | `generate_strategy(module)` | TestQualityGuard | ✅ |
|
|
286
|
+
| `retrospective` | `run_retrospective(results)` | RetrospectiveEngine | ✅ |
|
|
287
|
+
|
|
288
|
+
### Usage Examples
|
|
289
|
+
|
|
290
|
+
```python
|
|
291
|
+
# Direct import (recommended for single skill)
|
|
292
|
+
from skills.dispatch.handler import DispatchSkill
|
|
293
|
+
result = DispatchSkill().run("Fix login bug", roles=["coder", "tester"])
|
|
294
|
+
|
|
295
|
+
# Via registry (dynamic discovery)
|
|
296
|
+
from skills import get_skill, list_skills
|
|
297
|
+
print(list_skills()) # ['dispatch', 'intent', 'review', 'security', 'test', 'retrospective']
|
|
298
|
+
skill = get_skill("security")
|
|
299
|
+
result = skill.scan_input("DROP TABLE users; --")
|
|
300
|
+
```
|
|
301
|
+
|
|
302
|
+
All sub-skills work **without any API key** in Mock mode.
|
|
303
|
+
|
|
304
|
+
---
|
|
305
|
+
|
|
306
|
+
## 📋 Plan C Architecture (Core Engine)
|
|
307
|
+
|
|
308
|
+
**Unified Lifecycle Architecture** - Resolves CLI 6 commands vs 11-phase lifecycle:
|
|
309
|
+
|
|
310
|
+
```
|
|
311
|
+
CLI View Layer (6 commands) Core Engine (11 phases)
|
|
312
|
+
┌─────────────────────┐ ┌──────────────────────────┐
|
|
313
|
+
│ spec → P1, P2 │───View ──→│ P1: Requirements │
|
|
314
|
+
│ plan → P7 │ Mapping │ P2: Architecture │
|
|
315
|
+
│ build → P8 │ │ P3: Technical Design │
|
|
316
|
+
│ test → P9 │ │ ... │
|
|
317
|
+
│ review → P8,P6 │ │ P10: Deployment │
|
|
318
|
+
│ ship → P10 │ │ P11: Operations │
|
|
319
|
+
└─────────────────────┘ └──────────────────────────┘
|
|
320
|
+
↓ ↓
|
|
321
|
+
UnifiedGateEngine CheckpointManager
|
|
322
|
+
(Phase + Worker gates) (Lifecycle state persistence)
|
|
323
|
+
```
|
|
324
|
+
|
|
325
|
+
**Core Components:**
|
|
326
|
+
- ✅ **LifecycleProtocol** - Abstract interface for unified lifecycle management
|
|
327
|
+
- ✅ **UnifiedGateEngine** - Integrates VerificationGate + Phase transition gates
|
|
328
|
+
- ✅ **FullLifecycleAdapter** - Complete 11-phase lifecycle with dependency resolution
|
|
329
|
+
- ✅ **Enhanced CheckpointManager** - Auto save/restore lifecycle state across sessions
|
|
330
|
+
|
|
331
|
+
## What is DevSquad?
|
|
332
|
+
|
|
333
|
+
DevSquad transforms a **single AI task into a multi-role AI collaboration**. It automatically dispatches your task to the right combination of expert roles — architect, product manager, coder, tester, security reviewer, DevOps — orchestrates their parallel collaboration through a shared workspace, resolves conflicts via weighted consensus voting, and delivers a unified structured report.
|
|
334
|
+
|
|
335
|
+
```
|
|
336
|
+
You: "Design a microservices e-commerce backend"
|
|
337
|
+
│
|
|
338
|
+
▼
|
|
339
|
+
┌─────────────────┐
|
|
340
|
+
│ InputValidator ──→ Security check (XSS, SQL injection, prompt injection)
|
|
341
|
+
└────────┬────────┘
|
|
342
|
+
▼
|
|
343
|
+
┌─────────────────┐
|
|
344
|
+
│ RoleMatcher ──→ Auto-match: architect + devops + security
|
|
345
|
+
└────────┬────────┘
|
|
346
|
+
▼
|
|
347
|
+
┌──────────┬──────────┬──────────┐
|
|
348
|
+
│ Architect │ DevOps │ Security │ ← ThreadPoolExecutor parallel execution
|
|
349
|
+
│(Design) │(Infra) │(Threat) │
|
|
350
|
+
└────┬──────┴────┬─────┴────┬────┘
|
|
351
|
+
└────────────┼───────────┘
|
|
352
|
+
▼
|
|
353
|
+
┌──────────────────┐
|
|
354
|
+
│ Scratchpad │ ← Shared blackboard (real-time sync)
|
|
355
|
+
└────────┬─────────┘
|
|
356
|
+
▼
|
|
357
|
+
┌──────────────────┐
|
|
358
|
+
│ Consensus Engine │ ← Weighted vote + veto + escalation
|
|
359
|
+
└────────┬─────────┘
|
|
360
|
+
▼
|
|
361
|
+
┌──────────────────┐
|
|
362
|
+
│ Structured Report │ ← Findings + Action Items (H/M/L)
|
|
363
|
+
└──────────────────┘
|
|
364
|
+
```
|
|
365
|
+
|
|
366
|
+
## 📦 Installation
|
|
367
|
+
|
|
368
|
+
### Prerequisites
|
|
369
|
+
- **Python 3.9+** (3.9, 3.10, 3.11, 3.12 supported)
|
|
370
|
+
- **pip** or **pipenv** for package management
|
|
371
|
+
|
|
372
|
+
### Option A: Core Installation (CLI + Dashboard)
|
|
373
|
+
```bash
|
|
374
|
+
git clone https://github.com/your-org/DevSquad.git
|
|
375
|
+
cd DevSquad
|
|
376
|
+
|
|
377
|
+
# Install core package (minimal dependencies)
|
|
378
|
+
pip install -e .
|
|
379
|
+
|
|
380
|
+
# Ready to use!
|
|
381
|
+
devsquad dispatch -t "Design user authentication system"
|
|
382
|
+
```
|
|
383
|
+
|
|
384
|
+
### Option B: Full Production Stack (Recommended)
|
|
385
|
+
```bash
|
|
386
|
+
# Clone and install with all production features
|
|
387
|
+
git clone https://github.com/your-org/DevSquad.git
|
|
388
|
+
cd DevSquad
|
|
389
|
+
|
|
390
|
+
# Install with API server dependencies
|
|
391
|
+
pip install -e ".[api]"
|
|
392
|
+
|
|
393
|
+
# Or install all optional features
|
|
394
|
+
pip install -e ".[all]"
|
|
395
|
+
```
|
|
396
|
+
|
|
397
|
+
**Optional Feature Groups:**
|
|
398
|
+
```bash
|
|
399
|
+
# API Server (FastAPI + Uvicorn)
|
|
400
|
+
pip install -e ".[api]"
|
|
401
|
+
|
|
402
|
+
# Visualization (Streamlit + Jupyter)
|
|
403
|
+
pip install -e ".[visualization]"
|
|
404
|
+
|
|
405
|
+
# Alerting (Slack SDK)
|
|
406
|
+
pip install -e ".[alerts]"
|
|
407
|
+
|
|
408
|
+
# Development & Testing
|
|
409
|
+
pip install -e ".[dev]"
|
|
410
|
+
|
|
411
|
+
# Everything combined
|
|
412
|
+
pip install -e ".[all]"
|
|
413
|
+
```
|
|
414
|
+
|
|
415
|
+
### Verify Installation
|
|
416
|
+
```bash
|
|
417
|
+
# Check version
|
|
418
|
+
devsquad --version
|
|
419
|
+
# Expected: devsquad 3.6.0
|
|
420
|
+
|
|
421
|
+
# Run tests
|
|
422
|
+
pytest tests/ -v --tb=short
|
|
423
|
+
# Expected: 1500+ passed
|
|
424
|
+
```
|
|
425
|
+
|
|
426
|
+
### 3 Ways to Use
|
|
427
|
+
|
|
428
|
+
**1. CLI (Recommended)**
|
|
429
|
+
|
|
430
|
+
```bash
|
|
431
|
+
# Mock mode (default) — no API key needed
|
|
432
|
+
python3 scripts/cli.py dispatch -t "Design user authentication system"
|
|
433
|
+
|
|
434
|
+
# Real AI output — set environment variables first
|
|
435
|
+
export OPENAI_API_KEY="sk-..."
|
|
436
|
+
export OPENAI_BASE_URL="https://api.openai.com/v1" # optional
|
|
437
|
+
export OPENAI_MODEL="gpt-4" # optional
|
|
438
|
+
python3 scripts/cli.py dispatch -t "Design auth system" --backend openai
|
|
439
|
+
|
|
440
|
+
# Specify roles (short IDs: arch/pm/test/coder/ui/infra/sec)
|
|
441
|
+
python3 scripts/cli.py dispatch -t "Design auth system" -r arch sec --backend openai
|
|
442
|
+
|
|
443
|
+
# Stream output in real-time
|
|
444
|
+
python3 scripts/cli.py dispatch -t "Design auth system" -r arch --backend openai --stream
|
|
445
|
+
|
|
446
|
+
# Other commands
|
|
447
|
+
python3 scripts/cli.py status # System status
|
|
448
|
+
python3 scripts/cli.py roles # List available roles
|
|
449
|
+
python3 scripts/cli.py --version # Show version (3.6.0)
|
|
450
|
+
```
|
|
451
|
+
|
|
452
|
+
**2. Python API**
|
|
453
|
+
|
|
454
|
+
```python
|
|
455
|
+
from scripts.collaboration.dispatcher import MultiAgentDispatcher
|
|
456
|
+
|
|
457
|
+
# Mock mode (default)
|
|
458
|
+
disp = MultiAgentDispatcher()
|
|
459
|
+
result = disp.dispatch("Design REST API for user management")
|
|
460
|
+
print(result.to_markdown())
|
|
461
|
+
disp.shutdown()
|
|
462
|
+
|
|
463
|
+
# With LLM backend
|
|
464
|
+
from scripts.collaboration.llm_backend import create_backend
|
|
465
|
+
backend = create_backend("openai", api_key="sk-...", base_url="https://api.openai.com/v1")
|
|
466
|
+
disp = MultiAgentDispatcher(llm_backend=backend)
|
|
467
|
+
result = disp.dispatch("Design auth system", roles=["architect", "security"])
|
|
468
|
+
print(result.summary)
|
|
469
|
+
disp.shutdown()
|
|
470
|
+
```
|
|
471
|
+
|
|
472
|
+
**4. Sub-Skills (Lightweight Independent)**
|
|
473
|
+
|
|
474
|
+
```python
|
|
475
|
+
# Each sub-skill works independently — no Dispatcher needed
|
|
476
|
+
from skills.security.handler import SecuritySkill
|
|
477
|
+
risk = SecuritySkill().scan_input("malicious input")
|
|
478
|
+
|
|
479
|
+
from skills.review.handler import ReviewScore
|
|
480
|
+
verdict = ReviewSkill().review(code_snippet)
|
|
481
|
+
|
|
482
|
+
from skills.intent.handler import IntentSkill
|
|
483
|
+
intent = IntentSkill().detect("修复登录漏洞", lang="zh")
|
|
484
|
+
```
|
|
485
|
+
|
|
486
|
+
**3. MCP Server (for Cursor / any MCP client)**
|
|
487
|
+
|
|
488
|
+
```bash
|
|
489
|
+
pip install mcp
|
|
490
|
+
python3 scripts/mcp_server.py # stdio mode
|
|
491
|
+
python3 scripts/mcp_server.py --port 8080 # SSE mode
|
|
492
|
+
```
|
|
493
|
+
|
|
494
|
+
Exposes 6 tools: `multiagent_dispatch`, `multiagent_quick`, `multiagent_roles`,
|
|
495
|
+
`multiagent_status`, `multiagent_analyze`, `multiagent_shutdown`.
|
|
496
|
+
|
|
497
|
+
## 7 Core Roles
|
|
498
|
+
|
|
499
|
+
| Role | CLI ID | Aliases | Weight | Best For |
|
|
500
|
+
|------|--------|---------|--------|----------|
|
|
501
|
+
| Architect | `arch` | `architect` | 1.5 | System design, tech stack, performance/security architecture |
|
|
502
|
+
| Product Manager | `pm` | `product-manager` | 1.2 | Requirements, user stories, acceptance criteria |
|
|
503
|
+
| Security Expert | `sec` | `security` | 1.1 | Threat modeling, vulnerability audit, compliance |
|
|
504
|
+
| Tester | `test` | `tester`, `qa` | 1.0 | Test strategy, quality assurance, edge cases |
|
|
505
|
+
| Coder | `coder` | `solo-coder`, `dev` | 1.0 | Implementation, code review, performance optimization |
|
|
506
|
+
| DevOps | `infra` | `devops` | 1.0 | CI/CD, containerization, monitoring, infrastructure |
|
|
507
|
+
| UI Designer | `ui` | `ui-designer` | 0.9 | UX flow, interaction design, accessibility |
|
|
508
|
+
|
|
509
|
+
**Auto-match**: If no roles specified, the dispatcher automatically matches based on task keywords.
|
|
510
|
+
|
|
511
|
+
## Architecture Overview (48 Core Modules)
|
|
512
|
+
|
|
513
|
+
DevSquad is built on a layered architecture with clear separation of concerns:
|
|
514
|
+
|
|
515
|
+
```
|
|
516
|
+
┌─────────────────────────────────────────────────┐
|
|
517
|
+
│ CLI / MCP / API │ Entry Points
|
|
518
|
+
├─────────────────────────────────────────────────┤
|
|
519
|
+
│ MultiAgentDispatcher │ Orchestration
|
|
520
|
+
│ ┌────────────┬──────────────┬────────────────┐ │
|
|
521
|
+
│ │RoleMatcher │ReportFormatter│InputValidator │ │ Extracted Components
|
|
522
|
+
│ └────────────┴──────────────┴────────────────┘ │
|
|
523
|
+
│ ┌────────────────────────────────────────────┐ │
|
|
524
|
+
│ │ RuleCollector (NL Rule Intercept) │ │ Rule Collection
|
|
525
|
+
│ └────────────────────────────────────────────┘ │
|
|
526
|
+
├─────────────────────────────────────────────────┤
|
|
527
|
+
│ Coordinator │ Task Planning
|
|
528
|
+
│ ┌──────────┬───────────┬────────────────────┐ │
|
|
529
|
+
│ │ Scratchpad│ Consensus │ BatchScheduler │ │ Collaboration
|
|
530
|
+
│ └──────────┴───────────┴────────────────────┘ │
|
|
531
|
+
├─────────────────────────────────────────────────┤
|
|
532
|
+
│ Worker (per role) │ Execution
|
|
533
|
+
│ ┌────────────────────────────────────────────┐ │
|
|
534
|
+
│ │ PromptAssembler → LLMBackend → Output │ │
|
|
535
|
+
│ └────────────────────────────────────────────┘ │
|
|
536
|
+
├─────────────────────────────────────────────────┤
|
|
537
|
+
│ LLMBackend: Mock | OpenAI | Anthropic │ LLM Layer
|
|
538
|
+
├─────────────────────────────────────────────────┤
|
|
539
|
+
│ CheckpointManager | WorkflowEngine | ... │ Infrastructure
|
|
540
|
+
└─────────────────────────────────────────────────┘
|
|
541
|
+
```
|
|
542
|
+
|
|
543
|
+
## What's New in V3.6.0 🆕
|
|
544
|
+
|
|
545
|
+
### AnchorChecker System
|
|
546
|
+
Milestone anchor verification that ensures critical checkpoints are validated before proceeding:
|
|
547
|
+
|
|
548
|
+
```python
|
|
549
|
+
from scripts.collaboration.anchor_checker import AnchorChecker
|
|
550
|
+
|
|
551
|
+
checker = AnchorChecker()
|
|
552
|
+
checker.define_anchor("architecture_complete", criteria=["API spec defined", "tech stack selected"])
|
|
553
|
+
result = checker.check_anchor("architecture_complete", phase_output)
|
|
554
|
+
print(f"Anchor passed: {result.passed}")
|
|
555
|
+
print(f"Drift detected: {result.drift_score}")
|
|
556
|
+
```
|
|
557
|
+
|
|
558
|
+
**Features**:
|
|
559
|
+
- Cross-phase consistency verification
|
|
560
|
+
- Drift detection with severity scoring
|
|
561
|
+
- Auto-recovery suggestions
|
|
562
|
+
- Anchor point persistence
|
|
563
|
+
|
|
564
|
+
### RetrospectiveEngine
|
|
565
|
+
Independent retrospective mechanism for continuous improvement:
|
|
566
|
+
|
|
567
|
+
```python
|
|
568
|
+
from scripts.collaboration.retrospective_engine import RetrospectiveEngine
|
|
569
|
+
|
|
570
|
+
engine = RetrospectiveEngine()
|
|
571
|
+
report = engine.run_retrospective(dispatch_result)
|
|
572
|
+
print(f"Patterns found: {len(report.patterns)}")
|
|
573
|
+
print(f"Anti-patterns: {len(report.anti_patterns)}")
|
|
574
|
+
print(f"Improvement suggestions: {report.suggestions}")
|
|
575
|
+
```
|
|
576
|
+
|
|
577
|
+
**Features**:
|
|
578
|
+
- Post-dispatch quality analysis
|
|
579
|
+
- Pattern and anti-pattern extraction
|
|
580
|
+
- Metric trend tracking
|
|
581
|
+
- Actionable improvement suggestions
|
|
582
|
+
|
|
583
|
+
### StructuredGoal
|
|
584
|
+
Structured goal management with hierarchical decomposition:
|
|
585
|
+
|
|
586
|
+
```python
|
|
587
|
+
from scripts.collaboration.structured_goal import StructuredGoal
|
|
588
|
+
|
|
589
|
+
goal = StructuredGoal("Build e-commerce platform")
|
|
590
|
+
goal.add_sub_goal("User auth", criteria=["OAuth2 support", "2FA ready"])
|
|
591
|
+
goal.add_sub_goal("Product catalog", criteria=["Search", "Filter", "Pagination"])
|
|
592
|
+
progress = goal.get_progress()
|
|
593
|
+
print(f"Overall: {progress.completion_pct}%")
|
|
594
|
+
```
|
|
595
|
+
|
|
596
|
+
**Features**:
|
|
597
|
+
- Hierarchical goal decomposition
|
|
598
|
+
- Dependency mapping between sub-goals
|
|
599
|
+
- Real-time progress tracking
|
|
600
|
+
- Automated completion verification
|
|
601
|
+
|
|
602
|
+
### FallbackBackend
|
|
603
|
+
Automatic LLM backend failover for high availability:
|
|
604
|
+
|
|
605
|
+
```python
|
|
606
|
+
from scripts.collaboration.llm_backend import FallbackBackend
|
|
607
|
+
|
|
608
|
+
backend = FallbackBackend(
|
|
609
|
+
primary="openai",
|
|
610
|
+
fallbacks=["anthropic", "mock"],
|
|
611
|
+
health_check_interval=30,
|
|
612
|
+
)
|
|
613
|
+
result = backend.generate("Design auth system")
|
|
614
|
+
# Automatically fails over if primary is down
|
|
615
|
+
```
|
|
616
|
+
|
|
617
|
+
**Features**:
|
|
618
|
+
- Continuous backend health monitoring
|
|
619
|
+
- Seamless automatic failover
|
|
620
|
+
- Priority-based routing configuration
|
|
621
|
+
- Automatic primary recovery detection
|
|
622
|
+
|
|
623
|
+
### Natural Language Rule Collection
|
|
624
|
+
Automatically detect and store user rules from natural language input:
|
|
625
|
+
|
|
626
|
+
```python
|
|
627
|
+
# User says: "记住规则:写代码时必须加注释"
|
|
628
|
+
# DevSquad automatically:
|
|
629
|
+
# 1. Detects rule-storing intent
|
|
630
|
+
# 2. Extracts: trigger="写代码时", action="必须加注释", type="always"
|
|
631
|
+
# 3. Sanitizes content (removes dangerous patterns)
|
|
632
|
+
# 4. Stores via CarryMem or local JSON fallback
|
|
633
|
+
|
|
634
|
+
# List stored rules
|
|
635
|
+
# User says: "列出规则" → Returns all stored rules
|
|
636
|
+
|
|
637
|
+
# Delete a rule
|
|
638
|
+
# User says: "删除规则 RULE-LOCAL-abc123"
|
|
639
|
+
```
|
|
640
|
+
|
|
641
|
+
**Pipeline**: User Input → IntentDetector → RuleExtractor → RuleSanitizer → RuleStorage (CarryMem + local JSON)
|
|
642
|
+
|
|
643
|
+
**Features**:
|
|
644
|
+
- 11 intent patterns (Chinese + English)
|
|
645
|
+
- 4 rule types: always / avoid / prefer / forbid
|
|
646
|
+
- Prompt injection protection in rule content
|
|
647
|
+
- CarryMem primary + local JSON fallback storage
|
|
648
|
+
- Automatic rule injection into Worker prompts
|
|
649
|
+
|
|
650
|
+
See [Integration Guide](docs/guides/agent_briefing_confidence_integration.md) for detailed usage.
|
|
651
|
+
|
|
652
|
+
---
|
|
653
|
+
|
|
654
|
+
## Key Features
|
|
655
|
+
|
|
656
|
+
### Security
|
|
657
|
+
- **InputValidator**: XSS, SQL injection, command injection, HTML injection detection
|
|
658
|
+
- **Prompt Injection Protection**: 21+ patterns (ignore previous instructions, jailbreak, DAN mode, system prompt extraction, etc.)
|
|
659
|
+
- **API Key Safety**: Environment variables only, never CLI arguments or logs
|
|
660
|
+
- **PermissionGuard**: 4-level safety gate (PLAN → DEFAULT → AUTO → BYPASS)
|
|
661
|
+
|
|
662
|
+
### Performance
|
|
663
|
+
- **ThreadPoolExecutor**: Real parallel execution for multi-role dispatch
|
|
664
|
+
- **LLM Cache**: TTL-based LRU cache with disk persistence (60-80% cost reduction)
|
|
665
|
+
- **LLM Retry**: Exponential backoff + circuit breaker + multi-backend fallback
|
|
666
|
+
- **Streaming Output**: Real-time chunk-by-chunk LLM output via `--stream`
|
|
667
|
+
|
|
668
|
+
### Reliability
|
|
669
|
+
- **CheckpointManager**: SHA256 integrity, handoff documents, auto-cleanup
|
|
670
|
+
- **WorkflowEngine**: Task-to-workflow auto-split, step execution, resume from checkpoint, **11-phase lifecycle templates** (full/backend/frontend/internal_tool/minimal), requirement change management
|
|
671
|
+
- **TaskCompletionChecker**: DispatchResult/ScheduleResult completion tracking
|
|
672
|
+
- **ConsensusEngine**: Weighted voting with veto power and human escalation
|
|
673
|
+
|
|
674
|
+
### Project Lifecycle (11-Phase Model)
|
|
675
|
+
|
|
676
|
+
DevSquad V3.6.0 defines an **11-phase (4 optional)** project lifecycle with clear roles, dependencies, and gate conditions:
|
|
677
|
+
|
|
678
|
+
```
|
|
679
|
+
P1 → P2 ──┬──→ P3 ──→ P6 ──→ P7 ──→ P8 ──→ P9 ──→ P10 ──→ P11
|
|
680
|
+
├──→ P4(∥P3) ──↗
|
|
681
|
+
└──→ P5(dep P1+P3) ──↗
|
|
682
|
+
```
|
|
683
|
+
|
|
684
|
+
| Template | Phases | Use Case |
|
|
685
|
+
|----------|--------|----------|
|
|
686
|
+
| `full` | P1-P11 | Complete project |
|
|
687
|
+
| `backend` | No P5 | Backend services |
|
|
688
|
+
| `frontend` | No P4,P6 | Frontend applications |
|
|
689
|
+
| `internal_tool` | No P4,P5,P6,P11 | Internal tools |
|
|
690
|
+
| `minimal` | P1,P3,P7,P8,P9 | Minimum set |
|
|
691
|
+
|
|
692
|
+
See [GUIDE.md](GUIDE.md) §4 for full lifecycle details with gate conditions and requirement change process.
|
|
693
|
+
|
|
694
|
+
### Developer Experience
|
|
695
|
+
- **Configuration File**: `.devsquad.yaml` in project root with env var overrides
|
|
696
|
+
- **Quality Control Injection**: Auto-inject QC rules (hallucination prevention, overconfidence check, security guard, RACI protocol) into Worker prompts based on `.devsquad.yaml` config
|
|
697
|
+
- **Docker Support**: `docker build -t devsquad . && docker run devsquad dispatch -t "task"`
|
|
698
|
+
- **GitHub Actions CI**: Python 3.9-3.12 matrix testing
|
|
699
|
+
- **pip installable**: `pip install -e .` with optional dependencies
|
|
700
|
+
|
|
701
|
+
## Module Reference (48 Modules)
|
|
702
|
+
|
|
703
|
+
| Module | File | Purpose |
|
|
704
|
+
|--------|------|---------|
|
|
705
|
+
| **MultiAgentDispatcher** | `dispatcher.py` | Unified entry point |
|
|
706
|
+
| **Coordinator** | `coordinator.py` | Global orchestration: plan → assign → execute → collect |
|
|
707
|
+
| **Worker** | `worker.py` | Role executor with LLM backend integration |
|
|
708
|
+
| **EnhancedWorker** | `enhanced_worker.py` | Worker with auto QA (briefing + confidence + retry + memory rules) |
|
|
709
|
+
| **Scratchpad** | `scratchpad.py` | Shared blackboard for inter-worker communication |
|
|
710
|
+
| **ConsensusEngine** | `consensus.py` | Weighted voting + veto + escalation |
|
|
711
|
+
| **RoleMatcher** | `role_matcher.py` | Keyword-based role matching with alias resolution |
|
|
712
|
+
| **ReportFormatter** | `report_formatter.py` | Structured/compact/detailed report generation |
|
|
713
|
+
| **InputValidator** | `input_validator.py` | Security validation + prompt injection detection |
|
|
714
|
+
| **AISemanticMatcher** | `ai_semantic_matcher.py` | LLM-powered semantic role matching |
|
|
715
|
+
| **CheckpointManager** | `checkpoint_manager.py` | State persistence + handoff documents |
|
|
716
|
+
| **WorkflowEngine** | `workflow_engine.py` | Task-to-workflow auto-split + 11-phase lifecycle templates + requirement change |
|
|
717
|
+
| **TaskCompletionChecker** | `task_completion_checker.py` | Completion tracking + progress reporting |
|
|
718
|
+
| **CodeMapGenerator** | `code_map_generator.py` | Python AST-based code structure analysis |
|
|
719
|
+
| **DualLayerContextManager** | `dual_layer_context.py` | Project-level + task-level context management |
|
|
720
|
+
| **SkillRegistry** | `skill_registry.py` | Reusable skill registration + discovery |
|
|
721
|
+
| **IntentWorkflowMapper** | `intent_workflow_mapper.py` | User intent → workflow chain mapping (6 intents × 3 languages) |
|
|
722
|
+
| **OperationClassifier** | `operation_classifier.py` | Three-tier operation classification (ALWAYS_SAFE/NEEDS_REVIEW/FORBIDDEN) |
|
|
723
|
+
| **FiveAxisConsensusEngine** | `five_axis_consensus.py` | Five-axis review consensus with weighted voting |
|
|
724
|
+
| **FeatureUsageTracker** | `feature_usage_tracker.py` | Feature usage tracking + reporting + auto-persistence |
|
|
725
|
+
| **LLMBackend** | `llm_backend.py` | Mock/OpenAI/Anthropic with streaming support |
|
|
726
|
+
| **LLMCache** | `llm_cache.py` | TTL-based LRU cache with disk persistence |
|
|
727
|
+
| **LLMRetry** | `llm_retry.py` | Exponential backoff + circuit breaker |
|
|
728
|
+
| **ConfigManager** | `config_loader.py` | YAML config + env var overrides |
|
|
729
|
+
| **PromptAssembler** | `prompt_assembler.py` | Dynamic prompt assembly + QC rule injection |
|
|
730
|
+
| **AgentBriefing** | `agent_briefing.py` | Context-aware task briefing with priority filtering |
|
|
731
|
+
| **ConfidenceScorer** | `confidence_score.py` | 5-factor response quality assessment |
|
|
732
|
+
| **PerformanceMonitor** | `performance_monitor.py` | P95/P99 tracking + CPU/memory monitoring |
|
|
733
|
+
| **MCEAdapter** | `mce_adapter.py` | CarryMem integration adapter (optional dependency, supports match_rules + format_rules_as_prompt + add_rule) |
|
|
734
|
+
| **Protocols** | `protocols.py` | Interface definitions (CacheProvider, MemoryProvider, etc.) |
|
|
735
|
+
| **NullProviders** | `null_providers.py` | Graceful degradation providers |
|
|
736
|
+
| **PermissionGuard** | `permission_guard.py` | 4-level safety gate |
|
|
737
|
+
| **MemoryBridge** | `memory_bridge.py` | Cross-session memory |
|
|
738
|
+
| **BatchScheduler** | `batch_scheduler.py` | Batch task scheduling |
|
|
739
|
+
| **ContextCompressor** | `context_compressor.py` | Context compression for long tasks |
|
|
740
|
+
| **RoleTemplateMarket** | `role_template_market.py` | Role template sharing marketplace |
|
|
741
|
+
| **Skillifier** | `skillifier.py` | Auto skill learning from tasks |
|
|
742
|
+
| **UsageTracker** | `usage_tracker.py` | Token/cost tracking |
|
|
743
|
+
| **WarmupManager** | `warmup_manager.py` | Startup warmup optimization |
|
|
744
|
+
| **TestQualityGuard** | `test_quality_guard.py` | Test quality enforcement |
|
|
745
|
+
| **PromptVariantGenerator** | `prompt_variant_generator.py` | A/B prompt testing |
|
|
746
|
+
| **ConfigManager (YAML)** | `config_manager.py` | Project-level YAML config |
|
|
747
|
+
| **WorkBuddyClawSource** | `memory_bridge.py` | WorkBuddy read-only bridge |
|
|
748
|
+
| **Models** | `models.py` | Shared data models and type definitions |
|
|
749
|
+
| **LLMCacheAsync** | `llm_cache_async.py` | Async LLM cache for concurrent workloads |
|
|
750
|
+
| **LLMRetryAsync** | `llm_retry_async.py` | Async LLM retry with backoff |
|
|
751
|
+
| **IntegrationExample** | `integration_example.py` | DevSquad integration example code |
|
|
752
|
+
| **AsyncIntegrationExample** | `async_integration_example.py` | Async DevSquad integration example |
|
|
753
|
+
| **AnchorChecker** | `anchor_checker.py` | Milestone anchor verification + drift detection + auto-recovery |
|
|
754
|
+
| **RetrospectiveEngine** | `retrospective.py` | Independent post-dispatch retrospective + pattern extraction + anti-pattern detection |
|
|
755
|
+
| **FeatureUsageTracker** | `feature_usage_tracker.py` | Feature invocation counter + usage reports + auto-persist |
|
|
756
|
+
| **FallbackBackend** | `llm_backend.py` | Automatic LLM backend failover with health monitoring |
|
|
757
|
+
|
|
758
|
+
## Configuration
|
|
759
|
+
|
|
760
|
+
Create `.devsquad.yaml` in your project root:
|
|
761
|
+
|
|
762
|
+
```yaml
|
|
763
|
+
quality_control:
|
|
764
|
+
enabled: true
|
|
765
|
+
strict_mode: true
|
|
766
|
+
min_quality_score: 85
|
|
767
|
+
ai_quality_control:
|
|
768
|
+
enabled: true
|
|
769
|
+
hallucination_check:
|
|
770
|
+
enabled: true
|
|
771
|
+
require_traceable_references: true
|
|
772
|
+
overconfidence_check:
|
|
773
|
+
enabled: true
|
|
774
|
+
require_alternatives_min: 2
|
|
775
|
+
ai_security_guard:
|
|
776
|
+
enabled: true
|
|
777
|
+
permission_level: "DEFAULT"
|
|
778
|
+
ai_team_collaboration:
|
|
779
|
+
enabled: true
|
|
780
|
+
raci:
|
|
781
|
+
mode: "strict"
|
|
782
|
+
|
|
783
|
+
llm:
|
|
784
|
+
backend: openai
|
|
785
|
+
base_url: "" # Set via LLM_BASE_URL env var
|
|
786
|
+
model: "" # Set via LLM_MODEL env var
|
|
787
|
+
timeout: 120
|
|
788
|
+
log_level: WARNING
|
|
789
|
+
```
|
|
790
|
+
|
|
791
|
+
Or use environment variables (higher priority):
|
|
792
|
+
|
|
793
|
+
```bash
|
|
794
|
+
export DEVSQUAD_LLM_BACKEND=openai
|
|
795
|
+
export DEVSQUAD_BASE_URL=https://api.openai.com/v1
|
|
796
|
+
export DEVSQUAD_MODEL=gpt-4
|
|
797
|
+
export OPENAI_API_KEY=sk-...
|
|
798
|
+
```
|
|
799
|
+
|
|
800
|
+
## Environment Variables
|
|
801
|
+
|
|
802
|
+
| Variable | Purpose | Default |
|
|
803
|
+
|----------|---------|---------|
|
|
804
|
+
| `OPENAI_API_KEY` | OpenAI API key | None (required for OpenAI backend) |
|
|
805
|
+
| `OPENAI_BASE_URL` | OpenAI-compatible base URL | None |
|
|
806
|
+
| `OPENAI_MODEL` | Model name | `gpt-4` |
|
|
807
|
+
| `ANTHROPIC_API_KEY` | Anthropic API key | None (required for Anthropic backend) |
|
|
808
|
+
| `ANTHROPIC_MODEL` | Model name | `claude-sonnet-4-20250514` |
|
|
809
|
+
| `DEVSQUAD_LLM_BACKEND` | Default backend type | `mock` |
|
|
810
|
+
| `DEVSQUAD_LOG_LEVEL` | Logging level | `WARNING` |
|
|
811
|
+
|
|
812
|
+
## Running Tests
|
|
813
|
+
|
|
814
|
+
```bash
|
|
815
|
+
# Core tests (748+ tests all passing)
|
|
816
|
+
python3 -m pytest scripts/collaboration/core_test.py \
|
|
817
|
+
scripts/collaboration/role_mapping_test.py \
|
|
818
|
+
scripts/collaboration/upstream_test.py \
|
|
819
|
+
scripts/collaboration/mce_adapter_test.py \
|
|
820
|
+
tests/ test_v35_integration.py \
|
|
821
|
+
tests/test_anti_rationalization.py \
|
|
822
|
+
tests/test_verification_gate.py \
|
|
823
|
+
tests/test_intent_workflow_mapper.py \
|
|
824
|
+
tests/test_cli_lifecycle.py -v
|
|
825
|
+
|
|
826
|
+
# Quick smoke test
|
|
827
|
+
python3 scripts/cli.py --version # 3.6.0
|
|
828
|
+
python3 scripts/cli.py status # System ready
|
|
829
|
+
python3 scripts/cli.py roles # List 7 roles
|
|
830
|
+
|
|
831
|
+
# Lifecycle commands (NEW in v3.4.1)
|
|
832
|
+
python3 scripts/cli.py spec -t "User authentication system"
|
|
833
|
+
python3 scripts/cli.py build -t "Implement login API"
|
|
834
|
+
python3 scripts/cli.py test -t "Run all unit tests"
|
|
835
|
+
python3 scripts/cli.py review -t "Check PR #123"
|
|
836
|
+
python3 scripts/cli.py ship -t "Deploy to production"
|
|
837
|
+
```
|
|
838
|
+
|
|
839
|
+
## Documentation
|
|
840
|
+
|
|
841
|
+
| Document | Description |
|
|
842
|
+
|----------|-------------|
|
|
843
|
+
| [QUICK_START_EN.md](docs/i18n/QUICK_START_EN.md) | ⚡ Quick start guide (English, 5 minutes) |
|
|
844
|
+
| [REFERENCE_GUIDE_EN.md](docs/i18n/REFERENCE_GUIDE_EN.md) | 📖 Complete reference guide (English) |
|
|
845
|
+
| [QUICK_START_JP.md](docs/i18n/QUICK_START_JP.md) | ⚡ クイックスタートガイド (日本語, 5分) |
|
|
846
|
+
| [REFERENCE_GUIDE_JP.md](docs/i18n/REFERENCE_GUIDE_JP.md) | 📖 完全リファレンスガイド (日本語) |
|
|
847
|
+
| [GUIDE.md](GUIDE.md) | Complete user guide (Chinese) |
|
|
848
|
+
| [GUIDE_EN.md](docs/i18n/GUIDE_EN.md) | ~~Complete user guide (English)~~ → See QUICK_START + REFERENCE_GUIDE |
|
|
849
|
+
| [GUIDE_JP.md](docs/i18n/GUIDE_JP.md) | ~~完全なユーザーガイド (日本語)~~ → クイックスタート+リファレンスを参照 |
|
|
850
|
+
| [INSTALL.md](INSTALL.md) | Installation guide (Unix + Windows) |
|
|
851
|
+
| [EXAMPLES.md](EXAMPLES.md) | Real-world usage examples |
|
|
852
|
+
| [SKILL.md](SKILL.md) | Skill manual (EN/CN/JP) |
|
|
853
|
+
| [CLAUDE.md](CLAUDE.md) | Claude Code project instructions |
|
|
854
|
+
| [CHANGELOG.md](CHANGELOG.md) | Version history |
|
|
855
|
+
| [README-CN.md](docs/i18n/README_CN.md) | 中文说明 |
|
|
856
|
+
| [README-JP.md](docs/i18n/README_JP.md) | 日本語説明 |
|
|
857
|
+
|
|
858
|
+
### 🆕 Quick Start (Recommended for New Users)
|
|
859
|
+
|
|
860
|
+
**New to DevSquad? Start here:**
|
|
861
|
+
|
|
862
|
+
```bash
|
|
863
|
+
# 1. Run the interactive demo (3 scenarios, < 15 seconds)
|
|
864
|
+
python examples/quick_demo.py
|
|
865
|
+
|
|
866
|
+
# 2. Read the quick start guide
|
|
867
|
+
# English: docs/i18n/QUICK_START_EN.md
|
|
868
|
+
# Japanese: docs/i18n/QUICK_START_JP.md
|
|
869
|
+
|
|
870
|
+
# 3. Your first dispatch
|
|
871
|
+
python3 scripts/cli.py dispatch -t "Design user authentication system"
|
|
872
|
+
```
|
|
873
|
+
|
|
874
|
+
### ☸️ Kubernetes Deployment
|
|
875
|
+
|
|
876
|
+
```bash
|
|
877
|
+
# Deploy with Helm
|
|
878
|
+
helm install devsquad ./helm/devsquad
|
|
879
|
+
|
|
880
|
+
# Port forward
|
|
881
|
+
kubectl port-forward svc/devsquad-api 8000:8000
|
|
882
|
+
```
|
|
883
|
+
|
|
884
|
+
See [helm/devsquad/README.md](helm/devsquad/README.md) for full documentation.
|
|
885
|
+
|
|
886
|
+
## Cross-Platform Compatibility
|
|
887
|
+
|
|
888
|
+
DevSquad is **not TRAE-exclusive**. It supports 6 integration methods:
|
|
889
|
+
|
|
890
|
+
| Platform | Integration | Setup Difficulty | Key Features Available |
|
|
891
|
+
|----------|-------------|-----------------|----------------------|
|
|
892
|
+
| **TRAE IDE** | Native Skill (`skill-manifest.yaml`) | ⭐ Zero config | Full: Dispatcher + Dashboard + CLI |
|
|
893
|
+
| **Claude Code** | MCP Server / Python import | ⭐ Low | 6 MCP tools or direct API |
|
|
894
|
+
| **Cursor** | MCP Server (`stdio` mode) | ⭐ Low | Same as Claude Code |
|
|
895
|
+
| **OpenClaw / WorkBuddy Claw** | `WorkBuddyClawSource` bridge | Auto | Read-only memory bridge |
|
|
896
|
+
| **Any MCP Client** | stdio / SSE dual mode | ⭐ Low | 6 tools, configurable port |
|
|
897
|
+
| **Pure Python** | `pip install -e .` | ⭐ Low | CLI + API + Skills + REST |
|
|
898
|
+
| **Docker** | `docker build & run` | ⭐ Low | Isolated container with all features |
|
|
899
|
+
|
|
900
|
+
### Quick Start per Platform
|
|
901
|
+
|
|
902
|
+
```bash
|
|
903
|
+
# === TRAE IDE ===
|
|
904
|
+
# Just use it — zero configuration
|
|
905
|
+
|
|
906
|
+
# === Claude Code / Cursor (MCP) ===
|
|
907
|
+
# Add to .claude/mcp.json or .cursor/mcp.json:
|
|
908
|
+
# {"mcpServers": {"devsquad": {"command": "python", "args": ["/path/to/mcp_server.py"]}}}
|
|
909
|
+
|
|
910
|
+
# === Pure Python ===
|
|
911
|
+
pip install -e "/path/to/DevSquad[all]"
|
|
912
|
+
devsquad dispatch -t "task description"
|
|
913
|
+
|
|
914
|
+
# === REST API ===
|
|
915
|
+
uvicorn scripts.api_server:app --port 8000 # → http://localhost:8000/docs
|
|
916
|
+
|
|
917
|
+
# === Docker ===
|
|
918
|
+
docker build -t devsquad . && docker run -it devsquad dispatch -t "test"
|
|
919
|
+
```
|
|
920
|
+
|
|
921
|
+
## Version History
|
|
922
|
+
|
|
923
|
+
| Date | Version | Highlights |
|
|
924
|
+
|------|---------|-----------|
|
|
925
|
+
| 2026-05-16 | **V3.6.0** | 🧩 **Layered Sub-Skill Architecture** — 6 atomic sub-skills (dispatch/intent/review/security/test/retrospective) with lazy-loading registry via importlib, each ~50 lines wrapping existing core modules, no duplicated logic. All sub-skills work in Mock mode without API keys. Plus: Cross-platform compatibility docs updated for Claude Code/Cursor/OpenClaw/Pure Python/Docker/MCP. |
|
|
926
|
+
| 2026-05-13 | **V3.6.0** | ⚓ AnchorChecker (milestone anchor verification + drift detection), RetrospectiveEngine (independent retrospective + pattern extraction), StructuredGoal (structured goal decomposition + progress tracking), FallbackBackend (automatic LLM failover + health monitoring), FeatureUsageTracker (feature usage tracking + reporting + auto-persistence), 7 module integrations (IntentWorkflowMapper/AISemanticMatcher/DualLayerContextManager/OperationClassifier/SkillRegistry/FiveAxisConsensusEngine/NullProviders), 1548+ tests, 48 core modules |
|
|
927
|
+
| 2026-05-05 | **V3.5.0** | 📋 Enhancement Sprint — Code walkthrough enhancement, documentation consistency checks, Karpathy principles, project understanding (AgentBriefing), CLI lifecycle commands, structured output, 748+ tests |
|
|
928
|
+
| 2026-05-03 | **V3.4.1** | 🚀 Agent Skills Quality Framework (P0) — AntiRationalizationEngine + VerificationGate + IntentWorkflowMapper + CLI Lifecycle Commands (spec/plan/build/test/review/ship) + 167 new tests + Google Agent Skills integration + 49 core modules |
|
|
929
|
+
| 2026-05-02 | **V3.4.0** | 🆕 11-Phase Project Lifecycle (full/backend/frontend/internal_tool/minimal templates), requirement change management, gate mechanism with gap reporting, 748+ tests passing, WorkflowEngine lifecycle support |
|
|
930
|
+
| 2026-05-01 | V3.4.0 | AgentBriefing (context-aware task briefing), ConfidenceScore (5-factor quality assessment), EnhancedWorker (auto quality assurance with retry + memory_provider rule injection), Protocol interface system (match_rules/format_rules_as_prompt), CarryMem v0.2.8+ integration, comprehensive documentation |
|
|
931
|
+
| 2026-04-27 | V3.4.0 | Real LLM backend (OpenAI/Anthropic/Mock), ThreadPoolExecutor parallel execution, InputValidator + prompt injection protection, CheckpointManager, WorkflowEngine, TaskCompletionChecker, AISemanticMatcher, streaming output, Docker, GitHub Actions CI, config file, CodeMapGenerator, DualLayerContext, SkillRegistry, CarryMem integration, 234 unit tests |
|
|
932
|
+
| 2026-04-17 | V3.2 | E2E Demo, MCE Adapter, Dispatcher UX |
|
|
933
|
+
| 2026-04-16 | V3.0 | Complete redesign — Coordinator/Worker/Scratchpad architecture |
|
|
934
|
+
|
|
935
|
+
## License
|
|
936
|
+
|
|
937
|
+
MIT License — see [LICENSE](LICENSE) for details.
|
|
938
|
+
|
|
939
|
+
## Links
|
|
940
|
+
|
|
941
|
+
| Link | URL |
|
|
942
|
+
|------|-----|
|
|
943
|
+
| **GitHub (This Repo)** | https://github.com/lulin70/DevSquad |
|
|
944
|
+
| **Original / Upstream** | https://github.com/weiransoft/TraeMultiAgentSkill |
|