Agent-first starter for Effect HTTP + Temporal + Next.js + Drizzle.
This repository uses an agent-first workflow inspired by OpenAI's Harness Engineering post (February 11, 2026).
- Humans steer intent and acceptance criteria.
- Agents implement, validate, and iterate with mechanical checks.
- If an agent fails repeatedly, improve scaffolding (docs, linters, tests, scripts).
| Artifact | Path |
|---|---|
| Architecture | docs/ARCHITECTURE.md |
| Quality invariants | docs/QUALITY.md |
| Command catalog | docs/COMMANDS.md |
| Runbooks | docs/RUNBOOKS.md |
| Deployment | docs/DEPLOYMENT.md |
| Rollback | docs/ROLLBACK.md |
| API contract | apps/api/openapi.json (generated via pnpm openapi:generate) |
| MCP servers | .mcp.json + scripts/mcp/* |
| Skills | .claude/skills/* |
| CRUD scaffold skill | .claude/skills/golden-path-crud/SKILL.md |
Run tx in agent shells as source ~/.zshrc >/dev/null 2>&1; eval 'tx <subcommand> ...'.
apps/web: Client-only Next.js SPA (no SSR, noapp/api)apps/api: Effect HttpApi serverapps/worker: Temporal worker + workflowsapps/mobile: Expo React Nativeapps/docs: Fumadocs documentation sitepackages/core: DDD domain logic (Effect services)packages/contracts: Shared schemas + event types + permissionspackages/temporal-client: Temporal workflow types + event schemaspackages/infra/*: DB, auth, logging, observability, AIpackages/testkit: Test utilities + integration harnesspackages/tooling/*: ESLint configs, scaffold CLI, tsconfig, vitest configs
packages/core/src/domains/<domain>/
domain/ # entities, value objects, pure rules, event payloads
ports/ # capability contracts (repository seams)
application/ # use-case orchestration
adapters/ # external system adapters (optional)
runtime/ # layer wiring (optional)Dependency direction: inward only (domain ← ports ← application ← adapters ← runtime).
Full layer rules: docs/ARCHITECTURE.md + docs/QUALITY.md.
All invariants are mechanically enforced via pnpm lint.
Read docs/QUALITY.md for the full list. Highlights:
apps/webis client-only: noeffect, nodrizzle-orm, nonext/server, noapp/api.drizzle-ormonly inpackages/infra/db.process.envonly through dedicated env modules.as any,@ts-ignore,eslint-disableforbidden in source.- Temporal workflows must be deterministic.
- Domain events flow through transactional outbox;
apps/api/must not import@temporalio/*. usage_records/credit_ledgerare financial audit trails — no retention policies.
pnpm scaffold:crud --domain <domain> --entity <entity> --dry-run- Add contracts in
packages/contractswitheffect/Schema. - Add domain logic under
packages/core/src/domains/<domain>/. - If persistence: update
packages/infra/db/src/schema.ts+ effect-schemas + factories. - Expose via
apps/api, thenpnpm openapi:generate. - Regenerate hooks:
pnpm api:client:generate. - Validate:
pnpm lint && pnpm type-check && pnpm test.
Full skill: .claude/skills/golden-path-crud/SKILL.md
pnpm lint:quiet/pnpm lintpnpm type-check:quiet/pnpm type-checkpnpm test:quiet/pnpm testpnpm test:integration:quiet/pnpm test:integrationpnpm test:db:pgtapfor database trigger contracts.
Full command catalog: docs/COMMANDS.md
- Environment variables:
LANGFUSE_ENABLED,LANGFUSE_PUBLIC_KEY,LANGFUSE_SECRET_KEY,LANGFUSE_BASE_URL. - Enable export by setting
LANGFUSE_ENABLED=true. - Local vs Cloud switch requires only changing
LANGFUSE_BASE_URL,LANGFUSE_PUBLIC_KEY, andLANGFUSE_SECRET_KEY. - For AI integration test patterns and cassette workflows, use
.claude/skills/ai-vcr-test/SKILL.md.
- Starts automatically with
pnpm infra:ensure(part of theinfraDocker profile). - Enabled by default:
SENTRY_SPOTLIGHT=truein.env.example. Works without a real Sentry DSN (uses placeholderhttps://spotlight@local/0). - Native desktop app alternative: download from https://spotlightjs.com/, then stop the Docker container to free port
8969. - All three app layers (web, api, worker) forward errors + traces to Spotlight when enabled.
- MCP server
spotlight-localexposessearch_errors,search_logs,search_traces,get_tracesfor AI-assisted debugging. Fails fast with a clear message if the sidecar is not running. pnpm dev:openopens the Spotlight UI alongside other dashboards.- Full docs:
apps/docs/content/docs/observability/spotlight.mdx.
- ESLint:
packages/tooling/eslint-config/(modular configs) - Structural:
scripts/lint/enforce-*.mjs(7 invariant scripts) - Shell:
scripts/check-shell-invariants.sh - DB contracts: pgTAP suites in
packages/infra/db/pgtap/ - Duplication:
.jscpd.json(5% threshold on api/core/scripts) - Unused deps:
.knip.jsonc(pnpm lint:knip) pnpm lintruns ESLint + structural + shell + jscpd.
- Keep this file short and map-like (~100 lines).
- Move durable decisions into versioned docs/code.
- Treat in-repo artifacts as the only reliable knowledge source for agents.