Optimize and route lessons to rule files (Phase 3 only)
Routes lessons to appropriate rule files and optimizes them with emphasis keywords and peripheral bias.
/plugin marketplace add anouar1991/rules-learning-pipeline/plugin install anouar1991-rules-learning-pipeline@anouar1991/rules-learning-pipelineRun Phase 3 of the learning pipeline - route lessons and optimize rule files.
/rules-learning-pipeline:optimize-prompts <lessons-file> [--dry-run]
Route lessons by validated scope:
For each target file:
Route expansion decisions:
Task(
subagent_type: "prompt-optimizer",
prompt: "Optimize lessons at {lessons_file}:
1. GROUP lessons by scope:
- user-general → ~/.claude/CLAUDE.md
- cross-project-domain → ~/.claude/rules/{framework}.md
- project → project/CLAUDE.md
- domain → context/rules/{domain}.md
2. FOR each target file:
- Read existing rules
- Merge new lessons
- Remove duplicates
- Apply peripheral bias
- Add emphasis (MUST/NEVER/CRITICAL)
- Verify < 60 lines (warn if exceeded)
3. ROUTE expansion:
IF critical pattern → CREATE file immediately
ELSE IF ≥3 rules → CREATE domain file
ELSE → Add to pending section
4. UPDATE router index
Output to:
- docs/evaluations/{session}-optimized.md
- Updated rule files (unless --dry-run)"
)
| Practice | Implementation |
|---|---|
| Length < 60 lines | Enforced per file, warn if exceeded |
| Peripheral bias | Critical rules at START and END |
| Emphasis keywords | MUST, NEVER, CRITICAL, ALWAYS |
| Specificity | No vague language allowed |
| No style rules | Defer to linters |
docs/evaluations/{session}-optimized.md - Optimization report~/.claude/CLAUDE.md (if user-general rules)project/CLAUDE.md (if project rules)context/rules/*.md (if domain rules)