This document outlines the development workflow for this project when working with Claude Code.
CRITICAL: Git branch management
-
Check for uncommitted changes:
git status
-
If there are uncommitted changes:
- Review all changes with the user
- Ask whether to commit them or discard them
- WAIT for user decision before proceeding
- If committing: use conventional commit messages
- If discarding: use
git restore <file>orgit clean -fdfor untracked files
-
Create a new branch for the task:
git checkout -b task/<task-number>-<brief-description>
- Example:
git checkout -b task/1-create-swiftdata-models - Example:
git checkout -b task/4-build-week-header-view
- Example:
- Use TodoWrite tool to track task progress
- Make small, focused commits as you complete logical units of work:
- Prefer multiple small commits over one large commit
- Each commit should represent a single, coherent change
- Stack commits to build up functionality incrementally
- Examples:
- ✅ Commit 1: "refactor: simplify Task initializer"
- ✅ Commit 2: "fix: force Monday as first weekday"
- ❌ Avoid: One commit with "refactor Task + fix calendar + update docs"
- Build frequently to catch compilation errors early
IMPORTANT: Always perform these steps after each task completion:
-
Build the project to verify compilation:
cd BulletJournalTodos # Default to iPhone 17 (iOS 26) for testing xcodebuild -scheme BulletJournalTodos -sdk iphonesimulator \ -destination 'platform=iOS Simulator,name=iPhone 17' build
-
Run unit tests to verify correctness:
# From project root (bullet-journal-todos-swiftui/) xcodebuild test -scheme BulletJournalTodos \ -project BulletJournalTodos/BulletJournalTodos.xcodeproj \ -destination 'platform=iOS Simulator,name=iPhone 17'
- All tests must pass before proceeding
- If tests fail, fix the issues and re-run
- Test output will show which specific tests failed and why
-
Run the app in iOS Simulator for user review:
# Boot an iOS 17+ simulator if needed open -a Simulator # Find the built app (adjust path based on your build) APP_PATH="./build/Build/Products/Debug-iphonesimulator/BulletJournalTodos.app" # Install and launch app xcrun simctl install booted "$APP_PATH" xcrun simctl launch booted com.vivqu.BulletJournalTodos
-
Take a screenshot (optional, for documentation):
xcrun simctl io booted screenshot screenshot-task-<N>.png
- IMPORTANT: Screenshots are for testing documentation only
- Never commit screenshots to git
- Before merging into main, delete all screenshot files:
git rm screenshot-*.png # Or if not yet committed: rm screenshot-*.png
-
Wait for user approval before proceeding to the next task
- User will review the running app in simulator
- User may request changes or approve to continue
-
Review code for style and language compliance:
- Review all modified Swift files against the style guide in
docs/swift.md - Fix any violations (e.g., force unwrapping, naming conventions, etc.)
- Ensure code follows Swift best practices and project conventions
- Re-run tests after style fixes to verify correctness
- Review all modified Swift files against the style guide in
-
After user approval, update plan.md:
- Mark the completed task with
[x]in plan.md - Example: Change
- [ ] 1. Create SwiftData modelsto- [x] 1. Create SwiftData models - This keeps the plan in sync with actual progress
- Mark the completed task with
-
Clean up temporary documentation files:
- Review all files created during the task
- Delete task-specific temporary files (e.g.,
TASK_23_SUMMARY.md,TESTING_LIMITATIONS.md) - Ask the user: "Should I synthesize the content from [temporary file names] into a reusable
docs/page (or add to an existing one)?" - If yes, create/update the appropriate
docs/file with permanent, reusable content - If no, simply delete the temporary files
- Examples of permanent documentation:
- Testing guides:
docs/ipad.md,docs/testing.md - Architecture notes: Add to
CLAUDE.mdor createdocs/architecture.md - Implementation patterns: Add to relevant
docs/file
- Testing guides:
- Commit the cleanup separately from feature work
When creating commits, follow these guidelines:
-
Use conventional commit format:
feat: add SwiftData models for Task, Week, and FocusAreafix: correct relationship between Task and Week modelsrefactor: extract view components into separate filesdocs: update CLAUDE.md with architecture notestest: add unit tests for Week model
-
Include co-author attribution:
git commit -m "feat: <description> 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>"
Avoid fatalError() for user-facing errors - only use it for unrecoverable system failures or developer mistakes. Use assertionFailure() for data integrity warnings that allow the app to continue functioning gracefully.
The project requires iOS 17.0 or later (SwiftData minimum requirement).
Default simulator for testing: iPhone 17 or latest iOS 26+ device
- Always use the latest iOS version (iOS 26+) for primary testing
- This ensures we're testing with the latest APIs and behaviors
- Only test on older iOS versions (iOS 17-25) when specifically requested for compatibility verification
Recommended iOS 26+ simulators:
- iPhone 17, iPhone 17 Pro, iPhone 17 Pro Max
- iPhone Air, iPhone 16e
To list available simulators:
xcrun simctl list devices available | grep "iPhone"- Verify simulator is running iOS 17.0 or later
- Check minimum deployment target in project settings
- Try:
xcrun simctl erase all(WARNING: deletes all simulator data)
- The old
Item.swifttemplate file may need to be removed from the project - Verify new models are properly imported in
BulletJournalTodosApp.swift
- Uninstall app from simulator first:
xcrun simctl uninstall booted com.vivqu.BulletJournalTodos - Clean build folder:
cd BulletJournalTodos && xcodebuild clean
IMPORTANT: Before starting a new task, check if the current branch should be merged into main.
After completing a task and receiving user approval:
-
Delete all testing screenshots before merging:
# Remove any screenshot files created during testing git rm screenshot-*.png 2>/dev/null || rm screenshot-*.png 2>/dev/null git commit -m "chore: remove testing screenshots" 2>/dev/null || true
Screenshots are for manual verification only and should never be committed to main.
-
Ask the user: "Should I merge the current branch (
<branch-name>) into main?" -
If yes, merge and clean up the branch:
git checkout main git merge <branch-name> --no-ff -m "Merge <task-description>" git branch -d <branch-name>
The
-dflag safely deletes the branch after it's been merged. -
If no, continue on the same branch for the next task. This allows related work to stay together before merging into main.
This ensures completed work is integrated into main at appropriate checkpoints while giving you control over when merges happen.