(AI generated. Not reviewed.)
Frontend Development Workflow Checklist
Last Updated: December 31, 2025 For: Fichero macOS App Development
Updated 2026-06-06: several process references below are stale — read with these corrections: - Tasks are tracked in GitHub Issues + Milestones, not a local TODO file (retired). Ignore the “check / update TODO.md” steps. - Branch discipline: commit milestone work directly to the milestone branch (e.g.
main); do not create per-taskfeature-branch-namebranches and do notgit pull origin maininto your work — seeAGENTS.md→ “Rules I Don’t Break”. - AppKit: “100% SwiftUI” is aspirational. SwiftUI-first with ~8 sanctionedNSViewRepresentablebridges (PDFKit, magnifier, text editors, …). TheAPPKIT_FINAL_AUDIT.mdreferenced below has been retired — seedocs/contributor_manual/swiftui-development-standards.md. - New.swiftfiles must be registered withruby scripts/add-swift-file.rb <path>(the main target uses traditional PBX refs); the build gate isbash scripts/verify_all.sh. - Prefer the Xcode MCP build/test tools over the rawxcodebuildinvocations shown here.
Daily Development Workflow
1. Start Development Session
Prerequisites:
# [ ] Start Python backend (REQUIRED)
cd "$(git rev-parse --show-toplevel)"
PYTHONPATH=fichero-server/src .venv/bin/uvicorn fichero_server.api.main:app --port 8765
# [ ] Open Xcode project
open Fichero/Fichero.xcodeproj
# [ ] Pull latest changes
git pull origin main
Check Status: - [ ] Backend running on port 8765 (http://localhost:8765/docs) - [ ] No merge conflicts - [ ] Latest code from main branch
2. Before Writing Code
Planning:
- [ ] Understand the requirement/bug
- [ ] Check the assigned GitHub issue for task details
- [ ] Read relevant context files (key_files.md, swiftui-principles.md)
- [ ] Identify affected files (use key_files.md)
- [ ] Check if files need splitting (> 400 lines?)
Research: - [ ] Check Sosumi MCP for SwiftUI patterns - [ ] Check Ref MCP for Swift language features - [ ] Review similar existing implementations
New View Implementation
Planning (10-15 min)
- [ ] Sketch the view hierarchy on paper
- [ ] Identify state needed (
@State,@Observable,@EnvironmentObject) - [ ] Plan API endpoints needed
- [ ] Check if view can reuse existing components
- [ ] Estimate file size (target < 400 lines)
Implementation
File Creation:
- [ ] Create file in correct directory (Views/FeatureName/)
- [ ] Use standard file template:
import SwiftUI
import OSLog
private let logger = Logger(subsystem: "com.tubb.Fichero", category: "FileName")
struct MyView: View {
// MARK: - Properties
// MARK: - Body
// MARK: - Subviews
// MARK: - Actions
}
#Preview { MyView() }
State Management:
- [ ] Use @State for local view state
- [ ] Use @StateObject for view model ownership
- [ ] Use @EnvironmentObject for shared services
- [ ] Use @Observable for iOS 17+ view models
- [ ] NEVER create services in view body
SwiftUI Compliance:
- [ ] 100% SwiftUI (NO AppKit unless unavoidable)
- [ ] Use @FocusedValue for menu commands (NO NotificationCenter)
- [ ] Use @ViewBuilder for computed views
- [ ] Cache expensive computations
- [ ] Handle task cancellation in .task {} blocks
Swift 6 Concurrency:
- [ ] Mark UI classes with @MainActor
- [ ] Use Task { @MainActor in ... } for UI updates from background
- [ ] Check Task.isCancelled in all .task {} blocks
- [ ] No DispatchQueue in @MainActor classes
- [ ] Make thread-safe classes conform to Sendable
Code Quality:
- [ ] Descriptive variable names (no x, y, i)
- [ ] Functions < 50 lines
- [ ] File < 400 lines (if larger, split immediately)
- [ ] Use OSLog (not NSLog/print)
- [ ] Add #Preview for visual testing
Testing
- [ ] Test in Xcode preview (⌘⌥↩)
- [ ] Test with sample data
- [ ] Test loading states
- [ ] Test error states
- [ ] Test with no backend connection
- [ ] Test keyboard shortcuts
- [ ] Test accessibility (VoiceOver if possible)
Modifying Existing Code
Before Editing
- [ ] Read the entire file first
- [ ] Understand current architecture
- [ ] Check for existing patterns to follow
- [ ] Note file size (will edit push it over 400 lines?)
Making Changes
- [ ] Keep changes minimal and focused
- [ ] Don’t refactor while fixing bugs
- [ ] Don’t add “improvements” beyond the task
- [ ] Maintain existing code style
- [ ] Update comments if logic changes
Swift 6 Checks
- [ ] No new concurrency warnings introduced
- [ ] Proper actor isolation maintained
- [ ] Task cancellation still handled
- [ ] No
DispatchQueueadded to@MainActorclasses
Before Committing
Code Quality Checks
Run SwiftLint (MANDATORY):
cd Fichero
swiftlint
Build Project (MANDATORY):
xcodebuild -project Fichero.xcodeproj -scheme Fichero -configuration Debug build
** BUILD SUCCEEDED ** with no Swift errors
Check for Violations:
- [ ] No files > 400 lines (recommended limit)
- [ ] No files > 1,000 lines (hard limit - MUST split)
- [ ] No functions > 50 lines
- [ ] No cyclomatic complexity > 10
- [ ] No identifier names like x, y, i, a, b
- [ ] No line lengths > 120 characters
Swift 6 Verification
- [ ] No concurrency warnings in Xcode
- [ ] All
.task {}blocks check cancellation - [ ] UI updates use
@MainActor(not DispatchQueue.main) - [ ] Thread-safe types are
Sendable
SwiftUI Verification
- [ ] No AppKit except in justified files (see
APPKIT_FINAL_AUDIT.md) - [ ] No NotificationCenter for app logic
- [ ] Using @FocusedValue for menu commands
- [ ] All views have
#Preview
Testing
- [ ] Manual testing in Xcode (⌘R)
- [ ] Test with backend running
- [ ] Test without backend (connection error handling)
- [ ] Preview canvas works (⌘⌥↩)
Git Workflow
Committing
# [ ] Check status
git status
# [ ] Review changes
git diff
# [ ] Stage specific files (not `git add .`)
git add Fichero/Fichero/Views/MyView.swift
git add Fichero/Fichero/Models/MyModel.swift
# [ ] Commit with descriptive message
git commit -m "Add MyView for feature X
- Implement SwiftUI view with @Observable state
- Add API integration for endpoint Y
- Include error handling and loading states
- All Swift 6 concurrency checks pass
🤖 Generated with Claude Code
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>"
Good Commit Messages: - Start with verb: “Add”, “Fix”, “Update”, “Refactor” - Explain WHY, not just WHAT - Reference issue/task numbers if applicable - Include compliance notes (Swift 6, SwiftLint, etc.)
Bad Commit Messages: - “Update file” (too vague) - “WIP” (not descriptive) - “asdf” (meaningless)
Pushing
# [ ] Pull latest first
git pull origin main
# [ ] Resolve any conflicts
# ... fix conflicts ...
# [ ] Push to remote
git push origin feature-branch-name
File Size Management
When a File Reaches 400 Lines
Immediate Action Required: 1. Stop adding to the file 2. Plan the split (by component, responsibility, or feature) 3. Create new files with extracted code 4. Update imports and references 5. Add new files to Xcode project 6. Test thoroughly 7. Commit with message: “Refactor MyView - split into components”
Splitting Strategies: - By Component: Extract toolbar, sidebar, inspector into separate files - By Responsibility: Extract data fetching, formatting, validation - By Feature: Extract search, filter, sort into separate files
Example: EditorView.swift (1,981 lines) →
- EditorView.swift (< 200 lines)
- EditorToolbar.swift
- EditorCanvas.swift
- EditorInspector.swift
- EditorHelpers.swift
Common Tasks Quick Reference
Adding a New Feature
- Read the assigned GitHub issue for task details
- Check
key_files.mdfor affected files - Review
swiftui-principles.mdfor patterns - Implement following workflow above
- Run SwiftLint and build
- Test manually
- Commit with descriptive message
- Update the GitHub issue status
Fixing a Bug
- Reproduce the bug
- Add logging if needed
- Identify root cause
- Make minimal fix
- Test fix works
- Test related functionality (no regressions)
- Run SwiftLint and build
- Commit with bug description
Refactoring
- Ensure tests pass first
- Make incremental changes
- Test after each change
- Don’t change behavior
- Run SwiftLint and build
- Commit each logical step
Adding API Integration
- Review backend API docs (
/api/docs) - Add endpoint to
APIClient.swiftor relevant service - Create/update data models
- Add error handling
- Add loading states
- Test with backend running
- Test without backend (error handling)
Troubleshooting
Build Fails
# Clean build folder
xcodebuild clean -project Fichero.xcodeproj -scheme Fichero
# Rebuild
xcodebuild -project Fichero.xcodeproj -scheme Fichero build
SwiftLint Errors
# Auto-fix formatting issues
swiftlint --fix --format
# Check specific file
swiftlint lint --path Fichero/Fichero/Views/MyView.swift
Concurrency Warnings
- Check if class needs
@MainActor - Use
Task { @MainActor in ... }for UI updates - Ensure thread-safe types conform to
Sendable - Remove
DispatchQueuefrom@MainActorclasses
Preview Not Working
- Ensure all dependencies are injected
- Provide sample data in preview
- Check for async operations in init
- Restart Xcode if canvas is stuck
Performance Checks
Before Committing Large Changes
- [ ] Profile with Instruments (Time Profiler)
- [ ] Check for memory leaks (Leaks instrument)
- [ ] Monitor view updates (Debug Navigator)
- [ ] Test with large datasets
- [ ] Test scrolling performance
Optimization Checklist
- [ ] Cache expensive computations
- [ ] Lazy load data when possible
- [ ] Use
LazyVStack/LazyHStackfor long lists - [ ] Minimize view updates
- [ ] Profile before and after changes
Documentation Updates
When to Update Docs
- [ ] Added new major feature → Update
overview.md - [ ] Added new file/module → Update
key_files.md - [ ] Changed architecture → Update
overview.md - [ ] New best practice → Update
swiftui-principles.md - [ ] Changed workflow → Update this file
Doc Locations
docs/contributor_manual/architecture/fichero/overview.md- High-level architecturedocs/contributor_manual/architecture/fichero/key_files.md- File organizationdocs/contributor_manual/swiftui-principles.md- Code patternsdocs/contributor_manual/swiftui-development-standards.md- Standards and guidelinesdocs/contributor_manual/architecture/fichero/workflow_checklist.md- This file
Resources
Quick Links
- Backend API: http://localhost:8765/docs
- Frontend Docs:
docs/contributor_manual/architecture/fichero/ - TODO List: GitHub Issues + Milestones
MCP Tools
- Sosumi:
searchAppleDocumentation("swiftui drag drop") - Ref:
searchDocumentation("Swift @Observable") - Filesystem: Read/write files in project
- Memory: Store project knowledge
When Stuck
- Check Sosumi for SwiftUI equivalent
- Check Ref for Swift language features
- Review similar code in project
- Read
swiftui-principles.md - Ask for clarification
Summary
Daily Checklist: 1. ✅ Start backend 2. ✅ Write code following swiftui-principles.md 3. ✅ Keep files < 400 lines 4. ✅ Run SwiftLint (zero errors) 5. ✅ Build succeeds 6. ✅ Test manually 7. ✅ Commit with good message
Quality Gates: - File size < 400 lines - SwiftLint passes - Build succeeds - No Swift 6 concurrency warnings - Manual testing passes - Preview works
Remember:
- 100% SwiftUI (NO AppKit unless unavoidable)
- Swift 6 compliant (@MainActor, Sendable, Task cancellation)
- Small, focused files (< 400 lines)
- Descriptive names (no x, y, i)
- OSLog for logging (no NSLog/print)