incident-to-regression

Convert incident artifacts into deterministic regression fixtures and CI-ready outputs. Use when users ask to reproduce a failure, build repeatable graders, or emit junit evidence.

10 stars

Best use case

incident-to-regression is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Convert incident artifacts into deterministic regression fixtures and CI-ready outputs. Use when users ask to reproduce a failure, build repeatable graders, or emit junit evidence.

Teams using incident-to-regression should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/incident-to-regression/SKILL.md --create-dirs "https://raw.githubusercontent.com/Clyra-AI/gait/main/.agents/skills/incident-to-regression/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/incident-to-regression/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How incident-to-regression Compares

Feature / Agentincident-to-regressionStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Convert incident artifacts into deterministic regression fixtures and CI-ready outputs. Use when users ask to reproduce a failure, build repeatable graders, or emit junit evidence.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# Incident To Regression

Use this skill to transform an observed incident into deterministic regression checks.

## Gait Context

Gait is the offline-first policy-as-code runtime for AI agent tool calls. It enforces tool-boundary policy, emits signed and verifiable evidence artifacts, and supports deterministic regressions.

Use this skill when:
- incident triage needs repeatable regression fixtures
- CI gate failures need deterministic reproduction
- evidence outputs must be generated from Gait artifacts

Do not use this skill when:
- Gait CLI is unavailable in the environment
- no Gait run/pack artifact or run identifier is available as input

## Required Inputs

- `run_source`: run id, runpack path, or equivalent source accepted by `gait capture` / `gait regress add` / `gait regress init`.
- `workdir`: writable working directory where fixtures and outputs will be created.

## Workflow

1. Resolve `run_source` before changing directories:
   - keep identifiers unchanged (for example run ids)
   - if `run_source` is a relative file path, normalize to absolute path
   - `run_source_ref="$(python3 -c 'import os,sys; v=sys.argv[1]; print(os.path.abspath(v) if os.path.exists(v) else v)' <run_source>)"`
2. Enter the declared working directory before generating artifacts:
   - `mkdir -p <workdir> && cd <workdir>`
3. Create deterministic fixture from the incident source:
   - explicit path: `gait capture --from <run_source_ref> --json`
   - then `gait regress add --from ./gait-out/capture.json --json`
   - legacy fallback: `gait regress init --from <run_source_ref> --json`
4. Parse fields from the fixture-creation output and record them:
   - `ok`, `run_id`, `fixture_name`, `fixture_dir`, `config_path`, `next_commands`
5. Execute regression graders:
   - `gait regress run --json`
6. If CI evidence is needed, rerun with JUnit output:
   - `gait regress run --json --junit <junit_path>`
7. Return a concise summary with:
   - source identifier
   - fixture directory and config path
   - status and failed grader count
   - evidence output paths

## Safety And Portability Rules

- Use CLI outputs only; do not infer grader results from config text.
- Treat non-zero regress exit codes as actionable outcomes, not warnings.
- Do not assume repository-specific fixture paths.
- Keep paths relative to the active workspace unless the user explicitly asks for absolute paths.

## Usage Example

```bash
run_source_ref="$(python3 -c 'import os,sys; v=sys.argv[1]; print(os.path.abspath(v) if os.path.exists(v) else v)' run_demo)"
mkdir -p ./regress-workdir && cd ./regress-workdir
gait demo --json
gait capture --from "${run_source_ref}" --json
gait regress add --from ./gait-out/capture.json --json
mkdir -p ./artifacts
gait regress run --json --junit ./artifacts/junit.xml
```

Expected result:
- fixture creation output includes `ok=true` and a `fixture_dir`
- run output includes stable `status` and grader failure details
- JUnit file exists at `./artifacts/junit.xml`

## Validation Example

```bash
mkdir -p ./regress-workdir && cd ./regress-workdir
gait demo --json
gait capture --from run_demo --json
gait regress add --from ./gait-out/capture.json --json
mkdir -p ./artifacts
gait regress run --json > ./artifacts/regress_result.json
python3 - <<'PY'
import json
from pathlib import Path
p = json.loads(Path('./artifacts/regress_result.json').read_text(encoding='utf-8'))
assert p.get('status') in {'pass', 'fail'}
print('validated status:', p.get('status'))
PY
```

Expected result:
- script prints `validated status: pass` or `validated status: fail`

Related Skills

We are still matching the closest adjacent skills for this page. In the meantime, continue through the full directory.