@mandujs/mcp 0.37.2 → 0.37.4

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.
@@ -10,14 +10,54 @@ metadata:
10
10
  version: "1.0.0"
11
11
  ---
12
12
 
13
- # Mandu Island Hydration
14
-
15
- Island Hydration은 페이지의 일부분만 클라이언트에서 인터랙티브하게 만드는 기술입니다.
16
- 대부분의 페이지는 정적 HTML로 유지하고, 필요한 부분만 JavaScript를 로드합니다.
17
-
18
- ## When to Apply
19
-
20
- Reference these guidelines when:
13
+ # Mandu Island Hydration
14
+
15
+ Island Hydration은 페이지의 일부분만 클라이언트에서 인터랙티브하게 만드는 기술입니다.
16
+ 대부분의 페이지는 정적 HTML로 유지하고, 필요한 부분만 JavaScript를 로드합니다.
17
+
18
+ ## Agent Workflow Contract
19
+
20
+ This skill is a Domain addendum. It must not replace `mandu-agent-workflow`.
21
+ Use it only after `mandu.agent.plan` selects the hydration, island, partial, or route domain.
22
+
23
+ Canonical workflow step: `plan -> apply -> verify -> repair`.
24
+
25
+ Preferred MCP tools:
26
+
27
+ | Step | Tools |
28
+ |------|-------|
29
+ | plan | `mandu.agent.plan`, `mandu.island.list` |
30
+ | apply | `mandu.agent.apply`, `mandu.hydration.set`, `mandu.hydration.addClientSlot` |
31
+ | verify | `mandu.agent.verify`, `mandu.build`, `mandu.build.status` |
32
+ | repair | `mandu.agent.repair` |
33
+
34
+ Allowed file edits:
35
+
36
+ - `app/**/*.partial.tsx`, `app/**/*.island.tsx`, route-local client components
37
+ - Page hydration metadata only when the plan names the route
38
+ - Shared client utilities only after inspecting existing client boundaries
39
+
40
+ Verification command:
41
+
42
+ ```bash
43
+ mandu agent verify --changed --json --write
44
+ ```
45
+
46
+ Common failures:
47
+
48
+ - Rendering page-level islands inline instead of using `partial().Render`
49
+ - Forgetting route hydration metadata when a server page renders partials
50
+ - Moving server-only imports into client bundles
51
+
52
+ Repair path:
53
+
54
+ ```bash
55
+ mandu agent repair --from .mandu/agent-verify.json --json
56
+ ```
57
+
58
+ ## When to Apply
59
+
60
+ Reference these guidelines when:
21
61
  - Creating interactive client components
22
62
  - Adding client-side state to pages
23
63
  - Implementing partial hydration
@@ -57,17 +97,25 @@ Reference these guidelines when:
57
97
  - `hydration-data-server` - Access server data with useServerData
58
98
  - `hydration-data-event` - Communicate between Islands with useIslandEvent
59
99
 
60
- ## Hydration Strategies
61
-
62
- | Strategy | Description | Use Case |
63
- |----------|-------------|----------|
64
- | `none` | No JavaScript | Pure static pages |
65
- | `island` | Partial hydration (default) | Static + interactive mix |
66
- | `full` | Full hydration | SPA-style pages |
67
-
68
- ## Client Hooks
69
-
70
- ```typescript
100
+ ## Hydration Strategies
101
+
102
+ | Strategy | Description | Use Case |
103
+ |----------|-------------|----------|
104
+ | `none` | No JavaScript | Pure static pages |
105
+ | `island` | Partial hydration (default) | Static + interactive mix |
106
+ | `full` | Full hydration | SPA-style pages |
107
+
108
+ ## Runtime API Constraints
109
+
110
+ - `island()` / `Mandu.island()` takes one definition object: `island({ setup, render })`.
111
+ - Do not call `island("visible", Component)`; use `wrapComponent(Component)` for a simple page-level island wrapper.
112
+ - Islands are page-level client bundles. Do not render them as inline JSX like `<MyIsland />`.
113
+ - For an embedded interactive region inside a server page, use `partial()`: put it in `*.partial.tsx`, export `partial({ id, component })`, and render the returned `.Render` component from the server page.
114
+ - A server page that renders partials must opt into hydration, for example `export const hydration = { strategy: "island", priority: "visible", preload: false }`.
115
+
116
+ ## Client Hooks
117
+
118
+ ```typescript
71
119
  import {
72
120
  useServerData,
73
121
  useHydrated,
@@ -5,13 +5,60 @@ impactDescription: Proper Island structure
5
5
  tags: hydration, island, setup
6
6
  ---
7
7
 
8
- ## Use Mandu.island() with Setup Function
9
-
10
- For complex Islands, use `Mandu.island()` API to separate state logic from rendering.
11
-
12
- **Incorrect (mixed concerns):**
13
-
14
- ```tsx
8
+ ## Use Mandu.island() with Setup Function
9
+
10
+ For complex Islands, use `Mandu.island()` API to separate state logic from rendering.
11
+ `Mandu.island()` takes a single definition object. The shorthand
12
+ `island("visible", Component)` is not a supported Mandu runtime API.
13
+
14
+ Islands are page-level client bundles. They are discovered and rendered by
15
+ the framework wrapper, not embedded directly as inline JSX. Use `partial()`
16
+ when a server page needs an inline interactive region.
17
+
18
+ ```tsx
19
+ // Simple page-level island wrapper
20
+ "use client";
21
+
22
+ import { wrapComponent } from "@mandujs/core/client";
23
+
24
+ function Counter() {
25
+ return <button>Count</button>;
26
+ }
27
+
28
+ export default wrapComponent(Counter);
29
+ ```
30
+
31
+ ```tsx
32
+ // Inline client region inside a server-rendered page
33
+ // app/Counter.partial.tsx
34
+ import { partial } from "@mandujs/core/client";
35
+ import { Counter } from "./counter.client";
36
+
37
+ export default partial({
38
+ id: "Counter",
39
+ component: Counter,
40
+ priority: "visible",
41
+ });
42
+ ```
43
+
44
+ ```tsx
45
+ // app/page.tsx
46
+ import CounterPartial from "./Counter.partial";
47
+
48
+ export const hydration = {
49
+ strategy: "island",
50
+ priority: "visible",
51
+ preload: false,
52
+ };
53
+
54
+ export default function Page() {
55
+ return <CounterPartial.Render initial={0} />;
56
+ }
57
+ ```
58
+
59
+ **Incorrect (mixed concerns):**
60
+
61
+ ```tsx
15
62
  "use client";
16
63
 
17
64
  export default function TodoList({ initialTodos }) {
@@ -18,43 +18,66 @@ Set hydration priority based on when the component needs to be interactive.
18
18
  | `idle` | Browser idle | Non-critical features (analytics widgets) |
19
19
  | `interaction` | User action | Click-to-activate components |
20
20
 
21
- ## Examples
22
-
23
- ### Immediate: Always-visible interactions
24
-
25
- ```tsx
26
- // Header with navigation - needs to work immediately
27
- <Island priority="immediate">
28
- <HeaderNav />
29
- </Island>
30
- ```
31
-
32
- ### Visible: Below-fold content (default)
33
-
34
- ```tsx
35
- // Comments section - load when scrolled into view
36
- <Island priority="visible">
37
- <CommentsSection postId={postId} />
38
- </Island>
39
- ```
40
-
41
- ### Idle: Background features
42
-
43
- ```tsx
44
- // Chat widget - can wait until browser is idle
45
- <Island priority="idle">
46
- <ChatWidget />
47
- </Island>
48
- ```
49
-
50
- ### Interaction: On-demand activation
51
-
52
- ```tsx
53
- // Video player - only hydrate when user clicks play
54
- <Island priority="interaction">
55
- <VideoPlayer videoId={videoId} />
56
- </Island>
57
- ```
21
+ ## Examples
22
+
23
+ Inline client regions live in `*.partial.tsx` files and use
24
+ `partial({ id, component, priority })`, then render the returned `.Render`
25
+ component from the server page. The page must export a non-`none` hydration
26
+ config.
27
+
28
+ ### Immediate: Always-visible interactions
29
+
30
+ ```tsx
31
+ // Header with navigation - needs to work immediately
32
+ import { partial } from "@mandujs/core/client";
33
+
34
+ const HeaderNavPartial = partial({
35
+ id: "HeaderNav",
36
+ component: HeaderNav,
37
+ priority: "immediate",
38
+ });
39
+
40
+ <HeaderNavPartial.Render />
41
+ ```
42
+
43
+ ### Visible: Below-fold content (default)
44
+
45
+ ```tsx
46
+ // Comments section - load when scrolled into view
47
+ const CommentsPartial = partial({
48
+ id: "Comments",
49
+ component: CommentsSection,
50
+ priority: "visible",
51
+ });
52
+
53
+ <CommentsPartial.Render postId={postId} />
54
+ ```
55
+
56
+ ### Idle: Background features
57
+
58
+ ```tsx
59
+ // Chat widget - can wait until browser is idle
60
+ const ChatPartial = partial({
61
+ id: "Chat",
62
+ component: ChatWidget,
63
+ priority: "idle",
64
+ });
65
+
66
+ <ChatPartial.Render />
67
+ ```
68
+
69
+ ### Interaction: On-demand activation
70
+
71
+ ```tsx
72
+ // Video player - only hydrate when user clicks play
73
+ const VideoPartial = partial({
74
+ id: "Video",
75
+ component: VideoPlayer,
76
+ priority: "interaction",
77
+ });
78
+
79
+ <VideoPartial.Render videoId={videoId} />
80
+ ```
58
81
 
59
82
  ## Performance Impact
60
83
 
@@ -10,13 +10,53 @@ metadata:
10
10
  version: "1.0.0"
11
11
  ---
12
12
 
13
- # Mandu Performance
14
-
15
- Mandu 애플리케이션의 성능 최적화 가이드. 워터폴 제거, 번들 최적화, 캐싱 패턴, Bun 런타임 활용법을 다룹니다. Vercel의 React Best Practices를 Mandu 컨텍스트로 변환하여 적용합니다.
16
-
17
- ## When to Apply
18
-
19
- Reference these guidelines when:
13
+ # Mandu Performance
14
+
15
+ Mandu 애플리케이션의 성능 최적화 가이드. 워터폴 제거, 번들 최적화, 캐싱 패턴, Bun 런타임 활용법을 다룹니다. Vercel의 React Best Practices를 Mandu 컨텍스트로 변환하여 적용합니다.
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 performance, hydration, route, API, or runtime domains.
21
+
22
+ Canonical workflow step: `plan -> verify -> repair`.
23
+
24
+ Preferred MCP tools:
25
+
26
+ | Step | Tools |
27
+ |------|-------|
28
+ | plan | `mandu.agent.plan`, `mandu.agent.context` |
29
+ | apply | `mandu.agent.apply` |
30
+ | verify | `mandu.agent.verify`, `mandu.build`, `mandu.run.tests` |
31
+ | repair | `mandu.agent.repair` |
32
+
33
+ Allowed file edits:
34
+
35
+ - Route, slot, island, or cache code named in the plan
36
+ - Import boundaries that reduce bundle/runtime cost
37
+ - Benchmark/test files scoped to the performance claim
38
+
39
+ Verification command:
40
+
41
+ ```bash
42
+ mandu agent verify --changed --json --write
43
+ ```
44
+
45
+ Common failures:
46
+
47
+ - Optimizing without a measurable route, bundle, or runtime target
48
+ - Moving server-only code into client islands for convenience
49
+ - Skipping typecheck or targeted tests after cache/import rewrites
50
+
51
+ Repair path:
52
+
53
+ ```bash
54
+ mandu agent repair --from .mandu/agent-verify.json --json
55
+ ```
56
+
57
+ ## When to Apply
58
+
59
+ Reference these guidelines when:
20
60
  - Optimizing slot handler response times
21
61
  - Reducing Island component bundle size
22
62
  - Implementing caching strategies
@@ -10,13 +10,53 @@ metadata:
10
10
  version: "1.0.0"
11
11
  ---
12
12
 
13
- # Mandu Security
14
-
15
- Mandu 애플리케이션의 보안 모범 사례 가이드. slot guard를 통한 인증/인가, 입력 검증, CSRF/XSS 방어, 환경 변수 관리를 다룹니다.
16
-
17
- ## When to Apply
18
-
19
- Reference these guidelines when:
13
+ # Mandu Security
14
+
15
+ Mandu 애플리케이션의 보안 모범 사례 가이드. slot guard를 통한 인증/인가, 입력 검증, CSRF/XSS 방어, 환경 변수 관리를 다룹니다.
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 security, auth, slot, API, or runtime domains.
21
+
22
+ Canonical workflow step: `plan -> verify -> repair`.
23
+
24
+ Preferred MCP tools:
25
+
26
+ | Step | Tools |
27
+ |------|-------|
28
+ | plan | `mandu.agent.plan`, `mandu.docs.search` |
29
+ | apply | `mandu.agent.apply` |
30
+ | verify | `mandu.agent.verify`, `mandu.guard.check`, `mandu.contract.validate` |
31
+ | repair | `mandu.agent.repair`, `mandu.guard.explain` |
32
+
33
+ Allowed file edits:
34
+
35
+ - Auth/session slot logic named in the plan
36
+ - Server-only validation and security header configuration
37
+ - Environment templates, never secret values
38
+
39
+ Verification command:
40
+
41
+ ```bash
42
+ mandu agent verify --changed --json --write
43
+ ```
44
+
45
+ Common failures:
46
+
47
+ - Exposing secrets through client bundles or sync artifacts
48
+ - Changing auth behavior without route/API/slot verification
49
+ - Treating guard findings as policy problems before checking source boundaries
50
+
51
+ Repair path:
52
+
53
+ ```bash
54
+ mandu agent repair --from .mandu/agent-verify.json --json
55
+ ```
56
+
57
+ ## When to Apply
58
+
59
+ Reference these guidelines when:
20
60
  - Implementing authentication in slots
21
61
  - Adding authorization guards
22
62
  - Validating user input
@@ -11,14 +11,54 @@ metadata:
11
11
  version: "1.0.0"
12
12
  ---
13
13
 
14
- # Mandu Slot
15
-
16
- Slot은 비즈니스 로직을 작성하는 파일입니다. `Mandu.filling()` API를 사용하여
17
- API 핸들러, 인증 가드, 라이프사이클 훅을 구현합니다.
18
-
19
- ## When to Apply
20
-
21
- Reference these guidelines when:
14
+ # Mandu Slot
15
+
16
+ Slot은 비즈니스 로직을 작성하는 파일입니다. `Mandu.filling()` API를 사용하여
17
+ API 핸들러, 인증 가드, 라이프사이클 훅을 구현합니다.
18
+
19
+ ## Agent Workflow Contract
20
+
21
+ This skill is a Domain addendum. It must not replace `mandu-agent-workflow`.
22
+ Use it only after `mandu.agent.plan` selects the slot, API, or security domain.
23
+
24
+ Canonical workflow step: `plan -> apply -> verify -> repair`.
25
+
26
+ Preferred MCP tools:
27
+
28
+ | Step | Tools |
29
+ |------|-------|
30
+ | plan | `mandu.agent.plan`, `mandu.slot.read`, `mandu.slot.constraints` |
31
+ | apply | `mandu.agent.apply`, `mandu.generate` |
32
+ | verify | `mandu.agent.verify`, `mandu.slot.validate`, `mandu.contract.validate` |
33
+ | repair | `mandu.agent.repair` |
34
+
35
+ Allowed file edits:
36
+
37
+ - `spec/slots/**/*.slot.ts`
38
+ - Route handlers that bind to the planned slot
39
+ - Contract files only when the plan includes contract work
40
+
41
+ Verification command:
42
+
43
+ ```bash
44
+ mandu agent verify --changed --json --write
45
+ ```
46
+
47
+ Common failures:
48
+
49
+ - Creating slot logic without checking `mandu.slot.constraints`
50
+ - Mixing auth/security changes into slot edits without security verification
51
+ - Returning untyped responses that drift from the linked contract
52
+
53
+ Repair path:
54
+
55
+ ```bash
56
+ mandu agent repair --from .mandu/agent-verify.json --json
57
+ ```
58
+
59
+ ## When to Apply
60
+
61
+ Reference these guidelines when:
22
62
  - Creating new API endpoints with business logic
23
63
  - Implementing authentication or authorization
24
64
  - Adding request/response lifecycle hooks
@@ -11,13 +11,53 @@ globs:
11
11
  - "app/globals.css"
12
12
  ---
13
13
 
14
- # Mandu Styling Skill
15
-
16
- Mandu Island 아키텍처에 최적화된 Tailwind CSS v4 스타일링 가이드입니다.
17
-
18
- ## 핵심 원칙
19
-
20
- 1. **Zero-Runtime**: 빌드 타임 CSS 생성 (SSR 호환)
14
+ # Mandu Styling Skill
15
+
16
+ Mandu Island 아키텍처에 최적화된 Tailwind CSS v4 스타일링 가이드입니다.
17
+
18
+ ## Agent Workflow Contract
19
+
20
+ This skill is a Domain addendum. It must not replace `mandu-agent-workflow`.
21
+ Use it only after `mandu.agent.plan` selects styling, design, UI, hydration, or component domains.
22
+
23
+ Canonical workflow step: `plan -> apply -> verify`.
24
+
25
+ Preferred MCP tools:
26
+
27
+ | Step | Tools |
28
+ |------|-------|
29
+ | plan | `mandu.agent.plan`, `mandu.design.get` |
30
+ | apply | `mandu.agent.apply`, `mandu.design.patch` |
31
+ | verify | `mandu.agent.verify`, `mandu.design.check`, `mandu.lint` |
32
+ | repair | `mandu.agent.repair` |
33
+
34
+ Allowed file edits:
35
+
36
+ - CSS files named in the plan, especially `app/globals.css`
37
+ - Component className changes scoped to the target UI
38
+ - Theme tokens only after inspecting the project's design source
39
+
40
+ Verification command:
41
+
42
+ ```bash
43
+ mandu agent verify --changed --json --write
44
+ ```
45
+
46
+ Common failures:
47
+
48
+ - Installing or changing styling stacks before checking the existing project style
49
+ - Editing broad theme tokens for a local component issue
50
+ - Skipping design/lint verification after Tailwind v4 syntax changes
51
+
52
+ Repair path:
53
+
54
+ ```bash
55
+ mandu agent repair --from .mandu/agent-verify.json --json
56
+ ```
57
+
58
+ ## 핵심 원칙
59
+
60
+ 1. **Zero-Runtime**: 빌드 타임 CSS 생성 (SSR 호환)
21
61
  2. **CSS-First**: JavaScript 설정 대신 CSS에서 테마 정의
22
62
  3. **Island 격리**: 컴포넌트 간 스타일 충돌 방지
23
63
  4. **Auto Integration**: Mandu가 Tailwind v4 자동 감지 및 빌드
@@ -29,9 +69,11 @@ Primary: Tailwind CSS v4 + clsx/tailwind-merge
29
69
  Alternative: CSS Modules (최소 의존성)
30
70
  ```
31
71
 
32
- ## 빠른 시작
33
-
34
- ### 1. 설치
72
+ ## Setup Examples
73
+
74
+ Use these examples only after `mandu.agent.plan` selects styling setup or migration.
75
+
76
+ ### 1. 설치
35
77
 
36
78
  ```bash
37
79
  bun add -d tailwindcss@^4.1 @tailwindcss/cli@^4.1
@@ -10,13 +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
- ## When to Apply
18
-
19
- 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:
20
59
  - Writing unit tests for slots
21
60
  - Testing Island components
22
61
  - Setting up E2E tests with Playwright
@@ -57,21 +96,15 @@ Reference these guidelines when:
57
96
  - `test-mock-fetch` - Mock fetch requests
58
97
  - `test-mock-database` - Mock database operations
59
98
 
60
- ## Bun Test Quick Start
61
-
62
- ```bash
63
- # Run all tests
64
- bun test
65
-
66
- # Run specific test file
67
- bun test src/slots/user.test.ts
68
-
69
- # Watch mode
70
- bun test --watch
71
-
72
- # Coverage
73
- bun test --coverage
74
- ```
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
+ ```
75
108
 
76
109
  ## Test File Convention
77
110