@mandujs/mcp 0.38.5 → 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
package/README.md
CHANGED
|
@@ -136,9 +136,9 @@ bunx @mandujs/mcp --root /path/to/project
|
|
|
136
136
|
|
|
137
137
|
### Semantic Slots (RFC-001) 🆕
|
|
138
138
|
|
|
139
|
-
| Tool | Description |
|
|
140
|
-
|------|-------------|
|
|
141
|
-
| `mandu_get_slot_constraints` | Get recommended slot constraint presets |
|
|
139
|
+
| Tool | Description |
|
|
140
|
+
|------|-------------|
|
|
141
|
+
| `mandu_get_slot_constraints` | Get recommended slot constraint presets |
|
|
142
142
|
|
|
143
143
|
### Architecture Negotiation (RFC-001) 🆕
|
|
144
144
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mandujs/mcp",
|
|
3
|
-
"version": "0.38.
|
|
3
|
+
"version": "0.38.7",
|
|
4
4
|
"description": "Mandu MCP Server - Agent-native interface for Mandu framework operations",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./src/index.ts",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"access": "public"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@mandujs/core": "^0.54.
|
|
37
|
+
"@mandujs/core": "^0.54.13",
|
|
38
38
|
"@mandujs/ate": "^0.26.1",
|
|
39
39
|
"@mandujs/skills": "^0.20.1",
|
|
40
40
|
"@modelcontextprotocol/sdk": "^1.25.3"
|
|
@@ -35,6 +35,23 @@ export interface McpErrorResponse {
|
|
|
35
35
|
export interface McpToolResponse {
|
|
36
36
|
content: Array<{ type: string; text: string }>;
|
|
37
37
|
isError?: boolean;
|
|
38
|
+
_meta?: McpResponseMeta;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export type McpNextActionKind = "none" | "inspect" | "verify" | "repair" | "retry";
|
|
42
|
+
|
|
43
|
+
export interface McpNextAction {
|
|
44
|
+
kind: McpNextActionKind;
|
|
45
|
+
reason: string;
|
|
46
|
+
command?: string;
|
|
47
|
+
tool?: string;
|
|
48
|
+
input?: unknown;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export interface McpResponseMeta {
|
|
52
|
+
toolName: string;
|
|
53
|
+
ok: boolean;
|
|
54
|
+
nextAction: McpNextAction;
|
|
38
55
|
}
|
|
39
56
|
|
|
40
57
|
/**
|
|
@@ -186,6 +203,51 @@ function isSoftErrorResult(result: unknown): boolean {
|
|
|
186
203
|
return false;
|
|
187
204
|
}
|
|
188
205
|
|
|
206
|
+
function inferNextAction(toolName: string, result: unknown, errorResponse?: McpErrorResponse): McpNextAction {
|
|
207
|
+
if (errorResponse) {
|
|
208
|
+
return {
|
|
209
|
+
kind: errorResponse.retryable ? "retry" : "repair",
|
|
210
|
+
reason: errorResponse.suggestion ?? errorResponse.error,
|
|
211
|
+
};
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
if (result && typeof result === "object") {
|
|
215
|
+
const obj = result as Record<string, unknown>;
|
|
216
|
+
if (isSoftErrorResult(result)) {
|
|
217
|
+
return { kind: "repair", reason: String(obj.error ?? "Tool returned an error result.") };
|
|
218
|
+
}
|
|
219
|
+
if (typeof obj.nextVerifyCommand === "string") {
|
|
220
|
+
return { kind: "verify", reason: "Tool returned an explicit verification command.", command: obj.nextVerifyCommand };
|
|
221
|
+
}
|
|
222
|
+
if (typeof obj.nextRepairInput === "string") {
|
|
223
|
+
return {
|
|
224
|
+
kind: "repair",
|
|
225
|
+
reason: "Tool returned a repair input artifact.",
|
|
226
|
+
command: `mandu agent repair --from ${obj.nextRepairInput}`,
|
|
227
|
+
input: obj.nextRepairInput,
|
|
228
|
+
};
|
|
229
|
+
}
|
|
230
|
+
if (obj.dryRun === true) {
|
|
231
|
+
return { kind: "inspect", reason: "Dry-run completed; review the preview before applying changes." };
|
|
232
|
+
}
|
|
233
|
+
if (Array.isArray(obj.nextSteps) && obj.nextSteps.length > 0) {
|
|
234
|
+
return { kind: "inspect", reason: "Tool returned follow-up steps.", input: obj.nextSteps };
|
|
235
|
+
}
|
|
236
|
+
if (typeof obj.tip === "string") {
|
|
237
|
+
return { kind: "inspect", reason: obj.tip };
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
return { kind: "none", reason: `${toolName} completed successfully.` };
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
function attachMeta(payload: unknown, meta: McpResponseMeta): unknown {
|
|
245
|
+
if (payload && typeof payload === "object" && !Array.isArray(payload)) {
|
|
246
|
+
return { ...(payload as Record<string, unknown>), _meta: meta };
|
|
247
|
+
}
|
|
248
|
+
return { data: payload, _meta: meta };
|
|
249
|
+
}
|
|
250
|
+
|
|
189
251
|
export function createToolResponse(
|
|
190
252
|
toolName: string,
|
|
191
253
|
result: unknown,
|
|
@@ -193,28 +255,40 @@ export function createToolResponse(
|
|
|
193
255
|
): McpToolResponse {
|
|
194
256
|
if (error) {
|
|
195
257
|
const errorResponse = formatMcpError(error, toolName);
|
|
258
|
+
const meta: McpResponseMeta = {
|
|
259
|
+
toolName,
|
|
260
|
+
ok: false,
|
|
261
|
+
nextAction: inferNextAction(toolName, null, errorResponse),
|
|
262
|
+
};
|
|
196
263
|
return {
|
|
197
264
|
content: [
|
|
198
265
|
{
|
|
199
266
|
type: "text",
|
|
200
|
-
text: JSON.stringify(errorResponse, null, 2),
|
|
267
|
+
text: JSON.stringify(attachMeta(errorResponse, meta), null, 2),
|
|
201
268
|
},
|
|
202
269
|
],
|
|
203
270
|
isError: true,
|
|
271
|
+
_meta: meta,
|
|
204
272
|
};
|
|
205
273
|
}
|
|
206
274
|
|
|
207
275
|
// Detect soft errors returned by handlers (e.g. { error: "Route not found" })
|
|
208
276
|
const softError = isSoftErrorResult(result);
|
|
277
|
+
const meta: McpResponseMeta = {
|
|
278
|
+
toolName,
|
|
279
|
+
ok: !softError,
|
|
280
|
+
nextAction: inferNextAction(toolName, result),
|
|
281
|
+
};
|
|
209
282
|
|
|
210
283
|
return {
|
|
211
284
|
content: [
|
|
212
285
|
{
|
|
213
286
|
type: "text",
|
|
214
|
-
text: JSON.stringify(result, null, 2),
|
|
287
|
+
text: JSON.stringify(attachMeta(result, meta), null, 2),
|
|
215
288
|
},
|
|
216
289
|
],
|
|
217
290
|
...(softError && { isError: true }),
|
|
291
|
+
_meta: meta,
|
|
218
292
|
};
|
|
219
293
|
}
|
|
220
294
|
|
package/src/index.ts
CHANGED
|
@@ -86,11 +86,11 @@ export {
|
|
|
86
86
|
// Profile exports
|
|
87
87
|
export {
|
|
88
88
|
type McpProfile,
|
|
89
|
-
PROFILE_CATEGORIES,
|
|
90
|
-
getProfileCategories,
|
|
91
|
-
isValidProfile,
|
|
92
|
-
resolveMcpProfile,
|
|
93
|
-
} from "./profiles.js";
|
|
89
|
+
PROFILE_CATEGORIES,
|
|
90
|
+
getProfileCategories,
|
|
91
|
+
isValidProfile,
|
|
92
|
+
resolveMcpProfile,
|
|
93
|
+
} from "./profiles.js";
|
|
94
94
|
|
|
95
95
|
// CLI entry point
|
|
96
96
|
import { startServer } from "./server.js";
|
package/src/prompts.ts
CHANGED
|
@@ -48,10 +48,10 @@ Follow these steps using Mandu MCP tools:
|
|
|
48
48
|
1. Read current route manifest: Resource mandu://routes
|
|
49
49
|
2. Read project config: Resource mandu://config
|
|
50
50
|
3. Negotiate the feature spec: Tool mandu.negotiate
|
|
51
|
-
4. Generate scaffold: Tool mandu.negotiate.scaffold
|
|
52
|
-
5. If client interactivity needed, create island: Tool mandu_create_island
|
|
53
|
-
Use @mandujs/core/client with wrapComponent(Component) or island({ setup, render })
|
|
54
|
-
6. If data requirements exist, create slot: Tool mandu_create_slot
|
|
51
|
+
4. Generate scaffold: Tool mandu.negotiate.scaffold
|
|
52
|
+
5. If client interactivity needed, create island: Tool mandu_create_island
|
|
53
|
+
Use @mandujs/core/client with wrapComponent(Component) or island({ setup, render })
|
|
54
|
+
6. If data requirements exist, create slot: Tool mandu_create_slot
|
|
55
55
|
Slots are server-side data loaders that run before render
|
|
56
56
|
7. If API is exposed, define contract: Tool mandu_create_contract
|
|
57
57
|
Contracts are Zod schemas for validation and OpenAPI generation
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import type { Resource } from "@modelcontextprotocol/sdk/types.js";
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
type GeneratedMap,
|
|
7
|
-
} from "@mandujs/core";
|
|
2
|
+
import { loadManifest } from "@mandujs/core";
|
|
3
|
+
import { getTransactionStatus } from "@mandujs/core/change";
|
|
4
|
+
import type { GeneratedMap } from "@mandujs/core/generator";
|
|
5
|
+
import { getWatcher } from "@mandujs/core/watcher";
|
|
8
6
|
import { getProjectPaths, readJsonFile } from "../utils/project.js";
|
|
9
7
|
import {
|
|
10
8
|
getGuide,
|
|
@@ -377,21 +377,21 @@ Island Hydration은 페이지의 일부분만 클라이언트에서 인터랙티
|
|
|
377
377
|
| \`idle\` | 브라우저 유휴 시 | 비중요 기능 |
|
|
378
378
|
| \`interaction\` | 사용자 상호작용 시 | 클릭해야 활성화 |
|
|
379
379
|
|
|
380
|
-
## Inline client region 만들기
|
|
381
|
-
|
|
382
|
-
### 1. 클라이언트 컴포넌트 작성
|
|
383
|
-
|
|
384
|
-
\`\`\`tsx
|
|
385
|
-
// app/counter/client.tsx
|
|
386
|
-
|
|
387
|
-
"use client";
|
|
388
|
-
|
|
389
|
-
import { useState } from "react";
|
|
390
|
-
|
|
391
|
-
export function Counter({ initial = 0 }: { initial?: number }) {
|
|
392
|
-
const [count, setCount] = useState(initial);
|
|
393
|
-
|
|
394
|
-
return (
|
|
380
|
+
## Inline client region 만들기
|
|
381
|
+
|
|
382
|
+
### 1. 클라이언트 컴포넌트 작성
|
|
383
|
+
|
|
384
|
+
\`\`\`tsx
|
|
385
|
+
// app/counter/client.tsx
|
|
386
|
+
|
|
387
|
+
"use client";
|
|
388
|
+
|
|
389
|
+
import { useState } from "react";
|
|
390
|
+
|
|
391
|
+
export function Counter({ initial = 0 }: { initial?: number }) {
|
|
392
|
+
const [count, setCount] = useState(initial);
|
|
393
|
+
|
|
394
|
+
return (
|
|
395
395
|
<div>
|
|
396
396
|
<p>Count: {count}</p>
|
|
397
397
|
<button onClick={() => setCount(c => c - 1)}>-</button>
|
|
@@ -399,43 +399,43 @@ export function Counter({ initial = 0 }: { initial?: number }) {
|
|
|
399
399
|
</div>
|
|
400
400
|
);
|
|
401
401
|
}
|
|
402
|
-
\`\`\`
|
|
403
|
-
|
|
404
|
-
### 2. 서버 페이지에서 partial로 사용
|
|
405
|
-
|
|
406
|
-
\`\`\`tsx
|
|
407
|
-
// app/counter/page.tsx
|
|
408
|
-
|
|
409
|
-
import { partial } from "@mandujs/core/client";
|
|
410
|
-
import { Counter } from "./client";
|
|
411
|
-
|
|
412
|
-
const CounterPartial = partial({
|
|
413
|
-
component: Counter,
|
|
414
|
-
priority: "visible",
|
|
415
|
-
});
|
|
416
|
-
|
|
417
|
-
export default function CounterPage() {
|
|
418
|
-
return (
|
|
402
|
+
\`\`\`
|
|
403
|
+
|
|
404
|
+
### 2. 서버 페이지에서 partial로 사용
|
|
405
|
+
|
|
406
|
+
\`\`\`tsx
|
|
407
|
+
// app/counter/page.tsx
|
|
408
|
+
|
|
409
|
+
import { partial } from "@mandujs/core/client";
|
|
410
|
+
import { Counter } from "./client";
|
|
411
|
+
|
|
412
|
+
const CounterPartial = partial({
|
|
413
|
+
component: Counter,
|
|
414
|
+
priority: "visible",
|
|
415
|
+
});
|
|
416
|
+
|
|
417
|
+
export default function CounterPage() {
|
|
418
|
+
return (
|
|
419
419
|
<div>
|
|
420
420
|
<h1>Counter Demo</h1>
|
|
421
421
|
<p>이 텍스트는 정적 HTML입니다.</p>
|
|
422
|
-
|
|
423
|
-
{/* 이 부분만 hydration됩니다 */}
|
|
424
|
-
<CounterPartial.Render initial={10} />
|
|
425
|
-
</div>
|
|
426
|
-
);
|
|
427
|
-
}
|
|
428
|
-
\`\`\`
|
|
429
|
-
|
|
430
|
-
## Mandu.island() API
|
|
431
|
-
|
|
432
|
-
고급 page-level Island 패턴을 위한 API입니다. \`Mandu.island()\`는 단일
|
|
433
|
-
정의 객체만 받습니다. \`island("visible", Component)\` 형태는 지원하지
|
|
434
|
-
않으며, 서버 페이지 안에 inline으로 렌더링할 영역은 \`partial()\`을
|
|
435
|
-
사용하세요.
|
|
436
|
-
|
|
437
|
-
\`\`\`typescript
|
|
438
|
-
// spec/slots/todos.client.ts
|
|
422
|
+
|
|
423
|
+
{/* 이 부분만 hydration됩니다 */}
|
|
424
|
+
<CounterPartial.Render initial={10} />
|
|
425
|
+
</div>
|
|
426
|
+
);
|
|
427
|
+
}
|
|
428
|
+
\`\`\`
|
|
429
|
+
|
|
430
|
+
## Mandu.island() API
|
|
431
|
+
|
|
432
|
+
고급 page-level Island 패턴을 위한 API입니다. \`Mandu.island()\`는 단일
|
|
433
|
+
정의 객체만 받습니다. \`island("visible", Component)\` 형태는 지원하지
|
|
434
|
+
않으며, 서버 페이지 안에 inline으로 렌더링할 영역은 \`partial()\`을
|
|
435
|
+
사용하세요.
|
|
436
|
+
|
|
437
|
+
\`\`\`typescript
|
|
438
|
+
// spec/slots/todos.client.ts
|
|
439
439
|
|
|
440
440
|
import { Mandu } from "@mandujs/core/client";
|
|
441
441
|
import { useState, useCallback } from "react";
|
|
@@ -27,11 +27,11 @@ export interface RuleMeta {
|
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
// Available skills
|
|
30
|
-
const SKILL_IDS = [
|
|
31
|
-
"mandu-agent-workflow",
|
|
32
|
-
"mandu-slot",
|
|
33
|
-
"mandu-fs-routes",
|
|
34
|
-
"mandu-hydration",
|
|
30
|
+
const SKILL_IDS = [
|
|
31
|
+
"mandu-agent-workflow",
|
|
32
|
+
"mandu-slot",
|
|
33
|
+
"mandu-fs-routes",
|
|
34
|
+
"mandu-hydration",
|
|
35
35
|
"mandu-guard",
|
|
36
36
|
"mandu-performance",
|
|
37
37
|
"mandu-composition",
|
|
@@ -95,9 +95,9 @@ export function listSkills(): SkillMeta[] {
|
|
|
95
95
|
}
|
|
96
96
|
|
|
97
97
|
function getSkillDescription(id: string): string {
|
|
98
|
-
const descriptions: Record<string, string> = {
|
|
99
|
-
"mandu-agent-workflow": "Canonical context -> plan -> apply -> verify -> repair workflow for Mandu agents",
|
|
100
|
-
"mandu-slot": "Business logic with Mandu.filling() API",
|
|
98
|
+
const descriptions: Record<string, string> = {
|
|
99
|
+
"mandu-agent-workflow": "Canonical context -> plan -> apply -> verify -> repair workflow for Mandu agents",
|
|
100
|
+
"mandu-slot": "Business logic with Mandu.filling() API",
|
|
101
101
|
"mandu-fs-routes": "File-system based routing patterns",
|
|
102
102
|
"mandu-hydration": "Island hydration and client components",
|
|
103
103
|
"mandu-guard": "Architecture enforcement and layer dependencies",
|
|
@@ -1,124 +1,124 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: mandu-agent-workflow
|
|
3
|
-
description: |
|
|
4
|
-
Canonical Mandu agent workflow. Use first in Mandu projects before direct
|
|
5
|
-
source edits so Codex, Claude Code, Gemini CLI, and other agents follow the
|
|
6
|
-
same context -> plan -> apply -> verify -> repair loop.
|
|
7
|
-
license: MIT
|
|
8
|
-
metadata:
|
|
9
|
-
author: mandu
|
|
10
|
-
version: "1.0.0"
|
|
11
|
-
---
|
|
12
|
-
|
|
13
|
-
# Mandu Agent Workflow
|
|
14
|
-
|
|
15
|
-
Mandu is an agent-native fullstack framework. Agents should not begin by
|
|
16
|
-
guessing file structure or calling low-level tools directly. Start with the
|
|
17
|
-
official agent surface, then use domain tools only when the plan identifies a
|
|
18
|
-
specific domain.
|
|
19
|
-
|
|
20
|
-
## When to Use
|
|
21
|
-
|
|
22
|
-
Use this skill for every Mandu project task that may inspect, create, modify, or
|
|
23
|
-
verify application code, framework configuration, contracts, slots, islands, or
|
|
24
|
-
deployment artifacts.
|
|
25
|
-
|
|
26
|
-
## Canonical Workflow
|
|
27
|
-
|
|
28
|
-
Always follow this loop:
|
|
29
|
-
|
|
30
|
-
```text
|
|
31
|
-
context -> plan -> apply -> verify -> repair
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
1. `context`: read the project map.
|
|
35
|
-
2. `plan`: convert the user request into domains, files, risks, and checks.
|
|
36
|
-
3. `apply`: prefer intent-level MCP/domain tools; direct edits must be grounded
|
|
37
|
-
in the plan.
|
|
38
|
-
4. `verify`: run the single agent-facing verification report.
|
|
39
|
-
5. `repair`: convert failures into next actions, then verify again.
|
|
40
|
-
|
|
41
|
-
## Preferred MCP Tools
|
|
42
|
-
|
|
43
|
-
Use these first when MCP is available:
|
|
44
|
-
|
|
45
|
-
| Step | Tool | Purpose |
|
|
46
|
-
|------|------|---------|
|
|
47
|
-
| context | `mandu.agent.context` | Project map, routes, APIs, slots, contracts, guard, diagnostics. |
|
|
48
|
-
| plan | `mandu.agent.plan` | Deterministic task plan with domains, files, tools, risks. |
|
|
49
|
-
| apply | `mandu.agent.apply` | Ordered action preview from `.mandu/agent-plan.json`. |
|
|
50
|
-
| verify | `mandu.agent.verify` | Unified post-change guard/diagnose/contract report. |
|
|
51
|
-
| repair | `mandu.agent.repair` | Structured next actions from `.mandu/agent-verify.json`. |
|
|
52
|
-
|
|
53
|
-
If MCP is unavailable, use the CLI equivalents:
|
|
54
|
-
|
|
55
|
-
```bash
|
|
56
|
-
mandu agent context --json
|
|
57
|
-
mandu agent plan "<task>" --json --write
|
|
58
|
-
mandu agent apply --from .mandu/agent-plan.json --json
|
|
59
|
-
mandu agent verify --changed --json --write
|
|
60
|
-
mandu agent repair --from .mandu/agent-verify.json --json
|
|
61
|
-
```
|
|
62
|
-
|
|
63
|
-
## Allowed File Edits
|
|
64
|
-
|
|
65
|
-
Direct file edits are allowed only after `plan` identifies the relevant domain
|
|
66
|
-
and the agent has inspected the local pattern. Prefer MCP/domain generation for:
|
|
67
|
-
|
|
68
|
-
- pages, layouts, and API routes
|
|
69
|
-
- contracts and OpenAPI-related files
|
|
70
|
-
- slots and fillings
|
|
71
|
-
- islands, partials, and hydration boundaries
|
|
72
|
-
- deploy intent and provider artifacts
|
|
73
|
-
|
|
74
|
-
Do not use destructive cleanup, cache removal, deploy execution, or broad
|
|
75
|
-
refactors without an explicit plan and verification path.
|
|
76
|
-
|
|
77
|
-
## Domain Skill Escalation
|
|
78
|
-
|
|
79
|
-
Read the matching domain skill when `mandu.agent.plan` includes that domain:
|
|
80
|
-
|
|
81
|
-
| Domain | Skill |
|
|
82
|
-
|--------|-------|
|
|
83
|
-
| route/api | `mandu-fs-routes` |
|
|
84
|
-
| hydration/island/partial | `mandu-hydration` |
|
|
85
|
-
| slot/filling | `mandu-slot` |
|
|
86
|
-
| guard/import boundary | `mandu-guard` |
|
|
87
|
-
| test/e2e/ATE | `mandu-testing` |
|
|
88
|
-
| deploy | `mandu-deployment` |
|
|
89
|
-
| security/auth/session | `mandu-security` |
|
|
90
|
-
| styling/ui/design | `mandu-styling`, `mandu-ui`, `mandu-composition` |
|
|
91
|
-
| performance | `mandu-performance` |
|
|
92
|
-
|
|
93
|
-
Domain skills are addenda. They must not replace the canonical workflow.
|
|
94
|
-
|
|
95
|
-
## Verification Command
|
|
96
|
-
|
|
97
|
-
Every code-changing task should end with:
|
|
98
|
-
|
|
99
|
-
```bash
|
|
100
|
-
mandu agent verify --changed --json --write
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
Run additional commands listed in the plan or verify report, usually
|
|
104
|
-
`bun run typecheck` and targeted `bun test` commands.
|
|
105
|
-
|
|
106
|
-
## Repair Path
|
|
107
|
-
|
|
108
|
-
When verify fails:
|
|
109
|
-
|
|
110
|
-
```bash
|
|
111
|
-
mandu agent repair --from .mandu/agent-verify.json --json
|
|
112
|
-
```
|
|
113
|
-
|
|
114
|
-
Apply only actions that are explicitly safe and scoped. After any repair, run
|
|
115
|
-
`mandu agent verify --changed --json --write` again.
|
|
116
|
-
|
|
117
|
-
## Common Failures
|
|
118
|
-
|
|
119
|
-
- Skipping context and editing the wrong route or contract path.
|
|
120
|
-
- Calling low-level Guard, Doctor, Fix, ATE, or deploy tools before a plan.
|
|
121
|
-
- Treating a domain skill as the full workflow.
|
|
122
|
-
- Ending a task after tests without writing or reading the agent verify report.
|
|
123
|
-
- Applying broad file changes when `agent.apply` only produced a dry-run action
|
|
124
|
-
report.
|
|
1
|
+
---
|
|
2
|
+
name: mandu-agent-workflow
|
|
3
|
+
description: |
|
|
4
|
+
Canonical Mandu agent workflow. Use first in Mandu projects before direct
|
|
5
|
+
source edits so Codex, Claude Code, Gemini CLI, and other agents follow the
|
|
6
|
+
same context -> plan -> apply -> verify -> repair loop.
|
|
7
|
+
license: MIT
|
|
8
|
+
metadata:
|
|
9
|
+
author: mandu
|
|
10
|
+
version: "1.0.0"
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# Mandu Agent Workflow
|
|
14
|
+
|
|
15
|
+
Mandu is an agent-native fullstack framework. Agents should not begin by
|
|
16
|
+
guessing file structure or calling low-level tools directly. Start with the
|
|
17
|
+
official agent surface, then use domain tools only when the plan identifies a
|
|
18
|
+
specific domain.
|
|
19
|
+
|
|
20
|
+
## When to Use
|
|
21
|
+
|
|
22
|
+
Use this skill for every Mandu project task that may inspect, create, modify, or
|
|
23
|
+
verify application code, framework configuration, contracts, slots, islands, or
|
|
24
|
+
deployment artifacts.
|
|
25
|
+
|
|
26
|
+
## Canonical Workflow
|
|
27
|
+
|
|
28
|
+
Always follow this loop:
|
|
29
|
+
|
|
30
|
+
```text
|
|
31
|
+
context -> plan -> apply -> verify -> repair
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
1. `context`: read the project map.
|
|
35
|
+
2. `plan`: convert the user request into domains, files, risks, and checks.
|
|
36
|
+
3. `apply`: prefer intent-level MCP/domain tools; direct edits must be grounded
|
|
37
|
+
in the plan.
|
|
38
|
+
4. `verify`: run the single agent-facing verification report.
|
|
39
|
+
5. `repair`: convert failures into next actions, then verify again.
|
|
40
|
+
|
|
41
|
+
## Preferred MCP Tools
|
|
42
|
+
|
|
43
|
+
Use these first when MCP is available:
|
|
44
|
+
|
|
45
|
+
| Step | Tool | Purpose |
|
|
46
|
+
|------|------|---------|
|
|
47
|
+
| context | `mandu.agent.context` | Project map, routes, APIs, slots, contracts, guard, diagnostics. |
|
|
48
|
+
| plan | `mandu.agent.plan` | Deterministic task plan with domains, files, tools, risks. |
|
|
49
|
+
| apply | `mandu.agent.apply` | Ordered action preview from `.mandu/agent-plan.json`. |
|
|
50
|
+
| verify | `mandu.agent.verify` | Unified post-change guard/diagnose/contract report. |
|
|
51
|
+
| repair | `mandu.agent.repair` | Structured next actions from `.mandu/agent-verify.json`. |
|
|
52
|
+
|
|
53
|
+
If MCP is unavailable, use the CLI equivalents:
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
mandu agent context --json
|
|
57
|
+
mandu agent plan "<task>" --json --write
|
|
58
|
+
mandu agent apply --from .mandu/agent-plan.json --json
|
|
59
|
+
mandu agent verify --changed --json --write
|
|
60
|
+
mandu agent repair --from .mandu/agent-verify.json --json
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## Allowed File Edits
|
|
64
|
+
|
|
65
|
+
Direct file edits are allowed only after `plan` identifies the relevant domain
|
|
66
|
+
and the agent has inspected the local pattern. Prefer MCP/domain generation for:
|
|
67
|
+
|
|
68
|
+
- pages, layouts, and API routes
|
|
69
|
+
- contracts and OpenAPI-related files
|
|
70
|
+
- slots and fillings
|
|
71
|
+
- islands, partials, and hydration boundaries
|
|
72
|
+
- deploy intent and provider artifacts
|
|
73
|
+
|
|
74
|
+
Do not use destructive cleanup, cache removal, deploy execution, or broad
|
|
75
|
+
refactors without an explicit plan and verification path.
|
|
76
|
+
|
|
77
|
+
## Domain Skill Escalation
|
|
78
|
+
|
|
79
|
+
Read the matching domain skill when `mandu.agent.plan` includes that domain:
|
|
80
|
+
|
|
81
|
+
| Domain | Skill |
|
|
82
|
+
|--------|-------|
|
|
83
|
+
| route/api | `mandu-fs-routes` |
|
|
84
|
+
| hydration/island/partial | `mandu-hydration` |
|
|
85
|
+
| slot/filling | `mandu-slot` |
|
|
86
|
+
| guard/import boundary | `mandu-guard` |
|
|
87
|
+
| test/e2e/ATE | `mandu-testing` |
|
|
88
|
+
| deploy | `mandu-deployment` |
|
|
89
|
+
| security/auth/session | `mandu-security` |
|
|
90
|
+
| styling/ui/design | `mandu-styling`, `mandu-ui`, `mandu-composition` |
|
|
91
|
+
| performance | `mandu-performance` |
|
|
92
|
+
|
|
93
|
+
Domain skills are addenda. They must not replace the canonical workflow.
|
|
94
|
+
|
|
95
|
+
## Verification Command
|
|
96
|
+
|
|
97
|
+
Every code-changing task should end with:
|
|
98
|
+
|
|
99
|
+
```bash
|
|
100
|
+
mandu agent verify --changed --json --write
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
Run additional commands listed in the plan or verify report, usually
|
|
104
|
+
`bun run typecheck` and targeted `bun test` commands.
|
|
105
|
+
|
|
106
|
+
## Repair Path
|
|
107
|
+
|
|
108
|
+
When verify fails:
|
|
109
|
+
|
|
110
|
+
```bash
|
|
111
|
+
mandu agent repair --from .mandu/agent-verify.json --json
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
Apply only actions that are explicitly safe and scoped. After any repair, run
|
|
115
|
+
`mandu agent verify --changed --json --write` again.
|
|
116
|
+
|
|
117
|
+
## Common Failures
|
|
118
|
+
|
|
119
|
+
- Skipping context and editing the wrong route or contract path.
|
|
120
|
+
- Calling low-level Guard, Doctor, Fix, ATE, or deploy tools before a plan.
|
|
121
|
+
- Treating a domain skill as the full workflow.
|
|
122
|
+
- Ending a task after tests without writing or reading the agent verify report.
|
|
123
|
+
- Applying broad file changes when `agent.apply` only produced a dry-run action
|
|
124
|
+
report.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": "1.0.0",
|
|
3
|
-
"organization": "Mandu Framework",
|
|
4
|
-
"date": "May 2026",
|
|
5
|
-
"abstract": "Canonical Mandu agent workflow for Codex, Claude Code, Gemini CLI, and other coding agents. Establishes context -> plan -> apply -> verify -> repair as the default loop and routes domain work through focused Mandu skills and MCP tools.",
|
|
6
|
-
"tags": ["agent", "workflow", "mcp", "skills", "mandu"]
|
|
7
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"version": "1.0.0",
|
|
3
|
+
"organization": "Mandu Framework",
|
|
4
|
+
"date": "May 2026",
|
|
5
|
+
"abstract": "Canonical Mandu agent workflow for Codex, Claude Code, Gemini CLI, and other coding agents. Establishes context -> plan -> apply -> verify -> repair as the default loop and routes domain work through focused Mandu skills and MCP tools.",
|
|
6
|
+
"tags": ["agent", "workflow", "mcp", "skills", "mandu"]
|
|
7
|
+
}
|