Database, migrations, test-container and clean-architecture#3
Database, migrations, test-container and clean-architecture#3
Conversation
🦋 Changeset detectedLatest commit: f20e1d1 The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
…chitecture, and unit testing rules Co-authored-by: Puppo <2527849+Puppo@users.noreply.github.com>
…migrations Co-authored-by: Puppo <2527849+Puppo@users.noreply.github.com>
5a9dfa9 to
6229e09
Compare
|
@copilot, can you add the changeset and fix the clean-architecture rule, which does not meet the validation rules? |
…t and TypeScript syntax Co-authored-by: Puppo <2527849+Puppo@users.noreply.github.com>
Done in fbb4da7. Changeset — added clean-architecture.md fixes:
|
…rchitecture rules Co-authored-by: Puppo <2527849+Puppo@users.noreply.github.com>
Done in f20e1d1. README.md — extended skill description; added the five new rules (Database Integration, Database Migrations, Test Containers, Clean Architecture, Unit Testing) to the rules table; added three new usage examples. AGENTS.md — added a Package Manager section ( |
This pull request significantly expands the Fastify best practices documentation to cover modern database integration, migrations, testing, and clean architecture. It introduces new high-impact rules and updates the project structure and usage guidance to reflect these best practices. The most important changes are summarized below:
Database Integration & Migrations:
database-integration.mdrule: Register a sharedpgpool as a Fastify plugin and use@nearform/sqlfor injection-safe queries.database-migrations.mdrule: Manage schema changes with Postgrator and run migrations automatically before the server starts.Testing Enhancements:
test-containers.mdandunit-testing.mdrules: Use Testcontainers for integration tests with real Postgres instances and mock database stubs for fast unit tests.Architecture Patterns:
clean-architecture.mdrule: Isolate business logic in pure service-layer functions, keep route handlers thin, and use explicit dependency injection.Documentation & Project Structure Updates:
SKILL.mdto include new rules in the topic list, usage recommendations, and a revised example project structure reflecting best practices for plugins, services, migrations, and testing.README.mdto include the five new rules in the rules table and extended the usage examples to cover database setup, migrations, and architecture patterns.AGENTS.mdto document the pnpm-based toolchain (pnpm install,pnpm run lint,pnpm run validate), the required rule file format (bold**Incorrect:**/**Correct:**labels, not###headings), and a guide for adding changeset files.Rule Change Tracking:
🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.