blue/.blue/docs/rfcs/0007-consistent-branch-naming.md
Eric Garcia 489942cd35 feat: implement RFC 0006 (soft-delete) and RFC 0007 (branch naming)
RFC 0006 - Document Deletion Tools:
- Add soft-delete with 7-day retention before permanent deletion
- Add blue_delete, blue_restore, blue_deleted_list, blue_purge_deleted tools
- Add deleted_at column to documents table (schema v3)
- Block deletion of documents with ADR dependents
- Support dry_run, force, and permanent options

RFC 0007 - Consistent Branch Naming:
- Strip RFC number prefix from branch/worktree names
- Branch format: feature-description (not rfc/NNNN-feature-description)
- PR title format: RFC NNNN: Feature Description
- Add strip_rfc_number_prefix helper with tests

Also:
- Remove orphan .blue/repos/ and .blue/data/ directories
- Fix docs path resolution bug (spike documented)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-24 16:42:31 -05:00

85 lines
2.6 KiB
Markdown

# RFC 0007: Consistent Branch Naming
| | |
|---|---|
| **Status** | Implemented |
| **Date** | 2026-01-24 |
---
## Summary
Branch names and worktrees for RFC implementation are inconsistent. Some use the full RFC name with number prefix, others use arbitrary names. This makes it hard to correlate branches with their source RFCs and clutters the git history.
## Problem
Currently when implementing an RFC:
- Branch names vary: `rfc-0005`, `feature/local-llm`, `0005-local-llm-integration`, etc.
- Worktree directories follow no convention
- No clear way to find which branch implements which RFC
- PR titles don't consistently reference the RFC number
## Proposal
### Naming Convention
For an RFC file named `NNNN-feature-description.md`:
| Artifact | Name |
|----------|------|
| RFC file | `NNNN-feature-description.md` |
| Branch | `feature-description` |
| Worktree | `feature-description` |
| PR title | `RFC NNNN: Feature Description` |
### Examples
| RFC File | Branch | Worktree |
|----------|--------|----------|
| `0005-local-llm-integration.md` | `local-llm-integration` | `local-llm-integration` |
| `0006-document-deletion-tools.md` | `document-deletion-tools` | `document-deletion-tools` |
| `0007-consistent-branch-naming.md` | `consistent-branch-naming` | `consistent-branch-naming` |
### Rationale
**Why strip the number prefix?**
- Branch names stay short and readable
- The RFC number is metadata, not the feature identity
- `git branch` output is cleaner
- Tab completion is easier
**Why keep feature-description?**
- Direct correlation to RFC title
- Descriptive without being verbose
- Consistent kebab-case convention
### Implementation
1. Update `blue_worktree_create` to derive branch name from RFC title (strip number prefix)
2. Update `blue_pr_create` to include RFC number in PR title
3. ~~Add validation to reject branches with number prefixes~~ (deferred - convention is enforced by tooling)
4. Document convention in CLAUDE.md
### Migration
Existing branches don't need to change. Convention applies to new work only.
## Test Plan
- [x] `blue worktree create` uses `feature-description` format
- [x] Branch name derived correctly from RFC title
- [x] PR title includes RFC number when `rfc` parameter provided
- [ ] ~~Validation rejects `NNNN-*` branch names with helpful message~~ (deferred)
## Implementation Plan
- [x] Update worktree handler to strip RFC number from branch name
- [x] Update PR handler to format title as `RFC NNNN: Title`
- [x] Add `strip_rfc_number_prefix` helper function with tests
- [ ] Update documentation (CLAUDE.md)
---
*"Names matter. Make them count."*
— Blue