mirror of
https://github.com/johndoe6345789/metabuilder.git
synced 2026-04-25 14:25:02 +00:00
4.2 KiB
4.2 KiB
Kickstart
Use this as the default workflow when starting work in this repo.
Workflow
- Skim
docs/START_HERE.md(if new),docs/INDEX.md, and relevant items indocs/todo/. - Check for scoped rules in nested
AGENTS.mdfiles (e.g.dbal/AGENTS.md) before editing those areas. - Use the prompts in
.github/prompts/as needed:- Plan:
1-plan-feature.prompt.md - Design:
2-design-component.prompt.md - Implement:
3-impl-*.prompt.md - Test:
4-test-*.prompt.md - Review:
5-review-code.prompt.md - Deploy:
6-deploy-*.prompt.md - Maintain:
7-maintain-*.prompt.md - Docs:
8-docs-feature.prompt.md
- Plan:
- Keep changes small and follow existing patterns; avoid dependency churn.
Where Work Lives
- Next.js app:
frontends/nextjs/(source insrc/, E2E ine2e/, local scripts inscripts/). - Component packages:
packages/(seed JSON underpackages/*/seed/, optionalstatic_content/, schema checks inpackages/*/tests/). - DBAL:
dbal/(TypeScript library indbal/ts/). - Prisma schema/migrations:
prisma/(schema.prisma,migrations/). - Shared config:
config/(symlinked intofrontends/nextjs/). - Repo utilities:
tools/(quality checks, workflow helpers, code analysis).
Common Commands
Run app workflows from frontends/nextjs/:
- Install:
npm ci(ornpm install) - Dev:
npm run dev - Build/serve:
npm run build/npm run start - Lint:
npm run lint/npm run lint:fix - Typecheck:
npm run typecheck - Unit:
npm run test:unit/npm run test:coverage - Function coverage:
npm run test:check-functions - Coverage report:
npm run test:coverage:report - E2E:
npm run test:e2e - Prisma (schema in
prisma/schema.prisma, config infrontends/nextjs/prisma.config.ts):- First-time setup: copy
.env.exampleto.env(or ensureDATABASE_URLis set) - Commands:
npm run db:generate/npm run db:push/npm run db:migrate - Validate:
npx prisma validate
- First-time setup: copy
- Coverage output:
frontends/nextjs/coverage/
DBAL workflows live in dbal/ts/ (npm run build, npm run test:unit).
Source + Tests
- TypeScript + ESM. Prefer
@/…imports insidefrontends/nextjs/src/. - React components:
PascalCase.tsx; hooks:useThing.ts; tests:*.test.ts(x). - Unit tests:
frontends/nextjs/src/**/*.test.ts(x)andpackages/*/tests/*.test.ts; E2E:frontends/nextjs/e2e/. - Prefer one focused function (“lambda”) per file; use classes only as containers for related functions (see
.github/prompts/LAMBDA_PROMPT.md). - Add/adjust tests with behavior changes; keep tests deterministic (no network, stable clocks/IDs), and parameterize where it improves coverage (
it.each()); keep source↔test naming aligned. - Leave TODOs only when you’re explicitly deferring follow-up work (and include the next step).
Git Hygiene
- Commit as you go with descriptive (Conventional Commit-style) messages; default to trunk-based work on
mainunless a PR flow is required. - If multiple agents are working, merge/rebase carefully and avoid overwriting each other’s changes.
- Before opening a PR, run
npm run lint,npm run typecheck, and the relevant tests (fromfrontends/nextjs/). - PRs should include: what/why, linked issue (if any), screenshots for UI changes, and notes on DB/schema changes.
Architecture Guardrails
- Prefer data-driven config (JSON/Lua) over hard-coded TS/TSX; start with
packages/*/seed/anddocs/architecture/data-driven-architecture.md. - Prefer declarative UI via
RenderComponent/ generic renderers (seedocs/architecture/generic-page-system.md). - Route data access through DBAL / the
Databasewrapper (frontends/nextjs/src/lib/db/or@/lib/db); don’t bypass it. - Assume multi-tenancy: include
tenantIdfiltering and isolate per-tenant data. - UI uses Material UI (
@mui/*) and SCSS/modules as needed; don’t introduce Radix UI or Tailwind. Seedocs/RADIX_TO_MUI_MIGRATION.mdandUI_STANDARDS.md. - Package metadata: keep
packages/*/seed/metadata.jsonpackageIdinsnake_caseand versions semver (e.g.1.2.3).
CI / Workflows
- Use
actto reproduce and debug GitHub Actions locally (fromfrontends/nextjs/:npm run act,npm run act:diagnose; seedocs/guides/ACT_TESTING.md).
If you get stuck, see .github/prompts/EEK-STUCK.md.