Skip to content

[plan] Add non-empty validation to workflow intent field in interactive.go #21470

@github-actions

Description

@github-actions

Objective

Add non-empty validation to the workflow intent text field in pkg/cli/interactive.go, consistent with the existing validation on the workflow name field.

Context

From the Terminal Stylist audit (discussion #21455), the huh.NewText() field for workflow intent in interactive.go accepts empty strings without warning, while the workflow name field already has a Validate() call requiring non-empty input.

Current State

// workflow name — has validation ✅
huh.NewInput().
    Title("Workflow name").
    Value(&builder.WorkflowName).
    Validate(func(s string) error {
        if s == "" { return errors.New("workflow name cannot be empty") }
        return nil
    }),

// intent text — missing validation ❌
huh.NewText().
    Title("What should this workflow do?").
    Value(&builder.Intent),

Approach

  1. Open pkg/cli/interactive.go (or whichever file contains the intent huh.NewText() field)
  2. Add a .Validate() call that rejects empty strings with an actionable error message
  3. Optionally add a minimum length check (e.g., 10 characters) for meaningful intent descriptions

Files to Modify

  • pkg/cli/interactive.go (or the file containing the intent Huh form field)

Acceptance Criteria

  • The intent text field has a .Validate() that rejects empty strings
  • The error message is actionable (e.g., "workflow intent cannot be empty")
  • Existing tests pass, new test added if a test file exists for this form
  • make fmt && make lint && make test-unit pass

Generated by Plan Command for issue #discussion #21455 ·

  • expires on Mar 19, 2026, 11:44 PM UTC

Metadata

Metadata

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