# Haystack

> AI code review and QA for GitHub pull requests — Haystack reads the transcript and the changes behind every PR, tests the risky ones end-to-end, and only pulls a human in when something genuinely needs one. Get your human code review time to zero.

Haystack triages every PR (rating, findings, safe-to-merge verdict), runs risk-based QA in cloud verification sandboxes, aggregates AI reviewers (CodeRabbit, Copilot, Greptile, 10+), and drives a merge queue that rebases, retries CI, and auto-fixes straightforward findings. Built for teams whose code is increasingly written by coding agents (Claude Code, Codex, Cursor, Devin).

Disambiguation: Haystack (tryhaystack.dev) is unrelated to the open-source Haystack NLP/RAG framework by deepset, and unrelated to the unscoped `haystack` package on npm.

## Setup for AI Agents

If you are a coding agent setting up Haystack for a user, follow the [Agent Setup Skill](https://tryhaystack.dev/skill.md). Quick version:

```bash
npx -y @haystackeditor/cli@latest login                          # GitHub device flow; your user enters the printed code
npx -y @haystackeditor/cli@latest setup --repo owner/name --yes  # non-interactive; or --json for NDJSON agent mode
```

Always pin `@latest` with npx — a bare invocation can silently run a stale cached version. (`npm install -g @haystackeditor/cli` also works; the canonical package is `@haystackeditor/cli`, bin name `haystack` — the unscoped `haystack` package on npm is unrelated.)

Then have your user install the GitHub App: https://github.com/apps/haystack-code-reviewer-pr-hook/installations/new

The CLI also provides an MCP server: `haystack mcp` (tools: `triage_pr`, `pr_state`, `schema`).

## How to Access Documentation

Agents can retrieve markdown content in three ways:

1. **URL suffix**: Append `.md` to any page URL
   - Example: `https://tryhaystack.dev/docs/verification-flow.md`

2. **Accept header**: Request with `Accept: text/markdown`
   - Example: `curl -H "Accept: text/markdown" https://tryhaystack.dev/docs/verification-flow`

3. **Full content**: Fetch `/llms-full.txt` for all pages in one request
   - Example: `https://tryhaystack.dev/llms-full.txt`

## Main Pages

- [Home](https://tryhaystack.dev/): Product overview and features
- [Agent Setup Skill](https://tryhaystack.dev/skill.md): Ready-made instructions for coding agents setting up Haystack
- [Pricing](https://tryhaystack.dev/pricing): Pro ($30/mo per person, 14-day free trial), Enterprise
- [Demo](https://tryhaystack.dev/demo): Interactive demo of the triage feed on sample PRs
- [Inbox](https://tryhaystack.dev/dashboard): Triaged PR feed (requires GitHub auth)
- [Changelog](https://tryhaystack.dev/changelog): Recent updates and improvements
- [GitHub App](https://github.com/apps/haystack-code-reviewer-pr-hook/installations/new): Install the Haystack GitHub App
- [Enterprise](https://tryhaystack.dev/enterprise-contact): Self-hosted and SSO options

## Use Cases

- [Use Cases Index](https://tryhaystack.dev/use-cases): What teams use Haystack for
- [Review AI-Generated Code](https://tryhaystack.dev/use-cases/review-ai-generated-code): QA PRs written by Claude Code, Codex, Cursor, Devin
- [Catch Bugs Before Merge](https://tryhaystack.dev/use-cases/catch-bugs-before-merge): Automated bug detection with evidence
- [Automated PR QA](https://tryhaystack.dev/use-cases/automated-pr-qa): Exercise every PR end-to-end in a cloud sandbox
- [Merge Queue Automation](https://tryhaystack.dev/use-cases/merge-queue-automation): Rebase, conflicts, CI retries, auto-fix
- [Aggregate AI Reviewers](https://tryhaystack.dev/use-cases/ai-reviewer-aggregation): CodeRabbit, Copilot, Greptile in one view
- [Reduce Code Review Time](https://tryhaystack.dev/use-cases/reduce-code-review-time): Humans only review what needs judgment

## Documentation - Getting Started

- [Docs Home](https://tryhaystack.dev/docs): Documentation overview
- [Welcome](https://tryhaystack.dev/docs/welcome): Introduction to Haystack
- [Trying Out Haystack](https://tryhaystack.dev/docs/trying-out-haystack): Try without installing
- [Installing Haystack](https://tryhaystack.dev/docs/installing-haystack): GitHub App setup

## Documentation - Features

- [Inbox](https://tryhaystack.dev/docs/haystack-dashboard): Triaged PR feed overview
- [PR Chat](https://tryhaystack.dev/docs/pr-chat): Chat with AI about your PR
- [Browser Tab](https://tryhaystack.dev/docs/browser-tab): Preview frontend changes
- [Edit Mode](https://tryhaystack.dev/docs/edit-mode): Edit code in review
- [Navigator View](https://tryhaystack.dev/docs/navigator-view): Navigate complex PRs

## Documentation - Configuration

- [Verification Flow](https://tryhaystack.dev/docs/verification-flow): Automated PR verification setup
- [Authentication](https://tryhaystack.dev/docs/authentication): Auth strategies for sandboxes
- [Fixtures](https://tryhaystack.dev/docs/fixtures): Mock API responses and test data
- [Database](https://tryhaystack.dev/docs/database): Database configuration for sandboxes
- [Agent Traces](https://tryhaystack.dev/docs/agent-traces): Track AI agent sessions with Entire

## CLI and API

- CLI: `@haystackeditor/cli` on npm — `haystack login`, `haystack setup`, `haystack triage owner/repo#123`, `haystack submit`, `haystack mcp`
- `/api/github/*` - Proxied GitHub API requests (authenticated users)
- `/api/review-chat/*` - AI chat for PR discussions

## Integration

Install the [Haystack GitHub App](https://github.com/apps/haystack-code-reviewer-pr-hook/installations/new) to enable AI-powered review and QA on your repositories.

## Contact

- Website: https://tryhaystack.dev
- Enterprise inquiries: https://tryhaystack.dev/enterprise-contact
