self-improving-agent

Log errors, corrections, and reusable learnings into structured Markdown records.

Updated Jul 20, 2026
One-click install
npx skills add https://github.com/lsongdev/skills --skill self-improving-agent-lsongdev
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: self-improving-agent
Source: https://github.com/lsongdev/skills/tree/main/self-improving-agent
Command: npx skills add https://github.com/lsongdev/skills --skill self-improving-agent-lsongdev

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve? AI agents repeat the same mistakes across sessions because failures, user corrections, and discovered best practices are never recorded. This Skill creates a closed-loop feedback system that captures errors, learnings, and feature requests into structured Markdown logs, then promotes proven patterns into long-term memory. ## Core Features & Use Cases - Structured Logging: Records errors (ERR), learnings (LRN), and feature requests (FEAT) with unique IDs, priorities, statuses, and metadata into LEARNINGS.md, ERRORS.md, and FEATURE_REQUESTS.md files. - Scoped Storage: Writes to a skill-level data directory by default, with optional project-level (.learnings/) and public promotion areas for cross-project rules. - Promotion Workflow: The promote command copies mature entries to a public area, marks the source as promoted, and prevents duplicates; stable rules can then be distilled into a memory system. - Use Case: After a shell command fails with a non-obvious cause, run the auto_log.sh error command to record the failure and fix; weeks later, search the logs before a similar task to avoid repeating the diagnosis. ## Quick Start Ask the agent to log the current error or correction using the self-improving-agent skill, for example by running scripts/auto_log.sh with the error or learning subcommand.

Frequently Asked Questions about self-improving-agent

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I log an error or correction for an AI agent?▼

Run scripts/auto_log.sh with the error or learning subcommand followed by a summary and details. The script appends a structured entry with a unique ID, timestamp, priority, and status to ERRORS.md or LEARNINGS.md in the skill's data directory.

How do I promote a learning to long-term memory?▼

Use the promote subcommand with the entry ID to copy it to the public area and mark the source as promoted. Then distill one to three short rules and write them to the memory system when the pattern recurs across tasks.

Can I keep learning logs separate per project?▼

Yes, pass --project with a project path to write logs into that project's .learnings directory instead of the default skill-level data directory. A --base option also supports fully custom log locations.

When should an event not be logged?▼

Skip logging for ordinary chat, one-off minor changes with no reuse value, temporary mistakes, or when the user explicitly asks not to log. The skill targets failures needing investigation, corrections, and reusable patterns.

Why does running auto_log.sh give a permission denied error?▼

The script may lack execute permission in some environments. Invoke it explicitly with sh, for example sh ~/.agents/skills/self-improving-agent/scripts/auto_log.sh init, to avoid the permission error.