Skip to content

Add proactive staleness warnings with actionable guidance to status command#6211

Closed
Copilot wants to merge 6 commits intomainfrom
copilot/add-proactive-staleness-warnings
Closed

Add proactive staleness warnings with actionable guidance to status command#6211
Copilot wants to merge 6 commits intomainfrom
copilot/add-proactive-staleness-warnings

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Dec 12, 2025

Plan: Add Proactive Staleness Warnings with Actionable Guidance

  • 1. Analyze current staleness detection in status_command.go (timestamp-based)
  • 2. Add ActionNeeded field to WorkflowStatus struct with console tag
  • 3. Implement staleness detection logic with actionable messages:
    • Never compiled: "gh aw compile workflow.md"
    • Stale (timestamp): "gh aw compile workflow.md"
  • 4. Add summary footer after table:
    • Count workflows needing compilation
    • Show bulk compile command if needed
    • Show success message if all up-to-date
  • 5. Add --fix-suggestions flag to generate executable shell script (Removed per feedback - functionality always on)
  • 6. Add color coding to Compiled column (Green/Yellow/Red)
  • 7. Update tests in status_command_test.go
  • 8. Run validation: make test-unit, make lint, make build
  • 9. Manual verification with ./gh-aw status

Implementation Summary

Features Added

  1. ActionNeeded Column: New column in status table showing copy-paste ready commands

    • Shows "gh aw compile workflow.md" for workflows needing compilation
    • Empty for up-to-date workflows
    • Included in both console and JSON output
    • Always visible (no flag required)
  2. Color-Coded Compiled Status: Visual indicators for workflow state

    • 🟢 Green "Yes" - Up-to-date workflows
    • 🟡 Yellow "Stale" - Modified source files (timestamp mismatch)
    • 🔴 Red "No" - Never compiled
    • Colors only shown in TTY terminals, plain text otherwise
  3. Summary Footer: Actionable summary after status table

    • Shows count: "Workflows needing compilation: X"
    • Displays bulk command: "⚡ gh aw compile"
    • Shows success message when all workflows are up-to-date
    • Always visible (no flag required)

Testing

  • ✅ All unit tests pass
  • ✅ New tests added for ActionNeeded field
  • ✅ Linting passes
  • ✅ Manual verification completed
  • ✅ JSON output validated

Files Modified

  • pkg/cli/status.go - Command definition (removed --fix-suggestions flag)
  • pkg/cli/status_command.go - Core implementation
  • pkg/cli/status_command_test.go - New tests
  • pkg/cli/commands_test.go - Updated test calls

Design Decisions

  • Action Needed column and summary footer are always displayed rather than hidden behind a flag
  • Summary message rephrased to "Workflows needing compilation: X" to avoid pluralization complexity
  • Removed pluralize helper function to simplify code
Original prompt

This section details on the original issue you should resolve

<issue_title>[plan] Add proactive staleness warnings with actionable guidance</issue_title>
<issue_description>## Objective

Enhance gh aw status output to provide clear, actionable guidance when workflows are stale or uncompiled. Add color-coded status, "Action Needed" column, summary line with bulk commands, and optional fix script generation.

Context

Current status output shows "Compiled: No" but provides no guidance on what to do next. Users must figure out commands themselves, leading to confusion and inconsistent workflow states.

Approach

1. Enhance WorkflowStatus Struct

Add new field:

ActionNeeded  string   `json:"action_needed" console:"header:Action Needed,omitempty"`

Generate commands based on staleness type:

  • Never compiled: "Run: gh aw compile workflow.md"
  • Stale (hash): "Run: gh aw compile workflow.md (content changed)"
  • Stale (timestamp): "Run: gh aw compile workflow.md (timestamp mismatch)"
  • Up-to-date: "" (empty)

2. Add Summary Footer

After status table, print:

⚠️  5 workflows need compilation
  Run: gh aw compile --all

Or if all up-to-date:

✓ All workflows are up-to-date

3. Add Color Coding

Using console package:

  • Green: Compiled == "Yes" (up-to-date)
  • Yellow: Compiled contains "Stale"
  • Red: Compiled == "No" (never compiled)

4. Add --fix-suggestions Flag

Generate executable shell script:

gh aw status --fix-suggestions > fix-workflows.sh

Output:

#!/bin/bash
# Generated by gh aw status --fix-suggestions
gh aw compile workflow1.md
gh aw compile workflow2.md
git add .github/workflows/*.lock.yml
echo "Done! Review changes with: git diff --cached"

Files to Modify

  • pkg/cli/status_command.go - Enhance output and add features
  • pkg/console/*.go - Add color formatting utilities if needed
  • pkg/cli/status_command_test.go - Test new output format

Acceptance Criteria

  • Status output includes "Action Needed" column
  • Commands are copy-paste ready
  • Summary line shows total needing compilation
  • Color-coded output for terminal display
  • --fix-suggestions generates valid shell script
  • Verbose mode explains staleness reason
  • Tests verify output format correctness
  • Documentation updated with examples
    Related to [plan] Workflow Lifecycle Management & Staleness Detection Improvements #6181

AI generated by Plan Command for discussion #6133

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 2 commits December 12, 2025 04:34
… status command

Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
Copilot AI changed the title [WIP] Enhance gh aw status with actionable staleness guidance Add proactive staleness warnings with actionable guidance to status command Dec 12, 2025
Copilot AI requested a review from mnkiefer December 12, 2025 04:56
@pelikhan
Copy link
Copy Markdown
Collaborator

@copilot the user can run "gh aw compile" to recompile all workflows

…d of 'gh aw compile --all'

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Dec 12, 2025

@copilot the user can run "gh aw compile" to recompile all workflows

Fixed in f213bde. The summary footer now shows gh aw compile instead of the incorrect gh aw compile --all.

Updated output:

⚠ 4 workflows need compilation
  Run: ⚡ gh aw compile

Comment thread pkg/cli/status.go Outdated
ref, _ := cmd.Flags().GetString("ref")
labelFilter, _ := cmd.Flags().GetString("label")
return StatusWorkflows(pattern, verbose, jsonFlag, ref, labelFilter)
fixSuggestions, _ := cmd.Flags().GetBool("fix-suggestions")
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot always on

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in 960481d. Removed the --fix-suggestions flag. The Action Needed column and summary footer are now always displayed.

Output now shows:

│Action Needed                                  │
│-                                              │
│gh aw compile code-health-file-diet.campaign.md│

And summary footer:

⚠ 4 workflows need compilation
  Run: ⚡ gh aw compile

Comment thread pkg/cli/status.go Outdated
ref, _ := cmd.Flags().GetString("ref")
labelFilter, _ := cmd.Flags().GetString("label")
return StatusWorkflows(pattern, verbose, jsonFlag, ref, labelFilter)
fixSuggestions, _ := cmd.Flags().GetBool("fix-suggestions")
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot remove flag

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in 960481d. The --fix-suggestions flag has been removed and the functionality is now always on.

…footer always on

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Comment thread pkg/cli/status_command.go Outdated
}

// pluralize returns "s" if count != 1, otherwise empty string
func pluralize(count int) string {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot rephrase so you do not have to pluralize, remove function

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in ea40e0c. Rephrased the message to "Workflows needing compilation: X" which doesn't require pluralization, and removed the pluralize function.

Updated output:

⚠ Workflows needing compilation: 4
  Run: ⚡ gh aw compile

…function

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI requested a review from pelikhan December 12, 2025 06:20
@pelikhan pelikhan closed this Dec 12, 2025
@pelikhan pelikhan deleted the copilot/add-proactive-staleness-warnings branch December 15, 2025 04:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[plan] Add proactive staleness warnings with actionable guidance

3 participants