agentleFS
syntaxfmsyntaxfm/website/CLAUDE.md

website

CLAUDE.md1.2k starsChanged 10 days agoMITView on GitHub

SvelteKit 3 treats any server directory as server-only, so code that client components import (e.g. src/utilities/transcripts.ts) must live outside src/server/. Paths use package.json subpath imports (SvelteKit's config.alias is deprecated): #lib/, #server/, #state/, #utilities/, #actions/, #assets/, #styles/*, plus #const and #hooks.server. Every variable must be declared in src/env.ts with defineEnvVars. Undeclared variables aren't available. Import them from $app/env/private (server) or $app/env/public (PUBLIC_ vars). Mark build-time values with static: true; runtime ones use a schema. The application manages podcast content with these…

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

20 rules. About 0 are common, 7 are distinctive, and 13 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈7

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 13

    Very specific

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

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

    Every variable must be declared in src/env.ts with defineEnvVars.

    line 69
  2. Very specific:

    Use $state for reactive state declarations

    line 100
  3. Very specific:

    Use $derived for computed values

    line 101
  4. Very specific:

    Use $effect for side effects and lifecycle

    line 102
  5. Very specific:

    Use $props for component props with destructuring

    line 103
  6. Very specific:

    Use $bindable for two-way bindable props

    line 104
  7. Distinctive:

    Use classes for complex state management (state machines)

    line 105
  8. Very specific:

    Use bg and fg convention for background/foreground colors

    line 110
  9. Distinctive:

    Routes: Use SvelteKit's file-based routing with layout groups

    line 120
  10. Very specific:

    Server: All server-side logic in /src/server/

    line 122
  11. Very specific:

    Create components in /src/lib/ for reusable UI

    line 155
  12. Very specific:

    Add routes in /src/routes/ following the layout structure

    line 156
  13. Very specific:

    Use Prisma for database operations via /src/server/prisma-client.ts

    line 157
  14. Distinctive:

    Add proper TypeScript types and error handling

    line 159
  15. Very specific:

    Run pnpm i-changed-the-schema to apply changes

    line 164
  16. Very specific:

    Update seed data if needed in /prisma/seed.ts

    line 165
  17. Distinctive:

    Use Playwright for integration tests

    line 169
  18. Distinctive:

    Use Vitest for unit tests

    line 170
  19. Distinctive:

    Run linting before commits

    line 171
  20. Distinctive:

    Test across different screen sizes and devices

    line 172

≈ “Common” is an estimate: at least 1 in 5 of the 25,680 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

CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

Development Commands

Core Commands

  • pnpm dev - Start development server with preheat script
  • pnpm build - Build production application (vite build)
  • pnpm check - Run TypeScript type checking
  • pnpm lint - Run prettier + eslint + stylelint
  • pnpm test - Run Playwright tests
  • pnpm test:unit - Run Vitest unit tests

Database Commands

  • pnpm db:studio - Open Prisma Studio GUI
  • pnpm db:generate - Generate Prisma client
  • pnpm db:push - Push schema changes to database
  • pnpm db:seed - Seed database with test data
  • pnpm i-changed-the-schema - Shortcut for push + generate after schema changes

Testing Commands

  • pnpm test:ui - Run Playwright tests with UI
  • pnpm check:watch - Run TypeScript check in watch mode

Project Architecture

Technology Stack

  • Frontend: SvelteKit 3 with Svelte 5, TypeScript 6, Vite 8
  • Backend: Node.js (22.17+) with SvelteKit server-side rendering
  • Database: MySQL with Prisma ORM (PlanetScale)
  • Caching: Redis (Upstash)
  • Deployment: Vercel with Node.js 22.x runtime
  • Monitoring: Sentry for error tracking

Key Directory Structure

src/
├── routes/
│   ├── (site)/        # Main website layout
│   ├── (blank)/       # Clean layout for embeds
│   └── api/           # API endpoints
├── lib/               # Reusable components
├── server/            # Server-side logic and utilities (server-only)
├── state/             # Svelte stores for client state
├── styles/            # CSS architecture with themes
├── actions/           # Svelte actions
├── utilities/         # Shared utilities (safe on client and server)
├── env.ts             # Declares every environment variable the app reads
└── params.ts          # Route param matchers

SvelteKit 3 treats any server directory as server-only, so code that client components import (e.g. src/utilities/transcripts.ts) must live outside src/server/.

Imports

Paths use package.json subpath imports (SvelteKit's config.alias is deprecated): #lib/*, #server/*, #state/*, #utilities/*, #actions/*, #assets/*, #styles/*, plus #const and #hooks.server.

  • Subpath imports map literally, so include the file extension. Use .js for .ts files: import { prisma_client } from '#server/prisma-client.js', import Icon from '#lib/Icon.svelte'.
  • # means a fragment in CSS, so CSS url()s use relative paths: url('../assets/Grit Mask@2x.png').

Environment Variables

Every variable must be declared in src/env.ts with defineEnvVars. Undeclared variables aren't available. Import them from $app/env/private (server) or $app/env/public (PUBLIC_ vars). Mark build-time values with static: true; runtime ones use a schema.

Database Schema

The application manages podcast content with these key models:

  • Show: Episodes with metadata, transcripts, AI-generated content
  • User: GitHub OAuth authentication with role-based access
  • Guest: Guest profiles with social links and appearances
  • Transcript: Full transcription with utterances and speaker identification
  • Video: YouTube integration with playlists
  • UserSubmission: User-generated content submissions

Content Management

  • Show notes are stored as markdown files in the /shows/ directory
  • AI-generated content (summaries, tweets, show notes) using Claude Sonnet 5.5 through OpenRouter in src/server/ai/notes.ts
  • Automated transcription via Deepgram
  • Multi-layer caching with Redis for performance

Code Style and Conventions

Naming Conventions

  • Components: PascalCase for .svelte files (e.g., ShowCard.svelte)
  • Variables/Functions: snake_case for variables, functions, and props
  • Constants: UPPER_CASE for true constants only
  • Types: PascalCase for TypeScript interfaces

Svelte 5 Patterns

  • Use $state for reactive state declarations
  • Use $derived for computed values
  • Use $effect for side effects and lifecycle
  • Use $props for component props with destructuring
  • Use $bindable for two-way bindable props
  • Use classes for complex state management (state machines)

CSS Architecture

  • CSS variables defined in src/styles/variables.css
  • Use bg and fg convention for background/foreground colors
  • Custom media queries for responsive design:
    @custom-media --below-med (width < 700px);
    @custom-media --above-med (width > 700px);

File Organization

  • Components: Group related components in /src/lib/
  • Routes: Use SvelteKit's file-based routing with layout groups
  • State: Svelte stores in /src/state/ for global state
  • Server: All server-side logic in /src/server/

Key Features

Audio Player

  • Audio player built on media-chrome, which also controls the YouTube player for episodes with video
  • Media Session API integration
  • Position saving and resume functionality
  • Offline episodes saved with the Cache API, player state in IndexedDB

Search System

  • Client-side search using FlexSearch, in a web worker so it doesn't block the page
  • Prefix search over episode titles and show notes (/content.json)

Admin Dashboard

  • Role-based access control
  • Content management for shows and guests
  • AI content generation tools
  • Transcript management

Performance Optimization

  • Redis caching for database queries
  • IndexedDB for offline data storage
  • CDN caching via cache-control headers on show pages and APIs

Development Workflow

Adding New Features

  1. Create components in /src/lib/ for reusable UI
  2. Add routes in /src/routes/ following the layout structure
  3. Use Prisma for database operations via /src/server/prisma-client.ts
  4. Implement caching for database queries using the cache utilities
  5. Add proper TypeScript types and error handling

Database Changes

  1. Modify /prisma/schema.prisma
  2. Run pnpm i-changed-the-schema to apply changes
  3. Update seed data if needed in /prisma/seed.ts

Testing

  • Use Playwright for integration tests
  • Use Vitest for unit tests
  • Run linting before commits
  • Test across different screen sizes and devices

Deployment

  • Application deploys to Vercel automatically
  • Environment variables managed through Vercel dashboard
  • Database hosted on PlanetScale
  • Redis cache on Upstash

Common Patterns

State Management

Existing global state (player, youtube_player, etc.) uses Svelte stores in src/state/*.ts. For new complex state, use a class in a .svelte.ts file:

// src/state/counter.svelte.ts
class Counter {
	count = $state(0);

	increment() {
		this.count += 1;
	}
}

export const counter = new Counter();

Database Queries

import { prisma_client } from '#server/prisma-client.js';
import { super_cache_mang } from '#server/cache/cache_mang.js';

// Wrap queries in super_cache_mang to cache them in Redis
const shows = await super_cache_mang('tasty_shows', () =>
	prisma_client.show.findMany({
		where: { show_type: 'TASTY' },
		orderBy: { number: 'desc' }
	})
);

Component Structure

<script lang="ts">
	import type { Show } from '@prisma/client';
	import { player } from '#state/player.js';

	let { show }: { show: Show } = $props();
	let is_current = $derived($player.current_show?.number === show.number);
</script>

<div class="show-card">
	<h3>{show.title}</h3>
	<button onclick={() => player.start_show(show)}>
		{is_current ? 'Playing' : 'Play'}
	</button>
</div>

Remember to follow the existing code conventions and patterns when adding new features or modifying existing code.

Download now (ZIP)

Trending

Quiet since January.thin dataabout the whole repository

Dec 2025: 0 mentionsJan 2026: 2 mentionsFeb 2026: 0 mentionsMar 2026: 0 mentionsApr 2026: 0 mentionsMay 2026: 0 mentionsJun 2026: 0 mentionsJul 2026: 0 mentionsAug 2026: 0 mentionsSep 2026: 0 mentionsOct 2026: 0 mentionsNov 2026: 0 mentions
Dec 2025Jun 2026Nov 2026
Mentions a month of the syntaxfm/website repository that our weekly crawl found: only 8 in all, so this is a hint, not a trend. There is no adoption data for this file yet.

Who's talking about syntaxfm/website

The biggest 5 of 8 mentions linking to the repository that our crawl found. Each line is their own headline.

See all 8

Talked about on GitHub and Bluesky (8 times).

On GitHub · 7

2 more on GitHub

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.