chiron 0.2.1 → 0.2.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ed0812e658fcd053473ebaeb84d3c0e7b5c0ca35cc9a53a66a316e72ba96d0e5
4
- data.tar.gz: 45a146731a3eb6797444ae1b8d469e066da1a3e7d50d8913a414d2944c9d9a40
3
+ metadata.gz: 111859d544263c1e225be5ed1657738d129b1a3ba2d5408664cb2c79b21797ce
4
+ data.tar.gz: a65d608c4abea66adbc0780e847547d99173c8467e95e82da60bc63f968809f7
5
5
  SHA512:
6
- metadata.gz: 0a1d06237d6c61271c7a4313a7242dc9105fdd14dc90a135f8117f18b0a5da1df02a800a5c2f731a02524bdf15a8dc1b698a5efd75f5bb9e7e634c8d6989876a
7
- data.tar.gz: 90b73ca6f3b9a550ee4b78220c3f73e83587341e962c0265acdefc1276d06aa89c6f67bedd93258436760f2e6671ef47a0e4bbe0bd76643fd56e0659751ec844
6
+ metadata.gz: 89e21444318c44696397229933f62b8f41d0056217c89ae22784a70bbf5f1fbc3a25ebab5e5cf338c0da654adbb0e2ad7e4f816e9655ac98b0d06085b0ab9c0a
7
+ data.tar.gz: 9657fd9dc8b6a0ba32dabd0e82609428ee47ad9bd0fdded4dc7db25b968b5075f4e4200f238a90cd24c4703ffd0972549ae80f0f92bf972b78539e57825c9f50
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- chiron (0.2.0)
4
+ chiron (0.2.2)
5
5
  colorize (~> 1.1)
6
6
  thor (~> 1.3)
7
7
  tty-prompt (~> 0.23)
@@ -5,6 +5,41 @@ Chiron is a Ruby gem that helps Rails and Python developers set up Claude AI wor
5
5
 
6
6
  ---
7
7
 
8
+ ## 2025-07-01 - Enhancement: Claude Code Best Practices Integration
9
+ **Developer(s)**: Claude Code | **Branch**: main | **Context**: User research into Claude Code best practices
10
+
11
+ ### What was accomplished today:
12
+ - **Template Enhancement**: Updated Rails and Python CLAUDE.md templates with best practices from https://www.anthropic.com/engineering/claude-code-best-practices
13
+ - **Extended Thinking Integration**: Added "think" triggers to workflow templates for complex problem solving
14
+ - **Test Verification Focus**: Enhanced TDD template to emphasize test failure verification before implementation
15
+ - **New Workflow Templates**: Created comprehensive Explore-Plan-Code-Commit and Visual Iteration workflows
16
+ - **Tool Permissions Guidance**: Added tool customization sections to help developers manage Claude Code permissions
17
+ - **Documentation Improvements**: Added quick documentation tips and conversational Q&A guidance
18
+
19
+ ### Technical decisions made:
20
+ - **Incremental Enhancement**: Modified existing templates rather than replacing them to maintain backward compatibility
21
+ - **Best Practice Integration**: Incorporated structured workflows (Explore-Plan-Code-Commit) recommended by Anthropic
22
+ - **Visual Development Support**: Added dedicated workflow for screenshot-driven UI development
23
+ - **Test Quality Focus**: Enhanced TDD workflow to prevent test overfitting and ensure proper failure verification
24
+
25
+ ### Implementation details:
26
+ - **Updated Templates**: Both `rails/CLAUDE.md.erb` and `python/CLAUDE.md.erb` now include tool permissions, extended thinking, and visual development guidance
27
+ - **New Workflow Files**:
28
+ - `explore-plan-code-commit.md` - Structured development process
29
+ - `visual-iteration.md` - Screenshot-driven UI development
30
+ - **Enhanced TDD**: Updated `test-driven.md` with failure verification and overfitting prevention
31
+ - **Quality Assurance**: All 41 tests continue to pass, ensuring no breaking changes
32
+
33
+ ### Files modified:
34
+ - `lib/chiron/templates/rails/CLAUDE.md.erb` - Added best practices sections
35
+ - `lib/chiron/templates/python/CLAUDE.md.erb` - Added best practices sections
36
+ - `lib/chiron/templates/shared/commands/workflows/create-prd.md` - Added extended thinking trigger
37
+ - `lib/chiron/templates/shared/commands/quality/test-driven.md` - Enhanced with failure verification
38
+ - `lib/chiron/templates/shared/commands/workflows/explore-plan-code-commit.md` - New comprehensive workflow
39
+ - `lib/chiron/templates/shared/commands/workflows/visual-iteration.md` - New UI development workflow
40
+
41
+ ---
42
+
8
43
  ## 2025-07-01 - Major Enhancement: Comprehensive Python Project Support
9
44
  **Developer(s)**: Claude Code | **Branch**: main | **Context**: User request for Python support
10
45
 
data/lib/chiron/cli.rb CHANGED
@@ -15,6 +15,7 @@ module Chiron
15
15
 
16
16
  desc 'init', 'Initialize Claude workflow in current project'
17
17
  option :project_name, type: :string, desc: 'Project name for CLAUDE.md'
18
+ option :user_name, type: :string, desc: 'User name for templates. Auto-detected from git config if not specified'
18
19
  option :type, type: :string, desc: 'Project type (rails, python). Auto-detected if not specified'
19
20
  option :with_oauth, type: :boolean, default: false, desc: 'Include OAuth workflow examples'
20
21
  option :with_viewcomponents, type: :boolean, default: false, desc: 'Include ViewComponent rules'
@@ -27,6 +28,7 @@ module Chiron
27
28
  @prompt = TTY::Prompt.new
28
29
  @project_type = determine_project_type
29
30
  @project_name = options[:project_name] || prompt_for_project_name
31
+ @user_name = options[:user_name] || detect_user_name
30
32
 
31
33
  # Set up project configuration
32
34
  if @project_type == :python
@@ -376,6 +378,21 @@ module Chiron
376
378
  File.exist?('setup.py') || File.exist?('Pipfile')
377
379
  end
378
380
 
381
+ def detect_user_name
382
+ # Try git config first
383
+ git_user = `git config user.name 2>/dev/null`.strip
384
+ return git_user if !git_user.empty?
385
+
386
+ # Fall back to environment variables
387
+ env_user = ENV['USER'] || ENV['USERNAME']
388
+ return env_user if env_user && !env_user.empty?
389
+
390
+ # Last resort: prompt the user
391
+ @prompt.ask('What is your name?', default: 'Developer')
392
+ rescue StandardError
393
+ 'Developer'
394
+ end
395
+
379
396
  def error(message)
380
397
  say "❌ #{message}".colorize(:red)
381
398
  end
@@ -6,6 +6,17 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
6
6
 
7
7
  <%= @project_name %> is a Python project<% if @python_framework == :django %> using Django framework<% elsif @python_framework == :fastapi %> using FastAPI framework<% elsif @python_framework == :flask %> using Flask framework<% end %>. [Add your project description here]
8
8
 
9
+ ## Tool Permissions & Customization
10
+
11
+ ```bash
12
+ # View current tool permissions
13
+ /permissions
14
+
15
+ # Customize tools for specific sessions
16
+ claude --allowedTools read,edit,bash --no-write # Example: read-only session
17
+ claude --allowedTools bash,read,write # Example: development session
18
+ ```
19
+
9
20
  ## Development Commands
10
21
 
11
22
  **Important**: Use virtual environments for dependency isolation.
@@ -118,6 +129,17 @@ JWT_SECRET=your-jwt-secret
118
129
 
119
130
  ## Development Patterns
120
131
 
132
+ ### Explore-Plan-Code-Commit Workflow
133
+ 1. **Explore**: Read relevant files and understand context
134
+ 2. **Plan**: Use "think" to trigger extended thinking mode for complex problems
135
+ 3. **Code**: Implement solution incrementally with frequent testing
136
+ 4. **Commit**: Create clear commit messages explaining the change
137
+
138
+ ### Visual Development
139
+ - Take screenshots for UI work using Claude Code's image reading
140
+ - Iterate 2-3 times for visual improvements
141
+ - Use incremental screenshots to track progress
142
+
121
143
  ### Code Organization
122
144
  <% if @python_framework == :django %>
123
145
  - Follow Django's app-based architecture
@@ -150,9 +172,10 @@ JWT_SECRET=your-jwt-secret
150
172
  ## Testing Standards
151
173
 
152
174
  - Write tests before implementation (TDD)
175
+ - **Verify tests fail first** - Confirm tests fail before writing implementation
153
176
  - Use pytest fixtures for test data
154
177
  - Mock external dependencies
155
- - Aim for high test coverage
178
+ - Aim for high test coverage but avoid "overfitting to the tests"
156
179
  - Test edge cases and error conditions
157
180
 
158
181
  <% if @python_framework == :django %>
@@ -182,11 +205,19 @@ def test_read_main():
182
205
  ```
183
206
  <% end %>
184
207
 
208
+ ## Quick Documentation Tips
209
+
210
+ - Use `#` key to quickly document guidelines and patterns
211
+ - Be specific in instructions to Claude
212
+ - Course-correct early and often during development
213
+ - Provide clear context and expectations
214
+
185
215
  ## Important Reminders
186
216
 
187
217
  - Always run tests before committing
188
- - Use semantic commit messages
218
+ - Use semantic commit messages with clear explanations
189
219
  - Update the development journal for significant changes
190
220
  - Follow the pre-commit checklist in `.claude/commands/quality/pre-commit.md`
191
221
  - Keep dependencies updated in requirements.txt
192
- - Document API changes
222
+ - Document API changes
223
+ - Use conversational Q&A to explore unfamiliar parts of the codebase
@@ -6,6 +6,17 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
6
6
 
7
7
  <%= @project_name %> is a Rails <%= Rails.version rescue "8.0.2" %> application. [Add your project description here]
8
8
 
9
+ ## Tool Permissions & Customization
10
+
11
+ ```bash
12
+ # View current tool permissions
13
+ /permissions
14
+
15
+ # Customize tools for specific sessions
16
+ claude --allowedTools read,edit,bash --no-write # Example: read-only session
17
+ claude --allowedTools bash,read,write # Example: development session
18
+ ```
19
+
9
20
  ## Development Commands
10
21
 
11
22
  **Important**: Always use binstubs instead of `bundle exec` for better performance and consistency.
@@ -67,6 +78,17 @@ Required for development:
67
78
 
68
79
  ## Development Patterns
69
80
 
81
+ ### Explore-Plan-Code-Commit Workflow
82
+ 1. **Explore**: Read relevant files and understand context
83
+ 2. **Plan**: Use "think" to trigger extended thinking mode for complex problems
84
+ 3. **Code**: Implement solution incrementally with frequent testing
85
+ 4. **Commit**: Create clear commit messages explaining the change
86
+
87
+ ### Visual Development
88
+ - Take screenshots for UI work using Claude Code's image reading
89
+ - Iterate 2-3 times for visual improvements
90
+ - Use incremental screenshots to track progress
91
+
70
92
  ### Component Architecture
71
93
  - Use ViewComponent for reusable UI elements (located in `app/components/`)
72
94
  - Follow Rails conventions with Hotwire for reactive interfaces
@@ -85,13 +107,23 @@ Required for development:
85
107
  ## Testing Standards
86
108
 
87
109
  - Write tests before implementation (TDD)
88
- - Maintain high test coverage
110
+ - **Verify tests fail first** - Confirm tests fail before writing implementation
111
+ - Maintain high test coverage but avoid "overfitting to the tests"
89
112
  - Use FactoryBot for test data
90
113
  - Follow RSpec best practices
114
+ - Test both happy path and edge cases
115
+
116
+ ## Quick Documentation Tips
117
+
118
+ - Use `#` key to quickly document guidelines and patterns
119
+ - Be specific in instructions to Claude
120
+ - Course-correct early and often during development
121
+ - Provide clear context and expectations
91
122
 
92
123
  ## Important Reminders
93
124
 
94
125
  - Always run tests before committing
95
- - Use semantic commit messages
126
+ - Use semantic commit messages with clear explanations
96
127
  - Update the development journal for significant changes
97
- - Follow the pre-commit checklist in `.claude/commands/quality/pre-commit.md`
128
+ - Follow the pre-commit checklist in `.claude/commands/quality/pre-commit.md`
129
+ - Use conversational Q&A to explore unfamiliar parts of the codebase
@@ -2,13 +2,20 @@
2
2
 
3
3
  ## Core Principles
4
4
 
5
- 1. **Red**: Write a failing test first
5
+ 1. **Red**: Write a failing test first and **verify it fails**
6
6
  2. **Green**: Write minimal code to make the test pass
7
7
  3. **Refactor**: Improve the code while keeping tests green
8
8
 
9
+ ## Key: Always Verify Test Failure First
10
+
11
+ **Critical**: Before writing implementation, run the test to confirm it fails for the expected reason. This prevents false positives and ensures your test actually validates the behavior.
12
+
9
13
  ## TDD Process
10
14
 
11
- ### Step 1: Write a Failing Test
15
+ ### Step 1: Think Through Complex Features
16
+ For complex functionality, use "think" to trigger extended thinking mode to plan your test strategy.
17
+
18
+ ### Step 2: Write a Failing Test
12
19
  ```ruby
13
20
  # spec/models/user_spec.rb
14
21
  it 'returns the full name' do
@@ -17,13 +24,14 @@ it 'returns the full name' do
17
24
  end
18
25
  ```
19
26
 
20
- ### Step 2: Run Test (See it Fail)
27
+ ### Step 3: **VERIFY** Test Fails (Critical Step)
21
28
  ```bash
22
29
  bin/rspec spec/models/user_spec.rb
23
30
  # Expected failure: undefined method `full_name'
31
+ # CONFIRM: Test fails for the RIGHT reason
24
32
  ```
25
33
 
26
- ### Step 3: Write Minimal Code
34
+ ### Step 4: Write Minimal Code
27
35
  ```ruby
28
36
  # app/models/user.rb
29
37
  def full_name
@@ -31,13 +39,13 @@ def full_name
31
39
  end
32
40
  ```
33
41
 
34
- ### Step 4: Run Test (See it Pass)
42
+ ### Step 5: Run Test (See it Pass)
35
43
  ```bash
36
44
  bin/rspec spec/models/user_spec.rb
37
45
  # All tests should pass
38
46
  ```
39
47
 
40
- ### Step 5: Refactor if Needed
48
+ ### Step 6: Refactor if Needed
41
49
  ```ruby
42
50
  # Improved version
43
51
  def full_name
@@ -68,6 +76,8 @@ end
68
76
  - Never delete or modify tests just to make them pass
69
77
  - If a test is wrong, fix it and document why
70
78
  - Use `skip` or `pending` for incomplete tests
79
+ - **Avoid overfitting**: Ensure tests validate real behavior, not just current implementation
80
+ - Write tests that would catch regressions if the implementation changed
71
81
 
72
82
  ## Test Plan Management
73
83
 
@@ -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. **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.
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
@@ -0,0 +1,269 @@
1
+ # Visual Iteration Workflow for UI Development
2
+
3
+ ## Overview
4
+
5
+ A screenshot-driven development process that leverages Claude Code's image reading capabilities to iteratively improve user interfaces through visual feedback and refinement.
6
+
7
+ ## Core Principle
8
+
9
+ Use screenshots as the primary feedback mechanism for UI development, allowing for rapid iteration and visual validation of changes before and after implementation.
10
+
11
+ ## The Visual Iteration Process
12
+
13
+ ### 1. Capture Initial State
14
+
15
+ **Goal**: Document the current state before making changes.
16
+
17
+ #### Actions:
18
+ - Take a screenshot of the current UI
19
+ - Share the screenshot with Claude Code using drag-and-drop or file path
20
+ - Document what needs to be changed or improved
21
+
22
+ #### Commands:
23
+ ```bash
24
+ # macOS screenshot shortcuts
25
+ Cmd+Shift+4 # Select area to screenshot
26
+ Cmd+Shift+3 # Full screen screenshot
27
+ Cmd+Shift+5 # Screenshot options menu
28
+
29
+ # After taking screenshot, drag file into Claude Code chat
30
+ ```
31
+
32
+ #### Documentation:
33
+ - Describe the current problems or limitations
34
+ - Identify specific UI elements that need attention
35
+ - Note any accessibility or usability concerns
36
+
37
+ ### 2. Visual Analysis
38
+
39
+ **Goal**: Analyze the current UI and plan improvements.
40
+
41
+ #### Claude Code Analysis:
42
+ When you share a screenshot, ask Claude to:
43
+ - Identify UI/UX issues
44
+ - Suggest specific improvements
45
+ - Recommend modern design patterns
46
+ - Point out accessibility concerns
47
+ - Suggest component organization
48
+
49
+ #### Questions to Ask:
50
+ - What design patterns would improve this interface?
51
+ - Are there accessibility issues to address?
52
+ - How can we improve the visual hierarchy?
53
+ - What CSS/styling changes would have the biggest impact?
54
+ - How does this compare to modern UI conventions?
55
+
56
+ ### 3. Incremental Implementation
57
+
58
+ **Goal**: Make small, visual changes and validate each step.
59
+
60
+ #### Implementation Strategy:
61
+ - Make one visual change at a time
62
+ - Focus on the most impactful changes first
63
+ - Use CSS/styling changes before structural changes
64
+ - Test responsiveness at each step
65
+
66
+ #### Change Types by Priority:
67
+ 1. **Layout & Spacing**: Margins, padding, alignment
68
+ 2. **Typography**: Font sizes, weights, line spacing
69
+ 3. **Colors & Contrast**: Brand colors, accessibility compliance
70
+ 4. **Components**: Buttons, forms, cards, navigation
71
+ 5. **Interactions**: Hover states, transitions, animations
72
+ 6. **Responsive**: Mobile, tablet, desktop breakpoints
73
+
74
+ ### 4. Screenshot After Changes
75
+
76
+ **Goal**: Capture and validate the results of each change.
77
+
78
+ #### Process:
79
+ - Take a new screenshot after each significant change
80
+ - Compare with the previous screenshot
81
+ - Share the new screenshot with Claude Code for feedback
82
+ - Document what was changed and why
83
+
84
+ #### Validation Questions:
85
+ - Does this change improve the user experience?
86
+ - Are there any unintended side effects?
87
+ - Does it work across different screen sizes?
88
+ - Is the change consistent with the design system?
89
+
90
+ ### 5. Iterate 2-3 Times
91
+
92
+ **Goal**: Refine the UI through multiple feedback cycles.
93
+
94
+ #### Typical Iteration Pattern:
95
+ - **Iteration 1**: Major layout and structural improvements
96
+ - **Iteration 2**: Color, typography, and spacing refinements
97
+ - **Iteration 3**: Polish, micro-interactions, and edge cases
98
+
99
+ #### When to Stop Iterating:
100
+ - The UI meets functional requirements
101
+ - Visual design is cohesive and accessible
102
+ - User experience feels intuitive
103
+ - No obvious improvements remain
104
+ - Time/budget constraints require moving on
105
+
106
+ ## UI Development Best Practices
107
+
108
+ ### Component-First Approach
109
+ ```ruby
110
+ # For Rails with ViewComponent
111
+ # app/components/button_component.rb
112
+ class ButtonComponent < ViewComponent::Base
113
+ def initialize(variant: :primary, size: :medium, **options)
114
+ @variant = variant
115
+ @size = size
116
+ @options = options
117
+ end
118
+
119
+ private
120
+
121
+ attr_reader :variant, :size, :options
122
+
123
+ def css_classes
124
+ ["btn", "btn--#{variant}", "btn--#{size}", @options[:class]].compact.join(" ")
125
+ end
126
+ end
127
+ ```
128
+
129
+ ### CSS Organization
130
+ ```scss
131
+ // Use BEM methodology
132
+ .btn {
133
+ &--primary { /* primary styles */ }
134
+ &--secondary { /* secondary styles */ }
135
+ &--small { /* small size */ }
136
+ &--medium { /* medium size */ }
137
+ &--large { /* large size */ }
138
+ }
139
+ ```
140
+
141
+ ### Responsive Design Testing
142
+ ```css
143
+ /* Test at common breakpoints */
144
+ /* Mobile: 320px - 768px */
145
+ /* Tablet: 768px - 1024px */
146
+ /* Desktop: 1024px+ */
147
+
148
+ @media (max-width: 768px) {
149
+ .component {
150
+ /* mobile styles */
151
+ }
152
+ }
153
+ ```
154
+
155
+ ## Tools and Techniques
156
+
157
+ ### Screenshot Tools
158
+ - **macOS**: Built-in screenshot tools (Cmd+Shift+4/5)
159
+ - **Windows**: Snipping Tool, Windows+Shift+S
160
+ - **Browser**: Developer tools device emulation
161
+ - **Third-party**: CleanShot X, LightShot
162
+
163
+ ### Browser Development
164
+ ```javascript
165
+ // Test different viewport sizes in browser console
166
+ // Responsive design testing
167
+ window.resizeTo(375, 812); // iPhone X
168
+ window.resizeTo(768, 1024); // iPad
169
+ window.resizeTo(1440, 900); // Desktop
170
+ ```
171
+
172
+ ### CSS Grid and Flexbox Debugging
173
+ ```css
174
+ /* Temporary debug styles */
175
+ .debug-grid {
176
+ outline: 1px solid red !important;
177
+ }
178
+
179
+ .debug-flex {
180
+ background: rgba(255, 0, 0, 0.1) !important;
181
+ }
182
+ ```
183
+
184
+ ## Common UI Improvement Patterns
185
+
186
+ ### Layout Issues
187
+ - **Problem**: Cramped spacing
188
+ - **Solution**: Add consistent padding/margins using design tokens
189
+ - **Validation**: Elements have breathing room, visual hierarchy is clear
190
+
191
+ ### Typography Problems
192
+ - **Problem**: Poor readability
193
+ - **Solution**: Improve font sizes, line heights, contrast ratios
194
+ - **Validation**: Text is easy to read at all screen sizes
195
+
196
+ ### Color and Contrast
197
+ - **Problem**: Accessibility violations
198
+ - **Solution**: Use WCAG AA compliant color combinations
199
+ - **Validation**: Passes automated accessibility testing
200
+
201
+ ### Interactive Elements
202
+ - **Problem**: Unclear interactive states
203
+ - **Solution**: Add hover, focus, and active states
204
+ - **Validation**: Users can identify clickable elements
205
+
206
+ ## Integration with Testing
207
+
208
+ ### Visual Regression Testing
209
+ ```ruby
210
+ # RSpec with Capybara
211
+ scenario "homepage layout" do
212
+ visit root_path
213
+ # Take screenshot for comparison
214
+ save_screenshot("homepage_#{Date.current}.png")
215
+
216
+ expect(page).to have_css(".hero-section")
217
+ expect(page).to have_css(".call-to-action")
218
+ end
219
+ ```
220
+
221
+ ### Accessibility Testing
222
+ ```ruby
223
+ # Include accessibility testing
224
+ require 'axe-capybara'
225
+
226
+ scenario "homepage accessibility" do
227
+ visit root_path
228
+ expect(page).to be_axe_clean
229
+ end
230
+ ```
231
+
232
+ ## Documentation and Handoff
233
+
234
+ ### Design System Updates
235
+ - Update component documentation with screenshots
236
+ - Document new CSS classes and their usage
237
+ - Add examples of component variations
238
+ - Include accessibility notes
239
+
240
+ ### Developer Handoff
241
+ - Provide before/after screenshots
242
+ - Document CSS changes made
243
+ - Include responsive breakpoint notes
244
+ - Add any new dependencies or setup requirements
245
+
246
+ ## When to Use Visual Iteration
247
+
248
+ ### Ideal For:
249
+ - New UI component development
250
+ - Redesigning existing interfaces
251
+ - Fixing visual bugs or inconsistencies
252
+ - Improving accessibility
253
+ - Responsive design implementation
254
+
255
+ ### Not Necessary For:
256
+ - Backend logic changes
257
+ - API development
258
+ - Database migrations
259
+ - Non-visual bug fixes
260
+
261
+ ## Success Metrics
262
+
263
+ You're using visual iteration successfully when:
264
+ - UI changes are intentional and validated
265
+ - Screenshots provide clear before/after documentation
266
+ - Multiple stakeholders can review visual progress
267
+ - Accessibility and usability improve with each iteration
268
+ - Development time spent on UI revisions decreases
269
+ - User feedback on interface quality improves
@@ -3,7 +3,7 @@
3
3
  This journal tracks significant development work, bug fixes, and feature implementations for <%= @project_name %>.
4
4
 
5
5
  ## Recent Contributors (Last 30 Days)
6
- - **[Your Name]**: Project owner, initial setup
6
+ - **<%= @user_name %>**: Project owner, initial setup
7
7
  - **Claude Code**: AI-assisted development
8
8
 
9
9
  ## Active Branches & Ownership
@@ -19,11 +19,12 @@ This journal tracks significant development work, bug fixes, and feature impleme
19
19
  ---
20
20
 
21
21
  ## <%= Date.today.strftime('%Y-%m-%d') %> - Initial Setup
22
- **Developer(s)**: [Your Name] & Claude Code | **Branch**: main | **Context**: Project initialization
22
+ **Developer(s)**: <%= @user_name %> & Claude Code | **Branch**: main | **Context**: Project initialization
23
23
 
24
24
  ### What Was Done
25
- - Initialized Rails <%= Rails.version rescue "8.0.2" %> application
26
- - Set up Claude workflow with claude-rails-setup gem
25
+ <% if @project_type == :rails %>
26
+ - Initialized Rails <%= defined?(Rails) ? Rails.version : "8.0+" %> application
27
+ - Set up Claude workflow with Chiron gem
27
28
  - Created initial project structure
28
29
  - Configured development environment
29
30
 
@@ -33,7 +34,7 @@ This journal tracks significant development work, bug fixes, and feature impleme
33
34
  - Setting up for collaborative development
34
35
 
35
36
  ### Technical Details
36
- - Rails <%= Rails.version rescue "8.0.2" %> with PostgreSQL database
37
+ - Rails <%= defined?(Rails) ? Rails.version : "8.0+" %> with PostgreSQL database
37
38
  - Hotwire (Turbo + Stimulus) for frontend interactivity
38
39
  - TailwindCSS for styling
39
40
  - RSpec for testing framework
@@ -50,6 +51,88 @@ This journal tracks significant development work, bug fixes, and feature impleme
50
51
  - Set up continuous integration
51
52
  - Implement initial models based on requirements
52
53
  - Create first PRD for core functionality
54
+ <% elsif @project_type == :python %>
55
+ - Initialized Python project
56
+ <% if @python_framework == :django %>
57
+ - Set up Django project structure
58
+ <% elsif @python_framework == :fastapi %>
59
+ - Set up FastAPI project structure
60
+ <% elsif @python_framework == :flask %>
61
+ - Set up Flask project structure
62
+ <% else %>
63
+ - Set up generic Python project structure
64
+ <% end %>
65
+ - Set up Claude workflow with Chiron gem
66
+ - Configured development environment
67
+
68
+ ### Why It Was Done
69
+ - Starting new Python project with AI-assisted development workflow
70
+ - Establishing consistent development patterns from the beginning
71
+ - Setting up for collaborative development
72
+
73
+ ### Technical Details
74
+ <% if @python_framework == :django %>
75
+ - Django framework for web development
76
+ - PostgreSQL database (recommended)
77
+ - Django REST framework for APIs
78
+ <% elsif @python_framework == :fastapi %>
79
+ - FastAPI framework for high-performance APIs
80
+ - Pydantic for data validation
81
+ - SQLAlchemy for database ORM
82
+ <% elsif @python_framework == :flask %>
83
+ - Flask framework for web development
84
+ - SQLAlchemy for database ORM
85
+ - Flask-RESTful for API development
86
+ <% else %>
87
+ - Python 3.x+ project structure
88
+ <% end %>
89
+ - pytest for testing framework
90
+ - black for code formatting
91
+ - flake8 for linting
92
+ - Claude AI workflow integration
93
+
94
+ ### Results
95
+ - ✅ Python project structure created
96
+ - ✅ Claude workflow initialized with commands and templates
97
+ - ✅ Development journal started
98
+ - ✅ Git repository initialized
99
+
100
+ ### Next Steps
101
+ - Set up virtual environment and install dependencies
102
+ - Configure database and create initial models
103
+ - Set up continuous integration
104
+ - Implement core functionality based on requirements
105
+ - Create first PRD for feature development
106
+ <% else %>
107
+ - Initialized project structure
108
+ - Set up Claude workflow with Chiron gem
109
+ - Created initial project structure
110
+ - Configured development environment
111
+
112
+ ### Why It Was Done
113
+ - Starting new project with AI-assisted development workflow
114
+ - Establishing consistent development patterns from the beginning
115
+ - Setting up for collaborative development
116
+
117
+ ### Technical Details
118
+ - Project initialized with Claude AI workflow integration
119
+ - Development journal and task tracking system
120
+ - Command templates for consistent workflows
121
+ - Quality assurance and testing patterns
122
+
123
+ ### Results
124
+ - ✅ Project structure created
125
+ - ✅ Claude workflow initialized with commands and templates
126
+ - ✅ Development journal started
127
+ - ✅ Git repository initialized
128
+
129
+ ### Next Steps
130
+ - Set up development dependencies
131
+ - Configure testing framework
132
+ - Set up continuous integration
133
+ - Implement core functionality based on requirements
134
+ - Create first PRD for feature development
135
+ <% end %>
53
136
 
54
137
  ---
55
138
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Chiron
4
- VERSION = '0.2.1'
4
+ VERSION = '0.2.3'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chiron
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brett McHargue
@@ -150,9 +150,11 @@ files:
150
150
  - lib/chiron/templates/shared/commands/quality/test-driven.md
151
151
  - lib/chiron/templates/shared/commands/workflows/branch-management.md
152
152
  - lib/chiron/templates/shared/commands/workflows/create-prd.md
153
+ - lib/chiron/templates/shared/commands/workflows/explore-plan-code-commit.md
153
154
  - lib/chiron/templates/shared/commands/workflows/feature-complete.md
154
155
  - lib/chiron/templates/shared/commands/workflows/generate-tasks.md
155
156
  - lib/chiron/templates/shared/commands/workflows/process-tasks.md
157
+ - lib/chiron/templates/shared/commands/workflows/visual-iteration.md
156
158
  - lib/chiron/templates/shared/development_journal.md.erb
157
159
  - lib/chiron/version.rb
158
160
  homepage: https://github.com/ebrett/chiron