Install any skill in seconds. Free to start, no credit card required.
Get Started Free →aiskillstore/code-patterns
Common code patterns and best practices reference for quick lookup
Passed 20 of 22 test cases with the skill, and 18 of 22 without it.
2 fixed18 passed either way2 still failing0 broke
Tokens, turns and time describe resource use, not a dollar price.
One of 2 test cases the skill fixed. Same model, same prompt, with and without the skill.
How should a TypeScript event emitter allow subscribers to detach their callback listener without forcing them to call a separate explicit unregister method with references?
| Checked | Without skill | With skill |
|---|---|---|
| Returns a teardown cleanup function directly from subscribe call | Missed | Passed |
The instructions your model reads when the skill loads.
Quick reference for common patterns. Use these as starting points, not rigid templates.
// When: Creating objects without specifying exact class
interface Product { use(): void }
class ConcreteProductA implements Product {
use() { console.log('Using A') }
}
class ProductFactory {
static create(type: string): Product {
const products = { a: ConcreteProductA };
return new products[type]();
}
}
// When: Complex object construction with many optional params
class QueryBuilder {
private query = { select: '*', from: '', where: [] };
select(fields: string) { this.query.select = fields; return this; }
from(table: string) { this.query.from = table; return this; }
where(condition: string) { this.query.where.push(condition); return this; }
build() { return this.query; }
}
// Usage
const query = new QueryBuilder()
.select('name, email')
.from('users')
.where('active = true')
test cases passed, vs 18 / 22 without
More skills from the same source and nearby in the registry, with their headline benchmark lift.