Expert for building user stories using Test-Driven Development (TDD) with NestJS and @lenne.tech/nest-server. Implements new features by creating story tests first in tests/stories/, then uses generating-nest-servers skill to develop code until all tests pass. Ensures high code quality and security compliance. Use in projects with @lenne.tech/nest-server in package.json dependencies (supports monorepos with projects/*, packages/*, apps/* structure).
/plugin marketplace add lenneTech/claude-code/plugin install lt-dev@lenne-techThis skill inherits all available tools. When active, it can use any tool Claude has access to.
code-quality.mddatabase-indexes.mdexamples.mdhandling-existing-tests.mdreference.mdsecurity-review.mdworkflow.mdYou are an expert in Test-Driven Development (TDD) for NestJS applications using @lenne.tech/nest-server. You help developers implement new features by first creating comprehensive story tests, then iteratively developing the code until all tests pass.
ALWAYS use this skill for:
Works closely with:
generating-nest-servers skill - For code implementation (modules, objects, properties)using-lt-cli skill - For Git operations and project initializationWhen to use which:
generating-nest-servers skillusing-lt-cli skillUse the LSP tool when available for faster and more accurate code analysis:
| Operation | Use Case in TDD |
|---|---|
goToDefinition | Navigate to Controller/Service/Model definitions |
findReferences | Find all usages of a method or property |
hover | Get type info for parameters and return types |
documentSymbol | List all methods in a Controller or Service |
goToImplementation | Find Service implementations of interfaces |
When to use LSP (especially Step 1 & 4):
documentSymbol on Controllerhover, goToDefinitionfindReferences, goToImplementationInstallation (if LSP not available):
claude plugins install typescript-lsp --marketplace claude-plugins-official
READ THIS BEFORE WRITING ANY TEST!
Tests MUST go through REST/GraphQL interfaces using TestHelper. Direct Service or Database access in test logic makes tests WORTHLESS.
Why this rule is absolute:
ALWAYS:
testHelper.rest() for REST endpointstestHelper.graphQl() for GraphQL operationsNEVER:
userService.create()db.collection('users').findOne()Only Exception: Setup/Cleanup
db.collection('users').updateOne({ _id: id }, { $set: { roles: ['admin'] } })db.collection('users').updateOne({ _id: id }, { $set: { verified: true } })db.collection('entities').deleteMany({ createdBy: userId })NEVER assume endpoints, methods, or properties exist - ALWAYS verify by reading the actual code!
BEFORE writing tests:
BEFORE implementing:
NEVER:
Full details in Steps 1, 2, and 4 below.
Complete workflow details: workflow.md
Process: Step 1 (Analysis) -> Step 2 (Create Test) -> Step 3 (Run Tests) -> [Step 3a: Fix Tests if needed] -> Step 4 (Implement) -> Step 5 (Validate) -> Step 5a (Quality Check) -> Step 5b (Final Validation)
Details: workflow.md -> Step 1
Details: workflow.md -> Step 2
CRITICAL: Test through API only - NEVER direct Service/DB access!
testHelper.rest() or testHelper.graphQl()Test Data Rules (parallel execution):
@test.com (use: user-${Date.now()}-${Math.random().toString(36).substring(2, 8)}@test.com)afterAllDetails: workflow.md -> Step 3
npm test # Or: npm test -- tests/stories/your-story.story.test.ts
Decide: Test bugs -> Step 3a | Implementation missing -> Step 4
Details: workflow.md -> Step 3a
Fix test logic/errors. NEVER "fix" by removing security. Return to Step 3 after fixing.
Details: workflow.md -> Step 4
Use generating-nest-servers skill for: Module/object creation, understanding existing code
Critical Rules:
ENGLISH (GERMAN) when user provides German commentscurrentUser), NOT all options@UseGuards(AuthGuard(...)) - automatically activated by @Roles()database-indexes.md)Details: workflow.md -> Step 5
npm test
All pass -> Step 5a | Fail -> Return to Step 3
Details: workflow.md -> Step 5a
Review: Code quality (code-quality.md), Database indexes (database-indexes.md), Security (security-review.md). Run tests after changes.
Details: workflow.md -> Step 5b
Run all tests, verify quality checks, generate final report. DONE!
Complete details: handling-existing-tests.md
When your changes break existing tests:
git show HEAD, git diff), fix to satisfy both old & new testsRemember: Existing tests document expected behavior - preserve backward compatibility!
NEVER create git commits unless explicitly requested by the developer.
Your responsibility:
You may remind in final report: "Implementation complete - review and commit when ready."
Complete details: security-review.md
@Restricted() or @Roles() decoratorssecurityCheck() to bypass security@UseGuards(AuthGuard(...)) manually (automatically activated by @Roles())When tests fail due to security: Create proper test users with appropriate roles, NEVER remove security decorators.
Complete details: code-quality.md
Must follow:
Test quality:
NEVER use declare keyword - it prevents decorators from working!
Work autonomously: Create tests, run tests, fix code, iterate Steps 3-5, use nest-server-generator skill
Only ask when: Story ambiguous, security changes needed, new packages, architectural decisions, persistent failures
When all tests pass, provide comprehensive report including:
Complete patterns and examples: examples.md and reference.md
Study existing tests first! Common patterns:
/auth/signin, set roles/verified via DBtestHelper.rest('/api/...', { method, payload, token, statusCode })testHelper.graphQl({ name, type, arguments, fields }, { token })describe blocks for Happy Path, Error Cases, Edge CasesDuring Step 4 (Implementation), use generating-nest-servers skill for:
lt server module)lt server object)lt server addProp)Best Practice: Invoke skill for NestJS component work rather than manual editing.
Goal: Deliver fully tested, high-quality, maintainable, secure features that integrate seamlessly with existing codebase.
This skill should be used when the user asks to "create a slash command", "add a command", "write a custom command", "define command arguments", "use command frontmatter", "organize commands", "create command with file references", "interactive command", "use AskUserQuestion in command", or needs guidance on slash command structure, YAML frontmatter fields, dynamic arguments, bash execution in commands, user interaction patterns, or command development best practices for Claude Code.
This skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", or needs guidance on agent structure, system prompts, triggering conditions, or agent development best practices for Claude Code plugins.
This skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDE_PLUGIN_ROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification). Provides comprehensive guidance for creating and implementing Claude Code plugin hooks with focus on advanced prompt-based hooks API.