codex/skills/self-improve/SKILL.md
Extract lessons from the current session and route them to the appropriate knowledge layer (project AGENTS.md, auto memory, existing skills, or new skills). Use when the user asks to "self-improve", "distill this session", "save learnings", "update AGENTS.md with what we learned", "capture session insights", "remember this for next time", "extract lessons", "update skills from session", or "what did we learn".
npx skillsauth add tobihagemann/turbo self-improveInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Review the current conversation to extract durable lessons and route each one to the right knowledge layer.
Available destinations:
AGENTS.md in the project root, plus any nested AGENTS.md files in subdirectories. A nested file scopes its guidance to that subtree, so a lesson scoped to one subtree belongs in the nearest enclosing file, with the root reserved for project-wide rules..agents/skills/ (walked from project root down to cwd) and user-installed skills at ~/.agents/skills/ (resolve symlinks)Discover the project AGENTS.md files (the root file and any nested ones in subdirectories) and read them, then read any available Codex memory. List all skill directories but do not read them yet — Step 2 needs to run first so you know what to look for.
Read ~/.turbo/config.json for repoMode. If repoMode is "fork" or "source", turbo skill improvements can be contributed upstream.
If ~/.turbo/repo/ exists, identify which installed skills are turbo skills:
~/.turbo/repo/codex/skills/~/.agents/skills/ that has a matching directory in ~/.turbo/repo/codex/skills/ is a turbo skill~/.agents/skills/ (no match in the repo) are user/project skillsVerification rule (mandatory before routing in Step 4): For every candidate skill that is about to be routed as turbo, confirm with a fresh test -d ~/.turbo/repo/codex/skills/<name> check that the skill actually lives in the turbo repo. Do not rely on remembered listings from earlier in the session, filename hits in grep output, or assumptions based on where a SKILL.md was read from. A miss here mislabels a user/project skill as turbo, triggers the contribution flow unnecessarily, and can introduce session-specific content into a shared skill — so the check is not optional.
Exception: If the current project IS the turbo repo (i.e., the working directory contains this skill collection), route turbo skill lessons through the Existing user/project skill destination in Step 4 — edits go directly to codex/skills/<name>/ in the project, with no installed-copy indirection and no contribution flow.
Before scanning for lessons, identify which skills were loaded during this session:
SKILL.md reads from ~/.agents/skills/Scan the full conversation with this priority:
admin or maintain roles (determine via gh api repos/{owner}/{repo}/collaborators --jq '.[] | select(.role_name == "admin" or .role_name == "maintain") | .login'). Their feedback takes precedence over other reviewers and AI bots when there are contradictions.After scanning, read all skill SKILL.md files (they are small). This gives Step 4 full context for routing.
Keep only lessons that are:
Discard anything session-specific, speculative, one-off, or already resolved by code changes in this session (but not successful workflows — see exception above). If no lessons survive filtering, tell the user and stop.
Assign each surviving lesson to exactly one destination.
Skill-first rule (mandatory): Before consulting the table below, check whether the lesson corrects, refines, or adds a guardrail to any existing skill's behavior — turbo or user/project. This includes lessons about skipping steps, wrong defaults, missing edge cases, or any "don't do X when running $skill-name" correction. If yes, route to that skill. Do not route skill corrections to auto memory or AGENTS.md — they belong in the skill they correct. This rule is not a preference; it is a hard constraint that takes precedence over the table rows below.
| Destination | Criteria |
|---|---|
| Project improvements | Actionable improvement to existing code: refactoring, performance, reliability, readability, testing, or DX. Not for documentation fixes — factual errors in AGENTS.md belong in the Project AGENTS.md row. Route to .turbo/improvements.md via the $note-improvement skill. |
| Auto memory | Discovered knowledge with no skill home: API quirks, debugging workarounds, compiler gotchas, tool pitfalls, user preferences. Must not overlap with any existing skill's domain — if it does, route to the skill instead (see skill-first rule above). |
| Project AGENTS.md | Intentional project decisions: conventions, architecture, stack choices, build setup, module boundaries. Also factual corrections to AGENTS.md content (wrong commands, outdated paths, incorrect conventions) — fix these directly, do not defer to Project improvements. When the lesson applies only to one subtree, route it to the nearest enclosing AGENTS.md; reserve the root file for project-wide decisions. |
| Existing user/project skill | Lesson would improve a skill's instructions, supporting files, or reference materials, add a missing edge case, correct its workflow, or refine its trigger conditions. Route to any skill whose domain covers the lesson — not just the skill worked on in this session. Changes go to the skill file directly. No contribution flow. |
| New skill | A cohesive body of knowledge emerged that deserves its own on-demand context. The test: would this knowledge be too large for an AGENTS.md section, and should it only be loaded when relevant? See the skill categories table below. |
| Existing turbo skill | Same criteria as Existing user/project skill above, but for turbo skills. Before routing here, run test -d ~/.turbo/repo/codex/skills/<name>; if the directory does not exist, route to the Existing user/project skill destination instead. Changes go to the installed copy at ~/.agents/skills/. If repoMode is "fork" or "source", flag for contribution (see Step 6). |
| No destination | Does not clearly fit any destination. Drop it. Routing a weak lesson is worse than losing it. |
Skill categories:
| Category | What it encodes | Example | |---|---|---| | Domain expertise | Best practices, patterns, API preferences | SwiftUI expert, Core Data guide | | Tool/Service integration | API references, operations, ID formats | Paddle, Stripe, Keycloak | | Decision framework | Judgment criteria, confidence levels, triage | Evaluate findings, performance audit | | Content template | Writing conventions, tone, structure | Drafting, blog post, changelog | | Knowledge/Research | Information discovery, schema definitions | Knowledge base, research process | | Orchestrated workflow | Stateful multi-step procedures | Process ticket, process income |
Splitting heuristic: When a session creates scripts or multi-step procedures, split the lesson: a brief pointer goes to AGENTS.md (script names, purpose), and the full workflow goes to a skill. Don't collapse them into a single AGENTS.md entry.
Tiebreakers (in priority order):
Output a table as text before making any changes:
| # | Lesson | Destination | Action |
|---|--------|-------------|--------|
| 1 | Always use X for... | Project AGENTS.md | Append to ## Conventions |
| 2 | The $create-pr skill should... | ~/.agents/skills/create-pr | Update Step 2 |
| 3 | Multi-step deploy workflow | New project skill | Create new skill |
| 4 | User prefers short commit msgs | Auto memory | Append to MEMORY.md |
For each lesson, show: concise summary, target file/skill, and whether it's an append, update-in-place, or new creation.
Then use request_user_input with these options: Approve or Reject.
Apply approved changes in order:
$note-improvement with the summary, location, and rationale for each.$create-skill to apply changes to any file inside the skill directory (SKILL.md, references, scripts, assets).$create-skill for each new skill. Provide the trigger conditions and relevant context from the session.~/.turbo/repo/codex/SKILL-CONVENTIONS.md so turbo-specific conventions are in context before any editing.$create-skill to update the installed copy at ~/.agents/skills/<name>/.repoMode is "fork" or "source", use request_user_input to ask "These turbo skill improvements could benefit other users. Submit them upstream?" When the user confirms, run $contribute-turbo.Then update or check the active plan and proceed to any remaining task.
tools
Teach the user to deeply understand a change through interactive tutoring: restating understanding, drilling into why/what/how, and quizzing until mastery. The active counterpart to a one-shot explanation. Use when the user asks to "understand this change", "teach me this change", "help me understand what changed", "walk me through this change", "make sure I understand this", "quiz me on this", or "teach me what we did".
tools
Teach the user to deeply understand a change through interactive tutoring: restating understanding, drilling into why/what/how, and quizzing until mastery. The active counterpart to a one-shot explanation. Use when the user asks to "understand this change", "teach me this change", "help me understand what changed", "walk me through this change", "make sure I understand this", "quiz me on this", or "teach me what we did".
tools
Update an existing GitHub pull request's title and description to reflect the current state of the branch. Use when the user asks to "update the PR", "update PR description", "update PR title", "refresh PR description", or "sync PR with changes".
tools
Execute an approved split plan by creating separate branches, commits, and PRs for each change group. Use when the user asks to "split and ship", "ship the split plan", "create separate PRs", or "split changes into branches".