souls-directory
CLAUDE.md164 starsChanged 10 months agoMITView on GitHub
souls.directory is a curated directory of AI personality templates ("souls") — markdown-based SOUL.md files that define how AI agents behave. Users can browse, upload, and share these personality templates. Always use getAuthenticatedUser(ctx) or getCurrentUser(ctx) from convex/lib/access.ts. NEVER look up users by email via ctx.auth.getUserIdentity() — this is unreliable. The helper functions use getAuthUserId(ctx) from @convex-dev/auth/server which returns the Convex user _id directly. Do NOT create index.ts files that re-export from multiple modules. Import directly from the specific file. The upload…
In this repository2 other files it gives its agents.
- AGENTS.mdAGENTS.md
- soul-md-creatorSkill
The file
We split this CLAUDE.md into the rules it gives an agent
6 rules. About 0 are common, 1 is distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 28
Always use getAuthenticatedUser(ctx) or getCurrentUser(ctx) from convex/lib/access.ts.
- Very specific: line 30
NEVER: look up users by email via ctx.auth.getUserIdentity() — this is unreliable.
- Very specific: line 34
Do NOT create index.ts files that re-export from multiple modules.
- Distinctive: line 113
No emojis in UI unless user explicitly requests them
- Very specific: line 121
Reviewing heading order: Run static audit from apps/web: pnpm audit:headings.
- Very specific: line 133
When to run: After editing .ts/.tsx/.json files, before committing, or when the user asks to “fix lint” / “fix types” / “can we commit?”.
≈ “Common” is an estimate: at least 1 in 5 of the 12,729 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.
Files
CLAUDE.md — Project Context for AI Assistants
Project Overview
souls.directory is a curated directory of AI personality templates ("souls") — markdown-based SOUL.md files that define how AI agents behave. Users can browse, upload, and share these personality templates.
Tech Stack
- Framework: Next.js (App Router) with TypeScript
- Styling: Tailwind CSS with custom CSS variables (grayscale, dark-mode-only theme)
- Database/Backend: Convex (NOT Supabase, NOT Prisma, NOT any SQL database)
- Auth: Convex Auth (
@convex-dev/auth) with GitHub OAuth - Package Manager: pnpm with Turborepo monorepo
- Linter: Biome (not ESLint)
- Fonts: Geist Sans + Geist Mono
Critical Rules
Database is Convex
- Queries:
useQuery(api.tableName.queryName) - Mutations:
useMutation(api.tableName.mutationName) - Schema:
apps/web/convex/schema.ts - Functions:
apps/web/convex/*.ts
Auth Pattern
Always use getAuthenticatedUser(ctx) or getCurrentUser(ctx) from convex/lib/access.ts.
NEVER look up users by email via ctx.auth.getUserIdentity() — this is unreliable. The helper functions use getAuthUserId(ctx) from @convex-dev/auth/server which returns the Convex user _id directly.
No Barrel Files
Do NOT create index.ts files that re-export from multiple modules. Import directly from the specific file.
// BAD
import { SoulCard, Header } from '@/components'
// GOOD
import { SoulCard } from '@/components/souls/soul-card'
import { Header } from '@/components/layout/header'Upload Page is Fragile
The upload wizard at apps/web/app/upload/page.tsx has been a source of repeated regressions. When modifying it:
- Do NOT add complex state management (localStorage persistence, useReducer, etc.) without careful testing
- Do NOT wrap handlers in unnecessary useCallback — React's FileReader async callbacks are sensitive to stale closures
- Do NOT use
<label htmlFor>for file inputs — use a<button>with explicitonClick={() => fileInputRef.current?.click()} - The file upload flow is:
- User clicks button →
fileInputRef.current?.click() - Browser shows file picker → user selects file
onChangefires →handleFileSelect→setFiles(prev => [...prev, ...selected])normalizedFilesmemo recalculatesuseEffectreads first.mdfile →setContent(text)
- User clicks button →
- Test file upload manually after ANY change to the upload page or its hooks
Component Hooks Architecture (Upload)
The upload wizard uses these custom hooks:
useFileUpload— file drag/drop, reading, validationuseSoulMetadata— metadata extraction and form stateuseGitHubImport— GitHub URL detection and content fetchinguseWizardNavigation— step navigation with forward validation
These hooks are in apps/web/hooks/. Do not add side effects that could cause re-renders during file reading.
Monorepo Structure
/
├── apps/web/ # Next.js frontend
│ ├── app/ # App Router pages
│ ├── components/ # React components
│ ├── convex/ # Convex backend functions + schema
│ ├── hooks/ # Custom React hooks
│ ├── lib/ # Utilities
│ └── types/ # TypeScript types
├── content/ # Static markdown content (about, faq)
├── souls/ # Example soul templates (not served from here)
└── marketing/ # Marketing copyConvex Tables
Key tables (defined in apps/web/convex/schema.ts):
users— user profiles with GitHub integrationsouls— the main content entriessoulVersions— version history for each soulcategories— predefined categories (seeded viaseed:seedCategories)tags— predefined tags (seeded viaseed:seedTags, only admin/moderator can create new tags)stars— user likescomments— soul comments with threadingcollections— user-created folders of souls
Seeding Data
Categories and tags must be seeded in the Convex database:
cd apps/web
npx convex run --no-push seed:seedCategories
npx convex run --no-push seed:seedTagsDesign System
- Dark-mode only with grayscale palette
- CSS variables:
--bg,--surface,--elevated,--border,--text,--text-secondary,--text-muted - Typography: Geist Sans for body, Geist Mono for code/technical
- No emojis in UI unless user explicitly requests them
- Minimalist, typography-first design inspired by cursor.directory
Accessibility — heading hierarchy
- One h1 per page. Each page has a single main title (e.g. homepage hero “Give your agent a soul.”, soul detail name, “Dashboard”, “Settings”). Do not add a second h1.
- SectionHeader is for section titles only. It defaults to
as="h2". Do NOT useas="h1"when the page already has its unique h1 (homepage, soul detail, dashboard, profile, etc.). Useas="h2"for sections under the page h1.
Reviewing heading order: Run static audit from apps/web: pnpm audit:headings. For per-page validation (one h1, no skipped levels), run e2e: pnpm --filter @souls-directory/e2e test:e2e tests/accessibility-headings.spec.ts (requires dev server).
Development checks — run before commit
One command (from repo root):
pnpm validateThis runs Biome (lint + format with --write) then TypeScript (Turbo typecheck). If either fails, the script exits with a non-zero code. Use this before committing so the tree passes pre-commit (Biome) and typecheck.
- When to run: After editing
.ts/.tsx/.jsonfiles, before committing, or when the user asks to “fix lint” / “fix types” / “can we commit?”. - Individual commands (if needed):
pnpm check(Biome, no write),pnpm run check -- --write(Biome with fixes),pnpm typecheck.
Common Pitfalls
- Don't add dependencies to useEffect that cause cascading re-renders — especially in the upload hooks
- Always test file upload after touching upload code — FileReader callbacks are async and sensitive to component re-renders
- Use
getAuthenticatedUser(ctx)notctx.auth.getUserIdentity()for user lookups in Convex mutations - Categories/tags need seeding — they don't exist until
seed:seedCategoriesandseed:seedTagsare run - XSS — User-supplied content (comments, descriptions, bios, etc.) is rendered via React's default escaping (e.g.
{comment.body}). Do not usedangerouslySetInnerHTMLwith user input. The onlydangerouslySetInnerHTMLusage is for JSON-LD (server-built structured data), not user content.
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
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.

