Add capitalization consistency tests and documentation#3730
Conversation
- Add comprehensive tests in cmd/gh-aw/capitalization_test.go - Create CAPITALIZATION_GUIDELINES.md documentation - Verify existing code already follows Option 2 correctly Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
There was a problem hiding this comment.
Pull Request Overview
This PR documents and enforces capitalization consistency for "agentic workflows" vs "Agentic Workflows" in CLI command descriptions. After verifying the codebase already follows the desired pattern (lowercase for generic usage, capitalized for product name), the PR adds automated tests and comprehensive documentation to prevent future inconsistencies.
Key Changes:
- Adds automated tests to enforce capitalization rules
- Documents the decision in a comprehensive guideline file
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| docs/CAPITALIZATION_GUIDELINES.md | Comprehensive guideline documenting when to capitalize "Agentic Workflows" vs "agentic workflows" |
| cmd/gh-aw/capitalization_test.go | Three test functions to enforce capitalization consistency across commands |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
docs/CAPITALIZATION_GUIDELINES.md
Outdated
| # Capitalization Guidelines for gh-aw CLI | ||
|
|
||
| This document defines the capitalization rules for the gh-aw CLI to ensure consistency across all command descriptions and documentation. |
There was a problem hiding this comment.
This documentation file is located in the wrong directory. According to the custom coding guidelines, Astro Starlight documentation should be in docs/src/content/docs/. The current location docs/CAPITALIZATION_GUIDELINES.md is outside the Astro content structure and won't be integrated into the documentation site. Move this file to docs/src/content/docs/reference/capitalization.md (or similar path) and add proper frontmatter with title and description fields.
See below for a potential fix:
@ -1,3 +1,8 @@
---
title: Capitalization Guidelines
description: Rules and examples for consistent capitalization in gh-aw CLI command descriptions and documentation.
---
There was a problem hiding this comment.
Fixed in commit 9b52bb6. Moved documentation to docs/src/content/docs/reference/capitalization.md with proper Astro Starlight frontmatter (title, description, sidebar order).
docs/CAPITALIZATION_GUIDELINES.md
Outdated
| ## Decision: Option 2 - Context-Based Capitalization | ||
|
|
||
| The gh-aw CLI follows **Option 2** for capitalization: | ||
|
|
||
| ### Rules |
There was a problem hiding this comment.
This documentation doesn't follow the Diátaxis framework specified in the custom coding guidelines. This content is 'Explanation' type (understanding-oriented) explaining 'why things are the way they are' and design decisions. However, it mixes in elements of Reference (the rules) and lacks proper structure. Consider restructuring: use indicative mood ('This approach provides', 'The tool uses'), discuss design tradeoffs, and separate the reference-style rules into a proper reference section or table.
There was a problem hiding this comment.
Fixed in commit 9b52bb6. Restructured as Explanation-oriented content following Diátaxis framework - uses indicative mood, discusses design tradeoffs, and provides historical context.
cmd/gh-aw/capitalization_test.go
Outdated
|
|
||
| // Check if uppercase was used without "GitHub" prefix (which would be wrong) | ||
| if strings.Contains(cmd.Short, "Agentic Workflow") && !strings.Contains(cmd.Short, "GitHub Agentic Workflow") { | ||
| t.Errorf("Command '%s' should use lowercase 'agentic workflow' not 'Agentic Workflow' in Short", cmd.Name()) | ||
| } | ||
| if strings.Contains(cmd.Long, "Agentic Workflow") && !strings.Contains(cmd.Long, "GitHub Agentic Workflow") { | ||
| t.Errorf("Command '%s' should use lowercase 'agentic workflow' not 'Agentic Workflow' in Long", cmd.Name()) | ||
| } |
There was a problem hiding this comment.
Lines 66-71 are unreachable code. The logic flow at lines 52-63 already handles all cases: if a command mentions 'agentic workflow' (case-insensitive check at line 54), it either finds lowercase usage and continues (line 60-62), or falls through to line 65. However, the only way to reach line 66 is if the command mentions 'agentic workflow' but doesn't have lowercase 'agentic workflow', which means it must have capitalized it. But line 60 already continues if lowercase is found, and line 54-56 continues if not mentioned at all. The checks at lines 66-71 will never execute because any command that reaches them would have already continued at line 62.
| // Check if uppercase was used without "GitHub" prefix (which would be wrong) | |
| if strings.Contains(cmd.Short, "Agentic Workflow") && !strings.Contains(cmd.Short, "GitHub Agentic Workflow") { | |
| t.Errorf("Command '%s' should use lowercase 'agentic workflow' not 'Agentic Workflow' in Short", cmd.Name()) | |
| } | |
| if strings.Contains(cmd.Long, "Agentic Workflow") && !strings.Contains(cmd.Long, "GitHub Agentic Workflow") { | |
| t.Errorf("Command '%s' should use lowercase 'agentic workflow' not 'Agentic Workflow' in Long", cmd.Name()) | |
| } |
There was a problem hiding this comment.
Fixed in commit 9b52bb6. Removed unreachable code (lines 66-71) by simplifying the test logic.
cmd/gh-aw/capitalization_test.go
Outdated
| if !strings.Contains(versionCmd.Long, "GitHub Agentic Workflows") && !strings.Contains(versionCmd.Short, "GitHub Agentic Workflows") { | ||
| // Version command is allowed to not have the product name in descriptions | ||
| // since it's output in the Run function instead | ||
| } |
There was a problem hiding this comment.
This if statement with only a comment in the body serves no purpose and adds confusion. If the version command is explicitly allowed to not have the product name, either remove this check entirely or add an explicit skip comment before checking other commands. The current code suggests a check is happening when it's actually just documentation.
| if !strings.Contains(versionCmd.Long, "GitHub Agentic Workflows") && !strings.Contains(versionCmd.Short, "GitHub Agentic Workflows") { | |
| // Version command is allowed to not have the product name in descriptions | |
| // since it's output in the Run function instead | |
| } | |
| // Version command is allowed to not have the product name in descriptions, | |
| // since it's output in the Run function instead. |
There was a problem hiding this comment.
Fixed in commit 9b52bb6. Removed the empty if block and replaced with a comment explaining why version command is skipped.
cmd/gh-aw/capitalization_test.go
Outdated
| // Verify they use lowercase "agentic workflows" or "agentic workflow" somewhere | ||
| lowerShort := strings.ToLower(cmd.Short) | ||
| lowerLong := strings.ToLower(cmd.Long) | ||
| if !strings.Contains(lowerShort, "agentic workflow") && !strings.Contains(lowerLong, "agentic workflow") { | ||
| // Not all commands need to mention agentic workflows | ||
| continue | ||
| } | ||
|
|
||
| // If they mention it, ensure it's lowercase | ||
| if strings.Contains(cmd.Short, "agentic workflow") || strings.Contains(cmd.Long, "agentic workflow") { | ||
| // Lowercase usage found - this is correct | ||
| continue | ||
| } | ||
|
|
||
| // Check if uppercase was used without "GitHub" prefix (which would be wrong) | ||
| if strings.Contains(cmd.Short, "Agentic Workflow") && !strings.Contains(cmd.Short, "GitHub Agentic Workflow") { | ||
| t.Errorf("Command '%s' should use lowercase 'agentic workflow' not 'Agentic Workflow' in Short", cmd.Name()) | ||
| } | ||
| if strings.Contains(cmd.Long, "Agentic Workflow") && !strings.Contains(cmd.Long, "GitHub Agentic Workflow") { | ||
| t.Errorf("Command '%s' should use lowercase 'agentic workflow' not 'Agentic Workflow' in Long", cmd.Name()) |
There was a problem hiding this comment.
The test logic from lines 51-71 is overly complex and contains unreachable code. Simplify by checking directly: if the command contains 'Agentic Workflow' (without 'GitHub' prefix), it's wrong and should error. The current multi-step approach with lowercase conversion and multiple continues makes the logic harder to follow and contains dead code (lines 66-71).
| // Verify they use lowercase "agentic workflows" or "agentic workflow" somewhere | |
| lowerShort := strings.ToLower(cmd.Short) | |
| lowerLong := strings.ToLower(cmd.Long) | |
| if !strings.Contains(lowerShort, "agentic workflow") && !strings.Contains(lowerLong, "agentic workflow") { | |
| // Not all commands need to mention agentic workflows | |
| continue | |
| } | |
| // If they mention it, ensure it's lowercase | |
| if strings.Contains(cmd.Short, "agentic workflow") || strings.Contains(cmd.Long, "agentic workflow") { | |
| // Lowercase usage found - this is correct | |
| continue | |
| } | |
| // Check if uppercase was used without "GitHub" prefix (which would be wrong) | |
| if strings.Contains(cmd.Short, "Agentic Workflow") && !strings.Contains(cmd.Short, "GitHub Agentic Workflow") { | |
| t.Errorf("Command '%s' should use lowercase 'agentic workflow' not 'Agentic Workflow' in Short", cmd.Name()) | |
| } | |
| if strings.Contains(cmd.Long, "Agentic Workflow") && !strings.Contains(cmd.Long, "GitHub Agentic Workflow") { | |
| t.Errorf("Command '%s' should use lowercase 'agentic workflow' not 'Agentic Workflow' in Long", cmd.Name()) | |
| // Directly check for incorrect usage of "Agentic Workflow" without "GitHub" prefix | |
| if strings.Contains(cmd.Short, "Agentic Workflow") && !strings.Contains(cmd.Short, "GitHub Agentic Workflow") { | |
| t.Errorf("Command '%s' Short description should use lowercase 'agentic workflow' for generic usage, not 'Agentic Workflow'. Got: %s", cmd.Name(), cmd.Short) | |
| } | |
| if strings.Contains(cmd.Long, "Agentic Workflow") && !strings.Contains(cmd.Long, "GitHub Agentic Workflow") { | |
| t.Errorf("Command '%s' Long description should use lowercase 'agentic workflow' for generic usage, not 'Agentic Workflow'. Got: %s", cmd.Name(), cmd.Long) |
There was a problem hiding this comment.
Fixed in commit 9b52bb6. Simplified test logic to directly check for incorrect usage of "Agentic Workflow" without "GitHub" prefix, removing all the overly complex logic and unreachable code.
|
@copilot lint |
- Simplify test logic by removing unreachable code (lines 66-71) - Remove empty if block (lines 24-27) - Directly check for incorrect capitalization - Move documentation from docs/CAPITALIZATION_GUIDELINES.md to docs/src/content/docs/reference/capitalization.md - Follow Diátaxis framework (Explanation-oriented) - Add proper frontmatter with title, description, sidebar order - All linting and tests pass Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
| order: 900 | ||
| --- | ||
|
|
||
| The gh-aw CLI follows context-based capitalization to distinguish between the product name and generic workflow references. This approach provides clarity and maintains professional consistency across all user-facing text. |
Fix CLI Capitalization Consistency ✅
Summary
After thorough analysis, the CLI already follows Option 2 correctly (lowercase "agentic workflows" for generic usage, capitalized "Agentic Workflows" only for product name). This PR adds automated tests and documentation to maintain consistency.
Changes
1. Automated Tests (
cmd/gh-aw/capitalization_test.go)2. Documentation (
docs/src/content/docs/reference/capitalization.md)Addressed PR Feedback
docs/src/content/docs/reference/capitalization.mdVerification
Product Name (Capitalized) ✅
Generic Usage (Lowercase) ✅
Technical Terms (Capitalized) ✅
Test Results
No code changes required - the codebase already implements Option 2 correctly.
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.