Conversation
- add comprehensive agent guide covering repo overview and workflow - document tooling commands, testing expectations, and CI pipeline - outline conventions, playbooks, and reference resources
Completed Working on "Auto PR Description"✅ Workflow completed successfully. |
Completed Working on "Auto PR Description"✅ Workflow completed successfully. |
There was a problem hiding this comment.
Summary: 4 MINOR items. The current AGENTS.md overstates available spec files and Mongo/ObjectId coverage, and its testing/playbook sections describe suites and attribute normalization guarantees that do not exist in the codebase. Themes: documentation promises for tests and helpers diverge from reality, giving contributors a false sense of coverage. Next steps: align AGENTS.md descriptions with the files and behaviors that actually exist today (or add the missing tests/features), and ensure the attribute normalization guidance matches the helper’s true behavior.
| ## 🗂️ Repository Structure | ||
| | Path | Description | | ||
| | --- | --- | | ||
| | `src/` | Runtime source and colocated Jest specs. Includes `builders.ts`, `print.ts`, `index.ts`, and their `*.spec.ts` files. |
There was a problem hiding this comment.
[minor]: Repository structure overstates available spec files. The src/ row says the directory contains builders.ts, print.ts, index.ts, and their *.spec.ts files, but the repo only ships builders.spec.ts and print.spec.ts—there is no index.spec.ts. This misleads contributors about available tests. Suggested fix: Update the src/ description to mention only the existing spec files (builders/print) or remove the claim that every listed module has a companion spec.
AGENTS.md
Outdated
| 6. **Review:** Validate changes against README/API expectations and ensure Prisma schemas printed by `print()` remain formatted via `@prisma/internals` `formatSchema` helper. | ||
|
|
||
| ## ✅ Testing & Quality Expectations | ||
| - **Testing framework:** Jest configured via `ts-jest` (see `package.json`). Specs import builders/printer to verify serialization, validation errors, and Prisma-specific behaviors (e.g., MongoDB ObjectId mappings, relation attributes). |
There was a problem hiding this comment.
[minor]: Testing section overstates Mongo/ObjectId coverage. Lines 39-41 claim the Jest suites verify Prisma-specific behaviors like MongoDB ObjectId mappings, but the only builder tests cover optional list validation and print specs never exercise Mongo-specific @db.ObjectId paths. This misleads contributors into believing those behaviors are already protected by tests when they are not. Suggested fix: Rewrite the Testing & Quality bullet to describe the actual coverage (serialization happy paths plus optional-list validation) or add the missing Mongo/ObjectId specs before documenting them.
|
|
||
| ## 📏 Critical Rules & Conventions | ||
| - **Builder invariants:** Always call `validateName`, `validateModifiers`, and attribute prefix helpers when introducing new builder APIs. Reuse exported error messages so tests remain meaningful. | ||
| - **Attributes handling:** Accept both arrays and strings; normalize to arrays with trimmed `@`/`@@` prefixes (see `validateAndPrepareAttributesPrefix`). |
There was a problem hiding this comment.
[minor]: Attributes normalization guidance does not match implementation. Line 63 says attribute helpers "normalize to arrays with trimmed @/@@ prefixes", but validateAndPrepareAttributesPrefix never mutates array inputs—the forEach call discards the trimmed values—so leading whitespace is preserved. Agents relying on the promised trimming will still leak malformed attribute strings into the AST/printer pipeline. Suggested fix: Document the actual behavior (string inputs are normalized, array inputs are passed through) or update validateAndPrepareAttributesPrefix to store the trimmed values before advertising the guarantee.
| - `src/index.ts` – central export surface tying builders and printer together. | ||
| - `src/builders.ts` – illustrates validation helpers (`validateScalarDefault`, attribute prefix enforcement) and error messaging patterns. | ||
| - `src/print.ts` – complete serialization pipeline, including documentation handling, relation rendering, and MongoDB-specific logic. | ||
| - `src/builders.spec.ts` – tests for invalid names, modifier conflicts, and attribute parsing. |
There was a problem hiding this comment.
[minor]: Builders spec reference overstates existing coverage. Lines 92-97 describe src/builders.spec.ts as covering invalid names, modifier conflicts, and attribute parsing, but the file currently contains only two optional-list tests. Pointing automation to nonexistent suites gives a false sense of safety. Suggested fix: Either expand src/builders.spec.ts with the named cases before referencing them or soften the description to match the current minimal coverage.
Completed Working on "Auto PR Description"✅ Workflow completed successfully. |
Summary
🔄 Overcut automatically updated AGENTS.md with latest repository analysis.
Summary
Document now mandates explicit MongoDB
_idattribute injections (with matching specs) and refreshes tooling/workflow instructions so automation contributors avoid regressions when editing the printer.Changes
formatSchemaintegration._idattribute injections validated bysrc/print.spec.ts.Commits
Testing