Lesson capture

From liza-mas/liza · View interactive version

Lesson capture is an AI agent skill from the GitHub repository liza-mas/liza. Capture project-specific operational lessons from mistakes, discoveries, and hard-won insights

How to use this skill

Skill file

Objective

Extract a lesson from the current conversation context and persist it as a structured file. Lessons are project-specific operational knowledge — gotchas, patterns, and hard-won insights that prevent recurring mistakes.

Lessons complement the contract: the contract governs how to work (behavioral, project-agnostic); lessons capture what we learned here (operational, project-specific).

Audience

Lessons are split by audience:

| Audience | Directory | Discovery | Content |

|----------|-----------|-----------|---------|

| Agents | lessons/agents/ | GUARDRAILS.md trigger index | Project-specific gotchas agents hit repeatedly |

| Humans | lessons/humans/ | lessons/humans/README.md | Workflow habits, domain pitfalls, invariants to preserve |

If audience is ambiguous, ask.

Lesson Format

Each lesson is a small .md file with yaml frontmatter.

---
title: "Descriptive title"
trigger: "When [succinct situational condition]"
keywords: [keyword1, keyword2, keyword3]
date: YYYY-MM-DD
---

## Context

[Situation, intent, and conditions that led to this lesson]

## Failure Mode

[What went wrong and why]

## Solution

[What to do instead]

## References

- [Links to relevant files, docs, specs, or external resources]

Frontmatter fields:

Body sections:

Index Format

| Audience | Location |

|----------|----------------------------|

| Agents | GUARDRAILS.md (Tier 2) |

| Humans | lessons/humans/README.md |

### G2.x: Lessons — Agents

Operational lessons from project experience. Read when a trigger matches.

| Trigger | File |
|---------|------|
| When ... | [filename.md](lessons/agents/filename.md) |

Human lesson indexes use the same table in lessons/humans/README.md, with file links relative to that directory.

The agent index is the discovery mechanism. Agents read GUARDRAILS.md during session initialization and consult full lessons when a trigger matches their current task.

Process

1. Extract

Identify the lesson from the current conversation. Look for:

2. Classify

Determine audience:

If unclear, ask: "Is this a lesson for agents, humans, or both?"

If both, write two separate lessons tailored to each audience.

3. Draft

Propose the lesson content in the standard format. Present for approval before writing.

Naming convention: kebab-case, descriptive. Examples:

Quality bar:

4. Write

After the mode-specific gate clears:

  1. Write the lesson file to the appropriate directory
  2. Update the audience's index:
  1. Announce: "Lesson captured: [title] → lessons/[audience]/[filename]. Index updated."

5. Maintain

When invoked on an existing lesson (update or delete):

Integration

Position in workflow:

mistake/discovery → reflection → lesson-capture skill → lessons/ persisted

Invoked explicitly by a human or when an agent's contract or prompt requires lesson capture.

Session initialization: Agents read the lesson index in GUARDRAILS.md. When a trigger matches current work, read the linked file under lessons/agents/ before proceeding.

Discovery limitation: The trigger+keyword model relies on agents predicting which lessons are relevant. This handles known-unknowns (agent recognizes the trigger) but cannot surface unknown-unknowns (agent working on CSV export won't search for "file locking" until it's already hit the problem). Mitigation: write triggers and keywords broadly enough to match adjacent situations, not just the exact scenario where the lesson was learned.

Relation to other artifacts:

Anti-patterns

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.