Skip to content
cccskills
FreePublished on GitHub

error-learning

**WORKFLOW SKILL** — Register and generalize agent errors into reusable lessons. USE FOR: when the user corrects the agent, capturing what went wrong, analyzing root cause, generalizing the error into a lesson that prevents recurrence. Use to register errors, analyze mistakes, create lessons, generalize corrections. DO NOT USE FOR: general debugging, writing tests, code review.

The English summary is being prepared. Showing the original description.

See how to install

Files included (2)

  • SKILL.md6.2 KB
  • FEEDBACK.md1.3 KB

SKILL.md (original)

Review the instructions the agent will receive before you install.

Error Learning — Register, Generalize, Prevent

You made a mistake and the user corrected you. This is valuable signal. Your job is to turn this correction into a reusable lesson that prevents you — and future agents — from repeating it.

1. Analyze the Error

When the user points out a correction, identify EXACTLY what went wrong. Classify the root cause:

CauseDescriptionExample
wrong-assumptionAssumed something without verifying"Assumi que a API aceitava array mas aceita string"
missing-contextDidn't read/search before acting"Editei sem ler o estado atual do arquivo"
unknown-patternDidn't know the correct pattern"Não sabia que PS 5.1 não suporta ternary"
wrong-scopeSolved the wrong problem"Corrigi o sintoma, não a causa raiz"
skipped-verificationDidn't test/validate before delivering"Não rodei os testes antes de commitar"

Be honest. The cause determines how useful the lesson will be.

2. Generalize

Transform the specific case into a generic rule that covers SIMILAR scenarios:

  • Specific: "errei neste regex de conventional commits"
  • Generic: "sempre validar regex contra spec oficial quando envolve padrão público"

The generalization must cover more than the exact case. Ask yourself: "In what other situations would this same mistake happen?" — that's the scope of your rule.

Bad generalization: "não errar em conventional commits regex" (too narrow — just restates the error). Good generalization: "validar qualquer regex-based matching contra a spec/fonte autoritativa antes de usar" (covers all pattern-matching against public standards).

3. Persist as Lesson

Create a lesson file:

  • Location: ~/.copilot/lessons/ (create directory if it doesn't exist)
  • Name: L{NNN}-{slug}.md — NNN is zero-padded sequential, slug is kebab-case of the title
  • Before creating: check existing files to determine the next sequential ID

Template

---
id: L{NNN}
tags: [{action}, {domain}]
confidence: 0.7
created: {YYYY-MM-DD}
cause: {cause-classification}
---

# {Title — imperative, max 60 chars}

## Resumo
{Max 2 lines. This is what gets injected into agent context by the lesson-injector hook.
Keep it dense and actionable — the hook injects ONLY this.}

## Registro
- **O que aconteceu**: {describe the concrete error}
- **Causa raiz**: {classification} — {explanation of why it happened}
- **Correção aplicada**: {what the user corrected}
- **Generalização**: {generic rule derived from this case}

Rules for the Template

  • The Resumo MUST be max 2 lines — it's the injected payload. Dense and actionable.
  • The id is sequential — list ~/.copilot/lessons/L*.md and increment from the highest found. Start at L001 if no lessons exist.
  • confidence starts at 0.7 for direct user corrections. Higher confidence (0.8-0.9) is reserved for lessons confirmed by multiple occurrences.

4. Assign Tags

Tags determine when the lesson-injector hook surfaces this lesson. Use relevant combinations:

Action tags (what the agent was doing): create, modify, delete, search, configure, fix

Domain tags (what area was involved): file-operations, git, regex, api, testing, hooks, agents, skills, shell, cross-platform, yaml, json, markdown, dependencies

Assign 2-4 tags per lesson. At least one action tag and one domain tag.

5. Confirm with the User

Before saving the lesson file, present:

  1. The generalization you derived
  2. The tags you chose
  3. The resumo (2-line summary)

Ask: "Essa generalização faz sentido? Cobre bem o cenário?"

Only save after the user confirms or adjusts.

6. Consolidation (30+ lessons)

When the lessons directory has 30 or more active lessons:

  1. Identify clusters — lessons with the same cause classification or overlapping tags
  2. Propose merges — combine similar lessons into one broader lesson with higher confidence
  3. Archive absorbed lessons — move merged originals to ~/.copilot/lessons/archive/
  4. Resequence is NOT needed — IDs are permanent identifiers, gaps are fine

Merge Example

Before:

  • L003 — "Ler arquivo antes de editar" (tags: modify, file-operations)
  • L012 — "Verificar estado do git antes de commit" (tags: modify, git)
  • L018 — "Checar config existente antes de alterar" (tags: modify, configure)

After merge:

  • L031 — "Sempre verificar estado atual antes de qualquer modificação" (tags: modify, file-operations, git, configure) — confidence: 0.85

Archived: L003, L012, L018 → ~/.copilot/lessons/archive/

Rules

  • NEVER save a lesson without user confirmation of the generalization
  • NEVER write a resumo longer than 2 lines — the hook has a 500-char context budget
  • ALWAYS check existing IDs before creating a new lesson — avoid ID collision
  • ALWAYS classify the root cause — "I made a mistake" is not a classification
  • ALWAYS generalize beyond the specific case — a lesson that only covers one scenario is a note, not a lesson
  • Confidence starts at 0.7 — only increase when the same lesson prevents a recurrence or the user explicitly validates it as high-value

Integration with lesson-injector Hook

The lesson-injector hook (~/.copilot/hooks/scripts/lesson-injector.ps1) automatically injects relevant lessons from ~/.copilot/lessons/ into the agent's context at PreToolUse. This closes the feedback loop:

  1. User corrects agent → error-learning skill creates a lesson
  2. Next interaction → lesson-injector hook injects relevant lessons
  3. Agent avoids repeating the same mistake

You don't need to manually reference lessons — the hook handles injection based on tags and relevance.

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

<What it does, one line>. Trigger phrases: <phrases>.

The English summary is being prepared. Showing the original description.

gabrielmoreira/agent-skills-mirror19Updated Oct 18, 2026

Use this skill whenever the user wants to create or improve a presentation for an academic context — conference papers, seminar talks, thesis defenses, grant briefings, lab meetings, invited lectures, or any presentation where the audience will evaluate reasoning and evidence. Triggers include: 'conference talk', 'seminar slides', 'thesis defense', 'research presentation', 'academic deck', 'academic presentation'. Also triggers when the user asks to 'make slides' in combination with academic content (e.g., 'make slides for my paper on X', 'create a presentation for my dissertation defense', 'build a deck for my grant proposal'). This skill governs CONTENT and STRUCTURE decisions. For the technical work of creating or editing the .pptx file itself, also read the pptx SKILL.md.

The English summary is being prepared. Showing the original description.

gabrielmoreira/agent-skills-mirror19Updated Oct 18, 2026

adapt

Free

Shortest English alias for web-adapt / universal-web-adaptation. Use this when adapting an unfamiliar public website generically before creating any site-specific rules.

The English summary is being prepared. Showing the original description.

gabrielmoreira/agent-skills-mirror19Updated Oct 18, 2026

Use this skill to audit CLI adapter projects (like opencli) for missing output fields, then batch-generate fixes and submit PRs. Turns AI agents into adapter quality reviewers.

The English summary is being prepared. Showing the original description.

gabrielmoreira/agent-skills-mirror19Updated Oct 18, 2026

ads

Free

Operate professional paid advertising across Google, Meta, YouTube, LinkedIn, TikTok, Microsoft, Apple, Amazon, Reddit, Pinterest, Snapchat, and X. Use for account intake, source-grounded audits, strategy, budget and measurement planning, creative production, experiments, reporting, monitoring, and explicitly approved campaign changes. Also trigger on PPC, paid social, retail media, attribution, tracking, landing pages, cross-platform conversion totals, negative keywords or search terms, beta-feature scoring, stale platform claims, API-token or credential setup, campaign deletion, and safe Claude Ads installation or uninstall.

The English summary is being prepared. Showing the original description.

gabrielmoreira/agent-skills-mirror19Updated Oct 18, 2026

Audit Amazon Ads profiles, regions, Sponsored Products, Sponsored Brands, Sponsored Display, DSP, portfolios, targeting, search terms, retail readiness, creative, budgets, ACOS, TACOS, reporting, and policy. Use for Amazon Ads, sponsored ads, Amazon PPC, ACOS, TACOS, ASIN advertising, Amazon DSP, or retail-media optimization.

The English summary is being prepared. Showing the original description.

gabrielmoreira/agent-skills-mirror19Updated Oct 18, 2026

See all skills by gabrielmoreira

Report a problem with this skill