Guidelines for Claude Code #
This document contains guidelines for Claude Code (or other AI assistants) when working on this project.
Documentation Style #
What to AVOID in Documentation Files #
❌ ASCII Art / Directory Tree Diagrams
Do NOT create directory tree structures like this:
client/
├── src/
│ ├── main.ts
│ └── components/
│ └── video-player.ts
✅ Use Bullet Points Instead
Instead, use simple bullet point lists with file paths:
client/src/main.ts- Description of what this file doesclient/src/components/video-player.ts- Description of component
What to INCLUDE in Documentation #
✅ Inline Code Examples
- Code snippets showing implementation patterns are good
- Keep them focused and relevant
✅ Clear Explanations
- Explain the "why" behind decisions
- Provide context and rationale
✅ Simple Lists
- Bullet points for enumerating items
- Numbered lists for sequential steps
Architecture Decision Process #
When making architectural decisions:
-
Document in DECISION_LOG.md - Use the established format:
- Date
- Decision
- Context
- Options Considered
- Rationale
- Consequences
- Status
-
Update ARCHITECTURE.md - Keep the main architecture doc in sync with decisions
-
Prefer Simplicity - This project values:
- Type safety (Rust, TypeScript)
- Simple deployment (single binary, minimal dependencies)
- Modern standards over frameworks
- Self-contained solutions over external services
Code Style Preferences #
Backend (Rust) #
- Use
sqlxfor explicit SQL with compile-time checking - Prefer newtype pattern for critical domain types
- Use
#[instrument]for tracing - Leverage Rust's type system to prevent invalid states
Frontend (TypeScript) #
- Use Web Components for component abstraction
- Modern browser APIs over libraries when possible
- Keep bundle size small
- TypeScript types should mirror Rust backend types
General #
- Explicit over implicit
- Simple over clever
- Type-safe over runtime validation where possible
- Document decisions, not just implementation
Version Control with Jujutsu (jj) #
This project uses Jujutsu (jj) for version control, which is Git-compatible but has a different workflow.
Key Concepts:
- Working copy is a real commit (not a staging area)
- All changes are automatically tracked when you edit files
- Use
jj newto create a new working commit on top of the current one - Use
jj describeto set/edit the commit message - Use
jj file untrack $FILEto untrack files (e.g., when adding to .gitignore)
Common Commands:
jj statusorjj st- Show working copy changesjj log- Show commit historyjj describe- Set commit message for current changejj new- Create new working commit (finalizes current commit)jj file untrack $FILE- Remove file from tracking
Claude's Workflow:
- After completing each task, remind user to commit
- Suggest conventional commit messages for
jj describe - User runs
jj describe -m "message"to set the commit message - User runs
jj newto finalize and create new working commit - Claude waits for confirmation before starting next task
Commit Messages #
This project uses Conventional Commits validated by convco.
Format:
<type>(<scope>): <subject>
[optional body]
[optional footer]
Types: feat, fix, docs, style, refactor, perf, test, chore, ci
Common Scopes: auth, video, api, db, frontend, backend, config, storage, upload, stream
Examples:
feat(auth): add JWT token generation
fix(upload): handle large file validation
docs: update implementation plan
chore: initialize Rust backend
Tools:
.gitmessage- Commit template (for reference).convco- convco configuration- Run
convco checkto validate commit messages - Run
convco changelogto generate CHANGELOG.md
When Working on This Project #
- Check existing decisions in
docs/DECISION_LOG.mdbefore suggesting alternatives - Keep scope focused - This is a small-scale self-hosted app, not enterprise software
- Prefer pragmatic solutions - Balance type safety with development speed
- Document trade-offs - Explain why simpler solutions were chosen over complex ones
- Suggest conventional commit messages after each task completion
Specific to This Project #
Target Audience: Small groups (5-20 friends) self-hosting a video sharing app
Not Our Target:
- Enterprise scale
- Complex distributed systems
- Framework-heavy solutions
- Services requiring extensive configuration
Our Values:
- Works out-of-box with good defaults
- Single binary deployment
- Type safety catches bugs at compile time
- Minimal external dependencies
- Self-contained (no cloud services required)