npx skills add ...
npx skills add alirezarezvani/claude-skills --skill promote
Graduate a proven pattern from auto-memory (MEMORY.md) to CLAUDE.md or .claude/rules/ for permanent enforcement. Use when the user runs /si:promote or asks to make a learned behavior permanent.
npx skills add alirezarezvani/claude-skills --skill promote
Moves a proven pattern from Claude's auto-memory into the project's rule system, where it becomes an enforced instruction rather than a background note.
Parse the user's description. If vague, ask one clarifying question:
Show the matching entries and confirm they're what the user means.
| Pattern scope | Target | Example |
|---|---|---|
| Applies to entire project | ./CLAUDE.md | "Use pnpm, not npm" |
| Applies to specific file types | .claude/rules/<topic>.md | "API handlers need validation" |
| Applies to all your projects | ~/.claude/CLAUDE.md | "Prefer explicit error handling" |
If the user didn't specify a target, recommend one based on scope.
Transform the learning from auto-memory's note format into CLAUDE.md's instruction format:
Before (MEMORY.md — descriptive):
The project uses pnpm workspaces. When I tried npm install it failed. The lock file is pnpm-lock.yaml. Must use pnpm install for dependencies.
After (CLAUDE.md — prescriptive):
Rules for distillation:
For CLAUDE.md:
.claude/rules/ insteadFor .claude/rules/:
paths if scopedAfter promoting, remove or mark the original entry in MEMORY.md:
Ask the user to confirm removal. Then edit MEMORY.md to remove the promoted entry. This frees space for new learnings.
| Use CLAUDE.md for | Use .claude/rules/ for |
|---|---|
| Global project rules | File-type-specific patterns |
| Build commands | Testing conventions |
| Architecture decisions | API design rules |
| Team conventions | Framework-specific gotchas |
## Build & Dependencies
- Package manager: pnpm (not npm). Use `pnpm install`.---
paths:
- "src/api/**/*.ts"
- "tests/api/**/*"
---
# API Development Rules
- All endpoints must validate input with Zod schemas
- Use `ApiError` class for error responses (not raw Error)
- Include OpenAPI JSDoc comments on handler functions# Show what will be removed
grep -n "<pattern>" "$MEMORY_DIR/MEMORY.md"✅ Promoted to {{target}}
Rule: "{{distilled rule}}"
Source: MEMORY.md line {{n}} (removed)
MEMORY.md: {{lines}}/200 lines remaining
The pattern is now an enforced instruction. Claude will follow it in all future sessions.