Skip to content

Compose layer: schema-driven CRUD/admin UI (vike-crud + vike-admin) instead of hand-writing it #189

Description

@suleimansh

Next layer under #186 (the "later" UI phase). PR #188 taught the agent to compose vike-auth (identity) and the universal-orm data layer (domain data). It still hand-writes the CRUD/admin UI — list/record/form screens and an admin panel — which is the largest remaining chunk of fresh, churn-prone AI code. Teach it to compose vike-crud (+ vike-admin) instead.

Mechanism

Same lever as #187: persona / skills framing. Add a vike-crud-composer persona to vikeExtensionPersonas in ai-autopilot, and a matching section in the workspace CLAUDE.md. No runtime change; the agent stays a black box.

What the persona teaches

  • Derive CRUD screens from the schema: crud({ table }) for list/record/form; definePage({ route, sections }) for custom pages. Do NOT hand-write list/record/form components. (defineView is gone — the package was renamed vike-view -> vike-crud, #509.)
  • Drop vike-admin on top for a whole-DB admin panel (a preset over vike-crud).
  • Screens render through vike-blocks / vike-themes and mutate through vike-actions, guarded by vike-rbac + the owner contract. The agent references actions by NAME (serializable), never inline closures.
  • Everything rides the ONE universal-orm adapter already registered (memory in dev, drizzle+pglite for real per Compose layer: real-DB persistence (drizzle + pglite) — accounts + data survive restart #187). Schema stays defineSchema.
  • Customization ladder: config -> slot overrides -> AI-eject. Reach for eject only when config can't express it, not by hand-rolling from the start.

Stack reference: see the verified dependency graph in the #186 comment.

Scope

  • ai-autopilot: new vike-crud-composer persona + wire into vikeExtensionPersonas; unit test asserts it teaches crud({ table }) / vike-admin / no hand-rolled CRUD.
  • Workspace CLAUDE.md: a "Screens come from the schema" section mirroring the persona.
  • Verify vike-crud's current public API in the repo (suleimansh/vike-data packages/vike-crud) before writing the snippets.

Acceptance

For a blog-style app, the agent composes a vike-crud/vike-admin CRUD+admin UI from the schema instead of writing its own list/record/form screens, and the production-grade loop no longer churns on hand-written CRUD UI.

Part of #186.

Metadata

Metadata

Assignees

Labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions