Get the FREE Ultimate OpenClaw Setup Guide →

check-lessons

Scanned
npx machina-cli add skill parthalon025/autonomous-coding-toolkit/check-lessons --openclaw
Files (1)
SKILL.md
3.8 KB

Check Lessons

Overview

Proactive lesson retrieval that searches the lessons-learned system for patterns matching the current work. Surfaces relevant cluster mitigations, open corrective actions, and key takeaways before you start coding — preventing the same bug from happening twice.

Uses lessons-db search (LanceDB semantic vector search + SQLite keyword/file matching) — not grep.

When to Use

  • Before EnterPlanMode — check if planned work touches any lesson clusters
  • When editing a file that appears in any lesson's **Files:** field
  • When a test fails in a pattern matching a known cluster
  • When starting work on a system with known failure history
  • When /check-lessons is invoked

Process

Step 1: Identify the Work Domain

Determine what is being touched:

  • Which files and directories?
  • Which systems (HA, Telegram, Notion, systemd, etc.)?
  • Which patterns (async, error handling, data flow, schema, startup, etc.)?

Step 2: Semantic Search

Run lessons-db search with descriptive queries for the work domain:

# Search by description of what's being built or the pattern at risk
lessons-db search "async error handling fire and forget"
lessons-db search "sqlite context manager connection close"
lessons-db search "schema change consumer update"

# Search by file being edited (surfaces lessons that reference this file)
lessons-db search "" --file path/to/file.py

# Search by code content (check against detection patterns)
lessons-db search "" --content "except:"

Run 2-3 focused queries targeting:

  • The specific system being touched (e.g., "HA entity state subscription")
  • The error pattern at risk (e.g., "silent exception return None")
  • The cluster domain (e.g., "cold start missing baseline seed")

Step 3: Map Clusters

For each result, note the cluster and look up cluster-wide mitigations:

ClusterNameWatch For
ASilent FailuresAny fallback/except/return None without logging
BIntegration BoundariesCross-service calls, shared state, API contracts
CCold-StartFirst-run, missing baselines, state seeding
DSpecification DriftAgent builds wrong thing correctly — verify spec
EContext & RetrievalInfo available but misscoped or buried
FPlanning & Control FlowWrong decomposition contaminates downstream

Step 4: Present Findings

Format output as:

Relevant Lessons for [current work]:

Cluster [X] ([Name]) — N matches:
  #[num]: [one_liner from search result]
  #[num]: [one_liner from search result]
  Mitigations:
    1. [applicable cluster mitigation]
    2. [applicable cluster mitigation]

File overlap:
  #[num] references [matching file] — Key Takeaway: [takeaway text]

Step 5: Flag Open Corrective Actions

Check lessons-db status for open scan findings and overdue corrective actions related to the matched lessons.

Key References

SourceHow to query
lessons-db search "<query>"Semantic + keyword search (primary)
lessons-db search "" --file <path>File-overlap search
lessons-db search "" --content "<code>"Pattern match against detection rules
lessons-db statusOpen findings + overdue actions

Common Mistakes

MistakeFix
Using grep on markdown filesUse lessons-db search — it has semantic search, not just keyword match
Single vague queryRun 2-3 focused queries: system, error pattern, cluster domain
Ignoring standalone lessons (no cluster)Search results include all lessons — cluster assignment is informational
Skipping open corrective actionsRun lessons-db status to surface proposed-but-unvalidated fixes

Source

git clone https://github.com/parthalon025/autonomous-coding-toolkit/blob/main/skills/check-lessons/SKILL.mdView on GitHub

Overview

Proactive retrieval of lessons-learned patterns to surface relevant mitigations, open corrective actions, and key takeaways before you start coding. This helps prevent repeating past mistakes by aligning work with known lessons.

How This Skill Works

The skill uses lessons-db search (semantic vector + keyword/file matching) to surface relevant lessons. It guides you through identifying the work domain, running focused queries, mapping results to clusters, and presenting mitigations and file overlaps before you proceed.

When to Use It

  • Before EnterPlanMode — check if planned work touches any lesson clusters
  • When editing a file that appears in any lesson's Files field
  • When a test fails in a pattern matching a known cluster
  • When starting work on a system with known failure history
  • When /check-lessons is invoked

Quick Start

  1. Step 1: Identify the Work Domain — files, systems, patterns being touched
  2. Step 2: Run lessons-db search with descriptive queries and file/content options
  3. Step 3: Map clusters to mitigations and review any open corrective actions

Best Practices

  • Run 2-3 focused queries targeting the specific system, the error pattern, and the cluster domain
  • Use file-overlap (--file) and content (--content) searches to surface relevant lessons
  • Map each result to its cluster and review cluster-wide mitigations
  • Check lessons-db status for open findings and overdue corrective actions
  • Avoid grep on markdown files; rely on lessons-db semantic search for accuracy

Example Use Cases

  • Planning HA entity state subscription changes and using lessons to avoid silent failures
  • Editing a file referenced by a lesson's Files field to ensure compliance with prior fixes
  • Investigating a failing test that matches a known cluster’s pattern
  • Starting work on a system with a documented failure history to surface mitigations first
  • Running /check-lessons to surface relevant lessons before coding begins

Frequently Asked Questions

Add this skill to your agents
Sponsor this space

Reach thousands of developers