用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/liza-mas/liza --skill lesson-capture命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
基于 SOC 职业分类
正在显示 SKILL.md
| name | lesson-capture |
| description | Capture project-specific operational lessons from mistakes, discoveries, and hard-won insights |
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).
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.
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:
| 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.
Identify the lesson from the current conversation. Look for:
Determine audience:
If unclear, ask: "Is this a lesson for agents, humans, or both?" If both, write two separate lessons tailored to each audience.
Propose the lesson content in the standard format. Present for approval before writing.
Naming convention: kebab-case, descriptive. Examples:
csv-field-escaping.mdfile-locking-shared-state.mddeployment-order-migrations.mdQuality bar:
After the mode-specific gate clears:
GUARDRAILS.md; create the section if absentlessons/humans/README.md; create the file if absent"Lesson captured: [title] → lessons/[audience]/[filename]. Index updated."When invoked on an existing lesson (update or delete):
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:
specs/ — Requirements and architecture (what to build)docs/ — Usage and setup (how to use)lessons/ — Operational knowledge (what we learned)