From workflow
Extract reusable patterns from the current session and save them for future use.
How this skill is triggered — by the user, by Claude, or both
Slash command
/workflow:learnThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Extract reusable patterns from the current session and save them for future use.
Extract reusable patterns from the current session and save them for future use.
/workflow:learn [pattern-name]
~/.claude-workflows/memory/$ARGUMENTS
You are extracting learnings from this session. Follow these steps:
Review the conversation history for:
INCLUDE patterns that are:
EXCLUDE patterns that are:
Based on what you found, choose the appropriate storage:
For project-specific learnings - auto-loaded by Claude Code for ALL sessions.
# Get project root
PROJECT_ROOT=$(git rev-parse --show-toplevel 2>/dev/null || pwd)
# Append to project's CLAUDE.md under "## Workflow Learnings" section
# File: $PROJECT_ROOT/CLAUDE.md
Append learnings under ## Workflow Learnings with subsections:
For patterns that apply across multiple projects.
Create a skill file at <HOME>/.claude/skills/learned/<pattern-name>.md (resolve <HOME> via echo $HOME).
# <Pattern Name>
> Extracted: {{DATE}}
> Applicability: <when this pattern applies>
## Problem
<specific issue this addresses>
## Solution
<the reusable pattern or technique>
## Example
<code demonstration if relevant>
## Trigger Conditions
<when this skill should activate>
Get the project root:
PROJECT_ROOT=$(git rev-parse --show-toplevel 2>/dev/null || pwd)
Read existing CLAUDE.md if present:
cat "$PROJECT_ROOT/CLAUDE.md" 2>/dev/null || echo "# Project Instructions"
Append new learnings under ## Workflow Learnings section
For reusable skills, create the skill file using Write tool with absolute path (never ~)
Summarize what was learned:
┌─────────────────────────────────────────────────────────┐
│ LEARNINGS EXTRACTED │
├─────────────────────────────────────────────────────────┤
│ Project CLAUDE.md Updated: <project>/CLAUDE.md │
│ (Auto-loaded by Claude Code for all sessions) │
│ │
│ New Patterns: │
│ • <pattern 1> │
│ • <pattern 2> │
│ │
│ Reusable Skills Created: │
│ • ~/.claude/skills/learned/<skill-name>.md │
│ │
│ Filtered Out (trivial): │
│ • <why certain things were excluded> │
└─────────────────────────────────────────────────────────┘
## Problem
Jest tests fail with "Cannot find module" when using path aliases
## Solution
Add moduleNameMapper to jest.config.js matching tsconfig paths:
```js
moduleNameMapper: {
'^@/(.*)$': '<rootDir>/src/$1'
}
When seeing path alias import errors in Jest tests
### Patterns to Skip
- "Fixed typo in variable name" (too trivial)
- "Server was down, waited and retried" (one-time issue)
- "Added semicolon" (basic syntax)
## Memory File Format
```markdown
# Project Memory: my-project
## Last Updated
2024-01-15T10:30:00Z
## Key Decisions
- Using repository pattern for data access (decided 2024-01-10)
- Chose Zod over Yup for validation - better TypeScript inference
## Patterns Discovered
- This codebase uses barrel exports in each module's index.ts
- Error handling follows Result<T, E> pattern, not exceptions
## Issues Resolved
- ESLint conflict with Prettier: added eslint-config-prettier
- TypeScript strict mode broke 15 files: documented fixes in MIGRATION.md
## Conventions Learned
- All API responses wrapped in { data, error, meta } envelope
- Feature flags stored in config/features.ts, not env vars
When a workflow completes successfully, it should call /workflow:learn to extract patterns before closing. This ensures continuous improvement of project knowledge.
npx claudepluginhub zb-ss/claude-plugin-workflow --plugin workflowGuides creation, editing, and verification of skills for AI coding agents using test-driven development with subagent scenarios. Use when authoring or debugging skills.