self-improvement
Appends new entries to LESSONS-LEARNED.md via opencastle lesson CLI; searches past lessons for matching errors; proposes skill updates when retry patterns exceed thresholds. Use when consulting or updating LESSONS-LEARNED.md, after task failures, when capturing retrospective insights, or when a retry succeeds.
git clone --depth 1 https://github.com/monkilabs/opencastle /tmp/self-improvement && cp -r /tmp/self-improvement/src/orchestrator/skills/self-improvement ~/.claude/skills/self-improvementSKILL.md
# Self-Improvement Protocol ## Core Rule **Retry with different approach and it works → document lesson immediately.** File: `.opencastle/LESSONS-LEARNED.md` ## Writing a Lesson > **⛔ HARD GATE — Use the CLI. Do NOT edit LESSONS-LEARNED.md directly.** ```sh opencastle lesson --title "Short descriptive title" --category general --severity high \ --problem "What was observed" --wrong "Failing approach" --correct "Working solution" \ --why "Root cause" ``` Required: `--title`, `--category`, `--severity`, `--problem` · Optional: `--wrong`, `--correct`, `--why` After writing: if lesson reveals gap in skill/instruction file, update that file too (prevents pitfall at source). ## Workflow 1. Search LESSONS-LEARNED.md for matching entries or similar errors. 2. Attempt task with conservative flags/options informed by lessons. 3. On failure: retry with modified approach (up to threshold); capture error details, context. 4. On success: run `opencastle lesson` to record working approach. 5. Verify: `tail -1 .opencastle/LESSONS-LEARNED.md` — confirm entry has title, category, severity. If malformed → re-run with corrected flags. 6. If lesson indicates needed skill/instruction update: draft change; propose a PR. Quick search example: ```bash rg "missing CRON_SECRET" .opencastle/LESSONS-LEARNED.md || true ``` ## Categories & Severity Category, severity tables moved to [LESSON-CATEGORIES.md](LESSON-CATEGORIES.md). Use that file when tagging lessons. ## Quality Rules - Include exact error messages, commands, tool parameters - Show wrong **and** correct approaches — the contrast is actionable - Explain why (root cause) - One lesson per entry; code blocks mandatory for commands ## Anti-Patterns Never skip reading lessons · Never fix without documenting · Never write vague entries · Never duplicate · Never defer to end of session ## Agent Memory For expertise tracking, cross-session knowledge graphs, load **agent-memory** skill.
Creates pages/layouts, defines content collections, configures hydration directives, and wires integrations. Use when adding or modifying Astro pages, layouts, components, or content collections. Trigger terms: Astro, content collection, client:load, client:visible, astro:content
Drive real browsers via Chrome DevTools MCP: navigate pages, capture snapshots, run responsive checks, and collect console/perf traces. Use when the user mentions: 'validate UI change in Chrome', 'capture a screenshot', 'run responsive checks', or 'collect console logs'. Trigger terms: browser testing, DevTools, console logs, screenshot, responsive testing
Creates and deploys Cloudflare Workers, configures wrangler.toml bindings, sets up KV/D1/R2 storage and Durable Objects, manages Pages deployments, and implements edge function patterns. Use when building or deploying Cloudflare Workers, setting up Pages, working with KV/D1/R2 storage, configuring wrangler.toml, or deploying edge applications.
Creates Contentful content types, queries entries via GraphQL/REST, runs CLI migrations, and manages assets and locales. Use when building or modifying Contentful content models, writing queries, or migrating content.
Convex reactive database patterns, schema design, real-time queries, mutations, actions, authentication, migrations, performance optimization, and component creation. Use when designing Convex schemas, writing queries/mutations, managing the Convex backend, setting up auth, migrating data, optimizing performance, or building Convex components.
Deploys applications, databases, and services on self-hosted Coolify instances, manages environments and env vars, runs infrastructure diagnostics, and performs batch operations. Use when deploying apps to Coolify, managing Coolify servers, debugging deployment issues, setting up databases, or managing Coolify infrastructure.
Writes Cypress E2E/component tests, configures `cy.intercept()` and `cy.session()`, authors custom commands, and wires CI artifacts. Use when creating E2E specs, component tests, or CI test pipelines. Trigger terms: cypress, e2e, component test, cy.intercept, cy.session
Drizzle ORM schema definition, type-safe queries, relational queries, CRUD operations, transactions, migrations with drizzle-kit, and database setup for PostgreSQL, MySQL, and SQLite. Use when defining database schemas, writing queries or joins, managing migrations, setting up a new Drizzle project, or working with drizzle-kit.