Arkive

Synergy Lesson 2 Walkthrough: Per-Package Migrations

As of
Version1.0.0
Kindguidance
Length2,104 words, about 9 min
Tagsbuildwalkthroughphase-3databasedrizzletesting

This guide reproduces lesson 2 of Phase 3 step by step. Every package that owns tables gets its own Drizzle config, migrations folder and migrations table; pnpm db:migrate runs them in dependency order; and one throwaway test database is built from every package's migrations, the same way. Synergy ships its first migration, the restore-aware update trigger function. It implements Migration 1.1.0 (D262) and Testing layers 1.3.0 (D261).

It shipped as sidekick#53, one squash-merged PR. What was learned along the way is in the notes.

Run everything from the Sidekick repo root unless a step says otherwise.

Where the build differs from the brief

  • Core's migrations table is renamed too. The brief kept core on drizzle's default name. Pratik pointed out that one package without a migrations.table would puzzle every later reader, so every package is __drizzle_migrations_<package>, and each existing database gets a one-time ALTER TABLE ... RENAME before its next migrate (step 6).
  • Only the root reads .env.local (new step 4a). Turbo runs tasks in strict env mode, so a test URL exported before turbo run db:migrate would be stripped, and a package-level dotenv -e .env.local would then have migrated dev. Package db:* scripts are now plain drizzle-kit, and turbo.json passes DATABASE_DIRECT_URL through.
  • The root wraps test:integration once, not each package. Per-package wrapping would start two clusters on the same port in parallel, and run Turbo inside Turbo once per package. One database for every package matches Testing layers: test files use random per-file user ids so they share one database.
  • @sidekick/test-utils imports nothing in the workspace. The brief expected it to import core. Only db.ts and http.ts are generic; core's mocks.ts is built from core's own types and stays in core. Core's tests depend on test-utils, so an import of core would have made a cycle.
  • A bug fix in core: migration 0009. The first shared test run showed Synergy's new function executable by the Data API roles. 0008's per-schema default privilege can't revoke the global PUBLIC EXECUTE; 0009 revokes it globally. See the post note in Phase 1.1.
  • Synergy's test proves behaviour, not only existence. It binds the function to a probe table and checks that a live update and a restore pass and a tombstone edit fails.

Step 1 — Synergy's Drizzle config

What and why: drizzle-kit records applied migrations in a table, one row per migration with a hash and the journal's when timestamp. Its migrator doesn't compare names or hashes: it takes the newest created_at and applies every journal entry whose when is later. So the table is a high-water mark. Two packages sharing one would hide each other's older migrations, silently.

Shell
git switch -c feat/per-package-migrations

packages/platform/synergy/drizzle.config.ts:

TypeScript
import { defineConfig } from 'drizzle-kit';

const directUrl = process.env.DATABASE_DIRECT_URL;

if (!directUrl) {
   throw new Error('Missing DATABASE_DIRECT_URL environment variable');
}

export default defineConfig({
   schema: './src/db/schema/index.ts',
   out: './src/db/migrations',
   dialect: 'postgresql',
   // Each package records its applied migrations in its own table:
   // drizzle-kit applies only migrations newer than the newest row, so a shared
   // table would skip one package's older migrations.
   migrations: {
      table: '__drizzle_migrations_synergy',
   },
   dbCredentials: {
      url: directUrl,
   },
});

Core's drizzle.config.ts gets the same migrations block with table: '__drizzle_migrations_core'. Both tables sit in drizzle's default drizzle schema.

packages/platform/synergy/src/db/schema/index.ts — drizzle-kit reads schema even for a custom migration, and an empty module is enough:

TypeScript
// Synergy's Drizzle tables. Lesson 3 adds the first ones; until then the
// schema is empty and every migration is custom SQL.
export {};

Dependencies, quoted because zsh expands *:

Shell
pnpm -C packages/platform/synergy add -D drizzle-kit@^0.31.11 @types/node@^24.19.2

@types/node must stay on 24 (Node 24); without a version, pnpm installs the latest major. In Synergy's tsconfig.json, add "compilerOptions": { "types": ["node"] } and include drizzle.config.ts. TypeScript 6 defaults types to an empty list, so process is unknown until Node's types are named; core only had them because Next's types pull them in.

Step 2 — Order by the package graph

What and why: in turbo.json, "dependsOn": ["^db:migrate"] means "run db:migrate in every package this one depends on first". Lint only lets a package depend on layers below it, so every edge points down, and Turbo runs foundation, then platform, then features. Siblings in one layer can't depend on each other, so their migrations may run in parallel.

JSON
"db:migrate": {
   "cache": false,
   "dependsOn": ["^db:migrate"]
},

Synergy needs the edge. A plain dependency, since lesson 3's code imports core at runtime:

Shell
pnpm -C packages/platform/synergy add '@sidekick/core@workspace:*'

Prove the order without a database:

Shell
pnpm turbo run db:migrate --dry=json | jq '.tasks[] | {taskId, dependencies}'

Synergy's task lists @sidekick/core#db:migrate; core's lists nothing. Packages without the script appear as empty placeholders.

A named dependency ("@sidekick/core#db:migrate") is not the same thing: every package inherits it, core included, so core would wait for itself, and Turbo reports a cycle.

Step 3 — Synergy's first migration

Shell
pnpm db:generate --filter=@sidekick/synergy -- --custom --name=restore_aware_update_trigger_fn

(During the lesson this ran inside the package; after step 4a the root form above is the one that works.) Replace drizzle-kit's placeholder line with:

SQL
-- Synergy's version of core's block_update_on_deleted: refuses every update to
-- a soft-deleted row except the one that restores it (deleted_at back to NULL).
-- Lesson 3 binds it to Synergy's tables with:
--   CREATE TRIGGER no_update_deleted_[table]
--     BEFORE UPDATE ON [table]
--     FOR EACH ROW EXECUTE FUNCTION synergy_block_update_on_deleted();
CREATE FUNCTION synergy_block_update_on_deleted()
RETURNS trigger LANGUAGE plpgsql AS $$
BEGIN
  IF OLD.deleted_at IS NOT NULL AND NEW.deleted_at IS NOT NULL THEN
    RAISE EXCEPTION
      'Cannot update a soft-deleted row in % (id: %). Restore it first.',
      TG_TABLE_NAME, OLD.id;
  END IF;
  RETURN NEW;
END;
$$;
  • It refuses the one case "deleted and still deleted"; a live row and a restore pass (D66). Core's block_update_on_deleted refuses every update to a tombstone on purpose: ordinary tables follow D11 and never show a tombstone to restore.
  • Plain CREATE FUNCTION, not CREATE OR REPLACE: a first definition should fail loudly if another package owns the name. The synergy_ prefix names the owner in Postgres' shared public namespace.
  • PL/pgSQL counts RAISE placeholders against arguments when it compiles the function, so a mistyped % fails the migration itself.

Add the generated meta/ folders to .prettierignore with one glob, packages/**/src/db/migrations/meta/; drizzle-kit rewrites those files on every generate.

Step 4a — Load .env.local once, at the root

What and why: Turbo 2 runs tasks in strict env mode (--dry=json shows "envMode": "strict"): a task sees only the variables turbo.json declares for it. Turbo filters; it doesn't create, so the root still loads the file, and each task receives only what it declares.

turbo.json:

JSON
"db:migrate": {
   "cache": false,
   "dependsOn": ["^db:migrate"],
   "passThroughEnv": ["DATABASE_DIRECT_URL"]
},
"db:generate": {
   "cache": false,
   "passThroughEnv": ["DATABASE_DIRECT_URL"]
},

Root package.json:

JSON
"db:generate": "dotenv -e .env.local -- turbo db:generate",
"db:migrate": "dotenv -e .env.local -- turbo db:migrate",

Core's and Synergy's package.json:

JSON
"db:generate": "drizzle-kit generate",
"db:migrate": "drizzle-kit migrate",

passThroughEnv rather than env: env would also put the URL into the cache key, and these tasks are never cached. Prove it fails safe:

Shell
pnpm turbo run db:migrate --filter=@sidekick/core
pnpm turbo run db:migrate --dry=json | jq '.tasks[] | select(.taskId=="@sidekick/synergy#db:migrate") | .environmentVariables.specified'

The first fails with Missing DATABASE_DIRECT_URL: nothing loaded the file, so nothing reached the task. The second shows the variable under passThroughEnv.

Step 4b — One test database for every package

Shell
mkdir -p scripts/test-db
git mv packages/foundation/core/tests/with-test-db.sh scripts/test-db/with-test-db.sh
git mv packages/foundation/core/tests/supabase-stub.sql scripts/test-db/supabase-stub.sql

In scripts/test-db/with-test-db.sh, update the header comment, replace CORE=... with ROOT="$(cd "$HERE/../.." && pwd)", and replace the single drizzle-kit migrate line with:

Shell
# Every package's migrations, in dependency order. turbo.json passes
# DATABASE_DIRECT_URL through to db:migrate, and no package reads .env.local,
# so this can only reach the throwaway database.
(cd "$ROOT" && DATABASE_DIRECT_URL="$(url postgres)" \
  pnpm turbo run db:migrate --output-logs=errors-only)

Root package.json: "test:integration": "scripts/test-db/with-test-db.sh turbo test:integration". Core's becomes "test:integration": "vitest run tests/integration". The URLs now cross Turbo, so the task declares them:

JSON
"test:integration": {
   "cache": false,
   "passThroughEnv": ["DATABASE_URL", "TEST_AUTH_DATABASE_URL", "TEST_ADMIN_DATABASE_URL"]
}
Shell
pnpm test:integration

The first run failed core's Data API test: synergy_block_update_on_deleted was executable by anon and authenticated. That is a core bug, fixed next.

4c — Core 0009: revoke function EXECUTE globally

What and why: Postgres keeps default privileges at two levels: global, and per schema on top. A per-schema rule can only add; it can't take back a global grant. The built-in global default lets PUBLIC (every role) execute every new function, so 0008's IN SCHEMA public revoke left new functions executable. Nothing noticed until Synergy created the first function after 0008.

Shell
pnpm db:generate --filter=@sidekick/core -- --custom --name=revoke_function_execute_from_public
SQL
-- 0008 revoked EXECUTE on future functions with ALTER DEFAULT PRIVILEGES ... IN SCHEMA
-- public, but a per-schema default can only add to the global defaults, never take away
-- from them. The global default lets PUBLIC (every role, anon and authenticated included)
-- execute every new function, so functions created after 0008 were still executable
-- through the Data API. Revoke it globally for the role that runs migrations: functions
-- postgres creates from now on, in any schema, are executable only by roles granted
-- EXECUTE explicitly. Triggers don't need EXECUTE to fire, so trigger functions still work.
ALTER DEFAULT PRIVILEGES FOR ROLE postgres
  REVOKE EXECUTE ON FUNCTIONS FROM PUBLIC;

Step 2's ordering makes a core fix enough: core's 0009 always runs before Synergy's 0000. pnpm test:integration is green again.

Step 5 — Shared test helpers in @sidekick/test-utils

5a — The package

packages/test-utils/package.json:

JSON
{
   "name": "@sidekick/test-utils",
   "private": true,
   "license": "MIT",
   "version": "0.0.0",
   "type": "module",
   "exports": {
      "./db": "./src/db.ts",
      "./http": "./src/http.ts"
   },
   "scripts": {
      "lint": "eslint .",
      "typecheck": "tsc -p tsconfig.json --noEmit"
   },
   "dependencies": {
      "postgres": "^4.0.0"
   },
   "devDependencies": {
      "@types/node": "^24.19.2"
   }
}

packages/test-utils/tsconfig.json extends ../../tsconfig.base.json with "types": ["node"] and "include": ["src"].

Shell
mkdir -p packages/test-utils/src
git mv packages/foundation/core/tests/helpers/db.ts packages/test-utils/src/db.ts
git mv packages/foundation/core/tests/helpers/http.ts packages/test-utils/src/http.ts
pnpm -C packages/foundation/core add -D '@sidekick/test-utils@workspace:*'

In db.ts, the comments and the error point at pnpm test:integration instead of the old script path. Core's imports of ../helpers/db and ../helpers/http (and ../../tests/helpers/http in src/api/*.test.ts) become @sidekick/test-utils/db and @sidekick/test-utils/http. mocks.ts stays in core.

Typecheck, tests and integration tests pass; pnpm lint fails: boundaries doesn't know packages/test-utils.

5b — Lint

In eslint.config.js, a new element and one policy:

JavaScript
{ type: 'test-utils', pattern: 'packages/test-utils' },
JavaScript
// Shared test helpers (D261, Synergy lesson 2): any layer's tests may import
// @sidekick/test-utils. Packages list it as a devDependency, so
// import-x/no-extraneous-dependencies keeps it out of product code.
// test-utils itself imports no workspace package.
{
   from: {
      element: {
         type: ['app', 'registry', 'feature', 'platform', 'foundation'],
      },
   },
   allow: { to: { element: { type: 'test-utils' } } },
},

Boundaries can't tell a test file from product code; the existing devDependency rule can, because it lets only test and config files import devDependencies. Add test-utils to Synergy too (pnpm -C packages/platform/synergy add -D '@sidekick/test-utils@workspace:*'), then prove both limits:

  1. import '@sidekick/test-utils/http'; in packages/platform/synergy/src/index.ts fails import-x/no-extraneous-dependencies ("should be listed in the project's dependencies, not devDependencies").
  2. import '@sidekick/core'; in packages/test-utils/src/db.ts fails boundaries/dependencies (no policy from test-utils to foundation) and the extraneous-dependency rule. The editor also shows TypeScript's "Cannot find module": pnpm only links a workspace package that is declared.

Remove both; pnpm lint is green.

Step 6 — Prove it

6a — Synergy's integration test

packages/platform/synergy/tests/integration/restore-aware-trigger.test.ts checks that the function exists, then binds it to a probe table (public.synergy_trigger_probe, created in beforeAll and dropped in afterAll through createTestAdminDb()) and proves three things in order: updating a live row passes, updating a deleted row that stays deleted is refused with "Cannot update a soft-deleted row", and restoring the deleted row passes. Synergy gets "test:integration": "vitest run tests/integration" and "tests" in its tsconfig include.

Shell
pnpm test:integration

Core 17 and Synergy 4 pass against one database. Break it: remove AND NEW.deleted_at IS NOT NULL from the migration, and "allows restoring a deleted row" fails. Editing an unapplied migration is fine because the test database is rebuilt on every run; once dev applies it, it is frozen.

6b — Dev

In the Supabase SQL editor, check SELECT count(*) FROM drizzle.__drizzle_migrations; (9), then rename it:

SQL
ALTER TABLE drizzle.__drizzle_migrations RENAME TO __drizzle_migrations_core;
Shell
pnpm db:migrate

Core applies only 0009, Synergy only its 0000. Check:

SQL
SELECT (SELECT count(*) FROM drizzle.__drizzle_migrations_core)    AS core,
       (SELECT count(*) FROM drizzle.__drizzle_migrations_synergy) AS synergy,
       has_function_privilege('anon', 'synergy_block_update_on_deleted()', 'EXECUTE') AS anon_can_execute;

10 | 1 | false. A second pnpm db:migrate applies nothing: Turbo still prints "cache bypass" (the task is never cached, since only the database knows what's pending), drizzle's CREATE ... IF NOT EXISTS notices show it found both tables, and its "migrations applied successfully" is printed even when nothing was applied.

Exit check: pnpm turbo run lint typecheck test --force, pnpm test:integration, pnpm prettier:check, dev migrated, CI green on sidekick#53.

Arkive

Index

Notes, decisions, and progress on my journey as I build Project Sidekick — built in the open; written as it happens.

Tags (145)

View

244 entries.

As ofTitleKind
2026-11-11Synergy Lesson 0 Walkthrough: One Repobuild walkthrough phase-3 monorepo one-repo git cloudflareguidance
2026-11-11Synergy Lesson 1 Walkthrough: Layer Folders and Lintbuild walkthrough phase-3 monorepo eslintguidance
2026-11-11Synergy Lesson 2 Walkthrough: Per-Package MigrationsReadingbuild walkthrough phase-3 database drizzle testingguidance
2026-11-11Hosting and Domainssystem-design deployment vercel cloudflare domainspec
2026-11-11Synergy Lesson 0: One Repoplan phase-3 task monorepo one-repo git cloudflareplan
2026-11-11Decisions Logdecisionlog
2026-11-11Synergy Checkpoint 3a: Prove the Store, Plan 3bplan phase-3 checkpoint guidanceplan
2026-11-11Synergy Lesson 1: Layer Folders and Lintplan phase-3 task monorepo eslintplan
2026-11-11Synergy Lesson 2: Per-Package Migrationsplan phase-3 task database drizzle testingplan
2026-11-11Synergy Lesson 3: Entity Index and Version Logplan phase-3 task synergy database rls postgresqlplan
2026-11-11Lexicon Highlightingsystem-design synergy taxilaspec
2026-11-11Synergy: System Designsystem-design synergyspec
2026-11-11Testing Layerssystem-design testing vitest playwrightspec
2026-11-11Synergy - Feature Specificationsprd spec synergyprd
2026-11-11Gatekeeper Walkthroughbuild walkthrough phase-2 api-guard feature-system rls authenticationguidance
2026-11-11Best Practice Rulessystem-design code-quality-check eslintspec
2026-11-11Agent Guideai-coding agent gateway agent-guidance rls supabase drizzle api react prettierguidance
2026-11-11Backlogged / Unplannedplan living-plan backlog feature-system taxila zinsser alter-ego parrot rls supabaseplan
2026-11-11Centralized Copysystem-design contentspec
2026-11-11Commands and Environmentai-coding command environment agent-guidance prettier pnpm cliguidance
2026-11-11Database and Securityai-coding database security agent-guidance api-guard rls drizzle api react repository-patternguidance
2026-11-11Dependency Flowsystem-design monorepo clispec
2026-11-11ESLint Plugin Boundariessystem-design code-quality-check eslintspec
2026-11-11Front Door: Row-Level Security Walkthroughplan phase-1.1 rls database supabase drizzle postgresql api typescriptguidance
2026-11-11Installation at Workspace Levelsystem-design code-quality-check typescript pnpmspec
2026-11-11Migrationsystem-design database drizzle pnpmspec
2026-11-11Prettier at Repo Levelsystem-design code-quality-check prettierspec
2026-11-11Shared tsconfigsystem-design code-quality-check typescriptspec
2026-11-11Synergyplan living-plan phase-3 synergy rls postgresql api graphplan
2026-11-09Notesai-coding-harness agent-guidance nextjs eslint pnpm cssguidance
2026-11-08Synergy Lesson 4: Sandbox Providers and the First Routesplan phase-3 task synergy feature-system apiplan
2026-11-08Violations and Exceptionssystem-design synergyspec
2026-11-08Front Door: Hardening Walkthroughbuild walkthrough pre-2 rls supabase drizzle postgresql testing eslintguidance
2026-11-08Alter Egoplan living-plan phase-6 taxila zinsser alter-ego war-room factory core-driveplan
2026-11-08API Versioningsystem-design apispec
2026-11-08Approve Buildssystem-design monorepo nextjs pnpmspec
2026-11-08Best Practicesai-coding-harness agent-guidance drizzle api react pnpm css offline embedding soft-deleteguidance
2026-11-08dotenv CLIsystem-design config clispec
2026-11-08Pocketplan living-plan phase-8 taxila alter-ego nextjs vercel pwa mobileplan
2026-11-08Server Actionssystem-design nextjs rls api authenticationspec
2026-11-08Taxilaplan living-plan phase-4 taxila api-guard rls drizzle api authenticationplan
2026-11-08War Roomplan living-plan phase-7 war-room factory core-drive rls api offlineplan
2026-11-08With API Guardsystem-design security api-guard rls api authentication typescriptspec
2026-11-08Zinsserplan living-plan phase-5 taxila zinsser api mantine ai embeddingplan
2026-11-06Design Tokenssystem-design css design-systemspec
2026-11-06Native UIsystem-design css design-system mantinespec
2026-11-06Public Site: System Designsystem-design site one-repospec
2026-11-06Internationalizationsystem-design content i18nspec
2026-11-06CSS Modulessystem-design css eslint stylelintspec
2026-11-06Non-Syncable Tablessystem-design database offlinespec
2026-11-06Runtime Validationssystem-design typescriptspec
2026-11-06Syncable Tablessystem-design database offline soft-deletespec
2026-11-06Technology Stacksystem-design supabase drizzle postgresql nextjs typescript turborepo pnpm vercelspec
2026-11-06Architectural OverviewSidekick's architectural overview — an API-first platform tuned for solo developerssidekick project technical architecturedocument
2026-11-05One Repoprd feature synergy one-repoprd
2026-11-05Overview of Synergyprd feature synergyprd
2026-11-01Synergy Lesson 10: Save Call, Anchorsplan phase-3 task synergy apiplan
2026-11-01Synergy Lesson 11: Delete and Restoreplan phase-3 task synergy databaseplan
2026-11-01Synergy Lesson 12: Tagsplan phase-3 task synergy apiplan
2026-11-01Synergy Lesson 13: Race Testsplan phase-3 task synergy testing postgresqlplan
2026-11-01Synergy Lesson 5: Outbox, Status and Versionsplan phase-3 task synergy database postgresqlplan
2026-11-01Synergy Lesson 6: Links, Relation Types and Cyclesplan phase-3 task synergy graph postgresql apiplan
2026-11-01Synergy Lesson 7: Staleness Dots and the Roll-Upplan phase-3 task synergy apiplan
2026-11-01Synergy Lesson 8: Lists and Supersedeplan phase-3 task synergy graph postgresqlplan
2026-11-01Synergy Lesson 9: Save Call, Mentionsplan phase-3 task synergy apiplan
2026-11-01Content Sequencesystem-design synergyspec
2026-11-01Tombstone Visibilitysystem-design synergy rlsspec
2026-11-01Anchors in Contentsystem-design synergy anchorsspec
2026-11-01Capture External Contentsystem-design synergy taxilaspec
2026-11-01Mentions and Link Lifetimesystem-design synergyspec
2026-11-01Synergy Store Choicessystem-design synergy postgresqlspec
2026-11-01Relationshipsprd feature synergyprd
2026-11-01Scope and Phasesprd feature synergyprd
2026-11-01Stay on ESLint, Revisit Oxlintsystem-design eslint typescriptspec
2026-11-01App Runtime for Drizzlesystem-design database drizzle postgresqlspec
2026-11-01Corepacksystem-design monorepo pnpmspec
2026-11-01Edge Runtimesystem-design security supabasespec
2026-11-01Env Vars in Turbo JSONsystem-design monorepo turborepo vercelspec
2026-11-01Flat Configsystem-design code-quality-check eslintspec
2026-11-01Force Dynamicsystem-design nextjs supabasespec
2026-11-01GraphQL and Relaysystem-design api graphql relayspec
2026-11-01Living Implementation Planplan living-plan taxila zinsser alter-ego war-room factory parrot core-driveplan
2026-11-01Module Resolution: Bundlersystem-design code-quality-check typescriptspec
2026-11-01Profile Creation Postgres Triggersystem-design security postgresql api authenticationspec
2026-11-01Public API Onlysystem-design api rls authentication clispec
2026-11-01tsupsystem-design code-quality-check eslintspec
2026-11-01Turboreposystem-design monorepo turborepo pnpmspec
2026-10-31Build mind palaceprd value-proposition specificationprd
2026-10-31Exponential Evolutionprd value-proposition specificationprd
2026-10-31Remember everythingprd value-proposition specificationprd
2026-10-31Entities and the Entity Indexprd feature synergyprd
2026-10-31Foundationsprd feature synergyprd
2026-10-31Keeping Links Trueprd feature synergyprd
2026-10-31Sneak Peek Linkprd feature synergyprd
2026-10-30Search and Backlinksprd feature synergyprd
2026-10-30Tagsprd feature synergyprd
2026-10-29Cost to Add Laterprinciple product engineeringguidance
2026-10-27Individual Firstprinciple productguidance
2026-10-27One Interfaceprinciple api cliguidance
2026-10-24Gatekeeper Lesson 7 Walkthrough: The Ops Package and Entitlements Grantbuild walkthrough phase-2 feature-system database postgresql cliguidance
2026-10-24Gatekeeper Lesson 8: Close-Outplan phase-2 task guidanceplan
2026-10-24Gatekeeper Lesson 3 Walkthrough: Entitlementsbuild walkthrough phase-2 feature-system database drizzle rls postgresql testingguidance
2026-10-24Gatekeeper Lesson 4 Walkthrough: withApiGuardbuild walkthrough phase-2 api-guard rls api authentication testingguidance
2026-10-24Gatekeeper Lesson 5 Walkthrough: Request and Auth-Failure Loggingbuild walkthrough phase-2 api-guard observability eslint testingguidance
2026-10-24Gatekeeper Lesson 6 Walkthrough: /api/health and Guard Verificationbuild walkthrough phase-2 api-guard api nextjs testingguidance
2026-10-24Gatekeeper Lesson 2 Walkthrough: resolveApiCallerbuild walkthrough phase-2 api-guard authentication supabase testingguidance
2026-10-24Gatekeeper Build Rules and Target Designplan phase-2 api-guard rls api authentication typescript guidanceplan
2026-10-24Gatekeeper Lesson 1 Walkthrough: Feature Registrybuild walkthrough phase-2 feature-system typescript monorepo testingguidance
2026-10-24Gatekeeper Lesson 7 (Task 2.10): Dev Entitlement Seed Scriptplan phase-2 task feature-system database postgresqlplan
2026-10-24Gatekeeperplan living-plan phase-2 api-guard rls api authentication feature-systemplan
2026-10-24Terminalplan living-plan phase-9 taxila api-guard rls api authentication cliplan
2026-10-23Gatekeeper Lesson 3 (Tasks 2.8, 2.9): Entitlements Table and getEnabledFeaturesplan phase-2 task feature-system database drizzle rls postgresql testingplan
2026-10-23Gatekeeper Lesson 4 (Tasks 2.2, 2.3): withApiGuard With withRLSplan phase-2 task api-guard rls api security testingplan
2026-10-23Gatekeeper Lesson 5 (Tasks 2.4, 2.5): Request and Auth-Failure Loggingplan phase-2 task api-guard observability eslintplan
2026-10-23Gatekeeper Lesson 6 (Tasks 2.11, 2.12): /api/health and Guard Verificationplan phase-2 task api-guard api nextjs testingplan
2026-10-23Centralizedsystem-design observability api authenticationspec
2026-10-23Error Handlingsystem-design observability api-guard rls supabase api nextjs react aispec
2026-10-23Groundwork Checkpoint B Walkthroughbuild walkthrough phase-0 checkpointguidance
2026-10-20Gatekeeper Lesson 2 (Task 2.1): resolveApiCallerplan phase-2 task api-guard authentication supabase nextjsplan
2026-10-18Gatekeeper Lesson 1 (Tasks 2.6, 2.7): FeatureManifest and ALL_FEATURESplan phase-2 task feature-system typescript monorepoplan
2026-10-18Registrysystem-design feature-systemspec
2026-10-17Core Drive to Be Practical and Grounded in Realitysystem-design feature core-drive prdprd
2026-10-17MVP Scopeprd mvp specification core-drive taxila war-room factory alter-ego zinsser parrot api cli native-appprd
2026-10-17An AI Writing Coach and an Appsystem-design prd feature zinsser aiprd
2026-10-17Overview of Taxilasystem-design prd feature taxila ragprd
2026-10-16Front Door: Hardeningplan pre-2 foundation security database testingplan
2026-10-14Profiles Schemasystem-design security rls authenticationspec
2026-10-14Tag Taxonomyai-coding agent-guidance taxonomy discoveryguidance
2026-10-13Anatomy of a Core Drive Entrysystem-design prd feature core-driveprd
2026-10-13Core Drive Stores Personal and Sensitive Informationsystem-design prd feature core-drive taxila graphprd
2026-10-13Core Drive Stores Values Onlysystem-design prd feature core-drive war-room factoryprd
2026-10-13Core Drive to Foster Reflections and Learningssystem-design prd feature core-driveprd
2026-10-13Groundwork: Checkpointsplan phase-0 api nextjs typescript eslint turborepo pnpmplan
2026-10-13Model Routingprd vercel ai embedding routingprd
2026-10-13Overview of Core Drivesystem-design prd feature core-drive factory ai alter-egoprd
2026-10-13Source Attributionprd feature alter-ego aiprd
2026-10-12Command Paletteprd ux specificationprd
2026-10-12MVP Design Objectiveprd ux specificationprd
2026-10-12Be the Best Version of Yourselfprd value-proposition specificationprd
2026-10-12Make the Right Behavior Easierprd value-proposition specificationprd
2026-10-11Solve Problems and Build Thingsmotivation creativityjournal
2026-10-11A Personal Discoverymotivation discipline bucket-list ambition entrepreneurship sidekickjournal
2026-10-11Commercialize Sidekickmotivation finance freedomjournal
2026-10-10Realityprinciple reality pragmatism survivalguidance
2026-10-10Seek Closureprinciple productivity happiness purposeguidance
2026-10-08No Do-Oversprinciple core-drive execution productivityguidance
2026-10-08Pragmatismprinciple practical pragmaticguidance
2026-10-04Protect Your Mind and Your Timeprinciple productivity automation minimalismguidance
2026-10-03Focus Funnelprinciple core-drive productivityguidance
2026-10-02Fuel Career Growthmotivation career ambitionjournal
2026-10-02Learnmotivation learning ai ragjournal
2026-09-19Actual Stateglossary terminologyglossary
2026-09-19Algorithm of Lifeglossary terminology nextjsglossary
2026-09-19Alter Egosystem-design prd feature taxila alter-ego factory aiprd
2026-09-19API Firstsystem-design api clispec
2026-09-19Architectural Driverssystem-design offlinespec
2026-09-19Architecture Invariantsai-coding architecture invariant agent-guidance api nextjsguidance
2026-09-19Asynchronoussystem-design rag embeddingspec
2026-09-19Atomicsystem-design rag embeddingspec
2026-09-19Authenticationsystem-design security taxila api authentication pwa mobile clispec
2026-09-19Background Jobssystem-design vercel background-jobspec
2026-09-19Build for Today, Designed for Futuresystem-design offlinespec
2026-09-19Bundle Everythingsystem-design monorepospec
2026-09-19Capacitorsystem-design native-app nextjs mobile offlinespec
2026-09-19Centralizedsystem-design feature-systemspec
2026-09-19Centralized and Client-Agnosticsystem-design security rls api authentication clispec
2026-09-19CLIsystem-design cli apispec
2026-09-19Context Assemblersystem-design ai war-room factory api-guardspec
2026-09-19Coresystem-design feature-systemspec
2026-09-19Core Drive and Taxilasystem-design prd feature taxila core-driveprd
2026-09-19Driving Forces and Key Featuressystem-design api offlinespec
2026-09-19Embedding Status Fieldsystem-design rag embedding typescriptspec
2026-09-19Enforced Conventionssystem-designspec
2026-09-19Essential and Ideal Stateglossary terminologyglossary
2026-09-19Evolvabilitysystem-design rls offlinespec
2026-09-19Factorysystem-design prd feature factoryprd
2026-09-19Feature Package Workai-coding feature monorepo agent-guidance feature-systemguidance
2026-09-19Front Doorplan living-plan phase-1 api-guard rls supabase drizzle postgresql apiplan
2026-09-19Front Door Task 1.1plan phase-1 task supabase postgresql api authentication nextjsplan
2026-09-19Front Door Task 1.10plan phase-1 task rls supabase drizzle postgresql authentication typescriptplan
2026-09-19Front Door Task 1.11plan phase-1 task api-guard rls supabase api authentication nextjsplan
2026-09-19Front Door Task 1.14plan phase-1 task react pnpm mantine cssplan
2026-09-19Front Door Task 1.17plan phase-1 task supabase authenticationplan
2026-09-19Front Door Task 1.18plan phase-1 task api-guard rls supabase drizzle postgresql authenticationplan
2026-09-19Front Door Task 1.2plan phase-1 task supabase drizzle postgresql authentication nextjs pnpmplan
2026-09-19Front Door Task 1.3plan phase-1 task supabase nextjs typescriptplan
2026-09-19Front Door Task 1.4plan phase-1 task supabase authentication nextjs react typescriptplan
2026-09-19Front Door Task 1.5plan phase-1 task rls supabase authentication typescriptplan
2026-09-19Front Door Task 1.6plan phase-1 task rls supabase drizzle authentication typescript offlineplan
2026-09-19Front Door Task 1.7plan phase-1 task drizzle postgresql typescriptplan
2026-09-19Front Door Task 1.8plan phase-1 task turborepo pnpmplan
2026-09-19Front Door Task 1.9plan phase-1 task rls supabase drizzle postgresql authenticationplan
2026-09-19Front Door Tasks 1.12 and 1.13plan phase-1 task supabase api authentication nextjs react typescriptplan
2026-09-19Front Door Tasks 1.15 and 1.16plan phase-1 task supabase authentication nextjs react mantineplan
2026-09-19Front Door: Original Planplan phase-1 rls supabase drizzle postgresql authentication nextjsguidance
2026-09-19Front Door: Row-Level Securityplan living-plan phase-1.1 rls supabase drizzle postgresql pnpm soft-deleteplan
2026-09-19Groundworkplan living-plan phase-0 nextjs typescript eslint prettier turborepo pnpmplan
2026-09-19Groundwork Checkpoint Aplan phase-0 checkpoint nextjs typescript turborepo pnpm cliplan
2026-09-19Groundwork Checkpoint Bplan phase-0 checkpoint eslint prettier turborepo pnpmplan
2026-09-19Groundwork Checkpoint Cplan phase-0 checkpoint nextjs pnpmplan
2026-09-19Groundwork Checkpoint Dplan phase-0 checkpoint api-guard rls supabase drizzle api authenticationplan
2026-09-19Historic Stateglossary terminologyglossary
2026-09-19Idempotent APIsystem-design api idempotencyspec
2026-09-19Independent Deploymentssystem-design feature-systemspec
2026-09-19Informationglossary terminologyglossary
2026-09-19Instrumentationsystem-design observability vercel embeddingspec
2026-09-19Isolationsystem-design feature-systemspec
2026-09-19Lifecycle and Traceabilityprd governance planningguidance
2026-09-19Many Clients and Many Consumerssystem-design api pwa ai rag clispec
2026-09-19May Become Part of Taxilasystem-design core-drive taxilaspec
2026-09-19Middlewaresystem-design security api authenticationspec
2026-09-19Model Router Contractsystem-design ai model-routing provider-agnostic embeddingspec
2026-09-19Never Mutate Outside API Layersystem-design apispec
2026-09-19Observabilitysystem-design api-guard api authentication vercel observabilityspec
2026-09-19Observablesystem-design rag embedding observabilityspec
2026-09-19Offline Readysystem-design api pwa offline soft-delete idempotencyspec
2026-09-19Open Houseplan living-plan phase-11plan
2026-09-19Parrotsystem-design prd feature parrotprd
2026-09-19Prefer JSON Configsystem-design monorepospec
2026-09-19Present Stateglossary terminologyglossary
2026-09-19Productivity Modulesystem-design prd feature war-roomprd
2026-09-19PWAsystem-design pwa offlinespec
2026-09-19RAGsystem-design rag ai embeddingspec
2026-09-19Repository Clientsystem-design database rls supabase drizzle api repository-patternspec
2026-09-19Request Flowsystem-design monorepo api offlinespec
2026-09-19Retryablesystem-design rag embeddingspec
2026-09-19Row-Level Securitysystem-design security rls drizzle offlinespec
2026-09-19Soft-Delete Supportsystem-design database soft-deletespec
2026-09-19Start Todayprinciple core-drive execution consistencyguidance
2026-09-19State Representationsystem-design api aispec
2026-09-19Storefrontplan living-plan phase-12 api offlineplan
2026-09-19Structured Response Attributionsystem-design ai structured-streaming source-attribution citationspec
2026-09-19System Overview Diagramsystem-designspec
2026-09-19Tiered Context Modelsystem-design core-drive domain situation war-room factory ai embeddingspec
2026-09-19Tiptap Requirementsystem-design rag embeddingspec
2026-09-19Use Navigation Hooksystem-design nextjsspec
2026-09-19Watchtowerplan living-plan phase-10 api-guard rls api authentication nextjs offlineplan
2026-07-19Project Sidekick - A Bird’s Eye ViewAn introduction to Project Sidekick. What is it? What problem does it solve? Why am I building it?sidekick project essaydocument
2026-07-10Building in the Margins of RealityProject kick-off post and a confessional essay about my past attempts and their failures. Why start now? What do I hope to achieve?sidekick project essayjournal
2026-05-29Config Files Explainedbuild walkthrough phase-0 turborepo typescript eslint prettierguidance
2026-05-29Front Door: Original Walkthroughbuild walkthrough phase-1 supabase drizzle authenticationguidance
2026-05-29Groundwork Checkpoint A Walkthroughbuild walkthrough phase-0 checkpointguidance
2026-05-29Groundwork Checkpoint C Walkthroughbuild walkthrough phase-0 checkpointguidance
2026-05-29Groundwork Checkpoint D Walkthroughbuild walkthrough phase-0 checkpointguidance