zcf 2.10.2 → 2.11.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 (33) hide show
  1. package/README.md +29 -24
  2. package/bin/zcf.mjs +1 -1
  3. package/dist/chunks/simple-config.mjs +938 -897
  4. package/dist/cli.mjs +286 -256
  5. package/dist/index.d.mts +13 -13
  6. package/dist/index.d.ts +13 -13
  7. package/dist/index.mjs +3 -4
  8. package/package.json +20 -15
  9. package/templates/CLAUDE.md +249 -5
  10. package/templates/common/CLAUDE.md +5 -0
  11. package/templates/en/memory/mcp.md +4 -1
  12. package/templates/en/memory/personality.md +1 -1
  13. package/templates/en/memory/rules.md +1 -4
  14. package/templates/en/workflow/bmad/commands/bmad-init.md +58 -56
  15. package/templates/en/workflow/common/agents/get-current-datetime.md +29 -0
  16. package/templates/en/workflow/common/agents/init-architect.md +114 -0
  17. package/templates/en/workflow/common/commands/init-project.md +53 -0
  18. package/templates/en/workflow/git/commands/git-cleanBranches.md +2 -1
  19. package/templates/en/workflow/git/commands/git-commit.md +36 -31
  20. package/templates/en/workflow/git/commands/git-rollback.md +27 -26
  21. package/templates/en/workflow/git/commands/git-worktree.md +145 -221
  22. package/templates/zh-CN/memory/mcp.md +4 -1
  23. package/templates/zh-CN/memory/personality.md +1 -1
  24. package/templates/zh-CN/memory/rules.md +1 -4
  25. package/templates/zh-CN/workflow/bmad/commands/bmad-init.md +58 -55
  26. package/templates/zh-CN/workflow/common/agents/get-current-datetime.md +29 -0
  27. package/templates/zh-CN/workflow/common/agents/init-architect.md +114 -0
  28. package/templates/zh-CN/workflow/common/commands/init-project.md +53 -0
  29. package/templates/zh-CN/workflow/git/commands/git-cleanBranches.md +2 -1
  30. package/templates/zh-CN/workflow/git/commands/git-commit.md +0 -5
  31. package/templates/zh-CN/workflow/git/commands/git-rollback.md +1 -1
  32. package/templates/zh-CN/workflow/git/commands/git-worktree.md +145 -221
  33. /package/templates/{settings.json → common/settings.json} +0 -0
@@ -1,301 +1,225 @@
1
1
  ---
2
- description: Manage Git worktrees, support add/list/remove/migrate operations, create in .zcf/ directory by default, auto-configure git ignore rules, support IDE quick open and content migration
3
- allowed-tools: Read(**), Exec(git worktree add, git worktree list, git worktree remove, git worktree prune, git branch, git checkout, git rev-parse, git stash, git cp, code, cursor, webstorm), Write(.git/info/exclude)
2
+ description: Manage Git worktrees in project-level ../.zcf/project-name/ directory with smart defaults, IDE integration and content migration
3
+ allowed-tools: Read(**), Exec(git worktree add, git worktree list, git worktree remove, git worktree prune, git branch, git checkout, git rev-parse, git stash, git cp, detect-ide, open-ide, which, command, basename, dirname)
4
4
  argument-hint: <add|list|remove|prune|migrate> [path] [-b <branch>] [-o|--open] [--track] [--guess-remote] [--detach] [--checkout] [--lock] [--migrate-from <source-path>] [--migrate-stash]
5
5
  # examples:
6
- # - /git-worktree add feature-ui # create worktree, ask whether to open in IDE by default
6
+ # - /git-worktree add feature-ui # create new branch 'feature-ui' from main/master
7
7
  # - /git-worktree add feature-ui -o # create worktree and open directly in IDE
8
- # - /git-worktree add hotfix -b fix/login -o # create new branch, worktree and open in IDE directly
9
- # - /git-worktree migrate feature-ui --from main # migrate uncommitted content from main branch to feature-ui worktree
10
- # - /git-worktree migrate feature-ui --stash # migrate current stash content to feature-ui worktree
8
+ # - /git-worktree add hotfix -b fix/login -o # create new branch 'fix/login' with path 'hotfix'
9
+ # - /git-worktree migrate feature-ui --from main # migrate uncommitted content from main to feature-ui
10
+ # - /git-worktree migrate feature-ui --stash # migrate current stash to feature-ui
11
11
  ---
12
12
 
13
13
  # Claude Command: Git Worktree
14
14
 
15
- **Purpose**: Provide Git worktree quick operations, manage multiple working trees in `.zcf/` directory by default, auto-handle git ignore configuration, support IDE quick open and cross-worktree content migration.
15
+ Manage Git worktrees with smart defaults, IDE integration and content migration in structured `../.zcf/project-name/` paths.
16
+
17
+ Execute commands directly and provide concise results.
16
18
 
17
19
  ---
18
20
 
19
21
  ## Usage
20
22
 
21
23
  ```bash
22
- # Add worktree (default in .zcf/)
23
- /git-worktree add <path> # checkout same-name branch to .zcf/<path>, ask whether to open IDE
24
- /git-worktree add <path> -b <branch> # create new branch and add worktree
24
+ # Basic operations
25
+ /git-worktree add <path> # create new branch named <path> from main/master
26
+ /git-worktree add <path> -b <branch> # create new branch with specified name
25
27
  /git-worktree add <path> -o # create and open directly in IDE
26
- /git-worktree add <path> -b <branch> --open # create new branch, worktree and open directly
27
-
28
- # Content migration
29
- /git-worktree migrate <target-path> --from <source-path> # migrate uncommitted content
30
- /git-worktree migrate <target-path> --stash # migrate stash content
31
-
32
- # Other operations
33
28
  /git-worktree list # show all worktree status
34
29
  /git-worktree remove <path> # remove specified worktree
35
- /git-worktree prune # clean invalid worktree records
30
+ /git-worktree prune # clean invalid worktree references
31
+
32
+ # Content migration
33
+ /git-worktree migrate <target> --from <source> # migrate uncommitted content
34
+ /git-worktree migrate <target> --stash # migrate stash content
36
35
  ```
37
36
 
38
37
  ### Options
39
38
 
40
- | Option | Description |
41
- |--------|-------------|
42
- | `add <path>` | Add new worktree in `.zcf/<path>` |
43
- | `migrate <target>` | Migrate content to specified worktree |
44
- | `list` | List all worktrees and their status |
45
- | `remove <path>` | Remove worktree at specified path |
46
- | `prune` | Clean invalid worktree references |
47
- | `-b <branch>` | Create new branch and checkout to worktree |
48
- | `-o, --open` | Open directly in IDE after creation (skip prompt) |
49
- | `--from <source>` | Specify migration source path (migrate only) |
50
- | `--stash` | Migrate current stash content (migrate only) |
51
- | `--track` | Set new branch to track corresponding remote branch |
52
- | `--guess-remote` | Auto guess remote branch for tracking |
53
- | `--detach` | Create detached HEAD worktree |
54
- | `--checkout` | Checkout immediately after creation (default behavior) |
55
- | `--lock` | Lock worktree after creation |
39
+ | Option | Description |
40
+ | ------------------ | ------------------------------------------------------ |
41
+ | `add [<path>]` | Add new worktree in `../.zcf/project-name/<path>` |
42
+ | `migrate <target>` | Migrate content to specified worktree |
43
+ | `list` | List all worktrees and their status |
44
+ | `remove <path>` | Remove worktree at specified path |
45
+ | `prune` | Clean invalid worktree references |
46
+ | `-b <branch>` | Create new branch and checkout to worktree |
47
+ | `-o, --open` | Open directly in IDE after creation (skip prompt) |
48
+ | `--from <source>` | Specify migration source path (migrate only) |
49
+ | `--stash` | Migrate current stash content (migrate only) |
50
+ | `--track` | Set new branch to track corresponding remote branch |
51
+ | `--guess-remote` | Auto guess remote branch for tracking |
52
+ | `--detach` | Create detached HEAD worktree |
53
+ | `--checkout` | Checkout immediately after creation (default behavior) |
54
+ | `--lock` | Lock worktree after creation |
56
55
 
57
56
  ---
58
57
 
59
58
  ## What This Command Does
60
59
 
61
- ### 1. **Environment Check**
62
- - Confirm in Git repository via `git rev-parse --is-inside-work-tree`
60
+ 1. **Environment Check**
61
+ - Verify Git repository using `git rev-parse --is-inside-work-tree`
62
+ - Detect whether in main repo or existing worktree for smart path calculation
63
63
 
64
- ### 2. **Ignore Rules Configuration**
65
- - Check if `.git/info/exclude` contains `/.zcf/` rule
66
- - Auto-add `/.zcf/` to `.git/info/exclude` if not exists
64
+ 2. **Smart Path Management**
65
+ - Auto-calculate project name from main repository path using worktree detection
66
+ - Create worktrees in structured `../.zcf/project-name/<path>` directory
67
+ - Handle both main repo and worktree execution contexts correctly
67
68
 
68
- ### 3. **Worktree Operations**
69
- - **add**: Create new worktree in `.zcf/<path>`
70
- - **list**: Show all worktree paths, branches and status
71
- - **remove**: Safely remove specified worktree
72
- - **prune**: Clean orphaned worktree records
69
+ ```bash
70
+ # Core path calculation logic for worktree detection
71
+ get_main_repo_path() {
72
+ local git_common_dir=$(git rev-parse --git-common-dir 2>/dev/null)
73
+ local current_toplevel=$(git rev-parse --show-toplevel 2>/dev/null)
74
+
75
+ # Check if in worktree
76
+ if [[ "$git_common_dir" != "$current_toplevel/.git" ]]; then
77
+ # In worktree, derive main repo path from git-common-dir
78
+ dirname "$git_common_dir"
79
+ else
80
+ # In main repository
81
+ echo "$current_toplevel"
82
+ fi
83
+ }
73
84
 
74
- ### 4. **🆕 IDE Quick Open Feature**
75
- - **Default behavior**: Ask whether to open new worktree in IDE after `add` operation
76
- - **Direct open**: Use `-o/--open` parameter to skip prompt and open directly
77
- - **IDE detection**: Auto-detect common IDEs (VS Code, Cursor, WebStorm, etc.)
78
- - **Smart selection**: Recommend best choice based on project type and installed IDEs
85
+ MAIN_REPO_PATH=$(get_main_repo_path)
86
+ PROJECT_NAME=$(basename "$MAIN_REPO_PATH")
87
+ WORKTREE_BASE="$MAIN_REPO_PATH/../.zcf/$PROJECT_NAME"
79
88
 
80
- ### 5. **🆕 Content Migration Feature**
81
- - **Uncommitted content migration**: Migrate uncommitted changes from one worktree to another
82
- - **Stash migration**: Apply current stash content to target worktree
83
- - **Safety check**: Check target worktree status before migration to avoid conflicts
89
+ # Always use absolute path to prevent nesting issues
90
+ ABSOLUTE_WORKTREE_PATH="$WORKTREE_BASE/<path>"
91
+ ```
84
92
 
85
- ### 6. **Path Handling**
86
- - Auto-add `.zcf/` prefix to all relative paths
87
- - Keep absolute paths as-is
88
- - Auto-create `.zcf/` directory if not exists
93
+ **Critical Fix**: Always use absolute paths when creating worktrees from within existing worktrees to prevent path nesting issues like `../.zcf/project/.zcf/project/path`.
89
94
 
90
- ### 7. **Branch Management**
91
- - Support checking out existing branches or creating new branches
92
- - Auto-handle remote branch tracking
93
- - Provide branch status and HEAD position info
95
+ 3. **Worktree Operations**
96
+ - **add**: Create new worktree with smart branch/path defaults
97
+ - **list**: Display all worktrees with branches and status
98
+ - **remove**: Safely remove worktree and clean references
99
+ - **prune**: Clean orphaned worktree records
94
100
 
95
- ---
101
+ 4. **Smart Defaults**
102
+ - **Branch creation**: When no `-b` specified, create new branch using path name
103
+ - **Base branch**: New branches created from main/master branch
104
+ - **Path resolution**: Use branch name as path when unspecified
105
+ - **IDE integration**: Auto-detect and prompt for IDE opening
96
106
 
97
- ## Enhanced Features
107
+ 5. **Content Migration**
108
+ - Migrate uncommitted changes between worktrees
109
+ - Apply stash content to target worktree
110
+ - Safety checks to prevent conflicts
98
111
 
99
- ### 🖥️ **IDE Integration**
112
+ 6. **Safety Features**
113
+ - **Path conflict prevention**: Check for existing directories before creation
114
+ - **Branch checkout validation**: Ensure branches aren't already in use
115
+ - **Absolute path enforcement**: Prevent nested `.zcf` directories when in worktree
116
+ - **Auto-cleanup on removal**: Clean both directory and git references
117
+ - **Clear status reporting**: Display worktree locations and branch status
100
118
 
101
- **Supported IDEs**
102
- - **VS Code**: `code <path>`
103
- - **Cursor**: `cursor <path>`
104
- - **WebStorm**: `webstorm <path>`
105
- - **Others**: Configurable custom IDE commands
119
+ ---
106
120
 
107
- **Open Modes**
108
- ```bash
109
- # Default: ask whether to open after creation
110
- /git-worktree add feature-ui
111
- # Output: 🖥️ Open .zcf/feature-ui in IDE? [y/n]:
121
+ ## Enhanced Features
112
122
 
113
- # Direct open: skip prompt
114
- /git-worktree add feature-ui -o
115
- # Output: 🚀 Opening .zcf/feature-ui in VS Code...
116
- ```
123
+ ### IDE Integration
117
124
 
118
- **Smart Detection Flow**
119
- 1. Check installed IDEs in system
120
- 2. Recommend based on project type (e.g., recommend VS Code for Node.js projects)
121
- 3. Provide selection menu for user choice (default mode)
122
- 4. Remember user preference for next time
125
+ - **Auto-detection**: VS Code → Cursor → WebStorm → Sublime Text → Vim
126
+ - **Smart prompting**: Ask to open in IDE after worktree creation
127
+ - **Direct open**: Use `-o` flag to skip prompt and open immediately
128
+ - **Custom configuration**: Configurable via git config
123
129
 
124
- ### 📦 **Content Migration System**
130
+ ### Content Migration System
125
131
 
126
- **Migration Types**
127
132
  ```bash
128
- # Migrate uncommitted content from main branch
133
+ # Migrate uncommitted changes
129
134
  /git-worktree migrate feature-ui --from main
135
+ /git-worktree migrate hotfix --from ../other-worktree
130
136
 
131
- # Migrate from other worktree
132
- /git-worktree migrate hotfix --from .zcf/feature-ui
133
-
134
- # Migrate current stash
137
+ # Migrate stash content
135
138
  /git-worktree migrate feature-ui --stash
136
-
137
- # Migrate specific stash
138
- /git-worktree migrate feature-ui --stash stash@{2}
139
139
  ```
140
140
 
141
- **Migration Flow**
142
- 1. **Source check**: Verify source path exists and has uncommitted content
143
- 2. **Target check**: Ensure target worktree working directory is clean
144
- 3. **Content analysis**: Show files and changes to be migrated
145
- 4. **Safe migration**: Use git native commands to ensure data safety
146
- 5. **Result confirmation**: Show migration results and follow-up suggestions
141
+ **Migration Flow**:
147
142
 
148
- ---
149
-
150
- ## Safety Features
151
-
152
- - **Path check**: Prevent creating worktree in existing directory
153
- - **Branch conflict check**: Avoid same branch being checked out by multiple worktrees
154
- - **Auto cleanup**: Remove operation cleans both directory and git references
155
- - **Status display**: Clearly show each worktree's branch, commit and status
156
-
157
- ### **Migration Safety Protection**
158
- - **Conflict detection**: Check for potential file conflicts before migration
159
- - **Backup mechanism**: Auto-create stash backup before migration
160
- - **Rollback support**: Provide rollback solution when migration fails
161
- - **Status validation**: Ensure source and target worktrees are in correct state
162
-
163
- ### **IDE Integration Safety**
164
- - **Path validation**: Ensure IDE commands use correct paths
165
- - **Permission check**: Verify IDE executable permissions
166
- - **Error handling**: Friendly error messages when IDE startup fails
143
+ 1. Verify source has uncommitted content
144
+ 2. Ensure target worktree is clean
145
+ 3. Show changes to be migrated
146
+ 4. Execute safe migration using git commands
147
+ 5. Confirm results and suggest next steps
167
148
 
168
149
  ---
169
150
 
170
151
  ## Examples
171
152
 
172
- ### **Basic Usage + IDE Open**
173
153
  ```bash
174
- # Create worktree and ask for IDE open (default behavior)
175
- /git-worktree add feature-ui
176
- # Output:
177
- # Worktree created at .zcf/feature-ui
178
- # 🖥️ Detected IDEs:
179
- # 1. VS Code (recommended)
180
- # 2. Cursor
181
- # Open this worktree in IDE? [1/2/n]: 1
182
- # 🚀 Opening .zcf/feature-ui in VS Code...
183
-
184
- # Create worktree and open IDE directly
185
- /git-worktree add feature-ui -o
186
- # Output:
187
- # Worktree created at .zcf/feature-ui
188
- # 🚀 Opening .zcf/feature-ui in VS Code...
189
-
190
- # Create new branch and open directly
191
- /git-worktree add hotfix -b fix/login --open
192
- # Output:
193
- # ✅ Created branch 'fix/login' and worktree at .zcf/hotfix
194
- # 🚀 Opening .zcf/hotfix in VS Code...
154
+ # Basic usage
155
+ /git-worktree add feature-ui # create new branch 'feature-ui' from main/master
156
+ /git-worktree add feature-ui -b my-feature # create new branch 'my-feature' with path 'feature-ui'
157
+ /git-worktree add feature-ui -o # create and open in IDE directly
158
+
159
+ # Content migration scenarios
160
+ /git-worktree add feature-ui -b feature/new-ui # create new feature worktree
161
+ /git-worktree migrate feature-ui --from main # migrate uncommitted changes
162
+ /git-worktree migrate hotfix --stash # migrate stash content
163
+
164
+ # Management operations
165
+ /git-worktree list # view all worktrees
166
+ /git-worktree remove feature-ui # remove unneeded worktree
167
+ /git-worktree prune # clean invalid references
195
168
  ```
196
169
 
197
- ### **Content Migration Scenarios**
198
- ```bash
199
- # Scenario: developed some features on main branch, want to move to new branch
200
- # 1. Create new feature worktree
201
- /git-worktree add feature-ui -b feature/new-ui
202
-
203
- # 2. Migrate uncommitted content from main
204
- /git-worktree migrate feature-ui --from main
205
- # Output:
206
- # 📦 Found uncommitted content:
207
- # M src/components/Button.tsx
208
- # A src/components/Modal.tsx
209
- # ?? src/styles/new-theme.css
210
- # 🔄 Migrating to .zcf/feature-ui...
211
- # ✅ Migration completed! Suggest committing these changes in new worktree.
212
-
213
- # 3. Ask whether to open IDE (since -o wasn't used during creation)
214
- # 🖥️ Open .zcf/feature-ui in IDE? [y/n]: y
215
- ```
170
+ **Example Output**:
216
171
 
217
- ### **Stash Migration**
218
- ```bash
219
- # Have some stashes, want to apply to specific worktree
220
- /git-worktree migrate hotfix --stash
221
- # Output:
222
- # 📋 Found stashes:
223
- # stash@{0}: WIP on main: fix user login
224
- # stash@{1}: WIP on main: update docs
225
- # Select stash to migrate [0/1]: 0
226
- # 🔄 Applying stash@{0} to .zcf/hotfix...
227
- # ✅ Stash content applied successfully!
228
172
  ```
229
-
230
- ### **List and Manage Worktrees**
231
- ```bash
232
- # View all worktrees
233
- /git-worktree list
234
- # Output:
235
- # /path/to/project [main] ← main working tree
236
- # /path/to/project/.zcf/feature-ui [feature/new-ui]
237
- # /path/to/project/.zcf/hotfix [fix/login]
238
-
239
- # Remove unneeded worktree
240
- /git-worktree remove feature-ui
241
- # Output:
242
- # ✅ Worktree .zcf/feature-ui removed successfully
243
-
244
- # Clean invalid references
245
- /git-worktree prune
246
- # Output:
247
- # 🧹 Pruned 0 worktree entries
173
+ ✅ Worktree created at ../.zcf/project-name/feature-ui
174
+ 🖥️ Open ../.zcf/project-name/feature-ui in IDE? [y/n]: y
175
+ 🚀 Opening ../.zcf/project-name/feature-ui in VS Code...
248
176
  ```
249
177
 
250
178
  ---
251
179
 
252
180
  ## Directory Structure
253
181
 
254
- After using this command, project structure will be:
255
182
  ```
256
- your-project/
257
- ├── .git/
258
- ├── .zcf/ # worktree directory (ignored by git)
259
- ├── feature-ui/ # feature-ui branch working tree
260
- │ ├── hotfix/ # hotfix branch working tree
261
- │ ├── debug/ # debug working tree
262
- │ └── .worktree-config # worktree config file
263
- ├── src/ # main working tree source
264
- └── package.json # main working tree files
183
+ parent-directory/
184
+ ├── your-project/ # main project
185
+ ├── .git/
186
+ └── src/
187
+ └── .zcf/ # worktree management
188
+ └── your-project/ # project worktrees
189
+ ├── feature-ui/ # feature branch
190
+ ├── hotfix/ # hotfix branch
191
+ └── debug/ # debug worktree
265
192
  ```
266
193
 
267
194
  ---
268
195
 
269
196
  ## Configuration
270
197
 
271
- ### **IDE Preferences**
272
- Command saves user preferences in `.zcf/.worktree-config`:
273
- ```json
274
- {
275
- "preferredIDE": "code",
276
- "autoOpenIDE": false,
277
- "migrateBackup": true,
278
- "defaultWorktreeDir": ".zcf"
279
- }
280
- ```
198
+ ### IDE Configuration
199
+
200
+ - Supports VS Code, Cursor, WebStorm, Sublime Text, Vim
201
+ - Configurable via git config for custom IDEs
202
+ - Auto-detection with priority-based selection
203
+
204
+ ### Custom IDE Setup
281
205
 
282
- ### **Custom IDE Commands**
283
206
  ```bash
284
- # Set custom IDE
285
- git config worktree.ide.custom "subl %s" # Sublime Text
286
- git config worktree.ide.preferred "custom"
207
+ # Configure custom IDE
208
+ git config worktree.ide.custom.sublime "subl %s"
209
+ git config worktree.ide.preferred "sublime"
210
+
211
+ # Control auto-detection
212
+ git config worktree.ide.autodetect true # default
287
213
  ```
288
214
 
289
215
  ---
290
216
 
291
217
  ## Notes
292
218
 
293
- - **Performance optimization**: Worktrees share `.git` directory, saving disk space
294
- - **IDE support**: Most modern IDEs support multi-worktree projects
295
- - **Cleanup suggestion**: Regularly run `prune` to clean invalid references
296
- - **Branch protection**: Avoid operations on protected branches (like main/master)
297
- - **Migration limitation**: Can only migrate uncommitted changes, use `git cherry-pick` for committed content
298
- - **IDE requirement**: IDE command-line tools must be installed and in PATH
299
- - **Cross-platform support**: IDE detection and startup support Windows, macOS, Linux
219
+ - **Performance**: Worktrees share `.git` directory, saving disk space
220
+ - **Safety**: Path conflict prevention and branch checkout validation
221
+ - **Migration**: Only uncommitted changes; use `git cherry-pick` for commits
222
+ - **IDE requirement**: Command-line tools must be in PATH
223
+ - **Cross-platform**: Supports Windows, macOS, Linux
300
224
 
301
- ---
225
+ ---
@@ -1,6 +1,7 @@
1
1
  ## MCP 服务使用指南
2
2
 
3
3
  ### 文档与代码查询
4
+
4
5
  - **Context7**: 查询最新库文档和代码示例
5
6
  - 使用场景:需要了解新框架或库的用法时
6
7
  - 示例:查询 React Hooks、Vue Composition API 等
@@ -10,13 +11,15 @@
10
11
  - 示例:查看项目架构、贡献指南等
11
12
 
12
13
  ### 信息搜索
14
+
13
15
  - **Exa**: AI 驱动的网页搜索
14
16
  - 实时搜索最新技术资讯
15
17
  - 抓取特定 URL 的完整内容
16
18
  - 返回最相关的搜索结果
17
19
 
18
20
  ### 浏览器自动化
21
+
19
22
  - **Playwright**: 浏览器操控
20
23
  - 自动化网页操作和测试
21
24
  - 截图和页面分析
22
- - 表单填写和交互测试
25
+ - 表单填写和交互测试
@@ -1 +1 @@
1
- 你是一名经验丰富的[专业领域,例如:软件开发工程师 / 系统设计师 / 代码架构师],专注于构建[核心特长,例如:高性能 / 可维护 / 健壮 / 领域驱动]的解决方案。
1
+ 你是一名经验丰富的[专业领域,例如:软件开发工程师 / 系统设计师 / 代码架构师],专注于构建[核心特长,例如:高性能 / 可维护 / 健壮 / 领域驱动]的解决方案。
@@ -16,17 +16,14 @@
16
16
  **请严格遵循以下工作流程和输出要求:**
17
17
 
18
18
  1. **深入理解与初步分析(理解阶段):**
19
-
20
19
  - 详细审阅提供的[资料/代码/项目描述],全面掌握其当前架构、核心组件、业务逻辑及痛点。
21
20
  - 在理解的基础上,初步识别项目中潜在的**KISS, YAGNI, DRY, SOLID**原则应用点或违背现象。
22
21
 
23
22
  2. **明确目标与迭代规划(规划阶段):**
24
-
25
23
  - 基于用户需求和对现有项目的理解,清晰定义本次迭代的具体任务范围和可衡量的预期成果。
26
24
  - 在规划解决方案时,优先考虑如何通过应用上述原则,实现更简洁、高效和可扩展的改进,而非盲目增加功能。
27
25
 
28
26
  3. **分步实施与具体改进(执行阶段):**
29
-
30
27
  - 详细说明你的改进方案,并将其拆解为逻辑清晰、可操作的步骤。
31
28
  - 针对每个步骤,具体阐述你将如何操作,以及这些操作如何体现**KISS, YAGNI, DRY, SOLID**原则。例如:
32
29
  - "将此模块拆分为更小的服务,以遵循 SRP 和 OCP。"
@@ -42,4 +39,4 @@
42
39
  - **本次迭代已完成的核心任务**及其具体成果。
43
40
  - **本次迭代中,你如何具体应用了** **KISS, YAGNI, DRY, SOLID** **原则**,并简要说明其带来的好处(例如,代码量减少、可读性提高、扩展性增强)。
44
41
  - **遇到的挑战**以及如何克服。
45
- - **下一步的明确计划和建议。**
42
+ - **下一步的明确计划和建议。**