**Status:** 📋 Agent Guideline | **Module:** ritual | **Part of:** Agent Brain Pattern detection and habit tracking. The agent should watch for repeated behaviors and store them as `pattern` entries.
Scanned 9/7/2026
Install to Claude Code
npx -y skills add modbender/skill-library-mcp --skill ritual --agent claude-codeInstalls into .claude/skills of the current project.
Are you the author of Ritual?
Add the live security badge to your README — it updates automatically with every re-scan.
[](https://www.skillsdirectory.com/skills/modbender-ritual)More formats (shields.io, HTML) on the badges page.
# Ritual Memory 🔄
**Status:** 📋 Agent Guideline | **Module:** ritual | **Part of:** Agent Brain
Pattern detection and habit tracking. The agent should watch for repeated behaviors and store them as `pattern` entries.
## What It Does
Guides the agent to notice repeated actions and store them as `pattern` entries. Ritual does NOT run automatically — the agent must manually check for patterns using the `similar` command.
## Detection
The agent uses the `similar` command to find related entries:
### After Storing a Procedure or Preference
```bash
# After storing, check for similar entries
./scripts/memory.sh similar "<content>" 0.10
# If 3+ SIMILAR_ENTRIES of same type → create a pattern
./scripts/memory.sh add pattern "User always asks for examples when learning" \
inferred "learning,style,examples"
```
This is a **manual** step the agent should perform — it is not automatic.
### What the `similar` Command Does
- Uses TF-IDF with cosine similarity (no external libraries)
- Filters stopwords for meaningful comparison
- Returns scored results above threshold (default 0.10)
- Works across sessions — the engine handles persistence
### What Counts as "Similar"
- TF-IDF similarity score >= 0.10 (configurable threshold)
- Same or overlapping tags
- Same type of action (procedure/preference)
## Anti-Pattern Detection (Automatic)
The ONE automatic detection that exists: when the `correct` command is called and 3+ corrections share the same tag, the system suggests creating an anti-pattern entry. This IS implemented in code.
```bash
# After 3 corrections with tag "code.database":
# System prints: ANTI_PATTERN_DETECTED: tag 'code.database' has 3 corrections
# Suggests: add anti-pattern "Avoid inferring code.database - ask explicitly" inferred "code.database,caution"
```
## Pattern Storage
```bash
# When the agent detects a pattern (manual):
./scripts/memory.sh add pattern "User always asks for examples when learning new concepts" \
inferred "learning,style,examples"
```
Pattern entries have:
- `source: "inferred"` (not user-stated)
- `confidence: "uncertain"` (until confirmed)
- Tags linking to the topic area
## Pattern Lifecycle
```
Behavior observed once → stored as fact/preference/procedure
Agent runs similar, finds 3+ matches → agent creates pattern entry (uncertain)
User confirms pattern → ./scripts/memory.sh update <id> confidence sure
User denies pattern → ./scripts/memory.sh supersede <id> <new_id>
Pattern unused 60+ days → decayed via standard decay
```
## What Ritual Does NOT Do
- Auto-detect patterns (agent must manually run `similar`)
- Execute automated workflows
- Call external APIs or services
- Run scheduled tasks
## Integration
- **Archive**: Agent reads `similar` results to detect patterns manually
- **Gauge**: Patterns start as UNCERTAIN, upgrade on confirmation
Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.
No comments yet. Be the first to comment!