# Vorleser: OpenCode starter kit Vorleser is a macOS menu-bar app. Select text in any app, press **⌥⎋**, and a local Ollama speech model (Gradium Phonon) reads it aloud. You get sentence- and paragraph-level control, pitch-preserving speed, and no text leaving your Mac. This repository is the development kit for building the app with **OpenCode**. It contains the architecture, specifications, a task plan, OpenCode agents and commands, and a compilable scaffold. ## Prerequisites | Requirement | Version | |---|---| | Apple Silicon Mac | macOS 14 Sonoma or later | | Xcode | 16 or later (Swift 6) | | Ollama | ≥ 0.40.9, with `ollama pull phonon` (optionally `phonon:40m-de`) | | Homebrew | for `xcodegen`, `swiftformat`, `swiftlint`, `xcbeautify`, `ripgrep` | | OpenCode | current release, with a strong coding model configured | ## Getting started ```bash git init && git add -A && git commit -m "chore: Vorleser OpenCode kit" make bootstrap # installs xcodegen, swiftformat, swiftlint ollama pull phonon # English, Apache-2.0 make smoke # plays one sentence per installed phonon model make verify # the scaffold should already build and test opencode # start OpenCode in the repo root ``` Then paste the prompt from `docs/KICKOFF.md` into OpenCode, or simply run: ```text /next ``` ## What's inside | Path | Purpose | |---|---| | `AGENTS.md` | Project rules OpenCode loads automatically: commands, workflow, non-negotiables, doc map | | `opencode.json` | Loads `docs/CODING_STANDARDS.md` every session. It also sets permissions: build, test, and read-only git commands run freely; `git push`, `rm -rf`, and edits to the generated `.xcodeproj` are blocked. | | `.opencode/agents/` | `architect` (plans, read-only), `swift-reviewer` (reviews, read-only), `test-engineer` (may only edit tests and fakes) | | `.opencode/commands/` | `/next`, `/task T1.4`, `/plan …`, `/verify`, `/review`, `/adr …`, `/status`, `/manual-test …` | | `docs/ARCHITECTURE.md` | Authoritative design: modules, state machine, pipelines, budgets, risks | | `docs/PRD.md` | User stories and acceptance criteria | | `docs/IMPLEMENTATION_PLAN.md` | 10 milestones (M0–M9), 49 tasks, each with acceptance criteria | | `docs/KICKOFF.md` | Ready-to-paste prompts for the first session and checkpoints | | `docs/PROGRESS.md` | Checklist the agent updates after each task | | `docs/OLLAMA_SPEECH_API.md` | HTTP contract, error mapping, fixture plan | | `docs/SELECTION_CAPTURE.md` | Accessibility, Services, clipboard strategies + compatibility matrix | | `docs/AUDIO_PIPELINE.md` | AVAudioEngine graph, PCM conversion, epochs, events | | `docs/SECURITY_PRIVACY.md` | Privacy invariants SP-1…SP-10 (checked by `scripts/privacy-check.sh`) | | `docs/TESTING.md` | Test layers, required cases, manual release checklist | | `docs/DECISIONS.md` | ADR-001…007 | | `docs/CODING_STANDARDS.md` | Swift 6 concurrency, structure, logging, UI, style | | `project.yml` | XcodeGen spec for the app target | | `Packages/VorleserKit/` | SwiftPM package with module placeholders, test targets, and text fixtures | | `App/` | App target stubs, `Info.plist` (LSUIElement, NSServices, ATS), entitlements | | `scripts/` | `bootstrap`, `verify`, `privacy-check`, `capture-fixtures`, `smoke-ollama` | ## Recommended way to work with OpenCode 1. **One task per session.** `/task T1.4` keeps context small and focused. Start a new session per task. 2. **Headless first.** M1–M4 build everything that can be tested without UI: Ollama client, text pipeline, audio, and session. T4.5 gives you an interactive terminal reader (`vorleser-cli read --file article.txt`). Only then move to UI and Accessibility (M5–M7). 3. **Capture real fixtures early (T1.1).** Some `/api/show` and error-response details are marked **VERIFY** in the API doc. Recording them from your Ollama stops the agent from guessing. 4. **You are the test rig for macOS-only behaviour.** Accessibility, hotkeys, the Services menu, panel focus, and audio routing need a human. Use `/manual-test ` and report results back so the agent can update the compatibility matrix. 5. **Review gate.** `/next` already calls `@swift-reviewer`. Run `/review` yourself before committing larger changes. 6. **Record decisions.** When you deviate from the architecture, run `/adr ` so the docs stay true. ## Placeholders to change - Bundle ID prefix `de.schihei` in `project.yml`. - App name "Vorleser" if you prefer another. Search the repo for `Vorleser` (it also appears in the Services menu title in `Info.plist`). ## Licensing note Vorleser bundles no models or voices. `phonon` (31M English) is Apache-2.0. The `phonon:40m-*` checkpoints (incl. German) are **CC BY-NC 4.0**, so check this before any commercial distribution.