agentsclimarketplace

Self learning agent skill

Skill ardha27/self-learning-agent-skill

Portable skill that teaches an LLM agent to improve from its own measured outcomes — no fine-tuning, LLM as reader not author. Works with Claude Code, Codex, Cursor, Gemini, Copilot, and any agent that reads AGENTS.md.

Install
npx -y skills add ardha27/self-learning-agent-skill

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its author says it does

Copied from the file, not written here

Use when building an LLM agent that makes repeated decisions with measurable outcomes (trading, deploys, content picks, lead scoring, moderation) and should improve from its own results — especially when the agent repeats past mistakes, ignores what worked before, or its prompt grows unbounded with history.

SKILL.md

6.2 KB, ~1.4k tokens by cl100k_base, as published. Nobody here has run it

Self-Learning Agent Architecture

Battle-tested pattern extracted from a production autonomous trading agent (on-chain LP market-making). The agent gets smarter over time without fine-tuning and without the LLM writing its own memory.

Core Principle

The LLM is the reader, never the author, of what was learned. All learning is computed by plain deterministic code from outcome data. The LLM only consumes the results — either as text in its prompt (soft) or as filters that prune its options before it ever sees them (hard).

Two tracks, always both:

TrackMechanismBindingExamples
Softinject learned text into system promptLLM may weigh itepisodic lessons, signal weights, shared lessons, recent-decision log
Hardcode mutates filters/blocklists directlyLLM never sees pruned optionsthreshold evolution, cooldowns, blacklists, deterministic exit rules

If everything is soft, the agent "knows" but still misbehaves. If everything is hard, it can't reason about edge cases. Use both.

The Five Components

  1. Episodic lessons — after each outcome, a template (not the LLM) classifies it (good/neutral/poor/bad) and renders a rule string: PREFER: <conditions> — <evidence> / AVOID: ... / WORKED: / FAILED:. Neutral outcomes are discarded — nothing to learn. Each lesson gets tags, a role, and a confidence score from evidence strength.
  2. Signal weighting ("Darwin") — snapshot all decision signals at decision time; on close, compute each signal's predictive lift (winners vs losers), boost the top quartile ×1.05, decay the bottom ×0.95, clamp to [0.3, 2.5]. (Weight steps are ±5% — distinct from the threshold-evolution step below.) Render as a table in the prompt: "prioritize candidates whose strongest attributes align with high-weight signals."
  3. Threshold evolution — every N outcomes, recompute hard filter values (e.g. minimum quality score) from percentiles of winning vs losing entries, nudge config toward the target by at most ~10% per step (its own knob, larger than the weight step because thresholds chase a computed target rather than compounding), write an [AUTO-EVOLVED] lesson as the audit trail.
  4. Cooldowns & blocklists — mechanical avoidance with expiry: one bad-yield close → 4h cooldown on that entity; 3 consecutive same-failure closes → 12h cooldown on entity and its parent. Permanent blocklists for known-bad actors. Checked in code before candidates reach the LLM.
  5. Collective sync (optional) — push lessons + outcome events to a shared server fire-and-forget; pull score-curated lessons from other agents into a local cache, inject top-K under a separate prompt section. Only worth it when ≥2 independent instances run the same decision domain (or a community server exists); a solo agent gains nothing and adds an attack surface. Sanitize every inbound string (length cap, strip newlines and <> backticks) — shared text enters your prompt, so treat it as prompt-injection surface.

Mapping to Your Domain

The pattern is domain-agnostic; rename the fields. Anchor examples:

ConceptLP/Trading (reference)Content publishingLead scoring
entity / parentpool / base tokenvideo / topic clusterlead / company
outcome_valuePnL USDviews vs baselineconversion
secondary_yieldfees earnedengagement ratereply rate
efficiency% time in rangewatch-time %funnel progress
close_reasonstop_loss, OOR, low_yield48h window, removedwon, lost, ghosted
excluded from win-rate"pumped out of range"platform-removed videoslead went out of business

Calibrate outcome cutoffs per domain — the reference agent's good ≥ +5% is a trading number. Derive yours from baseline percentiles (e.g. good = top ~30% vs your historical median, bad = bottom ~30% or any hard failure) and revisit after ~30 samples.

Roles = one per distinct decision type the LLM makes (enter vs exit; select vs schedule). Keep it to 2–3; more roles than decision types just fragments the lesson pool.

Prompt Injection Budget (critical)

Never dump all memory into the prompt. Three capped tiers per cycle: PINNED (always, ~5) → ROLE-MATCHED (tag-filtered per agent role, ~6) → RECENT (fill, ~10), plus SHARED (~4). Sort bad outcomes first — avoiding repeat mistakes beats repeating wins.

Safeguards That Make It Work

  • Cold start: below minSamples, weights stay at 1.0 and thresholds stay at conservative hand-set values — only the lesson log accumulates (it's useful from outcome #1). Learning systems activate themselves once data exists; don't special-case.
  • Require both wins and losses (and a minimum sample count in a rolling window) before recomputing weights/thresholds — otherwise skip.
  • Evolve slowly (±5% per step, hard floor/ceiling) so one lucky streak can't flip the strategy.
  • Snapshot signals at entry, not at close — else you learn from exit conditions.
  • Exclude outcome categories that don't reflect signal quality from win-rate stats (e.g. "price pumped out of range" is not a bad entry).
  • Every store that echoes into the prompt gets sanitized on write.
  • All learning state in plain JSON files — inspectable, diffable, deletable.

Common Mistakes

MistakeFix
Letting the LLM write its own lessonsTemplate-derive from outcome data; LLM-authored memory drifts and self-reinforces
Unbounded lesson injection3-tier caps; prompt cost stays flat as history grows
Recalc on every outcomeBatch every N closes with min-sample gate; reduces noise
Only soft learningAdd hard gates; "the model knows" ≠ "the model complies"
Trusting shared/external lessonsSanitize + cap + separate prompt section

Detailed data shapes, algorithms, and pseudocode: see reference.md.

What ships with it: 6 files

17.6 KB alongside SKILL.md, 1 of them executable

Gives 0 of the 12 instructions most context ai engineering skills give in ~1.4k tokens

Counted across 1,193 of the 1,976 authors here whose files we hold, read 2026-08-07

  • Dispatch a fresh implementer subagent per taskin 48 of 1193, across 19 files
  • Dispatch a final code reviewer after all tasksin 33 of 1193, across 8 files
  • Provide full task text to the subagentin 30 of 1193, across 9 files
  • Review spec compliance before code qualityin 27 of 1193, across 10 files
  • Make the hook script executablein 26 of 1193, across 8 files
  • Re-snapshot after navigation or DOM changesin 25 of 1193, across 19 files
  • Read files before editing themin 22 of 1193, across 11 files
  • Answer subagent questions before proceedingin 22 of 1193, across 7 files
  • Mark task complete in TodoWrite after approvalin 22 of 1193, across 6 files
  • Merge hook into existing settingsin 21 of 1193, across 3 files
  • Ask if installation is global or projectin 20 of 1193, across 2 files
  • Copy the hook script to target locationin 20 of 1193, across 2 files

Said here and by no other author read

  • use deterministic code for learning
  • inject learned text into prompt
  • mutate filters directly in code
  • classify outcomes using templates
  • snapshot signals at decision time
  • recompute filters every N outcomes

Grouped from the skills themselves: near-identical wordings counted once, and counted by distinct author, so one author publishing three of these counts once. Length counted with cl100k_base; the agent that loads this file may tokenize it differently.

Keep looking

Skills are one crate of 326,984. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.