Extract patterns from git history and session files, recommend artifacts (skill/rule/hook/agent) based on frequency thresholds
Analyzes git history and session files to identify recurring patterns, recommending durable artifacts (skills, rules, hooks, agents) when patterns appear 3+ times. Triggers on `/learn` to transform repeated behaviors into encoded knowledge.
/plugin marketplace add majesticlabs-dev/majestic-marketplace/plugin install majestic-llm@majestic-marketplaceThis skill is limited to using the following tools:
Transform recurring patterns into durable artifacts. Use frequency-based thresholds to distinguish noise from signal.
Scan these locations for patterns:
| Source | Command/Path | What to Extract |
|---|---|---|
| Git commits | git log --oneline -100 | Repeated fix types, refactor patterns |
| Git commit bodies | git log -50 --format="%B---" | Lessons in commit descriptions |
| PR descriptions | gh pr list --state merged -L 20 | Decisions, learnings |
| Handoffs | $MAIN_WORKTREE/.claude/handoffs/*.md | Patterns, What Worked/Failed |
| Key Learnings | CLAUDE.md (Key Learnings section) | Existing encoded patterns |
Note: Session ledger (.claude/session_ledger.md) is for /reflect only - ephemeral per-session state.
# Git patterns (look for repeated prefixes/types)
git log --oneline -100 | cut -d' ' -f2- | sort | uniq -c | sort -rn
# Handoff patterns
grep -h "^- " .claude/handoffs/*.md 2>/dev/null | sort | uniq -c | sort -rn
Before counting, normalize patterns:
Group by semantic meaning, not exact wording.
| Occurrences | Action | Rationale |
|---|---|---|
| 1 | Skip | Could be noise, one-off incident |
| 2 | Note | Emerging pattern, watch for recurrence |
| 3+ | Recommend | Clear pattern, suggest artifact |
| 4+ | Strong recommend | Encode immediately |
Use this decision tree to determine artifact type:
Is it a sequential workflow with distinct phases?
YES → Consider COMMAND (user-invoked) or AGENT (autonomous)
Does it need user interaction during execution?
YES → COMMAND
NO → AGENT
NO ↓
Should it trigger automatically on file/context patterns?
YES → SKILL (probabilistic, Claude MAY follow)
Is enforcement critical (must happen every time)?
YES → Consider HOOK instead (deterministic)
NO ↓
Is it a simple rule or convention?
YES → RULE (add to CLAUDE.md or review-topics.md)
Project-specific? → review-topics.md
Universal? → CLAUDE.md
NO ↓
Does it enhance an existing agent's behavior?
YES → AGENT UPDATE (modify existing agent)
NO → Likely doesn't need encoding
| Artifact | When to Use | Example |
|---|---|---|
| Rule | Simple convention, always applies | "Use kebab-case for file names" |
| Skill | Knowledge/context for specific work | "Stimulus controller patterns" |
| Hook | Must enforce behavior deterministically | "Run linter before commit" |
| Command | User-invoked workflow with arguments | "/deploy --env staging" |
| Agent | Autonomous task, returns report | "security-review agent" |
Present findings as:
## Compound Learnings Analysis
### Strong Signal (4+ occurrences)
| Pattern | Count | Recommended Artifact | Rationale |
|---------|-------|---------------------|-----------|
| ... | ... | ... | ... |
### Emerging Patterns (2-3 occurrences)
| Pattern | Count | Potential Artifact | Notes |
|---------|-------|-------------------|-------|
| ... | ... | ... | ... |
### Recommended Actions
1. **[Artifact Type]**: `name` - description
- Draft: [brief template or content]
Before recommending an artifact, verify:
When invoked from /learn:
Note: /reflect is for single-session analysis. /learn is for cross-session compound learning.
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code, generative art, algorithmic art, flow fields, or particle systems. Create original algorithmic art rather than copying existing artists' work to avoid copyright violations.
Applies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply.
Create beautiful visual art in .png and .pdf documents using design philosophy. You should use this skill when the user asks to create a poster, piece of art, design, or other static piece. Create original visual designs, never copying existing artists' work to avoid copyright violations.