Claude Templates / S-tier · Foundation

Admin & Ops

The Admin Console Playbook

A 12-section operator cockpit: accounts, impersonation, P&L, audit log, settings.

ADMIN-CONSOLE-PLAYBOOK.md · 26 sections · 5,216 words · 42 KB · markdown

By Moe Ameen, founder of BILT · Published · Updated

The Admin Console Playbook is the largest S-tier file in the library, at about 5,200 words. It has Claude Code build a role-gated operator console: customer management, impersonation with a one-hour limit, an audit log of every destructive write, a financial overview with MRR, ARR, LTV and P&L, a unified inbox for support and sales, signup segmentation, settings and refunds. Billing pieces can be stubbed if Stripe isn't ready.

Key takeaways

  • Admin gating at three layers: proxy, API and database.
  • Every destructive admin write lands in an admin_actions audit table.
  • Impersonation uses a server-minted session with a 1-hour maximum.
  • Without billing, it ships everything except the money sections and stubs MRR at $0.

The surface you live in once real users show up. Customer list with drill-down, safe impersonation, plan management, credit grants, a financial overview, and a full audit log. The largest playbook in the library because it replaces four SaaS tools you'd otherwise pay for.

What does the Admin Console Playbook build?

It builds /admin and /admin/dashboard with customer, financial, conversation, analytics, SEO and settings sections, all behind requireAdmin().

It also defines account-status transitions (active, suspended, cancelled, archived) and a rule that admin edits sync to the customer's view.

When should you build the admin console?

Build it in week 3, which in practice is the day you get your first customers. Several A-tier playbooks plug into its shell and nav.

A very early beta can run on direct database access for a while, but support and refunds get risky without an audit log.

What do you need first?

You need an auth stack with a profiles or workspaces table, a Supabase service-role key, an IMPERSONATION_SECRET of 32+ random characters, and Stripe keys if refunds and P&L are in scope.

Decide early whether the admin flag lives on profiles or workspaces; the file says to pick deliberately.

What's inside

What does the playbook give you?

When to use it

Week 3. Day 1 of having customers, in practice.

Straight from the file

What does the writing look like?

Scope to your app: a per-user tool (no sales motion) can drop Inbox/Mail; a pre-revenue internal app can drop Automations/SEO and stub the P&L. Ship Summary + Accounts + Users + Audit + Impersonation as the irreducible core.

Table of contents

Which sections does the file cover?

  1. 0. Use this spec
  2. 1. Architecture
  3. 2. Nav structure (the cockpit)
  4. 3. Schema (Supabase)
  5. 4. Edge gating (proxy.ts)
  6. 5. requireAdmin() + the role/permission model
  7. 6. Audit log — recordAdminAction()
  8. 7. Overview dashboard — financial P&L + acquisition funnel
  9. 8. Customer/workspace management endpoints
  10. 9. Signups segmentation (lead vs abandoned checkout)
  11. 10. Cold leads (anonymous lead-magnet opt-ins)
  12. 11. Unified conversation system (one core, three faces)
  13. 15. Email automation console (Automations)
  14. 16. Analytics tab
  15. 17. SEO & GEO tab
  16. 18. Settings
  17. 19. Impersonation flow
  18. 20. Enterprise API key bridge
  19. 21. Refund issuance
  20. 22. Customer health metrics
  21. 23. Realtime notifications (the "cha-ching")
  22. 24. Admin Web Push
  23. 25. Message attachments
  24. 26. Admin → Client sync rule (MANDATORY)
  25. 27. Common pitfalls
  26. 28. Kickoff prompt

How do you run it?

Drop ADMIN-CONSOLE-PLAYBOOK.md into your repo, then tell Claude Code: “Read ADMIN-CONSOLE-PLAYBOOK.md and implement it in this codebase.” It's written for an agent to execute end to end. Search the file for angle-bracket placeholders and swap in your own project names, domains, and keys before the first run.

↓ Download the playbook

Who is this for, and who should skip it?

Best for

  • Founders running support, billing and growth themselves
  • Apps about to take paying customers
  • Teams that want one console instead of several SaaS tools

Not ideal for

  • Apps that already use a back-office tool such as Retool
  • Products with a handful of internal users and no customers
  • Multi-team orgs needing fine-grained enterprise RBAC beyond the file's role model
  • Builders who won't adapt paths: the file points to a reference app you won't have

What else do people ask?

What is in the Admin Console Playbook download?

The Admin Console Playbook is a markdown file of about 5,200 words. It has SQL for the audit, impersonation, P&L ledger, conversation, funnel, settings and push tables, a 12-item nav table, an endpoint table for customer management, the impersonation steps and a kickoff prompt.

Can I build only part of the admin console?

Yes. The Admin Console Playbook names Summary, Accounts, Users, the audit log and impersonation as the core you can't drop. A per-user tool can leave out Inbox and Mail, and a pre-revenue internal app can skip Automations and SEO and stub the P&L; the kickoff prompt has in-scope and out-of-scope fields for this.

Does it work for multi-tenant apps?

The Admin Console Playbook supports two models: a role column on profiles for per-user apps, or a server-only is_admin flag on workspaces for multi-tenant apps. In the multi-tenant version a customer is a workspace, and only the service role can toggle is_admin.

How does it keep impersonation safe?

The Admin Console Playbook caps impersonation at one hour, re-checks the cap on every /api/admin/* call, expires it in the browser and shows an Exit button. It keeps only IDs in an HMAC-signed side cookie, because copying the admin's full auth cookies can blow past the 4KB Set-Cookie limit and get silently dropped.

What RLS mistake does it warn about?

The Admin Console Playbook warns that an admin RLS policy which looks up profiles by auth.uid() runs once per row, an N+1 query. It recommends putting the admin flag in JWT claims or using a SECURITY DEFINER helper instead.

How do we know this?

This page is based on the playbook file itself, ADMIN-CONSOLE-PLAYBOOK.md, which Moe Ameen wrote from the Kompozy codebase (called BKE in the file). We read the file on November 4, 2026; the facts here come from it, not from independent testing in other codebases.

More admin & ops playbooks

← All 28 Claude templates