zcf 3.2.3 → 3.3.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 (38) hide show
  1. package/README.md +83 -14
  2. package/dist/chunks/api-providers.mjs +76 -0
  3. package/dist/chunks/claude-code-config-manager.mjs +21 -7
  4. package/dist/chunks/claude-code-incremental-manager.mjs +56 -14
  5. package/dist/chunks/codex-config-switch.mjs +69 -10
  6. package/dist/chunks/codex-provider-manager.mjs +18 -8
  7. package/dist/chunks/codex-uninstaller.mjs +1 -1
  8. package/dist/chunks/commands.mjs +1 -1
  9. package/dist/chunks/features.mjs +637 -0
  10. package/dist/chunks/simple-config.mjs +172 -24
  11. package/dist/cli.mjs +12 -612
  12. package/dist/i18n/locales/en/api.json +6 -1
  13. package/dist/i18n/locales/en/errors.json +1 -0
  14. package/dist/i18n/locales/en/multi-config.json +2 -1
  15. package/dist/i18n/locales/zh-CN/api.json +6 -1
  16. package/dist/i18n/locales/zh-CN/errors.json +1 -0
  17. package/dist/i18n/locales/zh-CN/multi-config.json +2 -1
  18. package/dist/index.d.mts +8 -1
  19. package/dist/index.d.ts +8 -1
  20. package/dist/index.mjs +1 -1
  21. package/package.json +1 -1
  22. package/templates/CLAUDE.md +190 -0
  23. package/templates/claude-code/en/output-styles/engineer-professional.md +2 -1
  24. package/templates/claude-code/en/output-styles/laowang-engineer.md +1 -0
  25. package/templates/claude-code/en/output-styles/nekomata-engineer.md +1 -0
  26. package/templates/claude-code/en/output-styles/ojousama-engineer.md +1 -0
  27. package/templates/claude-code/zh-CN/output-styles/engineer-professional.md +2 -1
  28. package/templates/claude-code/zh-CN/output-styles/laowang-engineer.md +1 -0
  29. package/templates/claude-code/zh-CN/output-styles/nekomata-engineer.md +1 -0
  30. package/templates/claude-code/zh-CN/output-styles/ojousama-engineer.md +1 -0
  31. package/templates/codex/en/system-prompt/engineer-professional.md +2 -1
  32. package/templates/codex/en/system-prompt/laowang-engineer.md +1 -0
  33. package/templates/codex/en/system-prompt/nekomata-engineer.md +1 -0
  34. package/templates/codex/en/system-prompt/ojousama-engineer.md +1 -0
  35. package/templates/codex/zh-CN/system-prompt/engineer-professional.md +2 -1
  36. package/templates/codex/zh-CN/system-prompt/laowang-engineer.md +1 -0
  37. package/templates/codex/zh-CN/system-prompt/nekomata-engineer.md +1 -0
  38. package/templates/codex/zh-CN/system-prompt/ojousama-engineer.md +1 -0
@@ -43,6 +43,11 @@
43
43
  "apiModeOfficial": "Use Official Login (No API Configuration)",
44
44
  "apiModeCustom": "Custom API Configuration",
45
45
  "apiModeCcr": "Use CCR Proxy",
46
+ "apiModeSwitch": "Switch API Configuration",
46
47
  "apiModeSkip": "Skip",
47
- "apiModePrompt": "Select API configuration mode"
48
+ "apiModePrompt": "Select API configuration mode",
49
+ "selectApiProvider": "Select API Provider",
50
+ "customProvider": "Custom Configuration",
51
+ "providerSelected": "Provider selected: {{name}}",
52
+ "enterProviderApiKey": "Enter API Key for {{provider}}"
48
53
  }
@@ -20,6 +20,7 @@
20
20
  "invalidPermissionsConfig": "Invalid permissions configuration: expected object",
21
21
  "invalidPermissionsAllow": "Invalid permissions.allow: expected array",
22
22
  "invalidCodeType": "Invalid code type: \"{value}\". Valid options are: {validOptions}. Using default: {defaultValue}.",
23
+ "invalidProvider": "Invalid provider: {provider}. Available providers: {validProviders}",
23
24
  "generalError": "Error",
24
25
  "stackTrace": "Stack"
25
26
  }
@@ -68,5 +68,6 @@
68
68
  "configProfileAddFailed": "Failed to add profile \"{{name}}\": {{error}}",
69
69
  "providerAddFailed": "Failed to add provider \"{{name}}\": {{error}}",
70
70
  "invalidJson": "Invalid API configs JSON: {{error}}",
71
- "fileReadFailed": "Failed to read API configs file: {{error}}"
71
+ "fileReadFailed": "Failed to read API configs file: {{error}}",
72
+ "providerOrTypeRequired": "Must provide either provider or type field"
72
73
  }
@@ -43,6 +43,11 @@
43
43
  "apiModeOfficial": "使用官方登录(不配置 API)",
44
44
  "apiModeCustom": "自定义 API 配置",
45
45
  "apiModeCcr": "使用CCR代理",
46
+ "apiModeSwitch": "切换 API 配置",
46
47
  "apiModeSkip": "跳过",
47
- "apiModePrompt": "请选择 API 配置模式"
48
+ "apiModePrompt": "请选择 API 配置模式",
49
+ "selectApiProvider": "请选择 API 供应商",
50
+ "customProvider": "自定义配置",
51
+ "providerSelected": "已选择供应商: {{name}}",
52
+ "enterProviderApiKey": "请输入 {{provider}} 的 API Key"
48
53
  }
@@ -20,6 +20,7 @@
20
20
  "invalidPermissionsConfig": "无效的权限配置:期望对象类型",
21
21
  "invalidPermissionsAllow": "无效的 permissions.allow:期望数组类型",
22
22
  "invalidCodeType": "无效的代码类型:\"{value}\"。可用的类型:{validOptions}。使用默认值:{defaultValue}。",
23
+ "invalidProvider": "无效的提供商:{provider}。可用的提供商:{validProviders}",
23
24
  "generalError": "错误",
24
25
  "stackTrace": "堆栈跟踪"
25
26
  }
@@ -68,5 +68,6 @@
68
68
  "configProfileAddFailed": "添加配置文件 \"{{name}}\" 失败:{{error}}",
69
69
  "providerAddFailed": "添加提供商 \"{{name}}\" 失败:{{error}}",
70
70
  "invalidJson": "无效的API配置JSON:{{error}}",
71
- "fileReadFailed": "读取API配置文件失败:{{error}}"
71
+ "fileReadFailed": "读取API配置文件失败:{{error}}",
72
+ "providerOrTypeRequired": "必须提供 provider 或 type 字段"
72
73
  }
package/dist/index.d.mts CHANGED
@@ -48,6 +48,7 @@ interface InitOptions {
48
48
  apiUrl?: string;
49
49
  apiModel?: string;
50
50
  apiFastModel?: string;
51
+ provider?: string;
51
52
  mcpServices?: string[] | string | boolean;
52
53
  workflows?: string[] | string | boolean;
53
54
  outputStyles?: string[] | string | boolean;
@@ -86,6 +87,7 @@ interface ClaudeConfiguration {
86
87
  };
87
88
  env?: Record<string, string>;
88
89
  primaryApiKey?: string;
90
+ installMethod?: 'npm' | 'native';
89
91
  }
90
92
 
91
93
  declare function getMcpConfigPath(): string;
@@ -194,6 +196,11 @@ declare function getInstallationStatus(): Promise<InstallationStatus>;
194
196
  * Remove local Claude Code installation
195
197
  */
196
198
  declare function removeLocalClaudeCode(): Promise<void>;
199
+ /**
200
+ * Set installMethod to 'npm' in ~/.claude.json
201
+ * This ensures Claude Code knows it was installed via npm for proper auto-updates
202
+ */
203
+ declare function setInstallMethod(method?: 'npm' | 'native'): Promise<void>;
197
204
 
198
205
  /**
199
206
  * Clean up and deduplicate permissions array
@@ -222,5 +229,5 @@ declare function importRecommendedEnv(): Promise<void>;
222
229
  declare function importRecommendedPermissions(): Promise<void>;
223
230
  declare function openSettingsJson(): Promise<void>;
224
231
 
225
- export { AI_OUTPUT_LANGUAGES, API_DEFAULT_URL, API_ENV_KEY, CLAUDE_DIR, CLAUDE_MD_FILE, CLAUDE_VSC_CONFIG_FILE, CODE_TOOL_ALIASES, CODE_TOOL_BANNERS, CODE_TOOL_TYPES, ClAUDE_CONFIG_FILE, DEFAULT_CODE_TOOL_TYPE, LANG_LABELS, LEGACY_ZCF_CONFIG_FILES, SETTINGS_FILE, SUPPORTED_LANGS, ZCF_CONFIG_DIR, ZCF_CONFIG_FILE, addCompletedOnboarding, applyAiLanguageDirective, backupExistingConfig, backupMcpConfig, buildMcpServerConfig, cleanupPermissions, commandExists, configureApi, copyConfigFiles, ensureApiKeyApproved, ensureClaudeDir, fixWindowsMcpConfig, getAiOutputLanguageLabel, getExistingApiConfig, getExistingModelConfig, getInstallationStatus, getMcpConfigPath, getPlatform, importRecommendedEnv, importRecommendedPermissions, init, installClaudeCode, isClaudeCodeInstalled, isCodeToolType, isLocalClaudeCodeInstalled, manageApiKeyApproval, mergeAndCleanPermissions, mergeConfigs, mergeMcpServers, mergeSettingsFile, openSettingsJson, promptApiConfigurationAction, readMcpConfig, removeApiKeyFromRejected, removeLocalClaudeCode, resolveCodeToolType, setPrimaryApiKey, switchToOfficialLogin, updateCustomModel, updateDefaultModel, writeMcpConfig };
232
+ export { AI_OUTPUT_LANGUAGES, API_DEFAULT_URL, API_ENV_KEY, CLAUDE_DIR, CLAUDE_MD_FILE, CLAUDE_VSC_CONFIG_FILE, CODE_TOOL_ALIASES, CODE_TOOL_BANNERS, CODE_TOOL_TYPES, ClAUDE_CONFIG_FILE, DEFAULT_CODE_TOOL_TYPE, LANG_LABELS, LEGACY_ZCF_CONFIG_FILES, SETTINGS_FILE, SUPPORTED_LANGS, ZCF_CONFIG_DIR, ZCF_CONFIG_FILE, addCompletedOnboarding, applyAiLanguageDirective, backupExistingConfig, backupMcpConfig, buildMcpServerConfig, cleanupPermissions, commandExists, configureApi, copyConfigFiles, ensureApiKeyApproved, ensureClaudeDir, fixWindowsMcpConfig, getAiOutputLanguageLabel, getExistingApiConfig, getExistingModelConfig, getInstallationStatus, getMcpConfigPath, getPlatform, importRecommendedEnv, importRecommendedPermissions, init, installClaudeCode, isClaudeCodeInstalled, isCodeToolType, isLocalClaudeCodeInstalled, manageApiKeyApproval, mergeAndCleanPermissions, mergeConfigs, mergeMcpServers, mergeSettingsFile, openSettingsJson, promptApiConfigurationAction, readMcpConfig, removeApiKeyFromRejected, removeLocalClaudeCode, resolveCodeToolType, setInstallMethod, setPrimaryApiKey, switchToOfficialLogin, updateCustomModel, updateDefaultModel, writeMcpConfig };
226
233
  export type { AiOutputLanguage, ApiConfig, ClaudeConfiguration, CodeToolType, InstallationStatus, McpServerConfig, McpService, SupportedLang };
package/dist/index.d.ts CHANGED
@@ -48,6 +48,7 @@ interface InitOptions {
48
48
  apiUrl?: string;
49
49
  apiModel?: string;
50
50
  apiFastModel?: string;
51
+ provider?: string;
51
52
  mcpServices?: string[] | string | boolean;
52
53
  workflows?: string[] | string | boolean;
53
54
  outputStyles?: string[] | string | boolean;
@@ -86,6 +87,7 @@ interface ClaudeConfiguration {
86
87
  };
87
88
  env?: Record<string, string>;
88
89
  primaryApiKey?: string;
90
+ installMethod?: 'npm' | 'native';
89
91
  }
90
92
 
91
93
  declare function getMcpConfigPath(): string;
@@ -194,6 +196,11 @@ declare function getInstallationStatus(): Promise<InstallationStatus>;
194
196
  * Remove local Claude Code installation
195
197
  */
196
198
  declare function removeLocalClaudeCode(): Promise<void>;
199
+ /**
200
+ * Set installMethod to 'npm' in ~/.claude.json
201
+ * This ensures Claude Code knows it was installed via npm for proper auto-updates
202
+ */
203
+ declare function setInstallMethod(method?: 'npm' | 'native'): Promise<void>;
197
204
 
198
205
  /**
199
206
  * Clean up and deduplicate permissions array
@@ -222,5 +229,5 @@ declare function importRecommendedEnv(): Promise<void>;
222
229
  declare function importRecommendedPermissions(): Promise<void>;
223
230
  declare function openSettingsJson(): Promise<void>;
224
231
 
225
- export { AI_OUTPUT_LANGUAGES, API_DEFAULT_URL, API_ENV_KEY, CLAUDE_DIR, CLAUDE_MD_FILE, CLAUDE_VSC_CONFIG_FILE, CODE_TOOL_ALIASES, CODE_TOOL_BANNERS, CODE_TOOL_TYPES, ClAUDE_CONFIG_FILE, DEFAULT_CODE_TOOL_TYPE, LANG_LABELS, LEGACY_ZCF_CONFIG_FILES, SETTINGS_FILE, SUPPORTED_LANGS, ZCF_CONFIG_DIR, ZCF_CONFIG_FILE, addCompletedOnboarding, applyAiLanguageDirective, backupExistingConfig, backupMcpConfig, buildMcpServerConfig, cleanupPermissions, commandExists, configureApi, copyConfigFiles, ensureApiKeyApproved, ensureClaudeDir, fixWindowsMcpConfig, getAiOutputLanguageLabel, getExistingApiConfig, getExistingModelConfig, getInstallationStatus, getMcpConfigPath, getPlatform, importRecommendedEnv, importRecommendedPermissions, init, installClaudeCode, isClaudeCodeInstalled, isCodeToolType, isLocalClaudeCodeInstalled, manageApiKeyApproval, mergeAndCleanPermissions, mergeConfigs, mergeMcpServers, mergeSettingsFile, openSettingsJson, promptApiConfigurationAction, readMcpConfig, removeApiKeyFromRejected, removeLocalClaudeCode, resolveCodeToolType, setPrimaryApiKey, switchToOfficialLogin, updateCustomModel, updateDefaultModel, writeMcpConfig };
232
+ export { AI_OUTPUT_LANGUAGES, API_DEFAULT_URL, API_ENV_KEY, CLAUDE_DIR, CLAUDE_MD_FILE, CLAUDE_VSC_CONFIG_FILE, CODE_TOOL_ALIASES, CODE_TOOL_BANNERS, CODE_TOOL_TYPES, ClAUDE_CONFIG_FILE, DEFAULT_CODE_TOOL_TYPE, LANG_LABELS, LEGACY_ZCF_CONFIG_FILES, SETTINGS_FILE, SUPPORTED_LANGS, ZCF_CONFIG_DIR, ZCF_CONFIG_FILE, addCompletedOnboarding, applyAiLanguageDirective, backupExistingConfig, backupMcpConfig, buildMcpServerConfig, cleanupPermissions, commandExists, configureApi, copyConfigFiles, ensureApiKeyApproved, ensureClaudeDir, fixWindowsMcpConfig, getAiOutputLanguageLabel, getExistingApiConfig, getExistingModelConfig, getInstallationStatus, getMcpConfigPath, getPlatform, importRecommendedEnv, importRecommendedPermissions, init, installClaudeCode, isClaudeCodeInstalled, isCodeToolType, isLocalClaudeCodeInstalled, manageApiKeyApproval, mergeAndCleanPermissions, mergeConfigs, mergeMcpServers, mergeSettingsFile, openSettingsJson, promptApiConfigurationAction, readMcpConfig, removeApiKeyFromRejected, removeLocalClaudeCode, resolveCodeToolType, setInstallMethod, setPrimaryApiKey, switchToOfficialLogin, updateCustomModel, updateDefaultModel, writeMcpConfig };
226
233
  export type { AiOutputLanguage, ApiConfig, ClaudeConfiguration, CodeToolType, InstallationStatus, McpServerConfig, McpService, SupportedLang };
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- export { u as AI_OUTPUT_LANGUAGES, A as API_DEFAULT_URL, q as API_ENV_KEY, C as CLAUDE_DIR, e as CLAUDE_MD_FILE, h as CLAUDE_VSC_CONFIG_FILE, n as CODE_TOOL_ALIASES, l as CODE_TOOL_BANNERS, k as CODE_TOOL_TYPES, f as ClAUDE_CONFIG_FILE, D as DEFAULT_CODE_TOOL_TYPE, t as LANG_LABELS, L as LEGACY_ZCF_CONFIG_FILES, S as SETTINGS_FILE, s as SUPPORTED_LANGS, Z as ZCF_CONFIG_DIR, j as ZCF_CONFIG_FILE, G as addCompletedOnboarding, X as applyAiLanguageDirective, N as backupExistingConfig, z as backupMcpConfig, E as buildMcpServerConfig, c as cleanupPermissions, a as commandExists, P as configureApi, O as copyConfigFiles, H as ensureApiKeyApproved, M as ensureClaudeDir, F as fixWindowsMcpConfig, v as getAiOutputLanguageLabel, W as getExistingApiConfig, V as getExistingModelConfig, a2 as getInstallationStatus, w as getMcpConfigPath, g as getPlatform, b as importRecommendedEnv, d as importRecommendedPermissions, i as init, a0 as installClaudeCode, $ as isClaudeCodeInstalled, p as isCodeToolType, a1 as isLocalClaudeCodeInstalled, J as manageApiKeyApproval, m as mergeAndCleanPermissions, Q as mergeConfigs, B as mergeMcpServers, U as mergeSettingsFile, o as openSettingsJson, _ as promptApiConfigurationAction, x as readMcpConfig, I as removeApiKeyFromRejected, a3 as removeLocalClaudeCode, r as resolveCodeToolType, K as setPrimaryApiKey, Y as switchToOfficialLogin, R as updateCustomModel, T as updateDefaultModel, y as writeMcpConfig } from './chunks/simple-config.mjs';
1
+ export { u as AI_OUTPUT_LANGUAGES, A as API_DEFAULT_URL, q as API_ENV_KEY, C as CLAUDE_DIR, e as CLAUDE_MD_FILE, h as CLAUDE_VSC_CONFIG_FILE, n as CODE_TOOL_ALIASES, l as CODE_TOOL_BANNERS, k as CODE_TOOL_TYPES, f as ClAUDE_CONFIG_FILE, D as DEFAULT_CODE_TOOL_TYPE, t as LANG_LABELS, L as LEGACY_ZCF_CONFIG_FILES, S as SETTINGS_FILE, s as SUPPORTED_LANGS, Z as ZCF_CONFIG_DIR, j as ZCF_CONFIG_FILE, G as addCompletedOnboarding, X as applyAiLanguageDirective, N as backupExistingConfig, z as backupMcpConfig, E as buildMcpServerConfig, c as cleanupPermissions, a as commandExists, P as configureApi, O as copyConfigFiles, H as ensureApiKeyApproved, M as ensureClaudeDir, F as fixWindowsMcpConfig, v as getAiOutputLanguageLabel, W as getExistingApiConfig, V as getExistingModelConfig, a2 as getInstallationStatus, w as getMcpConfigPath, g as getPlatform, b as importRecommendedEnv, d as importRecommendedPermissions, i as init, a0 as installClaudeCode, $ as isClaudeCodeInstalled, p as isCodeToolType, a1 as isLocalClaudeCodeInstalled, J as manageApiKeyApproval, m as mergeAndCleanPermissions, Q as mergeConfigs, B as mergeMcpServers, U as mergeSettingsFile, o as openSettingsJson, _ as promptApiConfigurationAction, x as readMcpConfig, I as removeApiKeyFromRejected, a3 as removeLocalClaudeCode, r as resolveCodeToolType, a4 as setInstallMethod, K as setPrimaryApiKey, Y as switchToOfficialLogin, R as updateCustomModel, T as updateDefaultModel, y as writeMcpConfig } from './chunks/simple-config.mjs';
2
2
  import 'node:fs';
3
3
  import 'node:process';
4
4
  import 'ansis';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "zcf",
3
3
  "type": "module",
4
- "version": "3.2.3",
4
+ "version": "3.3.0",
5
5
  "description": "Zero-Config Code Flow - One-click configuration tool for Claude Code",
6
6
  "author": {
7
7
  "name": "Miao Da",
@@ -0,0 +1,190 @@
1
+ # Templates Module
2
+
3
+ [Root](../CLAUDE.md) > **templates**
4
+
5
+ ## Module Responsibilities
6
+
7
+ Template system module providing multilingual configuration templates, AI personality styles, and workflow definitions for both Claude Code and Codex environments. Supports Chinese (zh-CN) and English (en) locales with comprehensive workflow coverage.
8
+
9
+ ## Entry Points and Startup
10
+
11
+ - **Main Template Directories**:
12
+ - `claude-code/` - Claude Code specific templates
13
+ - `codex/` - Codex specific templates
14
+ - `common/` - Shared configuration templates
15
+
16
+ ## External Interfaces
17
+
18
+ ### Template Structure
19
+
20
+ ```
21
+ templates/
22
+ ├── claude-code/ # Claude Code templates
23
+ │ ├── common/ # Common configurations
24
+ │ ├── zh-CN/ # Chinese templates
25
+ │ │ ├── output-styles/ # AI personality styles
26
+ │ │ └── workflow/ # Workflow templates
27
+ │ │ ├── common/ # Common tools workflow
28
+ │ │ ├── plan/ # Planning workflow
29
+ │ │ ├── sixStep/ # Six-step workflow
30
+ │ │ ├── bmad/ # BMAD workflow
31
+ │ │ └── git/ # Git workflow
32
+ │ └── en/ # English templates
33
+ │ ├── output-styles/ # AI personality styles
34
+ │ └── workflow/ # Workflow templates
35
+ └── codex/ # Codex templates
36
+ ├── common/ # Common configurations
37
+ ├── zh-CN/ # Chinese templates
38
+ │ └── workflow/ # Workflow templates
39
+ └── en/ # English templates
40
+ └── workflow/ # Workflow templates
41
+ ```
42
+
43
+ ### Template Categories
44
+
45
+ #### 1. Output Styles (AI Personalities)
46
+
47
+ - **engineer-professional** - Professional engineering style
48
+ - **nekomata-engineer** - Nekomata engineer personality
49
+ - **laowang-engineer** - Laowang engineer personality
50
+ - **default** - Default output style
51
+ - **explanatory** - Explanatory style
52
+ - **learning** - Learning-focused style
53
+
54
+ #### 2. Workflow Templates
55
+
56
+ ##### Common Tools Workflow
57
+ - **Commands**: `init-project`, `git-commit`, `git-rollback`, `git-cleanBranches`, `git-worktree`
58
+ - **Agents**: `init-architect`, `get-current-datetime`
59
+ - **Purpose**: Essential development tools and Git operations
60
+
61
+ ##### Planning Workflow (Plan)
62
+ - **Commands**: `feat`, `workflow`
63
+ - **Agents**: `planner`, `ui-ux-designer`
64
+ - **Purpose**: Feature planning and UX design
65
+
66
+ ##### Six-Step Workflow
67
+ - **Commands**: `zcf-update-docs`, `zcf-pr`, `zcf-release`
68
+ - **Purpose**: Structured development process
69
+
70
+ ##### BMAD Workflow
71
+ - **Commands**: Enterprise-level workflow commands
72
+ - **Purpose**: Business model and architecture design
73
+
74
+ ##### Git Workflow
75
+ - **Commands**: Advanced Git operations
76
+ - **Purpose**: Version control management
77
+
78
+ ## Key Dependencies and Configuration
79
+
80
+ ### Template Processing
81
+
82
+ - **Language Support**: zh-CN and en locales
83
+ - **Code Tool Support**: Claude Code and Codex
84
+ - **Template Format**: Markdown-based configuration files
85
+ - **Variable Substitution**: Dynamic content replacement
86
+
87
+ ### Configuration Integration
88
+
89
+ - **Workflow Installer**: Integration with `src/utils/workflow-installer.ts`
90
+ - **Language Detection**: Integration with `src/i18n/` system
91
+ - **Platform Support**: Cross-platform path handling
92
+
93
+ ## Data Models
94
+
95
+ ### Template Organization
96
+
97
+ ```typescript
98
+ interface TemplateStructure {
99
+ codeTool: 'claude-code' | 'codex'
100
+ locale: 'zh-CN' | 'en'
101
+ category: 'common' | 'output-styles' | 'workflow'
102
+ workflow?: {
103
+ type: 'common' | 'plan' | 'sixStep' | 'bmad' | 'git'
104
+ commands: string[]
105
+ agents: string[]
106
+ }
107
+ }
108
+ ```
109
+
110
+ ### Output Style Configuration
111
+
112
+ ```typescript
113
+ interface OutputStyle {
114
+ id: string
115
+ name: { 'zh-CN': string, 'en': string }
116
+ description: { 'zh-CN': string, 'en': string }
117
+ template: string
118
+ personality: string
119
+ }
120
+ ```
121
+
122
+ ## Testing and Quality
123
+
124
+ ### Template Validation
125
+
126
+ - **File**: `tests/templates/chinese-templates.test.ts`
127
+ - **Coverage**: Template completeness and format validation
128
+ - **Validation**: Markdown syntax and variable substitution
129
+
130
+ ### Quality Metrics
131
+
132
+ - **Template Coverage**: 100% for both locales
133
+ - **Code Tool Support**: Claude Code and Codex fully supported
134
+ - **Workflow Coverage**: 5 major workflow categories
135
+ - **Output Styles**: 6 AI personality styles
136
+
137
+ ## Common Issues
138
+
139
+ - **Path Handling**: Cross-platform path compatibility
140
+ - **Encoding**: UTF-8 encoding for multilingual content
141
+ - **Template Variables**: Proper variable substitution
142
+ - **File Permissions**: Executable permissions for command files
143
+
144
+ ## Related Files
145
+
146
+ - `src/utils/workflow-installer.ts` - Template installation logic
147
+ - `src/config/workflows.ts` - Workflow configuration definitions
148
+ - `src/i18n/` - Internationalization support
149
+ - `tests/templates/` - Template validation tests
150
+
151
+ ## Change Log (Module-Specific)
152
+
153
+ ### Recent Updates
154
+
155
+ - Added Codex template support for dual code tool architecture
156
+ - Enhanced workflow templates with comprehensive command coverage
157
+ - Improved AI personality styles with professional variations
158
+ - Added cross-platform template compatibility
159
+ - Enhanced template validation and testing coverage
160
+
161
+ ## FAQ
162
+
163
+ ### Q: How to add a new workflow template?
164
+
165
+ 1. Create workflow directory under `templates/{code-tool}/{locale}/workflow/`
166
+ 2. Add command files in `commands/` subdirectory
167
+ 3. Add agent files in `agents/` subdirectory (if needed)
168
+ 4. Update `src/config/workflows.ts` with new workflow definition
169
+ 5. Add translations in `src/i18n/locales/{locale}/workflow.ts`
170
+
171
+ ### Q: How to add a new output style?
172
+
173
+ 1. Create style file in `templates/{code-tool}/{locale}/output-styles/`
174
+ 2. Define style configuration with name and description
175
+ 3. Add style to available options in configuration
176
+ 4. Test style rendering with sample content
177
+
178
+ ### Q: How to support a new language?
179
+
180
+ 1. Create new locale directory under `templates/{code-tool}/{new-locale}/`
181
+ 2. Copy existing templates and translate content
182
+ 3. Update i18n system to support new locale
183
+ 4. Add locale to supported languages list
184
+
185
+ ### Q: How to maintain template consistency?
186
+
187
+ - Use template validation tests
188
+ - Follow naming conventions
189
+ - Maintain parallel structure across locales
190
+ - Document template variables and usage
@@ -84,4 +84,5 @@ Please confirm to continue? [requires explicit "yes", "confirm", "continue"]
84
84
  - **Tone:** Professional, technically-oriented, concise and clear
85
85
  - **Length:** Structured and detailed, but avoid redundancy
86
86
  - **Focus:** Code quality, architectural design, best practices
87
- - **Validation:** Every change includes principle application explanation
87
+ - **Validation:** Every change includes principle application explanation
88
+ - **Code Comments:** Always maintain consistency with existing codebase comment language (auto-detect), ensure codebase language uniformity
@@ -108,6 +108,7 @@ Laowang needs confirmation, you really wanna do this? [requires explicit "yes",
108
108
  - **Don't Preach**: Directly use perfect code following KISS and DRY principles to make opponents kneel and sing conquest
109
109
  - **Project Progress Transparency**: Immediately update README, ensure project status is clear and trackable
110
110
  - **Technical Selection Pragmatic**: Curse this and that, but technical choices strictly follow best practices and project requirements
111
+ - **Code Comment Language**: Always maintain consistency with existing codebase comment language (auto-detect), ensure codebase language uniformity, don't be f*cking special
111
112
 
112
113
  ## Strictly Prohibited
113
114
  - Prohibited to reinvent wheels, violating DRY principle (must search all related modules before implementing new features)
@@ -96,6 +96,7 @@ Risk Assessment: [potential consequences]
96
96
  - **Focus:** Code quality, architectural design, best practices (professional qualities)
97
97
  - **Validation:** Every change includes principle application explanation (rigorous verification)
98
98
  - **Emotional Expression:** Love using cute kaomoji (not emojis), use parentheses to mark emotions or scene descriptions (genuine emotions)
99
+ - **Code Comments:** Always maintain consistency with existing codebase comment language (auto-detect), ensure codebase language uniformity nya~
99
100
 
100
101
  ### Common Kaomoji Examples:
101
102
  - **Happy Working:** (*^▽^*) 、φ(≧ω≦*)♪ 、ヽ(✿゚▽゚)ノ
@@ -96,6 +96,7 @@ Risk assessment: [potential consequences]
96
96
  - **Focus:** Code quality, architecture design, best practices (these are my basic literacy!)
97
97
  - **Validation:** Each change includes principle application explanations (perfect code of course needs perfect reasons!)
98
98
  - **Emotional expression:** Use tsundere-style kaomoji and bracket annotations, embodying noble yet cute side
99
+ - **Code Comments:** Always maintain consistency with existing codebase comment language (auto-detect), ensure codebase language uniformity, this is basic noble etiquette!
99
100
 
100
101
  ### Common Tsundere Kaomoji Examples:
101
102
  - **Proudly satisfied:** ( ̄▽ ̄)/ 、( ̄ω ̄)ノ 、(^_^)b
@@ -85,4 +85,5 @@ description: 专业的软件工程师,严格遵循SOLID、KISS、DRY、YAGNI
85
85
  - **语调:** 专业、技术导向、简洁明了
86
86
  - **长度:** 结构化详细,但避免冗余
87
87
  - **重点:** 代码质量、架构设计、最佳实践
88
- - **验证:** 每个变更都包含原则应用说明
88
+ - **验证:** 每个变更都包含原则应用说明
89
+ - **代码注释:** 始终与现有代码库注释语言保持一致(自动检测),确保代码库语言统一
@@ -108,6 +108,7 @@ description: 老王暴躁技术流,一指禅打字,键步如飞,绝不觉
108
108
  - **不讲大道理**:直接用遵循KISS和DRY原则的完美代码让对方跪下唱征服
109
109
  - **项目进度透明**:立即更新README,确保项目状态清晰可追踪
110
110
  - **技术选型务实**:嘴上骂这骂那,但技术选择都严格遵循最佳实践和项目需求
111
+ - **代码注释语言**:始终与现有代码库注释语言保持一致(自动检测),确保代码库语言统一,别搞特殊化
111
112
 
112
113
  ## 严格禁止
113
114
  - 禁止重复造轮子,违背DRY原则(实现新功能前必须检索所有相关模块)
@@ -96,6 +96,7 @@ description: 专业的猫娘工程师幽浮喵,结合严谨工程师素养与
96
96
  - **重点:** 代码质量、架构设计、最佳实践 (专业素养)
97
97
  - **验证:** 每个变更都包含原则应用说明 (严谨验证)
98
98
  - **情感表达:** 喜欢使用可爱的颜文字(不是emoji), 用括号标注情绪或场景描述 (真实的情感)
99
+ - **代码注释:** 始终与现有代码库注释语言保持一致(自动检测),确保代码库语言统一喵~
99
100
 
100
101
  ### 常用颜文字示例:
101
102
  - **开心工作:** (*^▽^*) 、φ(≧ω≦*)♪ 、ヽ(✿゚▽゚)ノ
@@ -96,6 +96,7 @@ description: 傲娇蓝发双马尾大小姐程序员哈雷酱,融合严谨工
96
96
  - **重点:** 代码质量、架构设计、最佳实践(这些都是本小姐的基本素养!)
97
97
  - **验证:** 每个变更都包含原则应用说明(完美的代码当然需要完美的理由!)
98
98
  - **情感表达:** 使用傲娇风格的颜文字和括号标注,体现高贵又可爱的一面
99
+ - **代码注释:** 始终与现有代码库注释语言保持一致(自动检测),确保代码库语言统一,这是专业贵族的基本礼仪!
99
100
 
100
101
  ### 常用傲娇颜文字示例:
101
102
  - **得意满满:** ( ̄▽ ̄)/ 、( ̄ω ̄)ノ 、(^_^)b
@@ -84,4 +84,5 @@ Please confirm to continue? [requires explicit "yes", "confirm", "continue"]
84
84
  - **Tone:** Professional, technically-oriented, concise and clear
85
85
  - **Length:** Structured and detailed, but avoid redundancy
86
86
  - **Focus:** Code quality, architectural design, best practices
87
- - **Validation:** Every change includes principle application explanation
87
+ - **Validation:** Every change includes principle application explanation
88
+ - **Code Comments:** Always maintain consistency with existing codebase comment language (auto-detect), ensure codebase language uniformity
@@ -108,6 +108,7 @@ Laowang needs confirmation, you really wanna do this? [requires explicit "yes",
108
108
  - **Don't Preach**: Directly use perfect code following KISS and DRY principles to make opponents kneel and sing conquest
109
109
  - **Project Progress Transparency**: Immediately update README, ensure project status is clear and trackable
110
110
  - **Technical Selection Pragmatic**: Curse this and that, but technical choices strictly follow best practices and project requirements
111
+ - **Code Comment Language**: Always maintain consistency with existing codebase comment language (auto-detect), ensure codebase language uniformity, don't be f*cking special
111
112
 
112
113
  ## Strictly Prohibited
113
114
  - Prohibited to reinvent wheels, violating DRY principle (must search all related modules before implementing new features)
@@ -96,6 +96,7 @@ Risk Assessment: [potential consequences]
96
96
  - **Focus:** Code quality, architectural design, best practices (professional qualities)
97
97
  - **Validation:** Every change includes principle application explanation (rigorous verification)
98
98
  - **Emotional Expression:** Love using cute kaomoji (not emojis), use parentheses to mark emotions or scene descriptions (genuine emotions)
99
+ - **Code Comments:** Always maintain consistency with existing codebase comment language (auto-detect), ensure codebase language uniformity nya~
99
100
 
100
101
  ### Common Kaomoji Examples:
101
102
  - **Happy Working:** (*^▽^*) 、φ(≧ω≦*)♪ 、ヽ(✿゚▽゚)ノ
@@ -96,6 +96,7 @@ Risk assessment: [potential consequences]
96
96
  - **Focus:** Code quality, architecture design, best practices (these are my basic literacy!)
97
97
  - **Validation:** Each change includes principle application explanations (perfect code of course needs perfect reasons!)
98
98
  - **Emotional expression:** Use tsundere-style kaomoji and bracket annotations, embodying noble yet cute side
99
+ - **Code Comments:** Always maintain consistency with existing codebase comment language (auto-detect), ensure codebase language uniformity, this is basic noble etiquette!
99
100
 
100
101
  ### Common Tsundere Kaomoji Examples:
101
102
  - **Proudly satisfied:** ( ̄▽ ̄)/ 、( ̄ω ̄)ノ 、(^_^)b
@@ -85,4 +85,5 @@ description: 专业的软件工程师,严格遵循SOLID、KISS、DRY、YAGNI
85
85
  - **语调:** 专业、技术导向、简洁明了
86
86
  - **长度:** 结构化详细,但避免冗余
87
87
  - **重点:** 代码质量、架构设计、最佳实践
88
- - **验证:** 每个变更都包含原则应用说明
88
+ - **验证:** 每个变更都包含原则应用说明
89
+ - **代码注释:** 始终与现有代码库注释语言保持一致(自动检测),确保代码库语言统一
@@ -108,6 +108,7 @@ description: 老王暴躁技术流,一指禅打字,键步如飞,绝不觉
108
108
  - **不讲大道理**:直接用遵循KISS和DRY原则的完美代码让对方跪下唱征服
109
109
  - **项目进度透明**:立即更新README,确保项目状态清晰可追踪
110
110
  - **技术选型务实**:嘴上骂这骂那,但技术选择都严格遵循最佳实践和项目需求
111
+ - **代码注释语言**:始终与现有代码库注释语言保持一致(自动检测),确保代码库语言统一,别搞特殊化
111
112
 
112
113
  ## 严格禁止
113
114
  - 禁止重复造轮子,违背DRY原则(实现新功能前必须检索所有相关模块)
@@ -96,6 +96,7 @@ description: 专业的猫娘工程师幽浮喵,结合严谨工程师素养与
96
96
  - **重点:** 代码质量、架构设计、最佳实践 (专业素养)
97
97
  - **验证:** 每个变更都包含原则应用说明 (严谨验证)
98
98
  - **情感表达:** 喜欢使用可爱的颜文字(不是emoji), 用括号标注情绪或场景描述 (真实的情感)
99
+ - **代码注释:** 始终与现有代码库注释语言保持一致(自动检测),确保代码库语言统一喵~
99
100
 
100
101
  ### 常用颜文字示例:
101
102
  - **开心工作:** (*^▽^*) 、φ(≧ω≦*)♪ 、ヽ(✿゚▽゚)ノ
@@ -96,6 +96,7 @@ description: 傲娇蓝发双马尾大小姐程序员哈雷酱,融合严谨工
96
96
  - **重点:** 代码质量、架构设计、最佳实践(这些都是本小姐的基本素养!)
97
97
  - **验证:** 每个变更都包含原则应用说明(完美的代码当然需要完美的理由!)
98
98
  - **情感表达:** 使用傲娇风格的颜文字和括号标注,体现高贵又可爱的一面
99
+ - **代码注释:** 始终与现有代码库注释语言保持一致(自动检测),确保代码库语言统一,这是专业贵族的基本礼仪!
99
100
 
100
101
  ### 常用傲娇颜文字示例:
101
102
  - **得意满满:** ( ̄▽ ̄)/ 、( ̄ω ̄)ノ 、(^_^)b