用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/spotify/confidence-cli --skill integrations命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
Architecture guidelines and constraints for the Confidence Wizard CLI project
Load before writing, modifying, or adding any test file (unit, integration, or e2e). Covers testing philosophy, conventions, shared test scaffolds (__tests__/shared/), test framework structure (__tests__/e2e/testing-framework/, __tests__/ui/testing-framework/), and the named-key press() API for e2e tests.
Develop and modify the Ink-based terminal UI for the Confidence Wizard
基于 SOC 职业分类
正在显示 SKILL.md
| name | integrations |
| description | IDE integration strategy pattern and guidelines for the Confidence Wizard CLI project |
| version | 0.2 |
This skill defines the structure, constraints, and conventions for IDE integrations in the Confidence Wizard CLI. Follow these when adding, modifying, or reviewing IDE-related code.
The src/integrations/ module encapsulates all IDE-specific behavior behind a strategy pattern. Each supported IDE (Claude Code, Cursor, Codex) has a self-contained implementation that conforms to a shared IdeIntegration interface. This eliminates per-IDE switch statements scattered across the codebase and makes adding a new IDE a single-directory change.
src/integrations/
types.ts # IdeId, IdeIntegration strategy type, McpConnectOpts
index.ts # Barrel exports + registry re-exports
registry.ts # getIntegrations(), getIntegration() — the strategy registry
chat.ts # buildChatPrompt() + launchChatSession() orchestrator
plugins.ts # detectInstalledPlugins() + installPlugin() orchestrators
shared.ts # Reusable helpers: PLUGIN_SKILLS, installSkills(), hasConfidenceServers()
claude/
index.ts # claudeIntegration — composes strategy from submodules
paths.ts # Config file and directory paths
plugins.ts # detectPlugins(), installPlugins()
mcp.ts # detectMcpStatuses(), connectMcpServer()
onboarding.ts # runOnboarding() — spawns the IDE's onboarding process
cursor/
index.ts, paths.ts, plugins.ts, mcp.ts, onboarding.ts # Same structure
codex/
index.ts, paths.ts, plugins.ts, mcp.ts, onboarding.ts # Same structure
mcp/
servers.ts # MCP_SERVERS, McpServerName, McpServerStatus, verifyMcpServer(), helpers
preference.ts # loadMcpPreference(), persistMcpPreference()
index.ts # Barrel exports
IdeIntegration typeEvery IDE exports a single IdeIntegration object with these methods:
id — the IdeId string ('claude' | 'cursor' | 'codex')name — human-readable label for UI displaylaunchChat(prompt, cwd) — spawns a chat session in this IDErunOnboarding(opts, callbacks) — spawns the IDE's onboarding process with stdout/stderr streamingdetectPlugins(projectDir) — checks if Confidence plugins are installed for this IDEinstallPlugins(projectDir) — installs MCP config and skills for this IDEdetectMcpStatuses(projectDir) — detects MCP server connection statusesconnectMcpServer(opts) — registers an MCP server for this IDEEach IDE owns the full implementation of all these methods. Shared helpers (verifyMcpServer, installSkills, hasConfidenceServers) are imported from mcp/servers.ts and shared.ts.
IdeId is defined in src/integrations/types.ts — it belongs to the integrations module. WizardSession uses its own ChosenIde type (same string union, defined in src/lib/session.ts) to stay decoupled from the integrations module. This keeps the dependency direction clean: integrations never imports from lib/session for its own type definitions, and session never imports from integrations.
chat.ts and plugins.ts are thin orchestrators that resolve the IDE strategy and delegate:
launchChatSession(session, ide) — builds prompt, calls integration.launchChat()detectInstalledPlugins(projectDir) — iterates all integrations, calls i.detectPlugins()installPlugin(ide, projectDir) — calls getIntegration(ide).installPlugins()Consumers use orchestrators when they don't have the integration object, or use the strategy methods directly when they do.
Each IDE subdirectory (claude/, cursor/, codex/) must be fully independent:
paths.ts, plugins.ts, mcp.ts, and a slim index.ts that composes them../types.js, ../mcp/servers.js, and ../shared.js — never from ../registry.js or each otherAll IDE-specific branching is encapsulated inside each strategy object. Code outside src/integrations/ must not switch on IdeId or branch on IDE identity. Instead, call getIntegration(ide) and use the strategy methods.
integrations/index.ts → registry, chat, plugins, mcp/
registry.ts → claude/, cursor/, codex/
chat.ts, plugins.ts → registry.ts
claude/, cursor/, codex/ → types.ts, mcp/servers.ts, shared.ts (never registry or each other)
mcp/ → (no internal integrations imports)
shared.ts → (no internal integrations imports)
The integrations module imports from src/lib/ (for IdeId, WizardSession, constants). It never imports from src/ui/ or src/commands/.
When changing MCP-related code (config paths, server names, connection methods, permissions), verify that scripts/clean-dev-env.sh still correctly cleans up all IDE connections and artifacts. This script resets the local dev environment for clean-slate testing. If you add a new IDE, config path, or MCP registration method, update the script accordingly.
src/integrations/<ide-name>/index.tsconst <name>Integration: IdeIntegration with all required methodsINTEGRATIONS array in src/integrations/registry.tsscripts/clean-dev-env.sh to clean the new IDE's config files and MCP entriesThe barrel src/integrations/index.ts exports:
IdeId, IdeIntegration, McpConnectOpts, OnboardingOpts, OnboardingCallbacks, McpServerName, McpServerStatusgetIntegrations(), getIntegration(id)MCP_SERVERS, allServersConnected(), getAvailableMcpServers(), verifyMcpServer(), loadMcpPreference(), persistMcpPreference()launchChatSession(session, ide)detectInstalledPlugins(projectDir), installPlugin(ide, projectDir)Only import from the barrel or from specific submodules — never reach into an IDE's index.ts directly from outside the integrations module.
Follow all conventions from the wizard-architecture skill. Additionally:
type over interface for all type definitionssatisfies IdeIntegration only if needed for type narrowing; otherwise the export type annotation is sufficientconnectMcpServer method receives all server metadata via McpConnectOpts — it must not import MCP_SERVERS directly