skills/clean-architecture-node/SKILL.md
To decouple business logic from frameworks, databases, and external tools, making the application easier to test and maintain over time. Use when: When building complex enterprise applications; When you want to ensure the business logic can survive changes in the database (e.g., SQL to NoSQL) or framework (e.g., Express to NestJS); When you need high testability of core business rules.
npx skillsauth add jyjeanne/ai-setup-forge clean-architecture-nodeInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
To decouple business logic from frameworks, databases, and external tools, making the application easier to test and maintain over time.
Organize the code into four distinct layers:
// src/domain/entities/User.ts
export class User {
constructor(
public readonly id: string,
public readonly email: string,
public readonly passwordHash: string
) {}
public validateEmail() {
return this.email.includes('@');
}
}
Use cases should only depend on abstractions (interfaces).
// src/application/use-cases/CreateUser.ts
import { User } from '../../domain/entities/User';
export interface UserRepository {
save(user: User): Promise<void>;
findByEmail(email: string): Promise<User | null>;
}
export class CreateUser {
constructor(private userRepository: UserRepository) {}
async execute(data: any) {
const user = new User(Date.now().toString(), data.email, data.password);
if (!user.validateEmail()) throw new Error('Invalid email');
await this.userRepository.save(user);
}
}
Implement the interface defined in the application layer.
// src/infrastructure/repositories/SqlUserRepository.ts
import { UserRepository } from '../../application/use-cases/CreateUser';
import { User } from '../../domain/entities/User';
export class SqlUserRepository implements UserRepository {
async save(user: User): Promise<void> {
// DB logic using Prisma/TypeORM
}
async findByEmail(email: string): Promise<User | null> {
// DB logic
return null;
}
}
Wire everything together in the outermost layer.
// src/main.ts
const userRepository = new SqlUserRepository();
const createUserUseCase = new CreateUser(userRepository);
const userController = new UserController(createUserUseCase);
A decoupled codebase where the core logic is independent of the UI and Database choices.
development
Generate breadboard circuit mockups and visual diagrams using HTML5 Canvas drawing techniques. Use when asked to create circuit layouts, visualize electronic component placements, draw breadboard diagrams, mockup 6502 builds, generate retro computer schematics, or design vintage electronics projects. Supports 555 timers, W65C02S microprocessors, 28C256 EEPROMs, W65C22 VIA chips, 7400-series logic gates, LEDs, resistors, capacitors, switches, buttons, crystals, and wires.
development
Apply lean thinking to UX: hypothesis-driven design, collaborative sketching, and rapid experiments instead of heavy deliverables. Use when the user mentions "Lean UX", "design hypothesis", "UX experiment", "collaborative design", or "outcome over output". Covers hypothesis statements, MVPs for UX, and cross-functional collaboration. For Build-Measure-Learn, see lean-startup. For usability audits, see ux-heuristics.
development
Design MVPs, validated learning experiments, and pivot-or-persevere decisions using Build-Measure-Learn. Use when the user mentions "MVP scope", "validated learning", "pivot or persevere", "vanity metrics", or "test assumptions". Covers innovation accounting and actionable metrics. For 5-day prototype testing, see design-sprint. For customer motivation analysis, see jobs-to-be-done.
tools
Instrument, trace, evaluate, and monitor LLM applications and AI agents with LangSmith. Use when setting up observability for LLM pipelines, running offline or online evaluations, managing prompts in the Prompt Hub, creating datasets for regression testing, or deploying agent servers. Triggers on: langsmith, langchain tracing, llm tracing, llm observability, llm evaluation, trace llm calls, @traceable, wrap_openai, langsmith evaluate, langsmith dataset, langsmith feedback, langsmith prompt hub, langsmith project, llm monitoring, llm debugging, llm quality, openevals, langsmith cli, langsmith experiment, annotate llm, llm judge.