Skip to content

[Feature]: New gate-on-condition step kind (auto-fire on condition) #2593

@doquanghuy

Description

@doquanghuy

Problem Statement

Spec Kit gate steps require operator interaction. There's no way
to express "auto-fire this gate's <verdict> branch when condition
X holds, otherwise prompt the operator." This blocks any workflow
where downstream steps should auto-rerun based on detected state
without prompting on the no-op path.

Proposed Solution

- id: my-gate
  type: gate-on-condition
  conditions:
    - if: "{{ context.has_pending_work }}"
      then_route: regenerate
    - if: "{{ context.is_clean }}"
      then_route: continue
  fallback_prompt:
    message: "Ambiguous — approve, regenerate, or abort?"
    choices: ["approve", "regenerate", "abort"]

Conditions evaluated in declaration order; first match wins. No
match → operator gets fallback_prompt. Existing gate kind
unchanged. Opt-in per workflow author.

Component

Other

AI Agent (if applicable)

All agents

Acceptance Criteria

  • New gate-on-condition step kind in workflow YAML schema.
  • Condition evaluation reuses
    expressions.evaluate_condition.
  • First-match-wins; declaration-order semantics.
  • No match → fallback_prompt (if declared) used; otherwise
    run aborts with a clear error.
  • Default behaviour of existing gate kind preserved.

Additional Context

Possible objection — "auto-firing gates undermines
human-in-the-loop": opt-in per gate. Workflows that want strict
human approval don't use this kind.

Long-shot, low-priority. Fine to close politely if not aligned with
the project's direction.

AI disclosure: drafted with Claude Opus, human-reviewed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions