Recently Written · git

skill-learning

Hermes-style self-improvement for AI coding agents: learn reusable skills from hard tasks

git clone https://github.com/equwal/skill-learning

Log | Files | Refs


commit 7f9af30b350bdcbaee4a34534dae36382dee1902
equwal <13551856+equwal@users.noreply.github.com>
2026-10-03 21:49:27 -0700

Add skill-learning: Hermes-style self-improvement for AI agents

At the end of a hard task the agent patches or creates a reusable SKILL.md
and copies it to the other agents' skill folders. rule-block.md is the
trigger to paste into CLAUDE.md, AGENTS.md, copilot-instructions.md, or
GEMINI.md.

 .gitignore              |  2 ++
 rule-block.md           | 10 ++++++
 skill-learning/SKILL.md | 85 +++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 97 insertions(+)
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..bc791e3
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,2 @@
+.env
+*.bak*
diff --git a/rule-block.md b/rule-block.md
new file mode 100644
index 0000000..6c04970
--- /dev/null
+++ b/rule-block.md
@@ -0,0 +1,10 @@
+<!-- skill-learning:begin -->
+## Self-improvement: learn skills from experience
+
+At the end of each task, after it is verified and committed, run the
+`skill-learning` skill check. If the task took about 5 or more tool calls, hit
+errors before it worked, got a correction from the user, or showed that a
+skill you used is wrong, then patch the matching skill or create a new one.
+Copy it to the skills folders of the other AIs on this computer and commit.
+Most tasks need no skill: skip silently when none of these is true.
+<!-- skill-learning:end -->
diff --git a/skill-learning/SKILL.md b/skill-learning/SKILL.md
new file mode 100644
index 0000000..51215d0
--- /dev/null
+++ b/skill-learning/SKILL.md
@@ -0,0 +1,85 @@
+---
+name: skill-learning
+description: Turn hard-won experience into reusable skills, Hermes Agent style. Use at the end of a task that took many steps, hit errors before it worked, or got a correction from the user; and whenever a skill you followed turned out wrong or outdated. Creates a new SKILL.md or patches an existing one so the next session does the job faster.
+---
+
+# Skill learning
+
+Hermes Agent (Nous Research) improves itself in a closed loop: after hard work
+it writes a skill, and when a skill fails in use it fixes the skill. This skill
+gives the same loop to every AI on this machine.
+
+## When to run
+
+Run this check at the end of a task, after the work is verified and committed.
+Save a skill only if one of these is true:
+
+1. The task took about 5 or more tool calls and the steps will come back.
+2. You hit errors or dead ends, then found the path that works.
+3. The user corrected your approach.
+4. You found a non-obvious workflow, command sequence, or tool quirk.
+5. You followed an existing skill and it was wrong, incomplete, or outdated.
+
+Skip it if none is true. Most tasks need no skill. Never save a one-off
+answer, project facts that the code already shows, or a step a permission
+check denied.
+
+## Patch before you create
+
+1. List the skill folders (see "Where skills live") and read the names and
+   descriptions.
+2. If a skill covers the topic, patch it: fix the wrong step, add the gotcha,
+   update the command. Keep the rest.
+3. Only if nothing covers it, create a new skill.
+
+## Write the skill
+
+Folder: `<skills folder>/<kebab-case-name>/SKILL.md`. Format:
+
+```markdown
+---
+name: <kebab-case-name>
+description: <what it does and WHEN to use it, with the trigger words a future
+  request would contain. One or two sentences.>
+---
+
+# <Title>
+
+## When to use
+## Steps            (numbered, with the exact commands that worked)
+## Gotchas          (the errors you hit and how you got past them)
+## Verify           (the command that proves it worked)
+```
+
+Rules for the content:
+
+- Write steps that worked, not steps you tried. Keep it under about 150 lines.
+- Use exact commands, paths, and flags. Refer to code by symbol name, not by
+  line number.
+- No secrets, tokens, keys, passwords, or personal data. Use environment
+  variable names instead.
+- A skill never weakens a rule in CLAUDE.md, AGENTS.md,
+  copilot-instructions.md, or GEMINI.md. If a skill and a rule conflict, the
+  rule wins; fix the skill.
+- Write in plain English: short sentences, active voice.
+
+## Where skills live
+
+Each AI reads its own folder. Write the skill to your own folder, then copy
+the same `<name>/` folder to the other folders on this computer, so all AIs
+learn it:
+
+| AI | Skills folder |
+|---|---|
+| Claude Code | `~/.claude/skills/` |
+| Codex | `~/.codex/skills/` |
+| Copilot CLI | `~/.copilot/skills/` |
+| Antigravity | `~/.gemini/skills/` and `~/.gemini/antigravity/skills/` |
+
+If a skill is specific to one AI's tools, keep it only in that AI's folder.
+
+## Finish
+
+1. Commit the new or patched skill in each config folder that changed (each
+   is a git repo), then push.
+2. Tell the user in one line: the skill name, created or patched, and why.