# Backend nestjs

> Backend nestjs is an open-source agent skill for developer tools. Gives an agent NestJS rules for guards, DTO validation, modules and tests. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.

- **Kind:** Skill
- **Pricing:** Open source
- **Platforms:** Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf, Goose
- **Website:** https://github.com/JasGujral/mokata-oss/tree/main/src/mokata/skills/backend-nestjs
- **Repository:** https://github.com/jasgujral/mokata-oss
- **GitHub stars:** 19
- **License:** Apache-2.0
- **Skill name:** backend-nestjs
- **Collection:** https://github.com/JasGujral/mokata-oss
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-12-01

## About

This skill is a NestJS rule pack organized as an index file that points to one reference file per rule. Each rule carries an impact level, the version branch it applies to, an incorrect and a correct example, and a way to verify it. The agent is told to read the project's package.json first to find the @nestjs/core major, the HTTP platform, the test runner and the validation library, and to treat version-specific defaults as something to confirm against the official NestJS docs rather than memory.

The rules cover authorization in guards, DTOs that must be runtime classes so validation works, rejecting unknown fields, JWT claim verification, request-scoped providers, avoiding barrel imports between modules, providing injected dependencies, mapping errors to HTTP exceptions, and testing with testing modules. The skill also includes a review checklist and notes on when a contract change should have its callers walked before editing.

It expects a TypeScript project that depends on NestJS and works with the agent's file reading and search tools. It includes a note that it runs inside a pipeline with approval and gating steps, and some of its gates are described as review discipline rather than enforced checks.

## When your agent uses it

> mokata · NestJS rule pack — impact-ordered rules for modules, guards, DTOs and providers, loaded by the spec's routing.

## What it can access

From a static check of the files on GitHub; nothing was run.

- [Instructions only, no scripts](https://github.com/JasGujral/mokata-oss/tree/HEAD/src/mokata/skills/backend-nestjs)
- [License: Apache-2.0](https://github.com/JasGujral/mokata-oss/tree/HEAD/src/mokata/skills/backend-nestjs)

## Features

- **Impact-ordered NestJS rules:** Nine rules ranked from critical to medium, each in its own reference file with examples.
- **Guard-based authorization:** Guidance to place authorization in guards and to guard every route or mark it public explicitly.
- **DTO validation safeguards:** Rules ensuring DTOs stay runtime classes and that unknown fields are stripped or rejected.
- **Version-aware project reading:** Steps to read the project's NestJS major, HTTP platform, test runner and validation library first.
- **Module and provider hygiene:** Rules on barrel imports, circular dependencies, request scope and injected providers.
- **Testing and review checklist:** Guidance to write testing module or e2e tests first and a checklist to verify changes.

## Good for

- Review a NestJS controller for unguarded routes
- Add a new DTO with validation to an existing module
- Check a NestJS change for circular module imports
- Write unit tests with a NestJS testing module
- Verify JWT handling in a NestJS auth guard

## Install

### Claude Code

This skill ships in the `mokata` plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):

```sh
/plugin marketplace add JasGujral/mokata-oss
/plugin install mokata@mostack
```

Or copy only this skill to `~/.claude/skills/backend-nestjs`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/JasGujral/mokata-oss.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/backend-nestjs &&
cp -R "$tmp/src/mokata/skills/backend-nestjs" ~/.claude/skills/backend-nestjs &&
rm -rf "$tmp"
```

For one project only, put the folder in `.claude/skills/backend-nestjs` inside it instead.

### Codex

Copy the skill folder to `~/.agents/skills/backend-nestjs` to use it in every repository:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/JasGujral/mokata-oss.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/backend-nestjs &&
cp -R "$tmp/src/mokata/skills/backend-nestjs" ~/.agents/skills/backend-nestjs &&
rm -rf "$tmp"
```

For one repository only, put the folder in `.agents/skills/backend-nestjs` inside it instead.

### Cursor

Copy the skill folder to `~/.cursor/skills/backend-nestjs` to use it in every project:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/JasGujral/mokata-oss.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/backend-nestjs &&
cp -R "$tmp/src/mokata/skills/backend-nestjs" ~/.cursor/skills/backend-nestjs &&
rm -rf "$tmp"
```

For one project only, put the folder in `.cursor/skills/backend-nestjs` inside it instead.

### Gemini CLI

Run in a terminal (add `--scope workspace` to install it for the current workspace only):

```sh
gemini skills install https://github.com/JasGujral/mokata-oss.git --path src/mokata/skills/backend-nestjs
```

Or copy the folder to `~/.gemini/skills/backend-nestjs` yourself.

### VS Code

For GitHub Copilot in VS Code, copy the skill folder to `~/.copilot/skills/backend-nestjs`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/JasGujral/mokata-oss.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/backend-nestjs &&
cp -R "$tmp/src/mokata/skills/backend-nestjs" ~/.copilot/skills/backend-nestjs &&
rm -rf "$tmp"
```

For one project only, put the folder in `.github/skills/backend-nestjs` inside it instead.

### Other agents

Get the folder:

```sh
git clone --depth 1 https://github.com/JasGujral/mokata-oss.git
```

Then copy `mokata-oss/src/mokata/skills/backend-nestjs` into your agent's skills folder as `backend-nestjs`. Agents that support SKILL.md read one folder per skill.

## FAQ

### When does Backend nestjs engage?

It engages when the spec's domains name backend-nestjs, or when a change touches a controller, module, provider, guard, pipe or DTO in a package depending on @nestjs/core. It should not engage for plain Express, Fastify or Koa servers without NestJS, frontend-only changes, or TypeScript libraries without @nestjs/core.

### What does Backend nestjs need from my project?

It reads the touched package's package.json to identify the @nestjs/core major, the HTTP platform, the test runner and the validation library in use.

### Does Backend nestjs run any scripts or change files on its own?

The skill lists no scripts. It guides the agent through reading, reviewing and writing tests, and it says that a static every-route-guarded check is not part of the skill.

### How do I install Backend nestjs in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/backend-nestjs to use it in all your projects, or to .claude/skills/backend-nestjs in one project. Or install the mokata plugin, which includes it: /plugin marketplace add JasGujral/mokata-oss, then /plugin install mokata@mostack.

### Does Backend nestjs run scripts?

No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

### Which AI agents can use Backend nestjs?

Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose. Each reads skills in the SKILL.md format from its own folder; the install steps on this page list them.

### What are the best alternatives to Backend nestjs?

The closest alternatives to Backend nestjs are TypeScript best practices, Backend patterns, Readable code, Nuxt and Frontend react.

## Where this comes from

- Description: from the skill's own SKILL.md.

## Alternatives

- [TypeScript best practices](https://ai-powered.com/skills/typescript-best-practices): TypeScript best practices is an open-source agent skill for developer tools.
- [Backend patterns](https://ai-powered.com/skills/backend-patterns): Backend patterns is an open-source agent skill for developer tools.
- [Readable code](https://ai-powered.com/skills/readable-code): Readable code is an open-source agent skill for developer tools.
- [Nuxt](https://ai-powered.com/skills/nuxt): Nuxt is an open-source agent skill for developer tools.
- [Frontend react](https://ai-powered.com/skills/frontend-react): Frontend react is an open-source agent skill for developer tools.
- [Angular developer](https://ai-powered.com/skills/angular-developer): Angular developer is an open-source agent skill for developer tools.
- [Antfu](https://ai-powered.com/skills/antfu): Antfu is an open-source agent skill for developer tools.
- [Code review](https://ai-powered.com/skills/code-review-getsentry): Code review is an open-source agent skill for developer tools.

---
Source: https://ai-powered.com/skills/backend-nestjs
