docs(dashboard): refine AGENTS.md technical blueprint and align README with 48h follow-up workflow
- Strip duplicated workspace git/session rules from AGENTS.md and establish local pnpm + Vite+ + Biome gates. - Document 48-hour follow-up queue, payment acknowledgment, delayed-payment authorization, and slot release in README.md. Refs: #1
This commit is contained in:
1 parent
70ee56848a
commit
3f1ab11a5d
2 files changed
+54
-37
No files matched your search
@@ -1,35 +1,45 @@
|
|||||||
# Armonía del Ser: Admin Dashboard - Agent Guidelines & Workflow Rules
|
# Repository Technical Blueprint: `armonia-dashboard`
|
||||||
|
|
||||||
This document specifies mandatory workflows, constraints, and quality gates for AI agents operating in `armonia-dashboard`.
|
This file defines the local toolchain, frontend implementation rules, UX invariants, and security boundaries for `armonia-dashboard`. For cross-repo Git branching rules, TDD lifecycle, or Gitea (`tea`) issue tracking, consult the workspace root [`../AGENTS.md`](../AGENTS.md).
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## 1. Core Operating Constraints
|
## 1. Local Toolchain & Nix Environment (`flake.nix` + `pnpm` + `Vite+` + `Biome`)
|
||||||
|
|
||||||
- **No Direct Commits to `main`**: Agents must never commit directly to `main`. All work must be developed on descriptive feature, bugfix, or chore branches (`feat/*`, `fix/*`, `chore/*`).
|
This repository is provisioned via a declarative Nix `devShell` (`flake.nix` + `.envrc`) and uses `pnpm`, `Vite+` (`vp`), and `Biome`.
|
||||||
- **No Destructive Git Actions**: Commands such as `git reset --hard`, `git restore <file>`, `git clean -fd`, and force-pushes (`git push --force`) are strictly prohibited without the user's explicit yes.
|
- **Nix DevShell:** Ensure commands run inside the Nix environment (`direnv` activates automatically on `cd`, or prefix with `nix develop -c <cmd>`).
|
||||||
- **Secret Redaction**: Never print, commit, or log sensitive tokens or API credentials.
|
- **Package Manager:** Use `pnpm` exclusively (`pnpm install`, `pnpm add`). Never use `npm` or `yarn` (do not generate `package-lock.json` or `yarn.lock`).
|
||||||
- **Session Modes**:
|
- **Verification Gates (Pre-Commit Checklist):**
|
||||||
- `learning`: The user drives and writes the reasoning, the agent asks guiding questions.
|
Before proposing or executing any commit, run and pass all checks with zero warnings or errors:
|
||||||
- `delivery`: The agent may draft code and plans, presenting rationale and trade-offs.
|
```bash
|
||||||
|
pnpm exec biome check .
|
||||||
|
pnpm exec vp check
|
||||||
|
pnpm exec vp test
|
||||||
|
```
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## 2. Agent Directory & Persona Delegation
|
## 2. Frontend Architecture & Persona Delegation
|
||||||
|
|
||||||
- **Anne Droid** (`profile/agents/anne-droid.md`): Senior Frontend Engineer & UX Specialist.
|
### Anne Droid Delegation (`profile/agents/anne-droid.md`)
|
||||||
- **Consult when**: Designing or reviewing mobile ergonomics, accessible form components, and booking state transitions.
|
- **Consult when:** Designing or reviewing mobile ergonomics, accessible form controls, and operator workflows for booking/payment state transitions.
|
||||||
- **Delegate when**: Implementing UI components, Tailwind styling, and client-side interactions on `feat/anne/*` branches.
|
- **Delegate when:** Implementing UI components, Tailwind CSS styling, HTMX/Vite+ client interactions, and frontend tests on `feat/anne/*` branches.
|
||||||
- **Anti-"Zombie UI" Invariant**: Every view must explicitly design for the 5 states: *Empty*, *Loading*, *Error*, *Partial*, and *Success*. Touch targets must be >= 44x44px for thumb use on mobile devices.
|
|
||||||
|
### UI & UX Invariants
|
||||||
|
- **5-State Resilient UI (Anti-"Zombie UI"):** Every operator view and interactive control must explicitly handle all 5 states: *Empty*, *Loading*, *Error*, *Partial* (e.g., booking saved in Turso but Google Calendar sync `FAILED`), and *Success*.
|
||||||
|
- **Mobile Ergonomics:** Designed mobile-first for Jasmin and her assistant operating on smartphones. All interactive touch targets must be $\ge 44\times 44\text{px}$ with zero layout shift.
|
||||||
|
|
||||||
|
### Security & API Boundary
|
||||||
|
- **Zero Client Secrets:** Never embed Google OAuth client secrets, Turso tokens, or session signing keys in frontend code or `VITE_*` environment variables. All authentication and `admin_allowlist` checks are enforced server-side by `armonia-api`.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## 3. Architecture & Functional Directives
|
## 3. Core Operator Views & Functional Scope
|
||||||
|
|
||||||
- **Primary Persona**: Jazmín (therapist and business owner).
|
1. **Cola de Seguimiento (48h) & Pagos Pendientes:** Surfaces `RESERVED` bookings within 48 hours where `payment_status = 'AWAITING_ACKNOWLEDGMENT'` (plus any unpaid `DELAYED_ALLOWED` exceptions), providing 1-tap `wa.me` follow-up links and explicit operator actions:
|
||||||
- **Core Ergonomic Requirement**: **Mobile-first**. Jazmín checks her banking app (BBVA) on her phone to see incoming SPEI notifications, then switches to the dashboard to tap "Acreditar Pago" in one touch.
|
- **Acreditar Pago (`ACKNOWLEDGED`)**
|
||||||
- **Key Views**:
|
- **Autorizar Pago Diferido (`DELAYED_ALLOWED`)**
|
||||||
1. *Agenda & Reservas*: Live list of pending vs confirmed bookings with filter toggles.
|
- **Liberar Espacio (`RELEASED`)**
|
||||||
2. *Validación de Pagos*: Fast-action review queue for incoming SPEI deposits matching folios (`ADS-XXXX`).
|
2. **Agenda & Sincronización con Google Calendar:** Displays unified booking (`booking_status`) and payment (`payment_arrangement`, `payment_status`) truth alongside Google Calendar sync status (`SYNCED` vs `FAILED` with 1-tap retry).
|
||||||
3. *Directorio de Clientes*: Searchable directory with direct `wa.me` WhatsApp contact links.
|
3. **Control de Paquetes & Asistencia:** Multi-session package progress tracker (e.g., `8 de 10`) and group workshop roster check-in.
|
||||||
4. *Catálogo de Servicios*: Configuration of prices, schedules, and capacity.
|
4. **Catálogo de Servicios:** Administrative management of service modalities (`PRESENCIAL` / `ONLINE`), capacities, buffers, and MXN pricing.
|
||||||
@@ -1,26 +1,26 @@
|
|||||||
# Armonía del Ser: Admin Dashboard (`armonia-dashboard`)
|
# Armonía del Ser: Admin Dashboard (`armonia-dashboard`)
|
||||||
|
|
||||||
Mobile-first operational dashboard for **Jazmín**, owner of **Armonía del Ser**.
|
Mobile-first operational control surface for **Jasmin**, owner of **Armonía del Ser**, and her assistant.
|
||||||
|
|
||||||
Designed to streamline schedule coordination, client directory tracking, and instant 1-tap SPEI payment acknowledgment without friction.
|
Designed to provide single-source-of-truth visibility into bookings, 48-hour payment follow-ups, delayed-payment exceptions, deliberate slot releases, and Google Calendar coordination.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## The Operational Problem Solved
|
## The Operational Problem Solved
|
||||||
|
|
||||||
Currently, Jazmín coordinates bookings via manual chat messages and allows clients to pay after sessions, leading to lost revenue when clients stop responding.
|
`armonia-dashboard` equips Jasmin and her assistant with an authenticated (`Google OAuth` + server-side Turso allowlist), mobile-optimized control surface where they can:
|
||||||
|
1. **Monitor the 48-Hour Payment Follow-Up Queue**: View active bookings within 48 hours of their session (or with authorized delayed payments) whose payments have not yet been acknowledged, and contact clients manually via 1-tap `wa.me` links.
|
||||||
`armonia-dashboard` equips Jazmín with a dedicated, mobile-optimized tool where she can:
|
2. **Acknowledge Payments (`ACKNOWLEDGED`)**: Record verified SPEI/cash deposits with full auditability (`acknowledged_by`, `acknowledged_at`).
|
||||||
1. **Acknowledge Payments in 1 Tap**: When an SPEI deposit notification appears in her banking app matching a reservation folio (`ADS-XXXX`), she taps "Confirmar Pago" to transition the booking from `PENDING_PAYMENT` to `CONFIRMED`.
|
3. **Authorize Delayed-Payment Exceptions (`DELAYED_ALLOWED`)**: Explicitly allow a session to proceed without prepayment while keeping the outstanding balance visible and traceable.
|
||||||
2. **Synchronize with Google Calendar**: View locked-in sessions alongside tentative holds.
|
4. **Deliberately Release Slots (`RELEASED`)**: Release an unconfirmed slot after manual follow-up so another client can book the time.
|
||||||
3. **Contact Clients Directly**: One-touch WhatsApp triggers (`wa.me`) to send session reminders or meeting links.
|
5. **Coordinate with Google Calendar**: Inspect schedule synchronization status (`SYNCED` vs `FAILED`) and retry failed calendar syncs.
|
||||||
4. **Manage Services**: Adjust pricing, schedules, and capacity limits (e.g., Círculos de Cacao, Meditaciones con cuencos, Atención Psicológica).
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Architectural Principles
|
## Architectural Principles
|
||||||
|
|
||||||
- **Zero-Cost Deployment**: Designed for **Cloudflare Pages** (static edge delivery, $0/month).
|
- **Zero-Cost Deployment**: Designed for **Cloudflare Pages** (static edge delivery, $0/month).
|
||||||
|
- **Server-Enforced Security**: OAuth credentials and session signing secrets live strictly in `armonia-api`, verified on every request against Turso's `admin_allowlist`.
|
||||||
- **Mobile Ergonomics**: Large touch targets (minimum 44x44px), thumb-friendly layout, and zero layout shift.
|
- **Mobile Ergonomics**: Large touch targets (minimum 44x44px), thumb-friendly layout, and zero layout shift.
|
||||||
- **5-State Resilient UI**: Every component handles *Empty*, *Loading*, *Error*, *Partial*, and *Success* states gracefully.
|
- **5-State Resilient UI**: Every component handles *Empty*, *Loading*, *Error*, *Partial*, and *Success* states gracefully.
|
||||||
|
|
||||||
@@ -29,22 +29,29 @@ Currently, Jazmín coordinates bookings via manual chat messages and allows clie
|
|||||||
## Local Development Quickstart
|
## Local Development Quickstart
|
||||||
|
|
||||||
### Prerequisites
|
### Prerequisites
|
||||||
- Node.js 20+
|
- NixOS / Nix Flakes (`direnv` recommended) or Node.js 22+ & `pnpm`
|
||||||
- npm
|
|
||||||
|
|
||||||
### 1. Setup Environment
|
### 1. Enter Nix DevShell & Setup Environment
|
||||||
```bash
|
```bash
|
||||||
|
direnv allow # or: nix develop
|
||||||
cp .env.example .env
|
cp .env.example .env
|
||||||
```
|
```
|
||||||
Set `VITE_API_BASE_URL=http://localhost:8000` to connect to `armonia-api`.
|
Set `VITE_API_BASE_URL=http://localhost:8000` to connect to `armonia-api`.
|
||||||
|
|
||||||
### 2. Install Dependencies
|
### 2. Install Dependencies
|
||||||
```bash
|
```bash
|
||||||
npm install
|
pnpm install
|
||||||
```
|
```
|
||||||
|
|
||||||
### 3. Run Dev Server
|
### 3. Run Dev Server (`Vite+`)
|
||||||
```bash
|
```bash
|
||||||
npm run dev
|
pnpm exec vp dev
|
||||||
```
|
```
|
||||||
Open `http://localhost:5173` in your browser.
|
Open `http://localhost:5173` in your browser.
|
||||||
|
|
||||||
|
### 4. Verification Gates
|
||||||
|
```bash
|
||||||
|
pnpm exec biome check .
|
||||||
|
pnpm exec vp check
|
||||||
|
pnpm exec vp test
|
||||||
|
```
|
||||||
Reference in new issue
Block a user