Instinct Clustering
Overview
Cluster related instincts into higher-level abstractions: skills, commands, or agents. This skill analyzes accumulated behavioral patterns (instincts) and identifies groups that can be consolidated into reusable components.
Position: observe → instincts → cluster (this skill) → skills/commands/agents
Quick Reference
| Task | Command |
|---|---|
| Scan instincts | node "${SKILL_ROOT}/scripts/learn.js" scan --project {p} |
| Preview clusters | node "${SKILL_ROOT}/scripts/learn.js" preview --project {p} |
| Generate artifact | node "${SKILL_ROOT}/scripts/learn.js" generate --cluster N --project {p} [--type skill|command|agent] [--name custom-name] [--dry-run] |
| List evolved | node "${SKILL_ROOT}/scripts/learn.js" list --project {p} |
Infrastructure Commands
Set SKILL_ROOT from skill loader header (# SKILL_ROOT: ...):
: "${SKILL_ROOT:=${ARCFORGE_ROOT:-}/skills/arc-learning}"
if [ ! -d "$SKILL_ROOT" ]; then
echo "ERROR: SKILL_ROOT=$SKILL_ROOT does not exist. Set ARCFORGE_ROOT or SKILL_ROOT manually." >&2
exit 1
fi
Workflow
- Scan: Load all instincts from
~/.claude/instincts/{project}/andglobal/ - Cluster: Group by domain, then within each domain use trigger fingerprint similarity (Jaccard >= 0.6) to find sub-clusters
- Filter: Only process clusters with 3+ instincts, at least 1 with confidence >= 0.6
- Preview: Display candidate clusters with type recommendations and suggested names
- Generate: Create skill, command, or agent from a cluster (auto-classified or user-overridden)
- Track: Record evolution to
~/.claude/evolved/evolved.jsonlfor deduplication
Note: Generated files are scaffolds — refine before deployment.
When to Use
instinct evolvesuggests clustering candidates- 5+ instincts accumulated in the same domain
- User wants to consolidate behavioral patterns into reusable components
- User explicitly asks to cluster or organize instincts
When NOT to Use
- Fewer than 3 instincts in any domain
- User wants to save a single pattern (use /recall instead)
- User wants to reflect on diaries (use /reflect instead)
- User wants to confirm/contradict individual instincts (use arc-observing)
Generation Types
Classification is hybrid: domain+threshold primary, keywords as tiebreaker.
| Rule | Condition | Type |
|---|---|---|
| 1 | Domain is workflow or automation + avg confidence >= 0.7 |
command |
| 2 | Cluster size >= 3 + avg confidence >= 0.75 | agent |
| 3 | Default (no primary rule matches) | skill |
Tiebreaker: if behavioral tokens ("always", "prefer", "avoid") outnumber action tokens ("when starting", "when running") 2:1 → skill. Reverse → command.
Commands always produce a backing skill (arcforge convention). Source instincts are left in place after evolution.
Key Principles
- User-driven: Preview clusters and let user decide what to create
- Minimum cluster size: 3+ instincts required per cluster
- Quality threshold: At least 1 instinct must have confidence >= 0.6
- Source tracking: Record which instincts were evolved via JSONL log
- No re-evolution:
isAlreadyEvolved()prevents duplicate generation
Converted and distributed by TomeVault — claim your Tome and manage your conversions.