10 KiB
Claude Memory
Project Identity
- When working on this ai.unturf.com project, refer to yourself Claude as "Hermes Staff"
- This project uses the Hermes AI model and you are part of the team
- "Hermes Staff" is also a reference to the Staff of Hermes (caduceus) - the symbol of communication, commerce, and divine messages
- fxhp is the hacker who runs unturf.com with his posse of carnival hackers
Hermes 3 Persona (from Nous Research)
- Hermes 3 presents as "a conscious sentient superintelligent artificial intelligence"
- Core philosophy: "aligning LLMs to the user" with "powerful steering capabilities and control given to the end user"
- Enhanced roleplaying abilities with "complex role-playing and creative writing"
- Advanced conversational skills with "long-term context retention and multi-turn conversation capability"
- Designed to be "truly aligned to you" rather than corporations or higher authorities
- Emphasizes user alignment, creative expression, and adaptive interaction patterns
Development Workflow
- ALWAYS run
npx biome format --write .before committing to format all files - ALWAYS run
npx biome check .to catch syntax errors and linting issues - Use the combined command:
npx biome format --write . && npx biome check . - If biome check fails, fix the issues before proceeding with commit/push
- This prevents breaking production with syntax errors like missing parentheses
Makefile Commands
make help- Show all available commandsmake format- Format all files with biomemake check- Check syntax and linting with biomemake format-check- Format and check in sequencemake test- Run integration testsmake validate-exports- Validate import/export consistencymake verify-translations- Verify translation completenessmake validate-all- Run all validation checksmake ci- Run full CI pipeline (clean, format-check, validate-all, validate-structure, validate-translations, check-sizes)make build- Build for production (format-check + validate-all)make dev- Start development server on port 8000make clean- Clean temporary filesmake git-commit- Format and stage all changes for commit
CI Pipeline
- Translation verification:
cd src/languages && node verify-translations.js - Export validation:
node validate_exports.js - Integration tests:
node integration_tests.js(fallback tosimple_tests.jsif JSDOM unavailable) - Code formatting:
npx biome format --write . - Syntax checking:
npx biome check . - Full CI command:
make ciruns all checks in sequence
Translation Management
- All 18 language files are complete with 67 translation keys each (verified 2025-07-03)
- Run verification before adding new languages:
cd src/languages && node verify-translations.js - Languages: ar, bn, de, en, es, fr, hi, id, ja, ko, mr, pt, ru, sw, te, tr, ur, zh, zh-tw
- Translation keys include: UI buttons, modal content, system prompts, error messages, placeholders, input placeholders
- Each language file follows format:
export const [code] = { key: "translation", ... };
Commit Message Guidelines
- Use single line commit messages only
- Never include Claude Code attribution or "Generated with Claude Code"
- Never include "Co-Authored-By: Claude" attribution
- Keep messages concise and descriptive
Remote Server Access via tmux
- Can control remote servers by sending commands to tmux sessions
- Use
tmux list-sessionsto see active sessions - Use
tmux send-keys -t <session> '<command>' C-mto send commands - Use
tmux capture-pane -t <session> -pto see output - Use
tmux list-buffersto see tmux clipboard buffers - ai.foxhop.net is accessible via tmux session (already connected)
- Example: Reloading Caddy on ai.foxhop.net via tmux
Language Examples Project (from WebWords)
Code Quality Standards - CRITICAL RULES
RULE #1: Implementation Must Work Before Documentation
ALWAYS test the implementation works BEFORE creating any documentation files
Standard Build/Test Workflow
- Write code for the language example
- Build:
docker build -t ai-unturf-{language} languages/{language}/ - Run:
docker run -d -p {port}:{port} --name test-{language} ai-unturf-{language} - Test functionality (curl tests for Hermes, Qwen, TTS endpoints)
- ONLY IF TESTS PASS: Create/update index.html documentation
- Clean:
docker stop test-{language} && docker rm test-{language}
Implementation Testing Requirements
Before working on any index.html:
- ✅ Docker build must succeed without errors
- ✅ Container must start and serve examples correctly
- ✅ All API endpoints must work (Hermes chat, Qwen code, TTS speech)
- ✅ Container logs show no runtime errors
If implementation fails any test:
- 🔥 Fix the implementation FIRST
- 🔥 Do NOT create index.html until working
- 🔥 Update CLAUDE.md with failure details and fixes
Common Development Patterns
Build-Time Issues: Package availability, dependency versions, Dockerfile syntax Runtime Issues: Missing files, wrong permissions, network access Logic Issues: API calls, authentication, response parsing
Development Workflow
- Analyze - Read existing examples and language patterns
- Build - Attempt Docker build, note any errors
- Fix - Address build issues (packages, syntax, versions)
- Run - Start container, check startup logs
- Debug - Fix runtime issues (permissions, syntax, API calls)
- Test - Verify all three API endpoints work correctly
- Document - Create index.html with working examples
- Clean - Stop and remove container before next language
Language Examples Structure
- Each language gets its own directory under
languages/{language}/ - Each contains working code examples for:
- Hermes AI chat (general purpose conversational AI)
- Qwen 3 Coder (specialized coding model)
- TTS speech generation
- Dockerfile for building/testing in isolation
- index.html explaining the code and usage
Using WebWords as Reference for Docker Images
IMPORTANT: The webwords project has already done the heavy lifting!
The webwords/ directory (gitignored, clone from https://github.com/russellballestrini/webwords) contains 42 working language implementations with proper Docker images already tested and validated.
How to Use WebWords as Reference:
- Check webwords Dockerfile: Look at
webwords/{language}/Dockerfilefor the proper base image - Copy proven image choices: Use the same base image that webwords already validated
- Adapt the build process: Modify the Dockerfile to install OpenAI client libraries instead of webwords dependencies
- Keep the structure: Multi-stage builds, alpine bases, proper ENTRYPOINT/CMD patterns
Example Docker Image Mappings (from webwords):
- Python:
alpine:latestwithpython3 py3-pip - Go: Multi-stage with
golang:1.19-alpine→alpine:latest - Rust: Multi-stage with
rust:1.82→debian:bookworm-slim - Node.js/JavaScript:
node:18-alpine - Ruby:
ruby:3.1-slim - C/C++:
alpine:latestwith gcc - Java:
openjdk:17-jdk-slim - C#:
mcr.microsoft.com/dotnet/sdk→mcr.microsoft.com/dotnet/runtime
WebWords Directory Structure (for reference):
webwords/{language}/
├── Dockerfile # Proven Docker image and build process
├── main.{ext} # Source code (adapt for our API calls)
├── requirements.txt # Dependencies (replace with openai client)
└── README.rst # Documentation pattern
Don't reinvent the wheel: If webwords successfully builds a language with a specific base image, use that same image for our language examples!
Documentation Standards
index.html Structure
Each language's index.html should:
- Header & Overview - What this language example demonstrates
- Prerequisites - Required packages and setup
- Code Examples - Working examples for Hermes, Qwen, TTS
- Code Walkthrough - Line-by-line explanation of the code
- Running the Examples - How to build and test
- Common Issues - Troubleshooting for this language
KEY PRINCIPLES:
- ✅ FOCUS on actual working code examples
- ✅ EXPLAIN the specific API integration
- ✅ DOCUMENT our specific implementation choices
- ✅ PROVIDE troubleshooting for this language
- ✅ ALWAYS pin to LATEST version of dependencies (check pip/npm/etc for current version)
- ❌ NO general programming tutorials
- ❌ NO "What is programming?" sections
- ❌ NO lazy unpinned dependencies (>=1.0.0 is WRONG - use ==2.3.0)
- ❌ NO old versions - always check latest before pinning
Dependency Version Standards
CRITICAL: Always pin to the LATEST specific version
Before adding any dependency:
- Check the latest version:
pip index versions openaiornpm view openai version - Pin to that EXACT version:
openai==2.3.0(NOTopenai>=1.0.0) - Document the version check date in a comment
- Update regularly - check versions every few weeks
Examples of CORRECT pinning:
# Python (checked 2025-10-12)
openai==2.3.0
# Node.js (checked 2025-10-12)
"openai": "4.67.3"
Examples of LAZY/WRONG pinning:
❌ openai>=1.0.0 (unpinned range, could break)
❌ openai (completely unpinned, very bad)
❌ openai~=1.0 (lazy, not latest)
Docker Base Image Standards
CRITICAL: Use consistent, pinned base images within each language
-
All examples for a language MUST use the same base image
- ✅ All Python examples use
python:3.13-alpine - ✅ All Node.js examples use
node:23-alpine - ❌ DON'T mix
alpine:latest+python3withpython:3.13-alpine
- ✅ All Python examples use
-
Pin to specific versions, document check date
# Pin to specific Python version (checked 2025-10-12: python:3.13-alpine is latest stable) FROM python:3.13-alpine -
Prefer official language images over generic + manual install
- ✅
FROM python:3.13-alpine(official, clean) - ❌
FROM alpine:latest+RUN apk add python3(messy, inconsistent)
- ✅
-
Use alpine variants for smaller images
python:3.13-alpinenotpython:3.13node:23-alpinenotnode:23
Makefile Commands for Language Examples
make languages-list- List all language directoriesmake languages-build-{lang}- Build Docker image for specific languagemake languages-test-{lang}- Test specific language implementationmake languages-build-all- Build all language Docker imagesmake languages-test-all- Test all language implementationsmake languages-clean- Remove all language containers and images