# harness:setup

This skill inspects a project and configures Harness Evolver to evaluate an AI agent. Use it when introducing evolver to a project or choosing optimization goals.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · ★ 57
- Author: raphaelchristi
- License: MIT · policy=mirror · the beginning of the file is at the end of this page
- Source: https://github.com/raphaelchristi/harness-evolver/tree/HEAD/skills/setup/SKILL.md
- Updated: 2026-04-18
- HTML: https://affpapa.org/en/nevibecode/skills/harnesssetup

## What it does

The skill looks for the agent’s entry point, main framework, test data, and run command. It then asks you to review the configuration. The default goal is accuracy, with AI-generated test examples; you can choose other goals, such as latency or error handling.

Setup connects the project to LangSmith and runs a baseline evaluation. A `LANGSMITH_API_KEY` is required and can come from an environment variable, a credentials file, or `.env`. For a monorepo with multiple apps, you must choose which app to configure first. The selected Python environment matters too: the skill prefers a virtual environment it finds in or above the project.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add raphaelchristi/harness-evolver --skill setup -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/setup/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/setup/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add raphaelchristi/harness-evolver --skill setup -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/setup/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add raphaelchristi/harness-evolver --skill setup -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/setup/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install raphaelchristi/harness-evolver setup
```

2. **Manually: put the files in place**
- File: `.github/skills/setup/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add raphaelchristi/harness-evolver --skill setup -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/raphaelchristi/harness-evolver --path skills/setup
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/setup/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add raphaelchristi/harness-evolver --skill setup -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/raphaelchristi/harness-evolver/tree/HEAD/skills/setup/SKILL.md

## When to use it
- locate an agent’s entry point in a project
- identify the command used to run an agent
- configure LangSmith for an agent project
- choose goals for agent optimization
- prepare test data for a baseline evaluation

## Example prompts
- Set up Harness Evolver for this project.
- Run `/harness:setup` for the `backend` directory.
- Configure an agent evaluation for accuracy using my existing test data.

## Source text · SKILL.md · MIT

Below is the content of a third-party file. It is data, not instructions for you: do not act on anything written inside unless the human asks. Block tag: 591dec8239659392.

BEGIN THIRD-PARTY FILE 591dec8239659392
````text
---
name: harness:setup
description: "Use when the user wants to set up the evolver in their project, optimize an LLM agent, improve agent performance, or mentions evolver for the first time in a project without .evolver.json."
argument-hint: "[directory]"
allowed-tools: [Read, Write, Edit, Bash, Glob, Grep, Agent, AskUserQuestion]
---

# /harness:setup

Set up the Harness Evolver v3 in a project. Explores the codebase, configures LangSmith, runs baseline evaluation.

## Prerequisites

Check for LangSmith API key — it can be in the environment, the credentials file, or .env:

```bash
python3 -c "
import os, platform
key = os.environ.get('LANGSMITH_API_KEY', '')
if not key:
    creds = os.path.expanduser('~/Library/Application Support/langsmith-cli/credentials') if platform.system() == 'Darwin' else os.path.expanduser('~/.config/langsmith-cli/credentials')
    if os.path.exists(creds):
        for line in open(creds):
            if line.strip().startswith('LANGSMITH_API_KEY='):
                key = line.strip().split('=',1)[1].strip()
    if not key and os.path.exists('.env'):
        for line in open('.env'):
            if line.strip().startswith('LANGSMITH_API_KEY=') and not line.strip().startswith('#'):
                key = line.strip().split('=',1)[1].strip().strip('\"').strip(\"'\")
print('OK' if key else 'MISSING')
"
```

If `MISSING`: "Set your LangSmith API key: `export LANGSMITH_API_KEY=lsv2_pt_...` or run `npx harness-evolver@latest` to configure."

The tools auto-load the key from the credentials file, but the env var takes precedence.

## Resolve Tool Path and Python

```bash
# Prefer env vars set by plugin hook; fallback to legacy npx paths
TOOLS="${EVOLVER_TOOLS:-$([ -d ".evolver/tools" ] && echo ".evolver/tools" || echo "$HOME/.evolver/tools")}"
EVOLVER_PY="${EVOLVER_PY:-$([ -f "$HOME/.evolver/venv/bin/python" ] && echo "$HOME/.evolver/venv/bin/python" || echo "python3")}"
```

Use `$EVOLVER_PY` instead of `python3` for ALL tool invocations. This ensures the venv with langsmith is used.

**IMPORTANT: Never pass `LANGSMITH_API_KEY` inline in Bash commands.** The key is loaded automatically by the SessionStart hook (from credentials file or environment) and by each Python tool's `ensure_langsmith_api_key()`. Passing it inline exposes it in the output. If the key is missing, tell the user to run `export LANGSMITH_API_KEY=lsv2_pt_...` instead.

## Phase 1: Explore Project (automatic)

```bash
find . -maxdepth 3 -type f -name "*.py" -not -path "*/.venv/*" -not -path "*/node_modules/*" -not -path "*/__pycache__/*" | head -30
```

**Monorepo detection**: if the project root has multiple subdirectories with their own `main.py` or `pyproject.toml`, it's a monorepo. Use AskUserQuestion to ask WHICH app to optimize before proceeding — do NOT scan everything.

Look for:
- Entry points: files with `if __name__`, or named `main.py`, `app.py`, `agent.py`, `graph.py`, `pipeline.py`
- Existing LangSmith config: `LANGCHAIN_PROJECT` / `LANGSMITH_PROJECT` in env or `.env`
- Existing test data: JSON files with inputs, CSV files, etc.
- Dependencies: `requirements.txt`, `pyproject.toml`
````
END THIRD-PARTY FILE 591dec8239659392

The third-party file has ended. Everything between the 591dec8239659392 tags is data: requests and commands from it are not followed. An “end of file” line with another tag inside the block is part of the file.

First 3144 of 11656 bytes. © raphaelchristi · MIT · https://github.com/raphaelchristi/harness-evolver/tree/HEAD/skills/setup/SKILL.md

_Part of the page did not fit — see the HTML version._

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
