home / skills / yousufjoyian / claude-skills / tesseract

tesseract skill

/tesseract

This skill pulls the latest Tesseract code, ensures the dev server runs, and provides localhost and Tailscale access URLs.

npx playbooks add skill yousufjoyian/claude-skills --skill tesseract

Review the files below or copy the command above to add this skill to your agents.

Files (1)
SKILL.md
4.0 KB
---
name: tesseract
description: Pull and start Tesseract - the Information Mapping Knowledge Engine with Firebase backend. Provides localhost and Tailscale URLs.
---

# Tesseract Manager

This skill manages the Tesseract application - pulling latest code, starting the dev server, and providing access URLs.

## Quick Reference

| Component | Location |
|-----------|----------|
| Git Repo | `/home/yousuf/local_workspaces/tesseract` |
| GitHub | `yousufjoyian/tesseract` |
| Firebase Project | `tesseract-kb-app` |

## Ports

| Service | Port |
|---------|------|
| Web UI (Vite) | 3000 |

## When to Use This Skill

Trigger phrases:
- "pull tesseract"
- "start tesseract"
- "tesseract status"
- "launch tesseract"

## What This Skill Does

1. **Pull latest** from GitHub to `/home/yousuf/local_workspaces/tesseract`
2. **Check if Vite running** on port 3000
3. **Start Vite** if not running
4. **Provide URLs** for localhost and Tailscale access

## Execution Steps

### Step 1: Pull Latest from GitHub

```bash
cd /home/yousuf/local_workspaces/tesseract && git pull
```

### Step 2: Check if Vite is Running

```bash
curl -s http://localhost:3000 > /dev/null && echo "Vite: UP" || echo "Vite: DOWN"
```

### Step 3: Start Vite if Not Running

```bash
cd /home/yousuf/local_workspaces/tesseract && npm run dev &
```

### Step 4: Get Tailscale IP

```bash
ip -4 addr show tailscale0 2>/dev/null | grep -oP '(?<=inet\s)\d+(\.\d+){3}'
```

### Step 5: Provide Access URLs

After all steps, output:

```
Tesseract Ready

Localhost:
  http://localhost:3000

Android (Tailscale):
  http://<TAILSCALE_IP>:3000

Services:
  Web UI:   http://localhost:3000  [UP/DOWN]
  Firebase: tesseract-kb-app
```

## Full Automated Script

Run all steps in sequence:

```bash
#!/bin/bash
echo "=== Tesseract Pull & Start ==="

# 1. Pull latest
echo "[1/4] Pulling latest from GitHub..."
cd /home/yousuf/local_workspaces/tesseract && git pull

# 2. Check if Vite is running
echo "[2/4] Checking Vite status..."
VITE_UP=$(curl -s http://localhost:3000 > /dev/null 2>&1 && echo "UP" || echo "DOWN")

# 3. Start Vite if not running
if [ "$VITE_UP" = "DOWN" ]; then
  echo "[3/4] Starting Vite dev server..."
  cd /home/yousuf/local_workspaces/tesseract && npm run dev &
  sleep 3
  VITE_UP=$(curl -s http://localhost:3000 > /dev/null 2>&1 && echo "UP" || echo "DOWN")
else
  echo "[3/4] Vite already running"
fi

# 4. Get Tailscale IP
TAILSCALE_IP=$(ip -4 addr show tailscale0 2>/dev/null | grep -oP '(?<=inet\s)\d+(\.\d+){3}' || echo "not connected")

# Output
echo ""
echo "[4/4] Status Report"
echo "========================================"
echo "  Tesseract"
echo "========================================"
echo ""
echo "Access URLs:"
echo "  Localhost:  http://localhost:3000"
echo "  Android:    http://$TAILSCALE_IP:3000"
echo ""
echo "Services:"
echo "  Web UI:     $VITE_UP"
echo "  Firebase:   tesseract-kb-app"
echo ""

if [ "$VITE_UP" = "DOWN" ]; then
  echo "WARNING: Vite failed to start. Check logs."
fi
```

## Features

Tesseract provides:
- **Thoughts** - AI-powered note taking and organization
- **Map** - Neural visualization of knowledge connections
- **Export** - Information Mapping document generation from raw text/DOCX

## Firebase Backend

| Service | Details |
|---------|---------|
| Auth | Google Sign-In |
| Firestore | Thoughts collection |
| Functions | `geminiProxy` for AI calls |

## Troubleshooting

| Issue | Solution |
|-------|----------|
| Vite not starting | Check node_modules exist, run `npm install` |
| Firebase errors | Check user is signed in |
| AI not responding | Check Firebase functions deployed |
| Tailscale not connected | Run `sudo tailscale up` |

## Architecture

```
GitHub (yousufjoyian/tesseract)
    ↓ git pull
local_workspaces/tesseract
    ↓ npm run dev
Browser → localhost:3000 or Tailscale:3000
    ↓
Firebase (auth, firestore, functions)
    ↓
Gemini API (via geminiProxy function)
```

## A2UI Embedding

For embedding Tesseract in the A2UI panel, use the generic `a2ui-embed` skill.
See: `~/local_workspaces/skills/a2ui-embed/SKILL.md`

Overview

This skill manages the Tesseract information-mapping app: it pulls the latest code, ensures the Vite dev server is running, and returns local and Tailscale access URLs. It targets a local workspace with a Firebase backend and reports service status and Firebase project details. Use it to quickly deploy and verify the development instance on your machine or a Tailscale-connected device.

How this skill works

The skill runs a git pull in the Tesseract workspace, checks port 3000 to determine if Vite is up, and starts npm run dev when needed. It then queries the system for a Tailscale IP and assembles a short status report with localhost and Tailscale URLs plus Firebase project info. If Vite fails to start it warns and suggests checking logs and node_modules.

When to use it

  • After pulling upstream changes to test the latest UI/feature work
  • When you need a quick local or remote (Tailscale) access link to the dev UI
  • To verify the Vite dev server and Firebase connectivity before demos
  • When troubleshooting why the web UI or AI proxy is not responding
  • Before embedding the app into a development panel or UI container

Best practices

  • Run npm install in the workspace if Vite fails to start to ensure node_modules exist
  • Confirm Tailscale is connected (sudo tailscale up) on the host for remote access
  • Keep Firebase functions deployed (geminiProxy) when testing AI features
  • Run the script from the user account that owns the workspace to avoid permission issues
  • Check Vite logs if status remains DOWN after starting the dev server

Example use cases

  • Developer pulls latest changes, starts the app, and shares a Tailscale URL with a tester on Android
  • CI or automation triggers a status check to ensure the local dev server is running before integration tests
  • Quick local demo: start the Vite server and verify the Thoughts/Map export features are accessible
  • Troubleshooting: confirm Firebase project tesseract-kb-app is reachable and functions are deployed

FAQ

What if Vite does not start after running the script?

Check that node_modules are installed (run npm install), inspect terminal logs for errors, and ensure no other process is occupying port 3000.

How do I get the Tailscale URL?

The skill reads the tailscale0 interface for an IPv4 address and returns http://<TAILSCALE_IP>:3000; ensure Tailscale is active on the host.