chiron 0.1.0
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 +7 -0
- data/.rspec +3 -0
- data/.rspec_status +7 -0
- data/.rubocop.yml +24 -0
- data/CHANGELOG.md +34 -0
- data/CLAUDE.md +108 -0
- data/Gemfile +16 -0
- data/Gemfile.lock +93 -0
- data/LICENSE +21 -0
- data/README.md +155 -0
- data/Rakefile +12 -0
- data/docs/development_journal.md +60 -0
- data/exe/chiron +6 -0
- data/lib/chiron/cli.rb +259 -0
- data/lib/chiron/templates/CLAUDE.md.erb +97 -0
- data/lib/chiron/templates/claude/settings.json +6 -0
- data/lib/chiron/templates/commands/context/catchup.md +77 -0
- data/lib/chiron/templates/commands/context/prime.md +32 -0
- data/lib/chiron/templates/commands/context/quickstart.md +47 -0
- data/lib/chiron/templates/commands/conventions/rails.md +166 -0
- data/lib/chiron/templates/commands/journal/instructions.md +129 -0
- data/lib/chiron/templates/commands/journal/template.md +87 -0
- data/lib/chiron/templates/commands/quality/pre-commit.md +95 -0
- data/lib/chiron/templates/commands/quality/test-driven.md +187 -0
- data/lib/chiron/templates/commands/workflows/create-prd.md +57 -0
- data/lib/chiron/templates/commands/workflows/feature-complete.md +139 -0
- data/lib/chiron/templates/commands/workflows/generate-tasks.md +65 -0
- data/lib/chiron/templates/commands/workflows/process-tasks.md +84 -0
- data/lib/chiron/templates/development_journal.md.erb +80 -0
- data/lib/chiron/version.rb +5 -0
- data/lib/chiron.rb +16 -0
- metadata +174 -0
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
# Journal Instructions for Claude Code
|
|
2
|
+
|
|
3
|
+
This governs how Claude Code should maintain an ongoing development journal for tracking work progress and providing daily catchup summaries.
|
|
4
|
+
|
|
5
|
+
## Journal Location and Structure
|
|
6
|
+
|
|
7
|
+
**File**: `docs/development_journal.md`
|
|
8
|
+
|
|
9
|
+
**Format**: Chronological entries with structured sections for easy scanning and context building.
|
|
10
|
+
|
|
11
|
+
## When to Update the Journal
|
|
12
|
+
|
|
13
|
+
Update the journal after completing significant work sessions, specifically:
|
|
14
|
+
|
|
15
|
+
1. **Bug fixes** - Any bugs identified and resolved
|
|
16
|
+
2. **Feature implementations** - New features or enhancements added
|
|
17
|
+
3. **Refactoring** - Code improvements or architectural changes
|
|
18
|
+
4. **Infrastructure changes** - CI/CD, testing, or deployment modifications
|
|
19
|
+
5. **Important decisions** - Technical choices, architecture decisions, or approach changes
|
|
20
|
+
6. **Problem investigations** - Research into issues, even if not fully resolved
|
|
21
|
+
|
|
22
|
+
## Journal Entry Structure
|
|
23
|
+
|
|
24
|
+
Each entry should follow this format:
|
|
25
|
+
|
|
26
|
+
```markdown
|
|
27
|
+
## [Date] - [Brief Summary Title]
|
|
28
|
+
**Developer(s)**: [Name/Handle] | **Context**: [How work was initiated]
|
|
29
|
+
|
|
30
|
+
### What Was Done
|
|
31
|
+
- Bullet point list of specific actions taken
|
|
32
|
+
- Include file names and line numbers where applicable
|
|
33
|
+
- Mention any tools, commands, or scripts used
|
|
34
|
+
|
|
35
|
+
### Why It Was Done
|
|
36
|
+
- Context for the changes
|
|
37
|
+
- Problem being solved
|
|
38
|
+
- User request or issue being addressed
|
|
39
|
+
|
|
40
|
+
### Technical Details
|
|
41
|
+
- Key code changes made
|
|
42
|
+
- Architectural decisions
|
|
43
|
+
- Testing approach used
|
|
44
|
+
- Any notable implementation details
|
|
45
|
+
|
|
46
|
+
### Results
|
|
47
|
+
- What works now that didn't before
|
|
48
|
+
- Test results (passing/failing counts)
|
|
49
|
+
- Performance improvements if applicable
|
|
50
|
+
- Any remaining issues or follow-up needed
|
|
51
|
+
|
|
52
|
+
### Next Steps (if applicable)
|
|
53
|
+
- Related work that should be done
|
|
54
|
+
- Known issues to address
|
|
55
|
+
- Improvements to consider
|
|
56
|
+
|
|
57
|
+
---
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## Daily Catchup Format
|
|
61
|
+
|
|
62
|
+
When the user asks for a "catchup" or "where are we":
|
|
63
|
+
|
|
64
|
+
1. **Read the journal** to understand recent work
|
|
65
|
+
2. **Summarize the last 3-5 entries** in a concise format
|
|
66
|
+
3. **Highlight current state** of key features/systems
|
|
67
|
+
4. **Identify any pending work** or unresolved issues
|
|
68
|
+
5. **Suggest logical next steps** based on recent work patterns
|
|
69
|
+
|
|
70
|
+
## Developer Attribution Guidelines
|
|
71
|
+
|
|
72
|
+
**For Claude Code entries**:
|
|
73
|
+
- Use "Claude Code (with [User])" format
|
|
74
|
+
- Include how work was initiated (user request, bug report, etc.)
|
|
75
|
+
|
|
76
|
+
**For human developer entries**:
|
|
77
|
+
- Use developer's preferred name/handle
|
|
78
|
+
- Include context (pair programming, solo work, code review, etc.)
|
|
79
|
+
|
|
80
|
+
**For collaborative work**:
|
|
81
|
+
- List all contributors: "Jane Doe & Claude Code (with Brett)"
|
|
82
|
+
- Note the nature of collaboration in context
|
|
83
|
+
|
|
84
|
+
## Multi-Developer Collaboration Features
|
|
85
|
+
|
|
86
|
+
### Developer Activity Summary
|
|
87
|
+
Maintain a running summary at the top of the journal showing recent contributors:
|
|
88
|
+
|
|
89
|
+
```markdown
|
|
90
|
+
## Recent Contributors (Last 30 Days)
|
|
91
|
+
- **[Developer Name]**: [Their focus areas]
|
|
92
|
+
- **Claude Code**: [AI-assisted work areas]
|
|
93
|
+
|
|
94
|
+
## Active Branches & Ownership
|
|
95
|
+
- `branch-name`: [Developer(s) working on it]
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
### Conflict Prevention
|
|
99
|
+
- **Before starting work**: Check recent journal entries for conflicts
|
|
100
|
+
- **Branch coordination**: Note active branches and who's working on what
|
|
101
|
+
- **Handoff documentation**: When passing work between developers, include detailed context
|
|
102
|
+
|
|
103
|
+
## Important Guidelines
|
|
104
|
+
|
|
105
|
+
1. **Be Specific**: Include file paths, line numbers, method names, and test results
|
|
106
|
+
2. **Provide Context**: Explain why changes were needed, not just what was changed
|
|
107
|
+
3. **Track Progress**: Show how issues evolve and get resolved over time
|
|
108
|
+
4. **Include Failures**: Document what didn't work and why, for future reference
|
|
109
|
+
5. **Link Related Work**: Connect entries that build on each other
|
|
110
|
+
6. **Keep It Scannable**: Use clear headings and bullet points for quick reading
|
|
111
|
+
|
|
112
|
+
## Journal Maintenance
|
|
113
|
+
|
|
114
|
+
- **Update frequency**: After each significant work session
|
|
115
|
+
- **Entry length**: Aim for 100-300 words per entry
|
|
116
|
+
- **File size**: If journal exceeds 10,000 lines, create monthly archives
|
|
117
|
+
- **Cross-references**: Link to related PRs, issues, or documentation
|
|
118
|
+
|
|
119
|
+
## Automation Triggers
|
|
120
|
+
|
|
121
|
+
Consider updating the journal when:
|
|
122
|
+
- Completing tasks from a task list
|
|
123
|
+
- Test suite goes from failing to passing
|
|
124
|
+
- Major refactoring (>100 lines changed)
|
|
125
|
+
- Before switching branches
|
|
126
|
+
- After resolving complex bugs
|
|
127
|
+
- When implementing new features
|
|
128
|
+
|
|
129
|
+
This journal serves as both a development log and a knowledge base for understanding the project's evolution and current state.
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
# Journal Entry Template
|
|
2
|
+
|
|
3
|
+
Copy this template when manually adding entries to `docs/development_journal.md`:
|
|
4
|
+
|
|
5
|
+
```markdown
|
|
6
|
+
## [YYYY-MM-DD] - [Brief Summary Title]
|
|
7
|
+
**Developer(s)**: [Your Name] | **Context**: [How this work was initiated]
|
|
8
|
+
|
|
9
|
+
### What Was Done
|
|
10
|
+
- [Specific action taken]
|
|
11
|
+
- [Include file paths: `app/controllers/example_controller.rb:25`]
|
|
12
|
+
- [Commands run: `bin/rspec`, `bin/rubocop --autocorrect`]
|
|
13
|
+
- [Tools used: Claude Code, VS Code, etc.]
|
|
14
|
+
|
|
15
|
+
### Why It Was Done
|
|
16
|
+
- [Problem being solved]
|
|
17
|
+
- [User request or business need]
|
|
18
|
+
- [Technical debt being addressed]
|
|
19
|
+
- [Bug report or issue being fixed]
|
|
20
|
+
|
|
21
|
+
### Technical Details
|
|
22
|
+
- [Key code changes made]
|
|
23
|
+
- [Architecture decisions]
|
|
24
|
+
- [Libraries or frameworks used]
|
|
25
|
+
- [Database changes if applicable]
|
|
26
|
+
- [Testing approach]
|
|
27
|
+
|
|
28
|
+
### Results
|
|
29
|
+
- [What works now that didn't before]
|
|
30
|
+
- [Test results: X examples, Y failures]
|
|
31
|
+
- [Performance improvements if applicable]
|
|
32
|
+
- [Screenshots or demos if relevant]
|
|
33
|
+
|
|
34
|
+
### Next Steps (if applicable)
|
|
35
|
+
- [Related work that should be done]
|
|
36
|
+
- [Known issues to address]
|
|
37
|
+
- [Improvements to consider]
|
|
38
|
+
- [Dependencies for other developers]
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Quick Examples for Common Scenarios
|
|
44
|
+
|
|
45
|
+
**Bug Fix:**
|
|
46
|
+
```markdown
|
|
47
|
+
**Developer(s)**: Jane Doe | **Context**: User reported login failure in Issue #42
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
**Feature Development:**
|
|
51
|
+
```markdown
|
|
52
|
+
**Developer(s)**: John Smith | **Context**: Implementing payment workflow from prd-payment-system.md
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
**Pair Programming:**
|
|
56
|
+
```markdown
|
|
57
|
+
**Developer(s)**: Alice & Bob | **Context**: Pair programming session on OAuth integration
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
**Code Review Follow-up:**
|
|
61
|
+
```markdown
|
|
62
|
+
**Developer(s)**: Charlie | **Context**: Addressing PR #35 review comments from Brett
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
**Collaborative AI Work:**
|
|
66
|
+
```markdown
|
|
67
|
+
**Developer(s)**: Dana & Claude Code | **Context**: Investigating performance issues with AI assistance
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## Tips for Good Journal Entries
|
|
71
|
+
|
|
72
|
+
1. **Be specific about files changed** - include paths and line numbers when relevant
|
|
73
|
+
2. **Include test results** - show the impact of your changes
|
|
74
|
+
3. **Explain the "why"** - context helps other developers understand decisions
|
|
75
|
+
4. **Link to related work** - mention PRs, issues, or previous journal entries
|
|
76
|
+
5. **Note blocking issues** - help other developers avoid conflicts
|
|
77
|
+
6. **Update the contributor summary** - keep the top section current
|
|
78
|
+
7. **Time tracking** - Consider adding time spent for future estimates
|
|
79
|
+
|
|
80
|
+
## Commit Message Integration
|
|
81
|
+
|
|
82
|
+
When making commits related to journal entries, reference them:
|
|
83
|
+
```bash
|
|
84
|
+
git commit -m "Fix authentication timeout issue
|
|
85
|
+
|
|
86
|
+
See development journal entry 2025-06-21 for details"
|
|
87
|
+
```
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
# Pre-Commit Checklist
|
|
2
|
+
|
|
3
|
+
Run these commands in sequence before committing code changes.
|
|
4
|
+
|
|
5
|
+
## Required Steps
|
|
6
|
+
|
|
7
|
+
### 1. Code Quality
|
|
8
|
+
```bash
|
|
9
|
+
bin/rubocop --autocorrect
|
|
10
|
+
```
|
|
11
|
+
- Fix all auto-correctable violations
|
|
12
|
+
- Review remaining violations
|
|
13
|
+
- Document any acceptable violations
|
|
14
|
+
|
|
15
|
+
### 2. Test Suite
|
|
16
|
+
```bash
|
|
17
|
+
bin/rspec
|
|
18
|
+
```
|
|
19
|
+
- Ensure all tests pass
|
|
20
|
+
- If tests fail, fix them before proceeding
|
|
21
|
+
- Add new tests for new functionality
|
|
22
|
+
|
|
23
|
+
### 3. Security Check
|
|
24
|
+
```bash
|
|
25
|
+
bin/brakeman
|
|
26
|
+
```
|
|
27
|
+
- Review any security warnings
|
|
28
|
+
- Address critical issues immediately
|
|
29
|
+
- Document false positives
|
|
30
|
+
|
|
31
|
+
### 4. Review Changes
|
|
32
|
+
```bash
|
|
33
|
+
git diff --cached
|
|
34
|
+
```
|
|
35
|
+
- Verify all changes are intentional
|
|
36
|
+
- Check for debugging code
|
|
37
|
+
- Ensure no sensitive data is included
|
|
38
|
+
|
|
39
|
+
### 5. Update Documentation
|
|
40
|
+
- Update CLAUDE.md if workflow changes
|
|
41
|
+
- Add/update code comments if complex logic
|
|
42
|
+
- Update README if user-facing changes
|
|
43
|
+
|
|
44
|
+
### 6. Development Journal
|
|
45
|
+
For significant work:
|
|
46
|
+
- Add entry to docs/development_journal.md
|
|
47
|
+
- Include what, why, and results
|
|
48
|
+
- Note any follow-up tasks
|
|
49
|
+
|
|
50
|
+
## Quick Command
|
|
51
|
+
```bash
|
|
52
|
+
# Run all checks at once
|
|
53
|
+
bin/rubocop --autocorrect && bin/rspec && bin/brakeman && git diff --cached
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## Commit Message Format
|
|
57
|
+
```
|
|
58
|
+
type: Brief description (max 50 chars)
|
|
59
|
+
|
|
60
|
+
Longer explanation if needed. Wrap at 72 characters.
|
|
61
|
+
Explain what and why, not how.
|
|
62
|
+
|
|
63
|
+
- Bullet points for multiple changes
|
|
64
|
+
- Reference issue numbers: Fixes #123
|
|
65
|
+
- Reference PRD if applicable: Implements prd-feature-name
|
|
66
|
+
|
|
67
|
+
Co-authored-by: Name <email> (if pair programming)
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### Types:
|
|
71
|
+
- `feat`: New feature
|
|
72
|
+
- `fix`: Bug fix
|
|
73
|
+
- `docs`: Documentation only
|
|
74
|
+
- `style`: Code style (formatting, missing semicolons, etc)
|
|
75
|
+
- `refactor`: Code change that neither fixes a bug nor adds a feature
|
|
76
|
+
- `test`: Adding missing tests
|
|
77
|
+
- `chore`: Changes to build process or auxiliary tools
|
|
78
|
+
|
|
79
|
+
## Warning Signs to Check
|
|
80
|
+
|
|
81
|
+
Before committing, ensure you haven't:
|
|
82
|
+
- Left debugging statements (puts, console.log, binding.pry)
|
|
83
|
+
- Included commented-out code without explanation
|
|
84
|
+
- Added TODO comments without creating issues
|
|
85
|
+
- Modified tests just to make them pass
|
|
86
|
+
- Included hardcoded values that should be configurable
|
|
87
|
+
- Forgotten to add new files to git
|
|
88
|
+
|
|
89
|
+
## Final Verification
|
|
90
|
+
```bash
|
|
91
|
+
git status
|
|
92
|
+
```
|
|
93
|
+
- All intended files are staged
|
|
94
|
+
- No untracked files forgotten
|
|
95
|
+
- Working directory is clean (or intentionally not)
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
# Test-Driven Development (TDD) Workflow
|
|
2
|
+
|
|
3
|
+
## Core Principles
|
|
4
|
+
|
|
5
|
+
1. **Red**: Write a failing test first
|
|
6
|
+
2. **Green**: Write minimal code to make the test pass
|
|
7
|
+
3. **Refactor**: Improve the code while keeping tests green
|
|
8
|
+
|
|
9
|
+
## TDD Process
|
|
10
|
+
|
|
11
|
+
### Step 1: Write a Failing Test
|
|
12
|
+
```ruby
|
|
13
|
+
# spec/models/user_spec.rb
|
|
14
|
+
it 'returns the full name' do
|
|
15
|
+
user = User.new(first_name: 'John', last_name: 'Doe')
|
|
16
|
+
expect(user.full_name).to eq('John Doe')
|
|
17
|
+
end
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
### Step 2: Run Test (See it Fail)
|
|
21
|
+
```bash
|
|
22
|
+
bin/rspec spec/models/user_spec.rb
|
|
23
|
+
# Expected failure: undefined method `full_name'
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
### Step 3: Write Minimal Code
|
|
27
|
+
```ruby
|
|
28
|
+
# app/models/user.rb
|
|
29
|
+
def full_name
|
|
30
|
+
"#{first_name} #{last_name}"
|
|
31
|
+
end
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
### Step 4: Run Test (See it Pass)
|
|
35
|
+
```bash
|
|
36
|
+
bin/rspec spec/models/user_spec.rb
|
|
37
|
+
# All tests should pass
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### Step 5: Refactor if Needed
|
|
41
|
+
```ruby
|
|
42
|
+
# Improved version
|
|
43
|
+
def full_name
|
|
44
|
+
[first_name, last_name].compact.join(' ')
|
|
45
|
+
end
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Rules
|
|
49
|
+
|
|
50
|
+
### Write One Test at a Time
|
|
51
|
+
- Write test
|
|
52
|
+
- See it fail
|
|
53
|
+
- Make it pass
|
|
54
|
+
- Refactor
|
|
55
|
+
- Repeat
|
|
56
|
+
|
|
57
|
+
### Only Write Code to Pass Current Test
|
|
58
|
+
- Don't add functionality not required by current test
|
|
59
|
+
- Don't anticipate future needs
|
|
60
|
+
- Keep it simple
|
|
61
|
+
|
|
62
|
+
### Committing Rules
|
|
63
|
+
- Only commit when all tests pass
|
|
64
|
+
- Never commit with failing tests
|
|
65
|
+
- Include all changed files in commit
|
|
66
|
+
|
|
67
|
+
### Test Integrity
|
|
68
|
+
- Never delete or modify tests just to make them pass
|
|
69
|
+
- If a test is wrong, fix it and document why
|
|
70
|
+
- Use `skip` or `pending` for incomplete tests
|
|
71
|
+
|
|
72
|
+
## Test Plan Management
|
|
73
|
+
|
|
74
|
+
### Create Test Plan First
|
|
75
|
+
```markdown
|
|
76
|
+
## User Model Test Plan
|
|
77
|
+
- [ ] validates presence of email
|
|
78
|
+
- [ ] validates uniqueness of email
|
|
79
|
+
- [ ] validates email format
|
|
80
|
+
- [ ] returns full name
|
|
81
|
+
- [ ] returns initials
|
|
82
|
+
- [ ] has many posts
|
|
83
|
+
- [ ] scopes for active users
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### Track Progress
|
|
87
|
+
- Check off completed tests
|
|
88
|
+
- Add new tests as discovered
|
|
89
|
+
- Keep plan updated
|
|
90
|
+
|
|
91
|
+
## Common Patterns
|
|
92
|
+
|
|
93
|
+
### Model Testing
|
|
94
|
+
```ruby
|
|
95
|
+
describe User do
|
|
96
|
+
describe 'validations' do
|
|
97
|
+
it { should validate_presence_of(:email) }
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
describe '#full_name' do
|
|
101
|
+
it 'returns concatenated name' do
|
|
102
|
+
# test here
|
|
103
|
+
end
|
|
104
|
+
end
|
|
105
|
+
end
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
### Controller Testing
|
|
109
|
+
```ruby
|
|
110
|
+
describe UsersController do
|
|
111
|
+
describe 'GET #index' do
|
|
112
|
+
before { get :index }
|
|
113
|
+
|
|
114
|
+
it 'returns success' do
|
|
115
|
+
expect(response).to be_successful
|
|
116
|
+
end
|
|
117
|
+
end
|
|
118
|
+
end
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
### System Testing
|
|
122
|
+
```ruby
|
|
123
|
+
describe 'User registration' do
|
|
124
|
+
it 'allows new users to sign up' do
|
|
125
|
+
visit new_user_registration_path
|
|
126
|
+
fill_in 'Email', with: 'test@example.com'
|
|
127
|
+
# ... more steps
|
|
128
|
+
expect(page).to have_content('Welcome!')
|
|
129
|
+
end
|
|
130
|
+
end
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
## Best Practices
|
|
134
|
+
|
|
135
|
+
### Good Tests Are:
|
|
136
|
+
- **Fast**: Run quickly
|
|
137
|
+
- **Independent**: Don't depend on other tests
|
|
138
|
+
- **Repeatable**: Same result every time
|
|
139
|
+
- **Self-Validating**: Clear pass/fail
|
|
140
|
+
- **Timely**: Written before code
|
|
141
|
+
|
|
142
|
+
### Test Naming
|
|
143
|
+
```ruby
|
|
144
|
+
# Bad
|
|
145
|
+
it 'works' do
|
|
146
|
+
it 'test user' do
|
|
147
|
+
|
|
148
|
+
# Good
|
|
149
|
+
it 'returns full name when both names present' do
|
|
150
|
+
it 'returns only first name when last name is nil' do
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
### Edge Cases
|
|
154
|
+
Always test:
|
|
155
|
+
- Nil values
|
|
156
|
+
- Empty strings
|
|
157
|
+
- Boundary conditions
|
|
158
|
+
- Invalid input
|
|
159
|
+
- Error conditions
|
|
160
|
+
|
|
161
|
+
## Useful Commands
|
|
162
|
+
|
|
163
|
+
```bash
|
|
164
|
+
# Run specific test file
|
|
165
|
+
bin/rspec spec/models/user_spec.rb
|
|
166
|
+
|
|
167
|
+
# Run specific line
|
|
168
|
+
bin/rspec spec/models/user_spec.rb:42
|
|
169
|
+
|
|
170
|
+
# Run with documentation format
|
|
171
|
+
bin/rspec --format documentation
|
|
172
|
+
|
|
173
|
+
# Run only failing tests
|
|
174
|
+
bin/rspec --only-failures
|
|
175
|
+
|
|
176
|
+
# Run tests matching pattern
|
|
177
|
+
bin/rspec --example "full name"
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
## When to Break TDD Rules
|
|
181
|
+
|
|
182
|
+
Acceptable exceptions:
|
|
183
|
+
- Exploring new libraries/APIs
|
|
184
|
+
- Spike solutions (throw away after)
|
|
185
|
+
- UI styling (but test behavior)
|
|
186
|
+
|
|
187
|
+
Always return to TDD after exploration!
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# Creating a Product Requirements Document (PRD)
|
|
2
|
+
|
|
3
|
+
## Goal
|
|
4
|
+
|
|
5
|
+
To create a detailed Product Requirements Document (PRD) in Markdown format based on an initial user prompt. The PRD should be clear, actionable, and suitable for a junior developer to understand and implement the feature.
|
|
6
|
+
|
|
7
|
+
## Process
|
|
8
|
+
|
|
9
|
+
1. **Receive Initial Prompt:** The user provides a brief description or request for a new feature or functionality.
|
|
10
|
+
2. **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).
|
|
11
|
+
3. **Generate PRD:** Based on the initial prompt and the user's answers to the clarifying questions, generate a PRD using the structure outlined below.
|
|
12
|
+
4. **Save PRD:** Save the generated document as `prd-[feature-name].md` inside the `/tasks` directory.
|
|
13
|
+
|
|
14
|
+
## Clarifying Questions (Examples)
|
|
15
|
+
|
|
16
|
+
Adapt your questions based on the prompt, but here are common areas to explore:
|
|
17
|
+
|
|
18
|
+
* **Problem/Goal:** "What problem does this feature solve for the user?" or "What is the main goal we want to achieve with this feature?"
|
|
19
|
+
* **Target User:** "Who is the primary user of this feature?"
|
|
20
|
+
* **Core Functionality:** "Can you describe the key actions a user should be able to perform with this feature?"
|
|
21
|
+
* **User Stories:** "Could you provide a few user stories? (e.g., As a [type of user], I want to [perform an action] so that [benefit].)"
|
|
22
|
+
* **Acceptance Criteria:** "How will we know when this feature is successfully implemented? What are the key success criteria?"
|
|
23
|
+
* **Scope/Boundaries:** "Are there any specific things this feature *should not* do (non-goals)?"
|
|
24
|
+
* **Data Requirements:** "What kind of data does this feature need to display or manipulate?"
|
|
25
|
+
* **Design/UI:** "Are there any existing design mockups or UI guidelines to follow?" or "Can you describe the desired look and feel?"
|
|
26
|
+
* **Edge Cases:** "Are there any potential edge cases or error conditions we should consider?"
|
|
27
|
+
|
|
28
|
+
## PRD Structure
|
|
29
|
+
|
|
30
|
+
The generated PRD should include the following sections:
|
|
31
|
+
|
|
32
|
+
1. **Introduction/Overview:** Briefly describe the feature and the problem it solves. State the goal.
|
|
33
|
+
2. **Goals:** List the specific, measurable objectives for this feature.
|
|
34
|
+
3. **User Stories:** Detail the user narratives describing feature usage and benefits.
|
|
35
|
+
4. **Functional Requirements:** List the specific functionalities the feature must have. Use clear, concise language (e.g., "The system must allow users to upload a profile picture."). Number these requirements.
|
|
36
|
+
5. **Non-Goals (Out of Scope):** Clearly state what this feature will *not* include to manage scope.
|
|
37
|
+
6. **Design Considerations (Optional):** Link to mockups, describe UI/UX requirements, or mention relevant components/styles if applicable.
|
|
38
|
+
7. **Technical Considerations (Optional):** Mention any known technical constraints, dependencies, or suggestions (e.g., "Should integrate with the existing Auth module").
|
|
39
|
+
8. **Success Metrics:** How will the success of this feature be measured? (e.g., "Increase user engagement by 10%", "Reduce support tickets related to X").
|
|
40
|
+
9. **Open Questions:** List any remaining questions or areas needing further clarification.
|
|
41
|
+
|
|
42
|
+
## Target Audience
|
|
43
|
+
|
|
44
|
+
Assume the primary reader of the PRD is a **junior developer**. Therefore, requirements should be explicit, unambiguous, and avoid jargon where possible. Provide enough detail for them to understand the feature's purpose and core logic.
|
|
45
|
+
|
|
46
|
+
## Output
|
|
47
|
+
|
|
48
|
+
* **Format:** Markdown (`.md`)
|
|
49
|
+
* **Location:** `/tasks/`
|
|
50
|
+
* **Filename:** `prd-[feature-name].md`
|
|
51
|
+
|
|
52
|
+
## Important Reminders
|
|
53
|
+
|
|
54
|
+
1. Do NOT start implementing the PRD
|
|
55
|
+
2. Always ask the user clarifying questions
|
|
56
|
+
3. Take the user's answers to the clarifying questions and improve the PRD
|
|
57
|
+
4. Update the development journal when creating significant PRDs
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
# Feature Completion Checklist
|
|
2
|
+
|
|
3
|
+
Use this checklist when you believe a feature is complete to ensure nothing is missed.
|
|
4
|
+
|
|
5
|
+
## Pre-Completion Review
|
|
6
|
+
|
|
7
|
+
### 1. Task Verification
|
|
8
|
+
- [ ] All tasks from `tasks-*.md` are marked complete
|
|
9
|
+
- [ ] No blocked tasks remain unresolved
|
|
10
|
+
- [ ] All subtasks have been implemented
|
|
11
|
+
|
|
12
|
+
### 2. Code Quality
|
|
13
|
+
- [ ] All tests are passing (`bin/rspec`)
|
|
14
|
+
- [ ] RuboCop violations addressed (`bin/rubocop`)
|
|
15
|
+
- [ ] No commented-out code without explanation
|
|
16
|
+
- [ ] No debugging statements left in code
|
|
17
|
+
|
|
18
|
+
### 3. Test Coverage
|
|
19
|
+
- [ ] Unit tests for all models
|
|
20
|
+
- [ ] Request specs for all controllers
|
|
21
|
+
- [ ] System tests for user workflows
|
|
22
|
+
- [ ] Edge cases tested
|
|
23
|
+
- [ ] Error conditions handled
|
|
24
|
+
|
|
25
|
+
### 4. Documentation
|
|
26
|
+
- [ ] Code comments for complex logic
|
|
27
|
+
- [ ] README updated if needed
|
|
28
|
+
- [ ] API documentation if applicable
|
|
29
|
+
- [ ] CLAUDE.md updated for workflow changes
|
|
30
|
+
|
|
31
|
+
### 5. Performance
|
|
32
|
+
- [ ] Database queries optimized (no N+1)
|
|
33
|
+
- [ ] Appropriate indexes added
|
|
34
|
+
- [ ] Caching implemented where beneficial
|
|
35
|
+
- [ ] Background jobs for slow operations
|
|
36
|
+
|
|
37
|
+
### 6. Security
|
|
38
|
+
- [ ] Authorization checks in place
|
|
39
|
+
- [ ] Strong parameters used
|
|
40
|
+
- [ ] No sensitive data exposed
|
|
41
|
+
- [ ] Security scan passed (`bin/brakeman`)
|
|
42
|
+
|
|
43
|
+
## Feature-Specific Checks
|
|
44
|
+
|
|
45
|
+
### Frontend Features
|
|
46
|
+
- [ ] Responsive design verified
|
|
47
|
+
- [ ] Accessibility requirements met
|
|
48
|
+
- [ ] Cross-browser testing done
|
|
49
|
+
- [ ] Loading states implemented
|
|
50
|
+
- [ ] Error states handled gracefully
|
|
51
|
+
|
|
52
|
+
### API Features
|
|
53
|
+
- [ ] Versioning implemented
|
|
54
|
+
- [ ] Rate limiting considered
|
|
55
|
+
- [ ] Documentation generated
|
|
56
|
+
- [ ] Integration tests written
|
|
57
|
+
- [ ] Error responses standardized
|
|
58
|
+
|
|
59
|
+
### Background Jobs
|
|
60
|
+
- [ ] Idempotency ensured
|
|
61
|
+
- [ ] Retry logic implemented
|
|
62
|
+
- [ ] Failure notifications set up
|
|
63
|
+
- [ ] Performance monitored
|
|
64
|
+
- [ ] Dead letter queue configured
|
|
65
|
+
|
|
66
|
+
## Final Steps
|
|
67
|
+
|
|
68
|
+
### 1. Development Journal
|
|
69
|
+
Add comprehensive entry including:
|
|
70
|
+
- Summary of implementation
|
|
71
|
+
- Key decisions made
|
|
72
|
+
- Challenges overcome
|
|
73
|
+
- Performance metrics
|
|
74
|
+
- Lessons learned
|
|
75
|
+
|
|
76
|
+
### 2. Pull Request
|
|
77
|
+
Create PR with:
|
|
78
|
+
- Reference to original PRD
|
|
79
|
+
- Summary of changes
|
|
80
|
+
- Screenshots/demos if UI changes
|
|
81
|
+
- Testing instructions
|
|
82
|
+
- Deployment notes
|
|
83
|
+
|
|
84
|
+
### 3. Knowledge Transfer
|
|
85
|
+
- [ ] Document any gotchas
|
|
86
|
+
- [ ] Update team wiki if needed
|
|
87
|
+
- [ ] Schedule demo if significant feature
|
|
88
|
+
- [ ] Plan monitoring strategy
|
|
89
|
+
|
|
90
|
+
## Post-Completion
|
|
91
|
+
|
|
92
|
+
### Monitoring Plan
|
|
93
|
+
- Key metrics to track
|
|
94
|
+
- Error rate thresholds
|
|
95
|
+
- Performance benchmarks
|
|
96
|
+
- User feedback channels
|
|
97
|
+
|
|
98
|
+
### Follow-up Tasks
|
|
99
|
+
- Performance optimization opportunities
|
|
100
|
+
- Additional features to consider
|
|
101
|
+
- Technical debt to address
|
|
102
|
+
- Documentation improvements
|
|
103
|
+
|
|
104
|
+
## Success Criteria Verification
|
|
105
|
+
|
|
106
|
+
Review the original PRD and verify:
|
|
107
|
+
- All functional requirements implemented
|
|
108
|
+
- Success metrics achievable
|
|
109
|
+
- Acceptance criteria met
|
|
110
|
+
- Non-goals respected
|
|
111
|
+
|
|
112
|
+
## Sign-off Template
|
|
113
|
+
|
|
114
|
+
```markdown
|
|
115
|
+
## Feature Complete: [Feature Name]
|
|
116
|
+
|
|
117
|
+
**PRD Reference**: prd-[feature-name].md
|
|
118
|
+
**Tasks Reference**: tasks-prd-[feature-name].md
|
|
119
|
+
|
|
120
|
+
### Verification
|
|
121
|
+
- ✅ All tasks completed
|
|
122
|
+
- ✅ Tests passing: [X examples, 0 failures]
|
|
123
|
+
- ✅ Code quality verified
|
|
124
|
+
- ✅ Documentation updated
|
|
125
|
+
- ✅ Security review passed
|
|
126
|
+
|
|
127
|
+
### Metrics
|
|
128
|
+
- Test coverage: X%
|
|
129
|
+
- Performance: Xms average response
|
|
130
|
+
- Code changes: +X -Y lines
|
|
131
|
+
|
|
132
|
+
### Notes
|
|
133
|
+
[Any important notes for deployment or future work]
|
|
134
|
+
|
|
135
|
+
**Developer**: [Name]
|
|
136
|
+
**Date**: [YYYY-MM-DD]
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
Remember: "Done" means deployed, documented, and monitored!
|