Skip to content

Update gh aw init to create the Agentic Workflows custom agent#35773

Merged
pelikhan merged 17 commits into
mainfrom
copilot/update-init-command-for-agents
May 29, 2026
Merged

Update gh aw init to create the Agentic Workflows custom agent#35773
pelikhan merged 17 commits into
mainfrom
copilot/update-init-command-for-agents

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 29, 2026

gh aw init only created the dispatcher skill, so repositories were missing the .github/agents/agentic-workflows.md custom agent needed to invoke that skill directly. This change teaches init to generate both artifacts by default, while adding explicit opt-outs for each.

  • Init output

    • Create .github/agents/agentic-workflows.md during gh aw init
    • Keep the generated agent name as Agentic Workflows
    • Generate the agent as a concise file index that includes:
      • .github/skills/agentic-workflows/SKILL.md
      • the available top-level .github/aw/*.md prompts with short purposes
    • Reference .github/aw/*.md prompts using a shared canonical base URL instruction (https://github.com/github/gh-aw/blob/main/.github/aw) and concise per-file .github/aw/<file>.md entries (without repeating the full URL per line)
    • Keep the checked-in repository agent file aligned with the generated output so it can be tested directly in this repository
    • Harden prompt path handling with validation to prevent escaped paths when building the prompt inventory
  • CLI surface

    • Add --no-skill to skip .github/skills/agentic-workflows/SKILL.md
    • Add --no-agent to skip .github/agents/agentic-workflows.md
    • Preserve existing engine behavior so non-Copilot init paths still skip Copilot-specific artifacts
  • Docs and coverage

    • Update init help text and setup docs to describe the new default output and flags
    • Extend init tests to cover:
      • default creation of both skill and agent
      • --no-skill
      • --no-agent
      • non-Copilot engine behavior
      • concise prompt inventory generation for the agent file
      • keeping the checked-in repository agent file in sync with generated content
gh aw init
gh aw init --no-skill
gh aw init --no-agent

Copilot AI and others added 2 commits May 29, 2026 19:22
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title Update init to create Agentic Workflows custom agent Update gh aw init to create the Agentic Workflows custom agent May 29, 2026
Copilot AI requested a review from pelikhan May 29, 2026 19:29
Copy link
Copy Markdown
Collaborator

@pelikhan pelikhan left a comment

Choose a reason for hiding this comment

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

@copilot the agent prompt should be a concise, minimal list of files and their purpose. It should include the skill and all prompts in the .github/aw folder to improve prompting performance.

Comment thread pkg/cli/copilot_agents.go
Copilot AI and others added 2 commits May 29, 2026 20:06
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Comment thread .github/agents/agentic-workflows.md Outdated
Copilot AI and others added 2 commits May 29, 2026 20:26
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 29, 2026

@copilot the agent prompt should be a concise, minimal list of files and their purpose. It should include the skill and all prompts in the .github/aw folder to improve prompting performance.

Addressed in 7190401. The generated Agentic Workflows agent is now a concise file index: it always lists .github/skills/agentic-workflows/SKILL.md, includes the available top-level .github/aw/*.md prompts with short summaries, and keeps the checked-in repo agent file in sync with the generated output.

Copilot AI and others added 3 commits May 29, 2026 20:35
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
@pelikhan pelikhan marked this pull request as ready for review May 29, 2026 20:38
Copilot AI review requested due to automatic review settings May 29, 2026 20:38
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy link
Copy Markdown
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

Updates gh aw init so Copilot-engine initialization generates both the Agentic Workflows dispatcher skill and a new .github/agents/agentic-workflows.md custom agent (with --no-skill / --no-agent opt-outs), plus documentation and test coverage to validate the generated agent index content and keep the checked-in agent file in sync.

Changes:

  • Add Skill / Agent toggles to init options and wire them to new --no-skill / --no-agent CLI flags.
  • Implement generation of .github/agents/agentic-workflows.md as a concise index of the dispatcher skill and .github/aw/*.md prompts (sorted + summarized).
  • Extend/init tests and docs to cover default behavior, opt-outs, non-Copilot engines, and checked-in agent sync.
Show a summary per file
File Description
pkg/cli/interfaces_test.go Updates init option construction to include new Skill/Agent toggles.
pkg/cli/init.go Adds conditional creation of dispatcher skill and custom agent during init.
pkg/cli/init_test.go Updates init tests to pass Skill/Agent options.
pkg/cli/init_mcp_test.go Updates MCP init tests to pass Skill/Agent options.
pkg/cli/init_command.go Adds --no-skill / --no-agent flags and wires them into InitOptions.
pkg/cli/init_command_test.go Adds flag/help assertions and new tests for agent file creation + opt-outs.
pkg/cli/copilot_agents.go Implements custom agent generation and prompt summary extraction/sorting.
pkg/cli/copilot_agents_test.go Adds coverage for agent generation details + checked-in file sync.
docs/src/content/docs/setup/cli.md Documents new default outputs and flags for gh aw init.
.github/agents/agentic-workflows.md Adds the checked-in Agentic Workflows custom agent file expected by init/tests.

Copilot's findings

Tip

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

  • Files reviewed: 10/10 changed files
  • Comments generated: 4

Comment thread pkg/cli/init.go
Comment thread pkg/cli/init.go
Comment thread pkg/cli/copilot_agents.go
Comment thread pkg/cli/copilot_agents.go
Comment thread .github/agents/agentic-workflows.md
Copilot AI and others added 4 commits May 29, 2026 21:02
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI requested a review from pelikhan May 29, 2026 21:06
Comment thread pkg/cli/copilot_agents.go
return summary
}

func humanizePromptFilename(name string) 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 read the description field from these files

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.

Implemented in f226d41. The agent index now reads frontmatter description values from .github/aw/*.md when building prompt summaries (with concise normalization), and the checked-in .github/agents/agentic-workflows.md plus tests are updated to stay in sync.

Comment thread .github/agents/agentic-workflows.md Outdated

Read only the files you need:
- `.github/skills/agentic-workflows/SKILL.md` — router skill for workflow create, debug, and upgrade tasks.
- `https://github.com/github/gh-aw/blob/main/.github/aw/github-agentic-workflows.md` — GitHub Agentic Workflows.
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 inline 'https://github.com/github/gh-aw/blob/main/.github/aw' for every file is very verbose. Tell the agents that the files below must be loaded from https://github.com/github/gh-aw/blob/main/.github/aw and don't repeat the URL.

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.

Updated in d5d96ce. The generated agent now states once that .github/aw/*.md prompts must be loaded from https://github.com/github/gh-aw/blob/main/.github/aw, then lists concise .github/aw/<file>.md entries without repeating the full URL.

Copilot AI and others added 2 commits May 29, 2026 21:25
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
@github-actions
Copy link
Copy Markdown
Contributor

``
@copilot review all comments and address unresolved review feedback, then rerun the checks.

Generated by 👨‍🍳 PR Sous Chef · gpt54 15.5M ·

@pelikhan pelikhan merged commit d0575f2 into main May 29, 2026
@pelikhan pelikhan deleted the copilot/update-init-command-for-agents branch May 29, 2026 22:06
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.

3 participants