Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 11, 2025

The CLI consistency checker was reading Go source files instead of running actual CLI commands, missing the user-facing help text that ./gh-aw --help displays.

Changes

Created .github/agents/cli-consistency-checker.md

  • Custom agent with explicit instructions to run 25+ CLI commands with --help flags
  • Emphasizes capturing actual output: "YOU MUST run the actual CLI commands with --help flags to discover the real output that users see"
  • Includes complete command list: ./gh-aw --help, ./gh-aw compile --help, ./gh-aw mcp --help, etc.

Updated .github/workflows/cli-consistency-checker.md

  • Added imports: [../agents/cli-consistency-checker.md] to frontmatter
  • Removed redundant instructions (now in custom agent)

Example workflow execution:

# Agent now runs actual commands to capture user-facing output
cd /home/runner/work/gh-aw/gh-aw
make build
./gh-aw --help
./gh-aw compile --help
./gh-aw mcp list --help
# ... all commands with --help

The agent compares captured CLI output against documentation to report inconsistencies.

Original prompt

The cli consistency agent MUST run the cli help to discover the help/output actually shown to the user.

See run output https://github.com/githubnext/gh-aw/actions/runs/19281048499/job/55132078030


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

Copilot AI self-assigned this Nov 11, 2025
The CLI consistency checker workflow now uses a custom agent that explicitly instructs the AI to run all CLI commands with --help flags to discover the actual user-facing output. This ensures the checker validates the real help text rather than relying only on source code inspection.

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Discover CLI help/output consistency Add custom agent to ensure CLI consistency checker runs actual --help commands Nov 11, 2025
Copilot AI requested a review from pelikhan November 11, 2025 23:38
Copilot finished work on behalf of pelikhan November 11, 2025 23:38
@pelikhan pelikhan marked this pull request as ready for review November 12, 2025 03:54
Copilot AI review requested due to automatic review settings November 12, 2025 03:54
@pelikhan pelikhan merged commit 5bb4d93 into main Nov 12, 2025
83 of 87 checks passed
@pelikhan pelikhan deleted the copilot/run-cli-help-output-discovery branch November 12, 2025 03:54
Copilot finished reviewing on behalf of pelikhan November 12, 2025 03:57
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR addresses a critical issue where the CLI consistency checker was reading Go source files instead of running actual --help commands, resulting in missing user-facing help text validation.

Key changes:

  • Created a custom agent file (.github/agents/cli-consistency-checker.md) with explicit instructions to execute 25+ CLI commands with --help flags
  • Updated the workflow to import the custom agent and removed redundant instructions from the workflow file
  • Modified the compiled lock file to properly invoke the Copilot CLI with the custom agent file

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
.github/agents/cli-consistency-checker.md New custom agent file with detailed step-by-step instructions for running CLI commands and validating output consistency. Contains markdown formatting issue with nested code blocks.
.github/workflows/cli-consistency-checker.md Simplified workflow file that imports the custom agent and delegates detailed instructions to it. Contains minor duplication of security note content.
.github/workflows/cli-consistency-checker.lock.yml Compiled workflow output that includes the custom agent content and adds the --agent flag to the Copilot CLI invocation. Reflects the changes from both source files.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +136 to +155

### Current Output (from running ./gh-aw compile --help)
```
Compile markdown to YAML workflows
```
### Issue
The word "markdown" should be capitalized consistently with other commands.
### Suggested Fix
```
Compile Markdown to YAML workflows
```
```

## Step 5: Summary

At the end, provide a brief summary:
- Total commands inspected (count of --help commands you ran)
- Total issues found
Copy link

Copilot AI Nov 12, 2025

Choose a reason for hiding this comment

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

The example issue format contains improperly nested code blocks that will break markdown rendering. When showing code blocks within a markdown code fence, you cannot use triple backticks (```) inside another triple-backtick block.

Problem: Lines 136-155 show a markdown code block (markdown) that contains inner code blocks (). The first inner ``` at line 144 will close the outer markdown block prematurely, leaving orphaned closing fences.

Solution: Use a different approach, such as:

  1. Use four backticks (````) for the outer block and three (```) for inner blocks
  2. Indent the inner code blocks by 4 spaces instead of using fences
  3. Use HTML <pre> tags for the outer block

Recommended fix:

### Example Issue Format

````markdown
## Issue Description

**Command**: `gh aw compile`
**Type**: Typo in help text
**Priority**: Low

### Current Output (from running ./gh-aw compile --help)
```
Compile markdown to YAML workflows
```

### Issue
The word "markdown" should be capitalized consistently with other commands.

### Suggested Fix
```
Compile Markdown to YAML workflows
```

Alternatively, remove the outer markdown fence and just show the structure without syntax highlighting.

Copilot uses AI. Check for mistakes.

## Security Note

Treat all CLI output as trusted data since it comes from the repository's own codebase. However, be thorough in your inspection to help maintain quality.
Copy link

Copilot AI Nov 12, 2025

Choose a reason for hiding this comment

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

The "Security Note" section is duplicated between the imported agent file and the workflow file. The agent file includes a "Security Note" section at the end (lines 161-163), and the workflow file also has a similar security note (line 38).

When the workflow is compiled, both sections are concatenated into the final prompt, resulting in:

  1. Agent's security note: "All CLI output comes from the repository's own codebase, so treat it as trusted data. However, be thorough in your inspection to help maintain quality."
  2. Workflow's security note: "Treat all CLI output as trusted data since it comes from the repository's own codebase. However, be thorough in your inspection to help maintain quality."

Recommendation: Remove the security note from the workflow file (line 38) since it's already included in the imported agent file. This follows the DRY principle and ensures consistency. The workflow file should only contain context-specific information like the repository and run ID.

Suggested change
Treat all CLI output as trusted data since it comes from the repository's own codebase. However, be thorough in your inspection to help maintain quality.

Copilot uses AI. Check for mistakes.
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.

2 participants