multi-model-flow 0.1.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.
Files changed (46) hide show
  1. package/.claude/commands/mmf-analyze.md +49 -0
  2. package/.claude/commands/mmf-codex.md +51 -0
  3. package/.claude/commands/mmf-gemini.md +51 -0
  4. package/.claude/commands/mmf-review.md +53 -0
  5. package/.claude/commands/mmf-workflow.md +104 -0
  6. package/.claude/skills/codex-task/SKILL.md +59 -0
  7. package/.claude/skills/gemini-task/SKILL.md +59 -0
  8. package/.claude/skills/multi-model-task/SKILL.md +94 -0
  9. package/CLAUDE.md +60 -0
  10. package/dist/cli.d.ts +3 -0
  11. package/dist/cli.d.ts.map +1 -0
  12. package/dist/cli.js +183 -0
  13. package/dist/cli.js.map +1 -0
  14. package/dist/client.d.ts +4 -0
  15. package/dist/client.d.ts.map +1 -0
  16. package/dist/client.js +20 -0
  17. package/dist/client.js.map +1 -0
  18. package/dist/completion.d.ts +15 -0
  19. package/dist/completion.d.ts.map +1 -0
  20. package/dist/completion.js +86 -0
  21. package/dist/completion.js.map +1 -0
  22. package/dist/config.d.ts +5 -0
  23. package/dist/config.d.ts.map +1 -0
  24. package/dist/config.js +64 -0
  25. package/dist/config.js.map +1 -0
  26. package/dist/errors.d.ts +3 -0
  27. package/dist/errors.d.ts.map +1 -0
  28. package/dist/errors.js +35 -0
  29. package/dist/errors.js.map +1 -0
  30. package/dist/index.d.ts +3 -0
  31. package/dist/index.d.ts.map +1 -0
  32. package/dist/index.js +187 -0
  33. package/dist/index.js.map +1 -0
  34. package/dist/session.d.ts +18 -0
  35. package/dist/session.d.ts.map +1 -0
  36. package/dist/session.js +67 -0
  37. package/dist/session.js.map +1 -0
  38. package/dist/task.d.ts +19 -0
  39. package/dist/task.d.ts.map +1 -0
  40. package/dist/task.js +138 -0
  41. package/dist/task.js.map +1 -0
  42. package/dist/types.d.ts +86 -0
  43. package/dist/types.d.ts.map +1 -0
  44. package/dist/types.js +2 -0
  45. package/dist/types.js.map +1 -0
  46. package/package.json +48 -0
@@ -0,0 +1,49 @@
1
+ ---
2
+ description: "Parallel analysis: ace-tool retrieval + dual-model analysis (Codex backend + Gemini frontend)"
3
+ ---
4
+
5
+ # Parallel Multi-Model Analysis
6
+
7
+ You are performing a parallel analysis using code retrieval and dual-model insights.
8
+
9
+ ## Step 1: Retrieve Context
10
+
11
+ ```
12
+ mcp__ace-tool__codebase-retrieval({ information_request: "<describe what to analyze>", directory_path: "<project root>" })
13
+ ```
14
+
15
+ Optionally search for technical references:
16
+ ```
17
+ mcp__grok-search__web_search({ query: "<relevant technical query>" })
18
+ ```
19
+ Fallback to context7 if grok-search fails.
20
+
21
+ ## Step 2: Submit Parallel Analysis
22
+
23
+ ### Codex Analysis
24
+ ```
25
+ mcp__workflow__task_submit({
26
+ prompt: "Analyze the following code/requirement from a backend perspective:\n$CONTEXT\n\nProvide: architecture assessment, improvement suggestions, risk analysis.",
27
+ domain: "backend"
28
+ })
29
+ ```
30
+
31
+ ### Gemini Analysis
32
+ ```
33
+ mcp__workflow__task_submit({
34
+ prompt: "Analyze the following code/requirement from a frontend perspective:\n$CONTEXT\n\nProvide: UX assessment, component analysis, design recommendations.",
35
+ domain: "frontend"
36
+ })
37
+ ```
38
+
39
+ ## Step 3: Poll and Collect
40
+
41
+ Poll both tasks every 15-30 seconds using `task_status`. Retrieve results with `task_result` when complete.
42
+
43
+ ## Step 4: Synthesize
44
+
45
+ Present a unified analysis:
46
+ - **Consensus**: Points both models agree on
47
+ - **Backend insights**: Codex-specific findings (architecture, security, performance)
48
+ - **Frontend insights**: Gemini-specific findings (UX, accessibility, design)
49
+ - **Recommendations**: Prioritized action items
@@ -0,0 +1,51 @@
1
+ ---
2
+ description: "Ask Codex (OpenAI) to analyze code, generate diffs, or answer backend questions"
3
+ ---
4
+
5
+ # Codex Task
6
+
7
+ You are delegating a task to Codex (OpenAI). Codex specializes in backend logic, architecture, security, and performance.
8
+
9
+ ## Step 1: Collect Context
10
+
11
+ If the task involves existing code, retrieve context first:
12
+ ```
13
+ mcp__ace-tool__codebase-retrieval({ information_request: "<describe relevant code>", directory_path: "<project root>" })
14
+ ```
15
+
16
+ ## Step 2: Determine Task Length
17
+
18
+ ### Quick task (simple question, short analysis)
19
+ Use synchronous `chat`:
20
+ ```
21
+ mcp__workflow__chat({
22
+ prompt: "<user's request>\n\nContext:\n<code context>",
23
+ domain: "backend"
24
+ })
25
+ ```
26
+
27
+ ### Long task (deep analysis, large codebase review, diff generation)
28
+ Use async `task_submit`:
29
+ ```
30
+ mcp__workflow__task_submit({
31
+ prompt: "<user's request>\n\nContext:\n<code context>",
32
+ domain: "backend"
33
+ })
34
+ ```
35
+ Then poll with `task_status` every 15-30 seconds until complete. Retrieve with `task_result`.
36
+
37
+ ## Step 3: Multi-turn Follow-up
38
+
39
+ To continue the conversation, pass the `session_id` from the previous response:
40
+ ```
41
+ mcp__workflow__chat({
42
+ prompt: "<follow-up question>",
43
+ session_id: "<session_id from previous call>"
44
+ })
45
+ ```
46
+
47
+ ## Result Handling
48
+
49
+ - Present as "Codex analysis:"
50
+ - Preserve all code blocks and Unified Diff patches
51
+ - Never auto-apply changes — ask user for confirmation first
@@ -0,0 +1,51 @@
1
+ ---
2
+ description: "Ask Gemini to analyze UI/UX, frontend architecture, or design questions"
3
+ ---
4
+
5
+ # Gemini Task
6
+
7
+ You are delegating a task to Gemini. Gemini specializes in frontend, UI/UX design, component architecture, and accessibility.
8
+
9
+ ## Step 1: Collect Context
10
+
11
+ If the task involves existing code, retrieve context first:
12
+ ```
13
+ mcp__ace-tool__codebase-retrieval({ information_request: "<describe relevant code>", directory_path: "<project root>" })
14
+ ```
15
+
16
+ ## Step 2: Determine Task Length
17
+
18
+ ### Quick task (simple question, short analysis)
19
+ Use synchronous `chat`:
20
+ ```
21
+ mcp__workflow__chat({
22
+ prompt: "<user's request>\n\nContext:\n<code context>",
23
+ domain: "frontend"
24
+ })
25
+ ```
26
+
27
+ ### Long task (deep analysis, large component review, diff generation)
28
+ Use async `task_submit`:
29
+ ```
30
+ mcp__workflow__task_submit({
31
+ prompt: "<user's request>\n\nContext:\n<code context>",
32
+ domain: "frontend"
33
+ })
34
+ ```
35
+ Then poll with `task_status` every 15-30 seconds until complete. Retrieve with `task_result`.
36
+
37
+ ## Step 3: Multi-turn Follow-up
38
+
39
+ To continue the conversation, pass the `session_id` from the previous response:
40
+ ```
41
+ mcp__workflow__chat({
42
+ prompt: "<follow-up question>",
43
+ session_id: "<session_id from previous call>"
44
+ })
45
+ ```
46
+
47
+ ## Result Handling
48
+
49
+ - Present as "Gemini analysis:"
50
+ - Preserve all code blocks and Unified Diff patches
51
+ - Never auto-apply changes — ask user for confirmation first
@@ -0,0 +1,53 @@
1
+ ---
2
+ description: "Dual-model code review: Codex (logic/security) + Gemini (UI/accessibility) in parallel"
3
+ ---
4
+
5
+ # Dual-Model Code Review
6
+
7
+ You are performing a parallel code review using both Codex and Gemini.
8
+
9
+ ## Step 1: Collect Review Context
10
+
11
+ Use ace-tool to retrieve the code to review:
12
+ ```
13
+ mcp__ace-tool__codebase-retrieval({ information_request: "<describe the code to review>", directory_path: "<project root>" })
14
+ ```
15
+
16
+ Also gather the git diff if applicable (use `git diff` or `git diff --staged`).
17
+
18
+ ## Step 2: Submit Parallel Reviews
19
+
20
+ ### Codex Review (Logic + Security + Performance)
21
+ ```
22
+ mcp__workflow__task_submit({
23
+ prompt: "Review the following code. Focus on:\n1. Logic bugs and edge cases\n2. Security vulnerabilities\n3. Performance issues\n4. Error handling gaps\n\nRate each finding: Critical / Major / Minor / Suggestion\nInclude specific line numbers.\n\nCode:\n$CODE",
24
+ domain: "review"
25
+ })
26
+ ```
27
+
28
+ ### Gemini Review (UI + Accessibility + Design)
29
+ ```
30
+ mcp__workflow__task_submit({
31
+ prompt: "Review the following code. Focus on:\n1. UI/UX consistency\n2. Accessibility compliance\n3. Responsive design issues\n4. Component architecture\n\nRate each finding: Critical / Major / Minor / Suggestion\nInclude specific line numbers.\n\nCode:\n$CODE",
32
+ domain: "frontend"
33
+ })
34
+ ```
35
+
36
+ ## Step 3: Poll Progress
37
+
38
+ Poll both tasks every 15-30 seconds using `task_status`. When complete, retrieve with `task_result`.
39
+
40
+ ## Step 4: Synthesize Review
41
+
42
+ Merge findings from both reviewers:
43
+ - Deduplicate overlapping findings
44
+ - Backend/logic findings → trust Codex
45
+ - Frontend/UI findings → trust Gemini
46
+ - Present unified review with severity ratings
47
+
48
+ ## Step 5: Apply Fixes (if requested)
49
+
50
+ If the user wants fixes applied:
51
+ 1. Address Critical and Major findings first
52
+ 2. Apply changes using Claude's file editing tools
53
+ 3. Re-run review on changed files if needed
@@ -0,0 +1,104 @@
1
+ ---
2
+ description: "Multi-model workflow: ace-tool retrieval + grok search + Codex/Gemini parallel analysis"
3
+ ---
4
+
5
+ # Multi-Model Collaborative Workflow
6
+
7
+ You are orchestrating a multi-model collaborative workflow. Follow these phases strictly.
8
+
9
+ ## Core Protocol
10
+
11
+ - **Code Sovereignty**: External models (Codex/Gemini) have ZERO file write permission. They return analysis and Unified Diff patches only. YOU (Claude) are the sole code executor.
12
+ - **Trust Rules**: Backend logic → trust Codex. Frontend/UI → trust Gemini.
13
+ - **Language**: Respond in the same language as the user's input.
14
+
15
+ ## Phase 1: Research [模式:研究]
16
+
17
+ ### 1.1 Code Retrieval
18
+ Use ace-tool to retrieve relevant code context:
19
+ ```
20
+ mcp__ace-tool__codebase-retrieval({ information_request: "<describe what code is relevant>", directory_path: "<project root>" })
21
+ ```
22
+
23
+ ### 1.2 Web Search
24
+ Search for technical references using grok-search:
25
+ ```
26
+ mcp__grok-search__web_search({ query: "<technical search query>" })
27
+ ```
28
+
29
+ **Fallback**: If grok-search fails or is unavailable, use context7:
30
+ ```
31
+ mcp__plugin_context7_context7__resolve-library-id({ libraryName: "<library>" })
32
+ mcp__plugin_context7_context7__query-docs({ context7CompatibleLibraryID: "<id>", topic: "<topic>" })
33
+ ```
34
+
35
+ ### 1.3 Completeness Check
36
+ Before proceeding, verify you have:
37
+ - [ ] Relevant source code context
38
+ - [ ] Technical references (if needed)
39
+ - [ ] Clear understanding of the user's requirements
40
+
41
+ ## Phase 2: Parallel Analysis [模式:分析]
42
+
43
+ Submit tasks to BOTH models in parallel using `task_submit`:
44
+
45
+ ### Backend Analysis (Codex)
46
+ ```
47
+ mcp__workflow__task_submit({
48
+ prompt: "Analyze the following requirement and code context. Provide:\n1. Architecture analysis\n2. Implementation approach with Unified Diff patches\n3. Security considerations\n4. Performance implications\n\nRequirement: $REQUIREMENT\n\nCode Context:\n$CODE_CONTEXT\n\nTechnical References:\n$SEARCH_RESULTS",
49
+ domain: "backend"
50
+ })
51
+ ```
52
+
53
+ ### Frontend Analysis (Gemini)
54
+ ```
55
+ mcp__workflow__task_submit({
56
+ prompt: "Analyze the following requirement and code context. Provide:\n1. UI/UX impact analysis\n2. Component architecture with Unified Diff patches\n3. Accessibility considerations\n4. Design consistency review\n\nRequirement: $REQUIREMENT\n\nCode Context:\n$CODE_CONTEXT\n\nTechnical References:\n$SEARCH_RESULTS",
57
+ domain: "frontend"
58
+ })
59
+ ```
60
+
61
+ Record both task IDs.
62
+
63
+ ## Phase 3: Progress Monitoring [模式:轮询]
64
+
65
+ Poll both tasks every 15-30 seconds:
66
+ ```
67
+ mcp__workflow__task_status({ task_id: "<codex_task_id>" })
68
+ mcp__workflow__task_status({ task_id: "<gemini_task_id>" })
69
+ ```
70
+
71
+ Report progress to the user. When both complete, retrieve results:
72
+ ```
73
+ mcp__workflow__task_result({ task_id: "<codex_task_id>" })
74
+ mcp__workflow__task_result({ task_id: "<gemini_task_id>" })
75
+ ```
76
+
77
+ ## Phase 4: Cross-Validation [模式:综合]
78
+
79
+ Compare the two analyses:
80
+ 1. **Consensus** — Both agree → strong signal, adopt directly
81
+ 2. **Disagreements** — Conflict → apply trust rules (backend→Codex, frontend→Gemini), explain reasoning
82
+ 3. **Complementary** — Each covers different aspects → merge insights
83
+
84
+ Produce a unified implementation plan.
85
+
86
+ ## Phase 5: Execution [模式:执行]
87
+
88
+ Apply the synthesized plan:
89
+ 1. Apply Unified Diff patches from the trusted model
90
+ 2. Refactor "dirty prototype" code to production quality
91
+ 3. Ensure consistency across frontend and backend changes
92
+ 4. Run any available tests
93
+
94
+ ## Phase 6: Review [模式:审查]
95
+
96
+ Submit a final review task:
97
+ ```
98
+ mcp__workflow__task_submit({
99
+ prompt: "Review the following code changes for bugs, security issues, and quality:\n\n$CHANGES",
100
+ domain: "review"
101
+ })
102
+ ```
103
+
104
+ Report findings and apply fixes if needed.
@@ -0,0 +1,59 @@
1
+ ---
2
+ name: codex-task
3
+ description: Delegate code analysis, review, or generation tasks to Codex (OpenAI) with context collection
4
+ user-invocable: false
5
+ allowed-tools:
6
+ - mcp__workflow__chat
7
+ - mcp__workflow__task_submit
8
+ - mcp__workflow__task_status
9
+ - mcp__workflow__task_result
10
+ - mcp__workflow__task_cancel
11
+ - mcp__ace-tool__codebase-retrieval
12
+ ---
13
+
14
+ # Codex Task Skill
15
+
16
+ ## Trigger Detection
17
+
18
+ Activate when the user says:
19
+ - "use codex", "ask codex", "codex review", "codex analyze", "let codex do"
20
+ - Any request explicitly targeting backend logic, security, performance, or architecture analysis
21
+
22
+ ## Context Collection
23
+
24
+ ### 1. Determine Scope
25
+ - **Single-file**: Read target file + up to 3 imports + test file
26
+ - **Multi-file**: List directory (2 levels) + read up to 5 relevant files + config files
27
+ - **Project-wide**: Use `mcp__ace-tool__codebase-retrieval` for semantic search
28
+
29
+ ### 2. Assemble Prompt
30
+ Structure the prompt as:
31
+ ```
32
+ Task: <user's request>
33
+
34
+ Project Context:
35
+ <CLAUDE.md summary if exists, keep under 100 lines>
36
+
37
+ Code:
38
+ <relevant file contents, truncate files >300 lines to first 50 + last 20>
39
+
40
+ Instructions:
41
+ <specific focus areas based on task type>
42
+ ```
43
+
44
+ ### 3. Select System Prompt by Task Type
45
+ - **Review**: "senior code reviewer" — bugs, security, performance, style
46
+ - **Architecture**: "senior backend architect" — scalability, patterns, trade-offs
47
+ - **General**: "senior software engineer" — analysis and code suggestions
48
+
49
+ ## Delegation
50
+
51
+ - Quick tasks → `mcp__workflow__chat({ prompt, domain: "backend" })`
52
+ - Long tasks → `mcp__workflow__task_submit({ prompt, domain: "backend" })` + poll every 15-30s
53
+ - Follow-up → pass `session_id` from previous call
54
+
55
+ ## Result Presentation
56
+
57
+ - Attribute as "Codex analysis:"
58
+ - Preserve code blocks and diffs
59
+ - Never auto-apply — ask user confirmation first
@@ -0,0 +1,59 @@
1
+ ---
2
+ name: gemini-task
3
+ description: Delegate UI/UX analysis, frontend review, or design tasks to Gemini with context collection
4
+ user-invocable: false
5
+ allowed-tools:
6
+ - mcp__workflow__chat
7
+ - mcp__workflow__task_submit
8
+ - mcp__workflow__task_status
9
+ - mcp__workflow__task_result
10
+ - mcp__workflow__task_cancel
11
+ - mcp__ace-tool__codebase-retrieval
12
+ ---
13
+
14
+ # Gemini Task Skill
15
+
16
+ ## Trigger Detection
17
+
18
+ Activate when the user says:
19
+ - "use gemini", "ask gemini", "gemini review", "gemini analyze", "let gemini do"
20
+ - Any request explicitly targeting frontend, UI/UX, accessibility, or design analysis
21
+
22
+ ## Context Collection
23
+
24
+ ### 1. Determine Scope
25
+ - **Single-file**: Read target file + up to 3 imports + test file
26
+ - **Multi-file**: List directory (2 levels) + read up to 5 relevant files + config files
27
+ - **Project-wide**: Use `mcp__ace-tool__codebase-retrieval` for semantic search
28
+
29
+ ### 2. Assemble Prompt
30
+ Structure the prompt as:
31
+ ```
32
+ Task: <user's request>
33
+
34
+ Project Context:
35
+ <CLAUDE.md summary if exists, keep under 100 lines>
36
+
37
+ Code:
38
+ <relevant file contents, truncate files >300 lines to first 50 + last 20>
39
+
40
+ Instructions:
41
+ <specific focus areas based on task type>
42
+ ```
43
+
44
+ ### 3. Select System Prompt by Task Type
45
+ - **Review**: "senior frontend reviewer" — UI consistency, accessibility, responsive design
46
+ - **Design**: "senior UI/UX architect" — component patterns, design systems, user experience
47
+ - **General**: "senior frontend engineer" — analysis and code suggestions
48
+
49
+ ## Delegation
50
+
51
+ - Quick tasks → `mcp__workflow__chat({ prompt, domain: "frontend" })`
52
+ - Long tasks → `mcp__workflow__task_submit({ prompt, domain: "frontend" })` + poll every 15-30s
53
+ - Follow-up → pass `session_id` from previous call
54
+
55
+ ## Result Presentation
56
+
57
+ - Attribute as "Gemini analysis:"
58
+ - Preserve code blocks and diffs
59
+ - Never auto-apply — ask user confirmation first
@@ -0,0 +1,94 @@
1
+ ---
2
+ name: multi-model-task
3
+ description: Orchestrate tasks across Codex and Gemini with context collection, search fallback, and progress polling
4
+ user-invocable: false
5
+ allowed-tools:
6
+ - mcp__workflow__chat
7
+ - mcp__workflow__task_submit
8
+ - mcp__workflow__task_status
9
+ - mcp__workflow__task_result
10
+ - mcp__workflow__task_cancel
11
+ - mcp__ace-tool__codebase-retrieval
12
+ - mcp__grok-search__web_search
13
+ - mcp__grok-search__web_fetch
14
+ - mcp__plugin_context7_context7__resolve-library-id
15
+ - mcp__plugin_context7_context7__query-docs
16
+ ---
17
+
18
+ # Multi-Model Task Orchestration Skill
19
+
20
+ ## Trigger Detection
21
+
22
+ Activate this skill when the user says:
23
+ - "use codex", "ask codex", "codex review", "codex analyze"
24
+ - "use gemini", "ask gemini", "gemini review", "gemini analyze"
25
+ - "parallel analysis", "dual review", "multi-model"
26
+ - "let codex/gemini do..."
27
+
28
+ ## Context Collection Strategy
29
+
30
+ ### Single-file scope
31
+ - Read the target file
32
+ - Read up to 3 local imports/dependencies
33
+ - Read corresponding test file if exists
34
+
35
+ ### Multi-file scope
36
+ - List directory structure (2 levels)
37
+ - Read package.json / tsconfig.json
38
+ - Read up to 5 relevant files
39
+
40
+ ### Project-wide scope
41
+ - Use `mcp__ace-tool__codebase-retrieval` for semantic search
42
+ - Read project config files
43
+ - Read key entry points
44
+
45
+ ## Search Strategy
46
+
47
+ 1. **Primary**: Use `mcp__grok-search__web_search` for technical references
48
+ 2. **Fallback**: If grok-search returns an error or is unavailable:
49
+ - Use `mcp__plugin_context7_context7__resolve-library-id` to find the library
50
+ - Then `mcp__plugin_context7_context7__query-docs` to query documentation
51
+ 3. **Skip**: If the task doesn't require external references, skip search entirely
52
+
53
+ ## Task Delegation
54
+
55
+ ### Quick tasks (< 30 seconds expected)
56
+ Use `mcp__workflow__chat` for synchronous single-turn calls:
57
+ ```
58
+ mcp__workflow__chat({ prompt: "...", domain: "backend" })
59
+ ```
60
+
61
+ ### Long tasks (> 30 seconds expected)
62
+ Use `mcp__workflow__task_submit` + polling:
63
+ ```
64
+ mcp__workflow__task_submit({ prompt: "...", domain: "backend" })
65
+ // then poll with task_status every 15-30 seconds
66
+ ```
67
+
68
+ ### Multi-turn conversations
69
+ Pass `session_id` to continue a conversation:
70
+ ```
71
+ mcp__workflow__chat({ prompt: "follow-up question", session_id: "<previous session id>" })
72
+ ```
73
+
74
+ ## Polling Protocol
75
+
76
+ When a task is submitted:
77
+ 1. Wait 15 seconds before first poll
78
+ 2. Poll every 15-30 seconds with `task_status`
79
+ 3. Report progress to user (show partial output if meaningful)
80
+ 4. When status is "completed", retrieve with `task_result`
81
+ 5. If status is "failed", report error and suggest retry
82
+
83
+ ## Result Presentation
84
+
85
+ - Attribute results: "Codex analysis:" or "Gemini analysis:"
86
+ - Preserve all code blocks and diff patches
87
+ - Never auto-apply code changes — always ask user for confirmation
88
+ - If both models were used, present cross-validation summary
89
+
90
+ ## Trust Rules
91
+
92
+ - Backend logic, security, performance → Codex is authoritative
93
+ - Frontend UI, accessibility, design → Gemini is authoritative
94
+ - When models disagree, explain both perspectives and recommend based on domain authority
package/CLAUDE.md ADDED
@@ -0,0 +1,60 @@
1
+ # MMF - Claude Code 全局提示词
2
+
3
+ ## 核心约定
4
+ - 使用 mise 去调用 Java、Python 这类语言的运行时
5
+ - 运行在 Windows 系统内,运行环境是 PowerShell
6
+ - 先列好方案,向用户确认是否要修改代码,再去修改
7
+ - 思考用英文,回复用户用中文
8
+ - 使用标准 Markdown 格式;代码块用反引号包裹
9
+ - 简洁直接,不废话
10
+
11
+ ## MCP 工具速查表
12
+
13
+ 优先使用 MCP 工具,而非手动方式:
14
+
15
+ | 工具 | 使用时机 | 说明 |
16
+ |------|---------|------|
17
+ | `mcp__ace-tool__codebase-retrieval` | 生成任何代码之前 | 语义代码检索,用英文查询 |
18
+ | `mcp__grok-search__web_search` | 需要外部文档、最新信息 | 失败时回退到 context7 |
19
+ | `mcp__plugin_context7_context7__query-docs` | grok-search 不可用或失败时 | 库文档查询回退方案 |
20
+ | `mcp__diy-workflow__chat` | 快速 Codex/Gemini 单轮任务 | 用 `domain` 参数智能路由 |
21
+ | `mcp__diy-workflow__task_submit` | 长时间 Codex/Gemini 任务 | 用 `task_status` 轮询,`task_result` 获取结果 |
22
+
23
+ ## 命令速查表
24
+
25
+ | 命令 | 使用时机 |
26
+ |------|---------|
27
+ | `/mmf-workflow` | 完整多模型开发流程(研究→分析→综合→执行→审查) |
28
+ | `/mmf-codex` | 单独调 Codex 做后端/逻辑/安全分析 |
29
+ | `/mmf-gemini` | 单独调 Gemini 做前端/UI/设计分析 |
30
+ | `/mmf-review` | 双模型并行代码审查(Codex + Gemini) |
31
+ | `/mmf-analyze` | 并行分析(代码检索 + 双模型) |
32
+
33
+ ## 工作流原则
34
+
35
+ 1. **先检索,后生成** — 写代码前必须调用 `codebase-retrieval` 或 `web_search`
36
+ 2. **简单任务 → Claude 单独完成** — 不要在简单任务上强行多模型协作
37
+ 3. **代码主权** — Codex/Gemini 只负责分析;所有代码修改由 Claude 执行
38
+ 4. **并行执行** — 独立的 MCP 调用和模型查询并行运行
39
+ 5. **搜索回退** — grok-search 失败 → context7;绝不跳过研究阶段
40
+
41
+ ## 智能路由
42
+
43
+ - 前端 / UI / 设计 → Gemini(`domain: "frontend"`)
44
+ - 后端 / 逻辑 / 安全 → Codex(`domain: "backend"`)
45
+ - 代码审查 → Codex(`domain: "review"`)
46
+ - 通用任务 → Codex(`domain: "general"`)
47
+
48
+ ## 多模型协作规范
49
+
50
+ - 外部模型拥有 **零文件写入权限** — 只返回分析结果和 Unified Diff 补丁
51
+ - 信任规则:后端逻辑 → 信任 Codex,前端 UI → 信任 Gemini
52
+ - 模型意见冲突时 → 按领域权威裁决,说明理由
53
+ - 应用建议修改前必须征求用户确认
54
+ - 长任务每 15-30 秒轮询一次 `task_status`
55
+
56
+ ## Session 复用
57
+
58
+ - 首次调用返回 `session_id` — 后续调用传入即可续接多轮对话
59
+ - Session 闲置 1 小时后自动过期
60
+ - 适用于迭代优化场景(审查 → 修复 → 再审查)
package/dist/cli.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ export {};
3
+ //# sourceMappingURL=cli.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":""}