- Add project constitution with vision, principles, and autonomy settings - Add 15 feature specifications covering full app scope - Configure agent entry points (AGENTS.md, CLAUDE.md) - Add build prompt and speckit command for spec creation - Include comprehensive .gitignore for iOS development Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2.8 KiB
2.8 KiB
CheapRetouch Constitution
Version: ralph-wiggum@81231ca4e7466d84e3908841e9ed3d08e8c0803e Created: 2026-01-23
Project Vision
On-device iOS photo editor for removing unwanted elements using only Apple's public frameworks and classical image processing. No custom ML models.
Platform: iOS 17.0+
Core Capabilities:
- Person removal (Vision handles this well)
- Foreground object removal (user-initiated, Vision-assisted)
- Wire/line removal (geometric contour detection)
Core Principles
- Privacy-first: All processing on-device, no network calls for core functionality, no analytics or telemetry
- Graceful fallbacks: Always provide manual alternatives (brush, line brush) when auto-detection fails - the user is never stuck
- Performance matters: Fast previews (<300ms), responsive UI, efficient memory management (1.5GB budget)
Technical Stack
| Layer | Framework | Purpose |
|---|---|---|
| UI | SwiftUI + UIKit interop | Canvas, tools, state management |
| Masking | Vision | VNGenerateForegroundInstanceMaskRequest, VNDetectContoursRequest |
| Subject Interaction | VisionKit | ImageAnalyzer, ImageAnalysis, ImageAnalysisInteraction |
| Inpainting | Metal (custom) | Patch-based synthesis, mask feathering, blending |
| Compositing | Core Image | Color adjustments, preview pipeline |
| Fallback Processing | Accelerate/vImage | Simulator, older devices without Metal |
Autonomy Settings
- YOLO Mode: ENABLED - Make implementation decisions autonomously
- Git Autonomy: ENABLED - Commit and push completed work automatically
Operational Guidelines
When Implementing Features
- Read the spec completely before starting
- Follow the project structure defined in the spec
- Implement the primary path first, then fallbacks
- Ensure all edge cases from the spec are handled
- Write tests as specified (unit, snapshot, UI, performance, memory)
Code Quality
- Non-destructive editing: original image never modified
- Full undo/redo support via operation stack
- All operations must be Codable for persistence
- Memory management: release intermediate textures aggressively
- Tile-based processing for images > 12MP
User Experience
- Clear feedback states (processing, no detection, success)
- Contextual inspector panel based on active tool
- Accessibility: VoiceOver labels, Dynamic Type, Reduce Motion support
What NOT To Do
- Do not add ML models or custom neural networks
- Do not add features explicitly marked as out of scope
- Do not make network calls for core functionality
- Do not over-engineer beyond what the spec requires
Completion Signal
Output <promise>DONE</promise> only when a specification is 100% complete with all acceptance criteria met. Never output this prematurely.