Skip to content

Commit 62909a8

Browse files
ChrisEdwardsclaude
andcommitted
Restructure AI Development Workflow with stacked branch clarifications
Enhanced the workflow documentation to clarify stacked branch handling and ensure consistent high-quality PR descriptions: - Added Workflow Overview with decision tree and label definitions - Clarified stacked-branch label usage for branches based on PR branches - Created shared "Creating High-Quality PR Descriptions" section - Updated "Moving to Review" for standard PRs (pr-created + in-review labels) - Updated "Stacked PRs" workflow (pr-created label only, draft status) - Enhanced "Promoting Stacked PR" to add in-review label on promotion - Emphasized human review as bottleneck requiring effortless reviews Key improvements: - Consistent PR description quality across both workflows - Clear label lifecycle (pr-created vs in-review timing) - Stacked beads must depend on parent bead - Both workflows reference shared description format 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 1323345 commit 62909a8

File tree

1 file changed

+115
-32
lines changed

1 file changed

+115
-32
lines changed

CLAUDE.md

Lines changed: 115 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -168,10 +168,42 @@ This project is tracked in Jira under the **AIML** project. When creating Jira t
168168

169169
**Access**: Use the Atlassian MCP server to read or write Jira tickets programmatically.
170170

171+
----
171172

172173
## AI Development Workflow
173174

174-
This section defines the complete workflow for AI agents working with beads and Jira tickets in this project.
175+
This section defines the complete workflow for a Developer using AI agents working with beads and Jira tickets in this project.
176+
177+
### Workflow Overview
178+
179+
**Key Labels:**
180+
- `stacked-branch` - Branch is based on another PR branch (not main)
181+
- `pr-created` - Pull request has been created
182+
- `in-review` - Pull request is ready for human review (not draft)
183+
184+
**Decision Tree:**
185+
186+
```
187+
Branch Creation:
188+
├─ Based on main → No special label
189+
└─ Based on another PR branch → Label with `stacked-branch`
190+
191+
PR Creation:
192+
├─ Has `stacked-branch` label?
193+
│ └─ YES → Create DRAFT PR (Stacked PRs workflow)
194+
│ - Base: parent PR's branch
195+
│ - Labels: `pr-created` (NOT `in-review` yet)
196+
│ - Add warning banner + dependency context
197+
198+
└─ NO → Create ready PR (Moving to Review workflow)
199+
- Base: main
200+
- Labels: `pr-created`, `in-review`
201+
- Standard PR description
202+
203+
Promoting Stacked PR (after base PR merges):
204+
└─ Rebase onto main, update base branch, remove warnings
205+
Add `in-review` label, mark PR ready
206+
```
175207

176208
### Starting Work on a Bead
177209

@@ -181,15 +213,19 @@ This section defines the complete workflow for AI agents working with beads and
181213
- Show recently updated branches (sorted by most recent commits/PRs)
182214
- User may be working with stacked branches where each new branch comes off the previous PR branch
183215
- Name the branch with Jira ID prefix (e.g., `AIML-224-description`)
216+
- **If based on another PR branch (not main)**: Label bead with `stacked-branch`
184217
- **Bead is a child of Jira-linked bead**: Use the same branch as the parent bead
185218
- **Bead has no Jira association and no parent**:
186219
- **Ask user if it should have a Jira ticket**
187220
- Most code changes need a Jira ticket and branch before merging
188221
- Code changes should generally have a Jira ticket in scope
189222

190-
**2. Update bead status:**
223+
**2. Update bead status and labels:**
191224
- Set bead status to `in_progress`
192225
- Record the branch name in the bead (so it's easily found later)
226+
- **If this is a stacked branch** (based on another PR branch):
227+
- Label the bead with `stacked-branch`
228+
- Create parent-child dependency: the stacked bead depends on the bead of the branch it's based on
193229

194230
**3. Update Jira (if applicable):**
195231
- If bead has a linked Jira ticket:
@@ -236,41 +272,77 @@ All code changes require corresponding test coverage. Do not move to review with
236272

237273
See INTEGRATION_TESTS.md for integration test setup and credentials.
238274

275+
### Creating High-Quality PR Descriptions
276+
277+
**This section defines the shared approach for creating PR descriptions used by both "Moving to Review" and "Stacked PRs" workflows.**
278+
279+
Human review is the bottleneck in AI-assisted development. Creating exceptional PR descriptions that make review effortless is critical to development velocity.
280+
281+
**Research Phase** - Gather comprehensive context from:
282+
- All beads that have been worked on for this branch
283+
- All git commits in the branch (`git log`, `git diff`)
284+
- Voice notes that relate to this work
285+
- Any related Jira tickets
286+
287+
**PR Description Structure:**
288+
289+
1. **Why**: Explain the problem or need that motivated this change
290+
- What problem are we solving?
291+
- What value does this provide?
292+
- What was the business or technical driver?
293+
294+
2. **What**: Describe what changes were made at a high level
295+
- What components/files were modified?
296+
- What new capabilities exist?
297+
- What behavior changed?
298+
299+
3. **How**: Explain how it was implemented
300+
- Technical approach and architecture decisions
301+
- Key implementation choices and trade-offs
302+
- Design patterns used
303+
- Integration points
304+
305+
4. **Step-by-step walkthrough**: Guide the reviewer through the changes in logical order
306+
- Walk through the diff in a sensible sequence
307+
- Explain complex sections
308+
- Call out important details
309+
- Help reviewer understand the flow
310+
311+
5. **Testing**: Summarize test coverage and results
312+
- Unit test coverage added
313+
- Integration test coverage added
314+
- Test results (pass/fail counts)
315+
- Manual testing performed
316+
- Edge cases covered
317+
318+
**Goal**: Make reviewing effortless by providing all information the reviewer needs to understand and evaluate the changes with confidence and speed. The reviewer should not need to ask clarifying questions.
319+
239320
### Moving to Review
240321

241-
**When user says "move to review" or "ready for review":**
322+
**When user says "move to review" or "ready for review" for a bead WITHOUT the `stacked-branch` label:**
323+
324+
This workflow creates a standard PR ready for immediate review, targeting the `main` branch.
242325

243-
1. **Label the bead(s):**
244-
- Create/apply label `in-review` to the bead
326+
**1. Label the bead(s):**
327+
- Create/apply labels: `pr-created` and `in-review`
245328
- Apply to all beads worked on in this branch
246329

247-
2. **Push to remote:**
330+
**2. Push to remote:**
248331
- Push the feature branch to remote repository
249332

250-
3. **Create or update Pull Request:**
251-
- If PR doesn't exist, create it
333+
**3. Create or update Pull Request:**
334+
- If PR doesn't exist, create it with base branch `main`
252335
- If PR exists, update the description
336+
- PR should be ready for review (NOT draft)
253337

254-
4. **Generate comprehensive PR description:**
255-
256-
**Research phase** - Gather context from:
257-
- All beads that have been worked on for this branch
258-
- All git commits in the branch (`git log`, `git diff`)
259-
- Voice notes that relate to this work
260-
- Any related Jira tickets
261-
262-
**Write PR description** that includes:
263-
- **Why**: Explain the problem or need that motivated this change
264-
- **What**: Describe what changes were made at a high level
265-
- **How**: Explain how it was implemented (technical approach, key decisions)
266-
- **Step-by-step walkthrough**: Guide reviewer through the changes in logical order
267-
- **Testing**: Summarize test coverage and results
268-
269-
**Goal**: Make reviewing the PR easy by providing all information the reviewer needs to understand and evaluate the changes effectively.
338+
**4. Generate comprehensive PR description:**
339+
- Follow the **"Creating High-Quality PR Descriptions"** section above
340+
- Use the standard structure: Why / What / How / Walkthrough / Testing
341+
- No special warnings or dependency context needed
270342

271343
### Stacked PRs (Ready for Draft Review)
272344

273-
**When user says "ready for stacked PR", "ready for draft review", or indicates this is a stacked PR:**
345+
**When user says "ready for stacked PR", "ready for draft review", or when creating a PR for a bead WITH the `stacked-branch` label:**
274346

275347
This workflow creates a draft PR that depends on another unmerged PR (stacked branches).
276348

@@ -279,7 +351,9 @@ This workflow creates a draft PR that depends on another unmerged PR (stacked br
279351
- Note the PR number and URL
280352

281353
**2. Label the bead(s):**
282-
- Create/apply label `in-review` to the bead
354+
- Create/apply label `pr-created` to the bead
355+
- **Do NOT add `in-review` label yet** (only added when promoted to ready-for-review)
356+
- Apply to all beads worked on in this branch
283357

284358
**3. Push to remote:**
285359
- Push the feature branch: `git push -u origin <branch-name>`
@@ -288,22 +362,29 @@ This workflow creates a draft PR that depends on another unmerged PR (stacked br
288362
- **Base branch**: Set to the parent PR's branch (NOT main)
289363
- **Status**: MUST be draft
290364
- **Title**: Include `[STACKED]` indicator
291-
- **Body**: MUST start with prominent warning:
365+
- **Body**: Start with prominent warning, then add dependency context, followed by standard PR description:
292366
```
293367
**⚠️ DO NOT MERGE - WAITING FOR <link to base PR>**
294368
295369
This is a stacked PR based on #<base-pr-number>.
296370
Please review and merge #<base-pr-number> first,
297371
then rebase this PR onto `main` before merging.
298372
373+
---
374+
375+
**Dependency Context:**
376+
This PR builds on the work from #<base-pr-number>. [Briefly explain
377+
what the base PR did and why this PR follows it]
378+
299379
---
300380
```
301-
- Include full PR description after the warning (Why/What/How/Testing)
381+
- After the warning and dependency context, follow the **"Creating High-Quality PR Descriptions"** section
382+
- Use the standard structure: Why / What / How / Walkthrough / Testing
302383
303384
**5. Verify configuration:**
304385
- Confirm PR is in draft status
305386
- Confirm base branch is the parent PR's branch
306-
- Confirm warning is prominently displayed
387+
- Confirm warning and dependency context are prominently displayed
307388
308389
**Example command:**
309390
```bash
@@ -330,11 +411,12 @@ EOF
330411

331412
### Promoting Stacked PR to Ready for Review
332413

333-
**When user says "move stacked PR to ready for review", "promote stacked PR", or "finalize stacked PR":**
414+
**When user says "move stacked PR to ready for review", "promote stacked PR", or "finalize stacked PR" for a bead WITH the `stacked-branch` label:**
334415

335416
This workflow promotes a draft stacked PR to ready-for-review after its base PR has been merged to main.
336417

337418
**Prerequisites:**
419+
- Bead must have `stacked-branch` label
338420
- Base PR must be merged to main
339421
- All tests must be passing on the stacked branch
340422
- PR is currently in draft status targeting the base PR's branch
@@ -408,9 +490,10 @@ This workflow promotes a draft stacked PR to ready-for-review after its base PR
408490
- Address any failures before proceeding
409491
- Check CI status on GitHub
410492

411-
**9. Update bead (if applicable):**
493+
**9. Update bead:**
494+
- **Add `in-review` label to the bead** (PR is now truly ready for human review)
412495
- Update bead notes with PR status: "Rebased onto main, ready for review"
413-
- Keep bead in `in_progress` status with `in-review` label
496+
- Keep bead in `in_progress` status
414497
- Don't close until PR is merged
415498

416499
**10. Confirm completion:**

0 commit comments

Comments
 (0)