Skip to main content

One Thing per Folder

The codebase follows one rule: one thing per folder, file matches folder name.

Top-Level Layout

Folder Convention

Every folder contains exactly one thing. The primary file matches the folder name:
No barrel index.ts files. Imports always use the explicit file path via aliases:

Provider/Hook Split Pattern

When a file has both a React component and a hook, split them into separate files. This is required for React Fast Refresh to work correctly.
Fast Refresh only works when a file exports components OR hooks, not both. Mixing them causes full-page reloads during development.

The Runtime Folder

Each module is a class with a constructor that accepts { workspaceRoot, corpus, ... }. Modules never import each other — they communicate through corpus events.

Data Location

~/.wolffish/ is the ENTIRE footprint. The app stores nothing elsewhere. Uninstall is rm -rf ~/.wolffish/ plus removing the app itself.

Workspace Initialization

The defaults/workspace/ directory in the source tree is the template. On first launch:
  1. Wolffish checks if ~/.wolffish/workspace/ exists
  2. If it doesn’t, copies defaults/workspace/ into ~/.wolffish/workspace/
  3. If it does, nothing happens — user data is never overwritten
Workspace init runs ONLY when ~/.wolffish/workspace/ doesn’t exist. If you add new default files to defaults/workspace/, existing users won’t get them automatically. Handle migrations in code if needed.

Development Setup

Get the dev environment running.

Adding Brain Modules

Add a new module to the runtime pipeline.