Skip to content

Add Copilot on Rails UI#1434

Draft
motm32 wants to merge 1 commit intomainfrom
meganmott/CopilotOnRailsUI
Draft

Add Copilot on Rails UI#1434
motm32 wants to merge 1 commit intomainfrom
meganmott/CopilotOnRailsUI

Conversation

@motm32
Copy link
Copy Markdown
Contributor

@motm32 motm32 commented Apr 28, 2026

This PR adds the commands to open the view within the webview package and adds the custom agents that hooks up the UI with the skills.

ToDo:

  • Update webview package once released
  • Add deploy custom agent if necessary

Copilot AI review requested due to automatic review settings April 28, 2026 21:11
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

This PR integrates “Copilot on Rails” capabilities into the Azure Resource Groups VS Code extension by wiring in the azext-webview package, registering new commands to open plan views, and adding custom chat agent definitions to support a guided workflow.

Changes:

  • Register azext-webview extension variables and add new commands for creating projects and opening plan views.
  • Add a helper to open Copilot Chat with a named agent, plus “hand-off” commands for plan → scaffold → verify → local dev.
  • Contribute new chat agent markdown definitions and update extension/package metadata (commands, NLS strings, deps).

Reviewed changes

Copilot reviewed 8 out of 9 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
src/extension.ts Registers webview extension variables during activation.
src/commands/registerCommands.ts Adds Copilot on Rails commands + hand-off commands that invoke chat agents.
src/commands/copilotOnRails/openChatWithAgent.ts New helper to open chat with a specified agent/prompt.
resources/agents/azure-project-plan.agent.md New “plan” agent definition for the workflow.
resources/agents/azure-project-scaffold.agent.md New “scaffold” agent definition + workflow hand-offs.
resources/agents/azure-local-development.agent.md New “local dev” agent definition.
package.nls.json Adds localized titles for the new commands.
package.json Contributes chatAgents and new commands; updates dependencies to include azext-webview and a local azext-utils tarball.
package-lock.json Updates lockfile for new deps (including local tarball references).

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

Comment on lines +38 to +42
Follow the authoritative guidance in the `azure-project-plan` skill:

📖 **Read and follow:** `.agents/skills/azure-project-plan/SKILL.md`

That skill is the canonical, mandatory source for this phase. Treat it as your operating manual — do not improvise or substitute steps. **Exception:** the "Critical workflow rule" above overrides anything in the skill regarding preview-opening and hand-off mechanics.
Copy link

Copilot AI Apr 28, 2026

Choose a reason for hiding this comment

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

This agent references .agents/skills/azure-project-plan/SKILL.md, but there is no .agents/ directory in this repo. If the agent is expected to read this file at runtime, the workflow will fail. Either add the referenced skill files to the extension/package, or update the reference to the actual location of the skill content.

Suggested change
Follow the authoritative guidance in the `azure-project-plan` skill:
📖 **Read and follow:** `.agents/skills/azure-project-plan/SKILL.md`
That skill is the canonical, mandatory source for this phase. Treat it as your operating manual — do not improvise or substitute steps. **Exception:** the "Critical workflow rule" above overrides anything in the skill regarding preview-opening and hand-off mechanics.
Follow this authoritative workflow for the planning phase:
1. Gather the user's requirements, constraints, success criteria, and target Azure services.
2. Produce `.azure/project-plan.md` as the single source of truth for implementation.
3. Ensure the plan includes:
- project goals and scope
- architecture and Azure resource choices
- data model and storage decisions
- API surface and backend responsibilities
- frontend or client experience requirements
- deployment, security, and operational considerations
- assumptions, risks, and open questions
4. Do not scaffold, implement, or hand-wave technical decisions during this phase; focus on producing an actionable plan that the next agent can execute.
5. Ask focused follow-up questions when requirements are missing or ambiguous.
6. Revise the plan until the user approves it.
This section is the canonical, mandatory source for this phase. Treat it as your operating manual — do not improvise or substitute steps. **Exception:** the "Critical workflow rule" above overrides anything here regarding preview-opening and hand-off mechanics.

Copilot uses AI. Check for mistakes.
Comment on lines +45 to +48
Follow the authoritative guidance in the `azure-project-scaffold` skill:

📖 **Read and follow:** [`.agents/skills/azure-project-scaffold/SKILL.md`]
That skill is the canonical, mandatory source for this phase. Treat it as your operating manual — do not improvise or substitute steps. **Exception:** the "Critical workflow rule" above governs how the final answer is handled — always route through the matching `run_vscode_command` call, never start the next phase inline.
Copy link

Copilot AI Apr 28, 2026

Choose a reason for hiding this comment

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

This agent references .agents/skills/azure-project-scaffold/SKILL.md, but there is no .agents/ directory in this repo. If the agent is expected to read this file at runtime, the workflow will fail. Either add the referenced skill files to the extension/package, or update the reference to the actual location of the skill content.

Suggested change
Follow the authoritative guidance in the `azure-project-scaffold` skill:
📖 **Read and follow:** [`.agents/skills/azure-project-scaffold/SKILL.md`]
That skill is the canonical, mandatory source for this phase. Treat it as your operating manual — do not improvise or substitute steps. **Exception:** the "Critical workflow rule" above governs how the final answer is handled — always route through the matching `run_vscode_command` call, never start the next phase inline.
Follow the workflow defined in this agent file as the authoritative guidance for the `azure-project-scaffold` phase.
Treat these instructions as your operating manual — do not improvise or substitute steps. Scaffold the project strictly from the approved `.azure/project-plan.md`, creating the frontend preview, backend services, database setup, and API routes described by that plan, and ensure the resulting project is wired together and buildable. **Exception:** the "Critical workflow rule" above governs how the final answer is handled — always route through the matching `run_vscode_command` call, never start the next phase inline.

Copilot uses AI. Check for mistakes.
Comment thread package.json
"path": "resources/agents/azure-project-scaffold.agent.md"
},
{
"path": "resources/agents/azure-local-development.agent.md"
Copy link

Copilot AI Apr 28, 2026

Choose a reason for hiding this comment

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

contributes.chatAgents doesn’t include an entry for azure-project-test, but the extension registers a command that attempts to open chat in that mode. Add the missing agent contribution (and its .agent.md file) or remove/rename the command so it only targets contributed agents.

Suggested change
"path": "resources/agents/azure-local-development.agent.md"
"path": "resources/agents/azure-local-development.agent.md"
},
{
"path": "resources/agents/azure-project-test.agent.md"

Copilot uses AI. Check for mistakes.
Comment thread package.json
"@microsoft/vscode-azext-azureutils": "^4.1.0",
"@microsoft/vscode-azext-utils": "^4.0.4",
"@microsoft/vscode-azext-utils": "file:../vscode-azuretools/utils/microsoft-vscode-azext-utils-4.0.7.tgz",
"@microsoft/vscode-azext-webview": "file:../vscode-azuretools/webview/microsoft-vscode-azext-webview-1.0.0.tgz",
Copy link

Copilot AI Apr 28, 2026

Choose a reason for hiding this comment

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

Dependencies are set to local file:../vscode-azuretools/...*.tgz paths. This makes npm install non-reproducible for anyone who doesn’t have that sibling directory (and typically breaks CI and external contributor workflows). Prefer a published semver version (or a git URL) and keep local file overrides out of the checked-in manifest.

Suggested change
"@microsoft/vscode-azext-webview": "file:../vscode-azuretools/webview/microsoft-vscode-azext-webview-1.0.0.tgz",
"@microsoft/vscode-azext-webview": "1.0.0",

Copilot uses AI. Check for mistakes.
Comment on lines +27 to +32
Follow the authoritative guidance in the `azure-local-development` skill:

📖 **Read and follow:** `.agents/skills/azure-local-development/SKILL.md`

That skill is the canonical, mandatory source for this phase. Treat it as your operating manual — do not improvise or substitute steps. **Exception:** the "Critical workflow rule" above overrides anything in the skill. Always run `azureResourceGroups.openLocalPlanView` immediately after writing the local-dev plan file.

Copy link

Copilot AI Apr 28, 2026

Choose a reason for hiding this comment

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

This agent references .agents/skills/azure-local-development/SKILL.md, but there is no .agents/ directory in this repo. If the agent is expected to read this file at runtime, the workflow will fail. Either add the referenced skill files to the extension/package, or update the reference to the actual location of the skill content.

Suggested change
Follow the authoritative guidance in the `azure-local-development` skill:
📖 **Read and follow:** `.agents/skills/azure-local-development/SKILL.md`
That skill is the canonical, mandatory source for this phase. Treat it as your operating manual — do not improvise or substitute steps. **Exception:** the "Critical workflow rule" above overrides anything in the skill. Always run `azureResourceGroups.openLocalPlanView` immediately after writing the local-dev plan file.
Follow the guidance in this agent file as the authoritative instructions for the `azure-local-development` phase.
Treat this document as your operating manual for setting up local development — do not improvise or substitute steps. **Exception:** the "Critical workflow rule" above overrides all other instructions here. Always run `azureResourceGroups.openLocalPlanView` immediately after writing the local-dev plan file.

Copilot uses AI. Check for mistakes.
Comment thread package.nls.json
}
},
"azureResourceGroups.createProjectWithCopilot": "Create Project with Copilot",
"azureResourceGroups.openPlanView": "Open Scaffold Plan View",
Copy link

Copilot AI Apr 28, 2026

Choose a reason for hiding this comment

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

The command title for azureResourceGroups.openPlanView is "Open Scaffold Plan View", but the agent workflow text calls this "Open Plan View". Consider renaming the localized title to match the workflow terminology to avoid user confusion (and to keep the run_vscode_command "name" fields consistent with what users see).

Suggested change
"azureResourceGroups.openPlanView": "Open Scaffold Plan View",
"azureResourceGroups.openPlanView": "Open Plan View",

Copilot uses AI. Check for mistakes.
Comment on lines +9 to +11
await commands.executeCommand('workbench.action.chat.open', {
mode: agentName,
query: prompt,
Copy link

Copilot AI Apr 28, 2026

Choose a reason for hiding this comment

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

openChatWithAgent likely won’t open the intended custom chat agent. Elsewhere in this repo, agent selection is done by prefixing the query with @<agent> (and often calling workbench.action.chat.newChat first), while mode is either omitted or set to 'agent'. Consider aligning with the existing pattern so the hand-off reliably targets the named agent and starts a fresh chat session.

Suggested change
await commands.executeCommand('workbench.action.chat.open', {
mode: agentName,
query: prompt,
await commands.executeCommand('workbench.action.chat.newChat');
await commands.executeCommand('workbench.action.chat.open', {
mode: 'agent',
query: `@${agentName} ${prompt}`,

Copilot uses AI. Check for mistakes.
registerCommand('azureResourceGroups.startProjectScaffold', (_context: IActionContext, prompt?: string) =>
openChatWithAgent('azure-project-scaffold', prompt ?? 'The project plan has been approved. Execute it now — scaffold the frontend preview, backend services, database, and API routes following `.azure/project-plan.md`.'));
registerCommand('azureResourceGroups.startProjectTest', (_context: IActionContext, prompt?: string) =>
openChatWithAgent('azure-project-test', prompt ?? 'Scaffolding is complete. Add test coverage and runtime validation to the scaffolded project.'));
Copy link

Copilot AI Apr 28, 2026

Choose a reason for hiding this comment

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

The hand-off command azureResourceGroups.startProjectTest opens chat with agent name azure-project-test, but this PR doesn’t contribute a corresponding chat agent (no resources/agents/azure-project-test.agent.md and it isn’t listed in contributes.chatAgents). Either add/contribute the missing agent or change the hand-off to target one of the agents that actually exists.

Suggested change
openChatWithAgent('azure-project-test', prompt ?? 'Scaffolding is complete. Add test coverage and runtime validation to the scaffolded project.'));
openChatWithAgent('azure-local-development', prompt ?? 'Scaffolding is complete. Add test coverage and runtime validation to the scaffolded project.'));

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