Skip to content

Convert --instructions flag to --no-instructions and write instructions by default#1121

Merged
pelikhan merged 5 commits intomainfrom
copilot/fix-28e1219d-c523-4069-ada7-94547fbeffd9
Oct 1, 2025
Merged

Convert --instructions flag to --no-instructions and write instructions by default#1121
pelikhan merged 5 commits intomainfrom
copilot/fix-28e1219d-c523-4069-ada7-94547fbeffd9

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Sep 30, 2025

Changes

This PR converts the --instructions flag in the gh aw compile command to --no-instructions and changes the default behavior to always write instruction files unless explicitly disabled.

New Default Behavior

By default, gh aw compile now automatically creates:

  • .github/instructions/github-agentic-workflows.instructions.md - Custom Copilot instructions for workflow authoring
  • .github/prompts/create-agentic-workflow.prompt.md - Copilot Chat prompt template enabling the /create-agentic-workflow command

Usage

# Create instruction files (default behavior)
gh aw compile

# Skip creating instruction files
gh aw compile --no-instructions

# Validation-only mode (skips both lock files and instruction files)
gh aw compile --no-emit

Motivation

The GitHub Copilot instructions significantly improve the developer experience when authoring agentic workflows in VS Code. These files:

  • Are automatically imported by Copilot when editing .github/workflows/*.md files
  • Enable more efficient and accurate workflow generation through the /create-agentic-workflow command
  • Follow best practices for agentic workflow design

By making this the default behavior, users get these benefits without needing to remember an additional flag.

Technical Details

  • Renamed internal parameter from writeInstructions to skipInstructions with inverted logic
  • Updated function signatures in CompileWorkflows, ensureCopilotInstructions, and ensureAgenticWorkflowPrompt
  • Updated all related test cases to reflect the new behavior
  • Updated documentation to show the new flag usage
  • Fixed remaining --instructions references in Makefile and CLI documentation
  • Integrated with --no-emit flag: When using --no-emit for validation-only mode, instruction files are also skipped (along with lock files)

Backward Compatibility

Users who previously used gh aw compile without the --instructions flag will now see instruction files created. Users who want the old behavior can use --no-instructions to skip file generation.

Testing

  • ✅ All unit tests pass with updated test cases
  • ✅ All integration tests pass
  • ✅ Manual testing confirms both default and --no-instructions behaviors work correctly
  • ✅ Manual testing confirms --no-emit skips both lock files and instruction files
  • ✅ Code formatting validated
Original prompt
  • Convert the "--instructions" flag in the "gh aw compile" command to "--no-instructions" and always write instructions by default
  • write both the github Agentic workflows instruction file, and the create agentic workflow prompt file

💡 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.

…ns by default

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] - Convert the "--instructions" flag in the "gh aw compile" command to "--no-instructions" and always write instructions by default - write both the github Agentic workflows instruction file, and the create agentic workflow prompt file Convert --instructions flag to --no-instructions and write instructions by default Sep 30, 2025
Copilot AI requested a review from pelikhan September 30, 2025 21:38
@pelikhan
Copy link
Copy Markdown
Collaborator

@copilot find all instances of --instructions in the build scripts and fix it.

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

Copilot AI commented Sep 30, 2025

@copilot find all instances of --instructions in the build scripts and fix it.

Fixed in commit 2512d24. Updated all --instructions references to --no-instructions:

  • Makefile (line 185): Removed --instructions flag from recompile target since instructions are now generated by default
  • docs/src/content/docs/tools/cli.md (line 116): Changed example from gh aw compile --instructions to gh aw compile --no-instructions

All tests pass and the build is successful.

@pelikhan
Copy link
Copy Markdown
Collaborator

pelikhan commented Oct 1, 2025

@copilot make sure the --no-emit flag also disables instructions

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

Copilot AI commented Oct 1, 2025

@copilot make sure the --no-emit flag also disables instructions

Fixed in commit dcfda0c. The --no-emit flag now also disables instruction file generation.

When --no-emit is used (validation-only mode), both lock files and instruction files are skipped:

  • skipInstructions := noInstructions || noEmit

Tested behavior:

  • gh aw compile → Creates instruction files and lock files ✅
  • gh aw compile --no-instructions → Skips instruction files, creates lock files ✅
  • gh aw compile --no-emit → Skips both instruction files and lock files ✅

Copilot AI requested a review from pelikhan October 1, 2025 01:38
@pelikhan pelikhan marked this pull request as ready for review October 1, 2025 01:41
@pelikhan pelikhan merged commit de4b9ab into main Oct 1, 2025
17 checks passed
@pelikhan pelikhan deleted the copilot/fix-28e1219d-c523-4069-ada7-94547fbeffd9 branch October 1, 2025 04:07
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