К основному содержанию
команда CX Codex

devkit.typescript.code-review — команда для Claude Code: установка

Команда devkit.typescript.code-review проводит аудит TypeScript-монорепозиториев на Nx с бэкендом NestJS, веб-клиентом React и мобильными приложениями React Native.

MIT ★ 372 обновлён 2026-09-10

Установить в Claude Code · Через маркетплейс плагинов Все способы и платформы ↓
/plugin marketplace add giuseppe-trisciuoglio/developer-kit
/plugin install developer-kit-typescript@developer-kit
Открыть на GitHub

Что делает devkit.typescript.code-review

Команда считывает текущую ветку, статус Git, недавние коммиты и список затронутых проектов через команду npx nx show projects --affected. Анализ можно ограничить одним файлом или директорией, либо передать тип проверки: architecture, security, performance, testing, ci или best-practices.

Внутри проверяются границы библиотек, циклические зависимости в графе Nx, валидация DTO через class-validator в NestJS, конфигурация сборщиков Metro или Vite, а также настройки кэширования в CI. Для запуска команда выбирает специализированного агента typescript-software-architect-review с откатом до базового ревьюера.

Без файла nx.json в корне определение затронутых проектов не сработает: команда выведет сообщение об отсутствии рабочего пространства Nx.

Какие задачи решает

  • проверить архитектурные границы между приложениями и библиотеками в Nx
  • найти уязвимости, утечки секретов и ошибки в DTO NestJS
  • выявить тяжёлые модули и проблемы производительности в React и React Native
  • настроить кэширование сборки и запуск тестов для затронутых проектов в CI

Примеры запросов агенту

  • /devkit.typescript.code-review full
  • /devkit.typescript.code-review security apps/api
  • /devkit.typescript.code-review architecture libs/shared/ui

Как установить devkit.typescript.code-review

1Через маркетплейс плагинов

/plugin marketplace add giuseppe-trisciuoglio/developer-kit
/plugin install developer-kit-typescript@developer-kit

2Вручную: положить файлы

.claude/commands/devkit.typescript.code-review.md

Вызов — /devkit.typescript.code-review. Для всех проектов — ~/.claude/commands/

Вопросы о devkit.typescript.code-review

Как установить devkit.typescript.code-review в Claude Code?

Добавьте каталог командой /plugin marketplace add giuseppe-trisciuoglio/developer-kit, а затем установите плагин через /plugin install developer-kit-typescript@developer-kit.

Какие типы проверок поддерживает команда?

Доступны режимы full, security, performance, architecture, testing, ci и best-practices. По умолчанию выполняется полный аудит.

Что нужно команде для анализа затронутого кода?

Требуется репозиторий Git и файл nx.json. С их помощью команда вызывает npx nx show projects --affected --base=HEAD~1 и сужает проверку до изменённых частей.

Исходный текст

devkit.typescript.code-review.md · MIT
---
allowed-tools: Read, Write, Bash, Edit, Grep, Glob
argument-hint: "[review-type] [file/directory-path] [options]"
description: Provides comprehensive TypeScript monorepo code review for Nx workspaces including NestJS backend, React web, and React Native mobile apps. Use when reviewing architecture, boundaries, security, performance, CI/CD and Nx-specific practices.
model: inherit
---

# TypeScript Monorepo Code Review - Nx / NestJS / React / React Native

## Overview

Provides comprehensive TypeScript monorepo code review for Nx workspaces including NestJS backend, React web, and React
Native mobile apps. Use when reviewing architecture, boundaries, security, performance, CI/CD and Nx-specific practices.

## Usage

```
/devkit.typescript.code-review $ARGUMENTS
```

## Arguments

| Argument     | Description                              |
|--------------|------------------------------------------|
| `$ARGUMENTS` | Combined arguments passed to the command |

## Current Context

- **Current Git Branch**: !`git branch --show-current`
- **Git Status**: !`git status --porcelain`
- **Recent Commits**: !`git log --oneline -5`
- **Modified Files**: !`git diff --name-only HEAD~1`
- **Nx Affected Projects**: !
  `[ -f nx.json ] && npx nx show projects --affected --base=HEAD~1 2>/dev/null || echo "Nx not detected"`

## Execution Instructions

**Agent Selection**: To execute this code review, use the following agent with fallback:

- Primary: `developer-kit-typescript:typescript-software-architect-review`
- If not available: `developer-kit:typescript-software-architect-review` fallback to
  `developer-kit:general-code-reviewer`, if not available use `general-purpose`

**Run context**:

- Use `npx nx show projects --affected --base=HEAD~1` to limit scope (only if Nx workspace detected)
- Provide `$1` as `full` or `security` etc., and optional path to a project or file

## Review Configuration

The review will analyze: **$ARGUMENTS**

**Available review types:**

- `full` - Complete 360° review (default)
- `security` - Focus on vulnerabilities, secrets, access control
- `performance` - Build/runtime and resource usage
- `architecture` - Boundaries, module ownership, dependency graph
- `testing` - Tests, coverage, e2e strategies
- `ci` - CI/CD, caching and Nx Cloud usage
- `best-practices` - TypeScript/Monorepo best practices

## Phase 1: Identify Review Scope and Workspace

### 1.1 Detect scope

IF "$1" IS PROVIDED
THEN Analyze specific file or project: $ARGUMENTS
ELSE Analyze affected and recently modified projects in workspace
ENDIF

### 1.2 Base Workspace Metrics

- **Nx Workspace**: nx.json, workspace.json or project.json layout
- **Packages Layout**: apps/, libs/, packages/ (check for custom layout)
- **Node/TS Versions**: Check engines and package.json
- **Build System**: Nx builders, Vite, Metro, Webpack
- **Package Manager**: npm / yarn / pnpm (pnpm recommended for monorepos)

## Phase 2: Monorepo & Nx Best Practices

### 2.1 Project Boundaries

- Verify clear separation apps vs libs
- Enforce tags and implicitDependencies in project.json and nx.json
- Prefer small, focused, reusable libs (feature, ui, util, data)
- Check for barrel exports and public-api.ts in libs
- Validate path mappings (tsconfig.base.json -> paths)

### 2.2 Dependency Graph and Affected Changes

- Use `npx nx dep-graph --file=depgraph.svg` to visualize
- Ensure libs have minimal incoming dependencies
- Identify circular dependencies and large fan-in nodes
- Validate proper use of buildable/libs-with-build-targets where needed

### 2.3 Workspace Tooling

- nx.json: targetDefaults, implicitDependencies, cacheableOperations
- CI cache: Nx Cloud or local caching configured
- Script hygiene: package.json scripts use nx run-commands or nx commands

## Phase 3: Backend (NestJS) Review

### 3.1 Project Structure & Modules

- Prefer domain/feature libs for core business logic, keep NestJS adapters thin
- Modules should be cohesive and small; avoid god modules
- Use constructor injection, avoid dynamic module misuse

### 3.2 DTOs, Validation, Pipes, Guards

- Use class-validator and class-transformer on DTOs; prefer readonly properties
- Validate DTOs globally with ValidationPipe and whitelist=true
- Implement Guards, Interceptors, ExceptionFilters for cross-cutting concerns

### 3.3 Database & Repositories

- Check TypeORM/Prisma/Sequelize usage consistency across services
- Prevent raw string concatenation in queries, prefer parameterized queries or Prisma client
- Use repository pattern in libs to decouple from framework

### 3.4 Security (NestJS)

- Properly configure CORS, CSP, security headers
- Secure cookies, tokens, and refresh token rotation if applicable
- Validate JWT usage, revocation strategy, and token scopes

## Phase 4: Frontend (React / React Native) Review

### 4.1 Component Libraries & Reuse

- Component libs (ui) should be framework-agnostic where possible
- Use storybook or similar for visual regression and component catalog
- Ensure shared hooks and utilities live in libs and avoid app duplication

### 4.2 State Management & Data Fetching

- Prefer local state in components, lift state to libs as needed
- Validate consistent data fetching strategy (React Query, SWR, or custom)
- Check for serialization issues when sharing code between web and native

### 4.3 Performance & Native Integration

- Optimize bundle size (route-based code splitting, lazy loading)
- For RN, validate Metro config, native module usage, and Hermes support
- Check for heavy synchronous operations on UI thread

## Phase 5: Build, CI, and Release

### 5.1 Nx Build Targets

- Verify build/test/lint targets defined for each project
- Use `nx affected:test` and `nx affected:build` in CI
- Prefer buildable libs for publishable packages

### 5.2 CI/CD and Caching

- Check Nx Cloud or remote caching configuration
- Ensure CI uses cacheableOperations and restores cache correctly
- Use incremental builds and selective E2E execution for speed

### 5.3 Release Strategy

- Check versioning strategy (independent vs fixed) if publishing packages
- Validate changelog, automated release pipeline, and tagging

## Phase 6: Security and Vulnerability Assessment

- Run dependency audits (npm audit, yarn audit, pnpm audit) and Snyk/Dependabot
- Check for hardcoded secrets, API keys, and unsafe env handling
- Review usage of eval, insecure deserialization, SSRF vectors
- Cross-origin and XSS protections in React apps (sanitize inputs, escape output)

## Phase 7: Testing Strategy

- Unit tests: Jest for backend and frontend (ts-jest / babel-jest), aim for fast, isolated tests
- Integration tests: Web API integration (supertest / Pact) and DB with Testcontainers (if applicable)
- E2E: Cypress or Playwright for web, Detox or Appium for React Native
- CI: Run affected tests first, full test suite on main branch

## Phase 8: Linting, Formatting, and Type Safety

- ESLint with project references and overrides for apps/libs
- Strict TypeScript compiler options (noImplicitAny, strictNullChecks)
- Prettier consistent formatting; pre-commit hooks (lint-staged, husky)
- Validate path aliases match tsconfig and build tooling

## Phase 9: Observability and Runtime

- Logging standardization (pino/winston) and correlation IDs
- Metrics and tracing (OpenTelemetry, Prometheus exporters)
- Health checks and graceful shutdowns for NestJS services

## Phase 10: Final Review Report

### Critical Issues (P0 - Fix Immediately)

- Secrets checked into repo, open auth bypass, critical dependency vulnerability
- Production-breaking build or release pipeline failure

### High Priority (P1 - Next Release)

- Circular dependencies in libs, large monolithic libs that block CI
- Missing tests for public API of shared libs
- Performance regressions and large bundles

### Medium Priority (P2 - Next Sprint)

- Inconsistent linting/config mismatches
- Minor architectural refactors to split oversized libs

### Low Priority (P3 - Backlog)

- Cosmetic naming, docs, README improvements

## Quality Metrics

- Unit Test Target: > 80% for critical libs
- Integration Test Target: > 60% for services
- CI Time: keep fast feedback loops (< 10m for affected changes)
- Bundle Size Targets: enforce budgets per app

## Recommended Actions

1. Immediate: Remove secrets, patch critical vulnerabilities
2. Short term: Add strict TS rules, centralize shared libs, enable Nx Cloud
3. Next sprint: Break down large libs, add component catalog and e2e stability
4. Backlog: Continuous improvement and technical debt reduction

## Integrated Support Tools

- Nx (affected, dep-graph), Nx Cloud (caching)
- SonarQube / CodeQL for static analysis
- Snyk / Dependabot for dependency scanning
- Jest, Cypress / Playwright, Detox for tests
- Storybook for UI components

---

## Examples

```bash
/devkit.typescript.code-review example-input
```

© Giuseppe Trisciuoglio · MIT · giuseppe-trisciuoglio/developer-kit

Похожие слэш-команды

Все слэш-команды по теме «Код-ревью и рефакторинг» →
mastering-typescript Richard Hightower Скилл mastering-typescript помогает писать строгий код на TypeScript 5.9+ и настраивать тулчейн для React 19 или NestJS 11. Пригодится при миграции с JavaScript и проектировании сложных типов. CX Codex +1 821установок codependix-export organizzolini Скилл codependix-export для Claude Code запускает экспорт графов зависимостей codependix и проверку архитектурных границ. Выполняет режимы проверки отчётов, целостности связей и записи артефактов. CX Codex +1 364установок codependix-navigate organizzolini Скилл codependix-navigate учит агента отвечать на вопросы о зависимостях: как проект A доходит до C, что сломается при правке файла. Через codependix path или графы, уже лежащие в репозитории. CX Codex +1 364установок typescript-nestjs-best-practices-cursorrules-promp PatrickJS Правило typescript-nestjs-best-practices-cursorrules-promp для TypeScript-проектов на NestJS: модульная архитектура, SOLID, чистый код и тестирование по Arrange-Act-Assert. CX Codex +1 ★ 41 178звёзд репо typescript-expert sickn33 Скилл typescript-expert для Claude Code разбирает типы TypeScript, ускоряет проверку и помогает с миграциями; запускается на каждом PR и диагностирует медленную компиляцию. CX Codex +1 12 900установок typescript-e2e-testing bmad-labs Скилл typescript-e2e-testing для Claude Code помогает писать, запускать и отлаживать E2E- и интеграционные тесты TypeScript/NestJS. Охватывает Jest, supertest и Docker-инфраструктуру. CX Codex +1 2 300установок

Из того же набора191

Весь набор →
aws-cloudformation-vpc Скилл aws-cloudformation-vpc для Claude Code содержит шаблоны CloudFormation для VPC и помогает создавать сетевую инфраструктуру AWS. CX Codex +1 ★ 372звёзд репо devkit.java.security-review Команда devkit.java.security-review для Claude Code проверяет безопасность корпоративных Java-приложений. Она запускается для аудита приложения или перед выпуском в production. CX Codex +1 ★ 372звёзд репо zod-validation-patterns Правило zod-validation-patterns задаёт шаблоны валидации входных DTO через Zod 4 в TypeScript-проектах. Оно пригодится при создании и проверке схем. CX Codex +1 ★ 372звёзд репо prompt-engineering-expert Субагент prompt-engineering-expert для создания и оптимизации промптов под LLM. Применяет chain-of-thought, constitutional AI, few-shot learning и другие техники. CX Codex ★ 372звёзд репо nestjs-code-review-expert Субагент nestjs-code-review-expert для Claude Code проверяет NestJS-код после изменений и при разработке функций. Он разбирает архитектуру, практики TypeScript и качество тестов. CX Codex ★ 372звёзд репо spring-boot-code-review-expert Субагент spring-boot-code-review-expert разбирает изменения в Spring Boot-коде: паттерны, архитектуру, REST, транзакции и тесты. На выходе — замечания по severity с примерами правок. CX Codex ★ 372звёзд репо general-code-explorer Субагент general-code-explorer разбирает реализацию фич в кодовой базе: находит точки входа, отслеживает цепочки вызовов и строит отчёт по слоям архитектуры. CX Codex ★ 372звёзд репо devkit.generate-security-assessment Команда devkit.generate-security-assessment собирает структурированный документ по безопасности проекта на основе кода и результатов аудита. Запускайте её после проверки безопасности, чтобы оформить оценку в заданном языке и формате. CX Codex +1 ★ 372звёзд репо

Спонсоры проекта

Компании, которые помогают держать аналитику открытой