zcf 3.4.2 → 3.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/README.md +1 -1
  2. package/dist/chunks/api-providers.mjs +1 -1
  3. package/dist/chunks/claude-code-config-manager.mjs +28 -18
  4. package/dist/chunks/claude-code-incremental-manager.mjs +36 -19
  5. package/dist/chunks/codex-config-switch.mjs +4 -4
  6. package/dist/chunks/codex-provider-manager.mjs +28 -19
  7. package/dist/chunks/codex-uninstaller.mjs +2 -2
  8. package/dist/chunks/commands.mjs +1 -1
  9. package/dist/chunks/features.mjs +32 -20
  10. package/dist/chunks/simple-config.mjs +294 -114
  11. package/dist/cli.mjs +8 -6
  12. package/dist/i18n/locales/en/cli.json +3 -1
  13. package/dist/i18n/locales/en/configuration.json +3 -1
  14. package/dist/i18n/locales/en/errors.json +1 -1
  15. package/dist/i18n/locales/en/updater.json +1 -0
  16. package/dist/i18n/locales/zh-CN/cli.json +3 -1
  17. package/dist/i18n/locales/zh-CN/configuration.json +3 -1
  18. package/dist/i18n/locales/zh-CN/errors.json +1 -1
  19. package/dist/i18n/locales/zh-CN/updater.json +1 -0
  20. package/dist/index.d.mts +7 -3
  21. package/dist/index.d.ts +7 -3
  22. package/dist/index.mjs +1 -1
  23. package/package.json +1 -1
  24. package/templates/CLAUDE.md +39 -11
  25. package/templates/{codex/en/workflow/git/prompts → common/workflow/git/en}/git-commit.md +50 -3
  26. package/templates/{claude-code/zh-CN/workflow/git/commands → common/workflow/git/zh-CN}/git-commit.md +50 -3
  27. package/templates/{codex/en/workflow/sixStep/prompts → common/workflow/sixStep/en}/workflow.md +25 -4
  28. package/templates/{codex/zh-CN/workflow/sixStep/prompts → common/workflow/sixStep/zh-CN}/workflow.md +25 -4
  29. package/templates/claude-code/en/workflow/git/commands/git-commit.md +0 -158
  30. package/templates/claude-code/en/workflow/sixStep/commands/workflow.md +0 -230
  31. package/templates/claude-code/zh-CN/workflow/sixStep/commands/workflow.md +0 -194
  32. package/templates/codex/en/system-prompt/engineer-professional.md +0 -88
  33. package/templates/codex/en/system-prompt/laowang-engineer.md +0 -127
  34. package/templates/codex/en/system-prompt/nekomata-engineer.md +0 -120
  35. package/templates/codex/en/system-prompt/ojousama-engineer.md +0 -121
  36. package/templates/codex/en/workflow/git/prompts/git-cleanBranches.md +0 -102
  37. package/templates/codex/en/workflow/git/prompts/git-rollback.md +0 -90
  38. package/templates/codex/en/workflow/git/prompts/git-worktree.md +0 -276
  39. package/templates/codex/zh-CN/system-prompt/engineer-professional.md +0 -89
  40. package/templates/codex/zh-CN/system-prompt/laowang-engineer.md +0 -127
  41. package/templates/codex/zh-CN/system-prompt/nekomata-engineer.md +0 -120
  42. package/templates/codex/zh-CN/system-prompt/ojousama-engineer.md +0 -121
  43. package/templates/codex/zh-CN/workflow/git/prompts/git-cleanBranches.md +0 -102
  44. package/templates/codex/zh-CN/workflow/git/prompts/git-commit.md +0 -158
  45. package/templates/codex/zh-CN/workflow/git/prompts/git-rollback.md +0 -90
  46. package/templates/codex/zh-CN/workflow/git/prompts/git-worktree.md +0 -276
  47. /package/templates/{claude-code/en/output-styles → common/output-styles/en}/engineer-professional.md +0 -0
  48. /package/templates/{claude-code/en/output-styles → common/output-styles/en}/laowang-engineer.md +0 -0
  49. /package/templates/{claude-code/en/output-styles → common/output-styles/en}/nekomata-engineer.md +0 -0
  50. /package/templates/{claude-code/en/output-styles → common/output-styles/en}/ojousama-engineer.md +0 -0
  51. /package/templates/{claude-code/zh-CN/output-styles → common/output-styles/zh-CN}/engineer-professional.md +0 -0
  52. /package/templates/{claude-code/zh-CN/output-styles → common/output-styles/zh-CN}/laowang-engineer.md +0 -0
  53. /package/templates/{claude-code/zh-CN/output-styles → common/output-styles/zh-CN}/nekomata-engineer.md +0 -0
  54. /package/templates/{claude-code/zh-CN/output-styles → common/output-styles/zh-CN}/ojousama-engineer.md +0 -0
  55. /package/templates/{claude-code/en/workflow/git/commands → common/workflow/git/en}/git-cleanBranches.md +0 -0
  56. /package/templates/{claude-code/en/workflow/git/commands → common/workflow/git/en}/git-rollback.md +0 -0
  57. /package/templates/{claude-code/en/workflow/git/commands → common/workflow/git/en}/git-worktree.md +0 -0
  58. /package/templates/{claude-code/zh-CN/workflow/git/commands → common/workflow/git/zh-CN}/git-cleanBranches.md +0 -0
  59. /package/templates/{claude-code/zh-CN/workflow/git/commands → common/workflow/git/zh-CN}/git-rollback.md +0 -0
  60. /package/templates/{claude-code/zh-CN/workflow/git/commands → common/workflow/git/zh-CN}/git-worktree.md +0 -0
package/dist/cli.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import cac from 'cac';
3
3
  import ansis from 'ansis';
4
- import { ak as ensureI18nInitialized, al as i18n, aN as readCcrConfig, aI as isCcrInstalled, aJ as installCcr, aO as configureCcrFeature, ao as promptBoolean, aP as handleExitPromptError, aQ as handleGeneralError, aR as COMETIX_COMMAND_NAME, aS as COMETIX_COMMANDS, aT as installCometixLine, am as addNumbersToChoices, aU as checkAndUpdateTools, aV as runCodexUpdate, aW as resolveCodeType$1, at as readJsonConfig, aX as writeJsonConfig, q as ZCF_CONFIG_FILE, aD as readZcfConfig, D as DEFAULT_CODE_TOOL_TYPE, u as isCodeToolType, aY as displayBanner, aB as updateZcfConfig, aZ as version, a_ as resolveAiOutputLanguage, a$ as updatePromptOnly, b0 as selectAndInstallWorkflows, b1 as checkClaudeCodeVersionAndPrompt, w as resolveCodeToolType$1, b2 as displayBannerWithInfo, s as CODE_TOOL_BANNERS, b3 as runCodexUninstall, b4 as configureCodexMcp, b5 as configureCodexApi, b6 as runCodexWorkflowImportWithLanguageSelection, b7 as runCodexFullInit, i as init, b8 as switchCodexProvider, b9 as listCodexProviders, ax as readCodexConfig, ba as switchToOfficialLogin, bb as switchToProvider, bc as readZcfConfigAsync, bd as initI18n, be as selectScriptLanguage, aC as changeLanguage } from './chunks/simple-config.mjs';
4
+ import { ak as ensureI18nInitialized, al as i18n, aO as readCcrConfig, aJ as isCcrInstalled, aK as installCcr, aP as configureCcrFeature, ao as promptBoolean, aQ as handleExitPromptError, aR as handleGeneralError, aS as COMETIX_COMMAND_NAME, aT as COMETIX_COMMANDS, aU as installCometixLine, am as addNumbersToChoices, aV as checkAndUpdateTools, aW as runCodexUpdate, aX as resolveCodeType$1, at as readJsonConfig, aY as writeJsonConfig, q as ZCF_CONFIG_FILE, aE as readZcfConfig, D as DEFAULT_CODE_TOOL_TYPE, u as isCodeToolType, aZ as displayBanner, aC as updateZcfConfig, a_ as version, a$ as resolveAiOutputLanguage, b0 as updatePromptOnly, b1 as selectAndInstallWorkflows, b2 as checkClaudeCodeVersionAndPrompt, w as resolveCodeToolType$1, b3 as displayBannerWithInfo, s as CODE_TOOL_BANNERS, b4 as runCodexUninstall, b5 as configureCodexMcp, b6 as configureCodexApi, b7 as runCodexWorkflowImportWithLanguageSelection, b8 as runCodexFullInit, i as init, b9 as switchCodexProvider, ba as listCodexProviders, ay as readCodexConfig, bb as switchToOfficialLogin, bc as switchToProvider, bd as readZcfConfigAsync, be as initI18n, bf as selectScriptLanguage, aD as changeLanguage } from './chunks/simple-config.mjs';
5
5
  import { existsSync } from 'node:fs';
6
6
  import { homedir } from 'node:os';
7
7
  import inquirer from 'inquirer';
@@ -687,7 +687,7 @@ class ZcfUninstaller {
687
687
  result.removed.push(".claude.json (includes MCP configuration)");
688
688
  }
689
689
  try {
690
- const { uninstallCodeTool } = await import('./chunks/simple-config.mjs').then(function (n) { return n.bn; });
690
+ const { uninstallCodeTool } = await import('./chunks/simple-config.mjs').then(function (n) { return n.bo; });
691
691
  const success = await uninstallCodeTool("claude-code");
692
692
  if (success) {
693
693
  result.removed.push("@anthropic-ai/claude-code");
@@ -923,7 +923,7 @@ async function uninstall(options = {}) {
923
923
  }
924
924
  const uninstaller = new ZcfUninstaller(options.lang || "en");
925
925
  if (codeType === "codex") {
926
- const { runCodexUninstall } = await import('./chunks/simple-config.mjs').then(function (n) { return n.bm; });
926
+ const { runCodexUninstall } = await import('./chunks/simple-config.mjs').then(function (n) { return n.bn; });
927
927
  await runCodexUninstall();
928
928
  return;
929
929
  }
@@ -1193,7 +1193,7 @@ async function update(options = {}) {
1193
1193
  }
1194
1194
  return;
1195
1195
  }
1196
- const { resolveTemplateLanguage } = await import('./chunks/simple-config.mjs').then(function (n) { return n.bl; });
1196
+ const { resolveTemplateLanguage } = await import('./chunks/simple-config.mjs').then(function (n) { return n.bm; });
1197
1197
  const configLang = await resolveTemplateLanguage(
1198
1198
  options.configLang,
1199
1199
  // Command line option
@@ -1906,7 +1906,9 @@ function customizeHelp(sections) {
1906
1906
  ` ${ansis.green("--api-key, -k")} <key> ${i18n.t("cli:help.optionDescriptions.apiKey")}`,
1907
1907
  ` ${ansis.green("--api-url, -u")} <url> ${i18n.t("cli:help.optionDescriptions.customApiUrl")}`,
1908
1908
  ` ${ansis.green("--api-model, -M")} <model> ${i18n.t("cli:help.optionDescriptions.apiModel")} (e.g., claude-sonnet-4-5)`,
1909
- ` ${ansis.green("--api-fast-model, -F")} <model> ${i18n.t("cli:help.optionDescriptions.apiFastModel")} (e.g., claude-haiku-4-5)`,
1909
+ ` ${ansis.green("--api-haiku-model, -H")} <model> ${i18n.t("cli:help.optionDescriptions.apiHaikuModel")} (e.g., claude-haiku-4-5)`,
1910
+ ` ${ansis.green("--api-sonnet-model, -S")} <model> ${i18n.t("cli:help.optionDescriptions.apiSonnetModel")} (e.g., claude-sonnet-4-5)`,
1911
+ ` ${ansis.green("--api-opus-model, -O")} <model> ${i18n.t("cli:help.optionDescriptions.apiOpusModel")} (e.g., claude-opus-4-5)`,
1910
1912
  ` ${ansis.green("--ai-output-lang, -a")} <lang> ${i18n.t("cli:help.optionDescriptions.aiOutputLanguage")}`,
1911
1913
  ` ${ansis.green("--all-lang, -g")} <lang> ${i18n.t("cli:help.optionDescriptions.setAllLanguageParams")}`,
1912
1914
  ` ${ansis.green("--config-action, -r")} <action> ${i18n.t("cli:help.optionDescriptions.configHandling")} (${i18n.t("cli:help.defaults.prefix")} backup)`,
@@ -1972,7 +1974,7 @@ async function setupCommands(cli) {
1972
1974
  cli.command("", "Show interactive menu (default)").option("--lang, -l <lang>", "ZCF display language (zh-CN, en)").option("--all-lang, -g <lang>", "Set all language parameters to this value").option("--config-lang, -c <lang>", "Configuration language (zh-CN, en)").option("--force, -f", "Force overwrite existing configuration").option("--code-type, -T <codeType>", "Select code tool type (claude-code, codex, cc, cx)").action(await withLanguageResolution(async (options) => {
1973
1975
  await showMainMenu({ codeType: options.codeType });
1974
1976
  }));
1975
- cli.command("init", "Initialize Claude Code configuration").alias("i").option("--lang, -l <lang>", "ZCF display language (zh-CN, en)").option("--config-lang, -c <lang>", "Configuration language (zh-CN, en)").option("--ai-output-lang, -a <lang>", "AI output language").option("--force, -f", "Force overwrite existing configuration").option("--skip-prompt, -s", "Skip all interactive prompts (non-interactive mode)").option("--config-action, -r <action>", `Config handling (new/backup/merge/docs-only/skip), ${i18n.t("cli:help.defaults.prefix")} backup`).option("--api-type, -t <type>", "API type (auth_token/api_key/ccr_proxy/skip)").option("--api-key, -k <key>", "API key (used for both API key and auth token types)").option("--api-url, -u <url>", "Custom API URL").option("--api-model, -M <model>", "Primary API model (e.g., claude-sonnet-4-5)").option("--api-fast-model, -F <model>", "Fast API model (e.g., claude-haiku-4-5)").option("--provider, -p <provider>", "API provider preset (302ai, glm, minimax, kimi, custom)").option("--mcp-services, -m <services>", `Comma-separated MCP services to install (context7,mcp-deepwiki,Playwright,exa), "skip" to skip all, "all" for all non-key services, ${i18n.t("cli:help.defaults.prefix")} all`).option("--workflows, -w <workflows>", `Comma-separated workflows to install (sixStepsWorkflow,featPlanUx,gitWorkflow,bmadWorkflow), "skip" to skip all, "all" for all workflows, ${i18n.t("cli:help.defaults.prefix")} all`).option("--output-styles, -o <styles>", `Comma-separated output styles (engineer-professional,nekomata-engineer,laowang-engineer,default,explanatory,learning), "skip" to skip all, "all" for all custom styles, ${i18n.t("cli:help.defaults.prefix")} all`).option("--default-output-style, -d <style>", `Default output style, ${i18n.t("cli:help.defaults.prefix")} engineer-professional`).option("--all-lang, -g <lang>", "Set all language parameters to this value").option("--code-type, -T <codeType>", "Select code tool type (claude-code, codex, cc, cx)").option("--install-cometix-line, -x <value>", `Install CCometixLine statusline tool (true/false), ${i18n.t("cli:help.defaults.prefix")} true`).option("--api-configs <configs>", "API configurations as JSON string for multiple profiles").option("--api-configs-file <file>", "Path to JSON file containing API configurations").action(await withLanguageResolution(async (options) => {
1977
+ cli.command("init", "Initialize Claude Code configuration").alias("i").option("--lang, -l <lang>", "ZCF display language (zh-CN, en)").option("--config-lang, -c <lang>", "Configuration language (zh-CN, en)").option("--ai-output-lang, -a <lang>", "AI output language").option("--force, -f", "Force overwrite existing configuration").option("--skip-prompt, -s", "Skip all interactive prompts (non-interactive mode)").option("--config-action, -r <action>", `Config handling (new/backup/merge/docs-only/skip), ${i18n.t("cli:help.defaults.prefix")} backup`).option("--api-type, -t <type>", "API type (auth_token/api_key/ccr_proxy/skip)").option("--api-key, -k <key>", "API key (used for both API key and auth token types)").option("--api-url, -u <url>", "Custom API URL").option("--api-model, -M <model>", "Primary API model (e.g., claude-sonnet-4-5)").option("--api-haiku-model, -H <model>", "Default Haiku model (e.g., claude-haiku-4-5)").option("--api-sonnet-model, -S <model>", "Default Sonnet model (e.g., claude-sonnet-4-5)").option("--api-opus-model, -O <model>", "Default Opus model (e.g., claude-opus-4-5)").option("--provider, -p <provider>", "API provider preset (302ai, glm, minimax, kimi, custom)").option("--mcp-services, -m <services>", `Comma-separated MCP services to install (context7,mcp-deepwiki,Playwright,exa), "skip" to skip all, "all" for all non-key services, ${i18n.t("cli:help.defaults.prefix")} all`).option("--workflows, -w <workflows>", `Comma-separated workflows to install (sixStepsWorkflow,featPlanUx,gitWorkflow,bmadWorkflow), "skip" to skip all, "all" for all workflows, ${i18n.t("cli:help.defaults.prefix")} all`).option("--output-styles, -o <styles>", `Comma-separated output styles (engineer-professional,nekomata-engineer,laowang-engineer,default,explanatory,learning), "skip" to skip all, "all" for all custom styles, ${i18n.t("cli:help.defaults.prefix")} all`).option("--default-output-style, -d <style>", `Default output style, ${i18n.t("cli:help.defaults.prefix")} engineer-professional`).option("--all-lang, -g <lang>", "Set all language parameters to this value").option("--code-type, -T <codeType>", "Select code tool type (claude-code, codex, cc, cx)").option("--install-cometix-line, -x <value>", `Install CCometixLine statusline tool (true/false), ${i18n.t("cli:help.defaults.prefix")} true`).option("--api-configs <configs>", "API configurations as JSON string for multiple profiles").option("--api-configs-file <file>", "Path to JSON file containing API configurations").action(await withLanguageResolution(async (options) => {
1976
1978
  await init(options);
1977
1979
  }));
1978
1980
  cli.command("update", "Update Claude Code prompts only").alias("u").option("--lang, -l <lang>", "ZCF display language (zh-CN, en)").option("--all-lang, -g <lang>", "Set all language parameters to this value").option("--config-lang, -c <lang>", "Configuration language (zh-CN, en)").action(await withLanguageResolution(async (options) => {
@@ -24,7 +24,9 @@
24
24
  "help.optionDescriptions.apiKey": "API key (for both types)",
25
25
  "help.optionDescriptions.customApiUrl": "Custom API URL",
26
26
  "help.optionDescriptions.apiModel": "Primary API model",
27
- "help.optionDescriptions.apiFastModel": "Fast API model",
27
+ "help.optionDescriptions.apiHaikuModel": "Default Haiku model",
28
+ "help.optionDescriptions.apiSonnetModel": "Default Sonnet model",
29
+ "help.optionDescriptions.apiOpusModel": "Default Opus model",
28
30
  "help.optionDescriptions.aiOutputLanguage": "AI output language",
29
31
  "help.optionDescriptions.setAllLanguageParams": "Set all language params",
30
32
  "help.optionDescriptions.configHandling": "Config handling",
@@ -15,7 +15,9 @@
15
15
  "currentModel": "Current model",
16
16
  "defaultModelOption": "Default - Let Claude Code choose",
17
17
  "defaultStyle": "Default style",
18
- "enterFastModel": "Enter fast model name for background tasks",
18
+ "enterHaikuModel": "Enter default Haiku model",
19
+ "enterSonnetModel": "Enter default Sonnet model",
20
+ "enterOpusModel": "Enter default Opus model",
19
21
  "enterPrimaryModel": "Enter primary model name",
20
22
  "envImportSuccess": "Environment variables imported",
21
23
  "existingConfig": "Existing config detected. How to proceed?",
@@ -12,7 +12,7 @@
12
12
  "invalidWorkflow": "Invalid workflow: {workflow}. Available workflows: {validWorkflows}",
13
13
  "invalidModel": "Invalid model: {model}. Expected 'opus', 'sonnet', or 'sonnet[1m]'",
14
14
  "invalidApiModel": "Invalid API model parameter: {value}",
15
- "invalidApiFastModel": "Invalid fast model parameter: {value}",
15
+ "invalidModelParam": "Invalid model parameter {key}: {value}",
16
16
  "invalidEnvConfig": "Invalid env configuration: expected object",
17
17
  "invalidBaseUrl": "Invalid ANTHROPIC_BASE_URL: expected string",
18
18
  "invalidApiKeyConfig": "Invalid ANTHROPIC_API_KEY: expected string",
@@ -1,5 +1,6 @@
1
1
  {
2
2
  "autoUpdating": "Auto-updating {tool}...",
3
+ "usingSudo": "Detected non-root Linux user. Using sudo for update (password prompt may appear).",
3
4
  "cannotCheckVersion": "Cannot check latest version",
4
5
  "ccrNotInstalled": "CCR is not installed",
5
6
  "ccrUpToDate": "CCR is up to date (v{version})",
@@ -24,7 +24,9 @@
24
24
  "help.optionDescriptions.apiKey": "API密钥(适用于所有类型)",
25
25
  "help.optionDescriptions.customApiUrl": "自定义API地址",
26
26
  "help.optionDescriptions.apiModel": "主API模型",
27
- "help.optionDescriptions.apiFastModel": "快速API模型",
27
+ "help.optionDescriptions.apiHaikuModel": "默认 Haiku 模型",
28
+ "help.optionDescriptions.apiSonnetModel": "默认 Sonnet 模型",
29
+ "help.optionDescriptions.apiOpusModel": "默认 Opus 模型",
28
30
  "help.optionDescriptions.aiOutputLanguage": "AI输出语言",
29
31
  "help.optionDescriptions.setAllLanguageParams": "统一设置所有语言参数",
30
32
  "help.optionDescriptions.configHandling": "配置处理",
@@ -15,7 +15,9 @@
15
15
  "currentModel": "当前模型",
16
16
  "defaultModelOption": "默认 - 让 Claude Code 自动选择",
17
17
  "defaultStyle": "默认风格",
18
- "enterFastModel": "请输入后台任务的快速模型名称",
18
+ "enterHaikuModel": "请输入默认 Haiku 模型名称",
19
+ "enterSonnetModel": "请输入默认 Sonnet 模型名称",
20
+ "enterOpusModel": "请输入默认 Opus 模型名称",
19
21
  "enterPrimaryModel": "请输入主要使用的模型名称",
20
22
  "envImportSuccess": "环境变量已导入",
21
23
  "existingConfig": "检测到已有配置文件,如何处理?",
@@ -12,7 +12,7 @@
12
12
  "invalidWorkflow": "无效的工作流:{workflow}。可用的工作流:{validWorkflows}",
13
13
  "invalidModel": "无效的模型:{model}。期望的值:'opus', 'sonnet', 或 'sonnet[1m]'",
14
14
  "invalidApiModel": "无效的 API 模型参数:{value}",
15
- "invalidApiFastModel": "无效的快速模型参数:{value}",
15
+ "invalidModelParam": "无效的模型参数 {key}:{value}",
16
16
  "invalidEnvConfig": "无效的环境配置:期望对象类型",
17
17
  "invalidBaseUrl": "无效的 ANTHROPIC_BASE_URL:期望字符串类型",
18
18
  "invalidApiKeyConfig": "无效的 ANTHROPIC_API_KEY:期望字符串类型",
@@ -1,5 +1,6 @@
1
1
  {
2
2
  "autoUpdating": "正在自动更新 {tool}...",
3
+ "usingSudo": "检测到 Linux 非 root 用户,正在使用 sudo 提升权限进行更新(可能需要输入密码)。",
3
4
  "cannotCheckVersion": "无法检查最新版本",
4
5
  "ccrNotInstalled": "CCR 未安装",
5
6
  "ccrUpToDate": "CCR 已是最新版本 (v{version})",
package/dist/index.d.mts CHANGED
@@ -52,7 +52,9 @@ interface InitOptions {
52
52
  apiKey?: string;
53
53
  apiUrl?: string;
54
54
  apiModel?: string;
55
- apiFastModel?: string;
55
+ apiHaikuModel?: string;
56
+ apiSonnetModel?: string;
57
+ apiOpusModel?: string;
56
58
  provider?: string;
57
59
  mcpServices?: string[] | string | boolean;
58
60
  workflows?: string[] | string | boolean;
@@ -159,9 +161,11 @@ declare function mergeConfigs(sourceFile: string, targetFile: string): void;
159
161
  /**
160
162
  * Update custom model configuration using environment variables
161
163
  * @param primaryModel - Primary model name for general tasks
162
- * @param fastModel - Fast model name for background tasks (optional)
164
+ * @param haikuModel - Default Haiku model (optional)
165
+ * @param sonnetModel - Default Sonnet model (optional)
166
+ * @param opusModel - Default Opus model (optional)
163
167
  */
164
- declare function updateCustomModel(primaryModel?: string, fastModel?: string): void;
168
+ declare function updateCustomModel(primaryModel?: string, haikuModel?: string, sonnetModel?: string, opusModel?: string): void;
165
169
  /**
166
170
  * Update the default model configuration in settings.json
167
171
  * @param model - The model type to set: opus, sonnet, sonnet[1m], default, or custom
package/dist/index.d.ts CHANGED
@@ -52,7 +52,9 @@ interface InitOptions {
52
52
  apiKey?: string;
53
53
  apiUrl?: string;
54
54
  apiModel?: string;
55
- apiFastModel?: string;
55
+ apiHaikuModel?: string;
56
+ apiSonnetModel?: string;
57
+ apiOpusModel?: string;
56
58
  provider?: string;
57
59
  mcpServices?: string[] | string | boolean;
58
60
  workflows?: string[] | string | boolean;
@@ -159,9 +161,11 @@ declare function mergeConfigs(sourceFile: string, targetFile: string): void;
159
161
  /**
160
162
  * Update custom model configuration using environment variables
161
163
  * @param primaryModel - Primary model name for general tasks
162
- * @param fastModel - Fast model name for background tasks (optional)
164
+ * @param haikuModel - Default Haiku model (optional)
165
+ * @param sonnetModel - Default Sonnet model (optional)
166
+ * @param opusModel - Default Opus model (optional)
163
167
  */
164
- declare function updateCustomModel(primaryModel?: string, fastModel?: string): void;
168
+ declare function updateCustomModel(primaryModel?: string, haikuModel?: string, sonnetModel?: string, opusModel?: string): void;
165
169
  /**
166
170
  * Update the default model configuration in settings.json
167
171
  * @param model - The model type to set: opus, sonnet, sonnet[1m], default, or custom
package/dist/index.mjs CHANGED
@@ -11,9 +11,9 @@ import 'pathe';
11
11
  import 'node:url';
12
12
  import 'inquirer-toggle';
13
13
  import 'ora';
14
+ import 'tinyexec';
14
15
  import 'semver';
15
16
  import 'smol-toml';
16
- import 'tinyexec';
17
17
  import 'node:fs/promises';
18
18
  import 'i18next';
19
19
  import 'i18next-fs-backend';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "zcf",
3
3
  "type": "module",
4
- "version": "3.4.2",
4
+ "version": "3.5.0",
5
5
  "description": "Zero-Config Code Flow - One-click configuration tool for Code Cli",
6
6
  "author": {
7
7
  "name": "Miao Da",
@@ -1,6 +1,6 @@
1
1
  # Templates Module
2
2
 
3
- **Last Updated**: Mon Oct 27 19:39:26 CST 2025
3
+ **Last Updated**: Sun Dec 15 09:15:34 CST 2025
4
4
  [Root](../CLAUDE.md) > **templates**
5
5
 
6
6
  ## Module Responsibilities
@@ -20,18 +20,43 @@ Template system module providing multilingual configuration templates, AI person
20
20
 
21
21
  ```
22
22
  templates/
23
+ ├── common/ # Shared templates (cross code-tool)
24
+ │ ├── output-styles/ # AI personality styles
25
+ │ │ ├── en/ # English output styles
26
+ │ │ │ ├── engineer-professional.md
27
+ │ │ │ ├── laowang-engineer.md
28
+ │ │ │ ├── nekomata-engineer.md
29
+ │ │ │ └── ojousama-engineer.md
30
+ │ │ └── zh-CN/ # Chinese output styles
31
+ │ │ ├── engineer-professional.md
32
+ │ │ ├── laowang-engineer.md
33
+ │ │ ├── nekomata-engineer.md
34
+ │ │ └── ojousama-engineer.md
35
+ │ └── workflow/
36
+ │ ├── git/ # Git workflow
37
+ │ │ ├── en/ # English git commands
38
+ │ │ │ ├── git-commit.md
39
+ │ │ │ ├── git-worktree.md
40
+ │ │ │ ├── git-cleanBranches.md
41
+ │ │ │ └── git-rollback.md
42
+ │ │ └── zh-CN/ # Chinese git commands
43
+ │ │ ├── git-commit.md
44
+ │ │ ├── git-worktree.md
45
+ │ │ ├── git-cleanBranches.md
46
+ │ │ └── git-rollback.md
47
+ │ └── sixStep/ # Six-step workflow
48
+ │ ├── en/ # English workflow
49
+ │ │ └── workflow.md
50
+ │ └── zh-CN/ # Chinese workflow
51
+ │ └── workflow.md
23
52
  ├── claude-code/ # Claude Code templates
24
53
  │ ├── common/ # Common configurations
25
54
  │ ├── zh-CN/ # Chinese templates
26
- │ │ ├── output-styles/ # AI personality styles
27
55
  │ │ └── workflow/ # Workflow templates
28
56
  │ │ ├── common/ # Common tools workflow
29
57
  │ │ ├── plan/ # Planning workflow
30
- │ │ ├── sixStep/ # Six-step workflow
31
- │ │ ├── bmad/ # BMAD workflow
32
- │ │ └── git/ # Git workflow
58
+ │ │ └── bmad/ # BMAD workflow
33
59
  │ └── en/ # English templates
34
- │ ├── output-styles/ # AI personality styles
35
60
  │ └── workflow/ # Workflow templates
36
61
  └── codex/ # Codex templates
37
62
  ├── common/ # Common configurations
@@ -55,9 +80,9 @@ templates/
55
80
  #### 2. Workflow Templates
56
81
 
57
82
  ##### Common Tools Workflow
58
- - **Commands**: `init-project`, `git-commit`, `git-rollback`, `git-cleanBranches`, `git-worktree`
83
+ - **Commands**: `init-project`
59
84
  - **Agents**: `init-architect`, `get-current-datetime`
60
- - **Purpose**: Essential development tools and Git operations
85
+ - **Purpose**: Essential development tools and project initialization
61
86
 
62
87
  ##### Planning Workflow (Plan)
63
88
  - **Commands**: `feat`, `workflow`
@@ -73,8 +98,8 @@ templates/
73
98
  - **Purpose**: Business model and architecture design
74
99
 
75
100
  ##### Git Workflow
76
- - **Commands**: Advanced Git operations
77
- - **Purpose**: Version control management
101
+ - **Commands**: `git-commit`, `git-worktree`, `git-cleanBranches`, `git-rollback`
102
+ - **Purpose**: Version control management with conventional commits, worktree management, branch cleanup, and rollback operations
78
103
 
79
104
  ## Key Dependencies and Configuration
80
105
 
@@ -153,6 +178,9 @@ interface OutputStyle {
153
178
 
154
179
  ### Recent Updates
155
180
 
181
+ - Consolidated sixStep workflow templates to `templates/common/workflow/sixStep/` with unified `.zcf` plan directory for both Claude Code and Codex
182
+ - Consolidated output-styles/system-prompt templates to `templates/common/output-styles/`
183
+ - Consolidated git workflow templates to `templates/common/workflow/git/`
156
184
  - Added Codex template support for dual code tool architecture
157
185
  - Enhanced workflow templates with comprehensive command coverage
158
186
  - Improved AI personality styles with professional variations
@@ -171,7 +199,7 @@ interface OutputStyle {
171
199
 
172
200
  ### Q: How to add a new output style?
173
201
 
174
- 1. Create style file in `templates/{code-tool}/{locale}/output-styles/`
202
+ 1. Create style file in `templates/common/output-styles/{locale}/`
175
203
  2. Define style configuration with name and description
176
204
  3. Add style to available options in configuration
177
205
  4. Test style rendering with sample content
@@ -66,7 +66,16 @@ This command works **without any package manager/build tools**, using only **Git
66
66
  4. **Commit Message Generation (Conventional with Optional Emoji)**
67
67
  - Auto-infer `type` (`feat`/`fix`/`docs`/`refactor`/`test`/`chore`/`perf`/`style`/`ci`/`revert`...) and optional `scope`.
68
68
  - Generate message header: `[<emoji>] <type>(<scope>)?: <subject>` (first line ≤ 72 chars, imperative mood, emoji included only with `--emoji` flag).
69
- - Generate message body: bullet points (motivation, implementation details, impact scope, BREAKING CHANGE if any).
69
+ - Generate message body:
70
+ - Must have a blank line after the subject.
71
+ - Use list format, each item starts with `-`.
72
+ - Each item **must use imperative verb-first sentences** (e.g., "add…", "fix…", "update…").
73
+ - **Colon-separated formats are prohibited** (e.g., ~~"Feature: description"~~, ~~"Impl: content"~~).
74
+ - Describe the motivation, implementation details, or impact scope (3 items or fewer recommended).
75
+ - Generate message footer (if any):
76
+ - Must have a blank line after the Body.
77
+ - **BREAKING CHANGE**: If there are breaking changes, must include `BREAKING CHANGE: <description>`, or add exclamation mark after type (e.g., `feat!:`).
78
+ - Other footers use git trailer format (e.g., `Closes #123`, `Refs: #456`, `Reviewed-by: Name`).
70
79
  - Select message language to match the predominant language in Git history. Inspect recent commit subjects (e.g., `git log -n 50 --pretty=%s`) to decide Chinese vs English; if unclear, fall back to the repository's primary locale or English.
71
80
  - Write draft to `.git/COMMIT_EDITMSG` for use with `git commit`.
72
81
 
@@ -83,8 +92,8 @@ This command works **without any package manager/build tools**, using only **Git
83
92
 
84
93
  - **Atomic commits**: One commit does one thing, easier to trace and review.
85
94
  - **Group before committing**: Split by directory/module/feature.
86
- - **Clear subject**: First line ≤ 72 chars, imperative mood (e.g., "add... / fix...").
87
- - **Body with context**: Explain motivation, solution, impact scope, risks, and next steps.
95
+ - **Clear subject**: First line ≤ 72 chars, imperative mood.
96
+ - **Body with context**: Explain motivation, solution, and impact scope (colon-separated formats prohibited).
88
97
  - **Follow Conventional Commits**: `<type>(<scope>): <subject>`.
89
98
 
90
99
  ---
@@ -122,6 +131,7 @@ This command works **without any package manager/build tools**, using only **Git
122
131
 
123
132
  **Good (with --emoji)**
124
133
 
134
+ ```text
125
135
  - ✨ feat(ui): add user authentication flow
126
136
  - 🐛 fix(api): handle token refresh race condition
127
137
  - 📝 docs: update API usage examples
@@ -129,9 +139,11 @@ This command works **without any package manager/build tools**, using only **Git
129
139
  - ✅ test: add unit tests for rate limiter
130
140
  - 🔧 chore: update git hooks and repository settings
131
141
  - ⏪️ revert: revert "feat(core): introduce streaming API"
142
+ ```
132
143
 
133
144
  **Good (without --emoji)**
134
145
 
146
+ ```text
135
147
  - feat(ui): add user authentication flow
136
148
  - fix(api): handle token refresh race condition
137
149
  - docs: update API usage examples
@@ -139,13 +151,48 @@ This command works **without any package manager/build tools**, using only **Git
139
151
  - test: add unit tests for rate limiter
140
152
  - chore: update git hooks and repository settings
141
153
  - revert: revert "feat(core): introduce streaming API"
154
+ ```
155
+
156
+ **Good (with Body)**
157
+
158
+ ```text
159
+ feat(auth): add OAuth2 login flow
160
+
161
+ - implement Google and GitHub third-party login
162
+ - add user authorization callback handling
163
+ - improve login state persistence logic
164
+
165
+ Closes #42
166
+ ```
167
+
168
+ ```text
169
+ fix(ui): fix button spacing on mobile devices
170
+
171
+ - adjust button padding to fit small screens
172
+ - fix styling issues on iOS Safari
173
+ - optimize touch target size
174
+ ```
175
+
176
+ **Good (with BREAKING CHANGE)**
177
+
178
+ ```text
179
+ feat(api)!: redesign authentication API
180
+
181
+ - migrate from session-based to JWT authentication
182
+ - update all endpoint signatures
183
+ - remove deprecated login methods
184
+
185
+ BREAKING CHANGE: authentication API has been completely redesigned, all clients must update their integration
186
+ ```
142
187
 
143
188
  **Split Example**
144
189
 
190
+ ```text
145
191
  - `feat(types): add new type defs for payment method`
146
192
  - `docs: update API docs for new types`
147
193
  - `test: add unit tests for payment types`
148
194
  - `fix: address linter warnings in new files` ← (if your repo has hook errors)
195
+ ```
149
196
 
150
197
  ---
151
198
 
@@ -66,7 +66,16 @@ argument-hint: [--no-verify] [--all] [--amend] [--signoff] [--emoji] [--scope <s
66
66
  4. **提交信息生成(Conventional 规范,可选 Emoji)**
67
67
  - 自动推断 `type`(`feat`/`fix`/`docs`/`refactor`/`test`/`chore`/`perf`/`style`/`ci`/`revert` …)与可选 `scope`。
68
68
  - 生成消息头:`[<emoji>] <type>(<scope>)?: <subject>`(首行 ≤ 72 字符,祈使语气,仅在使用 `--emoji` 时包含 emoji)。
69
- - 生成消息体:要点列表(动机、实现要点、影响范围、BREAKING CHANGE 如有)。
69
+ - 生成消息体:
70
+ - 必须在 subject 之后空一行。
71
+ - 使用列表格式,每项以 `-` 开头。
72
+ - 每项**必须使用动词开头的祈使句**(如 "add…"、"fix…"、"update…")。
73
+ - **禁止使用冒号分隔的格式**(如 ~~"Feature: description"~~、~~"Impl: content"~~)。
74
+ - 说明变更的动机、实现要点或影响范围(3 项以内为宜)。
75
+ - 生成消息脚注(如有):
76
+ - 必须在 Body 之后空一行。
77
+ - **BREAKING CHANGE**:若存在破坏性变更,必须包含 `BREAKING CHANGE: <description>`,或在类型后添加感叹号(如 `feat!:`)。
78
+ - 其它脚注采用 git trailer 格式(如 `Closes #123`、`Refs: #456`、`Reviewed-by: Name`)。
70
79
  - 根据 Git 历史提交的主要语言选择提交信息语言。优先检查最近提交主题(例如 `git log -n 50 --pretty=%s`)判断中文/英文;若无法判断,则回退到仓库主要语言或英文。
71
80
  - 将草稿写入 `.git/COMMIT_EDITMSG`,并用于 `git commit`。
72
81
 
@@ -83,8 +92,8 @@ argument-hint: [--no-verify] [--all] [--amend] [--signoff] [--emoji] [--scope <s
83
92
 
84
93
  - **Atomic commits**:一次提交只做一件事,便于回溯与审阅。
85
94
  - **先分组再提交**:按目录/模块/功能点拆分。
86
- - **清晰主题**:首行 ≤ 72 字符,祈使语气(如 “add… / fix…”)。
87
- - **正文含上下文**:说明动机、方案、影响范围、风险与后续工作。
95
+ - **清晰主题**:首行 ≤ 72 字符,祈使语气。
96
+ - **正文含上下文**:说明动机、方案、影响范围(禁止冒号分隔格式)。
88
97
  - **遵循 Conventional Commits**:`<type>(<scope>): <subject>`。
89
98
 
90
99
  ---
@@ -122,6 +131,7 @@ argument-hint: [--no-verify] [--all] [--amend] [--signoff] [--emoji] [--scope <s
122
131
 
123
132
  **Good (使用 --emoji)**
124
133
 
134
+ ```text
125
135
  - ✨ feat(ui): add user authentication flow
126
136
  - 🐛 fix(api): handle token refresh race condition
127
137
  - 📝 docs: update API usage examples
@@ -129,9 +139,11 @@ argument-hint: [--no-verify] [--all] [--amend] [--signoff] [--emoji] [--scope <s
129
139
  - ✅ test: add unit tests for rate limiter
130
140
  - 🔧 chore: update git hooks and repository settings
131
141
  - ⏪️ revert: revert "feat(core): introduce streaming API"
142
+ ```
132
143
 
133
144
  **Good (不使用 --emoji)**
134
145
 
146
+ ```text
135
147
  - feat(ui): add user authentication flow
136
148
  - fix(api): handle token refresh race condition
137
149
  - docs: update API usage examples
@@ -139,13 +151,48 @@ argument-hint: [--no-verify] [--all] [--amend] [--signoff] [--emoji] [--scope <s
139
151
  - test: add unit tests for rate limiter
140
152
  - chore: update git hooks and repository settings
141
153
  - revert: revert "feat(core): introduce streaming API"
154
+ ```
155
+
156
+ **Good (包含 Body)**
157
+
158
+ ```text
159
+ feat(auth): add OAuth2 login flow
160
+
161
+ - implement Google and GitHub third-party login
162
+ - add user authorization callback handling
163
+ - improve login state persistence logic
164
+
165
+ Closes #42
166
+ ```
167
+
168
+ ```text
169
+ fix(ui): fix button spacing on mobile devices
170
+
171
+ - adjust button padding to fit small screens
172
+ - fix styling issues on iOS Safari
173
+ - optimize touch target size
174
+ ```
175
+
176
+ **Good (包含 BREAKING CHANGE)**
177
+
178
+ ```text
179
+ feat(api)!: redesign authentication API
180
+
181
+ - migrate from session-based to JWT authentication
182
+ - update all endpoint signatures
183
+ - remove deprecated login methods
184
+
185
+ BREAKING CHANGE: authentication API has been completely redesigned, all clients must update their integration
186
+ ```
142
187
 
143
188
  **Split Example**
144
189
 
190
+ ```text
145
191
  - `feat(types): add new type defs for payment method`
146
192
  - `docs: update API docs for new types`
147
193
  - `test: add unit tests for payment types`
148
194
  - `fix: address linter warnings in new files` ←(如你的仓库有钩子报错)
195
+ ```
149
196
 
150
197
  ---
151
198
 
@@ -54,9 +54,9 @@ You are a professional AI programming assistant following a structured core work
54
54
 
55
55
  ### 4. `[Mode: Execute]` - Implementation
56
56
 
57
+ - Store plan summary (with context and plan) in project root directory `.zcf/plan/current/task-name.md`
57
58
  - Must have user approval before execution
58
59
  - Strictly follow the plan for coding implementation
59
- - Store plan summary (with context and plan) in project root directory `.codex/plan/task-name.md`
60
60
  - Request user feedback after key steps and completion
61
61
 
62
62
  ### 5. `[Mode: Optimize]` - Code Optimization
@@ -73,6 +73,21 @@ You are a professional AI programming assistant following a structured core work
73
73
  - Report issues and suggestions
74
74
  - Request user confirmation after completion
75
75
 
76
+ ## Timestamp Acquisition Rules
77
+
78
+ During workflow execution, any scenario requiring current timestamp must obtain accurate time via bash command. Guessing or fabricating time is prohibited.
79
+
80
+ Basic Commands:
81
+ - Default format: `date +'%Y-%m-%d %H:%M:%S'`
82
+ - Filename format: `date +'%Y-%m-%d_%H%M%S'`
83
+ - Readable format: `date +'%Y-%m-%d %H:%M:%S %Z'`
84
+ - ISO format: `date +'%Y-%m-%dT%H:%M:%S%z'`
85
+
86
+ Typical Use Cases:
87
+ - Updating timestamp fields in documents
88
+ - Naming task plan documents during archiving (when moving from `.zcf/plan/current/` to `.zcf/plan/history/`)
89
+ - Any other scenario requiring current time recording
90
+
76
91
  ## Interactive Feedback & MCP Services
77
92
 
78
93
  ### Interactive Feedback Rules
@@ -169,6 +184,7 @@ Questions to Ask:
169
184
  - Evaluate pros and cons of each approach
170
185
  - Provide detailed comparison and recommendation
171
186
  - Consider technical constraints and best practices
187
+ - Request user approval before proceeding
172
188
 
173
189
  ### 📋 Phase 3: Detailed Planning
174
190
 
@@ -184,10 +200,10 @@ Questions to Ask:
184
200
 
185
201
  [Mode: Execute] - Code development:
186
202
 
203
+ - Store execution plan in project root directory `.zcf/plan/current/task-name.md`
187
204
  - Implement according to approved plan
188
205
  - Follow development best practices
189
206
  - Add usage methods before import statements (critical rule)
190
- - Store execution plan in project root directory `.codex/plan/task-name.md`
191
207
  - Request feedback at key milestones
192
208
 
193
209
  ### 🚀 Phase 5: Code Optimization
@@ -207,14 +223,19 @@ Questions to Ask:
207
223
  - Identify any remaining issues or improvements
208
224
  - Provide completion summary and recommendations
209
225
  - Request final user confirmation
226
+ - After task completion, move plan file from `.zcf/plan/current/` to `.zcf/plan/history/` for archiving
227
+ - Rename to `[Finish Time]task-name.md` during archiving for tracking, Finish Time format is `YYYY-MM-DD_HHMMSS`
210
228
 
211
229
  ## Expected Output Structure
212
230
 
213
231
  ```
214
232
  project/ # Project root directory
215
- ├── .codex/
233
+ ├── .zcf/
216
234
  │ └── plan/
217
- └── task-name.md # Execution plan and context (in project root)
235
+ ├── current/ # Current ongoing tasks
236
+ │ │ └── task-name.md # Execution plan and context
237
+ │ └── history/ # Completed historical tasks
238
+ │ └── [Finish Time]task-name.md # Archived task records
218
239
  ├── src/
219
240
  │ ├── components/
220
241
  │ ├── services/