agentleFS
huangchenghuangcheng/Seelie/CLAUDE.md

Seelie

CLAUDE.md4 starsChanged 8 months agoMITView on GitHub

Seelie — a native Qt6/C++ desktop pet that reacts to AI coding tool events (Claude Code, Codex, OpenCode). Lightweight, cross-platform (macOS/Windows/Linux), < 10MB RAM. Features a sprite pack engine for customizable characters. The app follows a pipeline: IPC → EventRouter → Animation/Effects/Tips → UI Gateways are pure ES modules (.mjs) with zero npm dependencies — only Node.js built-ins. Requires Node.js >= 18. Transport: UDP, newline-delimited JSON. Fire-and-forget for events (no re

The file

Files
CLAUDE.md

CLAUDE.md

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

Project

Seelie — a native Qt6/C++ desktop pet that reacts to AI coding tool events (Claude Code, Codex, OpenCode). Lightweight, cross-platform (macOS/Windows/Linux), < 10MB RAM. Features a sprite pack engine for customizable characters.

Build Commands

# macOS
mkdir -p build && cd build
cmake .. -DCMAKE_PREFIX_PATH="$(brew --prefix qt@6)"
cmake --build .

# Optional build flags:
#   -DSEELIE_TTS_ENABLED=OFF      drop the TTS AI tab + providers
#   -DSEELIE_LOTTIE_ENABLED=ON    enable Lottie character engine + Lottie packs (default OFF; effect overlay always on)
#   -DSEELIE_INCLUDE_NSFW=ON      bundle packs whose manifest tags include "nsfw"
#   -DSEELIE_INCLUDE_NSFW=ON     bundle packs whose manifest tags include "nsfw"

# Run
open build/Seelie.app             # macOS
./build/Seelie                    # Linux

# Tests (all)
cd build && ctest

# Single test
cd build && ./tests/test_ipc_animations

# Gateway CLI (uses --flag syntax, not subcommands)
seelie-gateway --source claude-code --event session.start   # send test event
seelie-gateway --ping                                        # health check

Architecture

C++ Core (src/)

The app follows a pipeline: IPC → EventRouter → Animation/Effects/Tips → UI

  • IPCServer / UDPWorker — UDP server on 127.0.0.1:52847 (runs UDPWorker on a separate QThread). Accepts newline-delimited JSON messages (event, tip, ping/pong).
  • EventRouter — Maps 17 canonical event names (e.g. session.start, tool.before, file.edited) to EventAction structs containing animation name, effect name, tip title/body. The event set is fixed — gateways normalize tool-specific events into these.
  • LottieAnimationEngine — Primary animation engine using rlottie to play Lottie JSON character animations from sprite packs.
  • SpriteAnimationEngine — Legacy fallback: plays frame-based animations from sprite sheets using definitions in animations.json.
  • Model3DEngine (src/model3d/) — Skeletal 3D glTF/GLB engine: GltfLoader (vendored cgltf) → AnimationEvaluator (CPU skinning palette) → GLSkinningRenderer (GLSL 120 vertex skinning, Qt GL wrappers only — no GLEW) → offscreen FBO like Live2D. Pack manifests use "type": "model3d" and map glTF clip names via the standard eventMap/idlePool/stateMap keys. Authoring docs: docs/model3d-packs.md; FBX conversion: scripts/fbx_to_glb.py.
  • LottieEffectOverlay — Renders visual effects (sparkles, confetti, alert-pulse, etc.) from assets/lottie/effects/ with offset positioning above the character.
  • SpritePack / SpritePackManager — Pack data structure with manifest parsing; discovers, loads, and switches between .spk sprite packs.
  • TipBubbleWidget — Win98-style speech bubble with asymmetric tail, fade animations, auto-dismiss (6s status / 12s tips).
  • TipsEngine — Pattern matcher on a 30-second event window. Detects behaviors (repeated errors, rapid edits, idle, permission denials) and suggests contextual tips. 5-minute cooldown per tip type.
  • ConfigManager — Persists to ~/.config/Seelie/config.json (window position, language, auto-start, IPC endpoint).
  • SettingsPanelWidget — UI panel for configuring settings (language, sprite pack, endpoint).
  • UpdateChecker — Checks for new releases via network.
  • MainWindow — Frameless, always-on-top, transparent 124×200 window. Owns the animation engine, effects overlay, tip bubble, settings panel, and system tray.

Node.js Gateway (gateways/)

  • seelie-gateway/ (@eastlake/seelie-gateway) — CLI tool for sending events and health checks. Contains lib/ipc.mjs for the UDP transport layer.

Gateways are pure ES modules (.mjs) with zero npm dependencies — only Node.js built-ins. Requires Node.js >= 18.

IPC Protocol

Transport: UDP, newline-delimited JSON. Fire-and-forget for events (no response expected). Messages:

{"type":"event","source":"claude-code","event":"tool.before","toolName":"Read"}
{"type":"tip","title":"Hello","body":"World","animation":"wave"}
{"type":"ping"}

17 Canonical Events

session.start, session.end, session.idle, session.error, prompt.submitted, tool.before, tool.after, tool.failed, permission.requested, permission.denied, permission.response, subagent.started, subagent.stopped, notification.sent, file.edited, file.watched, todo.updated

Key Conventions

  • C++17 with Qt6 (Core, Gui, Widgets, Network, LinguistTools, Test). Qt signals/slots throughout.
  • rlottie v0.2 fetched via CMake FetchContent (patched for Apple Silicon NEON and GCC 13+ <limits> include).
  • Animation names: PascalCase in C++ (SpriteAnimationEngine), snake_case over IPC. The engine handles mapping.
  • Acronyms in identifiers stay UPPERCASE — TTSEngine, IPCServer, UDPWorker, LLMProfile, ECGWidget, HTTPProvider. Do NOT PascalCase them (TtsEngine, IpcServer, …). Methods follow the same rule mid-name: setLLMProfiles, setIPCServer. Variables and members stay camelCase with lowercase acronyms (m_ttsEngine, m_ipcServer, httpServer). Filenames match the class: IPCServer.h, TTSProviderRegistry.cpp, OpenAITTSProvider.cpp. Header guards split the acronym with an underscore: IPC_SERVER_H, ITTS_PROVIDER_H.
  • i18n: Chinese translation in Seelie_zh_CN.ts. All user-visible strings use tr().
  • Tests use Qt Test framework on a separate UDP port (52848) to avoid conflicts with running app.
  • App version set in CMakeLists.txt (project(Seelie VERSION x.y.z)), passed to C++ via PROJECT_VERSION compile definition.
  • macOS bundle hides Dock icon via scripts/hide_dock_icon.py post-build step.

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.