agentleFS
lalulalilalulali/vespyr/.agents/skills/self-learning/SKILL.md

self-learning

Skill11 starsChanged 11 days agoMITView on GitHub

Promote recurring lessons into house-style instincts. Use when the user says "what have we learned", "promote this pattern", "review patterns", "run self-learning", "check instincts", or invokes /self-learning. Reads episodes from agent notes, curates patterns, and promotes instincts with human approval.

13 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use changelog-style, docs-consistency-check and 4 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • GrinvSkill

    changelog-style

    Turn a commit range into CHANGELOG.md entries following common-changelog style. Use when finishing a PR (adding to the [Unreleased] section) or cutting a release (moving [Unreleased] under a new version heading).

    Also in 4 projects that use this

  • GrinvSkill

    docs-consistency-check

    Check README/manifest.json/server.json/CHANGELOG.md/AGENTS.md and docs/*.md for drift against the actual registered tools and source. Use after adding, renaming, or removing a tool, or as part of a live-audit pass.

    Also in 4 projects that use this

  • MicrosoftSkill

    release

    Use ONLY when the user explicitly asks to cut/publish a Huabu desktop release or tag a version. Performs an outward action — bumps the version in apps/desktop/package.json, commits + annotated-tags vX.Y.Z, and pushes the branch + tag. That tag push auto-builds the macOS/Windows installers and publishes a GitHub Release. Provides `status`, `bump`, `tag-push`, and a one-command `run` (bump → tag-push).

    Also in 4 projects that use this

  • +3 more from Grinv

The file

We split this skill into the rules it gives an agent

6 rules. 0 are common, 1 is distinctive, and 5 are very specific to this project.

  • 0

    Common

    Most of the 9 edited versions we read keep these.

  • 1

    Distinctive

    This author's own choices. Worth a look.

  • 5

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    After a @retro, to decide which lessons are now general practice.

    line 30
  2. Distinctive:

    When the same approach has solved a problem repeatedly across agents.

    line 31
  3. Very specific:

    Do not invoke to record a single one-off lesson — that is a normal @memory-controller write to lessons-learned.md.

    line 34
  4. Very specific:

    If the user invokes /self-learning mid-session, stop:session-end has not captured the current conversation yet.

    line 50
  5. Very specific:

    Run node .agents/scripts/self_learn.js suggest --since=30d to inspect past episodes, promotion candidates, and skill/agent boost …

    line 52
  6. Very specific:

    No action needed. @memory-controller loads instincts.md first at step 0.1 of session start.

    line 93

“Common” is measured: kept by at least 6 in 10 of the 9 edited versions of this file we could read. “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

Self-Learning — episodes → patterns → instincts

What this skill does

This skill runs the 3-tier promotion pipeline defined in Phase 2 F2.11–F2.15. It does not guess: every promotion rule is a mechanical check in .agents/scripts/self_learn.js.

Skill vs. background automation

The skill is the human control surface, not the engine. Two mechanisms do the automatic work:

MechanismWhat it does automaticallyFrequency
stop:session-end hook → self_learn.js auto-captureAppends one Tier-1 episode to .agents/state/episodes.ndjson and records assistant [INSTINCT: ...] cite eventsevery session end
auto-capture digest refreshRebuilds state/self-learning-digest.mdat most once per day

Promotion is never automatic. A pattern becomes a pattern only when you review it and call promote-pattern; an instinct requires explicit --approve. That is deliberate — the plan's anti-patterns forbid auto-promotion. Invoke this skill to review candidates and decide; do not invoke it to "run self-learning", because capture already happened in the background.

When to invoke

  • After a @retro, to decide which lessons are now general practice.
  • When the same approach has solved a problem repeatedly across agents.
  • On demand: "what patterns have we learned?", "promote this to an instinct", "which instincts are stale?"

Do not invoke to record a single one-off lesson — that is a normal @memory-controller write to lessons-learned.md.

The 3 tiers

TierStoragePromotion ruleLifetimeVolume
1 — Episodes.agents/state/episodes.ndjson—until next retrohigh
2 — Patternsartifacts/memory/patterns-and-conventions.md≥3 occurrences, ≥2 agents, ≥7 day span — all requireduntil archived10–50
3 — Instinctsartifacts/memory/instincts.mdpattern stable ≥30 days and referenced by ≥2 ADRs, plus human --approvepermanent until demoted3–10

Instincts are loaded first in every session by @memory-controller under a ~200 token cap. They are the only tier applied automatically.

Procedure

0. Mid-session check (when the session has NOT ended yet)

If the user invokes /self-learning mid-session, stop:session-end has not captured the current conversation yet. Do both:

  1. Run node .agents/scripts/self_learn.js suggest --since=30d to inspect past episodes, promotion candidates, and skill/agent boost suggestions.
  2. Combine that output with what you have learned in the current session (corrections the user made, repeated edge cases, multi-step workarounds, or missing review perspectives) and present concrete suggestions right away:
    • Offer to record a key takeaway now with node .agents/scripts/self_learn.js episode ... so it is not lost before session end.
    • Recommend /create-skill or /create-agent using the Boost Decision Guide below whenever a takeaway outgrows a 1-line instinct. Never auto-create a skill or agent; present the proposed scope and let the user run the command.

Boost Decision Guide (Instinct vs. /create-skill vs. /create-agent)

What you learnedBest targetWhy
Short 1-line rule that applies to every taskInstinct (instincts.md)Always loaded at session start inside the 200-token cap.
Repeatable multi-step workflow, checklist, or script sequenceCustom Skill (/create-skill)Loaded on demand when triggered; keeps the 200-token instinct budget clean.
Missing specialist perspective, guardrail, or domain ownershipCustom Agent (/create-agent)Gives the swarm an independent persona and Socratic challenge stance.

1. Scan episodes

node .agents/scripts/self_learn.js scan-episodes --since=30d
node .agents/scripts/self_learn.js find-patterns --min-occurrences=3 --min-agents=2 --min-span-days=7

Review each candidate title. The clustering is lexical, so merge obvious synonyms by hand before promoting.

2. Promote a pattern

node .agents/scripts/self_learn.js promote-pattern \
  --title="{stable pattern}" --occurrences=3 --agents=@developer,@qa-engineer --last-seen=YYYY-MM-DD

The script updates occurrences and last_seen when the pattern already exists — it never creates a duplicate. Every promotion is human-reviewed: you chose the candidate from step 1.

3. Promote an instinct (human-in-the-loop)

node .agents/scripts/self_learn.js promote-instinct --pattern="{pattern title}" --approve

The script refuses without --approve, and refuses when the pattern is younger than 30 days or has fewer than 2 ADR references. Never bypass those checks.

4. Auto-load

No action needed. @memory-controller loads instincts.md first at step 0.1 of session start. When you apply an instinct, emit [INSTINCT: INS-NNN] in your response so the citation-rate metric can count it.

5. Maintain

node .agents/scripts/self_learn.js scan                 # writes state/self-learning-digest.md
node .agents/scripts/self_learn.js scan-patterns --stale  # last_seen > 90d AND occurrences < 3
node .agents/scripts/self_learn.js instinct-cost --since=7d
node .agents/scripts/self_learn.js demote-instinct --id=INS-001 --reason="..."

Stale patterns are archive candidates, not automatic deletions. Demotion is explicit and records a reason under ## Demoted Instincts.

Outcome metrics (F2.15.a–c)

MetricDefinitionTarget
Instinct citation ratesessions with a cite ÷ sessions with a load, per instinct, 14d window>50%, report only with ≥10 standard-mode sessions — directional, not a gate
Pattern freshnesslast_seen > 90d AND occurrences < 3 → stalearchive candidate
Token cost of instinctsinstinct-cost --since=7d: total / avg / p95 / over_capcap 200 tokens; if over_cap_count > 0, @retro Step 1 produces demotion candidates

Anti-patterns

  • Promoting on age alone — a pattern must clear occurrences, agents and span.
  • Auto-promoting an instinct — --approve is a human gate, never implied by a skill step.
  • Deleting a demoted instinct or pattern — move it to the demoted section / archive.
  • Over-fitting one session's vocabulary into a "house style".
  • Treating the citation rate as a gate — it is directional (09 risk R39).
  • Writing episodes directly into instincts.md — that bypasses the whole pipeline.

Done when

  • scan produced state/self-learning-digest.md.
  • Any promoted pattern shows occurrences, agents, and last_seen.
  • Any instinct has a source pattern, ADR evidence, and a human approval record.
  • Stale patterns and over-cap instincts have named owners (default: @retro Step 1).

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.