# Run Parallel CI Checks Before an Agent Review (https://www.shipfox.io/docs/how-to/recipes/parallel-ci-agent-review)

Description: Run lint and tests in parallel, then start an agent review only after both checks pass.

Use this recipe when lint and tests can run independently, but an agent review
should start only after both checks pass.

## Before you begin [#before-you-begin]

You need:

* An integration connection for GitHub and its slug. Find the slug in
  **Settings → Integrations**.
* A Node.js repository with `lint` and `test` scripts.

## Add the workflow [#add-the-workflow]

Create `.shipfox/workflows/parallel-ci-review.yml`. Replace `github_acme` with
the slug of your GitHub integration connection. This is a complete workflow:

```yaml
# yaml-language-server: $schema=https://www.shipfox.io/docs/workflow.schema.json
name: Parallel CI and agent review
runner: shipfox

triggers:
  on_push:
    source: github_acme # Replace with the slug of your GitHub integration connection.
    event: push

jobs:
  lint:
    steps:
      - run: npm ci
      - run: npm run lint

  test:
    steps:
      - run: npm ci
      - run: npm test

  review:
    needs: [lint, test]
    steps:
      - prompt: Review the repository for likely bugs and missing test coverage.
```

Commit and push the file to the project's default branch. Wait for **Parallel
CI and agent review** to sync in the project's **Workflows** tab.

## Verify the job graph [#verify-the-job-graph]

Push another commit and open the new run:

1. Confirm that `lint` and `test` start without waiting for each other.
2. Confirm that `review` starts only after both checks pass.
3. Open the agent step and confirm that it returns a repository review.
4. Make one check fail and confirm that Shipfox skips `review`.

Each job receives a fresh checkout. The review job does not receive the lint or
test logs. Use declared [outputs](https://www.shipfox.io/docs/how-to/author-workflows/pass-outputs) for small
values. Store reports and other artifacts outside the job checkout.

The extra checkout and dependency install in each job cost time. In return,
independent checks can use separate runners and finish sooner. See [Jobs and
steps](https://www.shipfox.io/docs/understand/jobs-and-steps) for the mental model and the [workflow
schema](https://www.shipfox.io/docs/reference/workflow-schema#job-fields) for exact dependency fields.