data/ERRORS.md
# Errors
openminis/minisskills · GitHub
Self-improvement logging and closed-loop feedback: Trigger when a command or operation fails, the user corrects you, outdated knowledge is identified, an external API fails, or a better reusable solution is found. Review historical learnings before important tasks. Avoid triggering during ordinary chat, for temporary mistakes that do not need to be logged, or when the user has explicitly said not to log.
프로젝트 폴더에서 아래 명령어를 실행하고, 설치할 에이전트를 선택하세요.
npx skills add openminis/minisskills --skill self-improving-agent설치 명령을 직접 실행해야 적용됩니다. 지원 에이전트와 필요한 권한·라이선스는 제작자의 안내를 확인하세요.
data/ERRORS.md# Errors
data/FEATURE_REQUESTS.md# Feature Requests
data/LEARNINGS.md# Learnings ## [LRN-20260317-HMO] category **Recorded Time**: 2026-03-17T14:43:15Z **Priority**: medium **Status**: pending **Domain**: docs ### Summary The default logging location for `self-improving-agent` has been changed to the skill data directory. ### Details Because Minis project directory detection is not stable, the default behavior no longer depends on the current shell working directory. Instead, logs are stored at the fixed path `/var/minis/skills/self-improving-agent/data`; project-level and public areas are available as explicit optional scopes. ### Recommended Action (To be added) ### Metadata - Source: conversation - Scope: skill - Base path: /var/minis/skills/self-improving-agent/data - Related files: (optional) - Tags: (optional) --- ## [LRN-20260317-JJ4] category **Recorded Time**: 2026-03-17T15:10:28Z **Priority**: medium **Status**: promoted **Domain**: docs ### Summary Test for writing back the `promoted` status ### Details Test whether `promoted` is automatically written back after promotion. ### Recommended Action (To be added) ### Metadata - Source: conversation - Scope: skill - Base path: /var/minis/skills/self-improving-agent/data - Related files: (optional) - Tags: (optional) --- **Promoted to**: /var/minis/skills/self-improving-agent/data/public/LEARNINGS.md ### Resolution Record - **Resolution Time**: 2026-03-17T15:10:28Z - **Description**: Promoted to the public area within the skill ## [LRN-20260317-QQG] category **Recorded Time**: 2026-03-17T15:12:21Z **Priority**: medium **Status**: promoted **Domain**: docs ### Summary Second test of the `promote` layout ### Details Check whether the write-back position is before the separator line. ### Recommended Action (To be added) ### Metadata - Source: conversation - Scope: skill - Base path: /var/minis/skills/self-improving-agent/data - Related files: (optional) - Tags: (optional) **Promoted to**: /var/minis/skills/self-improving-agent/data/public/LEARNINGS.md ### Resolution Record - **Resolution Time**: 2026-03-17T15:12:21Z - **Description**: Promoted to the public area within the skill --- ## [LRN-20260317-2LU] category **Recorded Time**: 2026-03-17T15:16:42Z **Priority**: medium **Status**: promoted **Domain**: docs ### Summary Duplicate promotion protection test ### Details Test whether a second `promote` is blocked. ### Recommended Action (To be added) ### Metadata - Source: conversation - Scope: skill - Base path: /var/minis/skills/self-improving-agent/data - Related files: (optional) - Tags: (optional) **Promoted to**: /var/minis/skills/self-improving-agent/data/public/LEARNINGS.md ### Resolution Record - **Resolution Time**: 2026-03-17T15:16:42Z - **Description**: Promoted to the public area within the skill ---
data/public/ERRORS.md# Errors # Errors
data/public/FEATURE_REQUESTS.md# Feature Requests # Feature Requests ## [FEAT-20260317-BQ5] capability **Recorded on**: 2026-03-17T14:08:09Z **Priority**: medium **Status**: pending **Scope**: docs ### Required Capability The cross-project initialization semantics of `self-improving-agent` are unclear. ### User Context The current script writes logs to a fixed location, `/var/minis/workspace/.learnings`. In practice, this is shared across the entire workspace, so initialization does not need to be repeated for each project. This could be improved by supporting `--base <path>` for multi-project isolation, or by adding a `status/doctor` command to explicitly indicate the current scope and whether it has been initialized. ### Complexity Assessment medium ### Recommended Implementation (To be added) ### Metadata - Frequency: first_time - Related Features: (optional) ---
data/public/LEARNINGS.md# Learnings ## [LRN-20260317-EUC] category **Time Logged**: 2026-03-17T14:05:12Z **Priority**: medium **Status**: pending **Domain**: docs ### Summary The script lacks execute permission when initializing `self-improving-agent` ### Details In Minis, this script should be called explicitly with `sh` to avoid a "Permission denied" error. Prefer `sh /var/minis/skills/self-improving-agent/scripts/minis_auto_log.sh init`. ### Recommended Actions (To be added) ### Metadata - Source: conversation - Related files: (optional) - Tags: (optional) --- ## [LRN-20260317-EXY] category **Recorded Time**: 2026-03-17T14:16:26Z **Priority**: medium **Status**: pending **Domain**: docs ### Summary The default location for learning logs has been changed to `workspace/learnings` ### Details The hidden directory `.learnings` has poor visibility in cross-project search and file selection scenarios. The default has been changed to `/var/minis/workspace/learnings`. At the same time, `--project` project-level isolation and `--base` custom paths are retained, creating a dual track of shared accumulated learnings and project isolation. ### Recommended Actions (To be added) ### Metadata - Source: conversation - Scope: workspace - Base path: /var/minis/workspace/learnings - Related Files: (optional) - Tags: (optional) --- ## [LRN-20260317-KNL] category **Recorded Time**: 2026-03-17T14:26:04Z **Priority**: medium **Status**: pending **Domain**: docs ### Summary Duplicate issue for `demo-b` ### Details Used for subsequent testing of promotion to the public area ### Recommended Action (To be added) ### Metadata - Source: conversation - Scope: project - Base path: /var/minis/workspace/demo-b/.learnings - Project Path: /var/minis/workspace/demo-b - Related Files: (optional) - Tags: (optional) --- ## [LRN-20260317-JJ4] category **Recorded Time**: 2026-03-17T15:10:28Z **Priority**: medium **Status**: pending **Domain**: docs ### Summary `promote` write-back test ### Details Test whether `promoted` is automatically written back after promotion ### Recommended Action (To be added) ### Metadata - Source: conversation - Scope: skill - Base path: /var/minis/skills/self-improving-agent/data - Related Files: (optional) - Tags: (optional) --- ## [LRN-20260317-QQG] category **Recorded Time**: 2026-03-17T15:12:21Z **Priority**: medium **Status**: pending **Domain**: docs ### Summary Second layout test for `promote` ### Details Check whether the write-back position is before the separator line ### Recommended Action (To be added) ### Metadata - Source: conversation - Scope: skill - Base path: /var/minis/skills/self-improving-agent/data - Related Files: (optional) - Tags: (optional) --- ## [LRN-20260317-2LU] category **Recorded Time**: 2026-03-17T15:16:42Z **Priority**: medium **Status**: pending **Domain**: docs ### Summary Repeated `promote` protection test ### Details Test whether the second `promote` action is blocked ### Recommended Action (To be added) ### Metadata - Source: conversation - Scope: skill - Base path: /var/minis/skills/self-improving-agent/data - Related Files: (optional) - Tags: (optional) ---
scripts/minis_auto_log.sh#!/bin/sh
# self-improving-agent Minis 自动初始化 + 自动记录
set -e
SKILL_BASE="/var/minis/skills/self-improving-agent/data"
PUBLIC_BASE="/var/minis/skills/self-improving-agent/data/public"
BASE="${SELF_IMPROVING_BASE:-$SKILL_BASE}"
MODE="skill"
PROJECT_ROOT=""
TARGET=""
while [ $# -gt 0 ]; do
case "$1" in
--base)
[ -n "$2" ] || { echo "缺少 --base 参数值" >&2; exit 1; }
BASE="$2"
MODE="custom"
shift 2
;;
--project)
[ -n "$2" ] || { echo "缺少 --project 参数值" >&2; exit 1; }
PROJECT_ROOT="$2"
BASE="$2/.learnings"
MODE="project"
shift 2
;;
--public|--workspace)
BASE="$PUBLIC_BASE"
MODE="public"
shift 1
;;
--skill)
BASE="$SKILL_BASE"
MODE="skill"
shift 1
;;
*)
break
;;
esac
done
LEARN="$BASE/LEARNINGS.md"
ERRS="$BASE/ERRORS.md"
FEAT="$BASE/FEATURE_REQUESTS.md"
init() {
mkdir -p "$BASE"
[ -f "$LEARN" ] || cat > "$LEARN" <<'EOF'
# Learnings
EOF
[ -f "$ERRS" ] || cat > "$ERRS" <<'EOF'
# Errors
EOF
[ -f "$FEAT" ] || cat > "$FEAT" <<'EOF'
# Feature Requests
EOF
}
project_meta_line() {
if [ -n "$PROJECT_ROOT" ]; then
printf '%s\n' "- 项目路径: $PROJECT_ROOT"
fi
}
meta_block() {
printf '%s\n' "- 来源: conversation"
printf '%s\n' "- 作用域: $MODE"
printf '%s\n' "- 基础路径: $BASE"
project_meta_line
printf '%s\n' "- 关联文件: (可选)"
printf '%s\n' "- 标签: (可选)"
}
new_id() {
TYPE="$1"
DATE=$(date -u +%Y%m%d)
RAND=$(tr -dc A-Z0-9 </dev/urandom | head -c 3)
echo "${TYPE}-${DATE}-${RAND}"
}
log_learning() {
TS=$(date -u +%Y-%m-%dT%H:%M:%SZ)
ID=$(new_id LRN)
SUMMARY="$1"
DETAILS="${2:-(可选)}"
{
printf '## [%s] category\n\n' "$ID"
printf '**记录时间**: %s\n' "$TS"
printf '**优先级**: medium\n'
printf '**状态**: pending\n'
printf '**领域**: docs\n\n'
printf '### 摘要\n%s\n\n' "$SUMMARY"
printf '### 详情\n%s\n\n' "$DETAILS"
printf '### 建议动作\n(待补充)\n\n'
printf '### 元数据\n'
meta_block
printf '\n---\n'
} >> "$LEARN"
echo "已记录:$ID → $LEARN"
}
log_error() {
TS=$(date -u +%Y-%m-%dT%H:%M:%SZ)
ID=$(new_id ERR)
SUMMARY="$1"
DETAILS="${2:-(粘贴错误信息)}"
{
printf '## [%s] command\n\n' "$ID"
printf '**记录时间**: %s\n' "$TS"
printf '**优先级**: high\n'
printf '**状态**: pending\n'
printf '**领域**: infra\n\n'
printf '### 摘要\n%s\n\n' "$SUMMARY"
printf '### Error\n```\n%s\n```\n\n' "$DETAILS"
printf '### Context\n- 尝试的命令/操作:\n- 输入或参数:\n- 环境细节:\n\n'
printf '### 建议修复\n(待补充)\n\n'
printf '### 元数据\n'
printf '%s\n' '- 可复现: unknown'
printf '%s\n' "- 作用域: $MODE"
printf '%s\n' "- 基础路径: $BASE"
project_meta_line
printf '%s\n\n' '- 关联文件: (可选)'
printf '%s\n' '---'
} >> "$ERRS"
echo "已记录:$ID → $ERRS"
}
log_feature() {
TS=$(date -u +%Y-%m-%dT%H:%M:%SZ)
ID=$(new_id FEAT)
SUMMARY="$1"
DETAILS="${2:-(可选)}"
{
printf '## [%s] capability\n\n' "$ID"
printf '**记录时间**: %s\n' "$TS"
printf '**优先级**: medium\n'
printf '**状态**: pending\n'
printf '**领域**: docs\n\n'
printf '### 需求能力\n%s\n\n' "$SUMMARY"
printf '### 用户背景\n%s\n\n' "$DETAILS"
printf '### 复杂度评估\nmedium\n\n'
printf '### 建议实现\n(待补充)\n\n'
printf '### 元数据\n'
printf '%s\n' '- 频次: first_time'
printf '%s\n' "- 作用域: $MODE"
printf '%s\n' "- 基础路径: $BASE"
project_meta_line
printf '%s\n\n' '- 关联功能: (可选)'
printf '%s\n' '---'
} >> "$FEAT"
echo "已记录:$ID → $FEAT"
}
status() {
init
echo "模式: $MODE"
echo "基础路径: $BASE"
[ -n "$PROJECT_ROOT" ] && echo "项目路径: $PROJECT_ROOT"
echo "技能默认区: $SKILL_BASE"
echo "公共区: $PUBLIC_BASE"
echo "LEARNINGS: $LEARN"
echo "ERRORS: $ERRS"
echo "FEATURES: $FEAT"
}
search_all() {
KEYWORD="$1"
[ -n "$KEYWORD" ] || { echo "缺少搜索关键词" >&2; exit 1; }
find /var/minis/skills/self-improving-agent /var/minis/workspace -type f \( -path '/var/minis/skills/self-improving-agent/data/*.md' -o -path '/var/minis/skills/self-improving-agent/data/public/*.md' -o -path '*/.learnings/*.md' \) -print0 2>/dev/null |
xargs -0 grep -n -i -- "$KEYWORD" 2>/dev/null || true
}
promote_to_public() {
ENTRY_ID="$1"
[ -n "$ENTRY_ID" ] || { echo "缺少条目 ID" >&2; exit 1; }
init
SRC=$(find /var/minis/skills/self-improving-agent /var/minis/workspace -type f \( -path '/var/minis/skills/self-improving-agent/data/*.md' -o -path '/var/minis/skills/self-improving-agent/data/public/*.md' -o -path '*/.learnings/*.md' \) -print0 2>/dev/null | xargs -0 grep -l "\[$ENTRY_ID\]" 2>/dev/null | head -n 1)
[ -n "$SRC" ] || { echo "未找到条目:$ENTRY_ID" >&2; exit 1; }
case "$SRC" in
"$PUBLIC_BASE"/*)
echo "条目已在公共区:$SRC"
exit 0
;;
esac
TARGET="$PUBLIC_BASE/$(basename "$SRC")"
mkdir -p "$PUBLIC_BASE"
[ -f "$TARGET" ] || printf '# %s\n' "$(basename "$TARGET" .md | tr '_' ' ')" > "$TARGET"
if grep -q "\[$ENTRY_ID\]" "$TARGET" 2>/dev/null; then
echo "条目已存在于公共区:$TARGET"
exit 0
fi
awk -v id="$ENTRY_ID" '
BEGIN {capture=0}
$0 ~ "^## \\[" id "\\]" {capture=1}
capture {print}
capture && $0 == "---" {exit}
' "$SRC" >> "$TARGET"
echo "" >> "$TARGET"
TMP=$(mktemp)
TS=$(date -u +%Y-%m-%dT%H:%M:%SZ)
awk -v id="$ENTRY_ID" -v target="$TARGET" -v ts="$TS" '
BEGIN {in_block=0; promoted_done=0; resolution_seen=0}
{
if ($0 ~ "^## \\[" id "\\]") {
in_block=1
}
if (in_block && $0 == "**状态**: pending") {
print "**状态**: promoted"
next
}
if (in_block && $0 ~ /^\*\*已提升到\*\*:/) {
promoted_done=1
}
if (in_block && $0 == "### 解决记录") {
resolution_seen=1
}
if (in_block && $0 == "---") {
if (!promoted_done) print "**已提升到**: " target
if (!resolution_seen) {
print ""
print "### 解决记录"
print "- **解决时间**: " ts
print "- **说明**: 已提升到技能内公共区"
}
print
in_block=0
promoted_done=0
resolution_seen=0
next
}
print
}
' "$SRC" > "$TMP"
mv "$TMP" "$SRC"
echo "已提升:$ENTRY_ID → $TARGET"
echo "已回写源条目状态为 promoted"
}
usage() {
echo "用法:$0 [--skill | --project 项目目录 | --public | --workspace | --base 路径] init | status | learning <摘要> [详情] | error <摘要> [错误] | feature <摘要> [背景] | search <关键词> | promote <条目ID>" >&2
exit 1
}
case "$1" in
init)
init
echo "已初始化:$BASE"
;;
status)
status
;;
learning)
init
[ -n "$2" ] || usage
log_learning "$2" "$3"
;;
error)
init
[ -n "$2" ] || usage
log_error "$2" "$3"
;;
feature)
init
[ -n "$2" ] || usage
log_feature "$2" "$3"
;;
search)
search_all "$2"
;;
promote)
promote_to_public "$2"
;;
*)
usage
;;
esac
SKILL.md--- name: self-improving-agent description: "Self-improvement logging and closed-loop feedback: Trigger when a command or operation fails, the user corrects you, outdated knowledge is identified, an external API fails, or a better reusable solution is found. Review historical learnings before important tasks. Avoid triggering during ordinary chat, for temporary mistakes that do not need to be logged, or when the user has explicitly said not to log." metadata: language: en-US scope: minis --- # Self-Improvement Skill (Minis Edition) This skill is used in the Minis environment to **record errors, corrections, and reusable best practices**, creating a traceable learning loop. ## Minis Directory Conventions - **Working directory**: `/var/minis/workspace/` - **Default learning log directory for this skill**: `/var/minis/skills/self-improving-agent/data/` - **Public learning log directory within this skill (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, exception output) - `FEATURE_REQUESTS.md` (new capabilities requested by users) > By default, log entries go first to the skill's own `data` directory. When you explicitly specify a project, write to the project-level log. When an issue has been abstracted into a cross-project rule, promote it to the skill's public area or the Minis memory system. ## Current Final Rules - **Default logging location**: `/var/minis/skills/self-improving-agent/data/` - **Public area within the skill**: `/var/minis/skills/self-improving-agent/data/public/` - **Project-level logging**: Use `<project>/.learnings/` only when `--project <path>` is passed explicitly - **Recommended public parameter**: `--public` - **Compatibility alias**: `--workspace` is still available, but only for compatibility and is no longer recommended - **Promotion behavior**: `promote <entryID>` copies the entry to the public area within the skill, automatically marks the source entry as `promoted`, and writes back `**Promoted to**` and `### Resolution Record` - **Duplicate protection**: If the entry already exists in the skill's public area, running `promote` again will not append a duplicate ## Quick Reference | Scenario | Action | |-----------|--------| | Command or operation fails | Log to the skill directory by default: `data/ERRORS.md` | | The user corrects you | Log to the skill directory by default: `data/LEARNINGS.md`, category `correction` | | The user needs a missing capability | Log to the skill directory by default: `data/FEATURE_REQUESTS.md` | | Project context is explicitly specified | Log to `<project>/.learnings/` | | External API or tool fails | Log to `ERRORS.md` in the current scope, including integration details | | Knowledge is outdated | Log to `LEARNINGS.md` in the current scope, category `knowledge_gap` | | A better solution is found | First log it to the current scope, then promote it after confirming it is generally applicable | | Similar issues recur across multiple projects | Promote to the public area within the skill: `data/public/` | | Similar to an existing entry | Link with `**See Also**` and consider raising the priority | | Widely applicable experience | Promote to the public area within the skill or to Minis memory. See "Promoting to Minis Memory" below | ## Trigger Logging Rules (Minis Runtime Conventions) > Note: By default, this skill **does not automatically listen in the background**. When trigger conditions are met, the assistant (or you) should actively call `scripts/minis_auto_log.sh` to write the log to disk. ### Recommended Triggers That "Must Be Logged" If any of the following conditions are met, the event should be logged unless you explicitly say "do not log it": 1. **A command or operation fails and the cause is not obvious**: For example, permissions, paths, dependencies, network issues, or third-party API exceptions that require investigation to diagnose. 2. **User correction**: You point out where my understanding is wrong, where my logic does not match the actual behavior of this software, or where paths or conventions are incorrect. 3. **Knowledge update or outdated assumption correction**: A previous assumption is found not to apply to Minis, or documentation or implementation needs correction. 4. **Reusable better solution**: A stable practice, convention, template, or workflow emerges that can significantly reduce rework. 5. **Recurring pattern**: Similar issues appear repeatedly within the same task, or across tasks or projects. ### Situations That Generally Should Not Be Logged - Ordinary chat, one-off small changes, or minor details with no reuse value. - You explicitly ask "do not log this." ### Recommended Logging Location - **By default**, write to the skill area `data/` first. - After confirming that the entry has reuse value across tasks, use `promote` to move it to the public area within the skill: `data/public/`. ## Difference from Minis Memory and Promotion Criteria ### Difference (Suggested Interpretation) - This skill's logs (`data/` and `data/public/`) are an **editable work review repository**: they record context, troubleshooting processes, and solution evolution, and they allow long text and details. - Minis memory (`memory_write` writing to `/var/minis/memory/`) is for **cross-session long-term rules and preferences**: entries should be short, stable, and reusable. Poorly written entries can "pollute" future decisions for a long time. ### Where to Write (Log First, Then Refine into Memory) - **Write to this skill's logs first**: When the content needs context, such as error output, troubleshooting paths, or solution comparisons; when it is not yet clear whether it is generally applicable; or when it is still being iterated on. - **Then promote to memory**: When the conclusion is stable, applies across tasks or skills, and can be expressed in one sentence. ### When to Promote to Memory (Hard Criteria) Consider `memory_write` only if at least one of the following is true: 1. It can be condensed into a rule of the form "**When X happens in the future, do Y**" and does not depend on specific project details. 2. It **recurs 3 or more times within 30 days**, or appears in at least **2 different tasks or domains**. 3. It clearly belongs to your long-term preferences or conventions, such as tool usage constraints, path conventions, or output format rules, and you explicitly say "remember this" or "do this from now on." ### Recommended Promotion Actions - First use `promote` to promote the entry to the public area within the skill, `data/public/`, for higher visibility and easier review. - Then distill 1 to 3 short rules from the public entry and write them to the day's memory with `memory_write`. Usage examples: ```bash # By default, write to the skill's own data directory sh /var/minis/skills/self-improving-agent/scripts/minis_auto_log.sh init # Log a skill-level learning sh /var/minis/skills/self-improving-agent/scripts/minis_auto_log.sh learning "Fixed the download timeout" "Use chunking and retries" # If you need to log explicitly at the project level, pass --project sh /var/minis/skills/self-improving-agent/scripts/minis_auto_log.sh --project /var/minis/workspace/my-project error "curl request failed" "HTTP 429" # If you need to write directly to the public area within the skill, pass --public explicitly sh /var/minis/skills/self-improving-agent/scripts/minis_auto_log.sh --public feature "Support batch export" "Operations needs daily reports" # Search the skill area + project area + public area within the skill sh /var/minis/skills/self-improving-agent/scripts/minis_auto_log.sh search timeout # Promote an entry to the public area within the skill sh /var/minis/skills/self-improving-agent/scripts/minis_auto_log.sh promote LRN-20260317-ABC # View the current scope sh /var/minis/skills/self-improving-agent/scripts/minis_auto_log.sh status ``` ## Logging Format ### Learning Record Append to `.learnings/LEARNINGS.md`: ```markdown ## [LRN-YYYYMMDD-XXX] category **Record time**: 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, and the correct approach ### Recommended Action Specific actionable improvement or fix ### Metadata - Source: conversation | error | user_feedback - Related file: path/to/file.ext - Tags: tag1, tag2 - Related entry: LRN-20250110-001 (if applicable) - Pattern key: simplify.dead_code | harden.input_validation (optional, for recurring pattern tracking) - Recurrence count: 1 (optional) - First seen: 2025-01-15 (optional) - Last seen: 2025-01-15 (optional) --- ``` ### Error Record Append to `.learnings/ERRORS.md`: ````markdown ## [ERR-YYYYMMDD-XXX] skill_or_command_name **Record time**: 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 or operation attempted - Input or parameters - Environment details, if relevant ### Recommended Fix If identifiable, provide possible solutions ### Metadata - Reproducible: yes | no | unknown - Related file: path/to/file.ext - Related entry: ERR-20250110-001 (if recurring) --- ```` ### Feature Request Record Append to `.learnings/FEATURE_REQUESTS.md`: ```markdown ## [FEAT-YYYYMMDD-XXX] capability_name **Record time**: ISO-8601 timestamp **Priority**: medium **Status**: pending **Domain**: frontend | backend | infra | tests | docs | config ### Requested Capability The capability the user wants to implement ### User Context Why it is needed and what problem it solves ### Complexity Assessment simple | medium | complex ### Recommended Implementation Possible implementation approaches 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: sequential number or random 3-character value, such as `001` or `A7B` Examples: `LRN-20250115-001`, `ERR-20250115-A3F`, `FEAT-20250115-002` ## Resolving Entries After an issue is fixed, update the entry: 1. Change `**Status**: pending` to `**Status**: resolved` 2. Add a resolution block after the metadata: ```markdown ### Resolution Record - **Resolution time**: 2025-01-16T09:00:00Z - **Commit/PR**: abc123 or #42 - **Notes**: Brief description of what was done ``` Other statuses: - `in_progress` - Being worked on - `wont_fix` - Decided not to fix. Write the reason in the resolution record - `promoted` - Promoted to Minis memory ## Promoting to Minis Memory When a learning item is broadly applicable rather than a one-time fix, it should be promoted to the Minis memory system. ### When to Promote - The learning applies across multiple files or features - Any contributor, human or AI, should know it - It prevents repeated mistakes - It records project conventions ### Promotion Targets (Minis) - **Daily memory**: `/var/minis/memory/YYYY-MM-DD.md` (written through `memory_write`) - **Global memory**: `/var/minis/memory/GLOBAL.md` (read-only; the user must maintain it in settings) - **Project notes**: Recommended target: `/var/minis/workspace/PROJECT_NOTES.md` ### How to Promote 1. **Distill**: Condense the learning into concise rules or facts 2. **Write**: Use `memory_write` to write to daily memory, and sync to project notes if needed 3. **Write back**: Update the original entry: - `**Status**: pending` to `**Status**: promoted` - Add `**Promoted**: YYYY-MM-DD.md` or `PROJECT_NOTES.md` ## Recurring Pattern Detection If the content being logged is similar to an existing entry: 1. **Search first**: `grep -r "keyword" /var/minis/workspace/.learnings/` 2. **Create an association**: Add `**See Also**: ERR-20250110-001` to the metadata 3. **Raise the priority**: If the issue recurs 4. **Consider a systematic fix**: Recurring issues usually indicate: - Missing documentation (write to `PROJECT_NOTES.md` or daily memory) - Missing automation (add scripts or toolchain support) - Architectural issues (create a technical 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 1. Read `simplify_and_harden.learning_loop.candidates` from the task summary. 2. For each candidate, use `pattern_key` as the stable deduplication key. 3. Search `.learnings/LEARNINGS.md` to see whether it already exists: - `grep -n "Pattern-Key: <pattern_key>" /var/minis/workspace/.learnings/LEARNINGS.md` 4. If it already exists: - Increment `Recurrence-Count` - Update `Last-Seen` - Add a `See Also` association 5. If it does not exist: - Create a new `LRN-...` entry - Set `Source: simplify-and-harden` - Set `Pattern-Key`, `Recurrence-Count: 1`, and `First-Seen`/`Last-Seen` ### Promotion Rules (System Prompt Feedback) When the following conditions are met, promote the recurring pattern to Minis memory: - `Recurrence-Count >= 3` - Appears in at least 2 different tasks - Occurs within 30 days The promoted rule should be a **short and clear preventive rule** that describes what to do before or during work, not a lengthy incident review. ## Periodic Review Review `.learnings/` at natural milestones: ### When to Review - Before starting a new important task - After completing a feature - When entering a domain that has previous learnings - Once a week during active development ### Quick Status Check ```bash # Count pending items grep -h "Status\*\*: pending" /var/minis/workspace/.learnings/*.md | wc -l # List pending high-priority items grep -B5 "Priority\*\*: high" /var/minis/workspace/.learnings/*.md | grep "^## \[" # Find learnings for a specific area grep -l "Domain\*\*: backend" /var/minis/workspace/.learnings/*.md ```