agentleFS
dmzoneilldmzoneill/skills/learn-pattern/SKILL.md

learn-pattern

Skill2 starsChanged 19 days agoApache-2.0View on GitHub

Save a new error pattern to memory for future recognition. When you discover a new error pattern and its fix, use this to remember it. Saved to patterns.yaml, matched during investigate_alert and debug_prod.

The file

We split this skill into the rules it gives an agent

3 rules. About 0 are common, 3 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    If commands provided: check tool names exist in MCP registry

    line 33
  2. Distinctive:

    If pattern exists in category: update.

    line 41
  3. Distinctive:

    Write back with last_updated

    line 42

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Learn Pattern

Saves error patterns to memory for future debugging sessions.

Inputs

InputTypeDefaultPurpose
patternstringrequiredShort name (e.g., "OOMKilled", "ImagePullBackOff")
meaningstringrequiredWhat the error means
fixstringrequiredHow to fix it
commandsstring-Comma-separated diagnosis commands
categorystring"general"pod_errors, log_patterns, network, general

Workflow

1. Validate Inputs

  • pattern, meaning, fix required
  • Return error if any missing

2. Parse Commands

  • Split by comma, strip whitespace

3. Optional: Validate Tool Names

  • If commands provided: check tool names exist in MCP registry
  • Warn if CLI commands (kubectl, oc) — suggest MCP tools

4. Save Pattern

  • Read memory/learned/patterns.yaml
  • Ensure category exists
  • Build entry: pattern, meaning, fix, commands (if any)
  • If pattern exists in category: update; else append
  • Write back with last_updated

5. Log (if success)

  • memory_session_log("Learned pattern: {pattern}", "Category: {category}, Action: added|updated")

6. Output

  • Success: "Pattern added/updated", details, "Will be matched during investigate_alert and debug_prod"
  • Failure: validation error or save error

Key MCP Tools

  • memory_read — read patterns (or file read)
  • memory_write / file write — save to memory/learned/patterns.yaml
  • memory_session_log — session logging
  • Alternative: learn_tool_fix for tool-specific fixes (different from general patterns)

Note

For tool-specific fixes (e.g., bonfire_deploy + "manifest unknown"), use learn_tool_fix instead. This skill is for general error patterns used across skills.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.