Skip to Content
kusaw docsv1.0.0

Replace a built-in step

Point a pipeline entry at your `command:` instead of `builtin:`. Keep the same step id so gates, loops, and feedback keep working. The built-in steps stay available as defaults; replacing one is a config change, not a new pipeline.

Point a pipeline entry at your command: instead of builtin:. Keep the same step id so gates, loops, and feedback keep working. The built-in steps stay available as defaults; replacing one is a config change, not a new pipeline.

Keep the same id

The default pipeline runs review-standards and review-spec. Those ids are what the loop and any later gate refer to. If you change only the program behind review-standards, the loop still collects that step's feedback and a gate that waits on it still waits.

Switch back by restoring builtin: review on that id.

Worked example: a team checklist

examples/custom-steps/review-checklist/ replaces the default review step with a small custom review that runs the team's own checklist script. The pipeline id stays review-standards.

YAMLexamples/custom-steps/review-checklist/kusaw.yaml
  review-standards: { command: ["python3", "./step.py"], timeout: 5m, config: { fail_on: major } }
  review-spec:      { builtin: review, args: ["--focus", "spec"], timeout: 5m, config: { fail_on: major } }

The parallel review group is unchanged:

YAMLexamples/custom-steps/review-checklist/kusaw.yaml
        - parallel:
            name: review
            fail_fast: false
            steps:
              - review-standards
              - review-spec

step.py speaks the protocol. checklist.sh is the team's script: it fails added FIXME lines that have no owner, for example FIXME(sam). Findings become fail with feedback, the same way the default review step reports findings, so the loop still iterates.

To switch review-standards back to the default review step:

YAML
  review-standards: { builtin: review, args: ["--focus", "standards"], timeout: 5m, config: { fail_on: major } }

Wrap a built-in

When you only want to wrap the default, start it from your step and then add your own checks. Forward the request on stdin to kusaw step review with the same --focus that id used:

Python
import subprocess, sys

req = sys.stdin.read()
proc = subprocess.run(
    ["kusaw", "step", "review", "--focus", "standards"],
    input=req, text=True, capture_output=True,
)
sys.stdout.write(proc.stdout)
sys.stderr.write(proc.stderr)

Your program still has to handshake, and its last stdout line still has to be a result. You can emit extra progress first, or replace an ok from the default with fail if your extra check fires.

How to switch back

  1. On that step id, replace command: [...] with builtin: <name>.
  2. Restore any args: the default used (--focus standards for the default review step).
  3. Run kusaw validate.

The pipeline list does not change.

On this page