Skip to content

Commit 11ecf64

Browse files
committed
Galley 0.1.0 — an integrated review environment (IRE)
Review a git diff in the browser, then hand a structured review back to your coding agent. CLI with working / staged / file / pr modes and an await → comment → reload event loop; a browser desk (Alpine + @pierre/diffs) with guided review, per-line comment threads, per-change accept/reject, file sign-off, and keyboard-first navigation; an installable skill + agents snippet; CI and tagged-release (OIDC publish) workflows.
0 parents  commit 11ecf64

52 files changed

Lines changed: 10521 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: ci
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
ci:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
- run: corepack enable
15+
- uses: actions/setup-node@v4
16+
with:
17+
node-version: 22
18+
cache: pnpm
19+
- run: pnpm install --frozen-lockfile
20+
- run: pnpm lint
21+
- run: pnpm check
22+
- run: pnpm build
23+
- run: pnpm test
24+
- run: pnpm smoke

.github/workflows/release.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: release
2+
3+
on:
4+
push:
5+
tags: ["v*"]
6+
7+
permissions:
8+
id-token: write # OIDC trusted publishing + npm provenance
9+
contents: write # create the GitHub Release
10+
11+
jobs:
12+
release:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
- run: corepack enable
17+
- uses: actions/setup-node@v4
18+
with:
19+
node-version: 22
20+
cache: pnpm
21+
registry-url: "https://registry.npmjs.org"
22+
- run: pnpm install --frozen-lockfile
23+
- run: pnpm lint
24+
- run: pnpm check
25+
- run: pnpm build
26+
- run: pnpm test
27+
- run: pnpm smoke
28+
# OIDC trusted publishing (tokenless) requires npm >= 11.5.1
29+
- run: npm install -g npm@latest
30+
- run: npm publish --provenance --access public
31+
- run: npx changelogen@latest github release --token "$GITHUB_TOKEN"
32+
env:
33+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
.prd/
2+
prototypes/
3+
node_modules/
4+
dist/
5+
.pi/
6+
*.log
7+
.DS_Store
8+
9+
# Playwright MCP test artifacts (screenshots/snapshots)
10+
.playwright-mcp/

.oxfmtrc.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"$schema": "./node_modules/oxfmt/configuration_schema.json",
3+
"ignorePatterns": ["src/ui/index.html", "src/ui/icon-data.ts"]
4+
}

.oxlintrc.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"$schema": "./node_modules/oxlint/configuration_schema.json",
3+
"ignorePatterns": ["src/ui/icon-data.ts"]
4+
}

AGENTS.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Agent Instructions
2+
3+
## Reviewing with Galley
4+
5+
When the user should review a plan, a PR, or code changes you've made, hand it to **Galley** — a living browser review desk.
6+
7+
- **Changes you made**`galley --session <task-id> &` (working tree; `--diff staged` for staged only).
8+
- **A markdown plan / single artifact**`galley file <path> &`.
9+
- **A branch / PR**`galley pr <ref> &`.
10+
11+
Then loop: `galley await --session <task-id>` blocks for the next event and prints a tagged JSON envelope.
12+
- `{"kind":"question",…}` → answer **now** with `galley comment --path … --line … --side … --body "…"` at the question's location.
13+
- `{"kind":"review","result":{…}}` → act on `result`: revert **rejected**, make **requestedChanges**, leave **accepted** alone, leave **approvedFiles** (signed off as-is) untouched, don't touch **stagedFiles** unless a change requires it. (Editing an approved file invalidates its approval → it needs re-review next round.)
14+
15+
After editing code, run `galley reload --session <task-id>` so your edits show in the open tab, then `galley await` again for the next round. The desk stays open across rounds — don't reopen it.
16+
17+
Full reference (modes, options, exit semantics, `ReviewResult`): **`skills/galley/SKILL.md`**.
18+
19+
## Commits & releases
20+
21+
- Commits follow **Conventional Commits** (`feat:`, `fix:`, `perf:`, `refactor:`, `docs:`,
22+
`chore:`, …). `changelogen` groups them into the changelog and infers the semver bump, so the
23+
prefix matters — use `feat:` for user-facing additions and `fix:` for bug fixes.
24+
- Releases are cut by the maintainer with `pnpm release`: it runs lint + typecheck + tests +
25+
build + smoke, then `changelogen --release --push` bumps the version, writes `CHANGELOG.md`,
26+
tags `vX.Y.Z`, and pushes. The pushed tag triggers the `release` workflow, which publishes to
27+
npm with provenance via OIDC. Do not run `npm publish` by hand.

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2026 Yusuf Mansur Özer
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
<div align="center">
2+
3+
<img src="assets/logo.svg" alt="Galley" width="84" />
4+
5+
# Galley
6+
7+
**An integrated review environment (IRE) for code you didn't write by hand.**
8+
9+
[![CI](https://github.com/ymansurozer/galley/actions/workflows/ci.yml/badge.svg)](https://github.com/ymansurozer/galley/actions/workflows/ci.yml) [![npm](https://img.shields.io/npm/v/@ymansurozer/galley.svg)](https://www.npmjs.com/package/@ymansurozer/galley) [![license](https://img.shields.io/badge/license-MIT-blue.svg)](./LICENSE)
10+
11+
<img src="assets/screenshot.png" alt="Galley — a guided review: pending changes with accept/reject, a question waiting on the agent, and a change request" width="80%" />
12+
13+
</div>
14+
15+
<br>
16+
17+
Code editors and IDEs were built for a coding-first world. Their diff view is fine for a quick glance, but not for working through a big change or going back and forth with the agent that wrote it.
18+
19+
Galley is my attempt at a real review surface: you review, hit **Send to Agent**, and your agent acts on your decisions and replies in place.
20+
21+
I'm not saying this is *the* review surface. I built it in a week and I'm still figuring out the shape. But this is what I think it should be.
22+
23+
> The name comes from the *galley proof*: in printing, the rough proof pulled for proofreading and corrections before a text goes to press. You mark it up, then it ships. Same idea, for code.
24+
25+
## Principles
26+
27+
Galley is opinionated about exactly one thing: the review surface. It's a protocol and an interface, nothing more. How you review, and what you review with, stays yours.
28+
29+
- **No model runs here.** Galley doesn't call an LLM or orchestrate one. It renders the diff, validates the structured input it's given, and hands a result back.
30+
- **Your agent, not ours.** The contract is plain JSON over stdout and a localhost server, with no assumption about who's on the other end: Claude Code, Cursor, Codex, a shell script. The guided review, the answers to your questions, the code changes themselves are all *your* agent's work. Galley just gives it somewhere to land.
31+
- **Local and private.** The server binds to localhost on a random port. No telemetry. Your browser may fetch a web font; switch to system fonts and even that stops.
32+
- **It won't touch your repo unless you ask.** Galley never edits your tracked files.
33+
34+
## Features
35+
36+
- **A beautiful and functional diff view** built on `@pierre/diffs`.
37+
- **Per-line comment threads.** Comment on any line. Ask a question and your agent answers live in the thread; leave a change request and it rides to the handoff.
38+
- **Per-change accept/reject.** Accept or reject individual changes, or sign off a whole file.
39+
- **A tight handoff loop.** Hit **Send to Agent** and your agent gets a structured review. It makes the edits, re-diffs into the same tab, and replies in place.
40+
- **Guided review.** Your agent can attach a guide: an overview, the files in a sensible order, a per-file summary and category, and the risky ones flagged.
41+
- **Four review modes.** The working tree, the staged diff, a single file (tracked or not, like a plan, PRD, or issue), or a branch against its merge-base.
42+
- **Keyboard-first.** Intuitive navigation: move by file, line, or change, and accept, reject, comment, or approve without touching the mouse.
43+
- **Customize** diff layout, intra-line, hunk separators, wrapping, code-highlight theme, and fonts.
44+
45+
## Getting started
46+
47+
1. **Install the CLI** (needs **Node 20+** and **git**):
48+
49+
```bash
50+
npm install -g @ymansurozer/galley # global, for any repo
51+
# or: npm install -D @ymansurozer/galley # per-project
52+
```
53+
54+
2. **Teach your agent to drive it.** Install the skill for on-demand use:
55+
56+
```bash
57+
npx skills add ymansurozer/galley
58+
```
59+
60+
Or paste the [snippet](./skills/galley/agents-snippet.md) into your agent's `AGENTS.md` / `CLAUDE.md` to always review via Galley.
61+
62+
3. **Start a review:**
63+
64+
```bash
65+
galley # review the working-tree diff
66+
galley --diff staged # review the staged diff
67+
galley file path/to/plan.md # review a single file or artifact (e.g. a generated plan)
68+
galley pr feature-branch # review a branch's commits vs its merge-base
69+
```
70+
71+
Galley opens in your browser and stays open. You review and click **Send to Agent**; the agent attaches, acts on each send, and replies in the same tab. More flags (`--repo`, `--path`, `--port`, `--no-open`, `--guide`, …) are documented in the skill.
72+
73+
## Roadmap
74+
75+
Immediate to-dos, in rough priority order.
76+
77+
- [ ] **Anchor repair instead of stale-flagging**: when re-diffing on `reload`, try to re-anchor each guide entry to its nearest surviving section/line before declaring the guide stale, so a guide degrades gracefully across rounds (the agent edits between rounds, Galley's hot path) instead of invalidating wholesale on any drift. Keep clean "vanished → stale" semantics for anchors that genuinely no longer resolve.
78+
- [ ] **Command palette**: add a discoverable Cmd/Ctrl+Shift+P palette for common review actions: file filter, find in diffs, next/previous file or change, accept/reject/request change, approve file, toggle layout/settings/sidebar, open in editor, reload, and Send to Agent. Keep keyboard shortcuts as the fast path, but make every major action searchable.
79+
- [ ] **Commit/range/branch review modes**: expand beyond working/staged/file/PR branch reviews with `galley commit <ref>`, `galley range <base>..<head>` / `<base>...<head>`, and `galley branch <base>` so Galley can review historical or comparison diffs without requiring a dirty working tree.
80+
- [ ] **Open file in editor**: add a configurable editor command and UI/shortcut action to open the selected file at the current line from the review desk. Support placeholders like `{repo}`, `{file}`, and `{line}` and keep it safe for repo-relative paths.
81+
- [ ] **Lazy diff/content loading + large/binary-file guards**: today every changed file's full contents are read and shipped up front; the only large-file handling is client-side render deferral. Move the guard to the data layer: classify each file by byte size and ship lightweight patch data first, hydrating full contents, highlighting, and rendered markdown on demand when a file is opened. Per-file `loadState` (`ready | deferred | too-large | binary | error`) with two byte tiers — an *eager* limit (~1 MiB, loaded up front) and a *manual* limit (~2 MiB, deferred until opened); over that is `too-large` (skipped with a summary + explicit load-anyway action), plus an image byte cap. Add **binary detection** (NUL-byte scan) so binaries are skipped rather than read as UTF-8 and handed to @pierre.
82+
83+
## License
84+
85+
[MIT](./LICENSE) © Yusuf Mansur Özer

assets/logo.svg

Lines changed: 10 additions & 0 deletions
Loading

assets/screenshot.png

116 KB
Loading

0 commit comments

Comments
 (0)