con un clic
improve-claude-local
Triage captured lessons and route each to where it belongs
Instalar con Codex o Claude Copia este prompt, pégalo en Codex, Claude u otro asistente, y deja que revise la página de la skill y la instale por ti.
Menú
Triage captured lessons and route each to where it belongs
Instalar con Codex o Claude Copia este prompt, pégalo en Codex, Claude u otro asistente, y deja que revise la página de la skill y la instale por ti.
Basado en la clasificación ocupacional SOC
| name | improve-claude-local |
| description | Triage captured lessons and route each to where it belongs |
Run two steps in order: (1) route every captured lesson to its correct home, then (2) keep what lands in CLAUDE.local.md sharp. Route first, then tidy — a lesson in the wrong file is lost (too local) or noise (too broad).
Run every captured lesson through three gates, in order. Take the first that fits.
Would this lesson help on a different codebase? Code style, architecture principles, language idioms, general workflow/tooling habits, review taste — these transfer.
→ Yes → a global skill + a pointer in ~/.claude/CLAUDE.md. Don't paste the instruction into CLAUDE.md — that file is always-on for every project and stays terse. Instead:
~/.claude/skills/<slug>/SKILL.md (write to ~/.claude directly — never the dotfiles harness/ source). The lesson body is the skill content; the if/when trigger is the skill's description (skills auto-load when their description matches the task). Phrase it generally; strip this project's names/paths.~/.claude/CLAUDE.md — the if/when + a reference to the skill, nothing more:
<task-relevant when="<trigger>">
Use the `<slug>` skill.
</task-relevant>
Examples: "prefer composition over inheritance for X-shaped problems", "name test files *_test.go next to source", "default to table-driven tests", "write commit subjects as <prefix>: <why>".
→ No → Gate 2.
Project-specific and not global. Split on shape: does the lesson describe steps to run in a situation (an action), or a rule to honor when deciding (a pattern)?
A checklist / sequence of steps to execute whenever a situation recurs — a verification pass, a regeneration sequence, a deploy ritual. States what to do, in order, next time the trigger fires.
→ Yes → a project skill at <repo-root>/.claude/skills/<slug>/SKILL.md. Mirror the global-skill move from Gate 1, at project scope:
description (skills auto-load when the description matches the task). Keep this project's real paths/commands — it's project-scoped, so concreteness helps.paths: when the trigger is "touched these files" — e.g. the LLM-config files for a post-model-change check. This makes the skill auto-fire only on relevant edits./slug. Use for verification/checks that should fire unprompted next time.disable-model-invocation: true → user-only via /slug, never auto-fires. Use for deliberate or destructive actions (deploy, migrations) the user must trigger.user-invocable: false → hidden from the / menu, model-only.CLAUDE.local.md: add .claude/skills/<slug> to .gitignore.local via the local-gitignore skill. Never commit captured corrections. Then drop the lesson from CLAUDE.local.md.Example: after changing the LLM model in the API settings and shipping a mistake, the fix is a procedure — "when editing the LLM model/API config, verify token limits, pricing, and the model id against the claude-api skill before shipping". That's a skill (paths: scoped to the config files), not a bare rule.
→ No → Gate 2b.
A reusable pattern / convention / style for this project that shapes a whole class of work — a decision to make differently next time, with no procedure to run.
→ Yes → the project's CLAUDE.local.md as a <task-relevant> block (see "Which CLAUDE.local.md" below, then Step 2).
Examples: "in repo subfolders write CLAUDE.md, not README.md"; "a *-help command prints its table verbatim — no preamble, no tool calls"; "a router SKILL.md gives every subcommand its own references/<sub>.md".
→ No → Gate 3.
A concrete one-off fact — a path, flag, command, ID, env quirk, "X lives at Y". Answers a lookup, doesn't shape behavior across tasks.
→ engram (mem_save). Drop from CLAUDE.local.md.
Examples: "the staging cluster is dev-htz-fra1"; "gh needs --user vgpopov for org repos"; "the DB dump script is mise run dump-db".
global (helps other repos)? ─yes→ ~/.claude skill + pointer in ~/.claude/CLAUDE.md
│no
project action (steps to run)? ─yes→ project .claude/skills/<slug>/SKILL.md
│no
project pattern (class of work)? ─yes→ project CLAUDE.local.md (<task-relevant>)
│no
▼
memory (engram mem_save) (concrete one-off fact)
Project-scoped rules go in the project's CLAUDE.local.md at the repo root (git rev-parse --show-toplevel). Create it if missing — the project is always a git repo. Keep it out of version control via the local-gitignore skill (adds CLAUDE.local.md to .gitignore.local); never commit it.
If the cwd is not a git repo, route the rule to the global ~/CLAUDE.local.md instead.
Applies to everything that landed in CLAUDE.local.md (the score-4/5 patterns).
<task-relevant> blocksWrap each conditional rule in a <task-relevant when="..."> block — an explicit relevance signal so the model attends to a rule only when its when matches the task at hand.
1. Foundational context bare, conditional rules wrapped. Leave bare anything relevant to ~90%+ of tasks in this repo (project identity, one-line map, where things live). Wrap anything that only matters for a kind of work. Most rules are the wrapped kind.
2. One rule, one block, one condition. Each rule gets its own block with a narrow when. Never group unrelated rules under one broad condition — broad conditions match everything and dilute nothing.
<task-relevant when="documenting a module/folder's structure or intent">
Write CLAUDE.md in that folder, not README.md.
</task-relevant>
3. Generalizable rule, not a fact. Each surviving block states what to do differently next time. (If it's a raw fact, it should have gone to engram in step 1.)
4. Merge overlapping rules. If one block refines another for the same trigger, merge into the sharper one. No two blocks the model weighs for the same task.
5. Drop stale rules. A rule pinned to a file/flag/workflow that no longer exists is dead weight — verify the anchor exists; delete if gone.
6. Keep the when in the user's terms. Describe how a task looks, not how the codebase looks: "when committing across multiple repos", not "when in a monorepo".
## Self-improvement header bare — it's the anchor the Stop hook appends to.CLAUDE.md — that's shared onboarding, not captured corrections.Use when drawing a diagram of an architecture change for review — a two-panel current-vs-planned (before/after) picture that lets a reviewer see what changed, what's removed, what's new, what held, and the one load-bearing why. Triggers: "arch diagram", "architecture diff", "before/after diagram", "diagram this refactor/migration/change", "visualize the change", "current vs planned", or any request to render an architectural change as a reviewable picture (HTML/SVG).
Use when asked to create a "local gitignore" or ignore files locally without committing the ignore rule. Create a `.gitignore.local` file at repo root and wire it via `git config core.excludesFile`, not `.git/info/exclude`.
This skill should be used when the user asks to "dedup the docs", "prune the corpus", "remove duplicate/redundant paragraphs", "reduce duplication across files", "these files repeat the same information", "consolidate repeated content", "the corpus duplicates topics", "map topics across files", or wants to find and remove duplicated prose across a set of text files (plain prose, markdown, SKILL.md, references, commands, specs).
This skill should be used when the user runs "/prx", "/prx <pr-url>", or "/prx post" — to collect the user's review comments against a diff and post them as an inline GitHub PR review. Trigger on "collect my PR comments", "start collecting comments", "post my comments to the PR", "send the review comments".
Build and sharpen a project's domain model. Use when the user wants to pin down domain terminology or a ubiquitous language, record an architectural decision, or when another skill needs to maintain the domain model.
Manage spec writing, implementation, and bug fixing.