···13361336 )
13371337 }
1338133813391339+ writeFileSync(
13401340+ join(dir, 'AGENTS.md'),
13411341+ `# hatk project
13421342+13431343+This is an AT Protocol application built with [hatk](https://github.com/hatk-dev/hatk).
13441344+Read the project's lexicons in \`lexicons/\` to understand the data model.
13451345+Types are generated from lexicons into \`hatk.generated.ts\` — never edit this file directly.
13461346+13471347+## Project structure
13481348+13491349+| Directory | Purpose |
13501350+|-------------|------------------------------------------------------|
13511351+| \`lexicons/\` | AT Protocol lexicon schemas (JSON). Defines collections and XRPC methods |
13521352+| \`feeds/\` | Feed generators — each file exports a feed via \`defineFeed\` |
13531353+| \`xrpc/\` | XRPC method handlers — directory nesting maps to NSID segments |
13541354+| \`labels/\` | Label definitions and rules for moderation |
13551355+| \`setup/\` | Boot-time scripts (run before server starts). Prefix with numbers for ordering |
13561356+| \`seeds/\` | Test data seeding scripts for local development |
13571357+| \`hooks/\` | Lifecycle hooks (e.g. \`on-login.ts\`) |
13581358+| \`og/\` | OpenGraph image routes |
13591359+| \`jobs/\` | Periodic background tasks |
13601360+| \`test/\` | Test files (vitest). Run with \`hatk test\` |
13611361+| \`public/\` | Static files served at the root |
13621362+13631363+## Key files
13641364+13651365+- \`hatk.config.ts\` — project configuration (see \`defineConfig\` for type info)
13661366+- \`hatk.generated.ts\` — auto-generated types and typed helpers. Regenerate with \`hatk generate types\`
13671367+13681368+## Commands
13691369+13701370+Run \`npx hatk --help\` for the full list of commands.
13711371+13721372+Use \`npx hatk generate\` to scaffold new feeds, xrpc handlers, labels, and lexicons
13731373+rather than creating files manually. These generate files with the correct imports
13741374+from \`hatk.generated.ts\`.
13751375+13761376+After modifying lexicons, always run \`npx hatk generate types\` to update the generated types.
13771377+`,
13781378+ )
13791379+13391380 console.log(`Created ${name}/`)
13401381 console.log(` hatk.config.ts`)
13411382 console.log(` lexicons/ — lexicon JSON files (core + your own)`)