# Productier - Project Plan

## Vision
Build a calm, lightweight, beautiful productivity workspace that combines calendar planning, kanban task management, notes, focus sessions, and mail-based task capture.

Design direction is Koffan-inspired:
https://github.com/PanSalut/Koffan

Reference the visual language and UX quality, but keep Productier implementation original and tailored to this project.

## Core Product Principles
- Lightweight and fast by default (quick load, minimal friction).
- Clean and simple UI with premium polish.
- Full dark and light mode support.
- Responsive experience for desktop and mobile.
- Local-first feel with backend sync and offline recovery.
- Strong workspace scoping and collaboration baseline.

## Core Experience (Target)
- Calendar:
  - Responsive month/week/day views.
  - Quick add on each day cell.
  - Event previews with show-more behavior.
  - Drag/drop and resize support.
  - Consistent color model shared with board and labels.
- Board (Kanban):
  - Custom groups (create, rename, reorder, recolor).
  - Smooth drag/drop between groups.
  - Rich task detail modal with markdown.
  - File attachments on tasks.
- Notes:
  - Fast free typing.
  - Markdown rendering.
  - Workspace-level organization.
- Focus:
  - Pomodoro timer with session history.
- Mail:
  - Connect mailbox.
  - Sync inbox.
  - Convert email into board tasks.

## OpenClaw + AI Tooling Plan
Goal: make Productier fully tool-usable by AI agents through OpenClaw.

### Planned Integration Shape
- Create an OpenClaw plugin package for Productier tools.
- Register typed tools for major operations:
  - `productier_list_workspaces`
  - `productier_list_tasks`
  - `productier_create_task`
  - `productier_update_task`
  - `productier_list_calendar_events`
  - `productier_create_calendar_event`
  - `productier_update_calendar_event`
  - `productier_list_notes`
  - `productier_create_note`
  - `productier_update_note`
  - `productier_list_board_groups`
  - `productier_create_board_group`
  - `productier_update_board_group`
  - `productier_list_mail_messages`
  - `productier_create_task_from_mail`
- Route tool calls to existing backend API endpoints.
- Enforce workspace membership and role checks.
- Add safe defaults and optional tool profiles.

### OpenClaw Delivery Phases
1. Plugin skeleton + one read-only tool (`list_tasks`) for end-to-end validation. (Implemented)
2. CRUD expansion for tasks/calendar/notes/board. (Implemented for plugin baseline)
3. Mail tooling + task-from-mail flows. (Mailbox list/connect/sync, outgoing mail list/create, message listing, and task-from-mail implemented for plugin baseline)
4. Hardening: retries, structured errors, rate limits, audit logs, docs. (Baseline implemented in OpenClaw plugin runtime)

## Whole-Project Delivery Roadmap
### Phase 1 - Foundation and Data Integrity
- Complete PostgreSQL-first runtime path.
- Eliminate in-memory fallback for production runs.
- Strengthen migration and seed workflows.
- Improve API error shape consistency.

### Phase 2 - UX Polish and Core Productivity Flows
- Improve calendar interactions and event density behavior.
- Implemented: aligned week view ranges, corrected day-view stepping, and per-day quick add entry points.
- Improve board editing ergonomics and modal UX.
- Finalize attachment handling for offline/online transitions.
- Improve note editing and rendering consistency.
- Implemented baseline: notes autosave status and debounced sync feedback (`saving`, `synced`, `queued`, `sync issue`).

### Phase 3 - Collaboration and Workspace Ops
- Invite/member admin improvements.
- Activity feed quality and filtering.
- Workspace settings expansion (roles, preferences, defaults).

### Phase 4 - AI and Automation
- OpenClaw plugin + tooling support.
- Safe tool execution model with clear permissions.
- AI-powered workflows (planning, triage, summarization, follow-up suggestions).

### Phase 5 - Reliability, Performance, and Launch Readiness
- Observability: logs, metrics, failure tracing.
- Implemented baseline: `/v1/metrics` JSON endpoint + `/v1/metrics/prometheus` text export with request counters and per-route latency snapshots.
- Implemented baseline: optional token guard for metrics endpoints (`METRICS_AUTH_TOKEN`) with production validation support.
- Performance budgets and frontend bundle optimization.
- Security hardening and secret/config review.
- Implemented baseline: frontend bundle budget gate in CI and stricter production env validation checks.
- Disaster recovery and operations automation: backup/verify/prune, staging restore-drill, deploy preflight/deploy gate, webhook alerts, and post-deploy smoke checks.
- QA pass, test coverage upgrades, release checklist.

## Definition of Done (Project Level)
- Stable backend with persistent data and migrations.
- Polished UX across key pages (Today, Calendar, Board, Notes, Focus, Mail).
- Reliable offline/sync behavior with visible statuses.
- OpenClaw plugin supports practical daily workflows.
- Documentation is complete enough for onboarding and contribution.
