Skip to content
Back to skills

Api Decorator Custom

ASecurity

Generate custom NestJS parameter decorators (user, tenant, actor) and metadata decorators (roles, permissions, public). Use when extracting request context or reducing controller boilerplate.

  • 2 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added September 27, 2026
toolsbashapi

Works with

  • api

Security analysis

A100/100

Scanned September 27, 2026

npx -y skills add David-Li0406/meta-skill-evloving --skill api-decorator-custom --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Api Decorator Custom?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Api Decorator Custom
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/david-li0406-api-decorator-custom/badge)](https://www.skillsdirectory.com/skills/david-li0406-api-decorator-custom)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: api-decorator-custom
description: Generate custom NestJS parameter decorators (user, tenant, actor) and metadata decorators (roles, permissions, public). Use when extracting request context or reducing controller boilerplate.
allowed-tools:
  - Read
  - Write
  - Edit
  - Glob
  - Grep
---

# Custom Decorators

## Purpose

Generate custom NestJS decorators for extracting common request data (user, tenant, actor) and adding metadata (roles, permissions, public).

## When to Use

- Creating reusable parameter decorators
- Adding metadata to routes
- Extracting request context
- Reducing boilerplate in controllers

## What It Generates

### Directory Structure

```
apps/api/src/common/decorators/
├── user.decorator.ts
├── tenant.decorator.ts
├── actor.decorator.ts
├── roles.decorator.ts
├── permissions.decorator.ts
├── public.decorator.ts
└── index.ts
```

## Patterns Enforced

### Parameter Decorators

Use `createParamDecorator` from `@nestjs/common`:

- Extract data from `ExecutionContext`
- Type-safe return values
- Support for WebSockets and GraphQL

### Metadata Decorators

Use `SetMetadata` from `@nestjs/common`:

- Store metadata for guards/interceptors
- Composable decorators
- Default values

## Usage Example

```bash
/skill decorator-custom --types='user,tenant,actor,roles,permissions,public'
```

## Related Files

- [Auth Guards](../auth-guards/SKILL.md) - Guards that use decorators
- [API Controller](../../core/api-controller/SKILL.md) - Controllers with decorators

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…