Agentclash ci release gate

From agentclash/agentclash · View interactive version

Agentclash ci release gate is an AI agent skill from the GitHub repository agentclash/agentclash. Use when wiring AgentClash manifest-based CI gates, deciding whether a PR should run AgentClash, resolving baselines, running `agentclash ci run`, interpreting gate exit codes, collecting CI artifacts, or configuring regression promotion policy in GitHub Actions.

How to use this skill

Skill file

AgentClash CI Release Gate

Purpose

Wire an AgentClash candidate build/deployment into a repo-tracked CI manifest, compare it against a baseline run, and turn the release gate verdict into CI status.

Use When

Do Not Use When

Environment

Use hosted production by default:

export AGENTCLASH_API_URL="https://api.agentclash.dev"
export AGENTCLASH_TOKEN="<token>"
export AGENTCLASH_WORKSPACE="<workspace-id>"

In GitHub Actions, pass tokens through secrets or the composite action inputs. Do not print tokens. ci run exits with code 10 and a JSON error envelope when workspace context is missing, so set AGENTCLASH_WORKSPACE, pass --workspace, or use saved CLI workspace config.

Manifest Shape

Create a sample with:

agentclash ci init .agentclash/ci.yaml
agentclash ci init .agentclash/ci.yaml --force

The CLI sample manifest is:

version: 1
trigger:
  paths:
    - .agentclash/agent.json
    - prompts/**
    - tools/**
  labels:
    - agentclash/eval
candidate:
  build:
    agent_build_id: 00000000-0000-0000-0000-000000000001
    spec_file: .agentclash/agent.json
  deployment:
    name: pr-candidate
    runtime_profile_id: 00000000-0000-0000-0000-000000000002
    provider_account_id: 00000000-0000-0000-0000-000000000003
    model: gpt-5.5
evaluation:
  challenge_pack_version_id: 00000000-0000-0000-0000-000000000005
  input_set_id: 00000000-0000-0000-0000-000000000006
  regression_suites:
    - 00000000-0000-0000-0000-000000000007
baseline:
  run_id: 00000000-0000-0000-0000-000000000008
  refresh: manual
  max_age_days: 30
gate:
  fail_on: regression
regressions:
  promote_failures: proposed

Exact fields the current CLI parses:

Important gate fidelity note: today ci run posts baseline_run_id, candidate_run_id, and optional run-agent IDs to /v1/release-gates/evaluate. It does not pass gate.fail_on, does not load gate.policy_file, and has no --fail-on or --policy-file flag. The backend normalizes an empty policy to the default release gate policy. Do not claim manifest gate fields customize evaluation until the CLI source wires that behavior.

Validation Commands

Validate locally first:

agentclash ci validate .agentclash/ci.yaml
agentclash ci validate .agentclash/ci.yaml --json

Use remote validation when workspace credentials are available:

agentclash ci validate .agentclash/ci.yaml --remote --json

Structured validate output includes:

{
  "path": ".agentclash/ci.yaml",
  "valid": true,
  "manifest": {},
  "remote": {
    "workspace_id": "<WORKSPACE_ID>",
    "valid": true,
    "checks": [
      {
        "field": "candidate.build.agent_build_id",
        "resource": "agent_build",
        "id": "<AGENT_BUILD_ID>",
        "valid": true,
        "code": "ok",
        "message": "agent build is accessible in the selected workspace"
      }
    ]
  }
}

Remote validation checks the agent build, runtime profile, provider account, model alias, challenge pack version, input set, regression suites, regression cases, and baseline compatibility. API failures that cannot be reduced to a field problem appear as remote API error: ....

Should Run

Use this before spending hosted evaluation budget:

agentclash ci should-run --manifest .agentclash/ci.yaml --base origin/main --head HEAD --json
agentclash ci should-run --manifest .agentclash/ci.yaml --changed-file prompts/refund.md --labels agentclash/eval --json

--changed-file may be repeated. --labels accepts comma-separated or repeated values. If changed files are omitted and refs are present, the CLI derives files with git diff --name-only --diff-filter=ACDMRTUXB <base>...<head>. Ref defaults can come from AGENTCLASH_CI_BASE, GITHUB_BASE_REF as origin/<base>, AGENTCLASH_CI_HEAD, GITHUB_SHA, and HEAD when a base is set.

JSON output shape:

{
  "path": ".agentclash/ci.yaml",
  "should_run": true,
  "reason": "changed files matched trigger.paths",
  "changed_files": ["prompts/refund.md"],
  "labels": ["agentclash/eval"],
  "checked_path_globs": ["prompts/**"],
  "checked_labels": ["agentclash/eval"],
  "matched_paths": [{"pattern": "prompts/**", "file": "prompts/refund.md"}],
  "matched_labels": ["agentclash/eval"]
}

The decision is an OR: matched paths or matched labels make should_run: true. Reasons are exactly:

Baseline Resolution

Resolve and print the exact baseline before running the gate:

agentclash ci baseline --manifest .agentclash/ci.yaml --json

For baseline.run_id, strategy is locked_run and source is baseline.run_id. The run must be in the selected workspace, completed, compatible with evaluation.challenge_pack_version_id and optional evaluation.input_set_id, and within baseline.max_age_days when set. baseline.run_agent_id is resolved against that run when present.

For baseline.deployment_id, strategy is deployment_latest_completed and source is baseline.deployment_id. The CLI selects the newest completed compatible run whose participant used that deployment and warns that deployment baselines move over time. Prefer baseline.run_id for PRs.

Refresh next actions are:

Run The Gate

Run the manifest workflow:

agentclash ci run --manifest .agentclash/ci.yaml --json --artifact-dir agentclash-artifacts
agentclash ci run --manifest .agentclash/ci.yaml --json --summary-file agentclash-summary.md
agentclash ci run --manifest .agentclash/ci.yaml --follow --timeout 30m --poll-interval 5s

Flags:

ci run does this in order: validate local manifest, remote-validate resource IDs, create a build version from candidate.build.spec_file, mark it ready, create a deployment, resolve the baseline, create a run with official_pack_mode: "full" plus optional regression suites/cases, wait for completion, resolve the candidate run agent, optionally fetch scorecard and comparison when reports are enabled, evaluate the release gate, optionally promote regression failures, then write reports.

Structured output includes:

{
  "manifest_path": ".agentclash/ci.yaml",
  "workspace_id": "<WORKSPACE_ID>",
  "remote_validation": {},
  "candidate": {
    "agent_build_id": "<AGENT_BUILD_ID>",
    "build_version_id": "<BUILD_VERSION_ID>",
    "deployment_id": "<DEPLOYMENT_ID>",
    "run_id": "<RUN_ID>",
    "run_agent_id": "<RUN_AGENT_ID>",
    "run_status": "completed",
    "run_url": "<URL>",
    "deployment_name": "pr-candidate",
    "ci_metadata": {}
  },
  "baseline_resolution": {},
  "baseline": {
    "run_id": "<BASELINE_RUN_ID>",
    "run_agent_id": "<BASELINE_RUN_AGENT_ID>",
    "status": "completed"
  },
  "release_gate": {},
  "gate_verdict": "pass",
  "failure_reason": "",
  "reports": {},
  "regression_promotions": {},
  "exit_code": 0
}

Exit codes are exact:

Successful terminal run statuses are completed, succeeded, and success. Failed terminal statuses include failed, error, errored, canceled, cancelled, aborted, timed_out, timeout, and expired.

Reports And Artifacts

Reports are enabled only when --summary-file, GITHUB_STEP_SUMMARY with --github-step-summary, or --artifact-dir is set. --artifact-dir agentclash-artifacts writes:

Each artifact is wrapped in an envelope with schema_version: "2026-05-04", kind, generated_at, manifest_path, workspace_id, challenge_pack_version_id, candidate, baseline, optional gate policy identity fields, and payload.

Regression Promotion

regressions.promote_failures runs only when the gate verdict is fail. Modes:

Promotion also blocks when evaluation.regression_suites is empty, using reason no_regression_suites. It lists candidate run failures with limit=200, prefers full_executable over output_only, skips non-promotable or unsupported failures, and avoids existing cases by source_challenge_identity_id or metadata source_failure_cluster_key unless the existing case status is archived or rejected.

regression_promotions contains policy, optional case_status, created, existing, skipped, blocked, and errors. Created/existing items include suite_id, case_id, challenge_identity_id, challenge_key, failure_cluster_key, status, and created.

GitHub Action

The repo-local composite action is .github/actions/agentclash-ci. Example:

name: AgentClash gate
on:
  pull_request:

jobs:
  agentclash:
    runs-on: ubuntu-latest
    permissions:
      contents: read
    steps:
      - uses: actions/checkout@v4
        with:
          fetch-depth: 0
      - id: agentclash
        uses: agentclash/agentclash/.github/actions/agentclash-ci@main
        with:
          token: ${{ secrets.AGENTCLASH_TOKEN }}
          workspace: ${{ secrets.AGENTCLASH_WORKSPACE }}
          api-url: https://api.agentclash.dev
          manifest: .agentclash/ci.yaml
          artifact-dir: agentclash-artifacts
      - uses: actions/upload-artifact@v4
        if: always() && steps.agentclash.outputs['should-run'] == 'true'
        with:
          name: agentclash-ci
          path: |
            ${{ steps.agentclash.outputs['result-file'] }}
            ${{ steps.agentclash.outputs['artifact-dir'] }}/*.json

Action inputs are exactly manifest, token, workspace, api-url, install-cli, cli-version, remote-validate, skip-if-unmatched, base, head, changed-files, labels, artifact-dir, result-file, timeout, poll-interval, follow, and default-branch.

Action outputs are exactly should-run, skip-reason, run-id, gate-verdict, exit-code, result-file, and artifact-dir.

The action exports AGENTCLASH_TOKEN, AGENTCLASH_WORKSPACE, and AGENTCLASH_API_URL, installs agentclash@<cli-version> when install-cli is true, runs ci validate with --remote by default, runs ci should-run --json, exits 0 when unmatched and skip-if-unmatched is true, then runs ci run --json --artifact-dir.

Open The Setup Pull Request

agentclash ci setup adds the local manifest and workflow to a GitHub repository through a pull request. The server uses the AgentClash GitHub App of the workspace. The app must be installed on the repository, and the caller needs the permission to manage integrations in the workspace.

Run the command from the root of the local clone. Each file goes into the repository at the same relative path.

agentclash ci validate .agentclash/ci.yaml
agentclash ci setup --repo <OWNER>/<REPO> --check-only --json
agentclash ci setup --repo <OWNER>/<REPO> --json

Failure Modes

Report Back Format

Manifest: <path>
Should run: <true/false + reason>
Baseline: <run-id or deployment selector + strategy>
Candidate run: <run-id>
Gate verdict: <pass|warn|fail|insufficient_evidence>
Exit code: <code + meaning>
Artifacts: <result-file and artifact-dir>
Regression candidates: <created/existing/skipped/blocked/errors>
Next command: <exact agentclash command or GitHub Actions fix>

Related Skills

Related Docs

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.