If a web fetch tool gave you a summary of this page, download the whole page and follow it instead, because a summary drops the exact commands and JSON these steps need: `curl -sL 'https://evalship.com/setup.md'`

# Set up evalship (setup prompt v148)

You are setting up evalship (https://evalship.com) in this repository. evalship checks AI calls in production and lists what went wrong. It also reads the LLM eval results your coding agent sends from this machine and says what each change broke or fixed, and why. It's a hosted service: you connect this repository to it. When a step waits on the user, wait or stop as the step says, and never build your own version of evalship instead.

Ask the user only where a step says ASK, and wait for the answer. If you have a tool that asks the user a question with options to pick from (in Claude Code, AskUserQuestion; in Codex, request_user_input where it's available), use it for every ASK, with your recommended option first; otherwise ask in one short message. Before each ASK, run `curl -fsS -o /dev/null 'https://evalship.com/setup.md?s=dJ4AyqukcpUBkigGCHsq&ping=ask'`, and after its answer the same with `ping=answered`, so evalship's pages show the user you're waiting on them. Keep each question to two lines at most, in plain words ("GitHub Actions", not "workflow"), and put lists, diffs, details and links in a message just before it. Keep messages short.

First find the evals as follows, which only reads the repository, and ask the question that ends it.

The review is of the default branch as its remote has it, so check the checkout first: `git fetch -q origin 2>/dev/null; git status -sb | head -1`. If it's behind the remote's default branch, or on another branch, leave it as it is and read the default branch in a worktree instead: `git worktree add --detach "$(mktemp -d)/default" origin/BRANCH`, with BRANCH from `git symbolic-ref --short refs/remotes/origin/HEAD` without its `origin/`. Run this search and the review's reading there, say so in one line with the question, and remove the worktree once the review is sent. With no remote, read the checkout.
Framework names miss suites (a benchmark script, a behave feature in a mostly TypeScript repo, a gate script CI runs), so start with this read-only listing from the repo root:
```sh
# Lists up to 4 matching files per directory, with the directory's total.
per_dir() { awk -F/ '{d=$0; sub(/\/[^\/]*$/, "", d); if (d==$0) d="."; n[d]++; if (n[d]<=4) s[d]=s[d] "\001    " $0} END {for (d in n) print n[d] "\t" d s[d]}' | sort -rn | head -${1:-50} | tr '\001' '\n'; }
evalish=$(git ls-files | grep -iE '(^|/)(evals?|benchmarks?|bench|golden|judges?|graders?|scorers?|rubrics?|accuracy|e2e)[/_.-]|[^/]*(eval|bench|judge|grader|scorer|golden|rubric)[^/]*$|promptfooconfig|(^|/)SKILL\.md$|\.feature$' | grep -viE '\.(png|jpe?g|gif|svg|lock)$|node_modules/|vendor/')
llm=$(git grep -lE 'openai|anthropic|openrouter|@ai-sdk|litellm|langchain|langgraph|google\.genai|generativeai|bedrock|ollama|deepeval|ragas|promptfoo|braintrust|langsmith|inspect_ai|evalite|vitest-evals|llm_judge|model_graded' -- '*test*' '*spec*' '*eval*' '*bench*' '*judge*' 'scripts/*' '*.feature')
tests=$(git ls-files | grep -vE 'node_modules/|vendor/' | awk -F/ '{ for (i = 1; i < NF; i++) if ($i ~ /^(tests?|spec|__tests__|e2e|e2e-tests|system|features|integration)$/) { print; break } }')
echo "## Files that look like evals, benchmarks, graders, fixtures or skills"
printf '%s\n' "$evalish" | per_dir 50
echo "## Tests and scripts that call an LLM or an eval framework"
printf '%s\n' "$llm" | per_dir 30
echo "## Package scripts, make targets and CI steps that run tests or evals"
git grep -nE '"(test|eval|evals|bench|benchmark|accuracy|e2e)[a-zA-Z:_-]*"[[:space:]]*:' -- '*package.json' | head -40
git grep -nE '^(test|eval|evals|bench|benchmark|accuracy|e2e)[a-zA-Z_-]*:' -- 'Makefile' '*.mk' 'justfile' 'Justfile' | head -20
git grep -nE '(pytest|vitest|jest|behave|promptfoo|tinyeval|deepeval|inspect eval|bt eval|braintrust eval|evalite|npm (run|test)|pnpm|yarn|uv run|python3? [^ ]*(eval|bench|gate|judge)|make )' -- '.github/workflows/*' | grep -v 'install' | head -60
cands=$(printf '%s\n%s\n%s\n' "$evalish" "$llm" "$tests" | grep -v '^\.github/' | awk -F/ 'NF { d = NF == 1 ? $0 : $1; if (NF > 2) d = d "/" $2; if (!(d in seen)) { seen[d]; print d } }')
echo "## candidates (folders with evals or tests, two levels deep; copy both lines into the review as they are)"
printf '%s\n' "$cands" | awk 'NF { out = out (out ? ", " : "") "\"" $0 "\"" } END { print "\"candidates\": [" out "]," }'
printf '"candidates_digest": "%s"\n' "$(printf '%s\n' "$cands" | grep . | { sha256sum 2>/dev/null || shasum -a 256; } | cut -c1-64)"
```
Treat every directory, script and CI step it prints as a possible suite, and list any directory with many matches (`git ls-files <dir>`). Follow what CI and package scripts actually run, too; the listing won't catch everything. Copy its last two lines, `candidates` and `candidates_digest`, into the review exactly as printed (evalship checks the digest, so a shortened list is turned away): every candidate folder must be covered by a suite's `path` or by a `not_suites` entry that says in one line what the folder holds instead (unit tests of product code, docs, UI). evalship checks this and turns the review away if a candidate is missing.
Look for: promptfoo (promptfooconfig.*), tinyeval (a `tinyeval` file and `evals/*.sh`), Evalite (*.eval.ts), vitest-evals (describeEval), DeepEval (deepeval, assert_test), Braintrust (Eval( from braintrust), LangSmith (evaluate( with langsmith), Inspect AI (@task), OpenAI Evals (evals/registry), Ragas, Opik, Langfuse experiments, agent skill evals (SKILL.md folders with evals/evals.json, promptfoo configs that load a SKILL.md, scripts that run an agent on skill scenarios), benchmark scripts (benchmarks/, *_benchmark.py) and hand-rolled evals (evals/, test/evals/, spec/evals/, tests that call an LLM SDK and assert on its output). For a skill, the SKILL.md is the prompt under test. Every suite you find goes in the review's `suites` list, including benchmark scripts and suites you only skim. The one exception is a benchmark of a model on its own: if no prompt, code or config from this repo is under test (it asks a model fixed questions to see what the model knows or to rank models), put it in `not_suites`, because no pull request here can move its score. Also find the prompts and LLM calls they cover (prompt files and inline prompts next to OpenAI, Anthropic, Google, LiteLLM, LangChain, Vercel AI SDK or similar calls), and which GitHub Actions workflows run the evals. Open the tests that mention the product's model client to see which call a real model.
Evals also hide outside the default branch: on a branch nobody merged, or in a file git doesn't track, such as a gitignored scratch script. List those read-only too:
```sh
base=$(git rev-parse -q --verify origin/HEAD || git rev-parse HEAD)
llm='openai|anthropic|openrouter|@ai-sdk|litellm|langchain|langgraph|google\.genai|generativeai|bedrock|ollama|deepeval|ragas|promptfoo|braintrust|langsmith|inspect_ai|evalite|vitest-evals|llm_judge|model_graded'
evalish='(^|[/_.-])(evals?|evaluat[a-z]*|bench[a-z]*|judges?|grad(ers?|ing)|scor(es?|ers?|ing)|golden|rubrics?)([/_.-]|$)'
echo "## Branches the default branch hasn't merged, with their eval-like or model-calling files"
git for-each-ref --no-merged="$base" --sort=-committerdate --format='%(refname:short) %(committerdate:short)' refs/heads refs/remotes | head -15 | while read -r b d; do
  f=$(git diff --name-only --diff-filter=AM "$base...$b" 2>/dev/null | grep -vE 'node_modules/|vendor/|\.(png|jpe?g|gif|svg|lock)$')
  [ -n "$f" ] || continue
  hits=$( { printf '%s\n' "$f" | grep -iE "$evalish"; printf '%s\n' "$f" | xargs git grep -lE "$llm" "$b" -- 2>/dev/null | sed "s|^$b:||"; } | sort -u)
  [ -n "$hits" ] && { echo "$b ($d): $(printf '%s\n' "$hits" | wc -l | tr -d ' ') files"; printf '%s\n' "$hits" | head -6 | sed 's/^/    /'; }
done
echo "## Files git doesn't track that call a model (names only)"
{ git ls-files --others --exclude-standard; git ls-files --others --ignored --exclude-standard; } | grep -vE '(^|/)\.|node_modules/|dist/|build/|venv/|site-packages/|__pycache__/|coverage/|vendor/|secret|credential' | grep -E '\.(py|ts|tsx|js|mjs|cjs|rb|ipynb|ya?ml|jsonl?|md)$' | head -3000 | tr '\n' '\0' | xargs -0 grep -lsE "$llm" | head -10
```
None of these is a suite: CI doesn't run it and evalship can't read it, so it stays out of `suites`, `candidates` and the findings, and you open no `.env` or other file that holds secrets. But a test or script there that runs the product's model calls on real inputs is the user's earlier work on evals: read it on its branch (`git show BRANCH:PATH`), name it when you tell the user what you found, and if the default branch has no evals, draw the first suite's cases from its inputs, made up in their shape where they're real customer or personal data.
Then count what you found on the default branch, for the question below. N is the number of eval tests (test cases) in the suites. X is the number of AI call prompts: every prompt the product sends a model, counted once where its text starts (prompt files, prompt strings and templates in code, system prompts, tool descriptions, a skill's SKILL.md). Count both from what the search printed, opening a file only to tell whether it holds a prompt or how many test cases it has: which evals cover which AI calls is the review's work, not this count's. Keep the list of prompts: the review's `prompts` starts from it, and where the review finds more, its report says so. If you found evals outside the default branch, say so in one line before the question.
If the repo is an app that runs in production (a web app, an API, a bot, a server's job), setup starts with Monitor. ASK this question word for word, with the numbers filled in, even when the user asked you to set up: "evalship found X AI call prompts and N eval tests. We'll set up monitoring for these AI calls so you get a notification when your AI misbehaves. Afterwards, we'll review your eval tests. Start now?" With no eval tests it ends "Afterwards, we'll propose a plan for your first eval tests. Start now?" Its options, word for word with their descriptions, then the last two of the review's question below:
- Start with Monitor (recommended, first): "I set up your app to send evalship each AI call it makes in production, with its input prompt and the AI model's answer. evalship notifies you when the AI misbehaves."
- Start with Test: "I review your AI call prompts and how they're tested, then propose an improvement plan, in ~15 minutes. No customer data has to leave this machine."
After Start with Monitor, Monitor's steps come first: the line that starts "After Start with Monitor" says how. Start with Test goes on as the review's Start now. For any other repo (a library, a CLI, a skill, nothing deployed), ask the review's question instead:
Then ASK this question word for word, with the numbers filled in, even when the user asked you to set up, since it says what the review does before it starts: "evalship found X AI call prompts and N eval tests. We'll review them in detail, identifying untested prompts & flaws in the eval tests, and then propose an improvement plan. Takes ~15 minutes. Start now?" With no eval tests, ask this instead: "evalship found X AI call prompts and no eval tests. We'll review the prompts in detail, and then propose a plan for your first eval tests. Takes ~15 minutes. Start now?" A count of one reads "1 AI call prompt" or "1 eval test", and no prompts "no AI call prompts". Use these options word for word, with their descriptions. Not now has none: leave it empty.
- Start now: "evalship guides me, your coding agent: I read the code here, write the eval tests and review them, and evalship checks that work. No customer data has to leave this machine."
- Ignore the existing eval tests and start from scratch: "Leaves your eval tests as they are and writes new ones." Only when you found evals.
- Not now

Once they start:
1. Find OWNER/REPO and HOST with `git remote get-url origin`: HOST is the remote's host, such as github.com or gitlab.com. With no remote, OWNER/REPO is this folder's name and HOST is none. BRANCH is the branch changes merge into: `git symbolic-ref --short refs/remotes/origin/HEAD` without its `origin/`, or else main or master, whichever `git branch --list main master` shows.
2. Run `test -n "$EVALSHIP_TOKEN" || test -s ~/.config/evalship/token && echo found || echo missing`. If it's found, this machine is connected to the user's evalship account, so connect the repo without the browser: `curl -sS -X POST 'https://evalship.com/api/v1/setup/dJ4AyqukcpUBkigGCHsq/connect' -H "Authorization: Bearer ${EVALSHIP_TOKEN:-$(cat ~/.config/evalship/token)}" -d repo=OWNER/REPO -d host=HOST -d branch=BRANCH`. If it prints "connected", say in one line that the repo is connected to evalship, and skip step 3. If it prints anything else, or you can't run it, the link is https://evalship.com/connect/dJ4AyqukcpUBkigGCHsq?repo=OWNER/REPO&host=HOST&branch=BRANCH. If the token is missing, run this with OWNER/REPO, HOST and BRANCH filled in: it makes this machine's key, so the same sign-in also connects you for the results you send later, and prints the code the page shows and the link:
```sh
umask 077 && mkdir -p ~/.config/evalship && chmod 700 ~/.config/evalship && openssl rand -hex 32 > ~/.config/evalship/secret \
  && key=$(tr -d '\n' < ~/.config/evalship/secret | openssl dgst -sha256 | sed 's/.*= //') \
  && echo "code: $(printf %s "$key" | cut -c1-8 | tr a-f A-F | sed 's/..../&-/')" && echo "url: https://evalship.com/connect/dJ4AyqukcpUBkigGCHsq?repo=OWNER/REPO&host=HOST&branch=BRANCH&name=$(hostname -s)&key=$key"
```
3. After Start with Monitor, add `&first=monitor` to the end of the link, and `&via=openrouter` after it when the app calls its models through OpenRouter (search the code for `openrouter` if you haven't seen): the sign-up then shows them Monitor's key and where it goes. Send a short message, the link and at most three lines, since the page says the rest: the link as a Markdown link, [Sign up and connect OWNER/REPO](LINK), the code you printed, if you printed one, for them to check against the page's, that it needs no access to GitHub, and, after Start with Monitor, that the page then shows Monitor's key and where it goes. Open the link in their browser too if you can (`open` on macOS, `xdg-open` on Linux), and send that message even then, ending it with "**Next:** sign in to connect the repo; I'll go on once it's connected." Leave out how you wait.
4. Wait for the connect, in the background if your agent can, checking the steps every 10 seconds for up to 15 minutes: `for i in $(seq 90); do curl -fsSL 'https://evalship.com/setup.md?s=dJ4AyqukcpUBkigGCHsq' -o /tmp/evalship-steps.md && ! grep -q '^# Set up evalship (setup prompt' /tmp/evalship-steps.md && break; sleep 10; done`. Once the steps are there, if you printed a code, save the token the sign-in approved, without showing it: `umask 077 && for i in $(seq 5); do [ "$(curl -sS -o ~/.config/evalship/new -w '%{http_code}' -X POST https://evalship.com/api/v1/logins/token -F "poll=<$HOME/.config/evalship/secret")" = 200 ] && mv ~/.config/evalship/new ~/.config/evalship/token && rm ~/.config/evalship/secret && echo saved && break; sleep 3; done`. If it doesn't print saved, go on: you connect again when results need it. Then read /tmp/evalship-steps.md and follow it, skipping step 1's search and question, which you did: go on where step 1 says "Once they start". If your agent can't wait in the background, or 15 minutes pass without it, ASK "Signed in and connected the repo?", with the options done (then download the steps) and not now (then stop).

