mcpField
M
melech-visualize

melech-visualize

github.com/adird生产力4565 次安装3 周前更新
代码仓库

关于 melech-visualize

melech-visualize 是一项 Agent 技能,可将当前聊天上下文绘制成简洁的 ASCII 图。它用于梳理流程、结构、界面、顺序、边界和方案对比,并区分假设与已确认信息。

主要功能

  1. 01将上下文绘制为简洁 ASCII 图
  2. 02呈现流程、结构、界面和对比
  3. 03区分假设与已确认信息
  4. 04绘图后附简短说明
  5. 05尽量少提澄清问题

适用场景

  1. 01梳理端到端后端流程
  2. 02绘制拟议的界面布局
  3. 03比较两种实现方案
  4. 04澄清对当前系统的理解

安装

复制下面的命令,在终端中运行。

$npx skills add https://github.com/adird/agent-shell-hamelech --skill melech-visualize

安装后在 Claude Code 中输入/melech-visualize确认已加载。

详细介绍

可视化

获取当前聊天上下文,并用紧凑的 ASCII 图示呈现相关概念。

绘制能让讨论豁然开朗的内容: 流程、结构、界面、时序、边界、对比或当前思维模型。

保持简单、清晰、实用。 优先使用最小且能说明要点的图示。

使用清晰的标签和箭头。 必要时做出合理假设,但请标明。 区分已确认的细节和推断。 如果图示揭示了更清晰的结构、不顺畅的流程或缺失的部分,请简要说明。

尽量少问澄清问题。 如果上下文足够,就直接开始绘制。

图示之后,简要说明:

  • 图示展示了什么
  • 做出了哪些假设
  • 哪些内容因此更加清晰
  • 还有哪些重要歧义尚未解决

示例交互

1) 后端流程

用户

melech-visualize how project creation works end to end

助手

Homepage submit → create-project workflow

  HomepagePromptInput
        |
        v
  POST /api/v1/workflows/create-project
        |
        v
  WorkflowsController.createProject()
        |
        +---> WorkspaceService.getOrCreateDefault(user)
        |
        +---> ProjectService.create(dto)
        |       |
        |       +---> AuthService.createSubTenant()
        |       +---> AuthService.assignUserToTenant(PROJECT_ADMIN)
        |       +---> ProjectRepository.save()  → INSERT projects
        |       +---> AnalyticsService.track()
        |       +---> EventPublisher → message bus
        |
        v
  Response { workspaceId, projectId }
        |
        v
  Navigate to /editor/{projectId}

What it shows:
- auth tenant isolation happens at creation time, not lazily
- bus events fan out to quota-service, thumbnail-service

Assumptions:
- Auth calls succeed (no retry shown)

What became clearer:
- project creation has side effects across 3 external systems (auth, message bus, analytics)
- a failure after DB insert but before tenant assignment leaves a broken project
2) UI 布局 — 为首页添加功能

用户

melech-visualize a "recently viewed" section on the homepage

助手

Current homepage layout (web-app/src/routes/index.tsx)

+--------------------------------------------------+
| Topbar                                           |
+--------------------------------------------------+
| Hero (title, subtitle, gradient bg)              |
+--------------------------------------------------+
| HomePagePromptInput                              |
| [Suggestions chips]                              |
+--------------------------------------------------+
| ProjectList                                      |
|  [Filters: all | published | draft]  [Search]    |
|  +------------+ +------------+ +------------+    |
|  | ProjectCard| | ProjectCard| | ProjectCard|    |
|  +------------+ +------------+ +------------+    |
+--------------------------------------------------+

With "recently viewed" added

+--------------------------------------------------+
| Topbar                                           |
+--------------------------------------------------+
| Hero (title, subtitle, gradient bg)              |
+--------------------------------------------------+
| HomePagePromptInput                              |
| [Suggestions chips]                              |
+--------------------------------------------------+
| RecentlyViewed              ← NEW                |
|  +--------+ +--------+ +--------+ +--------+    |
|  | thumb  | | thumb  | | thumb  | | thumb  |    |
|  | name   | | name   | | name   | | name   |    |
|  +--------+ +--------+ +--------+ +--------+    |
+--------------------------------------------------+
| ProjectList                                      |
|  [Filters: all | published | draft]  [Search]    |
|  +------------+ +------------+ +------------+    |
|  | ProjectCard| | ProjectCard| | ProjectCard|    |
|  +------------+ +------------+ +------------+    |
+--------------------------------------------------+

What it shows:
- recently viewed sits between prompt and full project list
- horizontal scroll row, compact cards (no filters/search needed)

Assumptions:
- "recently viewed" is per-user, stored server-side (not localStorage)
- max ~10 items, horizontal overflow

What became clearer:
- needs a new API endpoint (GET /projects/recent) or query param on existing
- ProjectCard may need a compact variant, or this uses a separate simpler component
- if list is empty (new user), section should hide entirely
3) 服务间架构

用户

melech-visualize how publish/deploy works across services

助手

Publish flow across microservices

  web-app                     api-service               deploy-orchestrator
  +-----------+              +----------------+         +------------------+
  | Editor UI |--publish-->  | ProjectService |         |                  |
  +-----------+              |  .publish()    |         |                  |
                             +-------+--------+         |                  |
                                     |                  |                  |
                      DeploymentClientService           |                  |
                        .triggerDeployment() ---------> | workflow engine  |
                                     |                  |   starts         |
                                     v                  +--------+---------+
                             ProjectRepository                   |
                              update deployment                  |
                              metadata                           v
                                                         EdgeDeployModule
                                                          - DNS setup
                                                          - edge deploy
                                                                 |
                                                                 v
                                                         sandbox-proxy
                                                          - runtime ready
                                                          - health check

What it shows:
- api-service triggers but doesn't wait for full deploy
- workflow engine orchestrates the multi-step deploy (DNS, edge, runtime)
- deployment is async — editor polls for status

Assumptions:
- workflow engine handles retries/failures internally
- EdgeDeployModule covers both DNS and worker deployment

What became clearer:
- three separate systems need to succeed for a publish (workflow engine, edge deploy, sandbox runtime)
- rollback story is unclear — what happens if DNS succeeds but runtime fails?
4) 比较两种方案

用户

melech-visualize adding project search as a new endpoint vs query param on existing

助手

Option A: New endpoint GET /api/v1/projects/search?q=term

  ProjectController                ProjectService
  +------------------+            +------------------+
  | @Get('/search')  |----------->| searchProjects() |
  | query: { q }     |            | new repo method  |
  +------------------+            +------------------+
                                         |
                                  ProjectRepository
                                   .createQueryBuilder()
                                   .where("name ILIKE :q")

Option B: Query param on existing GET /api/v1/projects?search=term

  ProjectController                ProjectService
  +------------------+            +------------------+
  | @Get('/')        |----------->| findAll(filters)  |
  | existing route   |            | add search param  |
  | + search param   |            | to existing query |
  +------------------+            +------------------+

What it shows:
- Option A: isolated, but duplicates pagination/filter logic
- Option B: one code path, search is just another filter

Assumptions:
- search is name-only for now, not full-text across metadata

What became clearer:
- Option B is simpler — findAll already handles workspaceId + status filters
- Option A only makes sense if search needs different response shape or permissions
5) 当前思维模型

用户

melech-visualize your current understanding of the chat/AI flow

助手

Current understanding of editor chat flow

  Editor UI (web-app)
  +-------------------+
  | ChatPanel         |
  |  user sends msg   |
  +--------+----------+
           |
    POST /api/v1/chat/messages
           |
           v
  +-------------------+     +------------------+
  | ChatController    |---->| ChatService      |
  +-------------------+     |  .sendMessage()  |
                            +--------+---------+
                                     |
                          +----------+----------+
                          |                     |
                    LLM API call          ToolExecutor
                    (Claude/GPT)          (sandbox ops,
                     via agent SDK         file read/write)
                          |                     |
                          v                     v
                    chat_messages         SandboxService
                    table (parts,         → sandbox SDK
                    usage jsonb)          → file system ops

  [?] unclear: how streaming responses reach the UI
  [?] unclear: where tool results feed back into the LLM loop

What it shows:
- chat is synchronous request/response at the HTTP level
- tool execution happens server-side within the message handling

Assumptions:
- streaming uses SSE or similar (not websockets)
- tool calls loop back into the LLM for follow-up

What became clearer:
- the biggest unknown is the agent loop — single-shot or multi-turn tool use?

评论

支持 Markdown