Install any skill in seconds. Free to start, no credit card required.
Get Started Free →aiskillstore/solid-principles
SOLID object-oriented design principles for maintainable code
Passed 23 of 24 test cases with the skill, and 18 of 24 without it.
and 2 more in the full report
5 fixed18 passed either way1 still failing0 broke
Tokens, turns and time describe resource use, not a dollar price.
One of 5 test cases the skill fixed. Same model, same prompt, with and without the skill.
I am writing a payment handler in Node.js TypeScript. Currently, `chargeCustomer` checks credit card formatting, calls Stripe, records the transaction log to PostgreSQL, and sends a transaction email in one 50-line async function. How should I restructure this function using functional single responsibility guidelines?
| Checked | Without skill | With skill |
|---|---|---|
| Separates input validation into a pure function returning a Result type. | Missed | Passed |
| Injects database and payment gateway dependencies into factory functions. | Passed | Passed |
| Isolates notification logic into a standalone function. | Passed | Passed |
The instructions your model reads when the skill loads.
SOLID principles adapted for functional and TypeScript-first development.
A module/function should have only one reason to change.
// Bad: Does validation, processing, and notification
const processOrder = async (order: Order) => {
// Validation
if (!order.items.length) throw new Error('Empty order');
if (order.total < 0) throw new Error('Invalid total');
// Processing
const processed = { ...order, status: 'processed' };
await db.orders.save(processed);
// Notification
await emailService.send(order.userId, 'Order confirmed');
return processed;
};
// Good: Separate responsibilities
const validateOrder = (order: Order): Result<Order, ValidationError> => {
if (!order.items.length) return Result.fail(emptyOrderError());
if (order.total < 0) return Result.fail(invalidTotalError());
return Result.ok(order);
};
const saveOrder = (db: Database) =>
async (order: Order): Promise<Order> => {
const processed = { ...order, status: 'processed' };
test cases passed, vs 18 / 24 without
More skills from the same source and nearby in the registry, with their headline benchmark lift.