SuperAPI AI Directory

self-improvement

General & other

View repository

Updated 10-16 04:59

About this skill

Self-Improvement

Turn high-value lessons from one-off conversations into reusable assets within the project.

Quick Reference

Situation Action
Command/tool failure Record to .learnings/ERRORS.md
User corrects you Record to .learnings/LEARNINGS.md, category correction
User requests a missing capability Record to .learnings/FEATURE_REQUESTS.md
External API failure Record to .learnings/ERRORS.md, including integration details
Knowledge is outdated Record to .learnings/LEARNINGS.md, category knowledge_gap
Discover a better approach Record to .learnings/LEARNINGS.md, category best_practice
Similar to an existing entry Use See Also to link, consider raising the priority
Broadly applicable lesson Promote to CLAUDE.md / AGENTS.md

File structure

.learnings/
├── LEARNINGS.md
├── ERRORS.md
└── FEATURE_REQUESTS.md

When to record

Prioritize recording these situations:

  1. The user corrected your judgment, assumption, or implementation approach
  2. A tool, command, or runtime environment had a non-obvious failure
  3. The user requested a capability the current system does not directly support
  4. You discovered a project constraint, workflow, or best practice worth reusing
  5. Your knowledge is outdated or does not match actual behavior

Do not record these situations:

  1. Obvious, one-off errors
  2. Small problems that can be solved without a retrospective
  3. Generic common knowledge unrelated to the current project

Recording principles

  1. Keep only high-signal information; avoid turning .learnings/ into a noise dump
  2. Write "why this will still be useful later" first, then write "what happened this time"
  3. If it is an error, clearly state reproduction clues and the suggested fix direction
  4. If it is a user correction, clearly state where the original assumption was wrong
  5. Search existing entries before recording; link duplicates with See Also
  6. If the pattern is already stable, consider promoting it to AGENTS.md or extracting a new skill

Recording format

Learning

## [LRN-YYYYMMDD-XXXXXX] correction | knowledge_gap | best_practice

**Logged**: 2026-03-23T10:00:00+00:00
**Priority**: low | medium | high | critical
**Status**: pending
**Area**: frontend | backend | infra | tests | docs | config | runtime

### Summary
一句话说明学到了什么

### Details
说明当时的错误假设、触发条件和正确做法

### Suggested Action
以后应如何避免再次犯错

### Metadata
- Source: user_feedback | error | conversation
- Related Files: path/to/file.py
- Tags: tag1, tag2
- See Also: LRN-20260320-001 (如果与已有条目相关)
- Pattern-Key: correction.api_format (可选,用于重复模式追踪)
- Recurrence-Count: 1 (可选)

---

Error

## [ERR-YYYYMMDD-XXXXXX] auto_logged_error

**Logged**: 2026-03-23T10:00:00+00:00
**Priority**: medium | high
**Status**: pending
**Area**: runtime

### Summary
一句话说明哪里失败了

### Error
```text
具体错误内容
```

### Context
- Step: 3
- Tool: `bash`
- Task: 当前任务摘要

### Suggested Fix
说明后续应怎么复盘或修正

### Metadata
- Reproducible: yes | no | unknown
- Related Files: N/A
- Pattern-Key: tool_error.bash (可选)
- Recurrence-Count: 2 (可选)

---

Feature Request

## [FEAT-YYYYMMDD-XXXXXX] capability_name

**Logged**: 2026-03-23T10:00:00+00:00
**Priority**: medium
**Status**: pending
**Area**: runtime

### Requested Capability
用户需要什么能力

### User Context
为什么需要它

### Complexity Estimate
simple | medium | complex

### Suggested Implementation
可行的最小实现思路

### Metadata
- Frequency: first_time | recurring
- Related Features: N/A

---

Entry lifecycle

Status Meaning
pending New record, pending
in_progress In progress
resolved Fixed/resolved
promoted Promoted to CLAUDE.md / AGENTS.md / new skill
wont_fix Decided not to handle it (explain the reason in Resolution)

When resolving an entry, append a Resolution block:

### Resolution
- **Resolved**: 2026-03-24T09:00:00Z
- **Commit/PR**: abc123 or #42
- **Notes**: 简述做了什么

Duplicate pattern detection

Search existing entries before recording:

grep -r "keyword" .learnings/

If a similar entry is found:

  1. Use See Also to link
  2. Consider raising the priority
  3. If Recurrence-Count >= 3, strongly recommend promoting it to a project rule

Priority guidance

Priority Applicable scenarios
critical Blocks core functionality, risk of data loss, security issues
high Significant impact, common workflows blocked, recurring
medium Moderate impact, has a workaround
low Minor inconvenience, edge cases

Area tags

Area Scope
frontend UI, components, client code
backend API, services, server-side code
infra CI/CD, deployment, Docker, cloud
tests Test files, test tooling
docs Documentation, comments
config Config files, environment variables
runtime Agent runtime, tool execution

Promotion paths

When a learning has been verified multiple times and has cross-task value:

Learning type Promotion target Example
Project convention CLAUDE.md "Use uv as the package manager, not pip"
Workflow rule AGENTS.md "The client must be regenerated after API changes"
Reusable pattern New skill A pattern complex enough to require dedicated guidance

After promotion, update the original entry's Status to promoted, and note **Promoted**: CLAUDE.md。

Skill extraction criteria

When a learning meets any of the following conditions, it can be extracted as a standalone skill:

  • Has 2+ See Also links (recurs repeatedly)
  • Status is resolved and the fix has been verified
  • Non-obvious, requires actual debugging to discover
  • Not limited to a specific project, usable across codebases
  • The user explicitly requests "save this as a skill"

Relationship with native Hooks

Within the project, SelfImprovementHook automatically does these things:

  1. Before running, reminds you to use this skill when necessary
  2. Automatically logs a basic record to ERRORS.md when a tool fails
  3. Automatically raises priority and tracks Pattern-Key when the same tool fails repeatedly
  4. Automatically logs to LEARNINGS.md on user reject/edit feedback
  5. Automatically logs to FEATURE_REQUESTS.md on feature_request feedback

Automatic logging is only a fallback. Truly high-quality learnings still require you to proactively organize them before the task ends.

Periodic review

Review .learnings/:

  • Before starting a new large task
  • After completing a feature
  • When working in an area with historical learnings
grep -h "Status\*\*: pending" .learnings/*.md | wc -l
grep -B5 "Priority\*\*: high" .learnings/*.md | grep "^## \["