Skip to content

Commit 29a9ffe

Browse files
author
Claude
committed
Repo: align agent docs and goreleaser notes
1 parent 18dc962 commit 29a9ffe

File tree

3 files changed

+77
-99
lines changed

3 files changed

+77
-99
lines changed

AGENTS.md

Lines changed: 59 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,71 @@
1-
# Repository Guidelines
1+
# AGENTS.md
22

3-
## Project Structure & Module Organization
3+
Canonical playbook for all coding agents working in the Catnip repo. Model-specific quirks live alongside this file (for example `CLAUDE.md`). Always start here, then consult your agent supplement if one exists.
44

5-
- `src/`: React + TypeScript SPA.
6-
- `components/` (PascalCase `.tsx`), `routes/` (TanStack Router), `lib/` utilities, `hooks/` (files start with `use-`), `stores/`, `types/`.
7-
- `worker/`: Cloudflare Worker (entry `worker/index.ts`) and scripts in `worker/scripts/`.
8-
- `public/`: static assets; `dist/`: build output.
9-
- `container/`: container build files; `docs/`: documentation; `scripts/`: repo maintenance.
10-
- Path alias: import from `@/*` (configured in `tsconfig`). Example: `import { cn } from "@/lib/utils"`.
5+
## Project Summary
116

12-
## Build, Test, and Development Commands
7+
Catnip is an agent-friendly development environment composed of:
138

14-
- `pnpm dev`: run Vite dev server at `http://localhost:5173`.
15-
- `pnpm dev:cf:vite`: SPA with Cloudflare dev flag for local Worker integration.
16-
- `pnpm dev:cf`: build SPA then run `wrangler dev` (Worker + assets); logs are tee’d to `/tmp/wrangler.log`.
17-
- `pnpm build`: type-check then Vite build to `dist/`.
18-
- `pnpm preview`: serve built assets locally.
19-
- `pnpm typecheck` / `pnpm typecheck:worker`: strict TS checks for app/worker.
20-
- `pnpm lint`: ESLint over repo.
21-
- `pnpm format:changed`: Prettier on staged/changed files.
22-
- Containers: `just build-dev` then `just run-dev` for full-stack containerized dev.
9+
- **Frontend**: React + TypeScript SPA built with Vite, ShadCN UI, Tailwind CSS, and TanStack Router
10+
- **Container**: Unified Go binary (`catnip`) providing CLI tools and JSONRPC-powered APIs
11+
- **Worker**: Cloudflare Worker using Hono for production edge logic
2312

24-
## Coding Style & Naming Conventions
13+
## Repository Layout
2514

26-
- TypeScript strict enabled; prefer explicit types where helpful.
27-
- ESLint rules in `eslint.config.js`; unused vars allowed with leading `_`.
28-
- Components: PascalCase filenames and exports. Hooks: `use-*.ts` in `src/hooks`.
29-
- Imports: prefer `@/*` alias; avoid deep relative chains.
30-
- Formatting: Prettier is available; use `pnpm format:changed` before commits.
15+
```
16+
catnip/
17+
├── src/ React app (components, routes, hooks, lib, stores, types)
18+
├── worker/ Cloudflare Worker entry `worker/index.ts` and scripts
19+
├── container/ Go application, `just` tasks, and setup files
20+
├── docs/ Additional documentation
21+
├── public/ Static assets served by Vite
22+
├── dist/ Build output (generated)
23+
└── scripts/ Repository maintenance scripts
24+
```
3125

32-
## Testing Guidelines
26+
Path aliases are configured so the frontend imports from `@/*` (e.g. `import { cn } from "@/lib/utils"`).
3327

34-
- No unit test runner is configured yet. Use `pnpm typecheck` and `pnpm lint` as gates.
35-
- For new tests, prefer colocated files named `*.test.ts(x)` under `src/` and keep fast, isolated modules.
36-
- Validate end-to-end flows via `pnpm dev:cf` (Worker) or `pnpm dev` (SPA).
28+
## Core Commands
3729

38-
## Commit & Pull Request Guidelines
30+
- `pnpm dev`: Vite dev server at `http://localhost:5173`
31+
- `pnpm dev:cf:vite`: SPA dev server with Cloudflare integration flag
32+
- `pnpm dev:cf`: Build SPA then run `wrangler dev` (worker + assets); logs stream to `/tmp/wrangler.log`
33+
- `pnpm build`: Type-check then Vite build to `dist/`
34+
- `pnpm preview`: Serve the built bundle locally
35+
- `pnpm typecheck` / `pnpm typecheck:worker`: Strict TypeScript validation for app/worker
36+
- `pnpm lint`: Run ESLint over the repo
37+
- `pnpm format:changed`: Prettier on staged or changed files
38+
- `just build-dev` then `just run-dev`: Containerized Go + frontend development flow
3939

40-
- Commits: short imperative subject with scope prefix when helpful (e.g., `CLI: reannounce host port mappings`, `UI: fix sidebar hostPort`).
41-
- PRs: include summary, linked issues, screenshots/recordings for UI, and notes on dev/testing steps. Update `docs/` when user-facing behavior changes.
40+
## Coding & Styling Guidelines
4241

43-
## Security & Configuration Tips
42+
- TypeScript is strict; add explicit types when it improves clarity
43+
- Component files are PascalCase `.tsx`; hooks live in `src/hooks` with `use-*.ts` names
44+
- Prefer `@/*` imports over deep relative chains
45+
- ESLint allows unused vars only when prefixed with `_`
46+
- Use Prettier formatting before commits (`pnpm format:changed`)
47+
- Reuse ShadCN theme tokens; avoid custom styling unless required
4448

45-
- Secrets: never commit secrets. Use Wrangler secrets (e.g., `wrangler secret put GITHUB_APP_PRIVATE_KEY`).
46-
- Env: local overrides in `.env.local`; deployment vars are set per-environment in `wrangler.jsonc`.
47-
- On workspace creation, the container runs `./setup.sh`—install any dependencies there.
49+
## Testing Expectations
50+
51+
- No unit test runner is configured yet; rely on `pnpm typecheck` and `pnpm lint`
52+
- Add colocated tests as `*.test.ts(x)` if needed, kept fast and isolated
53+
- Validate end-to-end flows via `pnpm dev` or `pnpm dev:cf`
54+
55+
## Development Environment Notes
56+
57+
- Dev servers auto-rebuild frontend and Go code; assume they are running
58+
- Avoid restarting containers unless explicitly asked—the dev server manages restarts
59+
- For Go changes, run `just build` inside `container/` to ensure compilation
60+
- Tooltip components must use `TooltipPrimitive.Provider`, `.Root`, etc. Never mount `TooltipPrimitive` directly
61+
62+
## Security & Configuration
63+
64+
- Never commit secrets; use Wrangler secrets (e.g. `wrangler secret put GITHUB_APP_PRIVATE_KEY`)
65+
- Local overrides belong in `.env.local`; deployment env vars are defined in `wrangler.jsonc`
66+
- Workspace initialization runs `./setup.sh`; add dependency installs there when needed
67+
68+
## Working With Agents
69+
70+
- Treat `AGENTS.md` as the source of truth for shared workflows
71+
- Keep per-agent documents lean—focus on deviations or ergonomics specific to that model and link back here for the baseline instructions

CLAUDE.md

Lines changed: 14 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,71 +1,24 @@
11
# CLAUDE.md
22

3-
## Project Overview
3+
Supplemental guidance for Anthropic Claude when working in this repository. Read `AGENTS.md` first for shared conventions, then apply the adjustments below.
44

5-
Catnip is an agentic coding environment with three main components:
5+
## Collaboration Style
66

7-
- **Frontend**: React/Vite SPA using ShadCN UI, Tailwind CSS, and TanStack Router
8-
- **Container**: Unified Go binary (`catnip`) providing both CLI tools and server APIs for sandboxed development
9-
- **Worker**: Hono-based Cloudflare Worker (production only)
7+
- Think out loud when the task is ambiguous, but keep the final answer concise
8+
- When tackling multi-step work, outline the intended plan before running commands and update it as you progress
9+
- Prefer actionable bullet points over prose when surfacing findings or next steps
1010

11-
## Tech Stack & Conventions
11+
## Tooling Notes
1212

13-
### Frontend
13+
- Use the provided CLI tools and scripts referenced in `AGENTS.md`; avoid launching alternative package managers or editors
14+
- Treat any long-running or potentially destructive command as opt-in—confirm with the user before executing
1415

15-
- Package manager: `pnpm`
16-
- UI Components: [ShadCN](https://ui.shadcn.com/docs/components) - add with `pnpm dlx shadcn@latest add button`
17-
- Styling: Tailwind CSS with dark/light mode support
18-
- Router: TanStack Router
16+
## Sandbox Awareness
1917

20-
### Backend
18+
- The Claude harness may queue shell commands; group related operations where possible to reduce round-trips
19+
- Surface permission or sandbox limitations immediately and suggest workarounds rather than retrying blindly
2120

22-
- Language: Go
23-
- Build tool: `just` (run `just build` in container/ directory)
24-
- Documentation: OpenAPI/Swagger (auto-generated on build - ensure API endpoints and models are well commented)
25-
- Architecture: JSONRPC where possible
26-
- Terminal UI: Bubbletea-based CLI tool (`catnip`)
21+
## When In Doubt
2722

28-
## Directory Structure
29-
30-
```
31-
catnip/
32-
├── src/ # Frontend React/Vite application
33-
│ ├── components/ # React components including ShadCN UI
34-
│ ├── routes/ # TanStack Router pages
35-
│ └── lib/ # Utilities and shared code
36-
├── container/ # Go application running in Docker
37-
│ ├── cmd/ # Unified binary entry point
38-
│ ├── internal/ # Internal Go packages
39-
│ └── setup/ # Container setup scripts
40-
├── worker/ # Cloudflare Worker (Hono-based)
41-
└── public/ # Static assets
42-
```
43-
44-
## Development Guidelines
45-
46-
### General Rules
47-
48-
- Dev server auto-rebuilds Go and frontend - assume it's running
49-
- Don't restart containers unless explicitly asked
50-
- Use ShadCN theme variables whenever possible
51-
- For Go changes, run `just build` in container/ directory to ensure compilation
52-
- Don't restart the container, our dev server uses air to restart the main binary automatically and restarting the container causes state to be lost
53-
54-
### Common Issues & Best Practices
55-
56-
- **TooltipPrimitive**: Always use `TooltipPrimitive.Provider`, `TooltipPrimitive.Root`, etc. - never use `TooltipPrimitive` directly as a JSX component. This is a recurring issue when working with Radix UI tooltips.
57-
58-
### Container Commands
59-
60-
- Exec in the container: `docker exec -u 1000 catnip-dev bash --login -c '...'` (use uid 1000 and --login for proper path and perms, you can always run sudo if needed)
61-
- View logs: `docker logs --tail 50 catnip-dev`
62-
63-
### Port System
64-
65-
- Services auto-detected and appear in dashboard
66-
- Preview: `/preview/$PORT` (full-screen iframe)
67-
- Direct access: `/$PORT/` (proxy with SPA routing)
68-
69-
## Essential Files
70-
71-
- `docs/` - Additional documentation
23+
- Link back to the relevant section in `AGENTS.md` instead of duplicating content
24+
- Ask the user for clarification whenever expectations conflict or the repository appears out of sync with the documented workflows

container/.goreleaser.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -186,13 +186,14 @@ release:
186186
187187
```bash
188188
# Quick install (latest version)
189-
curl -sfL install.catnip.sh | sh
189+
curl -sSfL install.catnip.sh | sh
190190
191191
# Install specific version
192-
curl -sfL install.catnip.sh | sh -s -- --version {{.Version}}
192+
curl -sSfL install.catnip.sh | sh -s -- --version v{{.Version}}
193193
```
194194
195-
**macOS Users**: The macOS version now includes native notification support through app bundle packaging. The installer will set up both the app bundle and CLI wrapper automatically.
195+
> [!NOTE]
196+
> The macOS version now includes native notification support through app bundle packaging. The installer will set up both the app bundle and CLI wrapper automatically.
196197
197198
### 📋 What's Changed
198199

0 commit comments

Comments
 (0)