agentleFS
trentfergusontrentferguson/homescreen-hero/.claude/CLAUDE.md

homescreen-hero

CLAUDE.md198 starsChanged 10 months agoMITView on GitHub

A self-hosted Plex companion app that automatically rotates collections on the homescreen via a FastAPI + React dashboard. Backend: Python 3.9+, FastAPI, SQLite, Pydantic Frontend: React 19, TypeScript, Vite, Tailwind CSS, Recharts Testing: pytest (backend), Vitest (frontend) Deployment: Docker, Docker Compose Prefer # hash comments over docstrings. Keep code readable through good naming and inline # comments where needed. Docstrings ("""...""") are acceptable for: - Public API endpoints that external users consume - Complex utility functions that are reused across…

  • Reads credentials
  • Installs packages

The file

We split this CLAUDE.md into the rules it gives an agent

2 rules. About 0 are common, 0 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Prefer # hash comments over docstrings: Keep code readable through good naming and inline # comments where needed.

    line 113
  2. Very specific:

    When backend is running: http://localhost:8000/docs (Swagger UI)

    line 153

≈ “Common” is an estimate: at least 1 in 5 of the 29,248 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
CLAUDE.md

homescreen-hero

A self-hosted Plex companion app that automatically rotates collections on the homescreen via a FastAPI + React dashboard.

Tech Stack

Backend: Python 3.9+, FastAPI, SQLite, Pydantic Frontend: React 19, TypeScript, Vite, Tailwind CSS, Recharts Testing: pytest (backend), Vitest (frontend) Deployment: Docker, Docker Compose

Project Structure

homescreen-hero/
├── homescreen_hero/           # Python backend (FastAPI)
│   ├── core/                  # Business logic
│   │   ├── config/            # YAML config loading & schema
│   │   ├── db/                # SQLite models & database operations
│   │   ├── integrations/      # External API clients (Plex, Trakt, MDBList, Tautulli, Letterboxd)
│   │   ├── auth.py            # Authentication
│   │   ├── rotation.py        # Collection rotation logic
│   │   ├── scheduler.py       # Background task scheduling
│   │   └── service.py         # Core service orchestration
│   ├── web/                   # FastAPI web layer
│   │   ├── routers/           # API route handlers
│   │   └── app.py             # FastAPI app entry point
│   ├── requirements.txt       # Production dependencies
│   └── requirements-dev.txt   # Test dependencies
├── homescreen-hero-ui/        # React frontend
│   └── src/                   # React components, hooks, pages
├── data/                      # Runtime data (config.yaml, SQLite DB, logs)
└── docker-compose.yml

Common Commands

Backend

# Activate venv (from homescreen_hero directory)
.venv\Scripts\activate  # Windows
source .venv/bin/activate  # Linux/Mac

# Run backend dev server
uvicorn homescreen_hero.web.app:app --reload --port 8000

# Run tests
pytest

# Run tests with coverage
pytest --cov=homescreen_hero --cov-report=html

Frontend

cd homescreen-hero-ui

# Install dependencies
npm install

# Run dev server (port 5173)
npm run dev

# Run tests
npm test           # Watch mode
npm run test:run   # Single run
npm run test:ui    # With UI

# Build
npm run build

# Lint
npm run lint

Docker

# Start app
docker-compose up -d

# View logs
docker-compose logs -f

# Rebuild
docker-compose up -d --build

Git Workflow

  • Main branch: develop
  • Feature branches: feature-*
  • Bugfix branches: fix-*
  • PRs target develop
  • Releases are tagged from develop (e.g., v0.4.0)
  • Nightly Docker builds from develop

Code Style

Python

  • Type hints preferred
  • Pydantic models for request/response schemas
  • Config schema defined in homescreen_hero/core/config/schema.py
  • Logging via homescreen_hero/core/logging_config.py

TypeScript/React

  • Functional components with hooks
  • Tailwind CSS for styling
  • Headless UI for accessible components
  • Lucide React for icons

Comments

Prefer # hash comments over docstrings. Keep code readable through good naming and inline # comments where needed.

Docstrings ("""...""") are acceptable for:

  • Public API endpoints that external users consume
  • Complex utility functions that are reused across the codebase
  • Functions where IDE hover tooltips would genuinely help

Avoid:

  • Docstrings on every function just for the sake of documentation
  • Comments that describe what code does (the code should be self-explanatory)
  • Redundant comments that repeat the function/variable name

Good:

# Retry up to 3 times because Plex API occasionally drops connections
for attempt in range(3):
    ...

Bad:

def get_collections():
    """Gets the collections."""  # Redundant, adds no value
    ...

Key Integrations

IntegrationClient FilePurpose
Plexcore/integrations/plex_client.pyCore functionality - library & collection management
Traktcore/integrations/trakt_client.pyThird-party list sync
MDBListcore/integrations/mdblist_client.pyThird-party list sync
Tautullicore/integrations/tautulli_client.pyAnalytics & streaming metrics
TMDbcore/integrations/tmdb_client.pyThird-party list sync
Letterboxdcore/integrations/letterboxd_scraper.pyList scraping
AniListcore/integrations/anilist_client.pyAnime list sync

API Documentation

When backend is running: http://localhost:8000/docs (Swagger UI)

Environment Variables

Sensitive values go in .env (not committed):

  • HSH_PLEX_TOKEN - Plex auth token
  • HSH_PLEX_URL - Plex server URL
  • HSH_AUTH_PASSWORD - Admin password
  • HSH_AUTH_SECRET_KEY - JWT secret
  • HSH_TRAKT_CLIENT_ID - Trakt API client ID
  • HSH_MDBLIST_API_KEY - MDBList API key
  • HSH_TMDB_API_KEY - TMDb API key
  • HSH_TAUTULLI_API_KEY - Tautulli API key
  • HSH_TAUTULLI_BASE_URL - Tautulli server URL

Testing Notes

  • Backend tests: homescreen_hero/tests/
  • Frontend tests: homescreen-hero-ui/src/**/*.test.{ts,tsx}
  • See TESTING.md for detailed testing documentation

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.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

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.