From d7dab69405a155c289b8f8cb0221f05d2980b45e Mon Sep 17 00:00:00 2001 From: Chris Wanstrath <2+defunkt@users.noreply.github.com> Date: Wed, 8 Oct 2025 14:04:51 -0700 Subject: [PATCH] maybe --- nose/CLAUDE.md | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 nose/CLAUDE.md diff --git a/nose/CLAUDE.md b/nose/CLAUDE.md new file mode 100644 index 0000000..0232cca --- /dev/null +++ b/nose/CLAUDE.md @@ -0,0 +1,62 @@ +# CLAUDE.md + +This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. + +## Overview + +This is a NOSE_DIR (user directory for NOSE - a browser-based terminal and server-based shell written in TypeScript). It contains multiple projects that can be accessed as subdomains. + +## Project Structure + +Each top-level directory represents a **project**. Projects are accessed via subdomains (e.g., `chris.nose-pluto.local` for the `chris` project). + +### Project Anatomy + +A project can contain: + +- **`bin/`** - Commands executable from the NOSE terminal. Each `.ts` or `.tsx` file in `bin/` exports a default function that becomes a command. +- **`index.ts` or `index.tsx`** - Web application entry point. When present, the project serves as a webapp at its subdomain. +- **`pub/`** - Static files (HTML, CSS, images, etc.) served publicly by the web server. +- **`test/`** - Test files for the project. + +### The Root Project + +The **`root/`** project is special: +- Cannot be deleted +- Cannot host webapps or static files (no `index.ts/tsx` or `pub/` directory) +- Commands in `root/bin/` are globally available in all other projects + +## Technology Stack + +- **Runtime**: Bun (TypeScript runtime) +- **Web Framework**: Hono (lightweight web framework) +- **JSX Runtime**: Hono JSX (`jsxImportSource: "hono/jsx"`) +- **Language**: TypeScript with strict mode + +## Type System + +- `global.d.ts` defines a global `Context` type that aliases `HonoContext` from Hono +- TSConfig uses path aliases pointing to central NOSE installation at `/home/nose/.nose/src/`: + - `@utils` → `/home/nose/.nose/src/utils.tsx` + - `@/*` → `/home/nose/.nose/src/*` + +## Creating New Projects + +To create a new project, use the `mkproject` command in your NOSE terminal. + +## Web Application Patterns + +Web apps export default functions that: +- Receive a Hono `Context` parameter (typed globally as `Context`) +- Return strings, JSX, or Response objects +- Can use Hono JSX for rendering HTML + +Example: +```tsx +export default (c: Context) => + Hello World +``` + +## Commands + +Commands in `bin/` directories export default functions that return strings or JSX to be displayed in the NOSE terminal.