.claude/skills/engine-file-layout/SKILL.md
This skill should be used when the user asks "where is function X", "which file contains", "engine file structure", "engine.go split", "engine_commands.go", "engine_cards.go", "engine_session.go", "engine_events.go", "engine_util.go", "engine_workspace.go", "find function in engine", "engine file layout", "engine file map", or needs to quickly locate a specific function, type, or constant across the engine's split file structure.
npx skillsauth add liuyu520/cc-connect-fork engine-file-layoutInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
After the engine.go refactoring, Engine logic is distributed across 7 files. This skill provides a quick-reference map for locating any function, type, or constant in the engine's split structure.
| File | Lines | Content Summary |
|------|-------|-----------------|
| engine.go | ~1,420 | Engine struct, NewEngine, Set* methods, lifecycle, handleMessage entry |
| engine_commands.go | ~4,100 | Command registry, handleCommand, all cmd* handlers |
| engine_cards.go | ~1,890 | Card navigation, card rendering, delete mode |
| engine_session.go | ~750 | Session types, interactive session management |
| engine_events.go | ~690 | Event processing loop, message draining |
| engine_util.go | ~600 | Send/reply helpers, message splitting, relay |
| engine_workspace.go | ~310 | Workspace resolution, session key parsing |
Constants & Types:
maxPlatformMessageLen, maxQueuedMessages, defaultThinkingMaxLen, defaultToolMaxLenRestartRequest, DisplayCfg, RateLimitCfg, sessionListCacheEntry, ConfigReloadResultworkspaceInitFlowVariables:
VersionInfo, CurrentVersion, ErrAttachmentSendDisabled, RestartChEngine struct and all Set*() configuration methods (~25)
Lifecycle:
NewEngine() — constructor, calls initBuiltinCommands()Start(), Stop(), OnPlatformReady(), OnPlatformUnavailable()Message entry:
handleMessage() — main message dispatch (~180 lines)resolveAlias(), matchBannedWord(), checkRateLimit()Session utilities:
listSessionsCached(), invalidateSessionListCache()ActiveSessionKeys(), CleanupSession(), GetSessionInfo()Cron/Heartbeat:
ExecuteCronJob(), executeCronShell(), ExecuteHeartbeat()Admin:
isAdmin(), resolveDisabledCmds()Registry types:
commandHandler — unified handler signature func(p Platform, msg *Message, args []string)builtinCommandDef — command definition with names, id, handler, privileged flagbuiltinCommandNames — package-level name/id list for resolveDisabledCmds and matchPrefixRegistry initialization:
initBuiltinCommands() — binds all 38 commands to handlersDispatch:
handleCommand() — registry-based command dispatch (replaces old 38-case switch)matchBuiltinPrefix() — Engine method for prefix matching against builtinCommandDefsmatchPrefix() — standalone prefix matching against name/id listmatchSubCommand() — subcommand prefix matchingisBtwCommand(), matchBtwPrefix() — /btw detectionWorkspace command:
handleWorkspaceCommand()Session commands: cmdNew, cmdList, cmdSwitch, matchSession, cmdSearch, cmdName, cmdCurrent, cmdStatus
Info commands: cmdUsage, formatUsageReport, formatUsageBlocks, accountDisplay, selectUsageWindows, formatUsageBlock, cmdHistory
Agent control: cmdModel, resolveModelAlias, parseModelSwitchArgs, switchModel, cmdReasoning, cmdMode, applyLiveModeChange, cmdQuiet, cmdTTS, cmdStop, cmdAllow
Compress: cmdCompress, runCompress, processCompressEvents, drainQueuedMessagesAfterCompress
Provider: cmdProvider, cmdProviderAdd, cmdProviderRemove, switchProvider
Memory/Cron/Heartbeat: cmdMemory, showMemoryFile, appendMemoryFile, cmdCron, cmdCronAdd, cmdCronAddExec, cmdCronList, cmdCronDel, cmdCronToggle, cmdCronMute, cmdCronSetup, cmdHeartbeat, cmdHeartbeatStatusText, heartbeatLocalizedHelpers
Custom commands & skills: executeCustomCommand, executeShellCommand, cmdCommands, cmdCommandsList, cmdCommandsAdd, cmdCommandsAddExec, cmdCommandsDel, executeSkill, cmdSkills
Config/System: configItem, configItems(), cmdConfig, cmdWhoami, formatWhoamiText, cmdDoctor, cmdUpgrade, cmdUpgradeConfirm, cmdConfigReload, cmdRestart, cmdAlias, cmdAliasList, cmdAliasAdd, cmdAliasDel
Delete: cmdDelete, isExplicitDeleteBatchArg, parseDeleteBatchIndices, cmdDeleteBatch, deleteSingleSession, deleteSingleSessionReply, deleteSessionDisplayName
Bind: cmdBind, cmdBindStatus, setupMemoryFile, cmdBindSetup
Lang/Help: cmdLang, langDisplayName, cmdHelp, cmdDir, dirApply, cmdShell
Public API: GetAllCommands()
Helpers: splitCardTitleBody, cardBackButton, cardPrevButton, cardNextButton, simpleCard
Safe wrappers: renderListCardSafe, renderDirCardSafe
Status/Time: renderStatusCard, cronTimeFormat, formatDurationI18n
Usage card: renderUsageCard, formatUsageResetTime, usageAccountLabel, usageWindowLabel, usageRemainingLabel, usageResetLabel, usageColon, usageCardTitle, usageUnavailableText
Help card: defaultHelpGroup, helpCardItem, helpCardGroup, helpCardGroups(), renderHelpCard, splitHelpTabRows, renderHelpGroupCard
Navigation: handleCardNav, executeCardAction
Delete mode: getOrCreateDeleteModeState, getDeleteModeState, renderDeleteModeCard, renderDeleteModeSelectCard, renderDeleteModeConfirmCard, renderDeleteModeResultCard, deleteModeSelectionNames, executeDeleteModeAction, parseDeleteModeSelectedIDs, submitDeleteModeSelection
Render cards: renderLangCard, renderModelCard, renderReasoningCard, renderModeCard, renderListCard, dirCardTruncPath, renderDirCard, renderCurrentCard, renderHistoryCard, renderProviderCard, renderCronCard, renderCommandsCard, renderAliasCard, renderConfigCard, renderSkillsCard, renderDoctorCard, renderVersionCard, renderUpgradeCard, renderHeartbeatCard, renderWhoamiCard
Types: queuedMessage, interactiveState, deleteModeState, pendingPermission, resolve()
Queue management: queueMessageForBusySession, drainOrphanedQueue
Voice: handleVoiceMessage
Permission handling: handlePendingPermission, resolveAskQuestionAnswer, buildAskQuestionResponse, isApproveAllResponse, isAllowResponse, isDenyResponse
Interactive session: processInteractiveMessage, processInteractiveMessageWith, getOrCreateWorkspaceAgent, getOrCreateInteractiveStateWith, cleanupInteractiveState
defaultEventIdleTimeout constantprocessInteractiveEvents() — core select loop (~600 lines)notifyDroppedQueuedMessages() — notify queued senders on errordrainPendingMessages() — process queued messages after turn completionSend/Reply: send, reply, replyWithButtons, replyWithCard, sendWithCard
Capabilities: supportsCards (standalone), drainEvents (standalone)
Permission UI: sendPermissionPrompt, sendAskQuestionPrompt
External API: SendToSession, SendToSessionWithAttachments
Text processing: toolCodeLang, truncateIf, splitMessage (all standalone)
TTS: sendTTSReply
Relay: HandleRelay, relayPartialResponseOrError
Context indicator: modelContextWindow constant, contextIndicator, ctxSelfReportRe, parseSelfReportedCtx
Sender injection: buildSenderPrompt
Key extraction (standalone): extractChannelID, extractUserID, extractPlatformName, workspaceChannelKey, extractWorkspaceChannelKey
Context resolution: commandContext, sessionContextForKey, interactiveKeyForSessionKey
Workspace binding: lookupEffectiveWorkspaceBinding, resolveWorkspace, handleWorkspaceInitFlow
Git utilities (standalone): looksLikeGitURL, extractRepoName, gitClone
| Adding... | Put it in... |
|-----------|-------------|
| New slash command handler | engine_commands.go |
| New card render function | engine_cards.go |
| New Engine Set*() method | engine.go |
| New Engine struct field | engine.go |
| New session/permission logic | engine_session.go |
| New event handling case | engine_events.go |
| New send/reply helper | engine_util.go |
| New workspace helper | engine_workspace.go |
tools
This skill should be used when the user asks about "webui", "web ui", "vibe coding", "WebUIServer", "web interface", "browser Claude Code", "web frontend", "React admin dashboard", "web/src", "VibeCoding page", "WebSocket /api/vibe/ws", "webui config", "port 9830", "static file serving", "webuiSession", "claude code subprocess from web", "project dropdown", "work dir select", "listProjects", "Management API frontend", "multi tab vibe", "TabBar", "VibeSession component", "copy work dir", "clipboard copy", "disconnect confirm", "断开确认", "复制路径", "copyWorkDir", "AgentSystemPrompt", "project awareness", "/project command in agent", "attachment upload", "sendWithAttachments", "file upload vibe", "image upload vibe", "drag drop vibe", "paste image vibe", or needs to debug, extend, or understand the browser-based Vibe Coding interface and its Go backend.
tools
This skill should be used when the user asks about "permission request", "control_request", "control_response", "permission prompt tool", "permission-prompt-tool stdio", "permission popup not showing", "permission dialog missing", "authorize tool use", "allow deny button", "webuiSession permission", "respondPermission", "updatedInput", "control_cancel_request", "permission cancelled", "permission_cancelled", "pendingInputs", "permission flow webui", "vibe permission", "前端没有弹出授权", "权限请求不显示", "权限弹窗", "webuiSession vs claudeSession", "webui parity", or needs to debug, extend, or understand how tool permission requests flow between Claude Code CLI, the Go WebUI backend, and the React frontend.
tools
This skill should be used when the user asks about "export markdown", "export chat", "download markdown", "export conversation", "导出 Markdown", "导出聊天记录", "ExportRequest", "ExportMessage", "handleVibeExportMarkdown", "buildExportMarkdown", "POST /api/vibe/export", "exportVibeSession", "chat export", "markdown download", "sanitizeFilename", "Content-Disposition attachment", "export button vibe", "history export", "tool_use in export", "message type mapping export", or needs to debug, extend, or understand the chat history Markdown export feature including the full-stack data flow from frontend trigger to file download.
tools
This skill should be used when the user asks about "attachment upload", "file upload", "image upload", "paste image", "drag drop file", "vibe attachment", "pendingAttachments", "sendWithAttachments", "fileToAttachment", "AttachmentItem", "base64 attachment", "WebSocket attachment protocol", "multimodal content", "image content block", "file content block", "clipboard paste image", "drag and drop upload", "attachment preview", "file size limit", "10MB limit", "ExtFromMime", "附件上传", "图片上传", "拖拽上传", "粘贴图片", "附件预览", "文件大小限制", or needs to debug, extend, or understand the WebUI attachment upload feature including the full-stack data flow from browser to Claude Code CLI.