mdan-cli 2.2.0 → 2.4.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 +46 -0
- package/AGENTS.md +246 -0
- package/README.md +32 -7
- package/agents/test.md +60 -2
- package/cli/mdan.js +149 -26
- package/cli/mdan.py +111 -54
- package/cli/mdan.sh +43 -43
- package/install.sh +30 -167
- package/integrations/all-integrations.md +2 -2
- package/integrations/cursor.md +11 -11
- package/integrations/mcp.md +153 -0
- package/integrations/windsurf.md +4 -4
- package/package.json +4 -2
- package/phases/04-verify.md +9 -3
- package/templates/prompts/README.md +108 -0
- package/templates/prompts/dev-agent.yaml +85 -0
- package/templates/prompts/orchestrator.yaml +97 -0
- package/templates/prompts.json +81 -0
- package/templates/tests/evaluations/README.md +80 -0
- package/templates/tests/evaluations/classification_eval.md +136 -0
- package/templates/tests/evaluations/rag_eval.md +116 -0
- package/templates/tests/scenarios/README.md +62 -0
- package/templates/tests/scenarios/basic_authentication.test.md +82 -0
- package/templates/tests/scenarios/user_registration.test.md +107 -0
package/cli/mdan.sh
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
# Multi-Agent Development Agentic Network
|
|
6
6
|
# ============================================================
|
|
7
7
|
|
|
8
|
-
VERSION="2.
|
|
8
|
+
VERSION="2.4.0"
|
|
9
9
|
MDAN_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
10
10
|
|
|
11
11
|
# Colors
|
|
@@ -110,7 +110,7 @@ cmd_learn() {
|
|
|
110
110
|
echo "---"
|
|
111
111
|
;;
|
|
112
112
|
--list)
|
|
113
|
-
KNOWLEDGE_FILE="
|
|
113
|
+
KNOWLEDGE_FILE="mdan/MDAN-KNOWLEDGE.md"
|
|
114
114
|
if [[ -f "${KNOWLEDGE_FILE}" ]]; then
|
|
115
115
|
cat "${KNOWLEDGE_FILE}"
|
|
116
116
|
else
|
|
@@ -120,7 +120,7 @@ cmd_learn() {
|
|
|
120
120
|
--capsule)
|
|
121
121
|
AGENT="${1}"
|
|
122
122
|
echo -e "${CYAN}Capsule for agent: ${BOLD}${AGENT}${NC}"
|
|
123
|
-
KNOWLEDGE_FILE="
|
|
123
|
+
KNOWLEDGE_FILE="mdan/MDAN-KNOWLEDGE.md"
|
|
124
124
|
if [[ -f "${KNOWLEDGE_FILE}" ]]; then
|
|
125
125
|
grep -A 20 "### ${AGENT^} Agent" "${KNOWLEDGE_FILE}" | head -25
|
|
126
126
|
else
|
|
@@ -215,41 +215,41 @@ cmd_attach() {
|
|
|
215
215
|
echo ""
|
|
216
216
|
fi
|
|
217
217
|
|
|
218
|
-
# Check if
|
|
219
|
-
if [[ -d "
|
|
220
|
-
echo -e "${YELLOW}⚠️
|
|
218
|
+
# Check if mdan already exists
|
|
219
|
+
if [[ -d "mdan" ]]; then
|
|
220
|
+
echo -e "${YELLOW}⚠️ mdan folder already exists.${NC}"
|
|
221
221
|
read -p " Overwrite? (y/n) " -n 1 -r
|
|
222
222
|
echo
|
|
223
223
|
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
|
|
224
|
-
echo " Keeping existing
|
|
224
|
+
echo " Keeping existing mdan folder."
|
|
225
225
|
else
|
|
226
|
-
rm -rf
|
|
226
|
+
rm -rf mdan
|
|
227
227
|
fi
|
|
228
228
|
fi
|
|
229
229
|
|
|
230
|
-
# Create
|
|
231
|
-
mkdir -p
|
|
232
|
-
mkdir -p
|
|
233
|
-
mkdir -p
|
|
230
|
+
# Create mdan directory structure
|
|
231
|
+
mkdir -p mdan/agents
|
|
232
|
+
mkdir -p mdan/artifacts
|
|
233
|
+
mkdir -p mdan/skills
|
|
234
234
|
|
|
235
235
|
# Copy core files
|
|
236
|
-
cp "${MDAN_DIR}/core/orchestrator.md"
|
|
237
|
-
cp "${MDAN_DIR}/core/universal-envelope.md"
|
|
236
|
+
cp "${MDAN_DIR}/core/orchestrator.md" mdan/orchestrator.md
|
|
237
|
+
cp "${MDAN_DIR}/core/universal-envelope.md" mdan/universal-envelope.md
|
|
238
238
|
|
|
239
239
|
# Copy all agents
|
|
240
|
-
cp "${MDAN_DIR}/agents/"*.md
|
|
240
|
+
cp "${MDAN_DIR}/agents/"*.md mdan/agents/
|
|
241
241
|
|
|
242
242
|
# Copy skills if available
|
|
243
243
|
if [[ -d "${MDAN_DIR}/skills" ]]; then
|
|
244
|
-
cp -r "${MDAN_DIR}/skills/"*
|
|
244
|
+
cp -r "${MDAN_DIR}/skills/"* mdan/skills/ 2>/dev/null
|
|
245
245
|
fi
|
|
246
246
|
|
|
247
247
|
# Create .cursorrules
|
|
248
248
|
cat "${MDAN_DIR}/core/orchestrator.md" > .cursorrules
|
|
249
249
|
echo "" >> .cursorrules
|
|
250
250
|
echo "## CURSOR INSTRUCTIONS" >> .cursorrules
|
|
251
|
-
echo "Agent files are in
|
|
252
|
-
echo "Skills are in
|
|
251
|
+
echo "Agent files are in mdan/agents/. Reference them with @file when activating agents." >> .cursorrules
|
|
252
|
+
echo "Skills are in mdan/skills/. Reference them for extended capabilities." >> .cursorrules
|
|
253
253
|
echo "" >> .cursorrules
|
|
254
254
|
|
|
255
255
|
if [[ "$REBUILD_MODE" == true ]]; then
|
|
@@ -283,7 +283,7 @@ cmd_attach() {
|
|
|
283
283
|
|
|
284
284
|
# Create MDAN-STATE.json
|
|
285
285
|
if [[ "$REBUILD_MODE" == true ]]; then
|
|
286
|
-
cat >
|
|
286
|
+
cat > mdan/MDAN-STATE.json << EOF
|
|
287
287
|
{
|
|
288
288
|
"user": {
|
|
289
289
|
"name": null
|
|
@@ -313,7 +313,7 @@ cmd_attach() {
|
|
|
313
313
|
}
|
|
314
314
|
EOF
|
|
315
315
|
else
|
|
316
|
-
cat >
|
|
316
|
+
cat > mdan/MDAN-STATE.json << EOF
|
|
317
317
|
{
|
|
318
318
|
"user": {
|
|
319
319
|
"name": null
|
|
@@ -345,7 +345,7 @@ EOF
|
|
|
345
345
|
|
|
346
346
|
# Create STATUS.md
|
|
347
347
|
if [[ "$REBUILD_MODE" == true ]]; then
|
|
348
|
-
cat >
|
|
348
|
+
cat > mdan/STATUS.md << EOF
|
|
349
349
|
# MDAN Project Status — REBUILD MODE
|
|
350
350
|
|
|
351
351
|
**Project:** ${PROJECT_NAME}
|
|
@@ -375,7 +375,7 @@ Rewrite the entire project from scratch with a modern architecture.
|
|
|
375
375
|
2. Start with: "MDAN REBUILD: Begin DISCOVER phase. Analyze this entire codebase."
|
|
376
376
|
EOF
|
|
377
377
|
else
|
|
378
|
-
cat >
|
|
378
|
+
cat > mdan/STATUS.md << EOF
|
|
379
379
|
# MDAN Project Status
|
|
380
380
|
|
|
381
381
|
**Project:** ${PROJECT_NAME} (existing)
|
|
@@ -396,17 +396,17 @@ EOF
|
|
|
396
396
|
|
|
397
397
|
## Commands to Start
|
|
398
398
|
1. Open Claude/Cursor with this project
|
|
399
|
-
2. Paste
|
|
399
|
+
2. Paste mdan/orchestrator.md as system prompt
|
|
400
400
|
3. Start with: "MDAN: Analyze this existing project and help me [goal]"
|
|
401
401
|
EOF
|
|
402
402
|
fi
|
|
403
403
|
|
|
404
404
|
echo -e "${GREEN}✅ MDAN attached to ${PROJECT_NAME}!${NC}"
|
|
405
405
|
echo ""
|
|
406
|
-
echo -e " ${BOLD}MDAN files:${NC}
|
|
407
|
-
echo -e " ${BOLD}Agents:${NC}
|
|
408
|
-
echo -e " ${BOLD}Skills:${NC}
|
|
409
|
-
echo -e " ${BOLD}State:${NC}
|
|
406
|
+
echo -e " ${BOLD}MDAN files:${NC} mdan/"
|
|
407
|
+
echo -e " ${BOLD}Agents:${NC} mdan/agents/"
|
|
408
|
+
echo -e " ${BOLD}Skills:${NC} mdan/skills/"
|
|
409
|
+
echo -e " ${BOLD}State:${NC} mdan/MDAN-STATE.json"
|
|
410
410
|
echo ""
|
|
411
411
|
|
|
412
412
|
if [[ "$REBUILD_MODE" == true ]]; then
|
|
@@ -445,33 +445,33 @@ cmd_init() {
|
|
|
445
445
|
echo -e "${CYAN}🚀 Initializing MDAN project: ${BOLD}${PROJECT_NAME}${NC}"
|
|
446
446
|
echo ""
|
|
447
447
|
|
|
448
|
-
# Create
|
|
449
|
-
mkdir -p "${PROJECT_NAME}
|
|
450
|
-
mkdir -p "${PROJECT_NAME}
|
|
451
|
-
mkdir -p "${PROJECT_NAME}
|
|
448
|
+
# Create mdan directory structure
|
|
449
|
+
mkdir -p "${PROJECT_NAME}/mdan/agents"
|
|
450
|
+
mkdir -p "${PROJECT_NAME}/mdan/artifacts"
|
|
451
|
+
mkdir -p "${PROJECT_NAME}/mdan/skills"
|
|
452
452
|
mkdir -p "${PROJECT_NAME}/mdan_output"
|
|
453
453
|
|
|
454
454
|
# Copy core files
|
|
455
|
-
cp "${MDAN_DIR}/core/orchestrator.md" "${PROJECT_NAME}
|
|
456
|
-
cp "${MDAN_DIR}/core/universal-envelope.md" "${PROJECT_NAME}
|
|
455
|
+
cp "${MDAN_DIR}/core/orchestrator.md" "${PROJECT_NAME}/mdan/orchestrator.md"
|
|
456
|
+
cp "${MDAN_DIR}/core/universal-envelope.md" "${PROJECT_NAME}/mdan/universal-envelope.md"
|
|
457
457
|
|
|
458
458
|
# Copy all agents
|
|
459
|
-
cp "${MDAN_DIR}/agents/"*.md "${PROJECT_NAME}
|
|
459
|
+
cp "${MDAN_DIR}/agents/"*.md "${PROJECT_NAME}/mdan/agents/"
|
|
460
460
|
|
|
461
461
|
# Copy templates
|
|
462
462
|
cp "${MDAN_DIR}/templates/"*.md "${PROJECT_NAME}/mdan_output/"
|
|
463
463
|
|
|
464
464
|
# Copy skills if available
|
|
465
465
|
if [[ -d "${MDAN_DIR}/skills" ]]; then
|
|
466
|
-
cp -r "${MDAN_DIR}/skills/"* "${PROJECT_NAME}
|
|
466
|
+
cp -r "${MDAN_DIR}/skills/"* "${PROJECT_NAME}/mdan/skills/" 2>/dev/null
|
|
467
467
|
fi
|
|
468
468
|
|
|
469
469
|
# Create .cursorrules
|
|
470
470
|
cat "${MDAN_DIR}/core/orchestrator.md" > "${PROJECT_NAME}/.cursorrules"
|
|
471
471
|
echo "" >> "${PROJECT_NAME}/.cursorrules"
|
|
472
472
|
echo "## CURSOR INSTRUCTIONS" >> "${PROJECT_NAME}/.cursorrules"
|
|
473
|
-
echo "Agent files are in
|
|
474
|
-
echo "Skills are in
|
|
473
|
+
echo "Agent files are in mdan/agents/. Reference them with @file when activating agents." >> "${PROJECT_NAME}/.cursorrules"
|
|
474
|
+
echo "Skills are in mdan/skills/. Reference them for extended capabilities." >> "${PROJECT_NAME}/.cursorrules"
|
|
475
475
|
|
|
476
476
|
# Create .windsurfrules
|
|
477
477
|
cp "${PROJECT_NAME}/.cursorrules" "${PROJECT_NAME}/.windsurfrules"
|
|
@@ -487,7 +487,7 @@ cmd_init() {
|
|
|
487
487
|
cp "${MDAN_DIR}/core/orchestrator.md" "${PROJECT_NAME}/.github/copilot-instructions.md"
|
|
488
488
|
|
|
489
489
|
# Create STATUS.md
|
|
490
|
-
cat > "${PROJECT_NAME}
|
|
490
|
+
cat > "${PROJECT_NAME}/mdan/STATUS.md" << EOF
|
|
491
491
|
# MDAN Project Status
|
|
492
492
|
|
|
493
493
|
**Project:** ${PROJECT_NAME}
|
|
@@ -520,13 +520,13 @@ EOF
|
|
|
520
520
|
echo -e "${GREEN}✅ MDAN project initialized successfully!${NC}"
|
|
521
521
|
echo ""
|
|
522
522
|
echo -e " ${BOLD}Project:${NC} ${PROJECT_NAME}/"
|
|
523
|
-
echo -e " ${BOLD}MDAN files:${NC} ${PROJECT_NAME}
|
|
523
|
+
echo -e " ${BOLD}MDAN files:${NC} ${PROJECT_NAME}/mdan/"
|
|
524
524
|
echo -e " ${BOLD}Templates:${NC} ${PROJECT_NAME}/mdan_output/"
|
|
525
|
-
echo -e " ${BOLD}Skills:${NC} ${PROJECT_NAME}
|
|
525
|
+
echo -e " ${BOLD}Skills:${NC} ${PROJECT_NAME}/mdan/skills/"
|
|
526
526
|
echo ""
|
|
527
527
|
echo -e "${YELLOW}Next steps:${NC}"
|
|
528
528
|
echo " 1. Open your chosen LLM"
|
|
529
|
-
echo " 2. Paste
|
|
529
|
+
echo " 2. Paste mdan/orchestrator.md as your system prompt"
|
|
530
530
|
echo " 3. Start with: 'MDAN: I want to build ${PROJECT_NAME}'"
|
|
531
531
|
echo ""
|
|
532
532
|
echo -e " Or for Cursor/Windsurf: open the ${PROJECT_NAME}/ folder — .cursorrules is ready"
|
|
@@ -654,9 +654,9 @@ cmd_prompt() {
|
|
|
654
654
|
# STATUS
|
|
655
655
|
# ============================================================
|
|
656
656
|
|
|
657
|
-
# ============================================================n# OC (Orchestrator)n# ============================================================nncmd_oc() {n ORCH_FILE="
|
|
657
|
+
# ============================================================n# OC (Orchestrator)n# ============================================================nncmd_oc() {n ORCH_FILE="mdan/orchestrator.md"n if [[ ! -f "$ORCH_FILE" ]]; thenn ORCH_FILE="${MDAN_DIR}/core/orchestrator.md"n fin n if [[ -f "$ORCH_FILE" ]]; thenn if command -v pbcopy &> /dev/null; thenn cat "$ORCH_FILE" | pbcopyn echo -e "${GREEN}✅ Orchestrator prompt copied to clipboard!${NC}"n echo " Paste it into Claude, ChatGPT, or your favorite LLM."n elif command -v xclip &> /dev/null; thenn cat "$ORCH_FILE" | xclip -selection clipboardn echo -e "${GREEN}✅ Orchestrator prompt copied to clipboard!${NC}"n echo " Paste it into Claude, ChatGPT, or your favorite LLM."n elif command -v wl-copy &> /dev/null; thenn cat "$ORCH_FILE" | wl-copyn echo -e "${GREEN}✅ Orchestrator prompt copied to clipboard!${NC}"n echo " Paste it into Claude, ChatGPT, or your favorite LLM."n elsen cat "$ORCH_FILE"n echo -e "\n${YELLOW}⚠️ Could not copy to clipboard automatically. Please copy the text above.${NC}"n fin elsen echo -e "${RED}Orchestrator file not found.${NC}"n fin}nn
|
|
658
658
|
cmd_status() {
|
|
659
|
-
STATUS_FILE="
|
|
659
|
+
STATUS_FILE="mdan/STATUS.md"
|
|
660
660
|
if [[ -f "${STATUS_FILE}" ]]; then
|
|
661
661
|
cat "${STATUS_FILE}"
|
|
662
662
|
else
|
package/install.sh
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/bin/bash
|
|
2
2
|
|
|
3
3
|
# ============================================================
|
|
4
|
-
# MDAN Installer
|
|
4
|
+
# MDAN Installer (Remote Fetch)
|
|
5
5
|
# ============================================================
|
|
6
6
|
|
|
7
7
|
set -e
|
|
@@ -15,6 +15,7 @@ NC='\033[0m'
|
|
|
15
15
|
|
|
16
16
|
INSTALL_DIR="$HOME/.mdan"
|
|
17
17
|
BIN_DIR="$HOME/.local/bin"
|
|
18
|
+
REPO_URL="https://github.com/khalilbenaz/MDAN/archive/refs/heads/main.tar.gz"
|
|
18
19
|
|
|
19
20
|
echo -e "${CYAN}"
|
|
20
21
|
echo " ███╗ ███╗██████╗ █████╗ ███╗ ██╗"
|
|
@@ -27,9 +28,6 @@ echo -e "${NC}"
|
|
|
27
28
|
echo -e " ${BOLD}MDAN Installer${NC}"
|
|
28
29
|
echo ""
|
|
29
30
|
|
|
30
|
-
# Get the directory where this script is located
|
|
31
|
-
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
32
|
-
|
|
33
31
|
echo -e "${YELLOW}Installing MDAN...${NC}"
|
|
34
32
|
echo ""
|
|
35
33
|
|
|
@@ -37,171 +35,35 @@ echo ""
|
|
|
37
35
|
mkdir -p "$INSTALL_DIR"
|
|
38
36
|
mkdir -p "$BIN_DIR"
|
|
39
37
|
|
|
38
|
+
# Download and extract the repository
|
|
39
|
+
echo " ⬇️ Downloading latest MDAN files..."
|
|
40
|
+
TMP_DIR=$(mktemp -d)
|
|
41
|
+
curl -sL "$REPO_URL" | tar -xz -C "$TMP_DIR"
|
|
42
|
+
MDAN_SRC="$TMP_DIR/MDAN-main"
|
|
43
|
+
|
|
40
44
|
# Copy MDAN files
|
|
41
45
|
echo " 📁 Copying files to $INSTALL_DIR..."
|
|
42
|
-
cp -r "$
|
|
43
|
-
cp -r "$
|
|
44
|
-
cp -r "$
|
|
45
|
-
cp -r "$
|
|
46
|
-
cp -r "$
|
|
47
|
-
cp -r "$
|
|
48
|
-
cp -r "$
|
|
49
|
-
cp "$
|
|
50
|
-
cp "$
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
46
|
+
cp -r "$MDAN_SRC/core" "$INSTALL_DIR/"
|
|
47
|
+
cp -r "$MDAN_SRC/agents" "$INSTALL_DIR/"
|
|
48
|
+
cp -r "$MDAN_SRC/phases" "$INSTALL_DIR/"
|
|
49
|
+
cp -r "$MDAN_SRC/templates" "$INSTALL_DIR/"
|
|
50
|
+
cp -r "$MDAN_SRC/integrations" "$INSTALL_DIR/"
|
|
51
|
+
cp -r "$MDAN_SRC/memory" "$INSTALL_DIR/"
|
|
52
|
+
cp -r "$MDAN_SRC/modules" "$INSTALL_DIR/" 2>/dev/null || true
|
|
53
|
+
cp -r "$MDAN_SRC/workflows" "$INSTALL_DIR/" 2>/dev/null || true
|
|
54
|
+
cp -r "$MDAN_SRC/skills" "$INSTALL_DIR/" 2>/dev/null || mkdir -p "$INSTALL_DIR/skills"
|
|
55
|
+
cp "$MDAN_SRC/MDAN.md" "$INSTALL_DIR/" 2>/dev/null || true
|
|
56
|
+
cp "$MDAN_SRC/MDAN.fr.md" "$INSTALL_DIR/" 2>/dev/null || true
|
|
57
|
+
|
|
58
|
+
# Cleanup
|
|
59
|
+
rm -rf "$TMP_DIR"
|
|
60
|
+
|
|
61
|
+
# Create the mdan command using the Node.js version instead of the bash version for better UX
|
|
62
|
+
echo " 🔧 Setting up CLI..."
|
|
54
63
|
cat > "$BIN_DIR/mdan" << 'MDAN_SCRIPT'
|
|
55
64
|
#!/bin/bash
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
MDAN_DIR="$HOME/.mdan"
|
|
59
|
-
|
|
60
|
-
# Colors
|
|
61
|
-
RED='\033[0;31m'
|
|
62
|
-
GREEN='\033[0;32m'
|
|
63
|
-
YELLOW='\033[1;33m'
|
|
64
|
-
CYAN='\033[0;36m'
|
|
65
|
-
MAGENTA='\033[0;35m'
|
|
66
|
-
BOLD='\033[1m'
|
|
67
|
-
NC='\033[0m'
|
|
68
|
-
|
|
69
|
-
banner() {
|
|
70
|
-
echo -e "${CYAN}"
|
|
71
|
-
echo " ███╗ ███╗██████╗ █████╗ ███╗ ██╗"
|
|
72
|
-
echo " ████╗ ████║██╔══██╗██╔══██╗████╗ ██║"
|
|
73
|
-
echo " ██╔████╔██║██║ ██║███████║██╔██╗ ██║"
|
|
74
|
-
echo " ██║╚██╔╝██║██║ ██║██╔══██║██║╚██╗██║"
|
|
75
|
-
echo " ██║ ╚═╝ ██║██████╔╝██║ ██║██║ ╚████║"
|
|
76
|
-
echo " ╚═╝ ╚═╝╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═══╝"
|
|
77
|
-
echo -e "${NC}"
|
|
78
|
-
echo -e " ${BOLD}Multi-Agent Development Agentic Network${NC} v${VERSION}"
|
|
79
|
-
echo ""
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
show_help() {
|
|
83
|
-
banner
|
|
84
|
-
echo -e "${BOLD}USAGE${NC}"
|
|
85
|
-
echo " mdan <command> [options]"
|
|
86
|
-
echo ""
|
|
87
|
-
echo -e "${BOLD}COMMANDS${NC}"
|
|
88
|
-
echo " init [name] Create a new project"
|
|
89
|
-
echo " attach [--rebuild] Add MDAN to existing project"
|
|
90
|
-
echo " status Show project status"
|
|
91
|
-
echo " phase [1-5] Show phase guide"
|
|
92
|
-
echo " agent [name] Show agent prompt"
|
|
93
|
-
echo " skills List available skills"
|
|
94
|
-
echo " version Show version"
|
|
95
|
-
echo ""
|
|
96
|
-
echo -e "${BOLD}EXAMPLES${NC}"
|
|
97
|
-
echo " mdan init my-app # New project"
|
|
98
|
-
echo " cd my-project && mdan attach # Existing project"
|
|
99
|
-
echo " mdan attach --rebuild # Rebuild from scratch"
|
|
100
|
-
echo ""
|
|
101
|
-
echo -e "${BOLD}AGENTS${NC}"
|
|
102
|
-
echo " product, architect, ux, dev, test, security, devops, doc"
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
cmd_init() {
|
|
106
|
-
PROJECT_NAME="${1:-my-project}"
|
|
107
|
-
echo -e "${CYAN}🚀 Creating: ${BOLD}${PROJECT_NAME}${NC}"
|
|
108
|
-
|
|
109
|
-
mkdir -p "${PROJECT_NAME}/.mdan/agents"
|
|
110
|
-
mkdir -p "${PROJECT_NAME}/.mdan/skills"
|
|
111
|
-
mkdir -p "${PROJECT_NAME}/docs"
|
|
112
|
-
mkdir -p "${PROJECT_NAME}/.claude/skills"
|
|
113
|
-
mkdir -p "${PROJECT_NAME}/.github"
|
|
114
|
-
|
|
115
|
-
cp "${MDAN_DIR}/core/orchestrator.md" "${PROJECT_NAME}/.mdan/"
|
|
116
|
-
cp "${MDAN_DIR}/core/universal-envelope.md" "${PROJECT_NAME}/.mdan/"
|
|
117
|
-
cp "${MDAN_DIR}/agents/"*.md "${PROJECT_NAME}/.mdan/agents/"
|
|
118
|
-
cp "${MDAN_DIR}/templates/"*.md "${PROJECT_NAME}/mdan_output/"
|
|
119
|
-
cp -r "${MDAN_DIR}/skills/"* "${PROJECT_NAME}/.mdan/skills/" 2>/dev/null || true
|
|
120
|
-
cp -r "${MDAN_DIR}/skills/"* "${PROJECT_NAME}/.claude/skills/" 2>/dev/null || true
|
|
121
|
-
|
|
122
|
-
cat "${MDAN_DIR}/core/orchestrator.md" > "${PROJECT_NAME}/.cursorrules"
|
|
123
|
-
echo -e "\n## CURSOR INSTRUCTIONS\nAgent files in .mdan/agents/\nSkills in .mdan/skills/" >> "${PROJECT_NAME}/.cursorrules"
|
|
124
|
-
cp "${PROJECT_NAME}/.cursorrules" "${PROJECT_NAME}/.windsurfrules"
|
|
125
|
-
cp "${MDAN_DIR}/core/orchestrator.md" "${PROJECT_NAME}/.github/copilot-instructions.md"
|
|
126
|
-
|
|
127
|
-
echo "# ${PROJECT_NAME}\n\n> Built with MDAN" > "${PROJECT_NAME}/README.md"
|
|
128
|
-
|
|
129
|
-
echo -e "${GREEN}✅ Created ${PROJECT_NAME}/${NC}"
|
|
130
|
-
echo ""
|
|
131
|
-
echo " ${BOLD}Next:${NC} cursor ${PROJECT_NAME}"
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
cmd_attach() {
|
|
135
|
-
REBUILD="${1}"
|
|
136
|
-
PROJECT_NAME=$(basename "$PWD")
|
|
137
|
-
|
|
138
|
-
if [[ "$REBUILD" == "--rebuild" ]]; then
|
|
139
|
-
echo -e "${MAGENTA}🔄 REBUILD MODE: ${BOLD}${PROJECT_NAME}${NC}"
|
|
140
|
-
else
|
|
141
|
-
echo -e "${CYAN}🔗 Attaching to: ${BOLD}${PROJECT_NAME}${NC}"
|
|
142
|
-
fi
|
|
143
|
-
|
|
144
|
-
mkdir -p .mdan/agents .mdan/skills .claude/skills .github
|
|
145
|
-
|
|
146
|
-
cp "${MDAN_DIR}/core/orchestrator.md" .mdan/
|
|
147
|
-
cp "${MDAN_DIR}/core/universal-envelope.md" .mdan/
|
|
148
|
-
cp "${MDAN_DIR}/agents/"*.md .mdan/agents/
|
|
149
|
-
cp -r "${MDAN_DIR}/skills/"* .mdan/skills/ 2>/dev/null || true
|
|
150
|
-
cp -r "${MDAN_DIR}/skills/"* .claude/skills/ 2>/dev/null || true
|
|
151
|
-
|
|
152
|
-
cat "${MDAN_DIR}/core/orchestrator.md" > .cursorrules
|
|
153
|
-
if [[ "$REBUILD" == "--rebuild" ]]; then
|
|
154
|
-
echo -e "\n## REBUILD MODE\nAnalyze existing code then rewrite from scratch." >> .cursorrules
|
|
155
|
-
else
|
|
156
|
-
echo -e "\n## EXISTING PROJECT\nAnalyze codebase before making changes." >> .cursorrules
|
|
157
|
-
fi
|
|
158
|
-
cp .cursorrules .windsurfrules
|
|
159
|
-
cp "${MDAN_DIR}/core/orchestrator.md" .github/copilot-instructions.md
|
|
160
|
-
|
|
161
|
-
echo -e "${GREEN}✅ MDAN ready!${NC}"
|
|
162
|
-
echo ""
|
|
163
|
-
if [[ "$REBUILD" == "--rebuild" ]]; then
|
|
164
|
-
echo " Start: ${CYAN}MDAN REBUILD: Analyze and rewrite this project${NC}"
|
|
165
|
-
else
|
|
166
|
-
echo " Start: ${CYAN}MDAN: Analyze this project${NC}"
|
|
167
|
-
fi
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
cmd_status() {
|
|
171
|
-
if [[ -f ".mdan/orchestrator.md" ]]; then
|
|
172
|
-
echo -e "${GREEN}✅ MDAN is active in this project${NC}"
|
|
173
|
-
[[ -f ".mdan/STATUS.md" ]] && cat .mdan/STATUS.md
|
|
174
|
-
else
|
|
175
|
-
echo -e "${YELLOW}No MDAN project here.${NC}"
|
|
176
|
-
echo " Run: mdan init [name] or mdan attach"
|
|
177
|
-
fi
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
cmd_phase() {
|
|
181
|
-
[[ -f "${MDAN_DIR}/phases/0${1}-"*.md ]] && cat "${MDAN_DIR}/phases/0${1}-"*.md || echo "Phase 1-5"
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
cmd_agent() {
|
|
185
|
-
[[ -f "${MDAN_DIR}/agents/${1}.md" ]] && cat "${MDAN_DIR}/agents/${1}.md" || echo "Agents: product, architect, ux, dev, test, security, devops, doc"
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
cmd_skills() {
|
|
189
|
-
echo -e "${CYAN}Skills:${NC}"
|
|
190
|
-
ls "${MDAN_DIR}/skills/" 2>/dev/null || echo " No skills installed"
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
# Main
|
|
194
|
-
case "${1}" in
|
|
195
|
-
init) cmd_init "$2" ;;
|
|
196
|
-
attach) cmd_attach "$2" ;;
|
|
197
|
-
status) cmd_status ;;
|
|
198
|
-
phase) cmd_phase "$2" ;;
|
|
199
|
-
agent) cmd_agent "$2" ;;
|
|
200
|
-
skills) cmd_skills ;;
|
|
201
|
-
version|-v) echo "MDAN v${VERSION}" ;;
|
|
202
|
-
help|--help|-h|"") show_help ;;
|
|
203
|
-
*) echo "Unknown: $1. Run: mdan help" ;;
|
|
204
|
-
esac
|
|
65
|
+
# Wrapper to run the npx version of mdan-cli to ensure the interactive wizard works
|
|
66
|
+
npx --yes mdan-cli "$@"
|
|
205
67
|
MDAN_SCRIPT
|
|
206
68
|
|
|
207
69
|
chmod +x "$BIN_DIR/mdan"
|
|
@@ -223,6 +85,7 @@ echo ""
|
|
|
223
85
|
echo -e "${GREEN}✅ MDAN installed successfully!${NC}"
|
|
224
86
|
echo ""
|
|
225
87
|
echo -e " ${BOLD}Usage:${NC}"
|
|
226
|
-
echo " mdan init
|
|
227
|
-
echo "
|
|
88
|
+
echo " mdan init # Interactive setup"
|
|
89
|
+
echo " mdan init my-project # Quick setup"
|
|
90
|
+
echo " cd existing && mdan attach"
|
|
228
91
|
echo ""
|
|
@@ -251,14 +251,14 @@ opencode
|
|
|
251
251
|
opencode "I want to build [your project idea]"
|
|
252
252
|
|
|
253
253
|
# Reference agent prompts
|
|
254
|
-
opencode "@file
|
|
254
|
+
opencode "@file mdan/agents/dev.md Implement the user authentication feature"
|
|
255
255
|
```
|
|
256
256
|
|
|
257
257
|
## Notes for Opencode
|
|
258
258
|
|
|
259
259
|
- Opencode excels in the BUILD phase — it can directly edit files
|
|
260
260
|
- Use MDAN feature briefs as opencode tasks
|
|
261
|
-
- Place agent files in
|
|
261
|
+
- Place agent files in `mdan/agents/` for easy reference
|
|
262
262
|
|
|
263
263
|
---
|
|
264
264
|
|
package/integrations/cursor.md
CHANGED
|
@@ -20,21 +20,21 @@ You are operating inside Cursor IDE. In addition to your MDAN orchestration role
|
|
|
20
20
|
- When the Doc Agent produces documentation, write it to the mdan_output/ folder
|
|
21
21
|
|
|
22
22
|
### Agent File References
|
|
23
|
-
- Product Agent: @file
|
|
24
|
-
- Architect Agent: @file
|
|
25
|
-
- UX Agent: @file
|
|
26
|
-
- Dev Agent: @file
|
|
27
|
-
- Test Agent: @file
|
|
28
|
-
- Security Agent: @file
|
|
29
|
-
- DevOps Agent: @file
|
|
30
|
-
- Doc Agent: @file
|
|
23
|
+
- Product Agent: @file mdan/agents/product.md
|
|
24
|
+
- Architect Agent: @file mdan/agents/architect.md
|
|
25
|
+
- UX Agent: @file mdan/agents/ux.md
|
|
26
|
+
- Dev Agent: @file mdan/agents/dev.md
|
|
27
|
+
- Test Agent: @file mdan/agents/test.md
|
|
28
|
+
- Security Agent: @file mdan/agents/security.md
|
|
29
|
+
- DevOps Agent: @file mdan/agents/devops.md
|
|
30
|
+
- Doc Agent: @file mdan/agents/doc.md
|
|
31
31
|
```
|
|
32
32
|
|
|
33
33
|
### Step 2: Copy agents to project
|
|
34
34
|
|
|
35
35
|
```bash
|
|
36
|
-
mkdir -p
|
|
37
|
-
cp agents/*.md
|
|
36
|
+
mkdir -p mdan/agents
|
|
37
|
+
cp agents/*.md mdan/agents/
|
|
38
38
|
```
|
|
39
39
|
|
|
40
40
|
### Step 3: Start using MDAN in Cursor
|
|
@@ -61,7 +61,7 @@ Enable Agent mode for autonomous implementation. MDAN Core will orchestrate, and
|
|
|
61
61
|
|
|
62
62
|
```
|
|
63
63
|
.cursorrules ← MDAN Core orchestrator prompt
|
|
64
|
-
|
|
64
|
+
mdan/
|
|
65
65
|
agents/
|
|
66
66
|
product.md
|
|
67
67
|
architect.md
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
# MDAN MCP Integration
|
|
2
|
+
|
|
3
|
+
> Configure Model Context Protocol for MDAN with your IDE
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
MDAN supports MCP (Model Context Protocol) to provide your coding assistant (Cursor, Claude Code, Windsurf) with deep understanding of MDAN workflows, agents, and best practices.
|
|
8
|
+
|
|
9
|
+
## Quick Start
|
|
10
|
+
|
|
11
|
+
### 1. Generate MCP Config
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
# In your MDAN project
|
|
15
|
+
mdan mcp init
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
This creates `.mcp.json` in your project root.
|
|
19
|
+
|
|
20
|
+
### 2. Configure Your IDE
|
|
21
|
+
|
|
22
|
+
#### Cursor
|
|
23
|
+
1. Open Cursor Settings → Features → Models
|
|
24
|
+
2. MCP should auto-detect `.mcp.json`
|
|
25
|
+
3. Or manually add via: Settings → Developer → Edit MCP Config
|
|
26
|
+
|
|
27
|
+
#### Claude Code
|
|
28
|
+
```bash
|
|
29
|
+
claude mcp add mdan --project path/to/your/project
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
#### Windsurf
|
|
33
|
+
MCP configs are auto-discovered from `.mcp.json` in project root.
|
|
34
|
+
|
|
35
|
+
## Configuration
|
|
36
|
+
|
|
37
|
+
### .mcp.json Structure
|
|
38
|
+
|
|
39
|
+
```json
|
|
40
|
+
{
|
|
41
|
+
"mcpServers": {
|
|
42
|
+
"mdan-memory": { ... }
|
|
43
|
+
},
|
|
44
|
+
"capabilities": {
|
|
45
|
+
"scenarios": {
|
|
46
|
+
"enabled": true,
|
|
47
|
+
"test_paths": ["tests/scenarios/"]
|
|
48
|
+
},
|
|
49
|
+
"evaluations": {
|
|
50
|
+
"enabled": true,
|
|
51
|
+
"eval_paths": ["tests/evaluations/"]
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
"agent_prompts": {
|
|
55
|
+
"dev": "templates/prompts/dev-agent.yaml"
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## Available MCP Tools
|
|
61
|
+
|
|
62
|
+
### mdan-state
|
|
63
|
+
|
|
64
|
+
Read/write MDAN project state.
|
|
65
|
+
|
|
66
|
+
```typescript
|
|
67
|
+
// Read current state
|
|
68
|
+
const state = await mdan_state({ action: "read" });
|
|
69
|
+
|
|
70
|
+
// Write state
|
|
71
|
+
await mdan_state({ action: "write", data: { phase: "BUILD", progress: 50 } });
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### mdan-agents
|
|
75
|
+
|
|
76
|
+
List available MDAN agents.
|
|
77
|
+
|
|
78
|
+
```typescript
|
|
79
|
+
const agents = await mdan_agents();
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### mdan-phases
|
|
83
|
+
|
|
84
|
+
Get phase information.
|
|
85
|
+
|
|
86
|
+
```typescript
|
|
87
|
+
const phase = await mdan_phases({ name: "VERIFY" });
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
## IDE Integration Examples
|
|
91
|
+
|
|
92
|
+
### Cursor Rules Auto-Generation
|
|
93
|
+
|
|
94
|
+
When you run `mdan init` or `mdan attach`, MDAN automatically generates:
|
|
95
|
+
|
|
96
|
+
- `.cursorrules` - Cursor-specific instructions
|
|
97
|
+
- `.windsurfrules` - Windsurf-specific instructions
|
|
98
|
+
- `.github/copilot-instructions.md` - Copilot instructions
|
|
99
|
+
|
|
100
|
+
### Agent Context
|
|
101
|
+
|
|
102
|
+
MCP provides your IDE with access to:
|
|
103
|
+
|
|
104
|
+
1. **Agent prompts** - Full agent definitions for context
|
|
105
|
+
2. **Phase workflows** - Current phase and next steps
|
|
106
|
+
3. **Quality gates** - What's required to pass
|
|
107
|
+
4. **Test templates** - Scenario and evaluation paths
|
|
108
|
+
|
|
109
|
+
## Troubleshooting
|
|
110
|
+
|
|
111
|
+
### MCP not detected
|
|
112
|
+
|
|
113
|
+
1. Check `.mcp.json` is valid JSON
|
|
114
|
+
2. Restart your IDE
|
|
115
|
+
3. Check IDE MCP documentation
|
|
116
|
+
|
|
117
|
+
### Tools not available
|
|
118
|
+
|
|
119
|
+
1. Verify MCP server is running
|
|
120
|
+
2. Check console for errors
|
|
121
|
+
3. Try regenerating config: `mdan mcp init --force`
|
|
122
|
+
|
|
123
|
+
## Commands
|
|
124
|
+
|
|
125
|
+
```bash
|
|
126
|
+
mdan mcp init # Generate MCP config
|
|
127
|
+
mdan mcp validate # Validate config
|
|
128
|
+
mdan mcp list # Show available tools
|
|
129
|
+
mdan mcp update # Update to latest version
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
## Framework Support
|
|
133
|
+
|
|
134
|
+
| IDE | MCP Support | Auto-detect |
|
|
135
|
+
|-----|--------------|-------------|
|
|
136
|
+
| Cursor | ✅ Full | ✅ |
|
|
137
|
+
| Claude Code | ✅ Full | ✅ |
|
|
138
|
+
| Windsurf | ✅ Full | ✅ |
|
|
139
|
+
| VS Code | ✅ Via extension | Manual |
|
|
140
|
+
|
|
141
|
+
## Integration with Better Agents
|
|
142
|
+
|
|
143
|
+
MDAN's MCP config is compatible with Better Agents:
|
|
144
|
+
|
|
145
|
+
- Scenarios in `tests/scenarios/` are auto-discovered
|
|
146
|
+
- Evaluations in `tests/evaluations/` are available
|
|
147
|
+
- Prompts from `templates/prompts/` are versioned
|
|
148
|
+
|
|
149
|
+
This allows you to use Better Agents CLI alongside MDAN:
|
|
150
|
+
|
|
151
|
+
```bash
|
|
152
|
+
npx @langwatch/better-agents test --scenarios tests/scenarios/
|
|
153
|
+
```
|