chiron 0.2.0 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +27 -0
- data/CLAUDE.md +30 -1
- data/Gemfile.lock +1 -1
- data/docs/development_journal.md +119 -1
- data/lib/chiron/templates/python/CLAUDE.md.erb +34 -3
- data/lib/chiron/templates/python/commands/quality/python-testing.md +578 -0
- data/lib/chiron/templates/python/commands/workflows/debug-python.md +222 -0
- data/lib/chiron/templates/python/commands/workflows/flask-development.md +667 -0
- data/lib/chiron/templates/python/commands/workflows/python-refactor.md +336 -0
- data/lib/chiron/templates/rails/CLAUDE.md.erb +35 -3
- data/lib/chiron/templates/shared/commands/context/branch-context.md +176 -0
- data/lib/chiron/templates/shared/commands/context/catchup.md +6 -1
- data/lib/chiron/templates/shared/commands/context/quickstart.md +8 -3
- data/lib/chiron/templates/shared/commands/quality/test-driven.md +16 -6
- data/lib/chiron/templates/shared/commands/workflows/branch-management.md +256 -0
- data/lib/chiron/templates/shared/commands/workflows/create-prd.md +4 -3
- data/lib/chiron/templates/shared/commands/workflows/explore-plan-code-commit.md +192 -0
- data/lib/chiron/templates/shared/commands/workflows/visual-iteration.md +269 -0
- data/lib/chiron/templates/shared/development_journal.md.erb +9 -3
- data/lib/chiron/version.rb +1 -1
- metadata +9 -1
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
# Branch Management Workflow
|
|
2
|
+
|
|
3
|
+
Comprehensive workflow for creating, switching, and managing Git branches in Claude Code sessions.
|
|
4
|
+
|
|
5
|
+
## Creating New Branches
|
|
6
|
+
|
|
7
|
+
### 1. **Pre-Branch Planning**
|
|
8
|
+
Before creating a branch, ensure:
|
|
9
|
+
- [ ] Clear understanding of the feature/fix purpose
|
|
10
|
+
- [ ] Related PRD exists (if for new feature)
|
|
11
|
+
- [ ] No existing branch covers the same work
|
|
12
|
+
- [ ] Clean working directory on current branch
|
|
13
|
+
|
|
14
|
+
### 2. **Branch Creation Process**
|
|
15
|
+
```bash
|
|
16
|
+
# Ensure you're on the base branch (usually main)
|
|
17
|
+
git checkout main
|
|
18
|
+
git pull origin main
|
|
19
|
+
|
|
20
|
+
# Create and switch to new branch
|
|
21
|
+
git checkout -b [type]/[descriptive-name]
|
|
22
|
+
|
|
23
|
+
# Examples:
|
|
24
|
+
git checkout -b feature/user-authentication
|
|
25
|
+
git checkout -b bugfix/login-validation
|
|
26
|
+
git checkout -b hotfix/security-patch
|
|
27
|
+
git checkout -b experiment/new-ui-approach
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
### 3. **Branch Documentation**
|
|
31
|
+
Immediately after creating a branch:
|
|
32
|
+
|
|
33
|
+
#### Update Development Journal
|
|
34
|
+
Add to the "Active Branches & Ownership" section:
|
|
35
|
+
```markdown
|
|
36
|
+
- `feature/user-authentication`: [Your Name] - Implement user login/signup system - [Created 2025-07-01]
|
|
37
|
+
- **PRD**: tasks/prd-user-authentication.md
|
|
38
|
+
- **Dependencies**: None
|
|
39
|
+
- **Timeline**: 1 week
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
#### Create Initial Commit
|
|
43
|
+
```bash
|
|
44
|
+
# Create a planning commit to establish branch purpose
|
|
45
|
+
git commit --allow-empty -m "Start feature/user-authentication
|
|
46
|
+
|
|
47
|
+
Initial branch creation for implementing user authentication system.
|
|
48
|
+
|
|
49
|
+
Related PRD: tasks/prd-user-authentication.md
|
|
50
|
+
Estimated timeline: 1 week
|
|
51
|
+
Dependencies: None"
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Branch Switching Workflow
|
|
55
|
+
|
|
56
|
+
### 1. **Before Switching Away**
|
|
57
|
+
```bash
|
|
58
|
+
# Save current work
|
|
59
|
+
git add .
|
|
60
|
+
git commit -m "WIP: [describe current state]"
|
|
61
|
+
# OR
|
|
62
|
+
git stash push -m "Work in progress: [description]"
|
|
63
|
+
|
|
64
|
+
# Update journal with progress
|
|
65
|
+
# Run catchup command to document current state
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
### 2. **Switching to Different Branch**
|
|
69
|
+
```bash
|
|
70
|
+
# Switch to target branch
|
|
71
|
+
git checkout [target-branch]
|
|
72
|
+
|
|
73
|
+
# Get branch context (use branch-context command)
|
|
74
|
+
# Update Claude with current branch state
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### 3. **After Switching**
|
|
78
|
+
- [ ] Run `/branch-context` command to orient Claude
|
|
79
|
+
- [ ] Review recent commits and current state
|
|
80
|
+
- [ ] Check for any merge conflicts or issues
|
|
81
|
+
- [ ] Resume work from where you left off
|
|
82
|
+
|
|
83
|
+
## Branch Maintenance
|
|
84
|
+
|
|
85
|
+
### 1. **Regular Synchronization**
|
|
86
|
+
```bash
|
|
87
|
+
# Keep feature branch updated with main
|
|
88
|
+
git checkout main
|
|
89
|
+
git pull origin main
|
|
90
|
+
git checkout [your-branch]
|
|
91
|
+
git merge main
|
|
92
|
+
# OR for cleaner history:
|
|
93
|
+
git rebase main
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### 2. **Progress Tracking**
|
|
97
|
+
Update development journal regularly:
|
|
98
|
+
- When completing major milestones
|
|
99
|
+
- When encountering significant challenges
|
|
100
|
+
- When changing approach or design
|
|
101
|
+
- Before long breaks in development
|
|
102
|
+
|
|
103
|
+
### 3. **Pre-Merge Checklist**
|
|
104
|
+
Before merging or creating PR:
|
|
105
|
+
- [ ] All tests passing
|
|
106
|
+
- [ ] Code quality checks pass
|
|
107
|
+
- [ ] Documentation updated
|
|
108
|
+
- [ ] Journal entry completed
|
|
109
|
+
- [ ] Branch purpose fully achieved
|
|
110
|
+
- [ ] No debug code or temporary changes
|
|
111
|
+
|
|
112
|
+
## Claude Session Continuity
|
|
113
|
+
|
|
114
|
+
### Starting New Session
|
|
115
|
+
When beginning a Claude session:
|
|
116
|
+
1. Run `/quickstart` command
|
|
117
|
+
2. Run `/branch-context` command
|
|
118
|
+
3. Review recent journal entries
|
|
119
|
+
4. Check current task status
|
|
120
|
+
|
|
121
|
+
### During Development
|
|
122
|
+
- Use `/catchup` to summarize progress
|
|
123
|
+
- Update journal for significant changes
|
|
124
|
+
- Create meaningful commit messages
|
|
125
|
+
- Reference related PRDs or issues
|
|
126
|
+
|
|
127
|
+
### Ending Session
|
|
128
|
+
Before ending a Claude session:
|
|
129
|
+
1. Commit or stash current work
|
|
130
|
+
2. Update journal with progress
|
|
131
|
+
3. Note any blockers or next steps
|
|
132
|
+
4. Create TODO items if applicable
|
|
133
|
+
|
|
134
|
+
## Branch Types and Naming
|
|
135
|
+
|
|
136
|
+
### Feature Branches
|
|
137
|
+
```bash
|
|
138
|
+
feature/[short-description]
|
|
139
|
+
feature/user-authentication
|
|
140
|
+
feature/payment-integration
|
|
141
|
+
feature/admin-dashboard
|
|
142
|
+
```
|
|
143
|
+
- For new functionality
|
|
144
|
+
- Usually based on PRDs
|
|
145
|
+
- Timeline: days to weeks
|
|
146
|
+
|
|
147
|
+
### Bugfix Branches
|
|
148
|
+
```bash
|
|
149
|
+
bugfix/[issue-description]
|
|
150
|
+
bugfix/login-validation
|
|
151
|
+
bugfix/email-formatting
|
|
152
|
+
bugfix/mobile-layout
|
|
153
|
+
```
|
|
154
|
+
- For fixing existing functionality
|
|
155
|
+
- Should include issue reproduction
|
|
156
|
+
- Timeline: hours to days
|
|
157
|
+
|
|
158
|
+
### Hotfix Branches
|
|
159
|
+
```bash
|
|
160
|
+
hotfix/[urgent-issue]
|
|
161
|
+
hotfix/security-patch
|
|
162
|
+
hotfix/production-error
|
|
163
|
+
hotfix/data-corruption
|
|
164
|
+
```
|
|
165
|
+
- For urgent production fixes
|
|
166
|
+
- Fast-tracked through review
|
|
167
|
+
- Timeline: hours
|
|
168
|
+
|
|
169
|
+
### Experiment Branches
|
|
170
|
+
```bash
|
|
171
|
+
experiment/[exploration-area]
|
|
172
|
+
experiment/new-ui-framework
|
|
173
|
+
experiment/performance-optimization
|
|
174
|
+
experiment/alternative-approach
|
|
175
|
+
```
|
|
176
|
+
- For trying new approaches
|
|
177
|
+
- May not be merged
|
|
178
|
+
- Timeline: varies
|
|
179
|
+
|
|
180
|
+
## Collaboration Patterns
|
|
181
|
+
|
|
182
|
+
### Multiple Developers
|
|
183
|
+
- Update journal with developer assignments
|
|
184
|
+
- Use PR descriptions to communicate context
|
|
185
|
+
- Reference branch dependencies clearly
|
|
186
|
+
- Coordinate merge timing
|
|
187
|
+
|
|
188
|
+
### Code Reviews
|
|
189
|
+
- Include branch context in PR description
|
|
190
|
+
- Reference related journal entries
|
|
191
|
+
- Explain design decisions made during development
|
|
192
|
+
- Link to relevant PRD sections
|
|
193
|
+
|
|
194
|
+
### Handoffs
|
|
195
|
+
When transferring work to another developer:
|
|
196
|
+
1. Complete journal entry for current state
|
|
197
|
+
2. Commit all work with clear messages
|
|
198
|
+
3. Document any known issues or blockers
|
|
199
|
+
4. Update branch ownership in journal
|
|
200
|
+
|
|
201
|
+
## Troubleshooting Common Issues
|
|
202
|
+
|
|
203
|
+
### Lost Context
|
|
204
|
+
If Claude loses branch context:
|
|
205
|
+
1. Run `/branch-context` command
|
|
206
|
+
2. Review recent commits: `git log --oneline -10`
|
|
207
|
+
3. Check journal for recent entries
|
|
208
|
+
4. Summarize current work state
|
|
209
|
+
|
|
210
|
+
### Merge Conflicts
|
|
211
|
+
```bash
|
|
212
|
+
# Resolve conflicts step by step
|
|
213
|
+
git status # See conflicted files
|
|
214
|
+
git diff # Review conflicts
|
|
215
|
+
# Edit files to resolve conflicts
|
|
216
|
+
git add [resolved-files]
|
|
217
|
+
git commit -m "Resolve merge conflicts"
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
### Stale Branches
|
|
221
|
+
For branches behind main:
|
|
222
|
+
```bash
|
|
223
|
+
git checkout [your-branch]
|
|
224
|
+
git fetch origin
|
|
225
|
+
git merge origin/main
|
|
226
|
+
# OR for cleaner history:
|
|
227
|
+
git rebase origin/main
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
## Best Practices Summary
|
|
231
|
+
|
|
232
|
+
### Branch Creation
|
|
233
|
+
- Always create from updated main/develop
|
|
234
|
+
- Use descriptive, consistent naming
|
|
235
|
+
- Document purpose immediately
|
|
236
|
+
- Create empty initial commit with context
|
|
237
|
+
|
|
238
|
+
### Development
|
|
239
|
+
- Commit frequently with meaningful messages
|
|
240
|
+
- Update journal for significant progress
|
|
241
|
+
- Keep branches focused on single purpose
|
|
242
|
+
- Sync with main regularly
|
|
243
|
+
|
|
244
|
+
### Claude Integration
|
|
245
|
+
- Use context commands at session start
|
|
246
|
+
- Maintain journal throughout development
|
|
247
|
+
- Reference branch work in commits
|
|
248
|
+
- Document decisions and rationale
|
|
249
|
+
|
|
250
|
+
### Cleanup
|
|
251
|
+
- Delete merged branches promptly
|
|
252
|
+
- Archive experiment branches with notes
|
|
253
|
+
- Update journal when closing branches
|
|
254
|
+
- Remove stale branch references
|
|
255
|
+
|
|
256
|
+
This workflow ensures branch work is well-documented, trackable across Claude sessions, and maintains clear development history.
|
|
@@ -7,9 +7,10 @@ To create a detailed Product Requirements Document (PRD) in Markdown format base
|
|
|
7
7
|
## Process
|
|
8
8
|
|
|
9
9
|
1. **Receive Initial Prompt:** The user provides a brief description or request for a new feature or functionality.
|
|
10
|
-
2. **
|
|
11
|
-
3. **
|
|
12
|
-
4. **
|
|
10
|
+
2. **Think Through Complexity:** Use "think" to trigger extended thinking mode for complex features requiring deep analysis.
|
|
11
|
+
3. **Ask Clarifying Questions:** Before writing the PRD, *always* ask clarifying questions to gather sufficient detail. The goal is to understand the "what" and "why" of the feature, not necessarily the "how" (which the developer will figure out).
|
|
12
|
+
4. **Generate PRD:** Based on the initial prompt and the user's answers to the clarifying questions, generate a PRD using the structure outlined below.
|
|
13
|
+
5. **Save PRD:** Save the generated document as `prd-[feature-name].md` inside the `/tasks` directory.
|
|
13
14
|
|
|
14
15
|
## Clarifying Questions (Examples)
|
|
15
16
|
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
# Explore-Plan-Code-Commit Workflow
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
A structured approach to feature development that emphasizes understanding before building, thoughtful planning, and clear documentation of changes.
|
|
6
|
+
|
|
7
|
+
## The Four Phases
|
|
8
|
+
|
|
9
|
+
### 1. Explore Phase
|
|
10
|
+
|
|
11
|
+
**Goal**: Understand the codebase, context, and requirements before making changes.
|
|
12
|
+
|
|
13
|
+
#### Actions:
|
|
14
|
+
- Read relevant files to understand current implementation
|
|
15
|
+
- Explore related code and dependencies
|
|
16
|
+
- Review existing tests and documentation
|
|
17
|
+
- Use conversational Q&A to understand unfamiliar parts of the codebase
|
|
18
|
+
- Search for similar implementations or patterns
|
|
19
|
+
|
|
20
|
+
#### Commands:
|
|
21
|
+
```bash
|
|
22
|
+
# Find related files
|
|
23
|
+
find . -name "*.rb" | grep user
|
|
24
|
+
grep -r "authentication" app/
|
|
25
|
+
|
|
26
|
+
# Understand file structure
|
|
27
|
+
ls -la app/models/
|
|
28
|
+
head -20 app/models/user.rb
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
#### Questions to Ask:
|
|
32
|
+
- What does the current code do?
|
|
33
|
+
- How does this feature fit into the existing architecture?
|
|
34
|
+
- What patterns are already established?
|
|
35
|
+
- Are there similar implementations to reference?
|
|
36
|
+
- What are the dependencies and constraints?
|
|
37
|
+
|
|
38
|
+
### 2. Plan Phase
|
|
39
|
+
|
|
40
|
+
**Goal**: Create a clear implementation strategy before writing code.
|
|
41
|
+
|
|
42
|
+
#### Use Extended Thinking
|
|
43
|
+
For complex features, use "think" to trigger extended thinking mode:
|
|
44
|
+
- Analyze multiple implementation approaches
|
|
45
|
+
- Consider edge cases and error scenarios
|
|
46
|
+
- Plan the sequence of changes
|
|
47
|
+
- Identify potential risks or complications
|
|
48
|
+
|
|
49
|
+
#### Planning Activities:
|
|
50
|
+
- Break down the feature into small, testable chunks
|
|
51
|
+
- Identify the files that need changes
|
|
52
|
+
- Plan the order of implementation (models → controllers → views)
|
|
53
|
+
- Consider backward compatibility
|
|
54
|
+
- Plan rollback strategy if needed
|
|
55
|
+
|
|
56
|
+
#### Documentation:
|
|
57
|
+
- Update or create PRD if the scope is significant
|
|
58
|
+
- Add notes to development journal
|
|
59
|
+
- Create a checklist of implementation steps
|
|
60
|
+
|
|
61
|
+
### 3. Code Phase
|
|
62
|
+
|
|
63
|
+
**Goal**: Implement the solution incrementally with frequent validation.
|
|
64
|
+
|
|
65
|
+
#### Best Practices:
|
|
66
|
+
- Start with tests (TDD approach)
|
|
67
|
+
- Make small, atomic changes
|
|
68
|
+
- Test frequently during development
|
|
69
|
+
- Commit early and often with descriptive messages
|
|
70
|
+
- Follow established code patterns and conventions
|
|
71
|
+
|
|
72
|
+
#### Implementation Order:
|
|
73
|
+
1. Write failing tests first
|
|
74
|
+
2. Implement minimal code to pass tests
|
|
75
|
+
3. Refactor while keeping tests green
|
|
76
|
+
4. Add edge case handling
|
|
77
|
+
5. Update documentation and comments
|
|
78
|
+
|
|
79
|
+
#### Validation:
|
|
80
|
+
- Run tests after each change
|
|
81
|
+
- Test in development environment
|
|
82
|
+
- Verify edge cases work correctly
|
|
83
|
+
- Check for performance implications
|
|
84
|
+
|
|
85
|
+
### 4. Commit Phase
|
|
86
|
+
|
|
87
|
+
**Goal**: Document changes clearly and ensure code quality.
|
|
88
|
+
|
|
89
|
+
#### Pre-Commit Checklist:
|
|
90
|
+
- [ ] All tests pass
|
|
91
|
+
- [ ] Code follows project style guidelines
|
|
92
|
+
- [ ] No debug code or console.logs left behind
|
|
93
|
+
- [ ] Documentation updated if needed
|
|
94
|
+
- [ ] Performance implications considered
|
|
95
|
+
- [ ] Security implications reviewed
|
|
96
|
+
|
|
97
|
+
#### Commit Message Structure:
|
|
98
|
+
```
|
|
99
|
+
Type: Brief description
|
|
100
|
+
|
|
101
|
+
More detailed explanation of what was changed and why.
|
|
102
|
+
Include context about the problem being solved.
|
|
103
|
+
|
|
104
|
+
- Key change 1
|
|
105
|
+
- Key change 2
|
|
106
|
+
- Key change 3
|
|
107
|
+
|
|
108
|
+
Closes #issue-number (if applicable)
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
#### Commit Types:
|
|
112
|
+
- `feat`: New feature
|
|
113
|
+
- `fix`: Bug fix
|
|
114
|
+
- `refactor`: Code refactoring
|
|
115
|
+
- `docs`: Documentation changes
|
|
116
|
+
- `test`: Adding or updating tests
|
|
117
|
+
- `style`: Code style changes (formatting, etc.)
|
|
118
|
+
|
|
119
|
+
## When to Use This Workflow
|
|
120
|
+
|
|
121
|
+
### Ideal For:
|
|
122
|
+
- New feature development
|
|
123
|
+
- Complex bug fixes
|
|
124
|
+
- Refactoring existing code
|
|
125
|
+
- Working with unfamiliar code
|
|
126
|
+
- Cross-cutting changes affecting multiple files
|
|
127
|
+
|
|
128
|
+
### Not Necessary For:
|
|
129
|
+
- Simple typo fixes
|
|
130
|
+
- Trivial configuration changes
|
|
131
|
+
- Emergency hotfixes (but document afterwards)
|
|
132
|
+
|
|
133
|
+
## Advanced Techniques
|
|
134
|
+
|
|
135
|
+
### Subagent Usage
|
|
136
|
+
For very complex problems, consider using subagents:
|
|
137
|
+
- Create specialized agents for different aspects (backend, frontend, testing)
|
|
138
|
+
- Have each agent focus on their specific domain
|
|
139
|
+
- Coordinate between agents for integrated solutions
|
|
140
|
+
|
|
141
|
+
### Incremental Development
|
|
142
|
+
- Start with the simplest possible implementation
|
|
143
|
+
- Add complexity gradually
|
|
144
|
+
- Maintain working code at each step
|
|
145
|
+
- Use feature flags for incomplete features
|
|
146
|
+
|
|
147
|
+
### Documentation as You Go
|
|
148
|
+
- Update README files for significant changes
|
|
149
|
+
- Add inline comments for complex logic
|
|
150
|
+
- Update API documentation
|
|
151
|
+
- Keep development journal current
|
|
152
|
+
|
|
153
|
+
## Common Pitfalls to Avoid
|
|
154
|
+
|
|
155
|
+
### In Explore Phase:
|
|
156
|
+
- Don't skip understanding existing code
|
|
157
|
+
- Don't assume you know how things work
|
|
158
|
+
- Don't ignore existing patterns and conventions
|
|
159
|
+
|
|
160
|
+
### In Plan Phase:
|
|
161
|
+
- Don't skip planning for complex features
|
|
162
|
+
- Don't plan too far ahead (avoid waterfall)
|
|
163
|
+
- Don't ignore edge cases in planning
|
|
164
|
+
|
|
165
|
+
### In Code Phase:
|
|
166
|
+
- Don't write all code before testing
|
|
167
|
+
- Don't ignore failing tests
|
|
168
|
+
- Don't commit broken code
|
|
169
|
+
- Don't leave debug code in commits
|
|
170
|
+
|
|
171
|
+
### In Commit Phase:
|
|
172
|
+
- Don't write vague commit messages
|
|
173
|
+
- Don't commit multiple unrelated changes together
|
|
174
|
+
- Don't skip the pre-commit checklist
|
|
175
|
+
- Don't forget to update documentation
|
|
176
|
+
|
|
177
|
+
## Integration with Other Workflows
|
|
178
|
+
|
|
179
|
+
This workflow complements:
|
|
180
|
+
- **TDD**: The Code phase follows TDD principles
|
|
181
|
+
- **PRD Process**: Use PRDs for significant features in the Plan phase
|
|
182
|
+
- **Code Review**: Structured commits make reviews easier
|
|
183
|
+
- **CI/CD**: Clean commits integrate better with automated pipelines
|
|
184
|
+
|
|
185
|
+
## Success Metrics
|
|
186
|
+
|
|
187
|
+
You're using this workflow successfully when:
|
|
188
|
+
- You rarely encounter unexpected issues during implementation
|
|
189
|
+
- Your commits are focused and well-documented
|
|
190
|
+
- Code reviews are faster and more productive
|
|
191
|
+
- You can easily explain your changes to others
|
|
192
|
+
- You spend less time debugging integration issues
|