@mandujs/mcp 0.38.6 → 0.38.7
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/README.md +3 -3
- package/package.json +2 -2
- package/src/executor/error-handler.ts +76 -2
- package/src/index.ts +5 -5
- package/src/prompts.ts +4 -4
- package/src/resources/handlers.ts +4 -6
- package/src/resources/skills/guides.ts +49 -49
- package/src/resources/skills/loader.ts +8 -8
- package/src/resources/skills/mandu-agent-workflow/SKILL.md +124 -124
- package/src/resources/skills/mandu-agent-workflow/metadata.json +7 -7
- package/src/resources/skills/mandu-composition/SKILL.md +47 -47
- package/src/resources/skills/mandu-deployment/SKILL.md +53 -53
- package/src/resources/skills/mandu-deployment/rules/db-provider-supabase.md +3 -3
- package/src/resources/skills/mandu-fs-routes/SKILL.md +47 -47
- package/src/resources/skills/mandu-guard/SKILL.md +58 -58
- package/src/resources/skills/mandu-hydration/SKILL.md +67 -67
- package/src/resources/skills/mandu-hydration/rules/hydration-island-setup.md +54 -54
- package/src/resources/skills/mandu-hydration/rules/hydration-priority-visible.md +60 -60
- package/src/resources/skills/mandu-performance/SKILL.md +47 -47
- package/src/resources/skills/mandu-security/SKILL.md +47 -47
- package/src/resources/skills/mandu-slot/SKILL.md +48 -48
- package/src/resources/skills/mandu-styling/SKILL.md +52 -52
- package/src/resources/skills/mandu-testing/SKILL.md +55 -55
- package/src/resources/skills/mandu-ui/SKILL.md +52 -52
- package/src/resources/skills/recipes.ts +28 -28
- package/src/server.ts +2 -1
- package/src/tools/agent.ts +443 -443
- package/src/tools/ate.ts +37 -37
- package/src/tools/brain.ts +12 -11
- package/src/tools/composite.ts +13 -13
- package/src/tools/contract.ts +1 -1
- package/src/tools/deploy-plan.ts +1 -1
- package/src/tools/generate.ts +3 -1
- package/src/tools/guard.ts +36 -1
- package/src/tools/history.ts +1 -1
- package/src/tools/hydration.ts +1 -3
- package/src/tools/index.ts +14 -0
- package/src/tools/kitchen.ts +72 -72
- package/src/tools/runtime.ts +1 -1
- package/src/tools/slot-validation.ts +19 -19
- package/src/tools/transaction.ts +19 -5
- package/src/utils/withWarnings.ts +1 -1
|
@@ -10,52 +10,52 @@ metadata:
|
|
|
10
10
|
version: "1.0.0"
|
|
11
11
|
---
|
|
12
12
|
|
|
13
|
-
# Mandu Testing
|
|
14
|
-
|
|
15
|
-
Mandu 애플리케이션의 테스트 패턴 가이드. Bun test를 활용한 단위 테스트, slot 테스트, Island 컴포넌트 테스트, Playwright E2E 테스트를 다룹니다.
|
|
16
|
-
|
|
17
|
-
## Agent Workflow Contract
|
|
18
|
-
|
|
19
|
-
This skill is a Domain addendum. It must not replace `mandu-agent-workflow`.
|
|
20
|
-
Use it only after `mandu.agent.plan` selects testing or `mandu.agent.verify` asks for targeted test coverage.
|
|
21
|
-
|
|
22
|
-
Canonical workflow step: `verify -> repair`.
|
|
23
|
-
|
|
24
|
-
Preferred MCP tools:
|
|
25
|
-
|
|
26
|
-
| Step | Tools |
|
|
27
|
-
|------|-------|
|
|
28
|
-
| plan | `mandu.agent.plan` |
|
|
29
|
-
| verify | `mandu.agent.verify`, `mandu.run.tests`, `mandu.ate.generate`, `mandu.ate.run` |
|
|
30
|
-
| repair | `mandu.agent.repair`, `mandu.ate.heal` |
|
|
31
|
-
|
|
32
|
-
Allowed file edits:
|
|
33
|
-
|
|
34
|
-
- Co-located `*.test.ts` / `*.test.tsx` files
|
|
35
|
-
- `tests/e2e/**/*.spec.ts`
|
|
36
|
-
- Test fixtures and mocks scoped to the planned domain
|
|
37
|
-
|
|
38
|
-
Verification command:
|
|
39
|
-
|
|
40
|
-
```bash
|
|
41
|
-
mandu agent verify --changed --json --write
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
Common failures:
|
|
45
|
-
|
|
46
|
-
- Running broad watch-mode tests as an agent default
|
|
47
|
-
- Adding tests that bypass the route/slot/contract path under change
|
|
48
|
-
- Applying ATE healing before reading the verify report
|
|
49
|
-
|
|
50
|
-
Repair path:
|
|
51
|
-
|
|
52
|
-
```bash
|
|
53
|
-
mandu agent repair --from .mandu/agent-verify.json --json
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
## When to Apply
|
|
57
|
-
|
|
58
|
-
Reference these guidelines when:
|
|
13
|
+
# Mandu Testing
|
|
14
|
+
|
|
15
|
+
Mandu 애플리케이션의 테스트 패턴 가이드. Bun test를 활용한 단위 테스트, slot 테스트, Island 컴포넌트 테스트, Playwright E2E 테스트를 다룹니다.
|
|
16
|
+
|
|
17
|
+
## Agent Workflow Contract
|
|
18
|
+
|
|
19
|
+
This skill is a Domain addendum. It must not replace `mandu-agent-workflow`.
|
|
20
|
+
Use it only after `mandu.agent.plan` selects testing or `mandu.agent.verify` asks for targeted test coverage.
|
|
21
|
+
|
|
22
|
+
Canonical workflow step: `verify -> repair`.
|
|
23
|
+
|
|
24
|
+
Preferred MCP tools:
|
|
25
|
+
|
|
26
|
+
| Step | Tools |
|
|
27
|
+
|------|-------|
|
|
28
|
+
| plan | `mandu.agent.plan` |
|
|
29
|
+
| verify | `mandu.agent.verify`, `mandu.run.tests`, `mandu.ate.generate`, `mandu.ate.run` |
|
|
30
|
+
| repair | `mandu.agent.repair`, `mandu.ate.heal` |
|
|
31
|
+
|
|
32
|
+
Allowed file edits:
|
|
33
|
+
|
|
34
|
+
- Co-located `*.test.ts` / `*.test.tsx` files
|
|
35
|
+
- `tests/e2e/**/*.spec.ts`
|
|
36
|
+
- Test fixtures and mocks scoped to the planned domain
|
|
37
|
+
|
|
38
|
+
Verification command:
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
mandu agent verify --changed --json --write
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Common failures:
|
|
45
|
+
|
|
46
|
+
- Running broad watch-mode tests as an agent default
|
|
47
|
+
- Adding tests that bypass the route/slot/contract path under change
|
|
48
|
+
- Applying ATE healing before reading the verify report
|
|
49
|
+
|
|
50
|
+
Repair path:
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
mandu agent repair --from .mandu/agent-verify.json --json
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## When to Apply
|
|
57
|
+
|
|
58
|
+
Reference these guidelines when:
|
|
59
59
|
- Writing unit tests for slots
|
|
60
60
|
- Testing Island components
|
|
61
61
|
- Setting up E2E tests with Playwright
|
|
@@ -96,15 +96,15 @@ Reference these guidelines when:
|
|
|
96
96
|
- `test-mock-fetch` - Mock fetch requests
|
|
97
97
|
- `test-mock-database` - Mock database operations
|
|
98
98
|
|
|
99
|
-
## Low-Level Test Commands
|
|
100
|
-
|
|
101
|
-
Use these only after `agent plan` or `agent verify` identifies the target:
|
|
102
|
-
|
|
103
|
-
```bash
|
|
104
|
-
mandu agent verify --changed --json --write
|
|
105
|
-
bun test src/slots/user.test.ts
|
|
106
|
-
bun test --coverage
|
|
107
|
-
```
|
|
99
|
+
## Low-Level Test Commands
|
|
100
|
+
|
|
101
|
+
Use these only after `agent plan` or `agent verify` identifies the target:
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
mandu agent verify --changed --json --write
|
|
105
|
+
bun test src/slots/user.test.ts
|
|
106
|
+
bun test --coverage
|
|
107
|
+
```
|
|
108
108
|
|
|
109
109
|
## Test File Convention
|
|
110
110
|
|
|
@@ -9,53 +9,53 @@ globs:
|
|
|
9
9
|
- "app/**/client.tsx"
|
|
10
10
|
---
|
|
11
11
|
|
|
12
|
-
# Mandu UI Skill
|
|
13
|
-
|
|
14
|
-
Mandu Island 아키텍처에 UI 컴포넌트 라이브러리를 통합하는 가이드입니다.
|
|
15
|
-
|
|
16
|
-
## Agent Workflow Contract
|
|
17
|
-
|
|
18
|
-
This skill is a Domain addendum. It must not replace `mandu-agent-workflow`.
|
|
19
|
-
Use it only after `mandu.agent.plan` selects UI, design, styling, component, or hydration domains.
|
|
20
|
-
|
|
21
|
-
Canonical workflow step: `plan -> apply -> verify`.
|
|
22
|
-
|
|
23
|
-
Preferred MCP tools:
|
|
24
|
-
|
|
25
|
-
| Step | Tools |
|
|
26
|
-
|------|-------|
|
|
27
|
-
| plan | `mandu.agent.plan`, `mandu.design.get`, `mandu.component.list` |
|
|
28
|
-
| apply | `mandu.agent.apply`, `mandu.component.add` |
|
|
29
|
-
| verify | `mandu.agent.verify`, `mandu.design.check`, `mandu.lint` |
|
|
30
|
-
| repair | `mandu.agent.repair` |
|
|
31
|
-
|
|
32
|
-
Allowed file edits:
|
|
33
|
-
|
|
34
|
-
- `components/ui/**/*.tsx`
|
|
35
|
-
- Route-local island/client components named in the plan
|
|
36
|
-
- Styling utilities only when they are required by the selected component
|
|
37
|
-
|
|
38
|
-
Verification command:
|
|
39
|
-
|
|
40
|
-
```bash
|
|
41
|
-
mandu agent verify --changed --json --write
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
Common failures:
|
|
45
|
-
|
|
46
|
-
- Adding UI libraries before reading the existing design/component inventory
|
|
47
|
-
- Mixing server components and island-only UI imports
|
|
48
|
-
- Skipping accessibility or design checks for interactive components
|
|
49
|
-
|
|
50
|
-
Repair path:
|
|
51
|
-
|
|
52
|
-
```bash
|
|
53
|
-
mandu agent repair --from .mandu/agent-verify.json --json
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
## 핵심 원칙
|
|
57
|
-
|
|
58
|
-
1. **Headless First**: Radix UI 기반으로 동작과 스타일 분리
|
|
12
|
+
# Mandu UI Skill
|
|
13
|
+
|
|
14
|
+
Mandu Island 아키텍처에 UI 컴포넌트 라이브러리를 통합하는 가이드입니다.
|
|
15
|
+
|
|
16
|
+
## Agent Workflow Contract
|
|
17
|
+
|
|
18
|
+
This skill is a Domain addendum. It must not replace `mandu-agent-workflow`.
|
|
19
|
+
Use it only after `mandu.agent.plan` selects UI, design, styling, component, or hydration domains.
|
|
20
|
+
|
|
21
|
+
Canonical workflow step: `plan -> apply -> verify`.
|
|
22
|
+
|
|
23
|
+
Preferred MCP tools:
|
|
24
|
+
|
|
25
|
+
| Step | Tools |
|
|
26
|
+
|------|-------|
|
|
27
|
+
| plan | `mandu.agent.plan`, `mandu.design.get`, `mandu.component.list` |
|
|
28
|
+
| apply | `mandu.agent.apply`, `mandu.component.add` |
|
|
29
|
+
| verify | `mandu.agent.verify`, `mandu.design.check`, `mandu.lint` |
|
|
30
|
+
| repair | `mandu.agent.repair` |
|
|
31
|
+
|
|
32
|
+
Allowed file edits:
|
|
33
|
+
|
|
34
|
+
- `components/ui/**/*.tsx`
|
|
35
|
+
- Route-local island/client components named in the plan
|
|
36
|
+
- Styling utilities only when they are required by the selected component
|
|
37
|
+
|
|
38
|
+
Verification command:
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
mandu agent verify --changed --json --write
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Common failures:
|
|
45
|
+
|
|
46
|
+
- Adding UI libraries before reading the existing design/component inventory
|
|
47
|
+
- Mixing server components and island-only UI imports
|
|
48
|
+
- Skipping accessibility or design checks for interactive components
|
|
49
|
+
|
|
50
|
+
Repair path:
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
mandu agent repair --from .mandu/agent-verify.json --json
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## 핵심 원칙
|
|
57
|
+
|
|
58
|
+
1. **Headless First**: Radix UI 기반으로 동작과 스타일 분리
|
|
59
59
|
2. **Copy-Paste**: shadcn/ui 방식으로 소유권 유지
|
|
60
60
|
3. **Accessibility**: WCAG 2.1 AA 수준 준수
|
|
61
61
|
4. **Island 호환**: 클라이언트 컴포넌트로 올바르게 분리
|
|
@@ -69,11 +69,11 @@ Icons: Lucide React
|
|
|
69
69
|
Utilities: clsx, tailwind-merge, cva
|
|
70
70
|
```
|
|
71
71
|
|
|
72
|
-
## Setup Examples
|
|
73
|
-
|
|
74
|
-
Use these examples only after `mandu.agent.plan` selects UI library setup.
|
|
75
|
-
|
|
76
|
-
### shadcn/ui 초기화
|
|
72
|
+
## Setup Examples
|
|
73
|
+
|
|
74
|
+
Use these examples only after `mandu.agent.plan` selects UI library setup.
|
|
75
|
+
|
|
76
|
+
### shadcn/ui 초기화
|
|
77
77
|
|
|
78
78
|
```bash
|
|
79
79
|
bunx shadcn-ui@latest init
|
|
@@ -469,30 +469,30 @@ export default function Counter({ initial = 0, step = 1 }: CounterProps) {
|
|
|
469
469
|
}
|
|
470
470
|
\`\`\`
|
|
471
471
|
|
|
472
|
-
## Step 2: 서버 페이지에서 partial로 사용
|
|
473
|
-
|
|
474
|
-
\`\`\`tsx
|
|
475
|
-
// app/counter/page.tsx
|
|
476
|
-
|
|
477
|
-
import { partial } from "@mandujs/core/client";
|
|
478
|
-
import Counter from "./client";
|
|
479
|
-
|
|
480
|
-
const CounterPartial = partial({
|
|
481
|
-
component: Counter,
|
|
482
|
-
priority: "visible",
|
|
483
|
-
});
|
|
484
|
-
|
|
485
|
-
export default function CounterPage() {
|
|
486
|
-
return (
|
|
472
|
+
## Step 2: 서버 페이지에서 partial로 사용
|
|
473
|
+
|
|
474
|
+
\`\`\`tsx
|
|
475
|
+
// app/counter/page.tsx
|
|
476
|
+
|
|
477
|
+
import { partial } from "@mandujs/core/client";
|
|
478
|
+
import Counter from "./client";
|
|
479
|
+
|
|
480
|
+
const CounterPartial = partial({
|
|
481
|
+
component: Counter,
|
|
482
|
+
priority: "visible",
|
|
483
|
+
});
|
|
484
|
+
|
|
485
|
+
export default function CounterPage() {
|
|
486
|
+
return (
|
|
487
487
|
<div style={{ padding: "20px" }}>
|
|
488
488
|
<h1>Counter Demo</h1>
|
|
489
489
|
<p>아래 카운터는 클라이언트에서 hydration됩니다.</p>
|
|
490
|
-
|
|
491
|
-
{/* Inline client region */}
|
|
492
|
-
<CounterPartial.Render initial={10} step={5} />
|
|
493
|
-
|
|
494
|
-
<p style={{ marginTop: "20px", color: "#666" }}>
|
|
495
|
-
이 텍스트는 정적 HTML입니다.
|
|
490
|
+
|
|
491
|
+
{/* Inline client region */}
|
|
492
|
+
<CounterPartial.Render initial={10} step={5} />
|
|
493
|
+
|
|
494
|
+
<p style={{ marginTop: "20px", color: "#666" }}>
|
|
495
|
+
이 텍스트는 정적 HTML입니다.
|
|
496
496
|
</p>
|
|
497
497
|
</div>
|
|
498
498
|
);
|
|
@@ -624,13 +624,13 @@ export default function UserList() {
|
|
|
624
624
|
|
|
625
625
|
## Mandu.island() API (고급)
|
|
626
626
|
|
|
627
|
-
서버 데이터와 클라이언트 상태를 분리하는 page-level Island가 필요하면
|
|
628
|
-
\`Mandu.island({ setup, render })\`를 사용합니다. \`island("visible",
|
|
629
|
-
Component)\`는 지원하지 않습니다. 서버 페이지 안에 inline으로 렌더링할
|
|
630
|
-
영역은 \`partial()\`을 사용하세요.
|
|
631
|
-
|
|
632
|
-
\`\`\`typescript
|
|
633
|
-
// spec/slots/todos.client.ts
|
|
627
|
+
서버 데이터와 클라이언트 상태를 분리하는 page-level Island가 필요하면
|
|
628
|
+
\`Mandu.island({ setup, render })\`를 사용합니다. \`island("visible",
|
|
629
|
+
Component)\`는 지원하지 않습니다. 서버 페이지 안에 inline으로 렌더링할
|
|
630
|
+
영역은 \`partial()\`을 사용하세요.
|
|
631
|
+
|
|
632
|
+
\`\`\`typescript
|
|
633
|
+
// spec/slots/todos.client.ts
|
|
634
634
|
|
|
635
635
|
import { Mandu } from "@mandujs/core/client";
|
|
636
636
|
import { useState } from "react";
|
package/src/server.ts
CHANGED
|
@@ -21,7 +21,8 @@ import {
|
|
|
21
21
|
type CallToolResult,
|
|
22
22
|
} from "@modelcontextprotocol/sdk/types.js";
|
|
23
23
|
|
|
24
|
-
import { loadManduConfig,
|
|
24
|
+
import { loadManduConfig, type ManduConfig } from "@mandujs/core";
|
|
25
|
+
import { startWatcher } from "@mandujs/core/watcher";
|
|
25
26
|
|
|
26
27
|
// DNA-001: 플러그인 기반 도구 레지스트리
|
|
27
28
|
import { mcpToolRegistry } from "./registry/mcp-tool-registry.js";
|