mdan-cli 2.5.1 → 2.7.0

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.
Files changed (57) hide show
  1. package/AGENTS.md +76 -1
  2. package/README.md +274 -4
  3. package/agents/auto-orchestrator.md +343 -0
  4. package/agents/devops.md +511 -94
  5. package/cli/mdan.py +111 -6
  6. package/cli/mdan_crewai.py +539 -0
  7. package/core/crewai_orchestrator.md +419 -0
  8. package/core/debate-protocol.md +454 -0
  9. package/core/universal-envelope.md +113 -0
  10. package/integrations/__init__.py +33 -0
  11. package/integrations/crewai/__init__.py +27 -0
  12. package/integrations/crewai/agents/__init__.py +21 -0
  13. package/integrations/crewai/agents/architect_agent.py +264 -0
  14. package/integrations/crewai/agents/dev_agent.py +271 -0
  15. package/integrations/crewai/agents/devops_agent.py +421 -0
  16. package/integrations/crewai/agents/doc_agent.py +388 -0
  17. package/integrations/crewai/agents/product_agent.py +203 -0
  18. package/integrations/crewai/agents/security_agent.py +386 -0
  19. package/integrations/crewai/agents/test_agent.py +358 -0
  20. package/integrations/crewai/agents/ux_agent.py +257 -0
  21. package/integrations/crewai/flows/__init__.py +13 -0
  22. package/integrations/crewai/flows/auto_flow.py +451 -0
  23. package/integrations/crewai/flows/build_flow.py +297 -0
  24. package/integrations/crewai/flows/debate_flow.py +422 -0
  25. package/integrations/crewai/flows/discovery_flow.py +267 -0
  26. package/integrations/crewai/orchestrator.py +558 -0
  27. package/integrations/crewai/skills/__init__.py +8 -0
  28. package/integrations/crewai/skills/skill_router.py +534 -0
  29. package/integrations/crewai/tools/__init__.py +11 -0
  30. package/integrations/crewai/tools/file_tool.py +355 -0
  31. package/integrations/crewai/tools/serper_tool.py +169 -0
  32. package/integrations/crewai/tools/sql_tool.py +435 -0
  33. package/memory/CONTEXT-SAVE-FORMAT.md +328 -0
  34. package/memory/MEMORY-AUTO.json +66 -0
  35. package/memory/RESUME-PROTOCOL.md +379 -0
  36. package/package.json +1 -1
  37. package/phases/auto-01-load.md +165 -0
  38. package/phases/auto-02-discover.md +207 -0
  39. package/phases/auto-03-plan.md +509 -0
  40. package/phases/auto-04-architect.md +567 -0
  41. package/phases/auto-05-implement.md +713 -0
  42. package/phases/auto-06-test.md +559 -0
  43. package/phases/auto-07-deploy.md +510 -0
  44. package/phases/auto-08-doc.md +970 -0
  45. package/skills/azure-devops/skill.md +1757 -0
  46. package/templates/dotnet-blazor/README.md +415 -0
  47. package/templates/external-services/ExampleService.cs +361 -0
  48. package/templates/external-services/IService.cs +113 -0
  49. package/templates/external-services/README.md +325 -0
  50. package/templates/external-services/ServiceBase.cs +492 -0
  51. package/templates/external-services/ServiceProvider.cs +243 -0
  52. package/templates/prompts/devops-agent.yaml +327 -0
  53. package/templates/prompts.json +15 -1
  54. package/templates/sql-server/README.md +37 -0
  55. package/templates/sql-server/functions.sql +158 -0
  56. package/templates/sql-server/schema.sql +188 -0
  57. package/templates/sql-server/stored-procedures.sql +284 -0
package/AGENTS.md CHANGED
@@ -228,6 +228,8 @@ my-project/
228
228
  | `mdan init` | Initialize project |
229
229
  | `mdan attach` | Add MDAN to existing project |
230
230
  | `mdan phase` | Show/run phase |
231
+ | `mdan auto` | Run autonomous full-cycle development |
232
+ | `mdan resume` | Resume from saved context |
231
233
  | `mdan mcp init` | Generate MCP config |
232
234
  | `mdan prompt list` | List prompts |
233
235
  | `mdan test` | Run tests |
@@ -235,12 +237,85 @@ my-project/
235
237
 
236
238
  ---
237
239
 
240
+ ## Agent Registry
241
+
242
+ ### Core Agents
243
+
244
+ | Agent | Phase | Expertise |
245
+ |-------|-------|-----------|
246
+ | Product Agent (Khalil) | DISCOVER | Requirements gathering, PRD creation |
247
+ | Architect Agent (Reda) | DESIGN | System architecture, tech stack |
248
+ | UX Agent (Jihane) | DESIGN | User experience, UI/UX design |
249
+ | Dev Agent (Haytame) | BUILD | Implementation, coding |
250
+ | Security Agent (Said) | BUILD/VERIFY | Security review, vulnerability assessment |
251
+ | Test Agent (Youssef) | VERIFY | Testing strategy, test execution |
252
+ | DevOps Agent (Anas) | SHIP | Deployment, CI/CD, Azure |
253
+ | Doc Agent (Amina) | SHIP | Documentation, user guides |
254
+ | Learn Agent | Transverse | Knowledge management, learning |
255
+
256
+ ### Autonomous Agents
257
+
258
+ | Agent | Phase | Expertise |
259
+ |-------|-------|-----------|
260
+ | Auto Orchestrator | ALL | Autonomous full-cycle development coordination |
261
+
262
+ The Auto Orchestrator executes all 8 phases (LOAD → DISCOVER → PLAN → ARCHITECT → IMPLEMENT → TEST → DEPLOY → DOC) without human intervention, with context save/load capabilities and multi-agent debate support.
263
+
264
+ ---
265
+
266
+ ## CrewAI Integration
267
+
268
+ MDANV2 includes a comprehensive CrewAI integration for intelligent multi-agent orchestration.
269
+
270
+ ### Installation
271
+
272
+ ```bash
273
+ pip install -r requirements_crewai.txt
274
+ ```
275
+
276
+ ### Environment Variables
277
+
278
+ ```bash
279
+ export SERPER_API_KEY="your-serper-api-key"
280
+ export OPENAI_API_KEY="your-openai-api-key"
281
+ ```
282
+
283
+ ### Usage
284
+
285
+ ```python
286
+ import asyncio
287
+ from integrations.crewai import CrewAIOrchestrator
288
+
289
+ async def main():
290
+ orchestrator = CrewAIOrchestrator(
291
+ project_path="/path/to/project",
292
+ llm=your_llm_instance,
293
+ auto_mode=True
294
+ )
295
+
296
+ # Run autonomous mode
297
+ result = await orchestrator.run_auto_mode("Build a todo app")
298
+
299
+ asyncio.run(main())
300
+ ```
301
+
302
+ ### Components
303
+
304
+ - **8 CrewAI Agents**: Product, Architect, UX, Dev, Test, Security, DevOps, Doc
305
+ - **4 CrewAI Flows**: Auto, Discovery, Build, Debate
306
+ - **3 Custom Tools**: Serper (web search), SQL (async database), File (file operations)
307
+ - **Skill Router**: Intelligent skill detection and routing (50+ skills)
308
+
309
+ ### Documentation
310
+
311
+ See `core/crewai_orchestrator.md` for complete documentation.
312
+
238
313
  ## Resources
239
314
 
240
315
  - [MDAN Documentation](https://github.com/khalilbenaz/MDAN)
241
316
  - [Better Agents](https://langwatch.ai/docs/better-agents)
242
317
  - [Agent Skills Standard](https://agentskills.io)
318
+ - [CrewAI Documentation](https://docs.crewai.com)
243
319
 
244
320
  ---
245
-
246
321
  *This file is auto-generated by MDAN. Edit with care.*
package/README.md CHANGED
@@ -27,16 +27,21 @@ Les outils IA traditionnels font le travail à votre place, produisant des résu
27
27
 
28
28
  ---
29
29
 
30
- ## 🚀 Nouveautés dans MDAN v2.4
30
+ ## 🚀 Nouveautés dans MDAN v2.5
31
31
 
32
32
  **MDAN évolue rapidement avec des optimisations incluant :**
33
33
 
34
+ - **MDAN-AUTO v1.0** — Mode de développement autonome sans intervention humaine
35
+ - **Context Save/Resume** — Sauvegarde et reprise automatique du contexte à 80% des tokens
36
+ - **Multi-Agent Debates** — Débats entre agents pour les décisions complexes
34
37
  - **Cross Platform Agent Team** — Agents multi-plateformes (Cursor, Windsurf, Claude Code, VS Code)
35
38
  - **Sub Agent Inclusion** — Sous-agents spécialisés pour des tâches ciblées
36
39
  - **Skills Architecture** — Architecture de skills extensible et modulable
37
40
  - **MDAN Builder v1** — Créez vos propres agents et workflows
38
41
  - **Dev Loop Automation** — Automatisation complète du cycle de développement
39
42
  - **Better Agents Integration** — Scenarios et evaluations intégrés
43
+ - **Templates Génériques** — Templates services externes, .NET Blazor, SQL Server
44
+ - **Architecture Modulaire** — Skills extensibles et modules spécialisés
40
45
 
41
46
  ---
42
47
 
@@ -119,8 +124,12 @@ MDAN s'étend avec des modules officiels pour domaines spécialisés :
119
124
  | Module | Description |
120
125
  |--------|-------------|
121
126
  | **MDAN Core** | Framework principal avec 5 phases |
127
+ | **MDAN-AUTO** | Mode de développement autonome (8 phases) |
128
+ | **External Services** | Templates d'intégration services externes génériques |
129
+ | **.NET Blazor** | Templates projets .NET 8.0 Blazor Server |
130
+ | **SQL Server** | Templates SQL Server (schema, stored procedures, functions) |
131
+ | **Azure DevOps** | Skills pour Azure DevOps Services |
122
132
  | **Agile Scrum** | Workflows Agile/Scrum (Sprint, backlog, retrospectives) |
123
- | **Skills** | Compétences additionnelles |
124
133
 
125
134
  ```bash
126
135
  # Ajouter un module
@@ -129,8 +138,83 @@ mdan module add agile-scrum
129
138
 
130
139
  ---
131
140
 
141
+ ## 📋 Templates Disponibles
142
+
143
+ MDAN fournit des templates génériques et réutilisables pour accélérer le développement :
144
+
145
+ ### External Services
146
+
147
+ Templates d'intégration de services externes (APIs, microservices) :
148
+
149
+ - `IService.cs` — Interface de base pour les services
150
+ - `ServiceBase.cs` — Classe de base avec logging et gestion d'erreurs
151
+ - `ServiceProvider.cs` — Gestionnaire de dépendances
152
+ - `ExampleService.cs` — Exemple d'implémentation
153
+
154
+ ```bash
155
+ # Utiliser le template
156
+ cp templates/external-services/IService.cs src/Services/
157
+ ```
158
+
159
+ ### .NET Blazor
160
+
161
+ Templates pour projets .NET 8.0 Blazor Server :
162
+
163
+ - Structure de projet standard
164
+ - Configuration de base
165
+ - Exemples de composants
166
+
167
+ ```bash
168
+ # Initialiser un projet Blazor
169
+ mdan init mon-projet --template dotnet-blazor
170
+ ```
171
+
172
+ ### SQL Server
173
+
174
+ Templates SQL Server pour bases de données :
175
+
176
+ - `schema.sql` — Schéma de base de données
177
+ - `stored-procedures.sql` — Procédures stockées
178
+ - `functions.sql` — Fonctions SQL
179
+
180
+ ```bash
181
+ # Utiliser les templates SQL
182
+ cp templates/sql-server/schema.sql database/
183
+ ```
184
+
185
+ ---
186
+
132
187
  ## 🔧 Fonctionnalités Avancées
133
188
 
189
+ ### MDAN-AUTO v1.0 — Mode Autonome
190
+
191
+ Développement entièrement autonome sans intervention humaine :
192
+
193
+ ```bash
194
+ # Démarrer le mode autonome
195
+ mdan auto
196
+
197
+ # Reprendre depuis une sauvegarde
198
+ mdan resume /tmp/mdan-save-1234567890.json
199
+ ```
200
+
201
+ **Phases Autonomes** :
202
+ 1. **LOAD** — Chargement du contexte et des exigences
203
+ 2. **DISCOVER** — Analyse des exigences et user stories
204
+ 3. **PLAN** — Plan d'implémentation détaillé (#PHASE1, #PHASE2...)
205
+ 4. **ARCHITECT** — Conception de l'architecture système
206
+ 5. **IMPLEMENT** — Exécution de l'implémentation
207
+ 6. **TEST** — Tests complets (unitaires, intégration, E2E)
208
+ 7. **DEPLOY** — Déploiement en production
209
+ 8. **DOC** — Génération de la documentation
210
+
211
+ **Fonctionnalités Clés** :
212
+ - 🔄 Sauvegarde automatique à 80% des tokens
213
+ - 🎯 Débats multi-agents pour décisions complexes
214
+ - ⚡ Exécution séquentielle sans pause
215
+ - 🚨 Fail-fast sur erreurs critiques
216
+ - 📊 Signaux de progression (PHASE X COMPLETE ✅)
217
+
134
218
  ### Scenarios (Better Agents)
135
219
 
136
220
  Tests conversationnels end-to-end pour valider le comportement des agents.
@@ -187,8 +271,36 @@ mdan module add [nom] # Installer un module
187
271
  mdan oc # Copier l'orchestrateur
188
272
  mdan agent [nom] # Voir un agent
189
273
  mdan skills # Lister les skills
274
+ mdan auto # Démarrer le mode autonome
275
+ mdan resume <save-file> # Reprendre depuis une sauvegarde
190
276
  mdan mcp [action] # Config MCP
191
277
  mdan prompt [action] # Gérer les prompts
278
+ mdan crewai <command> # CrewAI integration commands
279
+ ```
280
+
281
+ ### CrewAI CLI Commands
282
+
283
+ ```bash
284
+ # Initialize CrewAI in a project
285
+ mdan crewai init
286
+
287
+ # Run autonomous mode
288
+ mdan crewai auto "Build a todo app"
289
+
290
+ # Start multi-agent debate
291
+ mdan crewai debate "Best architecture for a microservices app"
292
+
293
+ # Execute task with specific agent
294
+ mdan crewai agent dev "Implement user authentication"
295
+
296
+ # Execute specific flow
297
+ mdan crewai flow discovery "Analyze requirements"
298
+
299
+ # List available skills
300
+ mdan crewai skills
301
+
302
+ # Show CrewAI status
303
+ mdan crewai status
192
304
  ```
193
305
 
194
306
  ---
@@ -215,12 +327,31 @@ projet/
215
327
  │ │ ├── test.md
216
328
  │ │ └── ...
217
329
  │ └── skills/ # Skills installés
330
+ ├── integrations/
331
+ │ └── crewai/ # CrewAI integration
332
+ │ ├── agents/ # 8 CrewAI agents
333
+ │ ├── flows/ # 4 CrewAI flows
334
+ │ ├── tools/ # Custom tools (Serper, SQL, File)
335
+ │ ├── skills/ # Skill router
336
+ │ └── orchestrator.py # Main orchestrator
218
337
  ├── tests/
219
338
  │ ├── scenarios/ # Tests conversationnels
220
339
  │ └── evaluations/ # Évaluations benchmarks
221
340
  ├── templates/
222
- │ ├── prompts/ # Prompts versionnés (YAML)
223
- └── prompts.json # Registre des prompts
341
+ │ ├── external-services/ # Templates services externes génériques
342
+ ├── dotnet-blazor/ # Templates .NET 8.0 Blazor Server
343
+ │ ├── sql-server/ # Templates SQL Server
344
+ │ ├── prompts/ # Prompts versionnés (YAML)
345
+ │ └── prompts.json # Registre des prompts
346
+ ├── phases/
347
+ │ ├── auto-01-load.md # Phase LOAD (autonome)
348
+ │ ├── auto-02-discover.md # Phase DISCOVER (autonome)
349
+ │ ├── auto-03-plan.md # Phase PLAN (autonome)
350
+ │ ├── auto-04-architect.md # Phase ARCHITECT (autonome)
351
+ │ ├── auto-05-implement.md # Phase IMPLEMENT (autonome)
352
+ │ ├── auto-06-test.md # Phase TEST (autonome)
353
+ │ ├── auto-07-deploy.md # Phase DEPLOY (autonome)
354
+ │ └── auto-08-doc.md # Phase DOC (autonome)
224
355
  ├── mdan_output/ # Artifacts générés par les agents
225
356
  ├── .cursorrules # Pour Cursor
226
357
  ├── .windsurfrules # Pour Windsurf
@@ -228,6 +359,7 @@ projet/
228
359
  ├── .github/ # Pour Copilot
229
360
  ├── .mcp.json # Configuration MCP
230
361
  ├── AGENTS.md # Guidelines de développement
362
+ ├── requirements_crewai.txt # CrewAI dependencies
231
363
  └── MDAN-STATE.json # État de la session
232
364
  ```
233
365
 
@@ -250,6 +382,143 @@ MDAN se compose de plusieurs composants interconnectés :
250
382
 
251
383
  ---
252
384
 
385
+ ## 🧪 Tests et Qualité
386
+
387
+ MDAN inclut une suite de tests complète pour garantir la qualité du code :
388
+
389
+ ### Framework de Tests
390
+
391
+ - **pytest** — Framework de tests Python
392
+ - **pytest-cov** — Couverture de code
393
+ - **pytest-mock** — Mocking pour tests
394
+
395
+ ### Types de Tests
396
+
397
+ | Type | Description | Emplacement |
398
+ |------|-------------|-------------|
399
+ | **Tests CLI** | Commandes CLI (init, attach, auto, etc.) | `tests/test_cli.py` |
400
+ | **Tests Templates** | Validation des templates | `tests/test_templates.py` |
401
+ | **Tests Services** | Patterns services externes | `tests/test_external_services.py` |
402
+ | **Tests Installation** | Vérification installation | `tests/test_installation.py` |
403
+ | **Tests Régression** | Pas de références wallet | `tests/test_regression.py` |
404
+
405
+ ### Exécuter les Tests
406
+
407
+ ```bash
408
+ # Tous les tests
409
+ pytest tests/ -v
410
+
411
+ # Avec couverture
412
+ pytest tests/ --cov=cli --cov-report=html
413
+
414
+ # Tests spécifiques
415
+ pytest tests/test_cli.py -v
416
+ ```
417
+
418
+ ### CI/CD
419
+
420
+ GitHub Actions configurés pour :
421
+
422
+ - **Tests automatiques** à chaque push
423
+ - **Linting** avec ruff et mypy
424
+ - **Couverture de code** minimale 80%
425
+
426
+ ```bash
427
+ # Workflows CI/CD
428
+ .github/workflows/test.yml
429
+ .github/workflows/lint.yml
430
+ ```
431
+
432
+ ---
433
+
434
+ ## 🤖 CrewAI Integration
435
+
436
+ MDANV2 includes a comprehensive CrewAI integration for intelligent multi-agent orchestration.
437
+
438
+ ### Installation
439
+
440
+ ```bash
441
+ # Note: CrewAI requires Python 3.10-3.13
442
+ pip install -r requirements_crewai.txt
443
+ ```
444
+
445
+ ### Environment Variables
446
+
447
+ ```bash
448
+ export SERPER_API_KEY="your-serper-api-key"
449
+ export OPENAI_API_KEY="your-openai-api-key"
450
+ ```
451
+
452
+ ### Usage
453
+
454
+ ```python
455
+ import asyncio
456
+ from integrations.crewai import CrewAIOrchestrator
457
+
458
+ async def main():
459
+ orchestrator = CrewAIOrchestrator(
460
+ project_path="/path/to/project",
461
+ llm=your_llm_instance,
462
+ auto_mode=True
463
+ )
464
+
465
+ # Run autonomous mode
466
+ result = await orchestrator.run_auto_mode("Build a todo app")
467
+
468
+ asyncio.run(main())
469
+ ```
470
+
471
+ ### Components
472
+
473
+ - **8 CrewAI Agents**: Product, Architect, UX, Dev, Test, Security, DevOps, Doc
474
+ - **4 CrewAI Flows**: Auto, Discovery, Build, Debate
475
+ - **3 Custom Tools**: Serper (web search), SQL (async database), File (file operations)
476
+ - **Skill Router**: Intelligent skill detection and routing (50+ skills)
477
+
478
+ ### Example Scripts
479
+
480
+ See the `examples/` directory for complete examples:
481
+
482
+ - `examples/crewai_auto_mode.py` — Autonomous mode example
483
+ - `examples/crewai_debate.py` — Multi-agent debate example
484
+ - `examples/crewai_custom_crew.py` — Custom crew creation example
485
+ - `examples/crewai_with_sql.py` — SQL integration example (in-memory SQLite)
486
+ - `examples/crewai_with_serper.py` — Web search example
487
+
488
+ ### Troubleshooting
489
+
490
+ **Python Version Issue**: CrewAI requires Python 3.10-3.13. If you're using Python 3.14, you'll need to use a different Python version.
491
+
492
+ ```bash
493
+ # Check Python version
494
+ python --version
495
+
496
+ # Create a virtual environment with Python 3.13
497
+ python3.13 -m venv venv
498
+ source venv/bin/activate
499
+ pip install -r requirements_crewai.txt
500
+ ```
501
+
502
+ **Import Errors**: Make sure you're running from the project root directory.
503
+
504
+ ```bash
505
+ # Run from project root
506
+ cd /path/to/MDANV2
507
+ python examples/crewai_auto_mode.py
508
+ ```
509
+
510
+ **Missing API Keys**: Ensure your environment variables are set.
511
+
512
+ ```bash
513
+ # Check if keys are set
514
+ echo $OPENAI_API_KEY
515
+ echo $SERPER_API_KEY
516
+ ```
517
+
518
+ ### Documentation
519
+
520
+ See `core/crewai_orchestrator.md` for complete documentation.
521
+
253
522
  ## 📚 Documentation
254
523
 
255
524
  | Document | Description |
@@ -257,6 +526,7 @@ MDAN se compose de plusieurs composants interconnectés :
257
526
  | [ARCHITECTURE.md](ARCHITECTURE.md) | Architecture technique |
258
527
  | [MDAN.md](MDAN.md) | Spécification complète |
259
528
  | [AGENTS.md](AGENTS.md) | Guidelines de développement |
529
+ | [core/crewai_orchestrator.md](core/crewai_orchestrator.md) | CrewAI integration documentation |
260
530
  | [docs/fr/](docs/fr/) | Documentation en français |
261
531
 
262
532
  ---