self-improve
self-improve
Session evidence → lessons → minimal skill diffs → Issue + PR. PR = human review gate: open Issue + PR without asking approval; push only to self-improve/* branches, human merges.
Upstream: jinsyin/skills (skills in skills/<name>/). Keep main context lean: work from digest, open raw transcript only for specific turns.
Args: --dry-run report only, no Issue/PR; free text narrows focus.
1. Collect evidence
Current conversation + python3 <skill-dir>/scripts/transcript.py digest --runtime <rt> [<session-id>]. <rt> = own runtime: claude, codex, cursor (IDE or cursor-agent), agy (Antigravity); omitted → Claude Code only. Pass own session id when known; else newest session of cwd, maybe another one. Digest compact, only source of token/time data — run even if context looks complete. [cost] unavailable = runtime records no tokens: token figures unknown, cost lessons only from wall time or call counts.
Record provenance for Issue: source project name (git root basename), agent runtime, session id + name. transcript.py meta (same args) prints session id, name, runtime, most-used and last model/effort pair; improvement run = same session: reuse its id, last pair = run's. Copy its unknown as-is. Done when digest read and provenance recorded.
Digest marks USER* (possible correction), ERROR, REJECTED, [retry xN], [repeat-error xN], SKILL/SKILL-LOADED (with path), cost lines: [cost] totals for main agent + subagents, [heavy-turn N] (turn ≥15% of input) / [skill-run N] (other skill turn): one run's in/out tokens, calls, compactions, peak-ctx, subagents, result chars, wall time (prompt → turn's last record), skills; HEAVY-AGENT (subagent ≥200k tokens), BIG-RESULT (tool output >20k chars), [skill-cost]/HEAVY-SKILL (per-skill totals from each invocation to next skill or turn end, incl. subagents started then; heavy = ≥25% of session tokens or wall time; via=manual = user-typed slash command, auto = Skill call by model or another skill). Markers = hints; judge each by context.
2. Scope
Candidate skills = skills used in evidence (Skill call, slash command, SKILL-LOADED, or reading/editing skill's own files) ∩ upstream skills: entries in project's skills-lock.json with source jinsyin/skills (case-insensitive), or load path inside a jinsyin/skills checkout. Lessons owned by no loaded skill can still justify new skill. self-improve always candidate (step 6). Third-party skills out of scope, except one tagged HEAVY-SKILL via=manual: retrospect its call details for lessons belonging in a setup-rules convention, since its files can't change here. Everything else (other third-party skills, project's own code) → final summary only.