Install
$ agentstack add skill-shikanime-labs-skills-nestjs-module-migration ✓ scanned · ✓ verified — works with Claude Code, Cursor, and more.
Security review
✓ PassedNo issues found. Passed automated security review. · v0.1.0 How review works →
- ✓ Prompt-injection patterns
- ✓ Secret / credential exfiltration
- ✓ Dangerous shell & filesystem operations
- ✓ Untrusted network calls
- ✓ Known-malicious package signatures
What it can access
- ✓ Network access No
- ✓ Filesystem access No
- ✓ Shell / process execution No
- ✓ Environment & secrets No
- ✓ Dynamic code execution No
From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.
About
NestJS Module Migration
Scope
Use this skill when migrating a legacy route/resource into apps/server-nestjs/src/modules/.
Standard anatomy
controller.ts: controllers, decorators,@UseGuards(...),
ZodValidationPipe
service.ts: business logic; usesPrismaServicemodule.ts: importsInfrastructureModule+AdminModulewhen admin auth is
needed
.spec.ts: unit tests aligned with repo mocks
Shared-contract rule
Mirror route shape/validation using packages/shared/src/contracts/.ts and schemas in packages/shared/src/schemas/.ts. Prefer ZodValidationPipe with the shared schema body/query types.
Auth rule
- admin routes:
AdminGuard+@RequireAdminPermission(...) - project routes:
ProjectContextGuard,ProjectStatusGuard,
ProjectLockedGuard, UserGuard, plus @Project() / @RequireProjectStatus()
- keep path-level controller first, conditional bypass only when required
MainModule wiring
- add new
*Moduletoapps/server-nestjs/src/main.module.ts - remove stale/broken module references after rebase/conflict resolution
- run
pnpm --filter server-nestjs exec tsc --noEmitafter edits
Documentation + tracking
- update
apps/server-nestjs/documentation/Modularisation-de-console-server/MODULARISATION-STATUT.md with:
- module section (routes, permissions, files, legacy differences)
- route totals and percentage progress
- new key date entry
- changelog entry
- if user requested task tracking, keep migration metadata in the task item
(module, route counts, permissions, files)
Legacy parity
- keep endpoint behavior as close as possible to
apps/server/src/resources//
- preserve “Différences avec le legacy” notes for client/QA
Pitfalls
- New Prisma service code must use the repo-standard
$transaction(async (tx) => { ... }) callback form; array-based $transaction([...]) does not match the standard vitest mocks used elsewhere.
- After parallel rebases,
main.module.tscan retain stale imports for modules
that were renamed/removed on the rebased side; always reconcile imports against actual files in apps/server-nestjs/src/modules/.
- Do not loop identical failing commands (
tsc --noEmit/ vitest) across the
whole repo when only one module is under review; narrow scope first.
import type { FooService }cannot be instantiated in tests; use a value
import when the constructor creates it under test.
Troubleshooting
- Module scoped service tests: run vitest from the
apps/server-nestjsworking
directory with src/modules//.spec.ts
- For Prisma unique-input args, match generated types (often compound keys like
{ pluginName_key: { ... } })
- If
@Injectis used in a service, importInjectfrom@nestjs/common - If a vitest command fails with "No test files found" or identical repeat
output, change strategy (path, working dir, or test scope) before rerunning. Repeating the exact same failing command is a blocker.
- Update
MODULARISATION-STATUT.mdafter every migration: module section, route
totals, key date, changelog.
tsc --noEmitmay report unrelated module failures; for a new module
migration, limit blocking judgment to its own file unless the user asks for a whole-repo clean sweep.
Source & license
This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.
- Author: shikanime-labs
- Source: shikanime-labs/skills
- License: Apache-2.0
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet — be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.