Files
Bill Allred 5f0444fe5f Add /adopt skill for BYOV (Bring Your Own Vault) support
Adds a 6-phase skill that scaffolds the PKM system onto existing Obsidian
vaults: scan structure, map folders, personalize, generate config, scaffold
missing pieces, and verify. Replaces hardcoded folder paths in hooks with
env var lookups (${VAR:-Default}) so adopted vaults with custom folder names
work correctly while template-based vaults remain unaffected.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 17:54:13 -08:00

39 lines
1.2 KiB
Bash
Executable File

#!/bin/bash
# Status line script for Claude Code
# Shows vault statistics in the terminal status line
VAULT_PATH="${VAULT_PATH:-$(pwd)}"
# Count total notes (excluding hidden directories)
TOTAL_NOTES=$(find "$VAULT_PATH" -name "*.md" -type f -not -path "*/\.*" 2>/dev/null | wc -l | tr -d ' ')
# Count inbox items
INBOX_COUNT=0
if [ -d "$VAULT_PATH/${INBOX_DIR:-Inbox}" ]; then
INBOX_COUNT=$(find "$VAULT_PATH/${INBOX_DIR:-Inbox}" -name "*.md" -type f 2>/dev/null | wc -l | tr -d ' ')
fi
# Add notes tagged with #inbox (if grep available)
if command -v grep &> /dev/null; then
TAGGED_INBOX=$(grep -rl "#inbox" "$VAULT_PATH" --include="*.md" 2>/dev/null | wc -l | tr -d ' ')
INBOX_COUNT=$((INBOX_COUNT + TAGGED_INBOX))
fi
# Count uncommitted changes (if in git repo)
UNCOMMITTED="N/A"
if [ -d "$VAULT_PATH/.git" ]; then
cd "$VAULT_PATH" || exit 1
UNCOMMITTED=$(git status --porcelain 2>/dev/null | wc -l | tr -d ' ')
fi
# Check if today's note exists
TODAY=$(date +%Y-%m-%d)
if [ -f "$VAULT_PATH/${DAILY_NOTES_DIR:-Daily Notes}/$TODAY.md" ]; then
TODAY_STATUS="Yes"
else
TODAY_STATUS="No"
fi
# Output status line (simple format)
echo "Notes: $TOTAL_NOTES | Inbox: $INBOX_COUNT | Uncommitted: $UNCOMMITTED | Today: $TODAY_STATUS"