Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Capture and organize learnings from coding experiences, debugging sessions, and problem-solving. Use when: the user wants to save a learning, document a discovery, record a pattern, or create a reference for future work. Do NOT use when: creating project documentation (use docs), writing PRDs (use create-prd), or when the user wants to read existing learnings without creating new ones.
| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | 88% | 0% |
| case-04 | ✗→✓ | ▲ Improved | 88% | 0% |
| case-07 | ✗→✓ | ▲ Improved | 114% | 0% |
| case-08 | ✗→✓ | ▲ Improved | 163% | 0% |
| case-09 | ✗→✓ | ▲ Improved | 249% | 0% |
Capture valuable insights from coding experiences and save them for future reference. Learnings are stored in .agents/learnings/ as Markdown files with YAML frontmatter.
docs skill)create-prd skill)project-files skill)Each learning is a Markdown file in .agents/learnings/ with this structure:
markdown--- title: Short descriptive title date: YYYY-MM-DD tags: [category1, category2] context: Brief context (optional) --- # Learning Title ## What I Learned [Clear, concise statement of the learning] ## Context [When and why this was discovered — what problem were you solving?] ## Solution / Pattern [The actual solution, pattern, or insight — make it actionable] ## Application [How to apply this in the future — include code examples if helpful] ## References - Related files: `path/to/file.ts` - Related commits: `abc1234` - External docs: [link](url)
| Field | Required | Description | |-------|----------|-------------| | title | Yes | Short, descriptive title (max 100 chars) | | date | Yes | ISO date format: YYYY-MM-DD | | tags | Yes | Array of lowercase tags for categorization | | context | No | One-line context about when this applies |
Use lowercase, hyphenated tags:
typescript, go, rust, sqlreact, hono, prisma, cloudflare-workersdebugging, performance, security, testingerror-handling, caching, authenticationapi, database, frontend, devopsbash# Create a new learning interactively bun run scripts/learning-create.ts # Create with title and tags bun run scripts/learning-create.ts "Prisma connection pooling" --tag prisma,database # List all learnings bun run scripts/learning-list.ts # List most recent 5 bun run scripts/learning-list.ts --recent 5 # Search learnings by tag or keyword bun run scripts/learning-search.ts "debugging" bun run scripts/learning-search.ts --tag typescript # Show a specific learning (supports partial filename match) bun run scripts/learning-show.ts 2024-01-15-react bun run scripts/learning-show.ts --latest
.agents/learnings/:bash # Use a descriptive filename: YYYY-MM-DD-topic-slug.md touch .agents/learnings/2024-01-15-react-usecallback-memoization.md
.agents/learnings/YYYY-MM-DD-descriptive-slug.mdExamples:
2024-01-15-react-usecallback-memoization.md2024-01-20-cloudflare-workers-cron-triggers.md2024-02-01-go-context-cancellation-patterns.md2024-02-10-prisma-connection-pooling-gotcha.mdmarkdown--- title: Prisma connection pool exhaustion under load date: 2024-01-15 tags: [prisma, database, debugging, performance] context: Production API returning 503 errors under high traffic --- # Prisma Connection Pool Exhaustion Under Load ## What I Learned Prisma's default connection pool size (10) is too small for high-traffic APIs. Under load, requests queue waiting for available connections, causing timeouts. ## Context Production API was returning 503 errors during peak traffic. Logs showed "Timeout: Pool connection limit reached" errors from Prisma. ## Solution / Pattern Increase the connection pool size in your Prisma schema:
datasource db { provider = "postgresql" url = env("DATABASE_URL") relationMode = "prisma" }
generator client { provider = "prisma-client-js" }
Then set pool size via environment variable:DATABASE_URL="postgresql://...?connection_limit=20&pool_timeout=10"
## Application
- Always set `connection_limit` based on expected concurrent requests
- Monitor connection pool metrics in production
- Consider using PgBouncer for very high throughput
## References
- Related files: `prisma/schema.prisma`, `src/db.ts`
- External docs: [Prisma Connection Management](https://www.prisma.io/docs/orm/more/comparisons/prisma-and-typeorm/connection-management)markdown--- title: TypeScript template literal types for API routes date: 2024-02-01 tags: [typescript, api, patterns] context: Building a type-safe API client --- # TypeScript Template Literal Types for API Routes ## What I Learned Template literal types can enforce correct HTTP method + path combinations at compile time, preventing invalid API calls. ## Context Building an API client and wanted to ensure callers only use valid endpoint combinations (e.g., GET /users, POST /users, but not DELETE /users). ## Solution / Pattern
type HttpMethod = 'GET' | 'POST' | 'PUT' | 'DELETE'; type ApiPath = '/users' | '/posts' | '/comments';
type ValidEndpoint = ${HttpMethod} ${ApiPath};
function callApi<T extends ValidEndpoint>(endpoint: T): Promise<Response> { const method, path] = endpoint.split(' '); return fetch(path, { method }); }
// ✅ Valid callApi('GET /users'); callApi('POST /posts');
// ❌ Compile error callApi('PATCH /users'); // Type error: not a ValidEndpoint
## Application
Use this pattern when building type-safe clients, routers, or any API
abstraction where method + path combinations matter.
## References
- Related files: `src/api/client.ts`
- External docs: [TypeScript Template Literal Types](https://www.typescriptlang.org/docs/handbook/2/template-literal-types.html)markdown--- title: Bun automatically kills long-running scripts date: 2024-02-10 tags: [bun, devops, gotcha] context: CI pipeline timing out --- # Bun Automatically Kills Long-Running Scripts ## What I Learned Bun has a default 30-second timeout for script execution. Long-running scripts will be killed without warning. ## Context CI pipeline was failing intermittently. Investigation revealed Bun was killing scripts that ran longer than 30 seconds. ## Solution / Pattern Use `--timeout` flag or `BUN_TIMEOUT` environment variable:
bun run script.ts --timeout 300000
BUN_TIMEOUT=300000 bun run script.ts
## Application
Always set explicit timeouts for long-running scripts in CI/CD pipelines.
## References
- External docs: [Bun CLI Reference](https://bun.sh/docs/cli/run)bash# Find all TypeScript learnings grep -l "tags:.*typescript" .agents/learnings/*.md # Or using the search script ./scripts/learning-search.sh --tag typescript
bash# Search learning content grep -rl "connection pool" .agents/learnings/ # Or using the search script ./scripts/learning-search.sh "connection pool"
bash# Learnings are naturally sorted by date via filename ls .agents/learnings/ # Show most recent ls -r .agents/learnings/ | head -10
bash# Move learnings older than 1 year to archive mkdir -p .agents/learnings/archive/2023 mv .agents/learnings/2023-*.md .agents/learnings/archive/2023/
debug — Capture the root cause and solution as a learningcode-review — Record patterns or anti-patterns discoveredexplore — Document findings about unfamiliar codebasesmixture-of-experts — Save expert insights for future referenceOther measured skills in the registry, with their headline benchmark lift.