agentleFS
golevelupgolevelup/nestjs/.github/copilot-instructions.md

nestjs

Copilot instructions2.8k starsChanged 7 months agoMITView on GitHub

This is a pnpm monorepo containing a collection of NestJS modules and utilities. Each package lives under packages/ and is published independently to npm under the @golevelup scope. Running pnpm i also registers Git hooks via Husky. Integration tests require external services. Use docker-compose.yml to start them locally: Environment variables for integration tests:

  • Installs packages

We split this copilot-instructions.md into the rules it gives an agent

13 rules. About 0 are common, 5 are distinctive, and 8 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 8

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    All code is TypeScript with strict: true.

    line 113
  2. Very specific:

    Follow existing NestJS module patterns: modules export a DynamicModule via a static forRoot() or forRootAsync() method.

    line 114
  3. Very specific:

    Use decorators and metadata reflection (reflect-metadata) for NestJS integration points.

    line 115
  4. Very specific:

    Prefer async/await over raw Promises or callbacks.

    line 116
  5. Distinctive:

    All new features must include corresponding unit tests.

    line 117
  6. Distinctive:

    Do not add new dependencies without checking for existing alternatives already present in the workspace.

    line 119
  7. Very specific:

    Do not manually edit package.json version fields or CHANGELOG.md files.

    line 146
  8. Distinctive:

    All steps must pass before a PR can be merged.

    line 160
  9. Very specific:

    Do not modify pnpm-lock.yaml directly.

    line 164
  10. Very specific:

    Do not commit build artifacts (lib/, *.tsbuildinfo) — they are gitignored.

    line 165
  11. Distinctive:

    Do not skip or delete existing tests to make a build pass.

    line 166
  12. Distinctive:

    Do not introduce breaking changes to public APIs without a corresponding changeset and major version bump.

    line 167
  13. Very specific:

    Do not use Jest for unit or integration tests.

    line 168

≈ “Common” is an estimate: at least 1 in 5 of the 3,669 Copilot instructions files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
copilot-instructions.md

Copilot Instructions for golevelup/nestjs

Repository Overview

This is a pnpm monorepo containing a collection of NestJS modules and utilities. Each package lives under packages/ and is published independently to npm under the @golevelup scope.

Packages

PackagePathPurpose
@golevelup/nestjs-commonpackages/commonShared types and mixins
@golevelup/nestjs-discoverypackages/discoveryFind providers, controllers, and handlers by metadata
@golevelup/nestjs-modulespackages/modulesDynamic module creation helper
@golevelup/nestjs-rabbitmqpackages/rabbitmqRabbitMQ pub/sub and RPC integration
@golevelup/nestjs-hasurapackages/hasuraHasura event handler integration
@golevelup/nestjs-graphql-requestpackages/graphql-requestGraphQL client dependency injection
@golevelup/nestjs-webhookspackages/webhooksWebhook processing middleware
@golevelup/nestjs-stripepackages/stripeStripe client and webhook integration
@golevelup/nestjs-google-cloud-pubsubpackages/google-cloud-pubsubGoogle Cloud Pub/Sub integration
@golevelup/nestjs-graphile-workerpackages/graphile-workerGraphile Worker job queue integration
@golevelup/ts-jestpackages/testing/ts-jestJest utilities for NestJS testing
@golevelup/ts-sinonpackages/testing/ts-sinonSinon utilities for NestJS testing
@golevelup/ts-vitestpackages/testing/ts-vitestVitest utilities for NestJS testing

Tech Stack

  • Language: TypeScript 5.x (strict mode enabled)
  • Framework: NestJS v11
  • Package manager: pnpm v10 (workspaces)
  • Monorepo tooling: Lerna v9 (independent versioning)
  • Unit tests: Vitest v4 (Jest is only used inside the @golevelup/ts-jest and @golevelup/ts-sinon packages)
  • Integration tests: Vitest v4
  • Linter: Oxlint
  • Formatter: Oxfmt
  • Versioning/changelog: Changesets
  • Commit conventions: Conventional Commits via Commitizen + CommitLint

Setup

pnpm i

Running pnpm i also registers Git hooks via Husky.

Build

# Build all packages (excludes rabbitmq-integration and google-cloud-pubsub-integration)
pnpm build

# Build in watch mode
pnpm build:watch

# Clean build artifacts
pnpm clean

Testing

# Run all unit tests
pnpm test

# Run unit tests in CI mode (with coverage)
pnpm test:ci

# Run integration tests (requires running RabbitMQ - see docker-compose.yml)
pnpm test:integration

# Run integration tests in CI mode
pnpm test:ci:integration

# Run Vitest unit tests
pnpm test:vitest

# Run Vitest in CI mode with coverage
pnpm test:vitest:ci

Integration tests require external services. Use docker-compose.yml to start them locally:

docker compose up -d

Environment variables for integration tests:

  • RABBITMQ_HOST – RabbitMQ hostname (default: localhost)
  • RABBITMQ_PORT – RabbitMQ port (default: 5672)

Linting & Formatting

# Lint
pnpm lint

# Format all files
pnpm format

# Check formatting without modifying files
pnpm format:check

Type Checking

pnpm lerna:typecheck

Coding Conventions

  • All code is TypeScript with strict: true. Do not disable strict checks.
  • Follow existing NestJS module patterns: modules export a DynamicModule via a static forRoot() or forRootAsync() method.
  • Use decorators and metadata reflection (reflect-metadata) for NestJS integration points.
  • Prefer async/await over raw Promises or callbacks.
  • All new features must include corresponding unit tests.
  • Tests live alongside source files (e.g., src/foo.spec.ts) or in a dedicated __tests__ directory within the package.
  • Do not add new dependencies without checking for existing alternatives already present in the workspace.
  • Each package has its own package.json. Add package-level dependencies to the correct package, not the root.

Commit Conventions

Commits must follow the Conventional Commits specification. Use the interactive prompt to generate compliant messages:

pnpm commit

Reference issue numbers in the commit footer using closes #<number> or refs #<number>.

Branch naming:

  • feature/{number}-short-description
  • fix/{number}-short-description
  • docs/short-description

Versioning & Publishing

Versions are managed independently per package using Changesets. To create a changeset for your changes:

pnpm prep-release

Do not manually edit package.json version fields or CHANGELOG.md files; let the Changesets tooling handle those.

CI

The CI pipeline (.github/workflows/ci.yml) runs on every pull request and executes:

  1. Install dependencies (pnpm i --prefer-offline)
  2. Build all packages (pnpm build)
  3. Lint (pnpm lint)
  4. Type check (pnpm lerna:typecheck)
  5. Unit tests (pnpm test:ci)
  6. Vitest tests (pnpm test:vitest:ci)
  7. Integration tests (pnpm test:ci:integration)

All steps must pass before a PR can be merged.

What Not to Do

  • Do not modify pnpm-lock.yaml directly; let pnpm i manage it.
  • Do not commit build artifacts (lib/, *.tsbuildinfo) — they are gitignored.
  • Do not skip or delete existing tests to make a build pass.
  • Do not introduce breaking changes to public APIs without a corresponding changeset and major version bump.
  • Do not use Jest for unit or integration tests; use Vitest instead. The only exception is the @golevelup/ts-jest package itself.

Download now (ZIP)

Trending

Steady: 0 new projects took it in the last 4 weeks, none the 4 weeks before.thin data

Week of Aug 30: 0 new projectsWeek of Sep 6: 0 new projectsWeek of Sep 13: 0 new projectsWeek of Sep 20: 0 new projectsWeek of Sep 27: 0 new projectsWeek of Oct 4: 0 new projectsWeek of Oct 11: 0 new projectsWeek of Oct 18: 0 new projects
Aug 2026Sep 2026Oct 2026
New projects taking a version of this file each week, over the 8 weeks our latest run read: only 0 in all, so this is a hint, not a trend.

Who's talking about golevelup/nestjs

The biggest 5 of 53 mentions linking to the repository that our crawl found. Each line is their own headline.

See all 53

Talked about on GitHub and Stack Overflow (53 times).

On GitHub · 50

45 more on GitHub
  • Where files are headingNew Copilot instructions files have more rules about branches and pull requests, and fewer about code style.

    Of the Copilot instructions files we read, the 2,297 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.