agentleFS
abhaylaabhayla/claude-best-practices/.claude/skills/self-improve/SKILL.md

self-improve

Skill9 starsChanged 7 months agoMITView on GitHub

Run the full self-improvement cycle: scan external sources (GitHub, Reddit, Twitter), classify discoveries, check against registry, capture session learnings, and propose new patterns. Use when starting a session, after completing work, or when you want to pull in external best practices.

39 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use ecosystem-reference, fractal-delegation and 10 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.
  • naman10parikhSkill

    ecosystem-reference

    Quick-access directory of Claude Code ecosystem repos, skills, plugins, MCPs, and patterns. Use when improving the harness.

    Also in 5 projects that use this

  • naman10parikhSkill

    fractal-delegation

    Also in 5 projects that use this

  • aaronjmarsSkill

    aeon-update

    Pull framework updates from the upstream Aeon repo into this instance - 3-way merges canon's new commits into a PR, never clobbering operator config.

    Also in 4 projects that use this

  • aaronjmarsSkill

    auto-workflow

    Two-mode aeon.yml workflow builder - analyze inspects URLs and emits a tiered, signal-verified skill-enablement plan plus an aeon.yml diff; enable flips slugs to enabled:true and opens a PR.

    Also in 4 projects that use this

  • +6 more from naman10parikh
  • +2 more from aaronjmars

The file

Show its rules and text

We split this skill into the rules it gives an agent

18 rules. 0 are common, 10 are distinctive, and 8 are very specific to this project.

  • 0

    Common

    Most of the 33 edited versions we read keep these.

  • 10

    Distinctive

    This author's own choices. Worth a look.

  • 8

    Very specific

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

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

    Read $ARGUMENTS and determine mode:

    line 34
  2. Very specific:

    No flag or --review → run Step 4 only

    line 39
  3. Distinctive:

    Search for Claude Code patterns from external sources.

    line 45
  4. Very specific:

    Use the /github skill to search for patterns:

    line 49
  5. Very specific:

    Use the /reddit skill to search r/ClaudeAI for recent tips:

    line 60
  6. Distinctive:

    Read the post-failure capture log for this session:

    line 101
  7. Distinctive:

    If failures exist, feed them into the learning database as error-fix-lesson triples (even if the fix hasn't been found yet — the error …

    line 108
  8. Very specific:

    If test-related learnings were captured, also feed them into /test-knowledge:

    line 113
  9. Very specific:

    Read the most recent session file from .claude/sessions/:

    line 121
  10. Distinctive:

    If a session file exists, extract learning signals:

    line 127
  11. Distinctive:

    If auto-queue candidates exist (>=85 confidence, high trust), present them to the user with a recommendation to import.

    line 182
  12. Very specific:

    Check .claude/learnings.json for pattern detection triggers:

    line 196
  13. Very specific:

    Check config/urls.yml for degraded or expired sources:

    line 203
  14. Distinctive:

    MUST NOT auto-import patterns without user approval — auto-queue only PRESENTS candidates

    line 233
  15. Distinctive:

    MUST NOT degrade source trust without evidence (test failure, user correction, or pattern rejection)

    line 234
  16. Distinctive:

    MUST run discovery adapter dedup before registering any finding — never create duplicate entries

    line 235
  17. Distinctive:

    MUST cite the source for every discovery: "found in github:owner/repo" or "seen on reddit:r/ClaudeAI"

    line 236
  18. Distinctive:

    Default mode is review (read-only) — scanning and learning require explicit flags

    line 238

“Common” is measured: kept by at least 6 in 10 of the 33 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-Improve — Autonomous Learning & Discovery Pipeline

Single entry point for the hub's self-improvement system. Combines external discovery, session learning, and pattern proposal into one workflow.

Arguments: $ARGUMENTS

Modes

ModeFlagWhat It Does
Review(default)Show pending discoveries, session stats, and improvement suggestions
Scan--scanSearch external sources (GitHub, Reddit, Twitter) for new patterns
Learn--learnCapture learnings from current session + check failure logs
Full--fullRun scan + learn + review in sequence

STEP 1: Parse Mode

Read $ARGUMENTS and determine mode:

  • --full → run Steps 2, 3, 4, 5 in sequence
  • --scan → run Step 2 only
  • --learn → run Step 3 only
  • No flag or --review → run Step 4 only

STEP 2: External Discovery Scan

Search for Claude Code patterns from external sources.

2A: GitHub Search

Use the /github skill to search for patterns:

Skill("github", args="search code SKILL.md path:.claude/skills language:markdown stars:>10")

For each result, extract name, type, content preview, and whether it has proper frontmatter.

2B: Reddit Scan

Use the /reddit skill to search r/ClaudeAI for recent tips:

Skill("reddit", args="search r/ClaudeAI claude code tips sort:new limit:10")

Extract actionable patterns from high-engagement posts (upvotes > 10).

2C: Register Discoveries

For each finding, register via the discovery adapter:

PYTHONPATH=. python scripts/discovery_adapter.py --add '{
  "name": "<pattern-name>",
  "type": "<skill|agent|rule|hook>",
  "source": "<github:owner/repo|reddit:r/subreddit|twitter:@handle>",
  "source_trust": "<high|medium|low>",
  "content": "<first 200 chars>",
  "has_frontmatter": true,
  "has_steps": false,
  "community_signal": 15
}'

Report: how many new discoveries, how many duplicates, how many already in registry.


STEP 3: Session Learning Capture

3A: Run Learn-n-Improve

Invoke the learning skill to capture session outcomes:

Skill("learn-n-improve", args="session")

3B: Check Failure Logs

Read the post-failure capture log for this session:

SESSION_ID=${CLAUDE_SESSION_ID:-default}
cat "${TMPDIR:-/tmp}/claude-failure-log/session-$SESSION_ID.jsonl" 2>/dev/null

If failures exist, feed them into the learning database as error-fix-lesson triples (even if the fix hasn't been found yet — the error context is valuable).

3C: Wire Test Knowledge

If test-related learnings were captured, also feed them into /test-knowledge:

Skill("test-knowledge", args="add <learning-summary>")

3D: Analyze Session Checkpoints

Read the most recent session file from .claude/sessions/:

ls -t .claude/sessions/*.md 2>/dev/null | head -1

If a session file exists, extract learning signals:

  1. Blocked tasks — scan for tasks marked blocked or in-progress that were never completed. Each blocked task is a potential skill gap or missing capability. Record as a learning with tag session-blocked.
  2. Decision themes — scan the "Key Decisions" section for recurring patterns. If the same type of decision appears across multiple session files (e.g., "chose X over Y for testing"), it may warrant a rule. Compare against the 3 most recent session files if available:
    ls -t .claude/sessions/*.md 2>/dev/null | head -3
  3. File hotspots — extract the "Working Files" section and count which files appear most frequently across recent sessions. Files modified in 3+ sessions are change hotspots — flag for potential refactoring or dedicated rule creation.
  4. Session duration signal — if a session has many completed tasks but also many blocked tasks, the session was productive but hit walls. Record the blocked-to-completed ratio as a learning metric.

Feed findings into the learning database:

PYTHONPATH=. python scripts/discovery_adapter.py --add '{
  "name": "session-pattern:<pattern-name>",
  "type": "rule",
  "source": "session:.claude/sessions/<filename>",
  "source_trust": "high",
  "content": "<finding summary>",
  "has_frontmatter": false,
  "community_signal": 0
}'

Session-derived discoveries get high trust — they come from direct observation of real work, not external sources.


STEP 4: Review Pending Improvements

4A: Discovery Pipeline Status

PYTHONPATH=. python scripts/discovery_adapter.py --stats

4B: Auto-Queue Candidates

PYTHONPATH=. python scripts/discovery_adapter.py --auto-queue

If auto-queue candidates exist (>=85 confidence, high trust), present them to the user with a recommendation to import.

4C: Convergent Evolution

PYTHONPATH=. python scripts/discovery_adapter.py --convergent

Patterns found in 3+ independent sources are strong candidates for hub promotion. Highlight these prominently.

4D: Learning Pattern Alerts

Check .claude/learnings.json for pattern detection triggers:

  • Tags appearing in >30% of learnings → systemic issue
  • Files with 3+ learnings → fragile code hotspot
  • Workflow patterns seen 3+ times → skill promotion candidate

4E: Source Health Check

Check config/urls.yml for degraded or expired sources:

PYTHONPATH=. python scripts/check_freshness.py

Report any expired or degraded sources that need attention.


STEP 5: Propose Improvements

Based on findings from Steps 2-4, propose concrete actions:

FindingProposed Action
Auto-queue candidate (>=85, high trust)"Import pattern X — run /skill-factory create <name>"
Convergent pattern (3+ sources)"Promote to hub — pattern X found in N independent sources"
Systemic learning tag (>30%)"Create rule for <tag> — run /claude-guardian"
Workflow pattern (3+ repeats)"Create skill — run /writing-skills"
Degraded source"Review source <url> — trust downgraded due to <reason>"
Expired source"Re-verify or remove <url> — expired <N> days ago"

Present findings as a prioritized list. Each proposal requires user approval before execution.


CRITICAL RULES

  • MUST NOT auto-import patterns without user approval — auto-queue only PRESENTS candidates
  • MUST NOT degrade source trust without evidence (test failure, user correction, or pattern rejection)
  • MUST run discovery adapter dedup before registering any finding — never create duplicate entries
  • MUST cite the source for every discovery: "found in github:owner/repo" or "seen on reddit:r/ClaudeAI"
  • Session learning capture (Step 3) MUST run even if external scan is skipped
  • Default mode is review (read-only) — scanning and learning require explicit flags

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.