Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Oct 31, 2025

Plan: Convert create-agentic-workflow.prompt.md to custom agent format

Understanding

  • Currently: create-agentic-workflow.prompt.md is stored in .github/prompts/
  • Target: Convert to create-agentic-workflow.md in .github/agents/
  • The prompt file uses frontmatter with description, tools, and model fields
  • Custom agents use frontmatter with name, description, and tools fields
  • Custom agent files use .md extension (not .agent.md)

Changes Completed

  • Create new template file pkg/cli/templates/create-agentic-workflow.md with proper agent frontmatter format
  • Update pkg/cli/commands.go to embed the new agent template
  • Update pkg/cli/init.go to call new function for creating agent file instead of prompt file
  • Create new function ensureAgenticWorkflowAgent to replace ensureAgenticWorkflowPrompt
  • Update success message to reference new agent file path
  • Update tests to verify agent file creation instead of prompt file
  • Update documentation references to use agent file activation pattern
  • Delete old prompt template file (removed during init)
  • Run build and tests to verify all changes work correctly
  • Move .github/prompts/create-agentic-workflow.prompt.md to .github/agents/create-agentic-workflow.md
  • Update Makefile sync-templates rule to sync agent file instead of prompt file
  • Run formatting and fix all formatting issues
  • Use .md extension to match convention (not .agent.md)

Testing

  • All unit tests passing
  • Manual testing confirmed:
    • Init command creates agent file at .github/agents/create-agentic-workflow.md
    • Old prompt file is removed if it exists
    • Success message displays correct agent path: @.github/agents/create-agentic-workflow.md
    • Makefile sync works correctly with new file structure
    • Build completes successfully
    • All code properly formatted

Implementation Details

The conversion involved:

  1. Converting frontmatter from prompt format (description, tools array as string, model) to agent format (name, description, tools array)
  2. Creating new helper function ensureAgentFromTemplate similar to ensurePromptFromTemplate but for agents directory
  3. Updating ensureAgenticWorkflowPrompt to remove old prompt files instead of creating them
  4. Updating all test assertions to check for agent files instead of prompt files
  5. Updating Makefile to sync from .github/agents/ instead of .github/prompts/
  6. Running make fmt to ensure all code is properly formatted
  7. Using .md extension to match the repository convention for custom agents (same as technical-doc-writer.md)
Original prompt
  • convert create-agentic-workflow.prompt.md to an custom agent
  • update "init" command to delete create-agentic-workflow.prompt.md and write agents/create-agentic-workflow.agent.md

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

Copilot AI and others added 3 commits October 31, 2025 00:14
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
- Created new agent template at pkg/cli/templates/create-agentic-workflow.agent.md
- Agent uses proper frontmatter with 'name', 'description', and 'tools' fields
- Updated init command to create agent file instead of prompt file
- Init command now removes old prompt file if it exists
- Updated all tests to reflect the new agent file structure
- Updated documentation in init_command.go and success messages
- All unit tests passing

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
- Moved .github/prompts/create-agentic-workflow.prompt.md to .github/agents/create-agentic-workflow.agent.md
- Updated Makefile sync-templates to copy agent file instead of prompt file
- Removed old template file pkg/cli/templates/create-agentic-workflow.prompt.md
- All tests passing with new file structure

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Convert create-agentic-workflow prompt to custom agent Convert create-agentic-workflow.prompt.md to custom agent format Oct 31, 2025
Copilot AI requested a review from pelikhan October 31, 2025 00:27
@pelikhan
Copy link
Contributor

@copilot format and fix tests

- Fixed trailing whitespace in agentic_workflow_prompt_test.go
- Reformatted JSON arrays in github-workflow.json schema
- All tests passing

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

Copilot AI commented Oct 31, 2025

@copilot format and fix tests

Done in 2f3f9ff. Ran make fmt which fixed trailing whitespace and reformatted JSON arrays. All tests passing.

Copilot AI requested a review from pelikhan October 31, 2025 00:57
@pelikhan pelikhan marked this pull request as ready for review October 31, 2025 02:52
Copilot AI review requested due to automatic review settings October 31, 2025 02:52
@github-actions
Copy link
Contributor

Agentic Changeset Generator triggered by this pull request.

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 converts the existing create-agentic-workflow.prompt.md file to the custom agent format. The change migrates from GitHub Copilot slash commands to custom agents by converting frontmatter from prompt format to agent format and updating all related infrastructure.

  • Converted frontmatter from prompt format (description, tools array as string, model) to agent format (name, description, tools array)
  • Updated init command to create agent files instead of prompt files and remove old prompt files
  • Modified all tests and documentation to reference the new agent file structure

Reviewed Changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated no comments.

Show a summary per file
File Description
pkg/cli/templates/create-agentic-workflow.agent.md Converted template from prompt to agent format with proper YAML frontmatter
pkg/cli/init_test.go Updated test assertions to verify agent file creation instead of prompt files
pkg/cli/init_command.go Updated command description and success message to reference agent files
pkg/cli/init.go Modified to remove old prompt files and create new agent files
pkg/cli/copilot-prompts.go Added ensureAgentFromTemplate function for agent file management
pkg/cli/compile_instructions_test.go Updated test variable names and error messages for agent files
pkg/cli/commands.go Changed embedded template variable from prompt to agent
pkg/cli/agentic_workflow_prompt_test.go Renamed test functions and updated to test agent functionality
pkg/cli/add_command.go Modified ensureAgenticWorkflowPrompt to remove old files and added ensureAgenticWorkflowAgent
Makefile Updated sync-templates rule to copy from agents directory instead of prompts
.github/workflows/unbloat-docs.lock.yml Updated Node.js action version
.github/agents/create-agentic-workflow.agent.md Converted agent file with proper frontmatter format

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

@pelikhan
Copy link
Contributor

@copilot custom agent markdown files must be under .github/agents but they do not need the .agent.md extension

- Renamed .github/agents/create-agentic-workflow.agent.md to create-agentic-workflow.md
- Renamed pkg/cli/templates/create-agentic-workflow.agent.md to create-agentic-workflow.md
- Updated all references in code, tests, and Makefile
- Custom agent files in .github/agents don't need .agent.md extension, just .md
- Matches convention used by existing technical-doc-writer.md agent
- All tests passing

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

Copilot AI commented Oct 31, 2025

@copilot custom agent markdown files must be under .github/agents but they do not need the .agent.md extension

Fixed in 5553402. Renamed from create-agentic-workflow.agent.md to create-agentic-workflow.md to match the convention used by other agents like technical-doc-writer.md. Updated all references in code, tests, and Makefile.

@pelikhan pelikhan merged commit cf9598e into main Oct 31, 2025
4 checks passed
@pelikhan pelikhan deleted the copilot/convert-create-agentic-workflow branch October 31, 2025 03:15
github-actions bot added a commit that referenced this pull request Oct 31, 2025
This PR updates the documentation based on features merged in the last 24 hours.

## Documentation Updates

### Custom Agent Files (PR #2838, #2837)
- Added comprehensive documentation for custom agent files in the AI Engines reference
- Documented the new imports-based approach for agent files
- Provided migration guide from deprecated `engine.custom-agent` field
- Included examples of creating and using custom agents

### Permission Validation (PR #2843)
- Documented new permission validation behavior in non-strict mode
- Added examples of warning messages when permissions are under-provisioned
- Explained the difference between non-strict and strict mode validation
- Provided actionable guidance for resolving permission warnings

### Agent File Imports (PR #2838)
- Updated Imports reference to explain agent file imports
- Clarified that only one agent file can be imported per workflow
- Cross-referenced Custom Agent Files documentation in Engines reference

## Changes Made

- Updated `docs/src/content/docs/reference/engines.md`:
  - Added "Custom Agent Files" section with creation and usage examples
  - Documented agent file requirements and constraints
  - Provided migration guide from `engine.custom-agent` to `imports`

- Updated `docs/src/content/docs/reference/frontmatter.md`:
  - Added "Permission Validation" subsection under Permissions
  - Documented non-strict mode warning behavior
  - Documented strict mode error behavior
  - Included example warning messages

- Updated `docs/src/content/docs/reference/imports.md`:
  - Added "Agent Files" section
  - Updated "Frontmatter Merging" to mention agent file fields

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
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