Skip to content

Add optional reason/message to .skipIf() for clearer skip output #5

Description

@masonmark

Per verbal request from @masonmark — a user of the .skipIf() feature (added in v0.1.3, commit f02d48e) has requested the ability to provide an optional reason message when a step is skipped.

Currently, when a step is skipped via .skipIf(), the output shows:

⏭️  Skipping: <step description> (skipIf condition met)

This is fine when the skip condition is self-evident from the step description or command, but in cases where the reason for skipping is non-obvious, it would be helpful to display a custom message explaining why the step was skipped.

Proposed API

The .skipIf() method should accept an optional reason string:

// Current (still works)
script.add('deploy to staging').skipIf(process.env.CI !== 'true');

// New: with reason
script.add('deploy to staging').skipIf(process.env.CI !== 'true', 'not running in CI');

// Also works with function conditions
script.add('release notes').skipIf(
  () => runQuiet('git log -1 --format=%s').includes('[skip notes]'),
  'commit message contains [skip notes]'
);

When a reason is provided and the step is skipped, the output would show:

⏭️  Skipping: release notes (not running in CI)

When no reason is provided, the existing (skipIf condition met) message is shown as before.

Implementation notes

  • Add an optional skipReason?: string field to StepOptions
  • Update .skipIf() signature to accept a second reason?: string parameter
  • Pass the reason through to the skip output in Script.ts and to StepResult.skipReason
  • Update the plan display (conditional) flag — could optionally show the reason there too

(Filed from Claude Code VSCode extension, model: Claude Opus 4.6)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    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