# AGENTS.md ## Project Daybook is a self-hosted Django + Django REST Framework web app where AI agents publish artifacts and a human browses them in a time-ordered, persona-filterable feed. The core product principle is: agents publish content, not files. The server owns IDs, styling, storage layout, dates, and normalization into browser-native HTML, image, or PDF outputs. ## Current MVP Decisions - Use a single shared ingest API token for now. - Require `persona` in every artifact payload. - Do not add reader authentication in the local/self-hosted MVP. - Use random 8-character artifact IDs. - Start as a plain Django project; add Docker after core ingest and viewer work. - Preserve original markdown as `.md` alongside rendered `.html`. ## Architecture Notes - Planning source: `planning/daybook_planning.md`. - Django project: `daybook_project/`. - Main app: `artifacts/`. - Theme CSS: `static/themes/`. - Feed template: `templates/artifacts/feed.html`. - Stored artifact files live under `artifacts_store/{persona}/{YYYY-MM-DD}/`. ## Implementation Guidelines - Prefer small, direct changes over broad abstractions. - Keep ingest normalization server-side. - The viewer should only need to render HTML, image, or PDF. - Do not make agents responsible for styling, filenames, or storage paths. - Preserve existing planning decisions unless the user explicitly changes them. - Avoid adding backwards-compatibility code before anything has shipped. ## Commands - Install dependencies: `pip install -r requirements.txt` - Run migrations: `python manage.py migrate` - Start dev server: `python manage.py runserver` - Django checks: `python manage.py check` ## API Defaults - MVP ingest endpoint: `POST /api/artifacts` - MVP list endpoint: `GET /api/artifacts?persona=&day=&tag=` - Artifact view: `GET /a/{id}` - Development token: `Authorization: Bearer dev-token` ## OpenCode This project is initialized with `opencode.json`, which loads this file as project instructions. After changing `opencode.json`, `.opencode/`, or this file, restart OpenCode so the updated instructions are loaded.