From 9ead82bbca1653e2169963d18c0de95bcc65320e Mon Sep 17 00:00:00 2001 From: simoleo89 Date: Sun, 12 Jul 2026 15:22:00 +0200 Subject: [PATCH] docs: plan first admin module port --- ...-12-admin-events-polls-banners-prefixes.md | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 docs/superpowers/plans/2026-07-12-admin-events-polls-banners-prefixes.md diff --git a/docs/superpowers/plans/2026-07-12-admin-events-polls-banners-prefixes.md b/docs/superpowers/plans/2026-07-12-admin-events-polls-banners-prefixes.md new file mode 100644 index 00000000..1b25dd39 --- /dev/null +++ b/docs/superpowers/plans/2026-07-12-admin-events-polls-banners-prefixes.md @@ -0,0 +1,43 @@ +# Admin Events Polls Banners Prefixes Implementation Plan + +> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking. + +**Goal:** Port four complete admin modules from habbo-next into EpicNext with safe schema ownership and ACL enforcement. + +**Architecture:** Add CMS-owned tables and Prisma models first, then validators/actions, then locale-free admin routes and navigation. Existing safe-action, audit, admin-list, UI primitives, and semantic theme systems are reused. + +**Tech Stack:** Next.js 16, Prisma 7, MariaDB SQL migrations, Zod, React Hook Form, Vitest. + +## Global Constraints + +- Never modify emulator-owned poll tables. +- Preserve the local `package.json` modification. +- Remove `[locale]` routing assumptions. +- Use EpicNext semantic colors and ACL permission constants. + +### Task 1: Schema and ACL + +- [ ] Add failing migration/schema contract tests for all CMS tables and permission slugs. +- [ ] Add Prisma models and an idempotent numbered migration. +- [ ] Generate Prisma and run schema/migration tests. +- [ ] Commit with `feat: add schema for admin content modules`. + +### Task 2: Validators and actions + +- [ ] Port event/poll validators and add invalid-input tests. +- [ ] Port events, polls, banners, and prefixes actions using existing safe-action/audit APIs. +- [ ] Run action import contracts, typecheck, and targeted tests. +- [ ] Commit with `feat: add admin content module actions`. + +### Task 3: Routes and UI + +- [ ] Port the 24 module files without locale routing and add the missing date-time picker primitive. +- [ ] Add route/import contract tests and adapt query/API differences found by typecheck. +- [ ] Add navigation entries and permission visibility. +- [ ] Run targeted tests and typecheck; commit with `feat: add admin content module pages`. + +### Task 4: Verification + +- [ ] Run Prisma generation, full test suite, typecheck, and production build. +- [ ] Verify migration idempotency and ensure `package.json` is unstaged. +- [ ] Push the verified commits to `origin/main`.