# Capture Learnings and Errors for Continuous Improvement

AI coding agents often repeat the same mistakes across sessions. This skill enables Claude, Codex, and Claude Code to log learnings, errors, and corrections to local markdown files, promoting better solutions to project memory.

## Install

```bash
npx skillstore add peterskoett/self-improvement
```

## Metadata

- - Slug: peterskoett-self-improvement
- - Version: 1.0.1
- - Author: peterskoett
- - GitHub username: peterskoett
- - License: MIT
- - Repository: https://github.com/peterskoett/self-improving-agent/tree/master/
- - Ref: master
- - Supported tools: Claude, Codex, Claude Code
- - Risk level: low
- - Risk factors: filesystem
- - Quality score: 89
- - Quality tier: featured
- - Public page: https://skillstore.pages.dev/skills/peterskoett-self-improvement
- - Manifest: https://skillstore.pages.dev/api/skills/peterskoett-self-improvement/manifest

## Capabilities

- Log corrections and errors to .learnings/ directory with structured markdown format
- Categorize entries as learnings, errors, or feature requests
- Promote valuable learnings to CLAUDE.md, AGENTS.md, or project memory
- Extract proven learnings into standalone skills for reuse
- Integrate with Claude Code and Codex via optional hooks
- Provide session reminders to review and capture learnings

## Use Cases

- Error Knowledge Retention: When Claude makes a mistake and you correct it, log the learning so future sessions avoid the same error. Example: 'Docker build fails on M1 without --platform flag'.
- Team Knowledge Sharing: Commit learnings to the repo so all team members and agents benefit from collective experience. Useful for onboarding new team members or AI agents.
- Skill Extraction Pipeline: When a learning pattern proves useful across multiple projects, extract it into a standalone skill. This creates reusable expertise that can be shared or published.

## Prompt Templates

### Log a Correction

```
I need to log a correction. The previous approach was wrong because [reason]. The correct approach is [solution]. Please log this to .learnings/LEARNINGS.md with category 'correction'.
```

### Log an Error

```
A command failed with this error: [error message]. This happened when trying to [context]. Please log this to .learnings/ERRORS.md with suggested fix if identifiable.
```

### Review Learnings Before Task

```
Before starting this task, please review .learnings/LEARNINGS.md and .learnings/ERRORS.md to see if there are relevant past learnings I should remember.
```

### Extract Learning to Skill

```
This learning has proven useful multiple times. Please extract it into a standalone skill at skills/[skill-name]/SKILL.md using the self-improvement skill extraction workflow.
```

## Limitations

- Does not automatically fix errors or apply learnings
- Requires manual hook setup for automatic reminders
- Learnings persist locally and may need team distribution
- Does not analyze or summarize entries automatically

## Best Practices

- Log immediately after errors or corrections while context is fresh
- Include specific reproduction steps and solutions, not just symptoms
- Promote broadly applicable learnings to CLAUDE.md or project memory

## Anti Patterns

- Do not log full error transcripts, stack traces, or raw command output by default
- Do not commit logs containing project-specific secrets or tokens
- Do not log trivial one-off mistakes that have no learning value

## Security Audit

- - Safe to publish: true
- - Audited at: 2026-04-18T01:50:00\+00:00
- - Summary: Static analysis flagged 440 potential issues, but evaluation reveals these are predominantly false positives from markdown documentation and code examples within the skill. The skill is a legitimate self-improvement/learning capture tool that creates local markdown files. No actual malicious code execution, credential exposure, or data exfiltration was found. All flagged 'external\_commands' are backticks used for inline code formatting in documentation. The skill explicitly warns against logging secrets and contains no cryptographic vulnerabilities.

## Stats

- - Views: 148
- - Downloads: 198
- - Favorites: 4
- - Popularity score: 0
