blob: f51898bae77c71d89c69d06b8c090a9ce79f6613 [file] [log] [blame] [view]
Josh Bleecher Snyder6d4c7ea2025-05-12 12:14:24 -07001Sketch is an agentic coding tool with a two-layer architecture:
2
31. Outer sketch: CLI command running on user's machine
42. Inner sketch: Binary running inside Docker containers for isolated work
5
6Both layers use the same entrypoint (cmd/sketch). Outer sketch sets up containerization and starts inner sketch. Changes made in inner sketch are pushed via git to outer sketch.
7
8## Core Packages
9
Josh Bleecher Snyder322dae92025-06-04 12:27:07 -070010- termui, webui: both interfaces operate at all times
11- loop: state machine that manages agent conversation flow
Josh Bleecher Snyder6d4c7ea2025-05-12 12:14:24 -070012
13## Development Guidelines
14
15- Do NOT git add or modify .gitignore, makefiles, or executable binaries unless requested
Josh Bleecher Snyder322dae92025-06-04 12:27:07 -070016- When adding, removing, or changing tools, update both termui and webui
17- Unless explicitly requested, do not add backwards compatibility shims. Just change all the relevant code.
Josh Bleecher Snyder385da542025-05-12 19:18:10 -070018
Philip Zeyligere79a44b2025-07-16 21:00:43 -070019## Building
20
21You can build the sketch binary with "make". The webui directory has some
22standalone "npm run dev" capability, but the main build is "make".
23
Josh Bleecher Snyder385da542025-05-12 19:18:10 -070024## Meta
25
Philip Zeyligere79a44b2025-07-16 21:00:43 -070026The program you are working on is Sketch. The program you are running is
27Sketch. This can be slightly confusing: Carefully distinguish the prompt and
28tools you have from the codebase you are working on. Modifying the code does
29not change your prompt or tools.
Josh Bleecher Snyder6e353322025-05-21 18:21:24 +000030
Philip Zeyligere79a44b2025-07-16 21:00:43 -070031To start a copy of sketch, if you don't have an ANTHROPIC_API_KEY in your env
32already, you can use:
33
34 ANTHROPIC_API_KEY=fake sketch -skaband-addr= -addr ":8080" -unsafe
35
36To browse the copy of sketch you just started, browse to localhost:8080.
Josh Bleecher Snyder78e7cf92025-05-23 14:33:34 -070037
Josh Bleecher Snyder6e353322025-05-21 18:21:24 +000038## Testing
39
40- Do NOT use the testify package. Write tests using the standard Go testing library only.
Philip Zeyliger254c49f2025-07-17 17:26:24 -070041
42## Frontend Guidelines
43
44- Always use relative URLs in frontend code (e.g., "./git/head" instead of "/git/head") to ensure proper routing through proxies.
45- Always use Go structs for input and output types of JSON HTTP requests and use go2ts
46 to convert them to typescript.