Skip to content

Add start-hackbot skill - #6392

Open
sylvestre wants to merge 2 commits into
mozilla:masterfrom
sylvestre:feat/start-hackbot-skill
Open

Add start-hackbot skill#6392
sylvestre wants to merge 2 commits into
mozilla:masterfrom
sylvestre:feat/start-hackbot-skill

Conversation

@sylvestre

Copy link
Copy Markdown
Contributor

A Claude Code skill documenting how to start the hackbot services locally: the API (hackbot-api), the web UI (hackbot-ui), and the pulse listener, plus a quick stub-backed UI demo and a recipe for validating alembic migrations against a throwaway Postgres.

A Claude Code skill documenting how to start the hackbot services locally:
the API (hackbot-api), the web UI (hackbot-ui), and the pulse listener, plus
a quick stub-backed UI demo and a recipe for validating alembic migrations
against a throwaway Postgres.
@sylvestre
sylvestre requested a review from a team as a code owner July 27, 2026 13:41
Copilot AI review requested due to automatic review settings July 27, 2026 13:41

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a Claude Code skill document for running Hackbot locally (hackbot-api, hackbot-ui, and the pulse listener), including a “quick local UI demo” and an Alembic migration validation recipe.

Changes:

  • Introduces .claude/skills/start-hackbot/SKILL.md with local run instructions for hackbot-api, hackbot-ui, and hackbot-pulse-listener.
  • Documents a stub-backed UI demo flow and related environment variables.
  • Adds a step-by-step method to validate Alembic migrations against a throwaway local Postgres using offline SQL.
Comments suppressed due to low confidence (3)

.claude/skills/start-hackbot/SKILL.md:37

  • The described stub API supports an author filter and uses /runs/{id} in the path, but hackbot-api’s list-runs endpoint only supports agent/status plus limit/offset, and the run identifier is consistently called run_id. Keeping these aligned will prevent confusion when swapping between the stub and real API.
1. **Stub API** — a small stdlib HTTP server that serves `GET /agents`, `GET /runs`
   (honoring `agent`/`status`/`author`/`limit`/`offset`), and `GET /runs/{id}` with seeded
   fake runs. It lives at `services/hackbot-ui/dev/stub_api.py`; run it on :8080:

.claude/skills/start-hackbot/SKILL.md:68

  • This section gives concrete instructions for implementing an authentication bypass in committed code paths. Even with the warning, documenting a bypass pattern here increases the risk it gets cargo-culted or accidentally shipped. Since hackbot-ui has no built-in bypass, it’s safer to document only the supported approach (configure a local Google OAuth client).
**Skipping Google OAuth locally.** The codebase has no auth bypass. If you don't want to
configure an OAuth client for a throwaway demo, add a temporary, env-gated bypass yourself
(and never commit it): short-circuit `middleware.ts` and `getAuthedEmail()` in `lib/session.ts`
when a `DEV_AUTH_EMAIL` env var is set, and fall back to `NEXT_PUBLIC_DEV_AUTH_EMAIL` for the
client identity in `components/RecentRuns.tsx`. Because they key off env vars that are unset in
production, they stay inert there — but keep them out of committed branches.

.claude/skills/start-hackbot/SKILL.md:70

  • Using pkill -f is overly broad and can terminate unrelated processes (including other Next.js dev servers). It’s safer to instruct stopping via Ctrl+C in the terminals running the stub/UI.
Stop: `pkill -f stub_api.py; pkill -f "next dev"`.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .claude/skills/start-hackbot/SKILL.md Outdated

Pick the path that matches the request:

- **"Try the UI / see the dashboard" without GCP creds** → [Quick local UI demo](#quick-local-ui-demo). Fastest; no Cloud SQL / GCP / Google OAuth needed.
Comment on lines +35 to +41
1. **Stub API** — a small stdlib HTTP server that serves `GET /agents`, `GET /runs`
(honoring `agent`/`status`/`author`/`limit`/`offset`), and `GET /runs/{id}` with seeded
fake runs. It lives at `services/hackbot-ui/dev/stub_api.py`; run it on :8080:

```bash
python3 services/hackbot-ui/dev/stub_api.py # listens on 127.0.0.1:8080
```
Comment on lines +60 to +62
Open http://localhost:3000 and sign in with a `@mozilla.com` Google account. The stub then
backs every run the UI reads (filtering, "My runs" vs "All runs", the author column, etc.).

- Drop the auth-bypass recipe: point at registering a throwaway OAuth client
  instead, so nothing here nudges anyone toward shipping a bypass.
- Stop claiming the quick demo needs no Google OAuth; it does.
- Describe the demo in terms of what the stub actually serves (read-only GETs),
  and note HACKBOT_DEV_USER plus what to do if the stub isn't in the checkout.
- Replace the broad pkill with Ctrl+C, and use {run_id} for the path param.
- Run prettier over the file.

The UI talks only to the API (server-side, via `X-API-Key`); the API owns the DB, GCS, and Cloud Run Jobs.

Pick the path that matches the request:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we have it as a Docker Compose for this, all we need it to fill a .env.example file with real values? That would simplify the instructions. I fill file it as a followup.


1. **Stub API** — a small stdlib HTTP server that serves `GET /agents`, `GET /runs`
(honoring `agent`/`status`/`author`/`limit`/`offset`), and `GET /runs/{run_id}` with seeded
fake runs. It lives at `services/hackbot-ui/dev/stub_api.py`; run it on :8080:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This depends on #6391

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants