Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .apm/instructions/dev-commands.instructions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
description: "Common dev commands for database migration, linting, and testing"
applyTo: "**"
---

### Database migration

Run migrations: `go run ./cmd/sippy migrate --database-dsn $SIPPY_DATABASE_DSN`

If `SIPPY_DATABASE_DSN` is not set, use the dev default: `postgresql://postgres:password@localhost:5432/postgres`

### Linting

Run lint: `CI=true make lint`

`CI=true` makes `hack/go-lint.sh` use the locally installed `golangci-lint` instead of spawning a container.

### Testing

Run unit tests: `make test`

This runs Go tests via gotestsum and sippy-ng Jest tests.
8 changes: 8 additions & 0 deletions .apm/instructions/mcp.instructions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
description: "MCP server (sippy-dev) for AI-callable dev tasks"
applyTo: "mcp/**"
---

Shared MCP server for AI-callable dev tasks (migrate, serve, lint, test, e2e). Configuration, tool list, logs, and extension notes: **[README.md](../../mcp/README.md)**.

When adding or modifying MCP tools, follow existing patterns in `server.py` (subprocess, `_repo_path`, `_ensure_dev_log_dir`, credentials helpers). Restart the MCP server after changes.
12 changes: 12 additions & 0 deletions .apm/prompts/sippy-dev-app.prompt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
description: "Start both Sippy backend and frontend dev servers"
---

# Sippy dev — backend + frontend

Start the full local Sippy stack using two MCP tool calls (server: **`sippy-dev`**). Run them in order — backend first, then frontend.

1. **`sippy_serve`** — pass **`bigquery_credentials_file`** when `SIPPY_BIGQUERY_CREDENTIALS_FILE` / `GOOGLE_APPLICATION_CREDENTIALS` are not set.
2. **`sippy_ng_start`**

Each tool returns listen hints (typically **8080** / **3000**) and log paths. If a tool reports already running, ask the user if they want to restart it. If yes, call the tool again with **`restart=True`**.
13 changes: 13 additions & 0 deletions .apm/prompts/sippy-dev-frontend.prompt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
description: "Start the sippy-ng React dev server via the sippy-dev MCP tool"
---

# Sippy dev — frontend (sippy-ng)

Use the **`sippy_ng_start`** MCP tool (server: **`sippy-dev`**). Do not run `npm start` in `sippy-ng` manually — the MCP tool handles background process management, log routing, and duplicate detection.

**`open_browser`** defaults to **`false`**. Typical URL: **`http://127.0.0.1:3000`**. Log: **`sippy-dev-logs/sippy_ng_start.log`**.

If the dev server is already running, the tool will report it. Ask the user if they want to restart, and if so call again with **`restart=True`**.

See **`mcp/server.py`** for all parameters.
17 changes: 17 additions & 0 deletions .apm/prompts/sippy-dev-migrate.prompt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
description: "Run Sippy PostgreSQL schema migration"
---

# Sippy dev — migrate

Run the migration command directly:

```bash
go run ./cmd/sippy migrate --database-dsn "$SIPPY_DATABASE_DSN"
```

If `SIPPY_DATABASE_DSN` is not set, use the dev default:

```bash
go run ./cmd/sippy migrate --database-dsn "postgresql://postgres:password@localhost:5432/postgres"
```
11 changes: 11 additions & 0 deletions .apm/prompts/sippy-dev-regression-cache.prompt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
description: "Run the Sippy regression-cache loader (BigQuery + Redis + DB)"
---

# Sippy dev — regression-cache

Use the **`regression_cache`** MCP tool (server: **`sippy-dev`**). Do not run `go run ./cmd/sippy load --loader regression-cache` manually — the MCP tool handles credentials, logging, and timeouts.

**`bigquery_credentials_file`**: path to BigQuery-capable SA JSON (e.g. `sippy-bigquery-job-importer-key.json`); optional if `SIPPY_BIGQUERY_CREDENTIALS_FILE` or `GOOGLE_APPLICATION_CREDENTIALS` is set.

See **`mcp/server.py`** for all parameters. Log: **`sippy-dev-logs/regression_cache.log`**. Typical duration is many minutes.
13 changes: 13 additions & 0 deletions .apm/prompts/sippy-dev-serve.prompt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
description: "Start the Sippy HTTP API server via the sippy-dev MCP tool"
---

# Sippy dev — serve

Use the **`sippy_serve`** MCP tool (server: **`sippy-dev`**). Do not run `go run ./cmd/sippy serve` manually — the MCP tool handles background process management, log routing, and duplicate detection.

**`bigquery_credentials_file`**: path to BigQuery-capable SA JSON (e.g. `sippy-bigquery-job-importer-key.json`); optional if `SIPPY_BIGQUERY_CREDENTIALS_FILE` or `GOOGLE_APPLICATION_CREDENTIALS` is set.

If the server is already running, the tool will report it. Ask the user if they want to restart, and if so call again with **`restart=True`**.

See **`mcp/server.py`** for all parameters. Typical listen address: **`:8080`**. Log: **`sippy-dev-logs/sippy_serve.log`**.
113 changes: 113 additions & 0 deletions .apm/prompts/sippy-dev-setup.prompt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
---
description: "Set up the Sippy devcontainer (Podman, env, GCP auth)"
---

# Sippy dev — devcontainer setup

Interactive setup for the Sippy devcontainer. Automates what can be detected, prompts for what can't.

## Workflow

### 1. Detect OS

```bash
uname -s
```

- **Darwin** = macOS
- **Linux** = Linux

### 2. Check prerequisites

Verify each tool is installed. Report any that are missing and stop.

```bash
command -v podman
command -v devcontainer
```

If `devcontainer` is missing, tell the user: `npm install -g @devcontainers/cli`

### 3. macOS: Podman machine

If macOS, check if podman machine is running:

```bash
podman machine info
```

If not initialized or not running, run:

```bash
podman machine init # only if no machine exists
podman machine start
```

### 4. Linux: Podman socket

If Linux, check if the socket is active:

```bash
systemctl --user is-active podman.socket
```

If not active, run:

```bash
systemctl --user enable --now podman.socket
```

Also check for `podman-docker`:

```bash
command -v docker
```

If missing, suggest installing `podman-docker` (dnf or apt depending on `/etc/os-release`).

### 5. Environment file

Check if `.devcontainer/.env` exists:

```bash
test -f .devcontainer/.env
```

If missing, copy from the example:

```bash
cp .devcontainer/.env.example .devcontainer/.env
```

Then read `.devcontainer/.env` and check for empty required values. If any are blank (e.g. `ANTHROPIC_VERTEX_PROJECT_ID`), tell the user which values need to be filled in and ask them to edit `.devcontainer/.env` and let you know when they're done. **Do not** ask for the values directly or write to the file yourself — the user should edit it. Wait for them to confirm before continuing.

### 6. Start the container

Determine the right command based on OS:

- **macOS**: `devcontainer up --workspace-folder . --docker-path podman`
- **Linux** (with `podman-docker`): `devcontainer up --workspace-folder .`
- **Linux** (without `podman-docker`): `devcontainer up --workspace-folder . --docker-path podman`

Run it. This triggers `init-services.sh` (PostgreSQL + Redis) and `post-create.sh` (Go tools, npm, MCP venv).

### 7. GCP authentication

GCP credentials are mounted from the host's `~/.config/gcloud` directory. If the user hasn't authenticated on the host yet, tell them to run on the host (not inside the container):

```bash
gcloud auth application-default login
```

The credentials will be available inside the container automatically after restart.

### 8. Summary

Print a summary of what was set up:

- Container status
- PostgreSQL: `localhost:5432`
- Redis: `localhost:6379`
- API server: `localhost:8080` (start with `/sippy-dev-serve`)
- React dev server: `localhost:3000` (start with `/sippy-dev-frontend`)
- GCP auth status
25 changes: 25 additions & 0 deletions .apm/prompts/sippy-dev-tests.prompt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
description: "Run lint, unit tests, and e2e in order (full local CI suite)"
---

# Sippy dev — full test suite

Run these three steps in order. Stop if any step fails.

1. **Lint** — run directly:

```bash
CI=true make lint
```

`CI=true` makes `hack/go-lint.sh` use the locally installed `golangci-lint` instead of spawning a container.

2. **Unit tests** — run directly:

```bash
make test
```

3. **E2e** — use the **`run_e2e`** MCP tool (server: **`sippy-dev`**). Pass **`bigquery_credentials_file`** when cred env vars are unset. E2e requires Podman/Docker and **does not work inside the devcontainer** — run it on the host.

E2e log: **`sippy-dev-logs/run_e2e.log`**. Timeouts: **`mcp/server.py`**.
12 changes: 12 additions & 0 deletions .claude/commands/sippy-dev-app.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions .claude/commands/sippy-dev-frontend.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions .claude/commands/sippy-dev-migrate.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions .claude/commands/sippy-dev-regression-cache.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions .claude/commands/sippy-dev-serve.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading