From onion-lasagna-kit
Use when creating Onion Lasagna outbound ports, repository adapters, persistence adapters, external API adapters, or infrastructure error boundaries
How this skill is triggered — by the user, by Claude, or both
Slash command
/onion-lasagna-kit:onion-lasagna-adapterThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Adapters keep app use cases independent from concrete infrastructure. App defines outbound ports; infra implements them; bootstrap wires implementations into use cases.
Adapters keep app use cases independent from concrete infrastructure. App defines outbound ports; infra implements them; bootstrap wires implementations into use cases.
Inspect existing app ports, infra adapters, repository patterns, and package exports before writing code. Search */app/**/ports, */infra/**, and packages/onion-lasagna/src/**/index.ts.
Load ../../references/architecture-rules.md when creating or reviewing adapter code.
Create these pieces:
App port, under app/**/ports:
export interface ProjectRepositoryPort {
save(project: Project): Promise<void>;
findById(id: ProjectId): Promise<Project | null>;
}
Infra adapter, under infra/**:
import { BaseOutboundAdapter, InfraError } from '@cosmneo/onion-lasagna';
export class ProjectRepositoryAdapter extends BaseOutboundAdapter implements ProjectRepositoryPort {
constructor(private readonly repository: DrizzleProjectRepository) {
super();
}
save(project: Project): Promise<void> {
return this.repository.save(project);
}
findById(id: ProjectId): Promise<Project | null> {
return this.repository.findById(id);
}
protected override createInfraError(error: unknown, methodName: string): InfraError {
return new InfraError({
message: `Project repository failed during ${methodName}`,
cause: error,
});
}
}
Bootstrap/composition root:
const drizzleRepository = new DrizzleProjectRepository(db);
const projectRepository = new ProjectRepositoryAdapter(drizzleRepository);
const createProjectCommand = new CreateProjectCommand(projectRepository);
npx claudepluginhub cosmneo/onion-lasagna --plugin onion-lasagna-kitCreates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.