plugins/dev-tools/skills/learning-patterns/SKILL.md
Extract learnings and generate project-specific customizations (CLAUDE.md, CONTEXT.md, ADRs, commands, skills, hooks). Use when user says "learn", "extract learnings", "what did we learn", "save learnings", "adapt config", "capture domain language", or wants to improve Claude Code based on conversation patterns.
npx skillsauth add alexei-led/claude-code-config learning-patternsInstall 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.
Extract actionable learnings and generate project-specific customizations. Adapts Claude Code to project patterns over time. Ground changes in actual conversation/tool output and ask one question at a time when confirmation is needed.
documenting-code; ask whether durable learning should also be captured only if the session reveals a reusable project rule./tmp/... paths; preserve only the durable rule, such as "skill eval summaries are written under the configured skill-eval workspace".AGENTS.md for workflow rules, CONTEXT.md for domain language, docs/adr/ for decisions, .claude/commands/ for repeated commands, or .claude/skills/ for complex workflows.Use TaskCreate to track these 9 phases:
<!-- CC-ONLY: end -->Find ALL project customization files:
# Run these in parallel via Glob
.claude/CLAUDE.md OR CLAUDE.md # Instructions
.claude/commands/*.md # Commands
.claude/skills/*/SKILL.md # Skills
.claude/settings.json # Hooks
.claude/rules/*.md # Rules
CONTEXT.md / CONTEXT-MAP.md # Domain language
docs/adr/*.md # Durable decisions
Record counts for budget tracking later.
Analyze conversation for these signal types:
| Signal | Look For | | ------------------ | --------------------------------------------- | | Corrections | "no", "wrong", "actually...", "instead..." | | Direct guidance | "always", "prefer", "use X", "never" | | Repeated explains | Same thing clarified 2+ times | | Project quirks | Unexpected behaviors, edge cases, workarounds | | Commands/workflows | Specific commands, sequences that worked |
| Signal | Look For | Confidence | | ------------------- | ---------------------------------------- | ---------- | | Repeated task | Same request 3+ times in session/history | HIGH | | "I always" pattern | "I always run X before Y" | HIGH | | Multi-step sequence | "first lint, then test, then build" | MEDIUM | | Template request | "create a new X like we discussed" | MEDIUM | | Workflow mention | "my workflow is X then Y then Z" | HIGH |
| Signal | Artifact | Look For | | -------------------- | ------------ | --------------------------------------------- | | Term resolution | CONTEXT.md | "call this X", "X means", overloaded jargon | | Ambiguity resolved | CONTEXT.md | "not account, customer", "avoid Y" | | Durable trade-off | ADR | hard-to-reverse, surprising, real alternative | | Scope rejection | .out-of-scope | "we will not support X because..." |
Only record domain concepts meaningful to domain experts. General implementation terms do not belong in CONTEXT.md.
| Signal | Look For | Confidence | | ------------------- | ----------------------------------------------- | ---------- | | Complex multi-tool | Workflow spanning 3+ files with analysis | HIGH | | Agent orchestration | "spawn agents to check X and Y in parallel" | HIGH | | Domain expertise | Detailed tech discussion needing reference docs | MEDIUM | | Progressive need | "for basic use X, for advanced see Y" | MEDIUM |
| Signal | Look For | Confidence | | ------------------ | ---------------------------------------- | ---------- | | Blocking rule | "never do X", "always block Y" | HIGH | | Validation need | "always run linter after edit" | HIGH | | Format requirement | "use prettier on save", "format on edit" | MEDIUM | | Approval pattern | "ask before destructive commands" | MEDIUM |
If $ARGUMENTS contains topic: Extract ONLY learnings related to that topic.
If $ARGUMENTS contains --dry-run: Show what would be created, don't write.
Pick an explicit target artifact for every durable learning before drafting text. Do not merely say you will discover possible destinations; choose the destination and name it in the workflow.
AGENTS.md / CLAUDE.md — reusable workflow or coding instructionsCONTEXT.md — domain language and project glossary termsdocs/adr/NNNN-slug.md — hard-to-reverse decisions with real alternatives.claude/commands/{name}.md — repeated command workflows.claude/skills/{name}/SKILL.md — complex reusable multi-tool workflows.claude/settings.json — hooks, permissions, or automationIf no target artifact is justified, do not persist the learning.
When the learning is a reusable project workflow, choose AGENTS.md/CLAUDE.md; when it is domain language, choose CONTEXT.md; when it is a hard-to-reverse decision, choose docs/adr/; when it is a repeated command sequence, choose .claude/commands/; when it is a reusable multi-tool process, choose .claude/skills/.
Sort extractions into buckets:
Instructions: [list of instruction candidates]
Domain docs: [CONTEXT.md / ADR / out-of-scope candidates]
Commands: [list of command candidates with names]
Skills: [list of skill candidates with names]
Hooks: [list of hook candidates with events]
Apply confidence threshold: Only include HIGH confidence for commands/skills/hooks. MEDIUM confidence items go to instructions in CLAUDE.md instead.
| Pattern | Example |
| ----------------- | -------------------------------------------- |
| Use X | Use prepared statements for SQL |
| Prefer X over Y | Prefer explicit returns over bare err |
| When X -> do Y | When tests fail -> check CI logs first |
| X requires Y | Auth endpoints require Bearer token |
| Run: \...` | Run:kubectl rollout restart deploy/api | |Note: X | Note:Get()returnsnil, nil` when absent |
One instruction per line. Max 80 chars.
---
description: { 1-line description }
allowed-tools: { tools needed, e.g., Bash(make *), Read }
argument-hint: { optional args }
---
# {Command Name}
{Brief purpose}
## Steps
1. {step from conversation}
2. {step from conversation}
## Context
{Any relevant @ references or bash context}
CONTEXT.md entries:
**Term**:
One-sentence definition.
_Avoid_: overloaded synonym, fuzzy alias
ADR entries under docs/adr/NNNN-slug.md:
# Decision title
One to three sentences: context, decision, why.
Write ADRs only when the decision is hard to reverse, surprising without context, and a real trade-off.
Out-of-scope records under .out-of-scope/<concept>.md capture rejected enhancements with reasoning and prior requests.
---
name: { kebab-case-name }
description: { when to use, triggers }
user-invocable: true
context: fork
allowed-tools: { restrictions if any }
---
# {Skill Name}
{Purpose}
## When to Use
- {scenario 1}
- {scenario 2}
## Workflow
1. {step 1}
2. {step 2}
SKILL.md under ~150 lines.{
"EventType": [
{
"matcher": "ToolPattern",
"hooks": [
{
"type": "command",
"command": "command-here",
"timeout": 30
}
]
}
]
}
Default to PostToolUse (non-blocking) unless explicit blocking requirement.
For each artifact type:
| Scenario | Action | | -------------------------- | -------------------------------------- | | New adds specificity | Update existing with concrete details | | New adds example | Append example to existing | | Both have value | Combine into single comprehensive item | | New is subset of existing | Keep existing, skip new | | Name collision (cmd/skill) | Merge content into existing file |
Prefer updating existing over creating new.
Recommended limits:
| Artifact | Limit | Why | | ----------- | --------- | --------------------- | | CLAUDE.md | 200 lines | Context efficiency | | CONTEXT.md | concise | Domain terms only | | ADRs | sparse | Decisions, not diary | | Commands | 10 | Discoverability | | Skills | 5 | Complexity management | | Hooks | 5 | Debugging simplicity |
If exceeding budget:
Show ALL proposed changes:
## Proposed Changes
### CLAUDE.md (instructions)
Target: `.claude/CLAUDE.md`
Lines: X/200
**Updates:**
- [old] -> [merged]
**Additions:**
- New instruction
### Commands
- `/pre-commit` - Run checks before commit
-> `.claude/commands/pre-commit.md`
### Skills
~ `auth-patterns` - Updated with OAuth2 flow
-> `.claude/skills/auth-patterns/SKILL.md`
### Hooks
- PostToolUse[Edit|Write]: Run prettier
-> `.claude/settings.json`
---
Rollback: `git checkout .claude/`
STOP:
<!-- CC-ONLY: begin -->Use AskUserQuestion:
| Header | Question | Options | | ------ | --------------------------- | ------------------------------------------ | | Action | Apply these customizations? | Apply all / Select items / Edit first / No |
<!-- CC-ONLY: end -->If "Select items": Show multi-select for each category.
Based on confirmation:
CONTEXT.md, ADRs, or .out-of-scope/ only for durable knowledgehooks objectAlways include verification in the workflow, even when only describing what would happen. Review every changed artifact before reporting success:
AGENTS.md/CLAUDE.md, CONTEXT.md, ADR, command, skill, or hook file.| Section | Content | | ---------- | -------------------------------- | | Patterns | Architecture, naming, structure | | Code Style | Formatting, idioms, conventions | | Workflows | Build, test, deploy commands | | Gotchas | Edge cases, quirks, known issues |
LEARNED
=======
Target: .claude/
Instructions: (CLAUDE.md)
~ "Use error wrapping" -> "Wrap errors: fmt.Errorf(\"op: %w\", err)"
+ "Note: API returns nil, nil when absent"
Commands: (commands/)
+ /pre-commit - Run lint, test, build
Skills: (skills/)
+ auth-patterns - OAuth2 and JWT handling
Domain docs:
+ CONTEXT.md: "Materialization" term
+ docs/adr/0003-use-events-for-materialization.md
Hooks: (settings.json)
+ PostToolUse[Edit]: prettier --write
Budget: 45/200 instructions | concise context | sparse ADRs | 3/10 commands | 1/5 skills | 1/5 hooks
tools
Idiomatic shell development for POSIX sh, Bash, Zsh, Fish, hooks, CI shell steps, and scriptable CLI glue. Use when writing or changing `.sh`, `.bash`, `.zsh`, `.fish`, `.bats`, shell functions, shell pipelines, or command-runner recipes. Emphasizes portability, quoting, safe filesystem/process handling, non-TUI CLI tools, ShellCheck, shfmt, Bats, and ShellSpec. NOT for Python, TypeScript, Go, web code, or infrastructure operations.
tools
Use when planning, executing, checkpointing, finishing, or inspecting lightweight spec-driven work. Runs one task at a time using `.spec/` markdown files and the bundled `specctl` helper. NOT for broad product discovery beyond a short requirement interview.
testing
Author, inspect, troubleshoot, and review infrastructure across IaC, Kubernetes, cloud resources, containers, CI/CD, and Linux hosts. Use when changing Terraform/OpenTofu, Kubernetes, Helm, Kustomize, Dockerfiles, GitHub Actions, AWS, GCP, Cloud Run, BigQuery, IAM, logs, instances, or service health. NOT for deploy/apply/rollback workflows (see deploying-infra). NOT for shell scripts or generic command pipelines (see writing-shell).
development
Configure safe git workflow hygiene: pre-commit/pre-push hooks, Gitleaks secret scanning, .gitignore rules, local git config, and guardrails. Use when setting up git hooks, gitleaks/git leaks, staged pre-commit checks, pre-push validation, core.hooksPath, .gitignore, or git config best practices. NOT for creating commits (use committing-code), cleaning branches/worktrees (use cleanup-git), or creating worktrees (use using-git-worktrees).