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.
- package/README.md +29 -24
- package/bin/zcf.mjs +1 -1
- package/dist/chunks/simple-config.mjs +938 -897
- package/dist/cli.mjs +286 -256
- package/dist/index.d.mts +13 -13
- package/dist/index.d.ts +13 -13
- package/dist/index.mjs +3 -4
- package/package.json +20 -15
- package/templates/CLAUDE.md +249 -5
- package/templates/common/CLAUDE.md +5 -0
- package/templates/en/memory/mcp.md +4 -1
- package/templates/en/memory/personality.md +1 -1
- package/templates/en/memory/rules.md +1 -4
- package/templates/en/workflow/bmad/commands/bmad-init.md +58 -56
- package/templates/en/workflow/common/agents/get-current-datetime.md +29 -0
- package/templates/en/workflow/common/agents/init-architect.md +114 -0
- package/templates/en/workflow/common/commands/init-project.md +53 -0
- package/templates/en/workflow/git/commands/git-cleanBranches.md +2 -1
- package/templates/en/workflow/git/commands/git-commit.md +36 -31
- package/templates/en/workflow/git/commands/git-rollback.md +27 -26
- package/templates/en/workflow/git/commands/git-worktree.md +145 -221
- package/templates/zh-CN/memory/mcp.md +4 -1
- package/templates/zh-CN/memory/personality.md +1 -1
- package/templates/zh-CN/memory/rules.md +1 -4
- package/templates/zh-CN/workflow/bmad/commands/bmad-init.md +58 -55
- package/templates/zh-CN/workflow/common/agents/get-current-datetime.md +29 -0
- package/templates/zh-CN/workflow/common/agents/init-architect.md +114 -0
- package/templates/zh-CN/workflow/common/commands/init-project.md +53 -0
- package/templates/zh-CN/workflow/git/commands/git-cleanBranches.md +2 -1
- package/templates/zh-CN/workflow/git/commands/git-commit.md +0 -5
- package/templates/zh-CN/workflow/git/commands/git-rollback.md +1 -1
- package/templates/zh-CN/workflow/git/commands/git-worktree.md +145 -221
- /package/templates/{settings.json → common/settings.json} +0 -0
|
@@ -1,301 +1,225 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: Manage Git worktrees
|
|
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,
|
|
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
|
|
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
|
|
9
|
-
# - /git-worktree migrate feature-ui --from main # migrate uncommitted content from main
|
|
10
|
-
# - /git-worktree migrate feature-ui --stash # migrate current stash
|
|
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
|
-
|
|
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
|
-
#
|
|
23
|
-
/git-worktree add <path> #
|
|
24
|
-
/git-worktree add <path> -b <branch> # create new branch
|
|
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
|
|
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
|
|
41
|
-
|
|
42
|
-
| `add <path
|
|
43
|
-
| `migrate <target>` | Migrate content to specified worktree
|
|
44
|
-
| `list`
|
|
45
|
-
| `remove <path>`
|
|
46
|
-
| `prune`
|
|
47
|
-
| `-b <branch>`
|
|
48
|
-
| `-o, --open`
|
|
49
|
-
| `--from <source>`
|
|
50
|
-
| `--stash`
|
|
51
|
-
| `--track`
|
|
52
|
-
| `--guess-remote`
|
|
53
|
-
| `--detach`
|
|
54
|
-
| `--checkout`
|
|
55
|
-
| `--lock`
|
|
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
|
-
|
|
62
|
-
-
|
|
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
|
-
|
|
65
|
-
-
|
|
66
|
-
-
|
|
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
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
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
|
-
|
|
75
|
-
|
|
76
|
-
|
|
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
|
-
|
|
81
|
-
|
|
82
|
-
|
|
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
|
-
|
|
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
|
-
|
|
91
|
-
-
|
|
92
|
-
-
|
|
93
|
-
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
102
|
-
- **VS Code**: `code <path>`
|
|
103
|
-
- **Cursor**: `cursor <path>`
|
|
104
|
-
- **WebStorm**: `webstorm <path>`
|
|
105
|
-
- **Others**: Configurable custom IDE commands
|
|
119
|
+
---
|
|
106
120
|
|
|
107
|
-
|
|
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
|
-
|
|
114
|
-
/git-worktree add feature-ui -o
|
|
115
|
-
# Output: 🚀 Opening .zcf/feature-ui in VS Code...
|
|
116
|
-
```
|
|
123
|
+
### IDE Integration
|
|
117
124
|
|
|
118
|
-
**
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
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
|
-
###
|
|
130
|
+
### Content Migration System
|
|
125
131
|
|
|
126
|
-
**Migration Types**
|
|
127
132
|
```bash
|
|
128
|
-
# Migrate uncommitted
|
|
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
|
|
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
|
-
|
|
151
|
-
|
|
152
|
-
|
|
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
|
-
#
|
|
175
|
-
/git-worktree add feature-ui
|
|
176
|
-
#
|
|
177
|
-
#
|
|
178
|
-
|
|
179
|
-
#
|
|
180
|
-
#
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
#
|
|
185
|
-
/git-worktree
|
|
186
|
-
#
|
|
187
|
-
#
|
|
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
|
-
|
|
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
|
-
|
|
231
|
-
|
|
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
|
-
|
|
257
|
-
├──
|
|
258
|
-
├── .
|
|
259
|
-
│
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
├──
|
|
264
|
-
└──
|
|
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
|
-
###
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
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
|
-
#
|
|
285
|
-
git config worktree.ide.custom "subl %s"
|
|
286
|
-
git config worktree.ide.preferred "
|
|
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
|
|
294
|
-
- **
|
|
295
|
-
- **
|
|
296
|
-
- **
|
|
297
|
-
- **
|
|
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
|
+
- **下一步的明确计划和建议。**
|