Development
Prerequisites
- Node.js >= 20
- npm or yarn
- Git
Setup
git clone https://github.com/yasserfaraazkhan/impact-gate.gitcd impact-gatenpm installnpm run buildBuild System
The project ships both CommonJS and ESM builds from TypeScript source under src/. The build compiles to dist/ with type declarations.
# Full buildnpm run build
# Watch mode for developmentnpm run devRunning Tests
# Run all testsnpm test
# Run specific test filenpm test -- test/impact_engine.test.ts
# Run with verbose outputnpm test -- --verboseTests live under test/ and cover the engine, pipeline orchestrator, and crew components.
Project Structure
src/ cli/ # CLI entry point, argument parsing, command handlers engine/ # Deterministic impact analysis core crew/ # Multi-agent orchestration agents/ # 10 specialized crew agents pipeline/ # 5-stage generation/healing pipeline knowledge/ # Route families, API surface, spec index training/ # Scanner, enricher, validator for manifests providers/ # LLM provider implementations adapters/ # Framework-specific adapters reporters/ # Output format plugins resilience/ # Circuit breaker, retry logic cache/ # Response cachingAdding a CLI Command
- Create
src/cli/commands/your_command.tswith an async handler - Add the command name to the
Commandtype union insrc/cli/types.ts - Register dispatch logic in
src/cli.ts - Add flags to
src/cli/parse_args.ts - Add defaults in
src/cli/defaults.tsif needed
Common Pitfalls
- Missing route-families.json: Impact analysis returns empty results without the manifest. Run
train --no-enrichfirst. - Budget exceeded mid-run: Set
--budget-usdhigh enough for the workflow. Use--dry-runto preview cost estimates. - Provider not found: Ensure the correct environment variable is set. Use
llm-healthto verify. - Stale cache: The response cache under
.e2e-ai-agents/cache/may serve outdated results. Delete the directory to clear it.