Skip to content
Productivity
Command

/learn-rule

Capture a lesson as a reusable rule after user approval.

From plugin
pro-workflow
2.9k23 skills8 agents23 commands22 hooks
> /plugin marketplace add rohitg00/pro-workflow
> /plugin install pro-workflow@pro-workflow

Command definition

learn-rule.md
description: Capture a lesson as a reusable rule after user approval.

/learn-rule - Extract Correction to Memory

Capture a lesson from this session into permanent memory.

Process

1. **Identify the lesson**

  • What mistake was made?
  • What should happen instead?

2. **Format the rule**

   [LEARN] Category: One-line rule

Categories:

  • Navigation (file paths, finding code)
  • Editing (code changes, patterns)
  • Testing (test approaches)
  • Git (commits, branches)
  • Quality (lint, types, style)
  • Context (when to clarify)
  • Architecture (design decisions)
  • Performance (optimization)
  • Claude-Code (sessions, modes, CLAUDE.md, skills, subagents, hooks, MCP)
  • Prompting (scope, constraints, acceptance criteria)

3. **Propose addition** Show what will be added to LEARNED section.

4. **Wait for approval** Only add after user confirms.

Example

Recent mistake: Edited wrong utils.ts file

[LEARN] Navigation: Confirm full path when multiple files share a name.

Add to LEARNED section? (y/n)

---

Claude Code Examples

[LEARN] Claude-Code: Use plan mode before multi-file changes.
Docs: https://code.claude.com/docs/common-workflows

[LEARN] Claude-Code: Compact context at task boundaries, not mid-work.
Docs: https://code.claude.com/docs/common-workflows

[LEARN] Prompting: Always include acceptance criteria in prompts.

---

**Trigger:** Use when user says "remember this", "add to rules", or after making a mistake.

Read more
@rohitg00
Ships withpro-workflow

Claude Code learns from your corrections: self-correcting memory that compounds over 50+ sessions. Context engineering, parallel worktrees, agent teams, and 17 battle-tested skills.

2.9k41 skills8 agents
Get the whole plugin

Stars on GitHub

Momentum

stars in total
2.9k
Star history of rohitg00/pro-workflow on GitHub, a chart by star-history.com

Other commands on pro-workflow.

auto-setup

auto-setup

Command

Auto-detect project type and configure quality gates, permissions, and hooks for a new codebase

@rohitg00@rohitg00Install Command
compact-guard

compact-guard

Command

Smart context compaction with state preservation — saves critical state before compact and restores after

@rohitg00@rohitg00Install Command

More commands from other plugins.

analyze-cohorts

analyze-cohorts

Command

Perform cohort analysis on user data — retention curves, feature adoption, and engagement trends

@phuryn@phurynInstall Command
again

again

Command

PUA Again — 用于再试试、换个方法、别放弃、为什么还不行、同一路径失败多次;要求停止微调同一思路,改用本质不同方案。

pua2mo20k
@tanweai@tanweaiInstall Command