|
2 | 2 |
|
3 | 3 | ## Goal |
4 | 4 |
|
5 | | -Move the work verify directory from `.cat/work/verify` to `.cat/verify` inside the worktree. This refactoring improves directory organization by consolidating CAT-managed state under the `.cat/` directory hierarchy and clarifies the semantic separation between implementation work (`.cat/work/`) and verification state (`.cat/verify/`). |
| 5 | +Change the VERIFY_DIR base path from `${CLAUDE_PROJECT_DIR}` to `${WORKTREE_PATH}` in all files that reference |
| 6 | +`.cat/work/verify`. The directory name `.cat/work/verify` stays the same — only the base path variable changes. This |
| 7 | +ensures verify files are written inside the issue worktree rather than the main project directory, maintaining worktree |
| 8 | +isolation. |
| 9 | + |
| 10 | +## Research Findings |
| 11 | + |
| 12 | +Codebase analysis identified 5 files that reference the VERIFY_DIR path using `${CLAUDE_PROJECT_DIR}/.cat/work/verify`: |
| 13 | +1. `plugin/concepts/work.md` — Concept documentation describing VERIFY_DIR path |
| 14 | +2. `plugin/skills/work-merge-agent/first-use.md` — Skill implementation setting VERIFY_DIR |
| 15 | +3. `plugin/skills/work-confirm-agent/first-use.md` — Skill implementation setting VERIFY_DIR |
| 16 | +4. `plugin/agents/work-verify.md` — Agent documentation setting VERIFY_DIR |
| 17 | +5. `plugin/migrations/2.1.sh` — Migration script (directory name unchanged, no base path variable) |
| 18 | + |
| 19 | +All references are string literals in shell/Markdown files. The migration script uses the relative path |
| 20 | +`.cat/work/verify` without a base path variable, so it requires no change. |
6 | 21 |
|
7 | 22 | ## Pre-conditions |
8 | 23 |
|
9 | 24 | (none) |
10 | 25 |
|
11 | 26 | ## Post-conditions |
12 | 27 |
|
13 | | -- [ ] User-visible behavior unchanged |
| 28 | +- [ ] All 4 identified plugin files updated from `${CLAUDE_PROJECT_DIR}/.cat/work/verify` to `${WORKTREE_PATH}/.cat/work/verify` |
| 29 | +- [ ] Migration script unchanged (already uses relative path `.cat/work/verify`) |
| 30 | +- [ ] No references to `${CLAUDE_PROJECT_DIR}/.cat/work/verify` remain in plugin source files |
| 31 | +- [ ] The directory name `.cat/work/verify` is preserved (not renamed) |
14 | 32 | - [ ] Tests passing |
15 | | -- [ ] Code quality improved |
16 | | -- [ ] E2E verification — verify the new directory structure works as expected |
| 33 | + |
| 34 | +## Execution Steps |
| 35 | + |
| 36 | +1. **Update plugin/concepts/work.md** |
| 37 | + - Change: `${CLAUDE_PROJECT_DIR}/.cat/work/verify/${CLAUDE_SESSION_ID}/` to `${WORKTREE_PATH}/.cat/work/verify/${CLAUDE_SESSION_ID}/` |
| 38 | + - Rationale: Verify files should be written inside the worktree |
| 39 | + |
| 40 | +2. **Update plugin/skills/work-merge-agent/first-use.md** |
| 41 | + - Change: `VERIFY_DIR="${CLAUDE_PROJECT_DIR}/.cat/work/verify/${CLAUDE_SESSION_ID}"` to `VERIFY_DIR="${WORKTREE_PATH}/.cat/work/verify/${CLAUDE_SESSION_ID}"` |
| 42 | + - Rationale: Merge-agent reads verify files from the worktree |
| 43 | + |
| 44 | +3. **Update plugin/skills/work-confirm-agent/first-use.md** |
| 45 | + - Change: `VERIFY_DIR="${CLAUDE_PROJECT_DIR}/.cat/work/verify/${CLAUDE_SESSION_ID}"` to `VERIFY_DIR="${WORKTREE_PATH}/.cat/work/verify/${CLAUDE_SESSION_ID}"` |
| 46 | + - Rationale: Confirm-agent writes verify files inside the worktree |
| 47 | + |
| 48 | +4. **Update plugin/agents/work-verify.md** |
| 49 | + - Change: `VERIFY_DIR="${CLAUDE_PROJECT_DIR}/.cat/work/verify/${CLAUDE_SESSION_ID}"` to `VERIFY_DIR="${WORKTREE_PATH}/.cat/work/verify/${CLAUDE_SESSION_ID}"` |
| 50 | + - Rationale: Verify agent writes analysis files inside the worktree |
| 51 | + |
| 52 | +5. **Verify migration script unchanged** |
| 53 | + - Confirm `plugin/migrations/2.1.sh` still has `new_verify_base=".cat/work/verify"` (relative path, no base variable) |
| 54 | + |
| 55 | +6. **Verify no remaining CLAUDE_PROJECT_DIR references to .cat/work/verify** |
| 56 | + - Run: `grep -r "CLAUDE_PROJECT_DIR.*\.cat/work/verify" plugin/` |
| 57 | + - Expected: No output |
| 58 | + |
| 59 | +7. **Run tests** |
| 60 | + - Command: `mvn -f client/pom.xml test` |
| 61 | + - Rationale: Ensures refactoring doesn't break existing functionality |
0 commit comments