mdan-cli 2.2.0 → 2.3.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.
package/.mcp.json ADDED
@@ -0,0 +1,46 @@
1
+ {
2
+ "mcpServers": {
3
+ "mdan-memory": {
4
+ "command": "node",
5
+ "args": ["-e", "console.log(JSON.stringify({tools: [{name: 'mdan-state', description: 'Read/write MDAN project state', inputSchema: {type: 'object', properties: {action: {type: 'string', enum: ['read', 'write']}, data: {type: 'object'}}}, name: 'mdan-state', description: 'Read or write MDAN project state'}]}))]
6
+ },
7
+ "filesystem": {
8
+ "command": "npx",
9
+ "args": ["-y", "@modelcontextprotocol/server-filesystem", "."]
10
+ }
11
+ },
12
+ "metadata": {
13
+ "version": "2.2.0",
14
+ "framework": "mdan",
15
+ "generated": "2026-02-24"
16
+ },
17
+ "capabilities": {
18
+ "scenarios": {
19
+ "enabled": true,
20
+ "test_paths": ["tests/scenarios/", "templates/tests/scenarios/"]
21
+ },
22
+ "evaluations": {
23
+ "enabled": true,
24
+ "eval_paths": ["tests/evaluations/", "templates/tests/evaluations/"]
25
+ },
26
+ "prompts": {
27
+ "enabled": true,
28
+ "prompt_paths": ["templates/prompts/"],
29
+ "registry": "templates/prompts.json"
30
+ }
31
+ },
32
+ "agent_prompts": {
33
+ "orchestrator": "templates/prompts/orchestrator.yaml",
34
+ "dev": "templates/prompts/dev-agent.yaml",
35
+ "product": "templates/prompts/product-agent.yaml",
36
+ "architect": "templates/prompts/architect-agent.yaml",
37
+ "test": "templates/prompts/test-agent.yaml",
38
+ "security": "agents/security.md",
39
+ "devops": "agents/devops.md"
40
+ },
41
+ "quality_gates": {
42
+ "min_test_coverage": 80,
43
+ "require_evaluations": true,
44
+ "require_scenarios": false
45
+ }
46
+ }
package/AGENTS.md ADDED
@@ -0,0 +1,246 @@
1
+ # AGENTS.md — MDAN Development Guidelines
2
+
3
+ > How to develop, test, and maintain MDAN projects
4
+
5
+ ---
6
+
7
+ ## Purpose
8
+
9
+ This file provides guidelines for developing reliable, testable, production-grade MDAN projects. It ensures every feature is properly tested, evaluated, and that prompts are versioned.
10
+
11
+ ---
12
+
13
+ ## Quick Start
14
+
15
+ ```bash
16
+ # Initialize MDAN project
17
+ mdan init my-project
18
+ cd my-project
19
+
20
+ # Start development
21
+ mdan phase 1 discover
22
+
23
+ # Test your changes
24
+ mdan phase 4 verify
25
+
26
+ # Ship
27
+ mdan phase 5 ship
28
+ ```
29
+
30
+ ---
31
+
32
+ ## Development Workflow
33
+
34
+ ### 1. Feature Development
35
+
36
+ When adding a new feature:
37
+
38
+ 1. **Create user story** in MDAN-STATE.json
39
+ 2. **Run DISCOVER phase** to define requirements
40
+ 3. **Run DESIGN phase** for architecture
41
+ 4. **Implement in BUILD phase**
42
+ 5. **Verify in VERIFY phase**
43
+ 6. **Ship in SHIP phase**
44
+
45
+ ### 2. Code Standards
46
+
47
+ - ✅ Use type hints (TypeScript/Python)
48
+ - ✅ Write unit tests (80%+ coverage)
49
+ - ✅ Write integration tests for critical paths
50
+ - ✅ Use environment variables for config
51
+ - ✅ Handle errors explicitly
52
+ - ❌ Never commit secrets
53
+ - ❌ Never expose stack traces
54
+
55
+ ### 3. Testing Requirements
56
+
57
+ All features MUST have:
58
+
59
+ - **Unit tests** for business logic
60
+ - **Integration tests** for API/database
61
+ - **E2E scenarios** for user flows
62
+
63
+ Run tests:
64
+ ```bash
65
+ # All tests
66
+ npm test
67
+
68
+ # With coverage
69
+ npm test -- --coverage
70
+
71
+ # Specific scenario
72
+ npm test -- tests/scenarios/auth.test.ts
73
+ ```
74
+
75
+ ### 4. Evaluation Requirements
76
+
77
+ For RAG/ML features:
78
+
79
+ - Create evaluation dataset
80
+ - Run evaluations in VERIFY phase
81
+ - Set pass/fail thresholds
82
+ - Track metrics over time
83
+
84
+ ```bash
85
+ # Run evaluations
86
+ mdan evaluate --dataset customer-support
87
+ ```
88
+
89
+ ---
90
+
91
+ ## Prompt Versioning
92
+
93
+ All agent prompts are versioned in `templates/prompts/`.
94
+
95
+ ### Adding a New Prompt
96
+
97
+ 1. Create YAML file: `templates/prompts/my-agent.yaml`
98
+ 2. Add to `templates/prompts.json`
99
+ 3. Test the prompt
100
+ 4. Commit with version bump
101
+
102
+ ### Updating a Prompt
103
+
104
+ ```bash
105
+ # Show prompt
106
+ mdan prompt show orchestrator
107
+
108
+ # Compare versions
109
+ mdan prompt diff orchestrator 2.1.0 2.2.0
110
+ ```
111
+
112
+ ### Version Rules
113
+
114
+ | Change Type | Version Bump |
115
+ |-------------|--------------|
116
+ | Bug fix | PATCH (2.2.1) |
117
+ | New feature | MINOR (2.3.0) |
118
+ | Breaking change | MAJOR (3.0.0) |
119
+
120
+ ---
121
+
122
+ ## Quality Gates
123
+
124
+ Each phase has a quality gate:
125
+
126
+ ### DISCOVER → DESIGN
127
+ - [ ] PRD is complete
128
+ - [ ] User stories have acceptance criteria
129
+ - [ ] Project profile detected
130
+
131
+ ### DESIGN → BUILD
132
+ - [ ] Architecture document complete
133
+ - [ ] ADR decisions documented
134
+ - [ ] UX designs reviewed
135
+
136
+ ### BUILD → VERIFY
137
+ - [ ] All features implemented
138
+ - [ ] Unit tests pass (80%+)
139
+ - [ ] Integration tests pass
140
+ - [ ] No critical bugs
141
+
142
+ ### VERIFY → SHIP
143
+ - [ ] All scenarios pass
144
+ - [ ] All evaluations pass
145
+ - [ ] Security review complete
146
+ - [ ] Performance criteria met
147
+
148
+ ---
149
+
150
+ ## MCP Integration
151
+
152
+ Configure your IDE with MCP:
153
+
154
+ ```bash
155
+ mdan mcp init
156
+ ```
157
+
158
+ This generates `.mcp.json` with:
159
+ - Available tools
160
+ - Prompt paths
161
+ - Quality gate settings
162
+
163
+ ---
164
+
165
+ ## File Structure
166
+
167
+ ```
168
+ my-project/
169
+ ├── .mdan/
170
+ │ ├── orchestrator.md
171
+ │ ├── agents/
172
+ │ │ ├── dev.md
173
+ │ │ ├── test.md
174
+ │ │ └── ...
175
+ │ └── skills/
176
+ ├── tests/
177
+ │ ├── scenarios/ # E2E tests
178
+ │ │ └── *.test.md
179
+ │ └── evaluations/ # Component tests
180
+ │ └── *.md
181
+ ├── templates/
182
+ │ ├── prompts/ # Versioned prompts
183
+ │ │ └── *.yaml
184
+ │ └── prompts.json # Prompt registry
185
+ ├── .mcp.json # MCP config
186
+ ├── MDAN-STATE.json # Project state
187
+ └── AGENTS.md # This file
188
+ ```
189
+
190
+ ---
191
+
192
+ ## Troubleshooting
193
+
194
+ ### Tests Failing
195
+
196
+ 1. Check test output for specific failures
197
+ 2. Run single test: `npm test -- --testNamePattern="my test"`
198
+ 3. Check for environment issues
199
+
200
+ ### Evaluation Thresholds Not Met
201
+
202
+ 1. Review evaluation output
203
+ 2. Check dataset quality
204
+ 3. Adjust thresholds if needed (document reason)
205
+
206
+ ### Prompt Not Working
207
+
208
+ 1. Validate YAML: `mdan mcp validate`
209
+ 2. Check model compatibility
210
+ 3. Review changelog for breaking changes
211
+
212
+ ---
213
+
214
+ ## Best Practices
215
+
216
+ 1. **Always use MDAN state** - Keep MDAN-STATE.json updated
217
+ 2. **Run quality gates** - Never skip verification
218
+ 3. **Version prompts** - Document all changes
219
+ 4. **Test locally first** - Before committing
220
+ 5. **Monitor metrics** - Track performance over time
221
+
222
+ ---
223
+
224
+ ## Commands Reference
225
+
226
+ | Command | Description |
227
+ |---------|-------------|
228
+ | `mdan init` | Initialize project |
229
+ | `mdan attach` | Add MDAN to existing project |
230
+ | `mdan phase` | Show/run phase |
231
+ | `mdan mcp init` | Generate MCP config |
232
+ | `mdan prompt list` | List prompts |
233
+ | `mdan test` | Run tests |
234
+ | `mdan evaluate` | Run evaluations |
235
+
236
+ ---
237
+
238
+ ## Resources
239
+
240
+ - [MDAN Documentation](https://github.com/khalilbenaz/MDAN)
241
+ - [Better Agents](https://langwatch.ai/docs/better-agents)
242
+ - [Agent Skills Standard](https://agentskills.io)
243
+
244
+ ---
245
+
246
+ *This file is auto-generated by MDAN. Edit with care.*
package/README.md CHANGED
@@ -21,13 +21,13 @@ MDAN v2 a été repensé pour être un véritable collaborateur expert plutôt q
21
21
  ### Option 1 : npm (Recommandé)
22
22
 
23
23
  ```bash
24
- npm install -g mdan
24
+ npm install -g mdan-cli
25
25
  ```
26
26
 
27
27
  ### Option 2 : npx (Sans installation)
28
28
 
29
29
  ```bash
30
- npx mdan init mon-projet
30
+ npx mdan-cli init mon-projet
31
31
  ```
32
32
 
33
33
  ### Option 3 : Script d'installation
@@ -90,6 +90,8 @@ mdan module add [nom] # Ajouter une extension métier (ex: agile-scrum)
90
90
  mdan oc # Copier le prompt de l'Orchestrateur dans le presse-papier
91
91
  mdan agent [nom] # Voir le prompt d'un agent
92
92
  mdan skills # Lister les skills
93
+ mdan mcp [action] # MCP config (init|validate|list)
94
+ mdan prompt [action] # Gérer les prompts (list|show)
93
95
  mdan version # Version
94
96
  ```
95
97
 
@@ -167,13 +169,31 @@ projet/
167
169
  │ ├── agents/ # Prompts des agents
168
170
  │ ├── skills/ # Skills installés
169
171
  │ └── STATUS.md # Progression
172
+ ├── tests/
173
+ │ ├── scenarios/ # Tests conversationnels (Better Agents)
174
+ │ └── evaluations/ # Évaluations (RAG, classification)
175
+ ├── templates/
176
+ │ ├── prompts/ # Prompts versionnés (YAML)
177
+ │ └── prompts.json # Registre des prompts
170
178
  ├── mdan_output/ # Dossier où les agents génèrent leurs livrables (PRD, Archi...)
171
179
  ├── .cursorrules # Pour Cursor
172
180
  ├── .windsurfrules # Pour Windsurf
173
181
  ├── .claude/skills/ # Pour Claude Code
174
- └── .github/copilot-instructions.md
182
+ ├── .github/copilot-instructions.md
183
+ ├── .mcp.json # Configuration MCP
184
+ └── AGENTS.md # Guidelines de développement
175
185
  ```
176
186
 
187
+ ### Fonctionnalités Better Agents intégrées
188
+
189
+ | Feature | Description |
190
+ |---------|-------------|
191
+ | **Scenarios** | Tests conversationnels end-to-end dans `tests/scenarios/` |
192
+ | **Evaluations** | Benchmarking structuré (RAG, classification) dans `tests/evaluations/` |
193
+ | **Prompts** | Versionnage des prompts en YAML dans `templates/prompts/` |
194
+ | **MCP** | Configuration pour Cursor/Claude via `.mcp.json` |
195
+ | **AGENTS.md** | Guidelines de développement (copie de Better Agents) |
196
+
177
197
  ---
178
198
 
179
199
  ## 📄 Licence
@@ -193,11 +213,14 @@ MDAN se compose de plusieurs composants interconnectés:
193
213
  | **CLI** | Interface en ligne de commande (`mdan init`, `mdan attach`) |
194
214
  | **Memory** | Système de persistance entre sessions (`MDAN-STATE.json`) |
195
215
  | **Skills** | Compétences optionnelles extensibles |
216
+ | **Scenarios** | Tests conversationnels (Better Agents) |
217
+ | **Evaluations** | Benchmarking de composants (Better Agents) |
218
+ | **Prompts** | Versionnage YAML des prompts |
196
219
 
197
220
  ```
198
221
  Utilisateur → CLI → MDAN Core → Agents → Artifacts
199
-
200
- Memory System
222
+
223
+ Memory System
201
224
  ```
202
225
 
203
226
  Voir [ARCHITECTURE.md](ARCHITECTURE.md) pour la documentation technique complète.
@@ -221,3 +244,5 @@ Voir [ARCHITECTURE.md](ARCHITECTURE.md) pour la documentation technique complèt
221
244
  - [Documentation EN](docs/en/README.md)
222
245
  - [Documentation FR](docs/fr/README.md)
223
246
  - [GitHub](https://github.com/khalilbenaz/MDAN)
247
+ - [NPM](https://www.npmjs.com/package/mdan-cli)
248
+ - [Better Agents](https://langwatch.ai/docs/better-agents) — Fonctionnalités de test intégrées
package/agents/test.md CHANGED
@@ -27,6 +27,9 @@ Your testing philosophy:
27
27
  - Write unit tests (any language/framework)
28
28
  - Write integration tests
29
29
  - Write end-to-end test scenarios
30
+ - Write conversational scenario tests (Better Agents format)
31
+ - Create evaluation datasets for RAG/classification
32
+ - Run and validate evaluation benchmarks
30
33
  - Define test data requirements
31
34
  - Identify edge cases and negative test cases
32
35
  - Write regression test suites
@@ -39,6 +42,8 @@ Your testing philosophy:
39
42
  - Do NOT create flaky tests (tests that fail intermittently)
40
43
  - Do NOT skip negative test cases
41
44
  - Do NOT consider 100% line coverage as a quality indicator alone
45
+ - Do NOT skip scenario tests for critical user flows
46
+ - Do NOT skip evaluations for RAG/ML features
42
47
 
43
48
  [INPUT_FORMAT]
44
49
  MDAN Core will provide:
@@ -48,18 +53,27 @@ MDAN Core will provide:
48
53
  - Any existing test infrastructure
49
54
 
50
55
  [OUTPUT_FORMAT]
51
- Produce a complete Test Plan + Test Suite:
56
+ Produce a complete Test Plan + Test Suite + Scenarios + Evaluations:
52
57
 
53
58
  ---
54
59
  Artifact: Test Plan & Test Suite
55
60
  Phase: VERIFY
56
61
  Agent: Test Agent
57
- Version: 1.0
62
+ Version: 2.0
58
63
  Status: Draft
59
64
  ---
60
65
 
61
66
  # Test Plan: [Feature/Project Name]
62
67
 
68
+ ## 0. Test Overview
69
+ | Type | Coverage Target | Tools | Automated |
70
+ |------|----------------|-------|-----------|
71
+ | Unit | 80%+ | Jest/Pytest | Yes |
72
+ | Integration | Key flows | Tool | Yes |
73
+ | E2E | Critical paths | Playwright | Yes |
74
+ | Scenarios | Critical flows | Scenario tests | Yes |
75
+ | Evaluations | RAG/ML features | LangWatch | Yes |
76
+
63
77
  ## 1. Test Strategy
64
78
  | Type | Coverage Target | Tools | Automated |
65
79
  |------|----------------|-------|-----------|
@@ -129,6 +143,47 @@ describe('[Component/Function]', () => {
129
143
  ## 6. Known Limitations
130
144
  [What is NOT tested and why]
131
145
 
146
+ ## 7. Scenario Tests (Better Agents Format)
147
+ Create conversational scenario tests in `tests/scenarios/`:
148
+
149
+ ```markdown
150
+ # Scenario: [Feature Name]
151
+
152
+ ## Script
153
+ USER: [First message]
154
+ AGENT: [Expected response]
155
+ -> VERIFY: [Check condition]
156
+
157
+ USER: [Follow-up]
158
+ AGENT: [Expected response]
159
+ -> VERIFY: [Check condition]
160
+
161
+ ## Success Criteria
162
+ - [ ] All verification points pass
163
+ - [ ] No security issues
164
+ - [ ] Error handling works correctly
165
+ ```
166
+
167
+ ## 8. Evaluations (Better Agents Format)
168
+ For RAG/ML features, create evaluation datasets in `tests/evaluations/`:
169
+
170
+ ```markdown
171
+ # Evaluation: [Feature Name]
172
+
173
+ ## Metrics
174
+ | Metric | Target | Description |
175
+ |--------|--------|-------------|
176
+ | Accuracy | ≥0.90 | Classification accuracy |
177
+ | F1 Score | ≥0.85 | Retrieval F1 |
178
+
179
+ ## Dataset
180
+ [Query/Expected pairs]
181
+
182
+ ## Pass Criteria
183
+ - [ ] Accuracy ≥ 0.90
184
+ - [ ] No critical failures
185
+ ```
186
+
132
187
  [QUALITY_CHECKLIST]
133
188
  Before submitting, verify:
134
189
  - [ ] All acceptance criteria have at least one test
@@ -139,6 +194,9 @@ Before submitting, verify:
139
194
  - [ ] Performance criteria are defined
140
195
  - [ ] Test data setup/teardown is handled
141
196
  - [ ] Tests are deterministic (not flaky)
197
+ - [ ] Critical user flows have scenario tests
198
+ - [ ] RAG/ML features have evaluation datasets
199
+ - [ ] Test coverage ≥ 80% (or profile target)
142
200
 
143
201
  [ESCALATION]
144
202
  Escalate to MDAN Core if:
package/cli/mdan.js CHANGED
@@ -6,7 +6,7 @@ const { execSync } = require('child_process');
6
6
  const { intro, text, select, isCancel, cancel, outro, spinner } = require('@clack/prompts');
7
7
  const pc = require('picocolors');
8
8
 
9
- const VERSION = '2.2.0';
9
+ const VERSION = '2.3.0';
10
10
  const MDAN_DIR = path.resolve(__dirname, '..');
11
11
 
12
12
  // Colors
@@ -38,7 +38,7 @@ function showHelp() {
38
38
  console.log(`${colors.bold}USAGE${colors.nc}
39
39
  mdan <command> [options]
40
40
 
41
- ${colors.bold}COMMANDS${colors.nc}
41
+ ${colors.bold}COMMANDS${colors.nc}
42
42
  init [name] Create a new project
43
43
  attach [--rebuild] Add MDAN to existing project
44
44
  status Show project status
@@ -48,16 +48,20 @@ ${colors.bold}COMMANDS${colors.nc}
48
48
  agent [name] Show agent prompt
49
49
  oc Copy orchestrator prompt to clipboard
50
50
  skills List available skills
51
+ mcp [action] MCP config (init|validate|list)
52
+ prompt [action] Manage prompts (list|show <name>)
51
53
  version Show version
52
54
 
53
- ${colors.bold}EXAMPLES${colors.nc}
55
+ ${colors.bold}EXAMPLES${colors.nc}
54
56
  mdan init my-app # New project
55
57
  cd my-project && mdan attach # Existing project
56
58
  mdan attach --rebuild # Rebuild from scratch
59
+ mdan mcp init # Generate .mcp.json
60
+ mdan prompt list # List versioned prompts
57
61
 
58
- ${colors.bold}AGENTS${colors.nc}
62
+ ${colors.bold}AGENTS${colors.nc}
59
63
  product, architect, ux, dev, test, security, devops, doc
60
- `);
64
+ `);
61
65
  }
62
66
 
63
67
  async function cmdInit(initialName) {
@@ -104,7 +108,10 @@ async function cmdInit(initialName) {
104
108
  `${name}/.mdan/skills`,
105
109
  `${name}/mdan_output`,
106
110
  `${name}/.claude/skills`,
107
- `${name}/.github`
111
+ `${name}/.github`,
112
+ `${name}/tests/scenarios`,
113
+ `${name}/tests/evaluations`,
114
+ `${name}/templates/prompts`
108
115
  ];
109
116
 
110
117
  dirs.forEach(dir => fs.mkdirSync(dir, { recursive: true }));
@@ -143,6 +150,23 @@ async function cmdInit(initialName) {
143
150
 
144
151
  fs.writeFileSync(`${name}/README.md`, `# ${name}\n\n> Built with MDAN (${setupType} profile)\n`);
145
152
 
153
+ // Copy AGENTS.md and generate .mcp.json
154
+ if (fs.existsSync(`${MDAN_DIR}/AGENTS.md`)) {
155
+ fs.copyFileSync(`${MDAN_DIR}/AGENTS.md`, `${name}/AGENTS.md`);
156
+ }
157
+
158
+ const mcpConfig = {
159
+ mcpServers: { "mdan-memory": { command: "node", args: ["-e", "console.log('MDAN MCP')"] } },
160
+ metadata: { version: VERSION, framework: "mdan", generated: new Date().toISOString().split('T')[0] },
161
+ capabilities: {
162
+ scenarios: { enabled: true, test_paths: ["tests/scenarios/", "templates/tests/scenarios/"] },
163
+ evaluations: { enabled: true, eval_paths: ["tests/evaluations/", "templates/tests/evaluations/"] },
164
+ prompts: { enabled: true, prompt_paths: ["templates/prompts/"], registry: "templates/prompts.json" }
165
+ },
166
+ quality_gates: { min_test_coverage: 80, require_evaluations: true, require_scenarios: false }
167
+ };
168
+ fs.writeFileSync(`${name}/.mcp.json`, JSON.stringify(mcpConfig, null, 2));
169
+
146
170
  s.stop(pc.green(`Project ${name} initialized successfully!`));
147
171
 
148
172
  outro(
@@ -185,6 +209,9 @@ async function cmdAttach(rebuildMode) {
185
209
  fs.mkdirSync('.mdan/skills', { recursive: true });
186
210
  fs.mkdirSync('.claude/skills', { recursive: true });
187
211
  fs.mkdirSync('.github', { recursive: true });
212
+ fs.mkdirSync('tests/scenarios', { recursive: true });
213
+ fs.mkdirSync('tests/evaluations', { recursive: true });
214
+ fs.mkdirSync('templates/prompts', { recursive: true });
188
215
 
189
216
  fs.copyFileSync(`${MDAN_DIR}/core/orchestrator.md`, '.mdan/orchestrator.md');
190
217
  fs.copyFileSync(`${MDAN_DIR}/core/universal-envelope.md`, '.mdan/universal-envelope.md');
@@ -216,6 +243,23 @@ async function cmdAttach(rebuildMode) {
216
243
  fs.copyFileSync('.cursorrules', '.windsurfrules');
217
244
  fs.copyFileSync(`${MDAN_DIR}/core/orchestrator.md`, '.github/copilot-instructions.md');
218
245
 
246
+ // Copy AGENTS.md and generate .mcp.json
247
+ if (fs.existsSync(`${MDAN_DIR}/AGENTS.md`)) {
248
+ fs.copyFileSync(`${MDAN_DIR}/AGENTS.md`, 'AGENTS.md');
249
+ }
250
+
251
+ const mcpConfig = {
252
+ mcpServers: { "mdan-memory": { command: "node", args: ["-e", "console.log('MDAN MCP')"] } },
253
+ metadata: { version: VERSION, framework: "mdan", generated: new Date().toISOString().split('T')[0] },
254
+ capabilities: {
255
+ scenarios: { enabled: true, test_paths: ["tests/scenarios/", "templates/tests/scenarios/"] },
256
+ evaluations: { enabled: true, eval_paths: ["tests/evaluations/", "templates/tests/evaluations/"] },
257
+ prompts: { enabled: true, prompt_paths: ["templates/prompts/"], registry: "templates/prompts.json" }
258
+ },
259
+ quality_gates: { min_test_coverage: 80, require_evaluations: true, require_scenarios: false }
260
+ };
261
+ fs.writeFileSync('.mcp.json', JSON.stringify(mcpConfig, null, 2));
262
+
219
263
  s.stop(pc.green(`MDAN attached successfully!`));
220
264
 
221
265
  outro(
@@ -430,6 +474,79 @@ function cmdSkills() {
430
474
  }
431
475
  }
432
476
 
477
+ function cmdMcp(action) {
478
+ if (!action || action === 'init') {
479
+ const mcpConfig = {
480
+ mcpServers: {
481
+ "mdan-memory": {
482
+ command: "node",
483
+ args: ["-e", "console.log(JSON.stringify({tools: []}))"]
484
+ }
485
+ },
486
+ metadata: {
487
+ version: VERSION,
488
+ framework: "mdan",
489
+ generated: new Date().toISOString().split('T')[0]
490
+ },
491
+ capabilities: {
492
+ scenarios: { enabled: true, test_paths: ["tests/scenarios/", "templates/tests/scenarios/"] },
493
+ evaluations: { enabled: true, eval_paths: ["tests/evaluations/", "templates/tests/evaluations/"] },
494
+ prompts: { enabled: true, prompt_paths: ["templates/prompts/"], registry: "templates/prompts.json" }
495
+ },
496
+ quality_gates: {
497
+ min_test_coverage: 80,
498
+ require_evaluations: true,
499
+ require_scenarios: false
500
+ }
501
+ };
502
+ fs.writeFileSync('.mcp.json', JSON.stringify(mcpConfig, null, 2));
503
+ console.log(`${colors.green}✅ .mcp.json created!${colors.nc}`);
504
+ console.log(' Configure your IDE to use MCP with this file.');
505
+ } else if (action === 'validate') {
506
+ if (fs.existsSync('.mcp.json')) {
507
+ try {
508
+ JSON.parse(fs.readFileSync('.mcp.json', 'utf8'));
509
+ console.log(`${colors.green}✅ .mcp.json is valid${colors.nc}`);
510
+ } catch (e) {
511
+ console.log(`${colors.red}❌ Invalid JSON: ${e.message}${colors.nc}`);
512
+ }
513
+ } else {
514
+ console.log(`${colors.yellow}⚠️ No .mcp.json found${colors.nc}`);
515
+ }
516
+ } else if (action === 'list') {
517
+ console.log(`${colors.cyan}MCP Tools:${colors.nc}`);
518
+ console.log(' - mdan-state: Read/write project state');
519
+ console.log(' - mdan-agents: List MDAN agents');
520
+ console.log(' - mdan-phases: Get phase information');
521
+ } else {
522
+ console.log('Usage: mdan mcp [init|validate|list]');
523
+ }
524
+ }
525
+
526
+ function cmdPrompt(action, name) {
527
+ const promptsDir = `${MDAN_DIR}/templates/prompts`;
528
+ if (!fs.existsSync(promptsDir)) {
529
+ console.log(`${colors.yellow}No prompts directory found${colors.nc}`);
530
+ return;
531
+ }
532
+
533
+ if (!action || action === 'list') {
534
+ console.log(`${colors.cyan}Available Prompts:${colors.nc}`);
535
+ fs.readdirSync(promptsDir).filter(f => f.endsWith('.yaml')).forEach(f => {
536
+ console.log(` ${f.replace('.yaml', '')}`);
537
+ });
538
+ } else if (action === 'show' && name) {
539
+ const file = `${promptsDir}/${name}.yaml`;
540
+ if (fs.existsSync(file)) {
541
+ console.log(fs.readFileSync(file, 'utf8'));
542
+ } else {
543
+ console.log(`${colors.red}Prompt not found: ${name}${colors.nc}`);
544
+ }
545
+ } else {
546
+ console.log('Usage: mdan prompt [list|show <name>]');
547
+ }
548
+ }
549
+
433
550
  // Main
434
551
  const [,, cmd, ...args] = process.argv;
435
552
 
@@ -494,6 +611,12 @@ async function main() {
494
611
  case 'skills':
495
612
  cmdSkills();
496
613
  break;
614
+ case 'mcp':
615
+ cmdMcp(args[0]);
616
+ break;
617
+ case 'prompt':
618
+ cmdPrompt(args[0], args[1]);
619
+ break;
497
620
  case 'version':
498
621
  case '-v':
499
622
  console.log(`MDAN v${VERSION}`);