Skip to content

Commit 4009c3f

Browse files
Merge remote-tracking branch 'origin/main'
2 parents 4d8f2fb + 66b65bf commit 4009c3f

24 files changed

Lines changed: 899 additions & 184 deletions

File tree

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
---
2+
name: build-extension
3+
description: Build, test, and package VSCode extensions in the dart_node repo
4+
argument-hint: "[too-many-cooks|dart-node-vsix] [build|test|package|install]"
5+
disable-model-invocation: true
6+
allowed-tools: Bash
7+
---
8+
9+
# Build VSCode Extensions
10+
11+
This repo has two VSCode extension components:
12+
13+
| Component | Location | What it is |
14+
|-----------|----------|------------|
15+
| **dart_node_vsix** | `packages/dart_node_vsix/` | The SDK package — Dart bindings for the VSCode extension API (commands, tree views, webviews, status bar, etc.) |
16+
| **too_many_cooks** | `examples/too_many_cooks_vscode_extension/` | A concrete extension built with that SDK — multi-agent coordination UI |
17+
18+
## too-many-cooks extension
19+
20+
**Full build** (MCP server + extension + .vsix package):
21+
```bash
22+
bash examples/too_many_cooks_vscode_extension/build.sh
23+
```
24+
25+
This does:
26+
1. Compiles MCP server: `dart compile js``add_preamble.dart``server_node.js`
27+
2. Compiles extension: `dart compile js``wrap-extension.js` bridge → `out/lib/extension.js`
28+
3. Packages: `vsce package``.vsix` file
29+
30+
**Test** (runs Mocha tests under a real VSCode instance):
31+
```bash
32+
cd examples/too_many_cooks_vscode_extension && npm run pretest && npm test
33+
```
34+
On headless Linux, prefix with `xvfb-run -a`.
35+
36+
**Install into VSCode**:
37+
```bash
38+
code --install-extension examples/too_many_cooks_vscode_extension/*.vsix
39+
```
40+
41+
## dart_node_vsix SDK package
42+
43+
**Test the SDK** (Dart tests compiled to JS, run in VSCode):
44+
```bash
45+
cd packages/dart_node_vsix && npm install && npm run compile && npm test
46+
```
47+
48+
**What it provides** — Dart bindings for:
49+
- `commands`, `window`, `workspace`, `statusBar`
50+
- `TreeView`, `Webview`, `OutputChannel`
51+
- `ExtensionContext`, `Disposable`
52+
- `Mocha` test API bindings
53+
- JS interop helpers (`Promise`, `EventEmitter`)
54+
55+
## Architecture
56+
57+
Both use the same pattern: Dart → `dart compile js` → wrapper script → VSCode-compatible JS module.
58+
59+
The wrapper scripts (`scripts/wrap-extension.js`, `scripts/wrap-tests.js`) bridge dart2js output to VSCode's CommonJS `require`/`module.exports` system and inject polyfills (navigator, self) needed by dart2js async scheduling.

.claude/skills/create-pr/SKILL.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
---
2+
name: create-pr
3+
description: Create a pull request using the dart_node PR template
4+
disable-model-invocation: true
5+
allowed-tools: Bash, Read, Grep, Glob
6+
---
7+
8+
# Create Pull Request
9+
10+
Create a PR following the dart_node template and conventions.
11+
12+
## Steps
13+
14+
1. **Check state**:
15+
```bash
16+
git status
17+
git diff main...HEAD
18+
git log main..HEAD --oneline
19+
```
20+
21+
2. **ignore all commits** do not pay attention to the commit messages
22+
23+
3. **Draft PR using the template** from `.github/PULL_REQUEST_TEMPLATE.md`
24+
25+
4. **Create the PR**:
26+
```bash
27+
gh pr create --title "Short title under 70 chars" --body "$(cat <<'EOF'
28+
## TLDR;
29+
...
30+
31+
## What Does This Do?
32+
...
33+
34+
## Brief Details?
35+
...
36+
37+
## How Do The Tests Prove The Change Works?
38+
...
39+
EOF
40+
)"
41+
```
42+
43+
## Rules
44+
45+
- Keep the title under 70 chars
46+
- Keep documentation tight (per CLAUDE.md)
47+
- Only diff against `main` — ignore commit messages
48+
- Return the PR URL when done

.claude/skills/pub-get/SKILL.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
name: pub-get
3+
description: Install all Dart and npm dependencies in dependency order
4+
disable-model-invocation: true
5+
allowed-tools: Bash
6+
---
7+
8+
# Install Dependencies
9+
10+
Run the dependency installer that handles the tiered monorepo structure.
11+
12+
```bash
13+
./tools/pub_get.sh
14+
```
15+
16+
## What it does
17+
18+
Installs `dart pub get` and `npm install` across all packages and examples in dependency order:
19+
20+
1. **Tier 1 (Core):** `dart_logging`, `dart_node_coverage`, `dart_node_core`, `reflux`
21+
2. **Tier 2 (Packages):** `dart_jsx`, `dart_node_express`, `dart_node_ws`, `dart_node_better_sqlite3`, `dart_node_mcp`, `dart_node_react`, `dart_node_react_native`
22+
3. **Tier 3 (Examples):** `frontend`, `markdown_editor`, `reflux_demo/web_counter`, `too_many_cooks`, `backend`, `mobile`, `jsx_demo`
23+
24+
Order matters because Tier 2 depends on Tier 1, and Tier 3 depends on both.
25+
26+
## After running
27+
28+
Report any failures. If a package fails, it's usually because:
29+
- A dependency in an earlier tier hasn't been published yet (use `dart run tools/switch_deps.dart local` for local dev)
30+
- npm packages need `npm install` in a subdirectory (e.g., `examples/mobile/rn/`)
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
---
2+
name: setup-claude
3+
description: Install Claude Code CLI and the Too Many Cooks VSCode extension for multi-agent development
4+
disable-model-invocation: true
5+
allowed-tools: Bash
6+
---
7+
8+
# Install Claude Code & Extension
9+
10+
Sets up Claude Code CLI and the Too Many Cooks VSCode extension for multi-agent coordination.
11+
12+
## Step 1: Install Claude Code CLI
13+
14+
```bash
15+
npm install -g @anthropic-ai/claude-code
16+
```
17+
18+
Verify:
19+
```bash
20+
claude --version
21+
```
22+
23+
## Step 2: Build the Too Many Cooks VSCode Extension
24+
25+
The extension provides visual agent coordination (locks, messages, plans) via the MCP server.
26+
27+
### 2a. Build the MCP Server first
28+
29+
```bash
30+
cd examples/too_many_cooks && dart pub get && npm install
31+
dart compile js -o examples/too_many_cooks/build/bin/server.js examples/too_many_cooks/bin/server.dart
32+
dart run tools/build/add_preamble.dart \
33+
examples/too_many_cooks/build/bin/server.js \
34+
examples/too_many_cooks/build/bin/server_node.js \
35+
--shebang
36+
```
37+
38+
### 2b. Build and package the extension
39+
40+
```bash
41+
cd examples/too_many_cooks_vscode_extension
42+
npm install
43+
npm run compile
44+
npx @vscode/vsce package
45+
```
46+
47+
This creates a `.vsix` file in `examples/too_many_cooks_vscode_extension/`.
48+
49+
### 2c. Install the extension
50+
51+
```bash
52+
code --install-extension examples/too_many_cooks_vscode_extension/*.vsix
53+
```
54+
55+
Or use the full build script that does steps 2a-2b:
56+
```bash
57+
bash examples/too_many_cooks_vscode_extension/build.sh
58+
```
59+
60+
## Step 3: Configure Claude Code for this project
61+
62+
The project's `.claude/settings.local.json` already has the required permissions:
63+
- `Bash(dart pub get:*)` — dependency installation
64+
- `mcp__too-many-cooks__register` — MCP agent registration
65+
- `Bash(docker ps:*)` — Docker status checks
66+
67+
Custom skills are in `.claude/skills/` — run `/help` to see them.
68+
69+
## Multi-Agent Usage
70+
71+
After setup, agents coordinate via the Too Many Cooks MCP server:
72+
- **Lock files** before editing, unlock after
73+
- **Check messages** regularly between agents
74+
- **Update plans** so other agents can see your intent
75+
- Keep your agent key — it's critical for authentication
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
---
2+
name: setup-playwright
3+
description: Install Chromium and Playwright for website E2E testing
4+
disable-model-invocation: true
5+
allowed-tools: Bash
6+
---
7+
8+
# Install Chromium & Playwright
9+
10+
Sets up Playwright with Chromium for running the website's E2E test suite.
11+
12+
## Steps
13+
14+
1. **Install website npm dependencies** (includes `@playwright/test`):
15+
```bash
16+
cd website && npm ci
17+
```
18+
19+
2. **Install Chromium browser and OS dependencies**:
20+
```bash
21+
cd website && npx playwright install --with-deps chromium
22+
```
23+
This installs the Chromium binary plus required system libraries (libgbm, libasound, etc.).
24+
25+
3. **Verify installation**:
26+
```bash
27+
cd website && npx playwright --version
28+
```
29+
30+
## Notes
31+
32+
- Only Chromium is needed — this project does not test against Firefox or WebKit.
33+
- On the Dev Container (Ubuntu 24.04), `--with-deps` installs the OS packages automatically.
34+
- On macOS, Playwright downloads its own Chromium binary — no Homebrew needed.
35+
- Browser cache lives at `~/.cache/ms-playwright/`. Delete this to force a clean reinstall.
36+
- The website tests are at `website/tests/` and configured in `website/playwright.config.js`.
37+
- Base URL: `http://localhost:8080` (Eleventy dev server).
38+
39+
## After installing
40+
41+
Run the website tests:
42+
```bash
43+
cd website && npm test
44+
```
45+
46+
Or with UI mode:
47+
```bash
48+
cd website && npm run test:ui
49+
```

.claude/skills/taskflow/SKILL.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
---
2+
name: taskflow
3+
description: Build and run the full TaskFlow demo stack (Express backend + React frontend + mobile)
4+
disable-model-invocation: true
5+
allowed-tools: Bash
6+
---
7+
8+
# TaskFlow Demo
9+
10+
Build and run the full-stack demo that showcases dart_node's capabilities.
11+
12+
## Run it
13+
14+
```bash
15+
sh examples/run_taskflow.sh
16+
```
17+
18+
This:
19+
1. Kills any existing processes on ports 3000 and 8080
20+
2. Builds backend, mobile, and frontend from Dart to JS
21+
3. Starts the Express backend on **http://localhost:3000**
22+
4. Starts the frontend dev server on **http://localhost:8080/web/**
23+
5. Traps Ctrl+C for clean shutdown
24+
25+
## Ports
26+
27+
| Service | Port | How |
28+
|---------|------|-----|
29+
| Backend API (Express) | 3000 | `node examples/backend/build/server.js` |
30+
| Frontend (static) | 8080 | `python3 -m http.server 8080` |
31+
| Mobile (Expo) || `cd examples/mobile/rn && npm run ios` or `npm run android` |
32+
33+
## Prerequisites
34+
35+
Dependencies must be installed first. If the build fails, run:
36+
```bash
37+
./tools/pub_get.sh
38+
```
39+
40+
Or use the Dev Container which runs `post-create.sh` automatically.
41+
42+
## Manual start (individual services)
43+
44+
Backend only:
45+
```bash
46+
dart run tools/build/build.dart backend && node examples/backend/build/server.js
47+
```
48+
49+
Frontend only:
50+
```bash
51+
cd examples/frontend && bash build.sh && python3 -m http.server 8080
52+
```

0 commit comments

Comments
 (0)