Skip to content

Commit 6b95150

Browse files
tmeschterCopilot
andcommitted
Replace symlink-based local dev with build + --plugin-dir workflow
- Rewrite CONTRIBUTING.md: npm install && npm run build + copilot --plugin-dir ./output - Delete scripts/src/local/ (setup, verify, test commands) and verify-local.ts - Update script entries in package.json and scripts/package.json - Add local dev note to README.md sovereign cloud section - Update docs/spec/azure-hosted-copilot-sdk.md to reflect removal Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 8f89590 commit 6b95150

10 files changed

Lines changed: 39 additions & 1510 deletions

File tree

CONTRIBUTING.md

Lines changed: 31 additions & 107 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,7 @@ Install the Azure plugin:
4646

4747
## Local Development Setup
4848

49-
To develop and test skills locally, you'll need to link your cloned repository to the installed plugins folder. This allows you to make changes and see them reflected immediately without reinstalling the plugin.
50-
51-
> **Important:** Do NOT run `/plugin install azure@azure-skills` when developing locally. The symlink setup below IS the installation. Running the install command would create a nested copy that shadows your local changes.
49+
To develop and test skills locally, you build the plugin from source and point Copilot CLI at the build output.
5250

5351
### 1. Fork and Clone the Repository
5452

@@ -58,151 +56,77 @@ git clone https://github.com/YOUR-USERNAME/GitHub-Copilot-for-Azure.git
5856
cd GitHub-Copilot-for-Azure
5957
```
6058

61-
### 2. Install Dependencies
62-
63-
```bash
64-
cd scripts
65-
npm install
66-
cd ..
67-
```
68-
69-
### 3. Set Up Local Development (Recommended)
59+
### 2. Build the Plugin
7060

71-
The easiest way to set up local development is using the provided scripts:
61+
Install dependencies and run the build. This copies the plugin source files into `output/`, stamping version numbers automatically via [Nerdbank.GitVersioning](https://github.com/dotnet/Nerdbank.GitVersioning).
7262

7363
```bash
74-
# From the repository root
75-
cd scripts
76-
77-
# Create the symlink
78-
npm run local setup
79-
80-
# Verify the setup is correct
81-
npm run local verify
82-
```
83-
84-
The setup script will:
85-
- Create a symlink from `~/.copilot/installed-plugins/azure-skills` to your local `plugin/` folder
86-
- Handle Windows junction fallback if admin privileges aren't available
87-
88-
The verify script will:
89-
- Check for nested plugin installs (which shadow your local changes)
90-
- Test that file changes propagate correctly via the symlink
91-
- Compare file contents between local and installed locations
92-
93-
Use `npm run local verify --fix` to automatically fix common issues.
94-
95-
### 3b. Manual Symlink Setup (Alternative)
96-
97-
If you prefer to create the symlink manually:
98-
99-
#### Windows (Command Prompt - Run as Administrator)
100-
101-
```cmd
102-
mklink /J "%USERPROFILE%\.copilot\installed-plugins\azure-skills\azure" "C:\path\to\GitHub-Copilot-for-Azure\plugin"
64+
npm install
65+
npm run build
10366
```
10467

105-
#### Windows (PowerShell - Run as Administrator)
68+
The `output/` directory now contains the fully built plugin, ready for use.
10669

107-
```powershell
108-
New-Item -ItemType Junction -Path "$env:USERPROFILE\.copilot\installed-plugins\azure-skills\azure" -Target "C:\path\to\GitHub-Copilot-for-Azure\plugin"
109-
```
70+
### 3. Run Copilot CLI with the Local Plugin
11071

111-
#### macOS / Linux
72+
Use the `--plugin-dir` flag to point Copilot CLI at your build output:
11273

11374
```bash
114-
ln -s ~/path/to/GitHub-Copilot-for-Azure/plugin ~/.copilot/installed-plugins/azure-skills/azure
75+
copilot --plugin-dir ./output
11576
```
11677

117-
> **Note:** Replace the paths above with your actual cloned repository location.
78+
This loads the locally built plugin instead of any marketplace-installed version.
11879

11980
### 4. Reloading Skills After Changes
12081

121-
After making changes to skills:
82+
After making changes to skill files under `plugin/`:
83+
84+
1. **Rebuild** the plugin to update the `output/` directory:
85+
```bash
86+
npm run build
87+
```
12288

123-
1. **In an active Copilot CLI session**, run:
89+
2. **In an active Copilot CLI session**, run:
12490
```
12591
/skills reload
12692
```
12793
This reloads all skills without restarting the CLI.
12894

129-
2. **Alternatively**, restart the GitHub Copilot CLI to pick up changes.
95+
3. **Alternatively**, restart the Copilot CLI to pick up changes.
13096

131-
> **Tip:** Use `/skills reload` for faster iteration during development.
97+
> **Tip:** Use `/skills reload` after rebuilding for faster iteration during development.
13298
133-
### 5. Verify the Symlink
99+
### 5. Testing Pull Requests Locally
134100

135-
Verify that the symlink was created correctly:
136-
137-
```bash
138-
# Using the verify script (recommended)
139-
cd scripts
140-
npm run local verify
141-
142-
# Or manually:
143-
# Windows (PowerShell)
144-
Get-ChildItem "$env:USERPROFILE\.copilot\installed-plugins" | Format-List
145-
146-
# macOS / Linux
147-
ls -la ~/.copilot/installed-plugins/
148-
```
149-
150-
You should see `azure-skills` pointing to your cloned repository's `plugin` folder.
151-
152-
### 6. Remove an Existing Symlink (If Needed)
153-
154-
If you need to remove or recreate a symlink:
155-
156-
#### Windows (Command Prompt - Run as Administrator)
157-
```cmd
158-
rmdir "%USERPROFILE%\.copilot\installed-plugins\azure-skills"
159-
```
160-
161-
#### Windows (PowerShell - Run as Administrator)
162-
```powershell
163-
Remove-Item "$env:USERPROFILE\.copilot\installed-plugins\azure-skills" -Force
164-
```
165-
166-
#### macOS / Linux
167-
```bash
168-
rm ~/.copilot/installed-plugins/azure-skills
169-
```
170-
171-
### 7. Testing Pull Requests Locally
172-
173-
Once your symlink is set up, you can quickly test any open pull request by checking out its branch. This is especially useful during code review to verify changes work as expected.
101+
You can quickly test any open pull request by checking out its branch and building. This is especially useful during code review to verify changes work as expected.
174102

175103
#### Using GitHub CLI
176104

177105
Install the [GitHub CLI](https://cli.github.com/) if you haven't already, then run:
178106

179107
```bash
180108
gh pr checkout <PR-NUMBER>
109+
npm run build
110+
copilot --plugin-dir ./output
181111
```
182112

183113
For example, to test PR #42:
184114

185115
```bash
186116
gh pr checkout 42
117+
npm run build
118+
copilot --plugin-dir ./output
187119
```
188120

189-
This automatically:
190-
1. Fetches the PR branch from the contributor's fork
191-
2. Creates a local branch tracking the PR
192-
3. Updates your symlinked plugin folder with the PR's changes
193-
194-
After checking out, run `/skills reload` in your Copilot CLI session (or restart the CLI) to pick up the changes and test the skill or feature.
195-
196121
#### Switching Back
197122

198123
To return to the main branch after testing:
199124

200125
```bash
201126
git checkout main
127+
npm run build
202128
```
203129

204-
> **Tip:** You can also use `gh pr checkout <PR-NUMBER> --force` to discard any local changes and switch to the PR branch.
205-
206130
---
207131

208132
## Contributing Skills
@@ -445,11 +369,11 @@ For feature requests, include:
445369

446370
After making changes to a skill:
447371

448-
1. Run `/skills reload` in your Copilot CLI session to reload all skills
449-
2. Test the skill by asking relevant questions
450-
3. Verify all referenced documentation and examples work
451-
452-
> **Tip:** Use `/skills reload` instead of restarting the CLI for faster iteration during development.
372+
1. Rebuild the plugin: `npm run build`
373+
2. Start Copilot CLI with `copilot --plugin-dir ./output`
374+
3. Run `/skills reload` if you already have a session open
375+
4. Test the skill by asking relevant questions
376+
5. Verify all referenced documentation and examples work
453377

454378
### Debugging
455379

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,9 @@ By default, the Azure MCP server connects to the Azure Public Cloud. If you use
7474

7575
### Copilot CLI
7676

77-
After installing the plugin, the skills are installed in `~/.copilot/installed-plugins/` on macOS/Linux (or `%USERPROFILE%\.copilot\installed-plugins\` on Windows). Edit the `<skill_installation_dir>/azure-skills/azure/.mcp.json` file in the installed plugin directory to add the `--cloud` argument:
77+
After installing the plugin from the marketplace, the skills are installed in `~/.copilot/installed-plugins/` on macOS/Linux (or `%USERPROFILE%\.copilot\installed-plugins\` on Windows). Edit the `<skill_installation_dir>/azure-skills/azure/.mcp.json` file in the installed plugin directory to add the `--cloud` argument:
78+
79+
> **Note:** If you are developing locally using `copilot --plugin-dir ./output`, edit `output/.mcp.json` in your local build output instead.
7880
7981
**Azure China Cloud:**
8082

docs/spec/azure-hosted-copilot-sdk.md

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,14 +56,9 @@ The `azure-hosted-copilot-sdk` skill enables users to build, deploy, and configu
5656
| `tests/utils/regression-detectors.ts` | Regression detectors (secrets, ACR spirals, port confusion, etc.) ||
5757
| `tests/_template/unit.test.ts` | Unit test template for new skills ||
5858

59-
### Local Dev Tooling — ✅ Complete
59+
### Local Dev Tooling — 🔄 Replaced
6060

61-
| File | Purpose | Status |
62-
|------|---------|--------|
63-
| `scripts/src/local/cli.ts` | Local development CLI (`npm run local`) ||
64-
| `scripts/src/local/commands/setup.ts` | Plugin + MCP server registration ||
65-
| `scripts/src/local/commands/verify.ts` | Health checks for plugin and MCP servers ||
66-
| `scripts/src/local/commands/test.ts` | Live validation of the local plugin ||
61+
The local development scripts (`scripts/src/local/`) have been replaced by the Gulp build system. Developers now run `npm run build` at the repo root and use `copilot --plugin-dir ./output` to test locally.
6762

6863
### What Changed in This PR
6964

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"scripts": {
77
"build": "gulp",
88
"tokens": "cd scripts && npm run tokens --",
9-
"verify-local": "cd scripts && npm run verify-local",
9+
"verify-local": "echo 'Removed: use npm run build + copilot --plugin-dir ./output instead'",
1010
"test": "cd scripts && npm test",
1111
"test:skills": "cd tests && npm test --",
1212
"test:skills:integration": "cd tests && npm run test:integration --",

scripts/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88
"checkCopilotCliCharBudget": "node --import tsx src/copilot-cli-char-budget.ts",
99
"checkPluginVersionPr": "node --import tsx src/check-plugin-version-pr.ts",
1010
"tokens": "node --import tsx src/tokens/cli.ts",
11-
"local": "node --import tsx src/local/cli.ts",
11+
"local": "echo 'Removed: use npm run build at repo root + copilot --plugin-dir ./output instead'",
1212
"references": "node --import tsx src/references/cli.ts",
1313
"frontmatter": "node --import tsx src/frontmatter/cli.ts",
14-
"verify-local": "node --import tsx src/verify-local.ts",
14+
"verify-local": "echo 'Removed: use npm run build at repo root + copilot --plugin-dir ./output instead'",
1515
"test": "vitest run",
1616
"test:watch": "vitest",
1717
"test:coverage": "vitest run --coverage",

scripts/src/local/cli.ts

Lines changed: 0 additions & 85 deletions
This file was deleted.

0 commit comments

Comments
 (0)