Reviews code against MX Space project standards including NestJS and Drizzle patterns.

Install

mkdir -p .claude/skills/mx-review && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/6424" && unzip -o skill.zip -d .claude/skills/mx-review && rm skill.zip

Installs to .claude/skills/mx-review

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Review code for MX Space project conventions. Checks NestJS patterns, Drizzle ORM repositories, Zod schemas, API design, etc.
125 charsno explicit “when” trigger
Intermediate

Key capabilities

  • Validate NestJS controller patterns
  • Check repository pattern implementation
  • Verify Zod schema usage
  • Review API design conventions
  • Check security and performance practices

How it works

It evaluates code against a checklist of project-specific architectural patterns, including NestJS decorators, Drizzle ORM usage, and Zod validation.

Inputs & outputs

You give it
File path to review
You get back
Review results with pass/fail status

When to use mx-review

  • Verifying controller compliance
  • Checking repository pattern implementation
  • Reviewing Zod schema usage

About this skill

MX Space Code Review

Review code for project conventions. Target: $ARGUMENTS

Review Checklist

1. Controller Conventions

  • Uses @ApiController() instead of @Controller()
  • Paginated endpoints return PaginationResult<T> from repository (no special decorator needed)
  • Authenticated endpoints use @Auth() decorator
  • Uses correct HTTP methods (GET/POST/PUT/DELETE)
  • Parameter validation uses DTOs (e.g., EntityIdDto for path params)
  • Return values follow response conventions (arrays auto-wrapped, objects returned directly)

2. Service Conventions

  • Injects repository class directly (e.g., private readonly postRepository: PostRepository)
  • Circular dependencies resolved with ModuleRef and injection tokens
  • Async tasks use scheduleManager.schedule()
  • Events use eventManager.emit() or eventManager.broadcast()

3. Repository Conventions

  • Extends BaseRepository from ~/processors/database/base.repository
  • Uses @Inject(PG_DB_TOKEN) db: AppDatabase constructor parameter
  • Uses Drizzle query builder (this.db.select().from(table).where(...))
  • ID boundaries validated with parseEntityId() / toEntityId() / toDbId()
  • Pagination uses this.paginationOf(total, page, size) helper from BaseRepository
  • Returns PaginationResult<T> for paginated queries

4. Schema (DTO) Conventions

  • Uses Zod instead of class-validator
  • Uses createZodDto() to create DTO classes
  • Provides Partial DTO for update operations
  • Uses project custom validators (e.g., zEntityId, zNonEmptyString, zCoerceInt)

5. Database Schema Conventions

  • Uses Drizzle pgTable() in ~/database/schema/
  • Primary keys use pkText() helper (Snowflake text IDs)
  • Foreign keys use refText() helper
  • Timestamps use createdAt(), updatedAt(), or tsCol() helpers
  • Indexes defined in the third argument of pgTable()

6. API Design Conventions

  • RESTful naming (plural nouns)
  • Correct status codes (200/201/204/400/401/404)
  • Paginated responses include data and pagination
  • Error responses use BusinessException

7. Module Registration Conventions

  • Repository registered as provider in module
  • Service and controller registered in module
  • Cross-module access uses injection tokens (e.g., POST_SERVICE_TOKEN)
  • Global modules decorated with @Global()

8. Test Conventions

  • Controllers have corresponding E2E tests
  • Uses createE2EApp to create test app
  • Test data created in pourData

9. Security Conventions

  • Sensitive operations protected by @Auth()
  • User input is validated
  • Internal error details not exposed
  • Sensitive info not logged

10. Performance Conventions

  • Batch operations use Promise.all
  • Large datasets use cursor-based pagination (OffsetDto with before/after)
  • Hot queries have caching
  • Avoid N+1 queries — batch related lookups (e.g., attachCategory, attachRelated)

Common Issues

Issue 1: Using class-validator

// Wrong
import { IsString } from 'class-validator'
class CreateDto {
  @IsString()
  name: string
}

// Correct
import { z } from 'zod'
import { createZodDto } from 'nestjs-zod'
const Schema = z.object({ name: z.string() })
class CreateDto extends createZodDto(Schema) {}

Issue 2: Response not following conventions

// Wrong - manually wrapping array
return { data: items }

// Correct - ResponseInterceptor auto-wraps
return items

Issue 3: Circular Dependency

// Wrong - direct injection causes circular dependency
constructor(private readonly otherService: OtherService) {}

// Correct - use ModuleRef for lazy loading
private otherService: OtherService
constructor(private readonly moduleRef: ModuleRef) {}
onApplicationBootstrap() {
  this.otherService = this.moduleRef.get(OTHER_SERVICE_TOKEN, { strict: false })
}

Issue 4: Not using EntityIdDto for path params

// Wrong - raw string param with no validation
@Get('/:id')
async get(@Param('id') id: string) {}

// Correct - validated entity ID
@Get('/:id')
async get(@Param() params: EntityIdDto) {
  return this.service.findById(params.id)
}

Issue 5: Repository not validating ID boundaries

// Wrong - passing raw string to DB query
await this.db.select().from(posts).where(eq(posts.id, id))

// Correct - validate ID at repository boundary
const idBig = parseEntityId(id)
await this.db.select().from(posts).where(eq(posts.id, idBig))

Output Format

After review, output in the following format:

## Review Results

### Passed
- [x] Item 1
- [x] Item 2

### Needs Changes
- [ ] Issue description
  - Location: `file:line`
  - Suggestion: Change recommendation

### Optimization Suggestions
- Suggestion 1
- Suggestion 2

When not to use it

  • Projects not following MX Space conventions

Limitations

  • Limited to MX Space project conventions
  • Requires manual review of suggestions

How it compares

It enforces strict project-specific conventions automatically, rather than relying on generic linting rules.

Compared to similar skills

mx-review side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
mx-review (this skill)13moNo flagsIntermediate
fullstack-guardian13moNo flagsAdvanced
supabase-developer957moReviewIntermediate
dependency-upgrade265moReviewIntermediate

Try saying

Example prompts that trigger this skill in your AI assistant.

You might also like

fullstack-guardian

Jeffallan

Use when implementing features across frontend and backend, building APIs with UI, or creating end-to-end data flows. Invoke for feature implementation, API development, UI building, cross-stack work.

15

supabase-developer

daffy0208

Build full-stack applications with Supabase (PostgreSQL, Auth, Storage, Real-time, Edge Functions). Use when implementing authentication, database design with RLS, file storage, real-time features, or serverless functions.

95185

dependency-upgrade

wshobson

Manage major dependency version upgrades with compatibility analysis, staged rollout, and comprehensive testing. Use when upgrading framework versions, updating major dependencies, or managing breaking changes in libraries.

26240

telegram-mini-app

davila7

Expert in building Telegram Mini Apps (TWA) - web apps that run inside Telegram with native-like experience. Covers the TON ecosystem, Telegram Web App API, payments, user authentication, and building viral mini apps that monetize. Use when: telegram mini app, TWA, telegram web app, TON app, mini app.

62163

stripe-integration

wshobson

Implement Stripe payment processing for robust, PCI-compliant payment flows including checkout, subscriptions, and webhooks. Use when integrating Stripe payments, building subscription systems, or implementing secure checkout flows.

48165

nodejs-best-practices

davila7

Node.js development principles and decision-making. Framework selection, async patterns, security, and architecture. Teaches thinking, not copying.

28120

Search skills

Search the agent skills registry