/** * 适配器配置 Writer — CLI 层模块。 * * 职责边界: * - 负责:生成并写入 Claude Code 的 MCP 配置、当前架构指令、quick hooks 和 skills * - 不负责:项目规划、配置推断(由 MCP 工具 sf_task/sf_knowledge 承担) * * 被谁调用:CLI init 命令(runInit)、CLI skills 命令(sync) * 调用谁:claude_md / hooks(适配器层生成函数)、loader(内置 skills 目录) * * 数据流:项目路径 + 配置 → 生成内容 → 写盘到项目根(MCP/CLAUDE.md/settings)+ 用户全局(skills) * * 设计决策:每个 writer = 生成内容 + 写盘,纯函数式便于单测。 */ import type { ProjectConfig } from "../types/index.js"; /** * 写入 Claude Code 的 .mcp.json(MCP 连接配置)。 * @runtimeContract 发布回放从构建产物动态导入。 */ export declare function writeMcpJson(projectPath: string): string; /** * 写入 CLAUDE.md(AI 工作流指令,让 Claude Code 一启动就懂 SoloForge 流程)。 * @runtimeContract 发布回放从构建产物动态导入。 */ export declare function writeClaudeMd(projectPath: string, config: ProjectConfig): string; /** * 写入 .claude/settings.json(危险操作保护 + quick 即时反馈)。 * @runtimeContract 发布回放从构建产物动态导入。 */ export declare function writeClaudeSettings(projectPath: string): string; export interface AdapterBundleResult { mcp: string; instructions: string; settings: string; } export interface AdapterBundlePreview { mcp: string; instructions: string; settings: string; } /** 生成合并后的适配器文件内容但不写盘;dry-run 与真实写入共享同一预检。 */ export declare function previewAdapterBundle(projectPath: string, config: ProjectConfig): AdapterBundlePreview; /** 三个项目级适配器文件成组写入;任一失败时恢复调用前内容。 */ export declare function writeAdapterBundle(projectPath: string, config: ProjectConfig, writeFile?: (target: string, content: string) => void): AdapterBundleResult; export declare function validateBuiltinSkillsDirectory(builtinSkillsDir: string): string[]; /** 写入 Claude Code skills 到用户全局 ~/.claude/skills/soloforge-{kind}/。 * * skill 必须到达用户 Claude Code 才生效。本函数把内置 skills/{kind}/ 复制到用户全局 * ~/.claude/skills/soloforge-{kind}/(Claude Code 自动加载用户级 skills)。 * * init 会执行首次同步,`soloforge skills` 可在升级后重新同步。 * * 目录名 soloforge-{kind}(kebab)对齐 frontmatter name,前缀隔离避与用户其他 skill 冲突。 * userSkillsDir 参数化(默认 ~/.claude/skills)便于测试。 */ export declare function writeSkills(userSkillsDir?: string): { copied: number; dir: string; };