Skip to content

Comments

Database, migrations, test-container and clean-architecture#3

Open
Copilot wants to merge 6 commits intomainfrom
copilot/add-database-integration-guidelines
Open

Database, migrations, test-container and clean-architecture#3
Copilot wants to merge 6 commits intomainfrom
copilot/add-database-integration-guidelines

Conversation

Copy link
Contributor

Copilot AI commented Feb 19, 2026

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:

  • Added database-integration.md rule: Register a shared pg pool as a Fastify plugin and use @nearform/sql for injection-safe queries.
  • Added database-migrations.md rule: Manage schema changes with Postgrator and run migrations automatically before the server starts.

Testing Enhancements:

  • Added test-containers.md and unit-testing.md rules: Use Testcontainers for integration tests with real Postgres instances and mock database stubs for fast unit tests.

Architecture Patterns:

  • Added clean-architecture.md rule: Isolate business logic in pure service-layer functions, keep route handlers thin, and use explicit dependency injection.

Documentation & Project Structure Updates:

  • Updated SKILL.md to include new rules in the topic list, usage recommendations, and a revised example project structure reflecting best practices for plugins, services, migrations, and testing.
  • Updated README.md to include the five new rules in the rules table and extended the usage examples to cover database setup, migrations, and architecture patterns.
  • Updated AGENTS.md to 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:

  • Added a changeset file summarizing the new rules for database integration, migrations, testing, and architecture.

🔒 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.

@changeset-bot
Copy link

changeset-bot bot commented Feb 19, 2026

🦋 Changeset detected

Latest 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

Copilot AI changed the title [WIP] Add database integration and migration rules Add database, migrations, test containers, clean architecture, and unit testing rules Feb 19, 2026
Copilot AI requested a review from Puppo February 19, 2026 22:34
Copilot AI changed the title Add database, migrations, test containers, clean architecture, and unit testing rules Switch database skills to pg + @nearform/sql + Postgrator Feb 19, 2026
Copilot AI and others added 4 commits February 20, 2026 09:24
…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>
@Puppo Puppo force-pushed the copilot/add-database-integration-guidelines branch from 5a9dfa9 to 6229e09 Compare February 20, 2026 08:24
@Puppo Puppo changed the title Switch database skills to pg + @nearform/sql + Postgrator Database, migrations, test-container and clean-architecture Feb 20, 2026
@Puppo
Copy link
Contributor

Puppo commented Feb 20, 2026

@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>
Copy link
Contributor Author

Copilot AI commented Feb 20, 2026

@copilot, can you add the changeset and fix the clean-architecture rule, which does not meet the validation rules?

Done in fbb4da7.

Changeset — added .changeset/database-integration-rules.md as a minor bump for @thecodepace/fastify-skills, describing the five new rules.

clean-architecture.md fixes:

  • Changed ### Incorrect (...) and ### Correct (...) headings to **Incorrect (...):** / **Correct (...):** bold labels so the validator can find the examples (all 15 rules now pass pnpm validate).
  • Fixed the TypeScript syntax error: async function (fastify) => {async (fastify) => {.
  • Added the missing export default userRoutes;.

@Puppo Puppo marked this pull request as ready for review February 20, 2026 12:35
Copy link
Contributor

@Puppo Puppo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot can you update the README file and the AGENT file?

…rchitecture rules

Co-authored-by: Puppo <2527849+Puppo@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Feb 20, 2026

@copilot can you update the README file and the AGENT file?

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 (pnpm install / lint / validate); updated Directory Structure and Naming Conventions to match the rules-based layout; added a Rule File Format section documenting the exact format required by the validator (including the note about using bold **Incorrect:**/**Correct:** labels instead of ### headings); added an Adding a Changeset section; removed duplicate end-user installation content.

Copilot AI requested a review from Puppo February 20, 2026 12:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants