Function: defineGate()

August 8, 2026 · View on GitHub

@plures/praxis


@plures/praxis / index / defineGate

Function: defineGate()

defineGate(name, config): PraxisModule<GateContext>

Defined in: src/project/project.ts:64

Define a feature gate — a condition that must be satisfied before proceeding with a workflow step (deploy, merge, release, etc.).

Parameters

name

string

Gate name (used as part of the rule ID gate/<name>)

config

GateConfig

Gate configuration: expected fact IDs, and satisfied/violation event names

Returns

PraxisModule<GateContext>

A PraxisModule containing the gate rule and constraint

Example

const testGate = defineGate('test', {
  expects: ['all-tests-pass', 'no-type-errors'],
  onSatisfied: 'deploy-allowed',
  onViolation: 'deploy-blocked',
});
registry.registerModule(testGate);