| name | self-improving-agent |
| description | Self-improvement logging and closed loop: triggered when commands/operations fail, user corrects, knowledge is outdated, external API fails, or a reusable better approach appears. Review historical learnings before important tasks. Avoid triggering during casual chat, temporary mistakes that don't need recording, or when user explicitly says not to record. |
| metadata | {"language":"en","scope":"minis"} |
Self-Improvement Skill (Minis Edition)
This skill is used within the Minis environment to record errors, corrections, and reusable best practices, forming a traceable learning closed loop.
Minis Directory Convention
- Working directory:
/var/minis/workspace/
- Skill default learning log directory:
/var/minis/skills/self-improving-agent/data/
- Skill public learning log directory (after promotion):
/var/minis/skills/self-improving-agent/data/public/
- Project-level learning log directory (optional):
<project>/.learnings/
- Learning log files:
LEARNINGS.md (corrections, knowledge gaps, best practices)
ERRORS.md (command failures, exceptions)
FEATURE_REQUESTS.md (capabilities proposed by user)
By default, write to the skill's own data directory; when you explicitly specify a project, write to the project-level log; when the issue has been abstracted into a cross-project general rule, promote to the intra-skill public area or Minis memory system.
Current Final Rules
- Default recording location:
/var/minis/skills/self-improving-agent/data/
- Skill public area:
/var/minis/skills/self-improving-agent/data/public/
- Project-level recording: use
<project>/.learnings/ only when --project <path> is explicitly passed
- Recommended public flag:
--public
- Compatibility alias:
--workspace still works but is no longer recommended
- Promotion behavior:
promote <entry-ID> copies the entry to the skill public area, auto-marks the source entry as promoted, writes back **Promoted to** and ### Resolution
- Duplicate protection: if the entry already exists in the skill public area, repeated
promote will not duplicate it
Quick Reference
| Scenario | Action |
|---|
| Command/operation fails | Default record to skill dir data/ERRORS.md |
| User corrects you | Default record to skill dir data/LEARNINGS.md, category correction |
| User needs missing capability | Default record to skill dir data/FEATURE_REQUESTS.md |
| Explicit project context provided | Record to <project>/.learnings/ |
| External API/tool fails | Record to current scope's ERRORS.md, include integration details |
| Knowledge outdated | Record to current scope's LEARNINGS.md, category knowledge_gap |
| Found a better approach | Record in current scope first, promote after confirming generality |
| Same issue recurs across multiple projects | Promote to skill public area data/public/ |
| Similar to existing entry | Link with **See Also**, consider promotion priority |
| Widely applicable experience | Promote to skill public area or Minis memory (see "Promote to Minis Memory" below) |
Trigger Recording Rules (Minis Runtime Convention)
Note: This skill does not auto-monitor in the background by default. When trigger conditions are met, the assistant (or you) proactively calls scripts/minis_auto_log.sh to write to disk.
Suggested "Must Record" Trigger Conditions
Any of the following should be recorded (unless you explicitly say "don't record"):
- Command/operation fails non-trivially: e.g., permission, path, dependency, network, third-party API exceptions require investigation to locate.
- User corrects: you point out where I misunderstood, logic doesn't match the software's actual behavior, path/spec is wrong.
- Knowledge update/outdated correction: discovered previous assumptions don't fit Minis, or docs/implementation need correction.
- Reusable better approach: forms a stable practice, convention, template, or workflow that significantly reduces rework.
- Recurring pattern: same issue repeats within a task, or across tasks/projects.
Generally Not Recorded
- Casual chat, one-time small changes, trivial details without reuse value.
- You explicitly say "don't record".
Recording Location Suggestions
- Default write to skill area
data/.
- After confirming cross-task reuse value, use
promote to promote to skill public area data/public/.
Difference from Minis Memory and Promotion Standards
Difference (suggested understanding)
- This skill's logs (
data/ and data/public/) are an editable work review repository: records context, troubleshooting process, solution evolution, allowing long text and details.
- Minis memory (
memory_write writes to /var/minis/memory/) is cross-session long-term rules/preferences: should be short, stable, reusable; poorly written rules can "contaminate" future decisions long-term.
Write Choice (log first, then refine into memory)
- First write to this skill's log: when content needs context (error output, investigation path, comparison of solutions), unsure if generally applicable, or still iterating.
- Then promote to memory: when the conclusion is stable, cross-task/cross-skill applicable, and can be expressed in one sentence.
When to Promote to Memory (hard criteria)
Only consider memory_write when any of the following is met:
- Can be condensed into a "next time X happens, do Y" rule, independent of specific project details.
- Recurs >= 3 times in 30 days, or appears in at least 2 different tasks/domains.
- Explicitly belongs to your long-term preference/convention (e.g., tool usage constraints, path conventions, output format rules), and you explicitly say "remember/do this going forward".
Promotion Action Suggestions
- First use
promote to promote to skill public area data/public/ (higher visibility, easier to review).
- Then extract 1-3 short rules from the public entry and use
memory_write to write to daily memory.
Usage Examples
sh /var/minis/skills/self-improving-agent/scripts/minis_auto_log.sh init
sh /var/minis/skills/self-improving-agent/scripts/minis_auto_log.sh learning "Fixed download timeout" "Use chunking and retry"
sh /var/minis/skills/self-improving-agent/scripts/minis_auto_log.sh --project /var/minis/workspace/my-project error "curl request failed" "HTTP 429"
sh /var/minis/skills/self-improving-agent/scripts/minis_auto_log.sh --public feature "Support batch export" "Operations need daily report"
sh /var/minis/skills/self-improving-agent/scripts/minis_auto_log.sh search timeout
sh /var/minis/skills/self-improving-agent/scripts/minis_auto_log.sh promote LRN-20260317-ABC
sh /var/minis/skills/self-improving-agent/scripts/minis_auto_log.sh status
Logging Format
Learning Record
Appended to .learnings/LEARNINGS.md:
## [LRN-YYYYMMDD-XXX] category
**Recorded At**: ISO-8601 timestamp
**Priority**: low | medium | high | critical
**Status**: pending
**Domain**: frontend | backend | infra | tests | docs | config
### Summary
One-line description of what was learned
### Details
Full context: what happened, what went wrong, correct approach
### Suggested Action
Concrete executable improvement or fix
### Metadata
- Source: conversation | error | user_feedback
- Related File: path/to/file.ext
- Tags: tag1, tag2
- Related Entries: LRN-20250110-001 (if related)
- Pattern Key: simplify.dead_code | harden.input_validation (optional, for recurrence pattern tracking)
- Recurrence Count: 1 (optional)
- First Seen: 2025-01-15 (optional)
- Last Seen: 2025-01-15 (optional)
---
Error Record
Appended to .learnings/ERRORS.md:
## [ERR-YYYYMMDD-XXX] skill_or_command_name
**Recorded At**: ISO-8601 timestamp
**Priority**: high
**Status**: pending
**Domain**: frontend | backend | infra | tests | docs | config
### Summary
Brief description of the failure
### Error
Actual error message or output
### Context
- Command/operation attempted
- Input or parameters
- Environment details (if relevant)
### Suggested Fix
If identifiable, give possible solution
### Metadata
- Reproducible: yes | no | unknown
- Related File: path/to/file.ext
- Related Entries: ERR-20250110-001 (if recurring)
---
Feature Request Record
Appended to .learnings/FEATURE_REQUESTS.md:
## [FEAT-YYYYMMDD-XXX] capability_name
**Recorded At**: ISO-8601 timestamp
**Priority**: medium
**Status**: pending
**Domain**: frontend | backend | infra | tests | docs | config
### Required Capability
What the user wants to achieve
### User Context
Why needed, what problem it solves
### Complexity Assessment
simple | medium | complex
### Suggested Implementation
Possible implementation approach and extension points
### Metadata
- Frequency: first_time | recurring
- Related Feature: existing_feature_name
---
ID Generation Rules
Format: TYPE-YYYYMMDD-XXX
- TYPE:
LRN (learning), ERR (error), FEAT (feature)
- YYYYMMDD: current date
- XXX: sequence number or random 3 chars (e.g.,
001, A7B)
Examples: LRN-20250115-001, ERR-20250115-A3F, FEAT-20250115-002
Entry Resolution
When a problem is fixed, update the entry:
- Change
**Status**: pending -> **Status**: resolved
- Add resolution block after metadata:
### Resolution
- **Resolved At**: 2025-01-16T09:00:00Z
- **Commit/PR**: abc123 or #42
- **Note**: Brief description of what was done
Other statuses:
in_progress - being worked on
wont_fix - decided not to fix (write reason in resolution)
promoted - promoted to Minis memory
Promote to Minis Memory
When a learning has broad applicability (not just a one-time fix), it should be promoted to the Minis memory system.
When to Promote
- Learning applies across multiple files/features
- Any contributor (human/AI) should know this
- Prevents repeated mistakes
- Records project conventions
Promotion Target (Minis)
- Daily Memory:
/var/minis/memory/YYYY-MM-DD.md (written via memory_write)
- Global Memory:
/var/minis/memory/GLOBAL.md (read-only, user maintains in settings)
- Project Notes: recommended to write to
/var/minis/workspace/PROJECT_NOTES.md
How to Promote
- Refine: condense learning into concise rules or facts
- Write: use
memory_write to write to daily memory, sync to project notes if necessary
- Back-write: update the original entry:
**Status**: pending -> **Status**: promoted
- Add
**Promoted to**: YYYY-MM-DD.md or PROJECT_NOTES.md
Recurrence Pattern Detection
If the recorded content is similar to an existing entry:
- Search first:
grep -r "keyword" /var/minis/workspace/.learnings/
- Establish relation: add
**See Also**: ERR-20250110-001 in metadata
- Increase priority: if the problem recurs
- Consider systemic fix: recurrence usually means:
- Missing documentation (-> write to PROJECT_NOTES.md or daily memory)
- Missing automation (-> add to scripts or toolchain)
- Architecture issue (-> create tech debt task)
Simplify & Harden Feed
Used to ingest recurring patterns from the simplify-and-harden skill and convert them into persistent prompt rules.
Ingestion Workflow
- Read
simplify_and_harden.learning_loop.candidates from task summary.
- Use
pattern_key as the stable dedup key for each candidate.
- Search
.learnings/LEARNINGS.md for existing entries:
grep -n "Pattern-Key: <pattern_key>" /var/minis/workspace/.learnings/LEARNINGS.md
- If exists:
- Increment
Recurrence-Count
- Update
Last-Seen
- Add
See Also relation
- If not exists:
- Create new
LRN-... entry
- Set
Source: simplify-and-harden
- Set
Pattern-Key, Recurrence-Count: 1 and First-Seen/Last-Seen
Promotion Rules (System Prompt Feedback)
Promote recurring patterns to Minis memory when:
Recurrence-Count >= 3
- Appears in at least 2 different tasks
- Occurs within 30 days
Promoted rules should be short, clear preventive rules (actions to take before/during work), not lengthy postmortems.
Periodic Review
Review .learnings/ at natural checkpoints:
When to Review
- Before starting a new important task
- After completing a feature
- When entering a domain that has past learnings
- Weekly during active development
Quick Status Check
grep -h "Pending" /var/minis/workspace/.learnings/*.md | wc -l
grep -B5 "Priority: high" /var/minis/workspace/.learnings/*.md | grep "^## \["
grep -l "Domain: backend" /var/minis/workspace/.learnings/*.md