curate-lessons
Skill2 starsChanged 8 months agoUnlicenseView on GitHub
Review .ai-lessons/pending.md, deduplicate against existing context files using hybrid grep+semantic comparison, graduate unique lessons into target files. Requires user approval before applying changes.
In this repository70 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- .cursor/rules/00-project-context.mdcCursor rule
- .cursor/rules/01b-component-gen-next.mdcCursor rule
- .cursor/rules/01-component-gen.mdcCursor rule
- .cursor/rules/02-component-tests.mdcCursor rule
- .cursor/rules/03b-vue-doctor.mdcCursor rule
- .cursor/rules/03-react-doctor.mdcCursor rule
- .cursor/rules/04-ui-tweak.mdcCursor rule
- .cursor/rules/05-refactor.mdcCursor rule
- .cursor/rules/06-frontend-code-review.mdcCursor rule
- .cursor/rules/07-fe-repo-scout.mdcCursor rule
- .cursor/rules/08-be-repo-scout.mdcCursor rule
- .cursor/rules/09-web-vitals.mdcCursor rule
- .cursor/rules/10-browser-check.mdcCursor rule
- .cursor/rules/11-api-bind.mdcCursor rule
- .cursor/rules/12-e2e-tests.mdcCursor rule
- .cursor/rules/13-api-mocks.mdcCursor rule
- agents-checkerSkill
- api-bindSkill
- api-mocksSkill
- be-repo-scoutSkill
- browser-checkSkill
- component-gen-nextSkill
- component-genSkill
- component-testsSkill
- curate-lessonsSkill
- e2e-testsSkill
- fe-repo-scoutSkill
- fix-markdownSkill
- frontend-code-reviewSkill
- init-agentSkill
- init-projectSkill
- init-skillSkill
- prSkill
- react-doctorSkill
- refactorSkill
- setup-configsSkill
- skill-auditSkill
- spec-auditSkill
- ui-tweakSkill
- update-ai-setupSkill
- vue-doctorSkill
- web-vitalsSkill
- agents-checkerSkill
- api-bindSkill
- api-mocksSkill
- be-repo-scoutSkill
- browser-checkSkill
- component-gen-nextSkill
- component-genSkill
- component-testsSkill
- e2e-testsSkill
- fe-repo-scoutSkill
- fix-markdownSkill
- frontend-code-reviewSkill
- init-agentSkill
- init-projectSkill
- init-skillSkill
- The first 60 shown.
The file
Show its rules and text
We split this skill into the rules it gives an agent
14 rules. About 0 are common, 8 are distinctive, and 6 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈8
Distinctive · estimate
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 17
Do NOT output per-phase progress to chat during Phase 1–2.
- Very specific: line 26
No parameters required. Reads .ai-lessons/pending.md automatically.
- Distinctive: line 39
If 0 entries → output "No lessons to curate" → STOP
- Distinctive: line 40
If < 3 entries → WARN: "Only N lesson(s) pending.
- Distinctive: line 49
If < 3 entries → WARN: "Only N lesson(s) pending.
- Distinctive: line 63
If 0 candidate files → lesson is likely unique, skip Pass 2
- Distinctive: line 67
Read only the candidate files from Pass 1 (not all 50+ context files)
- Very specific: line 84
If a lesson is self-referential (about curation, context file management, gardener behavior, or AI lesson-learning itself) → classify as …
- Distinctive: line 100
STOP checkpoint: Wait for user approval before applying changes.
- Very specific: line 111
Remove graduated entries from pending.md using Edit (Delta Update Protocol):
- Distinctive: line 113
If the entry spans multiple lines (indented continuation, fenced code blocks), capture the full block including all indented lines
- Very specific: line 115
NEVER use Write to regenerate pending.md — this violates Delta Update Protocol
- Very specific: line 119
Check if .claude/fe-antipatterns/_index.md exists (Glob for the file).
- Very specific: line 120
If a graduated rule maps to an existing anti-pattern in _index.md:
≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
/curate-lessons — Lesson Curation Skill
Gardener Protocol:
.claude/protocols/gardener.md— runs BEFORESKILL COMPLETE.
Verbosity Protocol (SILENT MODE)
- Do NOT output per-phase progress to chat during Phase 1–2.
- Output to chat ONLY: Phase 3 Curation Report, blocker/WARN messages, and the final SKILL COMPLETE block.
Purpose
Review .ai-lessons/pending.md, deduplicate against existing rules, graduate unique lessons into target context files.
Input
No parameters required. Reads .ai-lessons/pending.md automatically.
Phase Checkpoints
STOP if: .ai-lessons/pending.md does not exist or contains 0 entries
WARN if: < 3 entries → "Only N lesson(s) pending. Curate anyway? [y/N]" — wait for user
INFORM: N entries parsed, proceeding to dedupPre-Conditions
.ai-lessons/pending.mdmust exist and contain ≥ 1 lesson- If 0 entries → output "No lessons to curate" → STOP
- If < 3 entries → WARN: "Only N lesson(s) pending. Curate anyway? [y/N]" — wait for user response
Algorithm
Phase 1 — Read & Parse
- Read
.ai-lessons/pending.md - Parse each
- RULE:entry into a list - If 0 entries → output "No lessons to curate" → STOP
- If < 3 entries → WARN: "Only N lesson(s) pending. Curate anyway? [y/N]" → wait for user response. If "n" or no response → STOP
Phase 2 — Dedup Check
For each pending lesson, run a two-pass hybrid dedup:
Pass 1 — Grep Narrowing (cheap, parallel)
- Extract 2–3 most distinctive terms from the lesson text (nouns, technical terms — not generic words like "should", "always", "component")
- Grep each term independently across candidate files (use
files_with_matchesmode):CLAUDE.md.claude/fe-antipatterns/**/*.md.claude/skills/*/SKILL.md
- Collect file paths that match ≥ 2 terms → these are candidate files
- If 0 candidate files → lesson is likely unique, skip Pass 2
Pass 2 — Semantic Comparison (precise)
- Read only the candidate files from Pass 1 (not all 50+ context files)
- For each candidate, compare the lesson's intent against existing rules in that file
- Verdict per lesson:
DUPLICATE— same intent already expressed → cite the specific file and sectionOVERLAP— partially covered but lesson adds specificity → recommend merge targetUNIQUE— no semantic match found
Classification (for UNIQUE and OVERLAP lessons)
Classify the graduation target:
- Global rule (applies to all generated code) →
.claude/rules/git-safety.md - Skill-specific rule → target
skills/{name}/SKILL.md - Code pattern anti-pattern → new or existing
fe-antipatterns/{category}.md
META Classification
If a lesson is self-referential (about curation, context file management, gardener behavior, or AI lesson-learning itself) → classify as META. META lessons target curate-lessons/SKILL.md or .claude/protocols/gardener.md — do NOT graduate them into CLAUDE.md or anti-pattern files.
Phase 3 — Curation Report
Output for user confirmation:
📋 CURATION REPORT
| # | Lesson | Verdict | Target | Action |
|---|--------|---------|--------|--------|
| 1 | [text] | GRADUATE | `.claude/rules/git-safety.md` | Append |
| 2 | [text] | DUPLICATE | fe-antipatterns/react/... | Skip |
| 3 | [text] | OVERLAP | skills/api-bind/SKILL.md | Merge |
| 4 | [text] | META | skills/curate-lessons/SKILL.md | Append |STOP checkpoint: Wait for user approval before applying changes.
Phase 4 — Apply (after user approval)
- Apply Delta Updates (
Edit, notWrite) to target files Move graduated rules from
pending.mdtograduated.mdwith date:- [YYYY-MM-DD] RULE: [text]. Target: [file path]- Remove graduated entries from
pending.mdusingEdit(Delta Update Protocol):- For each graduated entry, set
old_stringto the complete entry text — from- RULE:through (but not including) the next- RULE:line or end of file - If the entry spans multiple lines (indented continuation, fenced code blocks), capture the full block including all indented lines
- Set
new_stringto empty string"" - NEVER use
Writeto regeneratepending.md— this violates Delta Update Protocol
- For each graduated entry, set
Phase 5 — Update Freq (optional)
- Check if
.claude/fe-antipatterns/_index.mdexists (Glob for the file). If not found → skip this phase entirely - If a graduated rule maps to an existing anti-pattern in
_index.md:- Increment its
Freqcolumn (low→med→high) based on recurrence
- Increment its
BANNED
- FORBIDDEN:
Writeon any governed file (Delta Update Protocol) - FORBIDDEN: graduating a lesson without user approval
- FORBIDDEN: deleting
pending.mdorgraduated.md - FORBIDDEN: modifying lessons during dedup — only classify them
- FORBIDDEN: invoking
EditorWritetools in the same response that outputs the Phase 3 Curation Report — Phase 3 (report) and Phase 4 (apply) MUST be separate turns with user approval between them - FORBIDDEN: using
Writeonpending.md— removals MUST useEditwithold_string/new_string(Delta Update Protocol,pending.mdheader:<!-- NEVER rewrite -->)
Quality Gates
| Gate | Criteria |
| Start | pending.md exists with ≥ 1 entry (WARN if < 3, STOP if 0) |
| Dedup | Two-pass hybrid: Grep narrowing → semantic comparison on candidates |
| Verdicts | Each lesson classified: GRADUATE | DUPLICATE | OVERLAP | META |
| Report | Curation table shown to user (Phase 3 output only — no Edit/Write in same response) |
| Separation | Phase 3→4 boundary enforced: user approval received before any file edits |
| Apply | Delta Updates only (Edit, never Write) on all governed files |
| Freq | _index.md existence verified before Freq update (Phase 5) |
Completion
✅ SKILL COMPLETE: /curate-lessons
├─ Framework: N/A
├─ Artifacts: [list of modified files]
├─ Type Check: N/A
├─ Lint: N/A
└─ Coverage: [X graduated / Y pending reviewed]Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

