# Emerge

> Surface unnamed patterns across vault notes. Use when: (1) /emerge for last 30 days, (2) /emerge 14d for custom window, (3) /emerge this week.

- **Type:** Skill
- **Install:** `agentstack add skill-abhattacherjee-claude-code-skills-emerge`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [abhattacherjee](https://agentstack.voostack.com/s/abhattacherjee)
- **Installs:** 0
- **Category:** [Security](https://agentstack.voostack.com/c/security)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [abhattacherjee](https://github.com/abhattacherjee)
- **Source:** https://github.com/abhattacherjee/claude-code-skills/tree/main/plugins/obsidian-brain/skills/emerge

## Install

```sh
agentstack add skill-abhattacherjee-claude-code-skills-emerge
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# Emerge — Discover Patterns Across Your Obsidian Vault

**Tools needed:** Bash, Agent, Write, Read

## Procedure

### Step 0 — Create task manifest

```
TaskCreate: subject="Collect and upgrade vault corpus", activeForm="Collecting vault corpus"
TaskCreate: subject="Analyze patterns across notes", activeForm="Analyzing patterns"
TaskCreate: subject="Build emerge report", activeForm="Building report"
TaskCreate: subject="Write vault note", activeForm="Writing vault note"
TaskCreate: subject="Present results", activeForm="Presenting results"
```
Track task IDs. Set task #1 to `in_progress`.

### Step 1 — Parse args + upgrade + collect corpus

**Optional flags:**
- `--include-snapshots` — include `claude-snapshot` notes in the corpus.
  By default snapshots are excluded; their transient "Key context" bullets
  dilute cross-session pattern synthesis.

Parse args: strip `--include-snapshots` first (set `INCLUDE_SNAPSHOTS=1` or `0`), then parse remaining arg as DAYS: no arg=30, `Nd`/`N days`=N, `this week`=days since Monday.

```bash
cd "$(git rev-parse --show-toplevel 2>/dev/null || pwd)"
python3 -c '
import sys, os, glob; sys.path.insert(0, max(glob.glob(os.path.expanduser("~/.claude/plugins/cache/*/obsidian-brain/*/hooks")), default="hooks"))
from emerge_cli import run_corpus; run_corpus(int(sys.argv[1]) if len(sys.argv) > 1 else 30, include_snapshots=(sys.argv[2] == "1") if len(sys.argv) > 2 else False)
' "$DAYS" "$INCLUDE_SNAPSHOTS"
```

If STATUS starts with `CACHED:`, report "Using cached corpus (::` or `EMPTY:0:0:0`). EMPTY -> tell user to widen window, stop. Report upgrades. If `failed > 0` -> Step 1f, else Step 2. Mark task #1 `completed`.
### Step 1f — Sub-agent fallback (skip if no failures)
Spawn parallel sub-agents for failed notes (read note, write summary to temp, write back via `upgrade_note_with_summary`) — mirrors `/recall` Phase 2 fallback. Re-collect:

```bash
cd "$(git rev-parse --show-toplevel 2>/dev/null || pwd)"
python3 -c '
import sys, os, glob; sys.path.insert(0, max(glob.glob(os.path.expanduser("~/.claude/plugins/cache/*/obsidian-brain/*/hooks")), default="hooks"))
from emerge_cli import run_recollect; run_recollect(int(sys.argv[1]) if len(sys.argv) > 1 else 30, include_snapshots=(sys.argv[2] == "1") if len(sys.argv) > 2 else False)
' "$DAYS" "$INCLUDE_SNAPSHOTS"
```

### Step 2 — Pattern synthesis
Set task #2 to `in_progress`. Spawn one Agent:
```
Agent({
  description: "Analyze vault corpus for cross-cutting patterns",
  prompt: "Read ~/.claude/obsidian-brain/emerge-corpus.json. Analyze and write to ~/.claude/obsidian-brain/emerge-analysis.md with these 5 categories:\n\n## Recurring Technical Patterns\nPatterns in approaches, tools, or architecture across 2+ sessions.\n\n## Error Clusters\nRepeated error types, common root causes, or failure modes.\n\n## Decision Trends\nDirectional shifts in technical decisions over time.\n\n## Cross-Project Connections\nShared themes between projects. Skip if only 1 project.\n\n## Emergent Practices\nImplicit conventions that formed organically but aren't documented.\n\nFor each pattern: descriptive name, 2-3 examples with note references, confidence (strong/moderate/tentative).\n\nWrite using the Write tool. Return ONLY: WRITTEN:~/.claude/obsidian-brain/emerge-analysis.md"
})
```

If no `WRITTEN:` response, report failure and stop. Mark task #2 `completed`.

### Step 3 — Build output + write note
```bash
cd "$(git rev-parse --show-toplevel 2>/dev/null || pwd)"
python3 -c '
import sys, os, glob; sys.path.insert(0, max(glob.glob(os.path.expanduser("~/.claude/plugins/cache/*/obsidian-brain/*/hooks")), default="hooks"))
from emerge_cli import run_build_note; run_build_note()
' 2>&1
```

Parse `SAVED:` and everything after `---REPORT---`. Mark tasks #3-#4 `completed`.

### Step 4 — Present to user
Display report prefixed with **Pattern Discovery Results:**. Confirm saved path. Mark task #5 `completed`.

## Edge Cases
- **No notes in window:** Suggest widening (e.g., `/emerge 60d`).
- **Only 1 project:** Sub-agent skips Cross-Project Connections.
- **Very large corpus (200+):** Python distills to ~25k tokens JSON, fits one sub-agent.
- **Config not found:** Tell user to run `/obsidian-setup` first.

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [abhattacherjee](https://github.com/abhattacherjee)
- **Source:** [abhattacherjee/claude-code-skills](https://github.com/abhattacherjee/claude-code-skills)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-abhattacherjee-claude-code-skills-emerge
- Seller: https://agentstack.voostack.com/s/abhattacherjee
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
