Pattern escalation
Skill crombieman/undercurrent-cortex/skills/pattern-escalation
This skill should be used when a problem class has appeared 2+ times across sessions — escalates recurring patterns up through the memory tier hierarchy.From its SKILL.md
npx -y skills add crombieman/undercurrent-cortex --skill pattern-escalationAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
3.6 KB, as published. Nobody here has run it
Pattern Escalation
TL;DR: Escalate recurring patterns up 3 tiers: lessons.md → MEMORY.md → CLAUDE.md.
Level 1 — tasks/lessons.md
Add/update: problem → root cause → fix → prevention rule. If variant of existing lesson: UPDATE that entry. Do not duplicate.
Level 2 — MEMORY.md (project root)
Add one-liner to relevant section. Format: **Pattern**: Rule.
Ensures every future session-start reads it.
Level 3 — CLAUDE.md (architectural patterns only)
Criteria: affects schema, pipeline design, security, or data integrity. Flag to Will before committing. Do NOT auto-commit CLAUDE.md changes.
Memory curation (every ~10 sessions or when lessons.md > 40 entries)
Classify each lesson:
- Structural → promote one-liner to MEMORY.md, remove detail from lessons.md
- Active → keep
- Obsolete → delete Goal: lessons.md stays actionable, not a graveyard.
Skill accuracy check
Whenever a skill's advice is followed and produces a wrong result: update the skill immediately. Don't wait for pattern-escalation. Stale skills give confident wrong guidance. Pipeline numbers, DB patterns, and institutional checklist items are the most likely to drift.
Proposal-aware escalation
Evolution proposals live at .claude/cortex/proposals.local.md. Each proposal has:
id(YYYYMMDD-HHMMSS-slug),status(pending/approved/rejected/expired),domain,occurrences,severitytype: hook-rule | skill-update | claude-md-amendmentprobation=3: new hooks run in warn-only mode for 3 sessions before blocking
Escalation path
- 1st occurrence — Lesson captured in
tasks/lessons.md - 2nd occurrence — Existing lesson updated with new variant
- 3rd+ occurrence — Conversation-analyzer generates a proposal with evidence
- User review — Proposals surfaced at session start; reviewed via
/analyze-session - Approved — Implementer applies the change, updates proposal
status=appliedwith commit SHA - Rejected — User marks
status=rejectedwith reason
Amplification path
When a lesson has been followed consistently (5+ sessions since written, 0 recurrences in that domain):
- Skill reference — Add as "Known pitfall" in the relevant SKILL.md
- Hook enforcement — If detectable by static analysis of tool input (file paths, code patterns, command strings), propose a new hook matcher
- All new hooks include
probation=3— warn-only for 3 sessions, then blocking
Review protocol (at session start)
When session-start surfaces pending proposals:
- Read each pending proposal
- Assess: still relevant? evidence strong? risk acceptable?
- Mark
status=approved(implement now),status=rejected(with reason), or leave pending - Approved proposals get implemented in the current session if time allows
Staleness rule
Proposals pending for 10+ sessions without review → mark status=expired. The pattern may resurface later if it recurs, generating a fresh proposal with updated evidence.
See Also
- session-end — Session end triggers pattern escalation check for recurring issues [lifecycle]
- session-start — Session start surfaces pending escalation proposals for review [lifecycle]
- systematic-debugging — Debugging discovers patterns that feed into escalation [upstream]