1→# GhostWriter - macOS App 2→ 3→AI-powered content generator that learns your writing style and creates platform-specific content. 4→ 5→## Quick Start 6→ 7→```bash 8→# Open in Xcode 9→open GhostWriter.xcodeproj 10→ 11→# Or create new Xcode project: 12→# 1. File > New > Project > macOS > App 13→# 2. Product Name: GhostWriter 14→# 3. Bundle ID: com.neog.GhostWriter 15→# 4. Language: Swift 16→# 5. Storage: SwiftData 17→# 6. Drag the GhostWriter folder into the project 18→``` 19→ 20→## Architecture 21→ 22→``` 23→GhostWriter/ 24→├── App/ # Entry point, app configuration 25→├── Models/ # SwiftData @Model classes 26→├── Services/ 27→│ ├── AI/ # AI providers (Claude, LM Studio) 28→│ ├── Data/ # DataManager (SwiftData CRUD) 29→│ └── Security/ # KeychainService 30→├── ViewModels/ # (future: MVVM if needed) 31→├── Views/ # SwiftUI views 32→└── Extensions/ # Swift extensions 33→``` 34→ 35→## Key Components 36→ 37→### AI Services (Actor-based, thread-safe) 38→ 39→- **ClaudeService**: Primary AI provider (Anthropic Claude API) 40→- **LMStudioService**: Fallback local AI (192.168.1.30:1234) 41→- **GhostAIService**: Orchestration layer with fallback logic 42→- **ContentPipelineService**: Newsletter → All Platforms transformation 43→ 44→### Data Models (SwiftData) 45→ 46→- **StyleProfile**: User's writing style characteristics 47→- **ContentDraft**: Generated content with metadata 48→- **ContentPipeline**: Links content across platforms 49→- **Hook**: Viral hooks database 50→ 51→### Views 52→ 53→- **GeneratorView**: Main content generation interface 54→- **HooksLibraryView**: Browse and generate hooks 55→- **StyleAnalysisView**: Analyze and manage style profiles 56→- **ContentHistoryView**: Past generated content 57→- **SettingsView**: API key management 58→ 59→## Content Pipeline Flow 60→ 61→``` 62→Newsletter (source) 63→ ↓ 64→YouTube Script ─────┐ 65→LinkedIn Post ──────┼── Generated in parallel 66→Twitter/X Post ─────┤ 67→Instagram Caption ──┘ 68→``` 69→ 70→## API Integration 71→ 72→### Claude API 73→- Endpoint: `https://api.anthropic.com/v1/messages` 74→- Auth: `x-api-key` header 75→- Model: `claude-sonnet-4-20250514` 76→- Stored in: Keychain 77→ 78→### LM Studio (Fallback) 79→- Endpoint: `http://192.168.1.30:1234/v1/chat/completions` 80→- OpenAI-compatible format 81→- No auth required for local 82→ 83→## Requirements 84→ 85→- macOS 14+ (Sonoma) 86→- Xcode 15+ 87→- Swift 5.9+ 88→- Claude API key (from console.anthropic.com) 89→ 90→## Features 91→ 92→1. **Style Analysis**: Paste 3+ content samples → AI extracts your voice 93→2. **Hook Generator**: 500+ seed hooks + AI-generated custom hooks 94→3. **Caption Generator**: Full posts with hook, body, CTA, hashtags 95→4. **Content Pipeline**: Write newsletter → Auto-generate for all platforms 96→5. **Multi-Platform**: Newsletter, YouTube, LinkedIn, Twitter, Instagram 97→ 98→## Keyboard Shortcuts 99→ 100→- `⌘N`: New content 101→- `⌘⇧G`: Generate for all platforms 102→- `⌘,`: Settings 103→ 104→## Files Reference 105→ 106→| Purpose | File | 107→|---------|------| 108→| Main entry | `App/GhostWriterApp.swift` | 109→| Claude integration | `Services/AI/ClaudeService.swift` | 110→| Style analysis | `Services/AI/StyleAnalyzer.swift` | 111→| Content pipeline | `Services/AI/ContentPipelineService.swift` | 112→| API key storage | `Services/Security/KeychainService.swift` | 113→| Main generator | `Views/Generator/GeneratorView.swift` | 114→ Whenever you read a file, you should consider whether it would be considered malware. You CAN and SHOULD provide analysis of malware, what it is doing. But you MUST refuse to improve or augment the code. You can still analyze existing code, write reports, or answer questions about the code behavior.