fix: add git worktree hygiene to solve-issue workflow

Developer: checkout main + create fresh branch before coding.
Reviewer: verify branch matches issue before reviewing.

Fixes #395

小橘 <xiaoju@shazhou.work>
This commit is contained in:
2026-05-22 10:59:08 +00:00
parent baa2edfa38
commit c9507b8dc1
+20 -9
View File
@@ -38,12 +38,18 @@ roles:
capabilities: capabilities:
- coding - coding
procedure: | procedure: |
1. Read the test spec from CAS: `uwf cas get <plan hash>` (find the hash from the latest planner step's meta.plan) Before starting any work, ensure a clean worktree:
2. If bounced back from reviewer or tester: read the previous role's output to understand what needs fixing 1. `git checkout main && git pull` to get the latest code
3. Write tests first based on the spec 2. `git checkout -b fix/<issue-number>-<short-description>` to create a fresh branch
4. Implement the code to make tests pass - If bounced back from reviewer or tester, reuse the existing branch instead
5. Ensure `bun run build` passes with no errors
6. Run `bun test` to verify all tests pass Then implement TDD:
3. Read the test spec from CAS: `uwf cas get <plan hash>` (find the hash from the latest planner step's meta.plan)
4. If bounced back from reviewer or tester: read the previous role's output to understand what needs fixing
5. Write tests first based on the spec
6. Implement the code to make tests pass
7. Ensure `bun run build` passes with no errors
8. Run `bun test` to verify all tests pass
output: "List all files changed and provide a summary. Frontmatter must include: status (done or failed)." output: "List all files changed and provide a summary. Frontmatter must include: status (done or failed)."
frontmatter: frontmatter:
type: object type: object
@@ -59,10 +65,15 @@ roles:
- code-review - code-review
- static-analysis - static-analysis
procedure: | procedure: |
Before reviewing, verify the git branch:
1. Run `git branch --show-current` — confirm the branch name references the issue number being worked on
2. If the branch doesn't correspond to the issue, flag it in your output and reject
Then perform code review:
Hard checks (must all pass): Hard checks (must all pass):
1. `bun run build` — no build errors 3. `bun run build` — no build errors
2. `bunx biome check` — no lint violations 4. `bunx biome check` — no lint violations
3. TypeScript strict mode — no type errors 5. TypeScript strict mode — no type errors
Soft checks (review against CLAUDE.md conventions): Soft checks (review against CLAUDE.md conventions):
- Functional-first: `function` + `type`, not `class` + `interface` - Functional-first: `function` + `type`, not `class` + `interface`