npm package: @leveragent/e2e-testing
Description: Install-and-run CLI assistant package that executes a startup skill to set up Cypress/Cucumber style e2e testing in the current repository.
Latest version: 0.1.12

# Leveragent Add Cypress

Install-and-run CLI assistant package that executes a startup skill to set up Cypress/Cucumber style e2e testing in the current repository.

## Quick Start (Published Package)

Run this in the target repository (the one you want to modify):

```bash
npx @leveragent/add-cypress
```

The command runs in your current working directory, so the assistant tools operate on the actual repository where you invoked `npx`.

The startup skill markdown is loaded from the package's bundled `skills/` folder.

## Prerequisites

- GitHub Copilot CLI installed and authenticated
- Node.js 22+ (required by current Copilot CLI runtime dependencies)

Authentication can come from either:

- A logged-in Copilot CLI session (`copilot auth login`)
- A token environment variable (`GITHUB_TOKEN`, `GH_TOKEN`, or `COPILOT_SDK_AUTH_TOKEN`)

## Local Development Setup

```bash
nvm install
nvm use
npm install
```

## Run

```bash
npm start
```

Then chat in the terminal and use `exit` to quit.

If auth is missing or invalid, the app now exits early with a clear message instead of failing after the first prompt.

## Commands

- `/help` show available commands
- `/status` show active session + auth status
- `/models` list first 20 available models
- `/new` start a fresh session
- `exit` or `quit` stop the assistant

## Optional environment variables

- `COPILOT_MODEL` (default: `gpt-5`)
- `COPILOT_REASONING_EFFORT` (`low` | `medium` | `high` | `xhigh`, default: `high`)
- `COPILOT_RESUME_LAST` (`true`/`false`, default: `true`)
- `COPILOT_REQUEST_TIMEOUT_MS` (default: `60000`)

When `COPILOT_RESUME_LAST=true`, the app resumes your previous session automatically to preserve context and continuity.

If you see timeout errors like `Timeout after 60000ms waiting for session.idle`, increase `COPILOT_REQUEST_TIMEOUT_MS`.

## Features

- Streaming assistant output
- Interactive prompt loop
- Resumable sessions with persistent context
- Inline agent follow-up questions via `ask_user`
- Custom `get_weather` tool (mocked weather data)
- Built-in `list_dir` and `glob_files` tools for repository discovery
- Built-in `read_file` tool for UTF-8 file reads within the working directory
- Built-in `write_file` tool for UTF-8 file writes within the working directory
- Built-in `search_code`, `go_to_definition`, and `find_references` tools for code navigation
- Built-in `run_command` tool for allowlisted project commands (`npm run check|test|build|lint`, `npm test`)
- Built-in git context tools: `git_status`, `git_diff`, `git_log`
- System prompt customization

## Built-in tools

- `get_weather`
  - Returns mocked weather details for a city.
- `list_dir`
  - Lists files/directories under a workspace path with depth, hidden-file, and result limits.
- `glob_files`
  - Finds files using glob patterns (for example `src/**/*.ts`) scoped to the workspace.
- `read_file`
  - Reads UTF-8 text from a file in the current working directory tree.
  - Rejects paths outside the working directory.
  - Uses a size limit (`maxBytes`, default `200000`) to avoid unexpectedly large reads.
- `write_file`
  - Writes UTF-8 text to a file in the current working directory tree.
  - Rejects paths outside the working directory.
  - Creates parent directories as needed.
  - Supports `overwrite` (default `true`).
- `search_code`
  - Searches text or regex patterns across workspace files with optional glob filtering and result caps.
- `go_to_definition`
  - Heuristically finds likely declaration sites (`function`, `class`, `interface`, `type`, `enum`, variables, methods).
- `find_references`
  - Finds symbol references across code-like files.
- `run_command`
  - Executes only allowlisted local commands for validation.
  - Allowed: `npm run check`, `npm run test`, `npm run build`, `npm run lint`, `npm test`.
- `git_status`
  - Returns `git status --short --branch` output.
- `git_diff`
  - Returns unstaged or staged diff output, optionally scoped to a file.
- `git_log`
  - Returns recent commit history in one-line format.

## Important note

If you see `ERR_UNKNOWN_BUILTIN_MODULE: node:sqlite`, switch to Node 22+:

```bash
nvm use 22
```