Add template-driven AGENTS guidance - #286
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
WalkthroughRestructures DDL layout to per-schema files at Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes
Possibly related PRs
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (5)
packages/ztd-cli/templates/AGENTS_ZTD.md (1)
9-9: Minor wording nit: “outside of” → “outside” (optional)Purely stylistic, but you could tighten this sentence to “re‑derive schema metadata outside
tests/ztd-row-map.generated.ts” if you want slightly crisper wording; behavior and guidance are already clear either way.packages/ztd-cli/README.md (1)
43-47: Clarifyddl pulloutput location vs. layoutThe description correctly reflects the “one file per schema under
sql/ddl/<schema>.sql” convention and the removal of theschemas/subdir. You might optionally mention that when--outis used, the same<schema>.sqllayout is applied under the chosen directory, not justsql/ddl/.packages/ztd-cli/templates/sql/ddl/AGENTS.md (1)
1-6: DDL AGENTS template is concise and aligned with ZTD guidanceThe template correctly positions
sql/ddlas the single source of truth for table structures and directs both humans and AI to this directory. You could optionally call out the per‑schema<schema>.sqlpattern explicitly to mirror the README wording, but it’s already serviceable as-is.packages/ztd-cli/src/commands/init.ts (2)
136-154: AGENTS templates for SQL folders now loaded from shared bundleAdding
templateNametoSQL_FOLDER_AGENT_TARGETSand pointing it atsql/ddl/AGENTS.md,sql/enums/AGENTS.md, andsql/domain-specs/AGENTS.mdleverages the shared template directory and removes inline markdown duplication. This centralizes guidance nicely.
188-206: Schema file path in init now derived from DEFAULT_ZTD_CONFIGUsing
schemaFileName = \${DEFAULT_ZTD_CONFIG.ddl.defaultSchema}.sql`and wiringabsolutePaths.schematoDEFAULT_ZTD_CONFIG.ddlDirensures init writes/pulls into the same.sqlfile the rest of the tooling expects. As a future enhancement, you might consider reading an existingztd.config.json(if present) to respect customddlDir/defaultSchemaon re‑runs ofztd init`, but the current behavior is correct for first‑run scaffolding.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
packages/ztd-cli/tests/__snapshots__/init.command.test.ts.snapis excluded by!**/*.snap
📒 Files selected for processing (16)
packages/drivers/pg-testkit/README.md(1 hunks)packages/ztd-cli/AGENTS_ZTD.md(1 hunks)packages/ztd-cli/README.md(3 hunks)packages/ztd-cli/src/commands/init.ts(3 hunks)packages/ztd-cli/src/commands/pull.ts(1 hunks)packages/ztd-cli/src/utils/agents.ts(1 hunks)packages/ztd-cli/templates/AGENTS_ZTD.md(1 hunks)packages/ztd-cli/templates/README.md(1 hunks)packages/ztd-cli/templates/sql/ddl/AGENTS.md(1 hunks)packages/ztd-cli/templates/sql/domain-specs/AGENTS.md(1 hunks)packages/ztd-cli/templates/sql/enums/AGENTS.md(1 hunks)packages/ztd-cli/tests/cliCommands.test.ts(2 hunks)packages/ztd-cli/tests/init.command.test.ts(4 hunks)playgrounds/ztd-playground/AGENTS.md(1 hunks)playgrounds/ztd-playground/README.md(3 hunks)playgrounds/ztd-playground/sql/ddl/AGENTS.md(1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (AGENTS.md)
Remove console debugging before committing.
Files:
packages/ztd-cli/tests/cliCommands.test.tspackages/ztd-cli/src/commands/pull.tspackages/ztd-cli/src/utils/agents.tspackages/ztd-cli/tests/init.command.test.tspackages/ztd-cli/src/commands/init.ts
**/src/**/*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
**/src/**/*.{ts,tsx}: All exported classes, functions, and types insrc/are considered part of the public API and must have clear English JSDoc attached to their declaration.
When adding a new exported symbol insrc/(class, function, type, interface, enum, etc.), always add English JSDoc in the same commit that briefly explains the role of the API and how to consume it.
When modifying an exported symbol, update the existing docstring to keep it truthful and never delete a docstring merely to keep the diff small.
If a helper is not meant to be public, make it non-exported or add@internalto its docstring rather than leaving an undocumented export.
Files:
packages/ztd-cli/src/commands/pull.tspackages/ztd-cli/src/utils/agents.tspackages/ztd-cli/src/commands/init.ts
🧠 Learnings (51)
📓 Common learnings
Learnt from: CR
Repo: mk3008/rawsql-ts PR: 0
File: playgrounds/ztd-playground/sql/ddl/AGENTS.md:0-0
Timestamp: 2025-12-09T12:47:40.447Z
Learning: Applies to playgrounds/ztd-playground/sql/ddl/sql/ddl/schemas/*.sql : Store table structure definitions (CREATE TABLE, ALTER TABLE, indexes, constraints) in `sql/ddl/schemas/*.sql`
Learnt from: CR
Repo: mk3008/rawsql-ts PR: 0
File: playgrounds/ztd-playground/sql/ddl/AGENTS.md:0-0
Timestamp: 2025-12-09T12:47:40.447Z
Learning: Applies to playgrounds/ztd-playground/sql/ddl/sql/ddl/schemas/**/*.sql : Treat SQL files in `sql/ddl/schemas/` as the single source of truth for database schemas
Learnt from: CR
Repo: mk3008/rawsql-ts PR: 0
File: packages/drivers/pg-testkit/AGENTS.md:0-0
Timestamp: 2025-12-09T12:47:23.688Z
Learning: Treat `tests/ztd-row-map.generated.ts` and `sql/ddl/` (or legacy `ddl/`) directory as canonical schema and row map; load fixtures from them rather than reverse-engineering the database structure
Learnt from: CR
Repo: mk3008/rawsql-ts PR: 0
File: playgrounds/ztd-playground/AGENTS.md:0-0
Timestamp: 2025-12-09T12:47:35.496Z
Learning: Applies to playgrounds/ztd-playground/sql/**/*.sql : Keep every table definition inside `sql/ddl/schemas/*.sql`, enums under `sql/enums/*.sql`, and executable specs inside `sql/domain-specs/*.sql`.
Learnt from: CR
Repo: mk3008/rawsql-ts PR: 0
File: playgrounds/ztd-playground/sql/ddl/AGENTS.md:0-0
Timestamp: 2025-12-09T12:47:40.447Z
Learning: Reference the `sql/ddl/schemas/` directory when modifying or understanding table structures
Learnt from: CR
Repo: mk3008/rawsql-ts PR: 0
File: packages/drivers/pg-testkit/AGENTS.md:0-0
Timestamp: 2025-12-09T12:47:23.688Z
Learning: Applies to packages/drivers/pg-testkit/sql/ddl/**/*.sql : Use DDL files only for canonical schema information and true shared baseline data; do not put per-test seeds inside schema files in pg-testkit
Learnt from: CR
Repo: mk3008/rawsql-ts PR: 0
File: packages/drivers/pg-testkit/AGENTS.md:0-0
Timestamp: 2025-12-09T12:47:23.688Z
Learning: Applies to packages/drivers/pg-testkit/**/{src,lib}/**/*.{ts,tsx,js} : Parse DDL files once per client/pool instance in pg-testkit to produce fixture schema and baseline fixture rows deterministically
Learnt from: CR
Repo: mk3008/rawsql-ts PR: 0
File: playgrounds/ztd-playground/AGENTS.md:0-0
Timestamp: 2025-12-09T12:47:35.496Z
Learning: Only include DDL files, minimal SQL examples in `src/`, and ZTD-focused tests under `tests/` in the playground. Avoid adding application logic, persistence layers, or business services.
Learnt from: CR
Repo: mk3008/rawsql-ts PR: 0
File: packages/drivers/pg-testkit/AGENTS.md:0-0
Timestamp: 2025-12-09T12:47:23.688Z
Learning: Applies to packages/drivers/pg-testkit/**/{src,lib}/**/*.{ts,tsx,js} : Load DDL-based fixtures using DDLToFixtureConverter when projects contain `tests/ztd-row-map.generated.ts` and `sql/ddl/` directory
📚 Learning: 2025-12-09T12:47:40.447Z
Learnt from: CR
Repo: mk3008/rawsql-ts PR: 0
File: playgrounds/ztd-playground/sql/ddl/AGENTS.md:0-0
Timestamp: 2025-12-09T12:47:40.447Z
Learning: Applies to playgrounds/ztd-playground/sql/ddl/sql/ddl/schemas/**/*.sql : Treat SQL files in `sql/ddl/schemas/` as the single source of truth for database schemas
Applied to files:
packages/ztd-cli/templates/README.mdpackages/ztd-cli/tests/cliCommands.test.tspackages/ztd-cli/src/commands/pull.tspackages/ztd-cli/templates/sql/ddl/AGENTS.mdplaygrounds/ztd-playground/AGENTS.mdpackages/ztd-cli/tests/init.command.test.tspackages/ztd-cli/src/commands/init.tsplaygrounds/ztd-playground/README.mdplaygrounds/ztd-playground/sql/ddl/AGENTS.mdpackages/ztd-cli/README.md
📚 Learning: 2025-12-09T12:47:40.447Z
Learnt from: CR
Repo: mk3008/rawsql-ts PR: 0
File: playgrounds/ztd-playground/sql/ddl/AGENTS.md:0-0
Timestamp: 2025-12-09T12:47:40.447Z
Learning: Applies to playgrounds/ztd-playground/sql/ddl/sql/ddl/schemas/*.sql : Store table structure definitions (CREATE TABLE, ALTER TABLE, indexes, constraints) in `sql/ddl/schemas/*.sql`
Applied to files:
packages/ztd-cli/templates/README.mdpackages/ztd-cli/src/commands/pull.tspackages/ztd-cli/templates/sql/ddl/AGENTS.mdplaygrounds/ztd-playground/AGENTS.mdpackages/ztd-cli/tests/init.command.test.tspackages/ztd-cli/src/commands/init.tspackages/ztd-cli/templates/sql/enums/AGENTS.mdplaygrounds/ztd-playground/README.mdplaygrounds/ztd-playground/sql/ddl/AGENTS.mdpackages/ztd-cli/templates/sql/domain-specs/AGENTS.mdpackages/ztd-cli/README.md
📚 Learning: 2025-12-08T14:13:45.120Z
Learnt from: CR
Repo: mk3008/rawsql-ts PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-08T14:13:45.120Z
Learning: Applies to ztd.config.json : Update `ztd.config.json` whenever you change the target schema or search path so the rewrite pipeline still matches tables as expected.
Applied to files:
packages/ztd-cli/templates/README.mdpackages/ztd-cli/src/commands/pull.tspackages/ztd-cli/src/utils/agents.tsplaygrounds/ztd-playground/AGENTS.mdpackages/ztd-cli/src/commands/init.tsplaygrounds/ztd-playground/README.mdpackages/ztd-cli/README.md
📚 Learning: 2025-12-09T12:47:23.688Z
Learnt from: CR
Repo: mk3008/rawsql-ts PR: 0
File: packages/drivers/pg-testkit/AGENTS.md:0-0
Timestamp: 2025-12-09T12:47:23.688Z
Learning: Applies to packages/drivers/pg-testkit/sql/ddl/**/*.sql : Use DDL files only for canonical schema information and true shared baseline data; do not put per-test seeds inside schema files in pg-testkit
Applied to files:
packages/ztd-cli/templates/README.mdpackages/ztd-cli/tests/cliCommands.test.tspackages/ztd-cli/templates/sql/ddl/AGENTS.mdplaygrounds/ztd-playground/sql/ddl/AGENTS.mdpackages/drivers/pg-testkit/README.mdpackages/ztd-cli/README.md
📚 Learning: 2025-12-09T12:47:35.496Z
Learnt from: CR
Repo: mk3008/rawsql-ts PR: 0
File: playgrounds/ztd-playground/AGENTS.md:0-0
Timestamp: 2025-12-09T12:47:35.496Z
Learning: Applies to playgrounds/ztd-playground/sql/**/*.sql : Keep every table definition inside `sql/ddl/schemas/*.sql`, enums under `sql/enums/*.sql`, and executable specs inside `sql/domain-specs/*.sql`.
Applied to files:
packages/ztd-cli/templates/README.mdpackages/ztd-cli/templates/sql/ddl/AGENTS.mdplaygrounds/ztd-playground/AGENTS.mdpackages/ztd-cli/src/commands/init.tspackages/ztd-cli/templates/sql/enums/AGENTS.mdplaygrounds/ztd-playground/README.mdplaygrounds/ztd-playground/sql/ddl/AGENTS.mdpackages/ztd-cli/templates/sql/domain-specs/AGENTS.mdpackages/ztd-cli/README.md
📚 Learning: 2025-12-09T12:47:23.688Z
Learnt from: CR
Repo: mk3008/rawsql-ts PR: 0
File: packages/drivers/pg-testkit/AGENTS.md:0-0
Timestamp: 2025-12-09T12:47:23.688Z
Learning: Applies to packages/drivers/pg-testkit/**/{src,lib}/**/*.{ts,tsx,js} : Load DDL-based fixtures using DDLToFixtureConverter when projects contain `tests/ztd-row-map.generated.ts` and `sql/ddl/` directory
Applied to files:
packages/ztd-cli/templates/README.mdpackages/ztd-cli/tests/cliCommands.test.tspackages/ztd-cli/src/commands/pull.tspackages/ztd-cli/templates/AGENTS_ZTD.mdpackages/ztd-cli/templates/sql/ddl/AGENTS.mdplaygrounds/ztd-playground/AGENTS.mdpackages/ztd-cli/tests/init.command.test.tspackages/ztd-cli/src/commands/init.tsplaygrounds/ztd-playground/README.mdplaygrounds/ztd-playground/sql/ddl/AGENTS.mdpackages/drivers/pg-testkit/README.mdpackages/ztd-cli/README.md
📚 Learning: 2025-12-09T12:47:23.688Z
Learnt from: CR
Repo: mk3008/rawsql-ts PR: 0
File: packages/drivers/pg-testkit/AGENTS.md:0-0
Timestamp: 2025-12-09T12:47:23.688Z
Learning: Treat `tests/ztd-row-map.generated.ts` and `sql/ddl/` (or legacy `ddl/`) directory as canonical schema and row map; load fixtures from them rather than reverse-engineering the database structure
Applied to files:
packages/ztd-cli/templates/README.mdpackages/ztd-cli/tests/cliCommands.test.tspackages/ztd-cli/src/commands/pull.tspackages/ztd-cli/templates/sql/ddl/AGENTS.mdplaygrounds/ztd-playground/AGENTS.mdpackages/ztd-cli/tests/init.command.test.tspackages/ztd-cli/src/commands/init.tsplaygrounds/ztd-playground/README.mdplaygrounds/ztd-playground/sql/ddl/AGENTS.mdpackages/drivers/pg-testkit/README.mdpackages/ztd-cli/README.md
📚 Learning: 2025-12-09T12:47:23.688Z
Learnt from: CR
Repo: mk3008/rawsql-ts PR: 0
File: packages/drivers/pg-testkit/AGENTS.md:0-0
Timestamp: 2025-12-09T12:47:23.688Z
Learning: Applies to packages/drivers/pg-testkit/**/{src,lib}/**/*.{ts,tsx,js} : Parse DDL files once per client/pool instance in pg-testkit to produce fixture schema and baseline fixture rows deterministically
Applied to files:
packages/ztd-cli/templates/README.mdpackages/ztd-cli/tests/cliCommands.test.tspackages/ztd-cli/src/commands/pull.tspackages/ztd-cli/templates/AGENTS_ZTD.mdpackages/ztd-cli/tests/init.command.test.tspackages/ztd-cli/src/commands/init.tsplaygrounds/ztd-playground/README.mdpackages/drivers/pg-testkit/README.mdpackages/ztd-cli/README.md
📚 Learning: 2025-12-09T12:47:40.447Z
Learnt from: CR
Repo: mk3008/rawsql-ts PR: 0
File: playgrounds/ztd-playground/sql/ddl/AGENTS.md:0-0
Timestamp: 2025-12-09T12:47:40.447Z
Learning: Reference the `sql/ddl/schemas/` directory when modifying or understanding table structures
Applied to files:
packages/ztd-cli/templates/README.mdpackages/ztd-cli/src/commands/pull.tspackages/ztd-cli/templates/sql/ddl/AGENTS.mdplaygrounds/ztd-playground/AGENTS.mdplaygrounds/ztd-playground/README.mdplaygrounds/ztd-playground/sql/ddl/AGENTS.md
📚 Learning: 2025-12-09T12:47:23.688Z
Learnt from: CR
Repo: mk3008/rawsql-ts PR: 0
File: packages/drivers/pg-testkit/AGENTS.md:0-0
Timestamp: 2025-12-09T12:47:23.688Z
Learning: Applies to packages/drivers/pg-testkit/**/{src,lib}/**/*.{ts,tsx,js} : Do not reconstruct DDL or row-type definitions inside pg-testkit when the project already ships `tests/ztd-row-map.generated.ts`; rely on the generated TestRowMap instead
Applied to files:
packages/ztd-cli/templates/README.mdpackages/ztd-cli/tests/cliCommands.test.tspackages/ztd-cli/src/commands/pull.tspackages/ztd-cli/templates/AGENTS_ZTD.mdpackages/ztd-cli/src/utils/agents.tspackages/ztd-cli/tests/init.command.test.tspackages/ztd-cli/src/commands/init.tspackages/drivers/pg-testkit/README.mdpackages/ztd-cli/README.md
📚 Learning: 2025-12-09T12:47:23.688Z
Learnt from: CR
Repo: mk3008/rawsql-ts PR: 0
File: packages/drivers/pg-testkit/AGENTS.md:0-0
Timestamp: 2025-12-09T12:47:23.688Z
Learning: Applies to packages/drivers/pg-testkit/**/{tests,test,__tests__}/**/*.{ts,tsx,js} : Provide test-specific rows via `tableRows` or `withFixtures()` rather than in DDL schema files when using pg-testkit
Applied to files:
packages/ztd-cli/templates/README.mdpackages/ztd-cli/tests/cliCommands.test.tspackages/ztd-cli/templates/AGENTS_ZTD.mdpackages/ztd-cli/tests/init.command.test.tspackages/ztd-cli/src/commands/init.tspackages/drivers/pg-testkit/README.mdpackages/ztd-cli/README.md
📚 Learning: 2025-12-09T12:47:35.496Z
Learnt from: CR
Repo: mk3008/rawsql-ts PR: 0
File: playgrounds/ztd-playground/AGENTS.md:0-0
Timestamp: 2025-12-09T12:47:35.496Z
Learning: Applies to playgrounds/ztd-playground/tests/**/*.test.ts : Always wire Postgres execution through `tests/testkit-client.ts`, which opens a `pg.Client`, passes it into `rawsql-ts/pg-testkit`, and shares the connection across tests. Regenerate the helper with `pnpm playground:gen-config` if you need to move SQL directories or change connection defaults.
Applied to files:
packages/ztd-cli/templates/README.mdpackages/ztd-cli/tests/cliCommands.test.tspackages/ztd-cli/templates/AGENTS_ZTD.mdplaygrounds/ztd-playground/AGENTS.mdpackages/ztd-cli/tests/init.command.test.tsplaygrounds/ztd-playground/README.mdpackages/ztd-cli/README.md
📚 Learning: 2025-12-09T12:47:35.496Z
Learnt from: CR
Repo: mk3008/rawsql-ts PR: 0
File: playgrounds/ztd-playground/AGENTS.md:0-0
Timestamp: 2025-12-09T12:47:35.496Z
Learning: Applies to playgrounds/ztd-playground/tests/**/*.test.ts : Import `ZtdConfig`, `ZtdRowShapes`, `ZtdTableName`, and `tableFixture()` from `tests/ztd-row-map.generated.ts` instead of duplicating row interfaces inside tests.
Applied to files:
packages/ztd-cli/templates/README.mdpackages/ztd-cli/tests/cliCommands.test.tspackages/ztd-cli/src/commands/pull.tspackages/ztd-cli/templates/AGENTS_ZTD.mdpackages/ztd-cli/src/utils/agents.tsplaygrounds/ztd-playground/AGENTS.mdpackages/ztd-cli/tests/init.command.test.tspackages/ztd-cli/src/commands/init.tsplaygrounds/ztd-playground/README.mdpackages/ztd-cli/README.md
📚 Learning: 2025-12-09T12:47:23.688Z
Learnt from: CR
Repo: mk3008/rawsql-ts PR: 0
File: packages/drivers/pg-testkit/AGENTS.md:0-0
Timestamp: 2025-12-09T12:47:23.688Z
Learning: Applies to packages/drivers/pg-testkit/**/{src,lib}/**/*.{ts,tsx,js} : Maintain fixture precedence order in pg-testkit: DDL fixtures (schema + shared seed rows) → Manual fixtures (`tableDefinitions`, `tableRows`) → Scoped fixtures (`client.withFixtures()`), where later layers override earlier ones
Applied to files:
packages/ztd-cli/templates/README.mdpackages/ztd-cli/tests/cliCommands.test.tspackages/ztd-cli/tests/init.command.test.tspackages/drivers/pg-testkit/README.mdpackages/ztd-cli/README.md
📚 Learning: 2025-12-09T12:47:35.496Z
Learnt from: CR
Repo: mk3008/rawsql-ts PR: 0
File: playgrounds/ztd-playground/AGENTS.md:0-0
Timestamp: 2025-12-09T12:47:35.496Z
Learning: Applies to playgrounds/ztd-playground/tests/**/*.test.ts : Never issue DDL statements against Postgres from the playground. All CRUD operations must flow through pg-testkit so they resolve to fixture-backed `SELECT` queries.
Applied to files:
packages/ztd-cli/templates/README.mdpackages/ztd-cli/tests/cliCommands.test.tspackages/ztd-cli/templates/AGENTS_ZTD.mdplaygrounds/ztd-playground/AGENTS.mdplaygrounds/ztd-playground/README.mdpackages/ztd-cli/README.md
📚 Learning: 2025-12-09T12:47:23.688Z
Learnt from: CR
Repo: mk3008/rawsql-ts PR: 0
File: packages/drivers/pg-testkit/AGENTS.md:0-0
Timestamp: 2025-12-09T12:47:23.688Z
Learning: Applies to packages/drivers/pg-testkit/**/{src,lib}/**/*.{ts,tsx,js} : Rewrite all CRUD statements (INSERT, UPDATE, DELETE) to fixture-backed SELECT queries before execution in pg-testkit
Applied to files:
packages/ztd-cli/templates/README.mdpackages/ztd-cli/tests/cliCommands.test.tspackages/ztd-cli/templates/AGENTS_ZTD.mdplaygrounds/ztd-playground/README.mdpackages/drivers/pg-testkit/README.md
📚 Learning: 2025-12-02T22:58:15.329Z
Learnt from: CR
Repo: mk3008/rawsql-ts PR: 0
File: packages/testkit-core/AGENTS.md:0-0
Timestamp: 2025-12-02T22:58:15.329Z
Learning: Applies to packages/testkit-core/tests/**/*.{test,spec}.{ts,tsx} : Add test coverage for fixture resolution paths, CRUD rewrite transformations, CTE + multi-statement handling, fallback logic, identifier casing rules, and error diagnostics in testkit-core
Applied to files:
packages/ztd-cli/tests/cliCommands.test.tspackages/ztd-cli/tests/init.command.test.ts
📚 Learning: 2025-12-09T12:47:23.688Z
Learnt from: CR
Repo: mk3008/rawsql-ts PR: 0
File: packages/drivers/pg-testkit/AGENTS.md:0-0
Timestamp: 2025-12-09T12:47:23.688Z
Learning: Applies to packages/drivers/pg-testkit/**/{src,lib}/**/*.{ts,tsx,js} : Adapt `testkit-core` rewrite results to PostgreSQL in pg-testkit implementation
Applied to files:
packages/ztd-cli/tests/cliCommands.test.tspackages/ztd-cli/templates/AGENTS_ZTD.mdpackages/drivers/pg-testkit/README.md
📚 Learning: 2025-12-02T22:58:15.329Z
Learnt from: CR
Repo: mk3008/rawsql-ts PR: 0
File: packages/testkit-core/AGENTS.md:0-0
Timestamp: 2025-12-02T22:58:15.329Z
Learning: Applies to packages/testkit-core/src/**/*.{ts,tsx} : warn and passthrough modes in testkit-core must behave predictably and never silently rewrite incorrect SQL
Applied to files:
packages/ztd-cli/tests/cliCommands.test.tspackages/ztd-cli/tests/init.command.test.ts
📚 Learning: 2025-12-02T22:57:55.626Z
Learnt from: CR
Repo: mk3008/rawsql-ts PR: 0
File: packages/drivers/sqlite-testkit/AGENTS.md:0-0
Timestamp: 2025-12-02T22:57:55.626Z
Learning: Applies to packages/drivers/sqlite-testkit/src/**/*.{ts,tsx,js} : No stray console.log or temp files outside ./tmp/ directory
Applied to files:
packages/ztd-cli/tests/cliCommands.test.tspackages/ztd-cli/src/commands/pull.tspackages/ztd-cli/tests/init.command.test.tspackages/ztd-cli/src/commands/init.ts
📚 Learning: 2025-12-09T12:47:35.496Z
Learnt from: CR
Repo: mk3008/rawsql-ts PR: 0
File: playgrounds/ztd-playground/AGENTS.md:0-0
Timestamp: 2025-12-09T12:47:35.496Z
Learning: Applies to playgrounds/ztd-playground/tests/ztd-layout.generated.ts : Do not hand-edit `tests/ztd-layout.generated.ts`; regenerate it with `pnpm playground:gen-config` (or `pnpm --filter ztd-playground exec ztd ztd-config`) so the CLI and tests stay aligned.
Applied to files:
packages/ztd-cli/tests/cliCommands.test.tspackages/ztd-cli/src/commands/pull.tspackages/ztd-cli/templates/AGENTS_ZTD.mdpackages/ztd-cli/src/utils/agents.tsplaygrounds/ztd-playground/AGENTS.mdpackages/ztd-cli/tests/init.command.test.tspackages/ztd-cli/src/commands/init.tsplaygrounds/ztd-playground/README.md
📚 Learning: 2025-12-09T12:47:23.688Z
Learnt from: CR
Repo: mk3008/rawsql-ts PR: 0
File: packages/drivers/pg-testkit/AGENTS.md:0-0
Timestamp: 2025-12-09T12:47:23.688Z
Learning: Applies to packages/drivers/pg-testkit/**/{src,lib}/**/*.{ts,tsx,js} : Support full parallel test execution in pg-testkit with no shared state
Applied to files:
packages/ztd-cli/tests/cliCommands.test.ts
📚 Learning: 2025-12-09T12:47:23.688Z
Learnt from: CR
Repo: mk3008/rawsql-ts PR: 0
File: packages/drivers/pg-testkit/AGENTS.md:0-0
Timestamp: 2025-12-09T12:47:23.688Z
Learning: Applies to packages/drivers/pg-testkit/**/{src,lib}/**/*.{ts,tsx,js} : Execute rewritten SELECT queries against a live pg client/pool in pg-testkit
Applied to files:
packages/ztd-cli/tests/cliCommands.test.tsplaygrounds/ztd-playground/README.md
📚 Learning: 2025-12-09T12:47:23.688Z
Learnt from: CR
Repo: mk3008/rawsql-ts PR: 0
File: packages/drivers/pg-testkit/AGENTS.md:0-0
Timestamp: 2025-12-09T12:47:23.688Z
Learning: Applies to packages/drivers/pg-testkit/**/{src,lib}/**/*.{ts,tsx,js} : Use `createPgTestkitClient` to lazily open a pg connection and ensure every `.query` call goes through rewrite + fixture application
Applied to files:
packages/ztd-cli/tests/cliCommands.test.ts
📚 Learning: 2025-12-09T12:47:23.688Z
Learnt from: CR
Repo: mk3008/rawsql-ts PR: 0
File: packages/drivers/pg-testkit/AGENTS.md:0-0
Timestamp: 2025-12-09T12:47:23.688Z
Learning: Applies to packages/drivers/pg-testkit/**/{src,lib}/**/*.{ts,tsx,js} : Normalize `$1`, `$2`, ... placeholders before rewrite and restore them before execution in pg-testkit
Applied to files:
packages/ztd-cli/tests/cliCommands.test.tspackages/ztd-cli/src/utils/agents.ts
📚 Learning: 2025-12-02T22:57:55.626Z
Learnt from: CR
Repo: mk3008/rawsql-ts PR: 0
File: packages/drivers/sqlite-testkit/AGENTS.md:0-0
Timestamp: 2025-12-02T22:57:55.626Z
Learning: Applies to packages/drivers/sqlite-testkit/src/**/*.test.{ts,tsx} : Use Vitest for both unit and integration-level coverage; integration tests should exercise real better-sqlite3 connections
Applied to files:
packages/ztd-cli/tests/cliCommands.test.tspackages/ztd-cli/tests/init.command.test.ts
📚 Learning: 2025-12-09T12:47:23.688Z
Learnt from: CR
Repo: mk3008/rawsql-ts PR: 0
File: packages/drivers/pg-testkit/AGENTS.md:0-0
Timestamp: 2025-12-09T12:47:23.688Z
Learning: Applies to packages/drivers/pg-testkit/**/{src,lib}/**/*.{ts,tsx,js} : Preserve full API surface (`.query`, `.connect`, `.release`) when wrapping an existing client or pool with `wrapPgClient`
Applied to files:
packages/ztd-cli/tests/cliCommands.test.ts
📚 Learning: 2025-12-09T12:47:23.688Z
Learnt from: CR
Repo: mk3008/rawsql-ts PR: 0
File: packages/drivers/pg-testkit/AGENTS.md:0-0
Timestamp: 2025-12-09T12:47:23.688Z
Learning: Applies to packages/drivers/pg-testkit/**/{src,lib}/**/*.{ts,tsx,js} : Do not introduce rewrite logic inside pg-testkit; rewrite logic belongs exclusively in testkit-core
Applied to files:
packages/ztd-cli/tests/cliCommands.test.ts
📚 Learning: 2025-12-08T14:13:45.120Z
Learnt from: CR
Repo: mk3008/rawsql-ts PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-08T14:13:45.120Z
Learning: Validation checklist: Run `pnpm lint`, `pnpm test` or `pnpm --filter <pkg> test`, `pnpm build`, and run benchmarks for SQL-rewriter changes when relevant.
Applied to files:
packages/ztd-cli/tests/cliCommands.test.tspackages/ztd-cli/tests/init.command.test.tsplaygrounds/ztd-playground/README.md
📚 Learning: 2025-12-08T14:13:45.120Z
Learnt from: CR
Repo: mk3008/rawsql-ts PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-08T14:13:45.120Z
Learning: Ensure `packages/core/dist` outputs stay synchronized with the pnpm store copy that CLI tests consume. Run `pnpm --filter rawsql-ts build` which executes `scripts/sync-rawsql-dist.js` as a `postbuild` step.
Applied to files:
packages/ztd-cli/tests/cliCommands.test.tspackages/ztd-cli/src/commands/pull.tspackages/ztd-cli/tests/init.command.test.ts
📚 Learning: 2025-12-02T22:57:55.626Z
Learnt from: CR
Repo: mk3008/rawsql-ts PR: 0
File: packages/drivers/sqlite-testkit/AGENTS.md:0-0
Timestamp: 2025-12-02T22:57:55.626Z
Learning: Applies to packages/drivers/sqlite-testkit/src/**/*.{ts,tsx} : Do not add physical table management (CREATE TABLE, ALTER TABLE, migrations) through the wrapped driver
Applied to files:
packages/ztd-cli/src/commands/pull.ts
📚 Learning: 2025-12-02T22:58:15.329Z
Learnt from: CR
Repo: mk3008/rawsql-ts PR: 0
File: packages/testkit-core/AGENTS.md:0-0
Timestamp: 2025-12-02T22:58:15.329Z
Learning: Applies to packages/testkit-core/src/**/*.{ts,tsx} : In rawsql-ts/testkit-core, remain DBMS-agnostic with no Postgres/SQLite conditionals or behavior
Applied to files:
packages/ztd-cli/templates/AGENTS_ZTD.md
📚 Learning: 2025-12-08T14:13:45.120Z
Learnt from: CR
Repo: mk3008/rawsql-ts PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-08T14:13:45.120Z
Learning: Applies to packages/pg-testkit/src/**/*.{ts,tsx} : Application SQL may freely use normal CRUD (`INSERT`, `UPDATE`, `DELETE`). pg-testkit will automatically rewrite them into `SELECT` queries. Library code must never bypass the rewriter.
Applied to files:
packages/ztd-cli/templates/AGENTS_ZTD.md
📚 Learning: 2025-12-09T12:47:23.688Z
Learnt from: CR
Repo: mk3008/rawsql-ts PR: 0
File: packages/drivers/pg-testkit/AGENTS.md:0-0
Timestamp: 2025-12-09T12:47:23.688Z
Learning: Applies to packages/drivers/pg-testkit/**/{src,lib}/**/*.{ts,tsx,js} : Never create or mutate real tables in pg-testkit; prohibit `CREATE TABLE`, `ALTER TABLE`, and migrations
Applied to files:
packages/ztd-cli/templates/AGENTS_ZTD.md
📚 Learning: 2025-12-08T14:13:45.120Z
Learnt from: CR
Repo: mk3008/rawsql-ts PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-08T14:13:45.120Z
Learning: Applies to {packages/core,packages/testkit-core,packages/pg-testkit,packages/sqlite-testkit}/src/**/*.{ts,tsx} : All SQL rewrites must rely on `rawsql-ts` AST utilities (parser, analyzer, splitQueries). Regex-based rewrites are allowed only as guarded fallbacks with comments explaining why. Block contributions introducing regex parsing when an AST alternative exists.
Applied to files:
packages/ztd-cli/templates/AGENTS_ZTD.md
📚 Learning: 2025-12-08T14:13:45.120Z
Learnt from: CR
Repo: mk3008/rawsql-ts PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-08T14:13:45.120Z
Learning: Document any deviations from the standard formatting workflow in AGENTS so AI contributors understand that formatting is owned by the scripts, not by hand edits.
Applied to files:
packages/ztd-cli/templates/sql/ddl/AGENTS.mdpackages/ztd-cli/AGENTS_ZTD.mdpackages/ztd-cli/templates/sql/enums/AGENTS.mdpackages/ztd-cli/templates/sql/domain-specs/AGENTS.md
📚 Learning: 2025-12-09T12:47:35.496Z
Learnt from: CR
Repo: mk3008/rawsql-ts PR: 0
File: playgrounds/ztd-playground/AGENTS.md:0-0
Timestamp: 2025-12-09T12:47:35.496Z
Learning: Only include DDL files, minimal SQL examples in `src/`, and ZTD-focused tests under `tests/` in the playground. Avoid adding application logic, persistence layers, or business services.
Applied to files:
packages/ztd-cli/templates/sql/ddl/AGENTS.mdplaygrounds/ztd-playground/AGENTS.mdpackages/ztd-cli/src/commands/init.tsplaygrounds/ztd-playground/README.mdplaygrounds/ztd-playground/sql/ddl/AGENTS.mdpackages/ztd-cli/templates/sql/domain-specs/AGENTS.mdpackages/ztd-cli/README.md
📚 Learning: 2025-12-09T12:47:43.255Z
Learnt from: CR
Repo: mk3008/rawsql-ts PR: 0
File: playgrounds/ztd-playground/sql/domain-specs/AGENTS.md:0-0
Timestamp: 2025-12-09T12:47:43.255Z
Learning: Applies to playgrounds/ztd-playground/sql/domain-specs/sql/domain-specs/** : Store SQL SELECT specifications that describe domain behaviors under `sql/domain-specs/`. Each file must contain a complete executable SELECT statement.
Applied to files:
packages/ztd-cli/templates/sql/ddl/AGENTS.mdplaygrounds/ztd-playground/AGENTS.mdpackages/ztd-cli/src/commands/init.tspackages/ztd-cli/templates/sql/enums/AGENTS.mdplaygrounds/ztd-playground/README.mdplaygrounds/ztd-playground/sql/ddl/AGENTS.mdpackages/ztd-cli/templates/sql/domain-specs/AGENTS.md
📚 Learning: 2025-12-08T14:13:45.120Z
Learnt from: CR
Repo: mk3008/rawsql-ts PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-08T14:13:45.120Z
Learning: Applies to ztd.config.json : Application SQL can omit schema qualifiers (e.g., `SELECT ... FROM users`). pg-testkit maps those references to canonical `schema.table` keys by consulting the `ddl.defaultSchema` / `ddl.searchPath` block in `ztd.config.json` before looking up fixtures or DDL metadata.
Applied to files:
packages/ztd-cli/templates/sql/ddl/AGENTS.mdpackages/ztd-cli/tests/init.command.test.tspackages/ztd-cli/src/commands/init.tsplaygrounds/ztd-playground/README.mdplaygrounds/ztd-playground/sql/ddl/AGENTS.mdpackages/drivers/pg-testkit/README.mdpackages/ztd-cli/README.md
📚 Learning: 2025-12-02T22:57:21.011Z
Learnt from: CR
Repo: mk3008/rawsql-ts PR: 0
File: packages/core/AGENTS.md:0-0
Timestamp: 2025-12-02T22:57:21.011Z
Learning: Applies to packages/core/src/**/*.ts : Refactor for clarity and document public APIs before running the validation pipeline
Applied to files:
packages/ztd-cli/src/utils/agents.ts
📚 Learning: 2025-12-09T12:47:35.496Z
Learnt from: CR
Repo: mk3008/rawsql-ts PR: 0
File: playgrounds/ztd-playground/AGENTS.md:0-0
Timestamp: 2025-12-09T12:47:35.496Z
Learning: Applies to playgrounds/ztd-playground/tests/**/*.test.ts : Provide explicit fixtures for each test using `tableFixture('schema.table', [{ ... }])`. Do not reuse shared mutable data between tests.
Applied to files:
playgrounds/ztd-playground/AGENTS.mdpackages/ztd-cli/tests/init.command.test.tspackages/ztd-cli/src/commands/init.tsplaygrounds/ztd-playground/README.md
📚 Learning: 2025-12-02T22:57:55.626Z
Learnt from: CR
Repo: mk3008/rawsql-ts PR: 0
File: packages/drivers/sqlite-testkit/AGENTS.md:0-0
Timestamp: 2025-12-02T22:57:55.626Z
Learning: Applies to packages/drivers/sqlite-testkit/src/**/*.test.{ts,tsx} : Ensure tests remain deterministic regardless of file-backed vs. memory-backed SQLite configurations
Applied to files:
packages/ztd-cli/tests/init.command.test.tspackages/ztd-cli/src/commands/init.ts
📚 Learning: 2025-12-09T12:47:23.688Z
Learnt from: CR
Repo: mk3008/rawsql-ts PR: 0
File: packages/drivers/pg-testkit/AGENTS.md:0-0
Timestamp: 2025-12-09T12:47:23.688Z
Learning: Applies to packages/drivers/pg-testkit/**/{tests,test,__tests__}/**/*.{ts,tsx,js} : Ensure all added features have tests in `tests/` directory when contributing to pg-testkit
Applied to files:
packages/ztd-cli/tests/init.command.test.ts
📚 Learning: 2025-12-09T12:47:35.496Z
Learnt from: CR
Repo: mk3008/rawsql-ts PR: 0
File: playgrounds/ztd-playground/AGENTS.md:0-0
Timestamp: 2025-12-09T12:47:35.496Z
Learning: Use `pnpm format` to normalize TypeScript, SQL, Markdown, and config files; do not hand-edit whitespace or indentation.
Applied to files:
packages/ztd-cli/tests/init.command.test.ts
📚 Learning: 2025-12-08T14:13:45.120Z
Learnt from: CR
Repo: mk3008/rawsql-ts PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-08T14:13:45.120Z
Learning: Applies to {packages/pg-testkit,packages/sqlite-testkit}/**/*.test.{ts,tsx} : Do not treat the backing DB as a migration target. The DB engine is only for planning/type-checking. Never execute `CREATE TABLE`, `ALTER TABLE`, or seed `INSERT`s over a pg-testkit connection.
Applied to files:
packages/ztd-cli/tests/init.command.test.tspackages/drivers/pg-testkit/README.md
📚 Learning: 2025-12-02T22:57:55.626Z
Learnt from: CR
Repo: mk3008/rawsql-ts PR: 0
File: packages/drivers/sqlite-testkit/AGENTS.md:0-0
Timestamp: 2025-12-02T22:57:55.626Z
Learning: Applies to packages/drivers/sqlite-testkit/src/**/*.{ts,tsx,js} : All SQL must flow through the testkit-core AST rewriter before execution; new rewrite behavior must be added to testkit-core first, then threaded into sqlite-testkit
Applied to files:
packages/ztd-cli/src/commands/init.ts
📚 Learning: 2025-12-09T12:47:45.696Z
Learnt from: CR
Repo: mk3008/rawsql-ts PR: 0
File: playgrounds/ztd-playground/sql/enums/AGENTS.md:0-0
Timestamp: 2025-12-09T12:47:45.696Z
Learning: Applies to playgrounds/ztd-playground/sql/enums/**/*.sql : Declare ENUM-like domain values using simple SQL `VALUES` syntax so fixtures and rewrites stay consistent, avoiding magic numbers
Applied to files:
packages/ztd-cli/templates/sql/enums/AGENTS.mdpackages/ztd-cli/templates/sql/domain-specs/AGENTS.md
📚 Learning: 2025-12-09T12:47:35.496Z
Learnt from: CR
Repo: mk3008/rawsql-ts PR: 0
File: playgrounds/ztd-playground/AGENTS.md:0-0
Timestamp: 2025-12-09T12:47:35.496Z
Learning: Set `DATABASE_URL` environment variable before running `pnpm playground:test` or any spec that touches the testkit helper; the helper throws a clear error when it is missing.
Applied to files:
playgrounds/ztd-playground/README.md
📚 Learning: 2025-12-09T12:47:23.688Z
Learnt from: CR
Repo: mk3008/rawsql-ts PR: 0
File: packages/drivers/pg-testkit/AGENTS.md:0-0
Timestamp: 2025-12-09T12:47:23.688Z
Learning: Applies to packages/drivers/pg-testkit/**/{src,lib}/**/*.{ts,tsx,js} : Implement `.withFixtures()` overlay on pg-testkit clients to apply scenario-specific rows while maintaining fixture precedence
Applied to files:
packages/drivers/pg-testkit/README.md
📚 Learning: 2025-12-02T22:57:55.626Z
Learnt from: CR
Repo: mk3008/rawsql-ts PR: 0
File: packages/drivers/sqlite-testkit/AGENTS.md:0-0
Timestamp: 2025-12-02T22:57:55.626Z
Learning: Applies to packages/drivers/sqlite-testkit/**/README.md : Adapters must be documented in README.md with realistic fixture-based examples
Applied to files:
packages/drivers/pg-testkit/README.md
🧬 Code graph analysis (1)
packages/ztd-cli/src/commands/init.ts (1)
packages/ztd-cli/src/utils/ztdProjectConfig.ts (1)
DEFAULT_ZTD_CONFIG(31-36)
🪛 LanguageTool
packages/ztd-cli/templates/AGENTS_ZTD.md
[style] ~9-~9: This phrase is redundant. Consider using “outside”.
Context: ...efinitions or re-derive schema metadata outside of tests/ztd-row-map.generated.ts. If a ...
(OUTSIDE_OF)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: build-and-test (20.x)
🔇 Additional comments (20)
packages/ztd-cli/templates/README.md (1)
12-12: Aligns workflow step with per‑schema DDL layoutUpdating the workflow to
sql/ddl/<schema>.sqlmatches the new per‑schema DDL convention; no issues from a tooling or docs standpoint.packages/ztd-cli/AGENTS_ZTD.md (1)
1-3: Clarifies mirror relationship to shared template bundleStating that this file mirrors
templates/AGENTS_ZTD.mdmakes the duplication explicit and should help keep CLI guidance and the bundled template in sync; no further changes needed here.packages/ztd-cli/src/utils/agents.ts (1)
9-10: Template resolution now targets sharedtemplates/bundlePointing
templatePathat../../templates/AGENTS_ZTD.mdmatches the new template bundle location, and the function still avoids overwriting existing AGENTS files, so behavior remains safe.playgrounds/ztd-playground/AGENTS.md (1)
11-11: Playground schema guidance aligned with per‑schema DDL filesUpdating the bullet to
sql/ddl/<schema>.sqlkeeps the playground’s instructions consistent with the new per‑schema layout and the shared templates; looks good.packages/ztd-cli/templates/sql/enums/AGENTS.md (1)
1-13: Enum template clearly encodes VALUES‑based enums and discourages magic numbersThe example and guidance to use simple
VALUESdefinitions and avoid magic numbers align with the existing playground enums guidance; this is a solid template addition.Based on learnings, this matches the prior recommendation to keep ENUM‑like values in
sql/enums/*.sqlusingVALUES.packages/ztd-cli/templates/sql/domain-specs/AGENTS.md (1)
1-18: Domain-specs template reinforces SELECT‑only, executable specsRequiring each domain-spec file to be a full executable SELECT and documenting it with a realistic example matches the existing domain-spec AGENTS guidance and will help keep these specs consistent.
Based on learnings, this lines up with the prior rule that
sql/domain-specs/*.sqlmust be complete SELECT statements describing domain behaviors.playgrounds/ztd-playground/sql/ddl/AGENTS.md (1)
3-3: No action needed—DDL path documentation is already currentThe file correctly documents the new
sql/ddl/<schema>.sqlconvention. No stalesql/ddl/schemas/references remain in the codebase, so no cleanup is required.packages/ztd-cli/README.md (2)
25-35: ztd init schema bullet matches new per‑schema layoutThe
sql/ddl/<schema>.sqlwording withpublic.sqlas the default is consistent with the newrunPullSchemabehavior and the updated tests; this keeps init docs aligned with actual output.
105-111: AI Coding Workflow step now points at the right schema filesStep 1’s reference to
sql/ddl/<schema>.sql(e.g.,public.sql) matches the new DDL organization and the generated layout file, so the workflow guidance remains accurate.packages/ztd-cli/src/commands/pull.ts (1)
54-71: Schema snapshots now correctly flatten to<outDir>/<schema>.sqlWriting each schema directly under
outDirusingsanitizeSchemaFileName(schema)while cleaning up the legacyschema.sqlandschemas/directory aligns the implementation with the updated tests and docs. Behavior is backwards‑compatible in that it removes old layouts only if present.packages/ztd-cli/tests/init.command.test.ts (3)
5-20: Tests now derive schema filename from DEFAULT_ZTD_CONFIGUsing
DEFAULT_ZTD_CONFIG.ddl.defaultSchemato computeschemaFileNameandschemaFilePath()keeps tests automatically aligned if the default schema changes, and matches howrunInitCommandnow chooses the initial DDL file.
63-81: Manual‑DDL init test matches new<schema>.sqlseed behaviorAsserting existence and contents of
schemaFilePath(workspace)is consistent with the newsql/ddl/<schema>.sqllayout and theSAMPLE_SCHEMAcontent; the rest of the expectations are unchanged and still valid.
84-120: DB‑first init test stubs pull into the right fileThe
runPullSchemastub writingschemaFileNameunderoptions.outmirrors the realrunPullSchemabehavior (writing<schema>.sqlinto the DDL dir), and the subsequent read throughschemaFilePath(workspace)verifies the correct content. This keeps the wizard test tightly coupled to the new layout.packages/ztd-cli/tests/cliCommands.test.ts (2)
2-25: Expanded fs imports are appropriate for temp directory helpersAdding
mkdirSync,mkdtempSync,readFileSync, andwriteFileSyncto the fs import reflects actual usage in this file and avoids relying on implicit globals; no issues here.
127-142: pull CLI test correctly targetspublic.sqland asserts noschemas/dirThe test now looks for
outDir/public.sql, verifies theschemassubdirectory is absent, and still checks that the legacyschema.sqlis not created. This precisely matches the updatedrunPullSchemabehavior and guards against regressions in layout.playgrounds/ztd-playground/README.md (3)
11-17: Quick loop step now points at per‑schema DDL filesReferencing
sql/ddl/<schema>.sql(e.g.,ecommerce.sql) in the loop matches the new layout and makes it clearer where to edit schemas in the playground.
24-28: SQL layout bullet accurately describes flattened DDL organizationDescribing
sql/ddl/as holding all table DDL with “each namespace lives insql/ddl/<schema>.sql” is consistent with the rest of the PR and keeps the playground instructions in sync with the CLI behavior.
37-38: EC schema reference updated to the new ecommerce.sql locationPointing to
sql/ddl/ecommerce.sqlfor the sample domain is correct under the per‑schema layout and matches how schemas are now organized.packages/ztd-cli/src/commands/init.ts (2)
156-161: NEXT_STEPS messaging reflects new per‑schema DDL layoutUpdating step 1 to “Review the schema files under sql/ddl/.sql” keeps the post‑init summary consistent with the new schema organization and the README/docs.
625-647: ensureSqlFolderAgents now emits canonical AGENTS content from templatesLoading
templateContents = loadTemplate(target.templateName)and writing it only when no AGENTS file exists preserves project‑specific overrides while ensuring new projects all start from the same bundled guidance. The eagerensureDirectorycall before checkingfileExistsis harmless and guarantees folder creation even when users pre‑seed AGENTS files.
Summary
Testing
Summary by CodeRabbit
Documentation
Refactor
Tests
✏️ Tip: You can customize this high-level summary in your review settings.