claude/skills/learn/SKILL.md
This skill should be used when the user asks to "save learnings", "remember this for next time", "add this to CLAUDE.md", "update your instructions", or wants to extract lessons from the current conversation.
npx skillsauth add tbroadley/dotfiles learnInstall 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 learnings from the current conversation and persist them to CLAUDE.md, skills, or repo-specific documentation.
Analyzes the conversation to identify:
Summarizes these into actionable rules
Updates the appropriate files:
~/dotfiles/claude/CLAUDE.md): General coding style and behavior rules~/dotfiles/claude/skills/<skill-name>/SKILL.md): Skill-specific learningsAGENTS.md or CLAUDE.md): Repo-specific gotchas and surprising behaviorsCommits and pushes the changes
If running in a dev container, runs ~/dotfiles/install.sh to propagate global changes
If the current repo has an open PR, fetch PR review comments to include in the analysis:
# Get current repo info
repo=$(gh repo view --json nameWithOwner -q '.nameWithOwner')
# Check for open PR on current branch
pr_number=$(gh pr view --json number -q '.number' 2>/dev/null)
if [ -n "$pr_number" ]; then
# Fetch PR review comments
gh api repos/$repo/pulls/$pr_number/comments --paginate
# Fetch PR review threads for more context
gh api graphql -f query='
query {
repository(owner: "'${repo%/*}'", name: "'${repo#*/}'") {
pullRequest(number: '$pr_number') {
reviewThreads(first: 100) {
nodes {
comments(first: 10) {
nodes {
body
author { login }
}
}
}
}
}
}
}
'
fi
Review the entire conversation looking for:
User Feedback:
Surprising Discoveries (from working on tasks):
Focus on learnings that are:
For each learning, draft a concise rule:
Group related learnings under existing sections in CLAUDE.md when possible.
Add to ~/dotfiles/claude/CLAUDE.md (global) if:
Add to a skill file (~/dotfiles/claude/skills/<skill>/SKILL.md) if:
Add to the current repo's AGENTS.md or CLAUDE.md if:
Prefer AGENTS.md if it exists; otherwise use CLAUDE.md. Create the file if neither exists and the learning is valuable enough.
Read the target file(s) to understand their structure:
# Global rules
cat ~/dotfiles/claude/CLAUDE.md
# Skill-specific
cat ~/dotfiles/claude/skills/<skill-name>/SKILL.md
# Current repo (check which exists)
cat AGENTS.md 2>/dev/null || cat CLAUDE.md 2>/dev/null || echo "No repo instructions file"
Edit the file to add the new rules:
For global/skill updates (dotfiles repo):
cd ~/dotfiles
git add -A
git commit -m "Add learnings from conversation
<brief summary of what was added>
Co-Authored-By: <agent-name> <agent-noreply-email>"
git push
For current repo updates:
# In the current repo (not dotfiles)
git add AGENTS.md CLAUDE.md 2>/dev/null
git commit -m "Document learnings from current session
<brief summary of gotchas/discoveries added>
Co-Authored-By: <agent-name> <agent-noreply-email>"
git push
If updating both dotfiles and the current repo, make separate commits in each.
If running inside a dev container, run install.sh to propagate the updated CLAUDE.md:
# Check if we're in a dev container (not the dotfiles repo itself)
if [ -f /.dockerenv ] && [ "$PWD" != "$HOME/dotfiles" ] && [ "$PWD" != "/workspaces/dotfiles" ]; then
~/dotfiles/install.sh
fi
From a conversation where the user corrected test mocking practices:
## Testing (pytest)
- Mock only at external boundaries (I/O, network, external libraries), not internal implementation details
- Prefer real data structures over MagicMock for return values
From PR feedback about error handling:
## Python Style
- Fail early: prefer code that fails immediately over code that logs a warning and potentially behaves incorrectly later
From debugging a test failure:
## Gotchas
- The `process_data()` function silently returns `None` if the input list is empty instead of raising an error
- Database migrations must be run with `--fake-initial` on first deploy due to legacy schema
From discovering undocumented API behavior:
## API Notes
- The `/users` endpoint returns max 100 results even without pagination params (undocumented limit)
- Rate limiting kicks in at 50 req/min per IP, not per API key as docs suggest
tools
Add words to the Wispr Flow dictionary. Use when the user wants to add a word, phrase, or snippet to Wispr Flow for voice dictation.
documentation
Upload images to a GitHub PR description or comment using a shared gist as image hosting. Use when the user wants to add plots, screenshots, or other images to a PR.
testing
Manage tasks, projects, and productivity in Todoist. View tasks, add new items, check completed work, and organize projects.
data-ai
Use when working with stacked diffs (branch B based on branch A, which is based on main).