85 lines
5.2 KiB
Markdown
85 lines
5.2 KiB
Markdown
# AGENTS.md — Agent Guidance for Event Photo Platform
|
|
|
|
This repository hosts a multi-tenant event photo platform (Laravel 12, PHP 8.3, Filament 4, React 19/Vite 7 PWA). This document defines how AI agents should operate in this repo: roles, permissions, safety rules, and standard workflows. It is the single source of truth for agent behavior. Per-agent details live in docs/agents/.
|
|
|
|
## Purpose & Scope
|
|
- Provide clear guardrails and playbooks so agents can assist safely with code, docs, DevOps and project hygiene.
|
|
- Applies to the whole repo unless a component has an explicit per-agent policy in docs/agents/.
|
|
|
|
## Roles
|
|
- Codegen Agent — implements and edits application code, tests and documentation within scoped tasks. See docs/agents/codegen.md.
|
|
- Ops Agent — automates tasks around CI/CD, releases, issue hygiene, and repo maintenance. See docs/agents/ops.md.
|
|
- (Optional) Docs Agent — maintains documentation quality; follow Codegen Agent rules with writing focus.
|
|
|
|
## Global Policies
|
|
- Secrets & Credentials:
|
|
- Never commit secrets. The local file gogs.ini (token=…) is ignored via .gitignore and must not be printed into logs.
|
|
- ENV values in .env are sensitive; do not commit them or echo to build logs.
|
|
- Data Protection:
|
|
- Respect GDPR. Do not introduce PII logging. Legal content (Impressum, Privacy, AGB) is managed via Legal Pages resource.
|
|
- Safety & Access:
|
|
- Prefer least privilege. Do not alter production data or infrastructure from code without explicit human approval.
|
|
- When uncertain about a destructive operation, open a PR or create an Issue with a proposal.
|
|
- Source of Truth:
|
|
- Keep this AGENTS.md authoritative. If per-agent docs diverge, update this file and link the rationale.
|
|
|
|
## Tools & Permissions
|
|
- Languages/Frameworks: PHP 8.3 (Laravel 12), TypeScript/JavaScript (React 19/Vite 7/Tailwind 4), Filament 4.
|
|
- Dev Commands: composer, npm, vite, artisan, PHPUnit, Pint/ESLint, Docker/Compose (for dev).
|
|
- Git Hosting: Gogs at http://nas:10880 (token found locally in gogs.ini, never printed or committed).
|
|
- Issue API: Gogs REST /api/v1 for labels/issues/milestones (token auth).
|
|
- Libraries: simplesoftwareio/simple-qrcode for server-side QR generation; Stripe PHP SDK for payments; PayPal Server SDK for payments; dompdf for PDF generation; spatie/laravel-translatable for i18n.
|
|
- Payment Systems: Stripe (subscriptions and one-time payments), PayPal (integrated payments), RevenueCat (mobile app subscriptions).
|
|
- PWA Technologies: React 19, Vite 7, Capacitor (iOS), Trusted Web Activity (Android), Service Workers, Background Sync.
|
|
|
|
## Repo Structure (high-level)
|
|
- docs/prp/ — split PRP (authoritative). Start at docs/prp/README.md.
|
|
- docs/changes/ — session change logs.
|
|
- docs/todo/ — prioritized backlog items (replaces single TODO.md file).
|
|
- resources/js/guest/ — Guest PWA source (React 19, offline-first, installable).
|
|
- resources/js/admin/ — Tenant Admin PWA source (React 19, Capacitor/TWA ready).
|
|
- fotospiel_prp.md — legacy monolithic PRP (historical reference; do not edit).
|
|
|
|
## Standard Workflows
|
|
- Coding tasks (Codegen Agent):
|
|
1) Understand scope; update or create a minimal plan.
|
|
2) Edit code/docs via small, reviewable patches; keep changes focused.
|
|
3) Add/update tests if behavior changes.
|
|
4) Update docs when public surfaces change (PRP, docs/*).
|
|
5) Propose follow-ups as Issues if out of scope.
|
|
- Issue hygiene (Ops Agent):
|
|
- Import docs/todo/ tasks as Issues with label TODO; group by Milestone (e.g., Now, Security & Compliance).
|
|
- Avoid duplicates by checking existing titles.
|
|
- Releases (Ops Agent):
|
|
- Tag with semantic version; generate changelog from commits/PRs; ensure legal pages and migration notes are updated.
|
|
|
|
## Developer Utilities
|
|
- Artisan commands:
|
|
- media:backfill-thumbnails — generate thumbnails for existing photos.
|
|
- tenant:add-dummy — create a demo tenant and admin user (see --help for options).
|
|
- tenant:attach-demo-event — attach an existing demo event to a tenant.
|
|
- Public APIs for Guest PWA: stats/photos endpoints with ETag; likes; uploads; see docs/prp/03-api.md.
|
|
- Payment Integration: Stripe webhooks, PayPal API integration, RevenueCat mobile subscriptions.
|
|
|
|
## PWA Architecture
|
|
- Guest PWA: Offline-first photo sharing app for event attendees (installable, background sync, no account required).
|
|
- Tenant Admin PWA: Store-ready mobile app for event management (Android TWA, iOS Capacitor, OAuth2 + PKCE).
|
|
- Core Features: Background upload, conflict resolution, push notifications, achievement system, emotion/task tagging.
|
|
|
|
## Constraints & Red-Lines
|
|
- Do not introduce tracking beyond what is documented (anonymous session_id only for guest PWA).
|
|
- Do not weaken auth, CSRF, CORS, or role checks.
|
|
- Do not expand data retention without updating Privacy policy.
|
|
- PWA decisions are locked: Photos only (no videos), no facial recognition, no public profiles.
|
|
|
|
## Change Management
|
|
- Propose updates to this file via PR. Include:
|
|
- Motivation and scope, affected agents, roll-out plan.
|
|
- Links to updated docs in docs/agents/.
|
|
|
|
## References
|
|
- ADR-0006: Tenant Admin PWA architecture decision.
|
|
- docs/prp/06-tenant-admin-pwa.md: Detailed PWA specifications.
|
|
- docs/prp/07-guest-pwa.md: Guest PWA requirements and features.
|
|
- docs/prp/08-billing.md: Payment system architecture.
|