agentleFS
adriaalcalaadriaalcala/claude-code-setup/skills/context-curator-admin/SKILL.md

Context Curator Administration

Skill0 starsChanged 49 days agoMITView on GitHub

Admin operations for Context Curator: indexing, monitoring, CLAUDE.md generation

  • Deletes or force-pushes
  • Sends data out

The file

Files
SKILL.md

Context Curator Administration

Server administration for Context Curator - the intelligent code indexing and context enrichment system.

Quick Status Check

Check all services:

curator-admin status

Expected output:

{
  "curator_api": "healthy",
  "chromadb": "connected",
  "ollama": "ready",
  "sync_agents": 0,
  "last_indexing": "2026-03-08T14:32:15Z",
  "indexed_projects": 3,
  "total_chunks": 1247
}

Administration Commands

1. Check System Status

Full system health check:

#!/bin/bash

echo "=== Context Curator System Status ==="
echo ""

# Check Curator API
echo "1. Curator API Health:"
if curl -s http://127.0.0.1:5555/health > /dev/null 2>&1; then
  echo "   Status: OK"
else
  echo "   Status: FAILED - API not responding"
fi

# Check ChromaDB
echo ""
echo "2. ChromaDB Status:"
if curl -s http://127.0.0.1:8000/api/v1/heartbeat > /dev/null 2>&1; then
  echo "   Status: OK"

  # Get collection stats
  STATS=$(curl -s http://127.0.0.1:8000/api/v1/collections)
  echo "   Collections: $(echo $STATS | jq 'length')"
else
  echo "   Status: FAILED - ChromaDB not responding"
fi

# Check Ollama
echo ""
echo "3. Ollama Models:"
MODELS=$(curl -s http://127.0.0.1:11434/api/tags | jq -r '.models[].name')
if [ -n "$MODELS" ]; then
  echo "   Models loaded:"
  echo "$MODELS" | sed 's/^/     - /'
else
  echo "   Status: FAILED - No models loaded"
fi

# List indexed projects
echo ""
echo "4. Indexed Projects:"
curl -s http://127.0.0.1:5555/projects | jq '.projects[]' 2>/dev/null || echo "   (Unable to fetch)"

# Check sync agents
echo ""
echo "5. Sync Agents:"
AGENTS=$(curl -s http://127.0.0.1:5555/agents 2>/dev/null | jq '.agents | length')
echo "   Connected: $AGENTS"

2. Indexing and Re-indexing

Check current indexing state:

curl -s http://127.0.0.1:5555/projects | jq '.projects[] | {name, status, last_indexed, chunk_count}'

Reindex specific project:

#!/bin/bash

PROJECT="${1:-}"

if [ -z "$PROJECT" ]; then
  echo "Usage: curator reindex <project-path>"
  exit 1
fi

echo "Reindexing: $PROJECT"

# Start reindexing
curl -X POST http://127.0.0.1:5555/projects/reindex \
  -H "Content-Type: application/json" \
  -d "{\"path\": \"$PROJECT\"}" \
  | jq .

# Monitor progress
while true; do
  STATUS=$(curl -s http://127.0.0.1:5555/projects \
    | jq ".projects[] | select(.name == \"$(basename $PROJECT)\") | .status")

  if [[ "$STATUS" == *"completed"* ]]; then
    echo "Reindexing complete!"
    break
  fi

  echo "Status: $STATUS"
  sleep 2
done

Full system reindex:

#!/bin/bash

echo "Starting full system reindex..."

# Reindex all projects
PROJECTS=$(curl -s http://127.0.0.1:5555/projects | jq -r '.projects[].name')

for PROJECT in $PROJECTS; do
  echo "Reindexing: $PROJECT"

  curl -X POST http://127.0.0.1:5555/projects/reindex \
    -H "Content-Type: application/json" \
    -d "{\"name\": \"$PROJECT\"}" > /dev/null

  # Wait for completion
  while [ "$(curl -s http://127.0.0.1:5555/projects | jq ".projects[] | select(.name == \"$PROJECT\") | .status" | grep -c "completed")" -eq 0 ]; do
    sleep 2
  done

  echo "  ✓ Complete"
done

echo "All projects reindexed!"

3. CLAUDE.local.md Generation

Generate CLAUDE.local.md for current project:

#!/bin/bash

PROJECT_PATH="${1:-.}"
OUTPUT="${PROJECT_PATH}/.claude/CLAUDE.local.md"

echo "Generating CLAUDE.local.md..."

mkdir -p "$(dirname "$OUTPUT")"

# Get project metadata from Curator
METADATA=$(curl -s http://127.0.0.1:5555/projects \
  | jq ".projects[] | select(.path == \"$PROJECT_PATH\")")

# Generate header
cat > "$OUTPUT" << 'EOF'
# CLAUDE.local.md

## Project Context

This file is auto-generated by Context Curator.
Last updated: $(date -u +%Y-%m-%dT%H:%M:%SZ)

EOF

# Add metadata
echo "$METADATA" | jq -r '.description' >> "$OUTPUT"

# Add key files
echo "" >> "$OUTPUT"
echo "## Key Files" >> "$OUTPUT"

curl -s "http://127.0.0.1:5555/projects/files" \
  -d "{\"path\": \"$PROJECT_PATH\"}" \
  | jq -r '.files[] | "- \(.path): \(.description)"' >> "$OUTPUT" 2>/dev/null

# Add code patterns
echo "" >> "$OUTPUT"
echo "## Code Patterns" >> "$OUTPUT"

curl -s "http://127.0.0.1:5555/projects/patterns" \
  -d "{\"path\": \"$PROJECT_PATH\"}" \
  | jq -r '.patterns[] | "- \(.name): \(.description)"' >> "$OUTPUT" 2>/dev/null

echo "Generated: $OUTPUT"

Generate full .claude/ OS:

#!/bin/bash

PROJECT_PATH="${1:-.}"
CLAUDE_DIR="${PROJECT_PATH}/.claude"

echo "Regenerating full .claude/ configuration..."

mkdir -p "$CLAUDE_DIR"

# 1. Generate CLAUDE.local.md
echo "1. Generating CLAUDE.local.md..."
curator generate "$PROJECT_PATH" > "$CLAUDE_DIR/CLAUDE.local.md"

# 2. Generate settings.json with context enrichment
echo "2. Generating settings.json..."
cat > "$CLAUDE_DIR/settings.json" << 'EOF'
{
  "version": "1.0.0",
  "context": {
    "maxTokens": 100000,
    "enrichmentLevels": ["local", "project", "semantic"],
    "curator": {
      "enabled": true,
      "apiUrl": "http://127.0.0.1:5555"
    }
  },
  "tools": {
    "allowed": ["Bash", "Read", "Grep", "Glob", "WebSearch"],
    "guards": {
      "bash": "hooks/scripts/bash-guard.sh",
      "write": "hooks/scripts/write-guard.sh"
    }
  }
}
EOF

# 3. Generate memory section
echo "3. Generating memory structure..."
mkdir -p "$CLAUDE_DIR/memory"

cat > "$CLAUDE_DIR/memory/project.md" << 'EOF'
# Project Memory

## Architecture
[Generated from code analysis]

## Key Decisions
[Generated from commit history]

## Performance Baselines
[Generated from profiling data]

## Known Issues
[Generated from issue tracker]
EOF

# 4. Generate agents configuration
echo "4. Generating agents configuration..."
mkdir -p "$CLAUDE_DIR/agents"

cat > "$CLAUDE_DIR/agents/curator.yaml" << 'EOF'
name: "Code Context Agent"
role: "Provide enriched code context"
tools:
  - Read
  - Grep
  - Glob
integrations:
  - curator
  - ollama
EOF

echo "Full .claude/ OS regenerated at: $CLAUDE_DIR"

4. ChromaDB Monitoring

Check ChromaDB health and collections:

#!/bin/bash

echo "=== ChromaDB Monitoring ==="
echo ""

# Heartbeat
echo "1. Heartbeat:"
curl -s http://127.0.0.1:8000/api/v1/heartbeat | jq .

# List collections
echo ""
echo "2. Collections:"
COLLECTIONS=$(curl -s http://127.0.0.1:8000/api/v1/collections)
echo "$COLLECTIONS" | jq '.[] | {name, metadata, count}'

# Collection details
echo ""
echo "3. Collection Stats:"
for COLLECTION in $(echo "$COLLECTIONS" | jq -r '.[].name'); do
  COUNT=$(curl -s "http://127.0.0.1:8000/api/v1/collections/$COLLECTION/count")
  echo "  $COLLECTION: $COUNT documents"
done

# Embedding stats
echo ""
echo "4. Embedding Model:"
EMBEDDING=$(curl -s http://127.0.0.1:8000/api/v1/embedding)
echo "$EMBEDDING" | jq '{model, dimension}'

Optimize ChromaDB:

#!/bin/bash

echo "Optimizing ChromaDB..."

# Compact collections (removes tombstones)
COLLECTIONS=$(curl -s http://127.0.0.1:8000/api/v1/collections | jq -r '.[].name')

for COLLECTION in $COLLECTIONS; do
  echo "Compacting: $COLLECTION"
  curl -X POST "http://127.0.0.1:8000/api/v1/collections/$COLLECTION/compact" \
    -H "Content-Type: application/json"
done

echo "Optimization complete"

Reset ChromaDB (careful!):

#!/bin/bash

echo "WARNING: This will clear all indexed data!"
read -p "Continue? (yes/no) " -n 3 -r
echo
if [[ $REPLY =~ ^[Yy][Ee][Ss]$ ]]; then
  curl -X POST http://127.0.0.1:8000/api/v1/reset \
    -H "Content-Type: application/json"
  echo "ChromaDB reset complete"
else
  echo "Cancelled"
fi

5. Ollama Model Management

List available models:

curl -s http://127.0.0.1:11434/api/tags | jq '.models[] | {name, size}'

Pull model:

ollama pull qwen3-coder
ollama pull nomic-embed-text

Check model status:

ollama list

Sync Agent Management

Check connected sync agents:

curl -s http://127.0.0.1:5555/agents | jq '.agents[] | {id, name, status, last_sync}'

Register new sync agent:

curl -X POST http://127.0.0.1:5555/agents/register \
  -H "Content-Type: application/json" \
  -d '{
    "name": "m3-pro-agent",
    "api_key": "key-here",
    "url": "http://REMOTE_HOST:5556"
  }' | jq .

Monitor sync agent:

#!/bin/bash

AGENT_ID="${1:-}"

if [ -z "$AGENT_ID" ]; then
  echo "Usage: curator monitor-agent <agent-id>"
  exit 1
fi

echo "Monitoring agent: $AGENT_ID"

while true; do
  STATUS=$(curl -s http://127.0.0.1:5555/agents/$AGENT_ID)

  echo "$(date): $(echo $STATUS | jq -r '.status')"

  sleep 5
done

Backup and Recovery

Backup ChromaDB:

#!/bin/bash

BACKUP_DIR="/backups/chromadb-$(date +%Y%m%d-%H%M%S)"
mkdir -p "$BACKUP_DIR"

# Stop Curator API to ensure consistency
systemctl stop curator-api

# Copy ChromaDB data
cp -r /var/lib/chromadb/data "$BACKUP_DIR/"

# Restart
systemctl start curator-api

echo "Backup complete: $BACKUP_DIR"

Restore from backup:

#!/bin/bash

BACKUP_DIR="${1:-}"

if [ -z "$BACKUP_DIR" ]; then
  echo "Usage: curator restore <backup-dir>"
  exit 1
fi

echo "Restoring from: $BACKUP_DIR"

# Stop services
systemctl stop curator-api

# Restore data
rm -rf /var/lib/chromadb/data
cp -r "$BACKUP_DIR/data" /var/lib/chromadb/

# Restart
systemctl start curator-api

echo "Restore complete"

Troubleshooting

Curator API not responding:

# Check service status
systemctl status curator-api

# Restart service
systemctl restart curator-api

# Check logs
journalctl -u curator-api -n 50 -f

ChromaDB connection failed:

# Check if ChromaDB is running
ps aux | grep chromadb

# Restart ChromaDB
docker restart chromadb

# Verify connection
curl http://127.0.0.1:8000/api/v1/heartbeat

Ollama models not loading:

# Check Ollama status
curl -s http://127.0.0.1:11434/api/tags

# Restart Ollama
pkill ollama
ollama serve

# Pull required models
ollama pull qwen3-coder
ollama pull nomic-embed-text

Automation Scripts

Daily system check:

#!/bin/bash
# curator-daily-check.sh

TIMESTAMP=$(date -u +%Y-%m-%dT%H:%M:%SZ)

echo "=== Daily Curator Check: $TIMESTAMP ===" >> curator-daily.log

# Health check
curator status >> curator-daily.log

# Reindex if needed
if [ $(date +%H) -eq 2 ]; then
  echo "Running nightly reindex..." >> curator-daily.log
  curator reindex-all >> curator-daily.log
fi

# Optimize
curator optimize >> curator-daily.log

echo "Check complete" >> curator-daily.log

Schedule with cron:

# Run daily at 2 AM
0 2 * * * /usr/local/bin/curator-daily-check.sh

Summary

Context Curator administration includes:

  • Status monitoring and health checks
  • Project indexing and reindexing
  • CLAUDE.md file generation
  • ChromaDB management and optimization
  • Ollama model management
  • Sync agent registration and monitoring
  • Backup and recovery procedures
  • Automated maintenance tasks

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

Reviews can't be read right now.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.