agentleFS
yeaight7yeaight7/agent-powerups/skills/hard-won-skill-extractor/SKILL.md

hard-won-skill-extractor

Skill6 starsChanged 4 months agoApache-2.0View on GitHub

Use when a tricky bug, non-obvious workaround, hidden gotcha, or undocumented behavior took real debugging effort to discover and should be captured as a reusable learned skill.

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Before extracting a skill manually, ALL three must be true:

    line 20
  2. Very specific:

    If the extracted idea should become a maintained, shareable skill instead of a project-local note, switch to skill-authoring-guide and turn …

    line 71
  3. Distinctive:

    Every learned skill file MUST start with YAML frontmatter.

    line 75
  4. Very specific:

    After the frontmatter, use a pure Markdown body with headings.

    line 77

≈ “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

Hard-Won Skill Extractor

This skill serves to document how to manually extract a useful learned skill into a reusable markdown file.

Core Principle

Reusable skills are not code snippets to copy-paste, but principles and decision-making heuristics that teach an agent HOW TO THINK about a class of problems.

The difference:

  • BAD (mimicking): "When you see ConnectionResetError, add this try/except block"
  • GOOD (reusable skill): "In async network code, any I/O operation can fail independently due to client/server lifecycle mismatches. The principle: wrap each I/O operation separately, because failure between operations is the common case, not the exception."

Quality Gate

Before extracting a skill manually, ALL three must be true:

  • "Could someone Google this in 5 minutes?" → NO
  • "Is this specific to THIS codebase?" → YES
  • "Did this take real debugging effort to discover?" → YES

Recognition Signals

Extract ONLY after:

  • Solving a tricky bug that required deep investigation
  • Discovering a non-obvious workaround specific to this codebase
  • Finding a hidden gotcha that wastes time when forgotten
  • Uncovering undocumented behavior that affects this project

What Makes a USEFUL Skill

  1. Non-Googleable: Something you couldn't easily find via search
  2. Context-Specific: References actual files, error messages, or patterns from THIS codebase
  3. Actionable with Precision: Tells you exactly WHAT to do and WHERE
  4. Hard-Won: Took significant debugging effort to discover

Anti-Patterns (DO NOT EXTRACT)

  • Generic programming patterns (use documentation instead)
  • Refactoring techniques (these are universal)
  • Library usage examples (use library docs)
  • Type definitions or boilerplate
  • Anything a junior dev could Google in 5 minutes

Manual Extraction Workflow

Step 1: Gather Required Information

  • Problem Statement: The SPECIFIC error, symptom, or confusion that occurred
  • Solution: The EXACT fix, not general advice
  • Triggers: Keywords that would appear when hitting this problem again
  • Scope: Almost always Project-level unless it's a truly universal insight

Step 2: Quality Validation

Reject skills that are:

  • Too generic
  • Easily Googleable
  • Vague solutions
  • Poor triggers

Step 3: Save Location

  • Project-level: .skills/<skill-name>.md - Default. Intended to be committed with the repo.

Step 4: Promote if reusable

If the extracted idea should become a maintained, shareable skill instead of a project-local note, switch to skill-authoring-guide and turn it into a proper skill folder with frontmatter, support files, and validation.

Required File Format

Every learned skill file MUST start with YAML frontmatter. Do not write plain markdown without frontmatter.

After the frontmatter, use a pure Markdown body with headings. Do not use XML-like tags such as <Purpose> or <Workflow> as default top-level structure; reserve XML-like delimiters for nested examples, quoted input, external documents, or machine-readable prompt payloads.

Minimum required frontmatter:

---
name: <skill-name>
description: <one-line description>
triggers:
  - <trigger-1>
  - <trigger-2>
---

Skill Body Template

---
name: <skill-name>
description: <one-line description>
triggers:
  - <trigger-1>
  - <trigger-2>
---

# [Skill Name]

## The Insight
What is the underlying PRINCIPLE you discovered? Not the code, but the mental model.

## Why This Matters
What goes wrong if you don't know this? What symptom led you here?

## Recognition Pattern
How do you know when this skill applies? What are the signs?

## The Approach
The decision-making heuristic, not just code. How should an agent THINK about this?

## Example (Optional)
If code helps, show it - but as illustration of the principle, not copy-paste material.

Verification

  • All three quality-gate questions hold: not Googleable in 5 minutes, specific to this codebase, took real debugging effort
  • The saved file starts with YAML frontmatter including name, description, and triggers
  • The body teaches the principle and recognition pattern — not copy-paste code
  • Anti-pattern content (generic patterns, library usage, boilerplate) was rejected, not extracted
  • Truly reusable insights were promoted via skill-authoring-guide instead of staying project-local

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.