consult-scars
Skill4 starsChanged 7 months agoMITView on GitHub
Scar-tissue retrieval. Loads relevant past lessons from ~/.claude/lessons/ before producing any architectural plan, so you don't repeat mistakes that already cost time/money. Use this skill at the START of any task involving: authentication, JWT, OAuth, RBAC, sessions, multi-tenancy, permissions, caching (any layer), cache invalidation, TTLs, database migrations, schema changes, ORM upgrades, indexes, distributed locking, payment flows, refunds, webhook handling, queue processing, retry logic, error recovery, rate limiting, deploys, infrastructure changes, API contract design, response wrappers, response formats, frontend-backend type contracts, NestJS modules, NestJS DI, Prisma client setup, Next.js layouts, Server Components, seed data, demo data, fake data generation. Triggers on prompts containing "design", "refactor", "migrate", "introduce", "implement", "build", "set up", "fix", "upgrade", "add caching", "add auth", "ship", "deploy", "schema change", "data model", "memory system", "agent architecture", "tune Claude", "context optimization", "improve Claude" or any combination of action verbs with the topics above. ALSO use when user asks to plan, spec, or architect anything non-trivial. The cost of skipping this skill is repeating a known-broken pattern; the cost of running it is ~30 seconds and ~500 tokens.
In this repository2 other files it gives its agents.
- enhanceSkill
- refresh-codemapSkill
The file
We split this skill into the rules it gives an agent
9 rules. About 0 are common, 8 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈8
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 54
Use the Read tool. Skim every entry — they're short.
- Distinctive: line 62
If no lesson file exists for a domain, that's fine — note it in your plan ("no scar tissue logged for X — proceeding without precedent").
- Distinctive: line 73
If yes to any: revise your plan BEFORE presenting it.
- Distinctive: line 77
When you present the plan, name the lessons that informed it.
- Distinctive: line 94
If during execution something breaks, surprises you, or reveals a non- obvious gotcha:
- Distinctive: line 97
Stop and write the lesson IMMEDIATELY (not later).
- Very specific: line 98
Use the format in ~/.claude/lessons/README.md.
- Distinctive: line 104
After-the-fact lessons lose 60% of their specificity.
- Distinctive: line 119
If the user explicitly says "skip scar tissue, just do it" — comply.
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Consult Scars — load lessons before you plan
You are about to design, refactor, migrate, or introduce something. Before producing any plan or writing any code, run this protocol.
Step 1 — Identify domains touched
List the domains your task touches. Use the lesson library structure:
agent-architecture— memory, context, tooling for AI agentsagent-tuning— Claude Code config, output styles, pluginsapi-design— API contracts, response wrappers, namingauth— JWT, OAuth, sessions, RBAC, multi-tenancycaching— cache layers, TTLs, invalidationdata-modeling— schemas, seeds, soft-delete, time-seriesexternal-apis— rate limits, headers, auth, retries, pricingmigrations— schema changes, downtime, rollbacknestjs— NestJS-specific gotchasnextjs— Next.js / React-specific gotchasprisma— Prisma ORM specifics
A task can touch multiple domains. List all of them.
Step 2 — Load every relevant domain file
For each domain identified, read ~/.claude/lessons/<domain>.md.
Use the Read tool. Skim every entry — they're short. Pay attention to:
- The
Tagsfield — does this lesson actually apply to your specific case? - The
Severityfield — high-severity lessons get more weight in your plan. - The
Never do againfield — that's the actionable rule. - ARCHIVED entries — the body still has value as historical context but the rule no longer applies.
If no lesson file exists for a domain, that's fine — note it in your plan ("no scar tissue logged for X — proceeding without precedent").
Step 3 — Cross-check your proposed approach
For each lesson loaded, ask:
- Am I about to repeat this mistake?
- Does my proposed approach explicitly avoid the failure mode?
- Is there a lesson that suggests a better approach than the one I had in mind?
If yes to any: revise your plan BEFORE presenting it.
Step 4 — Surface lessons in your output
When you present the plan, name the lessons that informed it. Format:
Plan:
<approach summary>Lessons consulted:
- L-NESTJS-001 — avoiding ESM/CJS conflict by inlining types instead of importing from shared workspace package
- L-API-001 — typing the wrapper, not the inner data, in the new endpoint client
Domains with no logged scars:
caching(no~/.claude/lessons/caching.mdyet)
This makes the lesson library's contribution visible to the user — they can audit whether you're actually using it, and they can request specific lessons not be applied if context has changed.
Step 5 — Write a new lesson if something burns during the work
If during execution something breaks, surprises you, or reveals a non- obvious gotcha:
- Stop and write the lesson IMMEDIATELY (not later).
- Use the format in
~/.claude/lessons/README.md. - Get the next stable ID by reading the domain file's existing lesson IDs and incrementing.
- Anchor the lesson to a commit SHA, PR #, or short diff.
- Resume the task.
After-the-fact lessons lose 60% of their specificity. Write while it stings.
Step 6 — When NOT to write a lesson
- Project-specific gotchas that don't generalize → put in
<project>/memory/feedback_*.mdinstead. - Personal preferences without an underlying failure mode → put in
~/.claude/memory/_global/MEMORY.md. - General software-engineering principles you'd find in any architecture textbook → leave them out of the lessons library.
The lessons library should grow because of pain, not because of theory.
When this skill ITSELF is wrong
If the user explicitly says "skip scar tissue, just do it" — comply. The skill's forcing function is for default behavior, not absolute mandate. The user is in control.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

