TypeScript starter infrastructure for human + AI agent co-development.
pkstack is a published starter kit and monorepo that gives you:
npm create pkstackfor a web app scaffoldnpm create pkstack --mobilefor an Expo scaffold- published
@pkstack/*runtime packages shared across templates @pkstack/configfor strict TypeScript, ESLint, and Tailwind defaults- gstack-oriented
AGENTS.mdandCLAUDE.mdconventions from day one
npm create pkstack my-app
npm create pkstack my-mobile-app --mobilepkstack is at v0.2.3.
create-pkstack,@pkstack/config, and the Stage 2@pkstack/*runtime packages are published on the same semver line.- The web template, mobile template, CLI, reference apps, and package extraction work are done.
- The docs site is live through Mintlify at
pkstack.preetham.org. - Contributor validation includes
npm run smoke(CI-parity without Playwright); seeCONTRIBUTING.mdandCHANGELOG.md.
- Next.js 15 App Router
- TypeScript 5 strict mode with
noUncheckedIndexedAccess - Tailwind v4
- Drizzle ORM
- Better Auth
- tRPC v11
- Vercel AI SDK helpers
- optional Stripe and Resend scaffold outputs
- generated
.env.exampleand.env.local AGENTS.mdandCLAUDE.mdalready present
- Expo
- TypeScript strict mode
- shared
@pkstack/apicontracts - shared
@pkstack/aihelpers
@pkstack/ui@pkstack/db@pkstack/auth@pkstack/ai@pkstack/api@pkstack/config
There are four layers:
- Published packages
packages/ui,db,auth,ai,api, andconfighold reusable runtime and tooling code. - Source-of-truth templates
templates/webandtemplates/mobileare the canonical scaffold outputs. - CLI
packages/clicopies a template, applies conditional choices, writes env files, and installs gstack. - Generated app
The user gets a new app that consumes published
@pkstack/*packages instead of copying core runtime code inline.
That means:
- package-owned code lives in
packages/* - app-owned wiring lives in the templates
- scaffold-time branching lives in
packages/cli/src/scaffold.ts - reference examples live in
apps/*
pkstack/
├── packages/
│ ├── cli/ # create-pkstack binary
│ ├── config/ # shared tsconfig/eslint/tailwind + lint rules
│ ├── ui/ # shared React UI primitives
│ ├── db/ # Drizzle and Postgres helpers
│ ├── auth/ # Better Auth schema + helper wiring
│ ├── ai/ # AI SDK wrappers and helper utilities
│ └── api/ # plain TS/zod shared contracts
├── templates/
│ ├── web/ # source-of-truth Next.js scaffold
│ └── mobile/ # source-of-truth Expo scaffold
├── apps/
│ ├── mobile/ # in-repo Expo reference app
│ └── docs/ # Mintlify content for the docs site
└── .github/workflows/ # CI + npm publish flow
npm create pkstack my-app
cd my-app
npm install
docker compose up -d
$EDITOR .env.local
npm run db:migrate
npm run devnpm create pkstack my-mobile-app --mobile
cd my-mobile-app
npm install
npm run startmy-app/
├── src/
│ ├── app/ # Next.js routes
│ ├── db/ # app schema + auth schema re-export + db wiring
│ ├── lib/ # auth/ai/email wiring
│ └── server/api/ # app-owned tRPC implementation
├── scripts/check-env.ts # required env validation
├── docker-compose.yml
├── AGENTS.md
└── CLAUDE.md
The generated app is not a monorepo. It is a single app that depends on published pkstack packages.
npm install
npm run build
npm run lint
npm run typecheck
npm test
npm run smokenpm run smoke mirrors the important CI checks (CLI, runtime packages, web template next build, mobile template typecheck) without Playwright. Use npm run test:e2e or npm run test:all only when you explicitly want browser-based scaffold tests.
npm run build -w packages/cli
PKSTACK_LOCAL_WORKSPACE=1 node packages/cli/dist/index.js test-app
PKSTACK_LOCAL_WORKSPACE=1 node packages/cli/dist/index.js test-mobile --mobilePKSTACK_LOCAL_WORKSPACE=1 is important when testing unpublished local package changes. It rewrites @pkstack/* dependencies in the generated app to local file: paths.
- edit
templates/webortemplates/mobileif the generated files should change - edit
packages/cli/src/scaffold.tsif behavior is conditional - edit
packages/*if shared runtime ownership changes - rebuild the CLI
- scaffold a fresh app and verify it there
Do not treat packages/cli/templates/* as source of truth. Those are bundled copies produced by the CLI build.
pkstack is designed so AI coding tools can work with the project instead of fighting it.
- every package, template, and app has an
AGENTS.md - generated apps ship with
AGENTS.mdandCLAUDE.md - shared UI components export typed
*Variantscontracts - the repo keeps ownership boundaries explicit so agents know where code belongs
The docs content lives in apps/docs.
Current status:
- local Mint preview works
- package publishing is done
- public docs deployment is live at
pkstack.preetham.org
Target:
- host the docs through Mintlify
- use
pkstack.preetham.orgas the initial custom domain
- AGENTS.md
- CLAUDE.md
- CONTRIBUTING.md
- CHANGELOG.md
- prompts/feature-polish-handoff.md — active handoff for polish / QoL work
- prompts/stage-2-handoff.md — earlier docs / release-validation context (through v0.2.2)