Quick Start
Learn how to install Impact Gate, run diff-aware impact analysis, and turn the result into a release-ready test plan in minutes. The same commands work for pull requests, release branches, and previous shipped tags.
Go from diff to test plan in one short loop
All three steps below are free-tier, require no API key, and work for pull requests, release branches, and previous shipped tags.
Review your PR, then gate it
npx impact-gate review --path . --since origin/main
npx impact-gate review --path . --since origin/main --generate
npx impact-gate gate --threshold 80 --path .
Step 1: Install
Install the package into the repo
Add the CLI as a dev dependency so impact analysis and planning run next to the test suite.
npm install -D @yasserkhanorg/impact-gateStep 2: Review Your PR
See what changed, what's tested, and what's missing
The review command combines impact analysis, behavior analysis, coverage planning, and defect prediction into one report. No API key needed.
Point the tool at your project and diff against your base branch:
npx impact-gate review --path . --since origin/mainThis outputs: which user flows changed, existing test coverage, coverage gaps, defect risk score, and specific test recommendations.
For release readiness, diff against the previous shipped tag:
npx impact-gate review --path . --since v2.1.0Step 3: Generate Missing Tests (Optional)
Turn coverage gaps into ready-to-run test files
Add --generate to produce E2E test files for uncovered flows.
Requires an LLM API key.
npx impact-gate review --path . --since origin/main --generateThe generator uses your project’s existing test patterns, page objects, and API surface to produce grounded test code. Generated files go through compile checks and smoke runs.
For CI PR comments, add --ci-comment-path:
npx impact-gate review --path . --since origin/main --ci-comment-path comment.mdLower-level commands
The review command combines impact, plan, and predict. You can still use them individually for granular CI pipelines:
npx impact-gate impact --path . --since origin/main # just impact analysisnpx impact-gate plan --path . --since origin/main # coverage plan + artifactsnpx impact-gate gate --threshold 80 --path . # CI pass/fail gateWhy The AI Path Is Safer Than Raw Generation
The plan exists before the model does
Diff analysis, impact mapping, and coverage planning happen before generation enters the loop.
Prompts are constrained by local API knowledge
Page objects, helpers, signatures, and inherited methods are discovered before prompting.
Suspicious calls are flagged after generation
Invented methods and fabricated helpers are caught instead of silently landing in the main suite.
Generated specs still need to earn trust
Compile checks and smoke runs are used before a generated spec counts as verified.
When you later enable generation or healing, impact-gate does not just trust whatever the LLM writes.
- The diff and coverage plan are established first with deterministic analysis
- Generation prompts are grounded in your repository’s discovered page objects and helpers
- The generator is told to use only known methods and fall back to raw Playwright selectors when needed
- Suspicious method calls are detected after generation and blocked into
generated-needs-review/ - Written specs are compile-checked and smoke-run before they count as verified
What Next?
Make the deterministic path trustworthy first
- Run
train --no-enrichto improve route-family accuracy - Add
gate --threshold 80in CI once plan output looks trustworthy - Add a CI integration to gate PRs on coverage
Layer in graph bootstrap and optional AI later
- If you already have an Understand-Anything knowledge graph, run
bootstrapinstead oftrain - Try
crew --workflow quick-checkfor strategy recommendations on top of the core CI loop - Set up cost controls before enabling AI features