agent/collection/update-index.sh
Snider ecefb8a952 refactor: restructure as Claude Code marketplace plugin
- Add .claude-plugin/plugin.json manifest for auto-updates
- Move claude/ contents to root level (commands/, hooks/, scripts/, skills/)
- Update hooks.json to use ${CLAUDE_PLUGIN_ROOT} for portability
- Add .gitignore for IDE files
- Update CLAUDE.md with new structure and installation instructions

Plugin can now be installed via:
  claude plugin add host-uk/core-agent

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 19:35:06 +00:00

38 lines
1.1 KiB
Bash
Executable file

#!/usr/bin/env bash
# Hook: update-index.sh
# Called after collection completes to update indexes
WHITEPAPERS_DIR="${1:-./whitepapers}"
echo "[update-index] Updating whitepaper index..."
# Count papers in each category
for category in cryptonote lethean research uncategorized; do
dir="$WHITEPAPERS_DIR/$category"
if [ -d "$dir" ]; then
count=$(find "$dir" -name "*.pdf" 2>/dev/null | wc -l | tr -d ' ')
echo " $category: $count papers"
fi
done
# Update INDEX.md with collected papers
INDEX="$WHITEPAPERS_DIR/INDEX.md"
if [ -f "$INDEX" ]; then
# Add collected papers section if not exists
if ! grep -q "## Recently Collected" "$INDEX"; then
echo "" >> "$INDEX"
echo "## Recently Collected" >> "$INDEX"
echo "" >> "$INDEX"
echo "_Last updated: $(date +%Y-%m-%d)_" >> "$INDEX"
echo "" >> "$INDEX"
fi
fi
# Process pending jobs
PENDING="$WHITEPAPERS_DIR/.pending-jobs.txt"
if [ -f "$PENDING" ]; then
count=$(wc -l < "$PENDING" | tr -d ' ')
echo "[update-index] $count papers queued for collection"
fi
echo "[update-index] Done"