بنقرة واحدة
architecture-overview
High-level system map of ComfyUI Assistant -- read first to understand the project
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
High-level system map of ComfyUI Assistant -- read first to understand the project
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
Install ComfyUI Assistant as a ComfyUI custom node. Use when performing or troubleshooting installation (clone, Python deps, frontend build, restart).
For complex user requests — evaluate, investigate, ask questions, propose a plan, accept modifications, then execute. Use when the request is multi-step, ambiguous, or high-impact.
Workflow execution and complete workflow generation tools (executeWorkflow, applyWorkflowJson). Use when the user wants to run a workflow or build a complete workflow from a description.
Python backend modules, chat request lifecycle, SSE format, and API endpoints
System prompt assembly from system_context, user_context, and environment sources
Generate a Product Requirements Document (PRD) for a new feature. Use when planning a feature, starting a new project, or when asked to create a PRD. Triggers on: create a prd, write prd for, plan this feature, requirements for, spec out.
| name | architecture-overview |
| description | High-level system map of ComfyUI Assistant -- read first to understand the project |
| version | 0.0.1 |
| license | MIT |
Read this skill first to understand how the pieces fit together.
┌──────────────────────────────────────────────────────────┐
│ ComfyUI (Host) │
│ window.app · graph API · bottomPanelTabs │
└──────────┬───────────────────────────────┬───────────────┘
│ DOM / JS API │ aiohttp routes
┌──────────▼──────────────┐ ┌───────────▼───────────────┐
│ React Frontend │ │ Python Backend │
│ assistant-ui/react │◄──►│ __init__.py (entry) │
│ useChatRuntime │SSE │ api_handlers.py │
│ Tool implementations │ │ agent_prompts.py │
│ Slash commands │ │ tools_definitions.py │
└─────────────────────────┘ └───────────┬───────────────┘
│ OpenAI-compat API
┌───────────▼───────────────┐
│ LLM Provider (OpenAI-compatible provider) │
│ Streaming + tool calling │
└───────────────────────────┘
.agents/project-context.md -- overview, stack, directory structure__init__.py -- backend entry point, route registration, chat handlerui/src/main.tsx -- frontend entry, ComfyUI extension registrationui/src/App.tsx -- runtime setup, agentic loop, onboardingtools_definitions.py -- all tools the LLM can callui/src/tools/index.ts -- frontend tool registry and implementationsagent_prompts.py -- system message assembly/api/chat with full message history (AI SDK UIMessage format)chat_api_handler in __init__.py):
a. Converts UIMessages to OpenAI format (_ui_messages_to_openai)
b. Loads system context (load_system_context from user_context_loader.py)
c. Loads environment summary (load_environment_summary)
d. Loads user context (load_user_context)
e. Assembles system message (get_system_message from agent_prompts.py)
f. Calls LLM (OpenAI-compatible provider) with streaming enabled + tool definitions
g. Streams response as SSE (AI SDK UI Message Stream v1)ModelContext, appends resultsshouldResubmitAfterToolResult): if last message part is a tool call, resubmit to get next LLM response -- this creates the agentic loopLLM (OpenAI-compatible provider) Backend Frontend
│ │ │
├─ tool_call(addNode,{...}) ──► │
│ ├─ SSE: tool-input ───►│
│ │ -available │
│ │ ├─ execute tool
│ │ │ (window.app access)
│ │ ├─ append result
│ │ │ to message
│ │◄─── resubmit ────────┤
│◄── messages + tool_result ──┤ │
├─ text("Done!") ─────────────► │
│ ├─ SSE: text-delta ───►│
│ │ ├─ render text
AssistantChatTransport({ api: '/api/chat' }) -- handles SSE communicationuseChatRuntime({ transport }) -- manages state, messages, threadingAssistantRuntimeProvider wraps the component treeuseComfyTools() hook registers tools into ModelContextsendAutomaticallyWhen: shouldResubmitAfterToolResult drives the agentic loopThread component with terminal-style renderingbackend-architecture -- Python modules and API detailsbackend-tools-declaration -- Tool sync between frontend and backendui-integration -- How React wires into ComfyUIassistant-ui -- Chat UI components and customizationSee "Files to Read First" above.
See "Tool Call Flow" diagram above. The LLM emits a tool_call, backend streams it as SSE, frontend executes it against window.app, appends the result, and resubmits.
In ui/src/App.tsx. The shouldResubmitAfterToolResult function checks if the last message part is a tool invocation; if so, sendAutomaticallyWhen triggers a resubmit.
AI SDK UI Message Stream v1 over SSE. Events: start, text-start, text-delta, text-end, reasoning-*, tool-input-available, finish, [DONE].