Skip to content

Commit 2157003

Browse files
committed
Add Dev Proxy agent skill. Closes #341
Closes #341
1 parent c9597b7 commit 2157003

10 files changed

Lines changed: 94 additions & 9 deletions

File tree

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,6 @@ node_modules
66

77
# Coverage reports
88
coverage/
9+
10+
# Skills fetched at build time
11+
skills/

.vscode/launch.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"outFiles": [
1616
"${workspaceFolder}/dist/**/*.js"
1717
],
18-
"preLaunchTask": "${defaultBuildTask}"
18+
"preLaunchTask": "pre-launch"
1919
}
2020
]
2121
}

.vscode/tasks.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,25 @@
4848
"npm: watch-tests"
4949
],
5050
"problemMatcher": []
51+
},
52+
{
53+
"label": "fetch-skill",
54+
"type": "shell",
55+
"command": "bash scripts/fetch-skill.sh",
56+
"presentation": {
57+
"reveal": "silent",
58+
"group": "build"
59+
},
60+
"problemMatcher": []
61+
},
62+
{
63+
"label": "pre-launch",
64+
"dependsOn": [
65+
"fetch-skill",
66+
"npm: watch"
67+
],
68+
"dependsOrder": "sequence",
69+
"problemMatcher": []
5170
}
5271
]
5372
}

.vscodeignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
out/**
44
node_modules/**
55
src/**
6+
scripts/**
7+
skills/**
68
.gitignore
79
.yarnrc
810
webpack.config.js

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99
1010
## [1.27.1] - Unreleased
1111

12+
### Added:
13+
14+
- Agent Skill: [Dev Proxy](https://github.com/dotnet/dev-proxy/tree/main/skills/dev-proxy)
15+
1216
### Fixed:
1317

1418
- Problem matcher: `$devproxy-watch` `beginsPattern` updated to match actual Dev Proxy output

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,12 @@ Run Dev Proxy as a VS Code task for integration with build workflows.
265265

266266
This extension includes an MCP server for AI-assisted development. See [Dev Proxy MCP Server](https://github.com/dev-proxy-tools/mcp) for available tools.
267267

268+
## Agent Skill
269+
270+
This extension contributes a Dev Proxy [agent skill](https://code.visualstudio.com/docs/copilot/customization/agent-skills) for GitHub Copilot. The skill teaches Copilot how to configure Dev Proxy, mock API responses, simulate errors, test rate limiting, and more — without you having to explain the setup every time.
271+
272+
The skill is automatically available when the extension is installed. Type `/dev-proxy` in Copilot Chat to invoke it, or let Copilot load it automatically when your question is relevant.
273+
268274
## Troubleshooting
269275

270276
**View debug logs**

package-lock.json

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"version": "1.27.1",
66
"publisher": "garrytrinder",
77
"engines": {
8-
"vscode": "^1.101.0"
8+
"vscode": "^1.109.0"
99
},
1010
"categories": [
1111
"Snippets",
@@ -120,6 +120,11 @@
120120
"label": "Dev Proxy"
121121
}
122122
],
123+
"chatSkills": [
124+
{
125+
"path": "./dist/skills/dev-proxy/SKILL.md"
126+
}
127+
],
123128
"menus": {
124129
"editor/title": [
125130
{
@@ -273,7 +278,8 @@
273278
"icon": "dist/icon.png",
274279
"homepage": "https://github.com/garrytrinder/dev-proxy-toolkit/blob/main/README.md",
275280
"scripts": {
276-
"vscode:prepublish": "npm run package",
281+
"vscode:prepublish": "npm run fetch-skill && npm run package",
282+
"fetch-skill": "bash scripts/fetch-skill.sh",
277283
"clean": "rm -rf out dist",
278284
"compile": "webpack",
279285
"watch": "webpack --watch",
@@ -292,7 +298,7 @@
292298
"@types/node": "^24.5.2",
293299
"@types/semver": "^7.7.1",
294300
"@types/sinon": "17.0.4",
295-
"@types/vscode": "1.101.0",
301+
"@types/vscode": "1.109.0",
296302
"@typescript-eslint/eslint-plugin": "8.44.1",
297303
"@typescript-eslint/parser": "8.44.1",
298304
"@vscode/test-cli": "^0.0.12",

scripts/fetch-skill.sh

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
# Downloads the Dev Proxy skill from dotnet/dev-proxy main branch.
5+
# The skill files (SKILL.md + references/) are fetched into skills/dev-proxy/
6+
# and are .gitignored — they're bundled into the VSIX at build time.
7+
8+
REPO="dotnet/dev-proxy"
9+
BRANCH="main"
10+
SKILL_PATH="skills/dev-proxy"
11+
TARGET_DIR="skills/dev-proxy"
12+
13+
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
14+
ROOT_DIR="$(cd "$SCRIPT_DIR/.." && pwd)"
15+
16+
echo "Fetching Dev Proxy skill from $REPO@$BRANCH..."
17+
18+
# Clean existing skill directory
19+
rm -rf "$ROOT_DIR/$TARGET_DIR"
20+
mkdir -p "$ROOT_DIR/$TARGET_DIR/references"
21+
22+
BASE_URL="https://raw.githubusercontent.com/$REPO/$BRANCH/$SKILL_PATH"
23+
24+
# Download SKILL.md
25+
curl -fsSL "$BASE_URL/SKILL.md" -o "$ROOT_DIR/$TARGET_DIR/SKILL.md"
26+
27+
# Download reference files
28+
REFERENCES=(
29+
"analyze-api-usage.md"
30+
"best-practices.md"
31+
"ci-cd-integration.md"
32+
"configuration.md"
33+
"installation.md"
34+
"mock-api-responses.md"
35+
"plugin-catalog.md"
36+
"test-api-resilience.md"
37+
"test-llm-apps.md"
38+
)
39+
40+
for ref in "${REFERENCES[@]}"; do
41+
curl -fsSL "$BASE_URL/references/$ref" -o "$ROOT_DIR/$TARGET_DIR/references/$ref"
42+
done
43+
44+
echo "Dev Proxy skill fetched successfully."

webpack.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ const extensionConfig = {
5252
{from: 'src/snippets/yaml-snippets.json', to: '[name][ext]'},
5353
{from: 'src/icon.png', to: '[name][ext]'},
5454
{from: 'LICENSE', to: '[name][ext]'},
55+
{from: 'skills', to: 'skills', globOptions: {ignore: ['**/.DS_Store']}},
5556
],
5657
}),
5758
],

0 commit comments

Comments
 (0)