Loading...
Loading...
Compare original and translation side by side
~/.m2/repository/~/.m2/repository/undefinedundefined
**If found:** Use that directory. If both exist, `.worktrees` wins.
**如果找到:** 使用该目录。如果两个都存在,优先选择`.worktrees`。grep -i "worktree.*director" CLAUDE.md 2>/dev/nullgrep -i "worktree.*director" CLAUDE.md 2>/dev/nullNo worktree directory found. Where should I create worktrees?
1. .worktrees/ (project-local, hidden)
2. ~/.config/superpowers/worktrees/<project-name>/ (global location)
Which would you prefer?未找到工作树目录。我应该在哪里创建工作树?
1. .worktrees/ (项目本地,隐藏目录)
2. ~/.config/superpowers/worktrees/<项目名称>/ (全局位置)
您更倾向于哪种选择?undefinedundefined
**If NOT ignored:**
1. Add appropriate line to .gitignore
2. Commit the change
3. Proceed with worktree creation
**Why critical:** Prevents accidentally committing worktree contents to repository.
**如果未被忽略:**
1. 在.gitignore中添加对应的忽略规则
2. 提交该修改
3. 继续创建工作树
**为什么这一步很关键:** 避免不小心将工作树内容提交到代码仓库。undefinedundefinedundefinedundefined.mvn/maven.configmkdir -p .mvn
cat > .mvn/maven.config << 'EOF'
-Dmaven.repo.local=${session.executionRootDirectory}/.m2/repository
-Dmaven.repo.local.tail=${user.home}/.m2/repository
EOFmaven.repo.localmaven.repo.local.tail.mvn/maven.configmkdir -p .mvn
cat > .mvn/maven.config << 'EOF'
-Dmaven.repo.local=${session.executionRootDirectory}/.m2/repository
-Dmaven.repo.local.tail=${user.home}/.m2/repository
EOFmaven.repo.localmaven.repo.local.tailundefinedundefinedundefinedundefinedundefinedundefinedundefinedundefinedmvn verifymvn install$MVN_CMD verifymvn installmvn verifymvn testmvn verifymvn install$MVN_CMD verifymvn installmvn verifymvn test.idea/*.iml.project.classpath.settings/.vscode/.idea/.idea/*.iml.project.classpath.settings/.vscode/.idea/| Situation | Action |
|---|---|
| Use it (verify ignored) |
| Use it (verify ignored) |
| Both exist | Use |
| Neither exists | Check CLAUDE.md → Ask user |
| Directory not ignored | Add to .gitignore + commit |
| Tests fail during baseline | Report failures + ask |
| mvnw exists | Use |
| Baseline verification | Use |
| IDE files | Generate per worktree, don't share |
| 场景 | 操作 |
|---|---|
| 使用它(验证已被忽略) |
| 使用它(验证已被忽略) |
| 两个都存在 | 使用 |
| 两个都不存在 | 检查CLAUDE.md → 询问用户 |
| 目录未被忽略 | 添加到.gitignore + 提交 |
| 基线测试失败 | 上报失败 + 询问用户 |
| 存在mvnw | 优先使用 |
| 基线验证 | 使用 |
| IDE文件 | 每个工作树单独生成,不要共享 |
.mvn/maven.config-Dmaven.repo.local=${session.executionRootDirectory}/.m2/repository-Dmaven.repo.local.tail=${user.home}/.m2/repository.mvn/maven.config-Dmaven.repo.local=${session.executionRootDirectory}/.m2/repository-Dmaven.repo.local.tail=${user.home}/.m2/repository~/.m2/repository~/.m2/repository.mvn/maven.config.mvn/maven.configmvn installmvn installmvn verifymvn verify| Excuse | Reality |
|---|---|
| "Default Maven config is fine" | Concurrent SNAPSHOT installs will clash without isolation |
| "maven.repo.local alone is enough" | Without tail, downloads everything fresh and plugins fail |
| "Shared repository is normal" | Normal for single workspace, broken for parallel worktrees |
| "No time for advanced setup" | Setup takes 30 seconds, debugging clashes takes hours |
| "This is complete isolation" | Complete = maven.repo.local + maven.repo.local.tail |
| "mvn install verifies properly" | mvn install pollutes repo, use mvn verify |
| "IDE files should be consistent" | IDE files reflect code structure, which varies by branch |
| 借口 | 实际情况 |
|---|---|
| "默认Maven配置就没问题" | 没有隔离的话并发SNAPSHOT安装一定会冲突 |
| "只配置maven.repo.local就够了" | 没有tail的话会重新下载所有内容,插件也会解析失败 |
| "共享仓库是常规操作" | 单工作空间正常,并行工作树场景下会出问题 |
| "没时间做高级配置" | 配置只需要30秒,排查冲突问题需要几小时 |
| "这就是完全隔离了" | 完整隔离 = maven.repo.local + maven.repo.local.tail |
| "mvn install就能完成正确验证" | mvn install会污染仓库,应该用mvn verify |
| "IDE文件应该保持一致" | IDE文件反映代码结构,不同分支的结构可能不一样 |
.mvn/maven.configmvn install.idea/mvn verify.mvn/maven.configmvn install.idea/mvn verifyYou: I'm using the using-maven-worktrees skill to set up an isolated Maven workspace.
[Check .worktrees/ - exists]
[Verify ignored - git check-ignore confirms]
[Create worktree: git worktree add .worktrees/feature-auth -b feature/auth]
[cd .worktrees/feature-auth]
[Create .mvn/maven.config with maven.repo.local + maven.repo.local.tail]
[Verify config exists and has both properties]
[Run ./mvnw verify - 127 tests passing]
Worktree ready at /Users/max/myproject/.worktrees/feature-auth
Maven isolation configured:
- maven.repo.local: .m2/repository (worktree-local)
- maven.repo.local.tail: ~/.m2/repository (shared cache)
Tests passing (127 tests, 0 failures)
Ready to implement authentication feature你:我正在使用using-maven-worktrees技能来设置隔离的Maven工作空间。
[检查 .worktrees/ - 存在]
[验证已被忽略 - git check-ignore确认]
[创建工作树:git worktree add .worktrees/feature-auth -b feature/auth]
[切换到目录:cd .worktrees/feature-auth]
[创建包含maven.repo.local + maven.repo.local.tail的.mvn/maven.config文件]
[验证配置存在且包含两个属性]
[运行 ./mvnw verify - 127个测试通过]
工作树已就绪,路径:/Users/max/myproject/.worktrees/feature-auth
Maven隔离已配置:
- maven.repo.local: .m2/repository(工作树本地)
- maven.repo.local.tail: ~/.m2/repository(共享缓存)
测试通过(127个测试,0个失败)
可以开始开发认证功能开发了