learn-rules

Converts conversation feedback into persistent Claude Code rules, skills, hooks, and memory assets.

Updated Dec 25, 2021
One-click install
npx skills add https://github.com/kotahashihama/dotfiles --skill learn-rules-kotahashihama
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: learn-rules
Source: https://github.com/kotahashihama/dotfiles/tree/main/home/.claude/skills/learn-rules
Command: npx skills add https://github.com/kotahashihama/dotfiles --skill learn-rules-kotahashihama

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Corrections, preferences, and lessons from a conversation are lost when the session ends, forcing users to repeat the same instructions. This Skill captures that feedback and turns it into persistent global assets (rules, skills, hooks, memory) so it applies in future sessions. ## Core Features & Use Cases - One-off vs. recurring judgment: First decides whether feedback is a one-time instruction or a recurring convention, avoiding asset pollution from single-use requests. - Placement decision: Routes each learning to the right location (rules/, skills/, settings.json hooks, CLAUDE.md, or project memory) and to public (home/) vs. private/ storage based on sensitivity. - Approval and maintenance workflow: Requires AskUserQuestion confirmation before editing, then performs inventory cleanup (split, merge, delete, cross-reference) and commits changes to the dotfiles repository. - Use Case: After a user corrects the assistant twice about commit message style, invoke this Skill to propose a new rule file, get approval, place it in the correct directory, cross-link related rules, and commit the change. ## Quick Start Ask the assistant to run /learn-rules to turn the recent corrections from this conversation into a persistent rule or skill.

Frequently Asked Questions about learn-rules

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I make Claude Code remember my preferences across sessions?

Use the learn-rules Skill to convert feedback into persistent assets like rules, skills, hooks, or memory files. It first judges whether the feedback is recurring, proposes a placement, asks for your approval, then writes and commits the change.

How do I create a custom rule or skill for Claude Code?

Invoke /learn-rules with the content you want captured, or let it pick up recent conversation context. It determines whether the content belongs in rules/, skills/, hooks, CLAUDE.md, or project memory, then writes it following existing conventions.

When should I use a hook instead of a rule in Claude Code?

Use a hook in settings.json when the behavior must run every time without exception, since rules can be overlooked while hooks always execute. The Skill routes 'must always happen' requirements to hooks and validates them against real input payloads.

Can I store company-internal names in Claude Code configuration?

Internal names, repository identifiers, and product details should go into the private/ directory, not the public home/ directory which is visible on GitHub. When in doubt, the Skill defaults to private placement since public exposure cannot be undone.

What happens if a rule exists but Claude keeps violating it?

The Skill treats repeated violations as a defect in the rule itself rather than ignoring them. It fixes ambiguous wording, relocates rules that are not being read, or deletes rules that are unenforceable or redundant.