Self-learning sidecar
Use this skill to recall prior shortcuts before you start work, and to record durable “aha” moments + recommendations after you finish.
Critical rule: if no learnings exist (cold start), say so and proceed with standard tools — do not invent memories.
CLI path (important)
This skill ships an optional helper CLI at <SKILL_DIR>/scripts/self_learning.py (where <SKILL_DIR> is the directory that contains this SKILL.md).
- Codex default:
${CODEX_HOME:-$HOME/.codex}/skills/self-learning-skills
- In the commands below, replace
<SKILL_DIR> with your install path.
1) PRE-RUN: Recall (before starting work)
When to use: Before any non-trivial task.
Action:
- Locate the project store:
<repo-root>/.agent-skills/self-learning/v1/users/<user>/
- Read
<project_store>/INDEX.md (quick skim).
- If you need targeted recall, run:
python3 <SKILL_DIR>/scripts/self_learning.py list --query "<keywords>"
- Optional filters:
--skill <name>, --tag skill:<name>
- Summarize 3–7 directly actionable bullets relevant to the current task (titles + IDs only; no long dumps).
2) POST-RUN: Record (after finishing work)
When to use: You discovered something durable (schema, fix, command sequence, constraint, etc.).
Action:
- Capture 1–5 Aha Cards (durable, reusable, specific, non-sensitive). Format:
references/FORMAT.md.
- Ensure every Aha Card and Recommendation has
primary_skill (use unknown if unsure).
- Set
scope to project (repo/run-specific) or portable (generally reusable; a backport candidate).
- If you rediscovered the same learning, treat it as reinforcement (signal) rather than duplicating the full card.
- Capture 1–5 concrete recommendations (what to change and where).
- Persist:
python3 <SKILL_DIR>/scripts/self_learning.py record --json payload.json (or stdin)
- If you used an existing Aha Card or Recommendation, mark it as used:
python3 <SKILL_DIR>/scripts/self_learning.py use --aha aha_...[,aha_...] [--rec rec_...[,rec_...]]
- Or include
used_aha_ids / used_rec_ids (or used: {aha_ids, rec_ids}) in the record payload to auto-append usage signals.
Output requirement: print a short summary + top 3 items, then point to “view more” (INDEX.md / review --format json). Do not dump long JSON by default.
3) REVIEW: Dashboard / Next actions
When to use: “What’s still open?”, “What’s stale?”, “What should we backport?”, “Most useful learnings this week?”
Action:
python3 <SKILL_DIR>/scripts/self_learning.py review --days 7
- Full JSON: add
--format json
- Filters:
--skill <name>, --scope project|portable, --status proposed,accepted,in_progress, --query "<keywords>"
4) MAINTENANCE / Governance
- Repair store hygiene (append-only):
python3 <SKILL_DIR>/scripts/self_learning.py repair --apply
- Update recommendation status/scope:
python3 <SKILL_DIR>/scripts/self_learning.py rec-status --id rec_... --status done --scope portable --note "..."
- Optional backport bundle (explicit + auditable):
python3 <SKILL_DIR>/scripts/self_learning.py export-backport --skill-path <skill-dir> --ids <aha_ids> [--make-diff] [--apply]
- Inspect backport markers in a skill:
python3 <SKILL_DIR>/scripts/self_learning.py backport-inspect --skill-path <skill-dir>
Docs
- Setup/background:
README.md
- Integration templates (no hooks):
references/INTEGRATION.md
- Rubric/format/portability:
references/RUBRIC.md, references/FORMAT.md, references/PORTABILITY.md
1---2name: self-learning-skills3description: Memory sidecar for agent work: recall before tasks, record learnings after tasks, review recommendations, optional backport bundles.4---5
6# Self-learning sidecar
7
8Use this skill to **recall** prior shortcuts before you start work, and to **record** durable “aha” moments + recommendations after you finish.
9
10Critical rule: if no learnings exist (cold start), say so and proceed with standard tools — **do not invent memories**.
11
12## CLI path (important)
13
14This skill ships an optional helper CLI at `<SKILL_DIR>/scripts/self_learning.py` (where `<SKILL_DIR>` is the directory that contains this `SKILL.md`).
15
16- Codex default: `${CODEX_HOME:-$HOME/.codex}/skills/self-learning-skills`
17- In the commands below, replace `<SKILL_DIR>` with your install path.
18
19## 1) PRE-RUN: Recall (before starting work)
20**When to use:** Before any non-trivial task.
21
22**Action:**
231. Locate the project store: `<repo-root>/.agent-skills/self-learning/v1/users/<user>/`
242. Read `<project_store>/INDEX.md` (quick skim).
253. If you need targeted recall, run:
26 - `python3 <SKILL_DIR>/scripts/self_learning.py list --query "<keywords>"`
27 - Optional filters: `--skill <name>`, `--tag skill:<name>`
284. Summarize **3–7** directly actionable bullets relevant to the current task (titles + IDs only; no long dumps).
29
30## 2) POST-RUN: Record (after finishing work)
31**When to use:** You discovered something durable (schema, fix, command sequence, constraint, etc.).
32
33**Action:**
341. Capture **1–5** Aha Cards (durable, reusable, specific, non-sensitive). Format: `references/FORMAT.md`.
35 - Ensure every Aha Card and Recommendation has `primary_skill` (use `unknown` if unsure).
36 - Set `scope` to `project` (repo/run-specific) or `portable` (generally reusable; a backport candidate).
37 - If you rediscovered the same learning, treat it as reinforcement (signal) rather than duplicating the full card.
382. Capture **1–5** concrete recommendations (what to change and where).
393. Persist:
40 - `python3 <SKILL_DIR>/scripts/self_learning.py record --json payload.json` (or stdin)
414. If you used an existing Aha Card or Recommendation, mark it as used:
42 - `python3 <SKILL_DIR>/scripts/self_learning.py use --aha aha_...[,aha_...] [--rec rec_...[,rec_...]]`
43 - Or include `used_aha_ids` / `used_rec_ids` (or `used: {aha_ids, rec_ids}`) in the `record` payload to auto-append usage signals.
44
45**Output requirement:** print a short summary + top 3 items, then point to “view more” (`INDEX.md` / `review --format json`). Do not dump long JSON by default.
46
47## 3) REVIEW: Dashboard / Next actions
48**When to use:** “What’s still open?”, “What’s stale?”, “What should we backport?”, “Most useful learnings this week?”
49
50**Action:**
51- `python3 <SKILL_DIR>/scripts/self_learning.py review --days 7`
52- Full JSON: add `--format json`
53- Filters: `--skill <name>`, `--scope project|portable`, `--status proposed,accepted,in_progress`, `--query "<keywords>"`
54
55## 4) MAINTENANCE / Governance
56- Repair store hygiene (append-only): `python3 <SKILL_DIR>/scripts/self_learning.py repair --apply`
57- Update recommendation status/scope: `python3 <SKILL_DIR>/scripts/self_learning.py rec-status --id rec_... --status done --scope portable --note "..."`
58- Optional backport bundle (explicit + auditable): `python3 <SKILL_DIR>/scripts/self_learning.py export-backport --skill-path <skill-dir> --ids <aha_ids> [--make-diff] [--apply]`
59- Inspect backport markers in a skill: `python3 <SKILL_DIR>/scripts/self_learning.py backport-inspect --skill-path <skill-dir>`
60
61## Docs
62- Setup/background: `README.md`
63- Integration templates (no hooks): `references/INTEGRATION.md`
64- Rubric/format/portability: `references/RUBRIC.md`, `references/FORMAT.md`, `references/PORTABILITY.md`