Skip to content

Commit 349869e

Browse files
committed
add CLAUDE.md
1 parent 7d52d07 commit 349869e

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

CLAUDE.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# CLAUDE.md
2+
3+
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4+
5+
## Project Overview
6+
7+
ChatGPT2Scratch is a Scratch extension that enables using OpenAI's ChatGPT (gpt-4o-mini) through Scratch blocks. Hosted on GitHub Pages at `https://ichiroc.github.io/chatgpt2scratch/`.
8+
9+
## Architecture
10+
11+
This repository is an extension that gets installed into scratch-gui — it does not run standalone.
12+
13+
- `scratch-vm/src/extensions/scratch3_chatgpt2scratch/index.js` — Main extension logic: block definitions, OpenAI API calls, i18n (en, ja, ja-Hira)
14+
- `scratch-gui/src/lib/libraries/extensions/chatgpt2scratch/index.jsx` — Extension entry for the Scratch GUI extension library
15+
- `install.sh` — Injects the extension into scratch-gui's `node_modules`. Embeds `AZURE_API_KEY` and `DOJO_KEY` environment variables into the source
16+
17+
There is a special code path for access via CoderDojo Japan: it uses an Azure OpenAI endpoint and does not require the user to set an API key.
18+
19+
## Local Development
20+
21+
```sh
22+
# 1. Clone scratch-gui
23+
git clone --depth 1 git@github.com:LLK/scratch-gui.git
24+
cd scratch-gui
25+
npm install
26+
27+
# 2. Clone this repo and install
28+
git clone git@github.com:ichiroc/chatgpt2scratch.git
29+
sh chatgpt2scratch/install.sh
30+
31+
# 3. Start
32+
npm start
33+
# Access at http://localhost:8601
34+
```
35+
36+
## CI/CD
37+
38+
`.github/workflows/build.yml` — Deploys to GitHub Pages on push to main. Checks out scratch-gui, installs the extension, builds, then deploys.

0 commit comments

Comments
 (0)