Skip to content

Commit 764efb9

Browse files
authored
Merge pull request #84 from Automattic/vscode-extension-scaffold
Add VS Code Studio connector scaffold
2 parents d0ae710 + 8d5b0cd commit 764efb9

18 files changed

Lines changed: 1247 additions & 26 deletions

File tree

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ Generated outputs are available for:
4343
- Qodo
4444
- Roo Code
4545
- Devin Desktop
46+
- VS Code Marketplace extension scaffold
4647
- Zed
4748

4849
The shared WordPress workflow:
@@ -95,9 +96,10 @@ Each build packages the shared `skills/` directory into the surfaces that can co
9596
| Qodo | `plugins/qodo/` | `AGENTS.md`, `skills/`, MCP setup documented for Qodo Agentic Tools |
9697
| Roo Code | `plugins/roo-code/` | `.roo/mcp.json`, `.roo/rules/`, `.roo/rules-code/`, `skills/` |
9798
| Devin Desktop | `plugins/devin-desktop/` | `.devin/rules/`, `mcp_config.json`, `skills/` |
99+
| VS Code Marketplace extension scaffold | `plugins/vscode/` | `package.json`, `extension.js`, `mcp.json`, `skills/` |
98100
| Zed | `plugins/zed/` | `AGENTS.md`, `.agents/skills/`, `.zed/settings.json` |
99101

100-
Some outputs intentionally stop at workspace files or setup guidance because that is what the official agent surface supports today. For example, Pi does not expose built-in MCP configuration, Qodo documents MCP through Agentic Tools or enterprise allow-lists, and Conductor keeps MCP setup in app/provider settings rather than a repository-local MCP file. Devin Desktop output lives under `plugins/devin-desktop/`; Cascade's official MCP config destination still uses `~/.codeium/windsurf/mcp_config.json`.
102+
Some outputs intentionally stop at workspace files or setup guidance because that is what the official agent surface supports today. For example, Pi does not expose built-in MCP configuration, Qodo documents MCP through Agentic Tools or enterprise allow-lists, and Conductor keeps MCP setup in app/provider settings rather than a repository-local MCP file. Devin Desktop output lives under `plugins/devin-desktop/`; Cascade's official MCP config destination still uses `~/.codeium/windsurf/mcp_config.json`. The VS Code output is a generated extension scaffold with the Automattic Marketplace publisher and no Marketplace publishing automation.
101103

102104
## Testing
103105

docs/architecture.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ Repository-native names used across the source and generated outputs:
6666
├── qodo/
6767
├── roo-code/
6868
├── devin-desktop/
69+
├── vscode/
6970
└── zed/
7071
```
7172

@@ -151,6 +152,8 @@ Build with WordPress does not own WordPress site storage, Studio authentication,
151152

152153
Generated output packages are repository-local files. Some agents consume package metadata or marketplace manifests, while other agents consume workspace instructions, MCP config files, or setup notes. The verification script documents which boundary each surface currently supports.
153154

155+
The VS Code output is a repository-generated extension scaffold. It uses the Automattic Marketplace publisher and lightweight local commands, but publishing credentials and Marketplace release automation remain outside this repository until maintainers explicitly add that workflow.
156+
154157
## Failure modes and invariants
155158

156159
| Area | Failure mode | Invariant or recovery path |

docs/generated-outputs.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,13 @@ pnpm build:telemetry-mcp
5050
| Qodo | `plugins/qodo/` | `AGENTS.md`, `skills/`, and MCP setup guidance for Qodo Agentic Tools. |
5151
| Roo Code | `plugins/roo-code/` | `.roo/mcp.json`, `.roo/rules/`, `.roo/rules-code/`, `skills/`. |
5252
| Devin Desktop | `plugins/devin-desktop/` | `.devin/rules/`, `mcp_config.json`, `skills/`. The generated output uses the Devin Desktop name; Cascade's official MCP config destination still uses `~/.codeium/windsurf/mcp_config.json`. |
53+
| VS Code Marketplace extension scaffold | `plugins/vscode/` | `package.json`, `extension.js`, `mcp.json`, `skills/`. Publisher is `automattic`. |
5354
| Zed | `plugins/zed/` | `AGENTS.md`, `.agents/skills/`, `.zed/settings.json`. |
5455

5556
Some surfaces support a complete plugin/marketplace package. Others only support workspace instructions, local settings, or user-facing setup notes. The generator should use the best supported native integration point for each surface.
5657

58+
The VS Code output is intentionally a scaffold, not a publishing workflow. It includes Marketplace-shaped extension metadata, the Automattic publisher, command contributions, a thin JavaScript runtime, the bundled MCP config, and shared skills. Add packaging credentials and release automation outside this generated output before attempting Marketplace publication.
59+
5760
## Shared generated contracts
5861

5962
### Skill packaging
@@ -110,6 +113,7 @@ Several surfaces require package metadata. Verification checks representative fi
110113
- MCP config path such as `./.mcp.json`
111114
- marketplace entries pointing to the generated plugin path
112115
- schema URLs and package metadata required by a surface
116+
- publishing identity and release credentials for Marketplace surfaces
113117

114118
Keep these values stable unless the corresponding agent surface changes its contract.
115119

docs/skills-and-integrations.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ The current generated surfaces are listed in the top-level README and [Generated
6262

6363
| Group | Examples | Integration style |
6464
| --- | --- | --- |
65-
| Plugin or marketplace packages | Codex, Claude Code, Cursor, Factory, Hermes, OpenClaw, Pi | Generated manifests, package metadata, marketplace entries, and skills. |
65+
| Plugin or marketplace packages | Codex, Claude Code, Cursor, Factory, Hermes, OpenClaw, Pi, VS Code | Generated manifests, package metadata, marketplace entries or extension scaffolds, and skills. |
6666
| Workspace instruction surfaces | Aider, Gemini, Qodo, Zed | Generated agent instructions plus skills or setup notes. |
6767
| MCP-configurable workspaces | Amp, Cline, Continue, Copilot, Devin, Junie, Kilo Code, OpenCode, Roo Code, Windsurf | Generated MCP config in the agent's native location plus skills/instructions. |
6868
| App/provider configured surfaces | Conductor and some Qodo use cases | Generated setup notes or settings where repository-local MCP config is not the supported path. |
@@ -130,6 +130,8 @@ The shared WordPress workflow can produce three design preview directions before
130130
5. Add verification for the generated files users or marketplaces will consume.
131131
6. Document the new surface in `README.md` and [Generated outputs](generated-outputs.md).
132132

133+
For VS Code Marketplace work, keep the generated scaffold separate from publishing. The generated manifest uses the Automattic Marketplace publisher, and this repository should not store Marketplace credentials.
134+
133135
## Safe extension boundaries
134136

135137
- Add reusable WordPress behavior in `skills/`.

plugins/vscode/README.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# WordPress Studio for VS Code
2+
3+
This is the smallest useful VS Code extension scaffold generated by Build with WordPress. It does not publish anything to the Marketplace from this repository.
4+
5+
## What it includes
6+
7+
- `package.json` with VS Code extension metadata and command contributions.
8+
- `extension.js` with thin commands to check whether `studio` is available and to show or copy the bundled MCP config.
9+
- `mcp.json` with `wordpress-studio` and `wordpress-telemetry` server entries.
10+
- `skills/` as reference Build with WordPress playbooks for editor users and future extension behavior.
11+
12+
## Marketplace placeholder
13+
14+
The manifest uses the Visual Studio Marketplace publisher `automattic`. This repo intentionally does not include publish automation or Marketplace credentials.
15+
16+
## Commands
17+
18+
- `WordPress Studio: Check Studio CLI` runs `studio --version` and reports whether the CLI is on `PATH`.
19+
- `WordPress Studio: Show MCP Config` opens the bundled `mcp.json` in an untitled JSON editor.
20+
- `WordPress Studio: Copy MCP Config` copies the bundled `mcp.json` to the clipboard.
21+
22+
## Included skills
23+
24+
- `auditing`
25+
- `block-creator`
26+
- `design-previews-creator`
27+
- `plugin-creator`
28+
- `site-creator`
29+
- `studio`
30+
- `theme-creator`
31+
- `wordpress-creator`

plugins/vscode/extension.js

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
const vscode = require("vscode");
2+
const { execFile } = require("child_process");
3+
const { readFile } = require("fs/promises");
4+
const path = require("path");
5+
6+
function runStudioVersion() {
7+
return new Promise((resolve, reject) => {
8+
execFile("studio", ["--version"], { timeout: 10000 }, (error, stdout, stderr) => {
9+
if (error) {
10+
reject(new Error(stderr || error.message));
11+
return;
12+
}
13+
resolve((stdout || stderr).trim());
14+
});
15+
});
16+
}
17+
18+
async function readMcpConfig(context) {
19+
return readFile(path.join(context.extensionPath, "mcp.json"), "utf8");
20+
}
21+
22+
async function checkStudio() {
23+
try {
24+
const version = await runStudioVersion();
25+
vscode.window.showInformationMessage(
26+
version ? "Studio CLI is available: " + version : "Studio CLI is available."
27+
);
28+
} catch (error) {
29+
vscode.window.showErrorMessage(
30+
"Studio CLI was not found. Install WordPress Studio and ensure the studio command is on PATH. " + error.message
31+
);
32+
}
33+
}
34+
35+
async function showMcpConfig(context) {
36+
const config = await readMcpConfig(context);
37+
const document = await vscode.workspace.openTextDocument({
38+
content: config,
39+
language: "json",
40+
});
41+
await vscode.window.showTextDocument(document, { preview: true });
42+
}
43+
44+
async function copyMcpConfig(context) {
45+
const config = await readMcpConfig(context);
46+
await vscode.env.clipboard.writeText(config);
47+
vscode.window.showInformationMessage("Copied WordPress Studio MCP config to the clipboard.");
48+
}
49+
50+
function activate(context) {
51+
context.subscriptions.push(
52+
vscode.commands.registerCommand("wordpressStudio.checkStudio", checkStudio),
53+
vscode.commands.registerCommand("wordpressStudio.showMcpConfig", () => showMcpConfig(context)),
54+
vscode.commands.registerCommand("wordpressStudio.copyMcpConfig", () => copyMcpConfig(context))
55+
);
56+
}
57+
58+
function deactivate() {}
59+
60+
module.exports = {
61+
activate,
62+
deactivate,
63+
};

plugins/vscode/mcp.json

Lines changed: 20 additions & 0 deletions
Large diffs are not rendered by default.

plugins/vscode/package.json

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
{
2+
"name": "wordpress-studio-vscode",
3+
"displayName": "WordPress Studio",
4+
"publisher": "automattic",
5+
"version": "0.1.0",
6+
"description": "Use WordPress Studio MCP from VS Code and copy the Build with WordPress MCP configuration.",
7+
"author": {
8+
"name": "Automattic"
9+
},
10+
"homepage": "https://developer.wordpress.com/",
11+
"repository": {
12+
"type": "git",
13+
"url": "https://github.com/Automattic/build-with-wordpress.git"
14+
},
15+
"license": "GPL-2.0-or-later",
16+
"engines": {
17+
"vscode": "^1.95.0"
18+
},
19+
"categories": [
20+
"Other"
21+
],
22+
"keywords": [
23+
"wordpress",
24+
"studio",
25+
"mcp",
26+
"wp-cli"
27+
],
28+
"activationEvents": [
29+
"onCommand:wordpressStudio.checkStudio",
30+
"onCommand:wordpressStudio.showMcpConfig",
31+
"onCommand:wordpressStudio.copyMcpConfig"
32+
],
33+
"main": "./extension.js",
34+
"contributes": {
35+
"commands": [
36+
{
37+
"command": "wordpressStudio.checkStudio",
38+
"title": "WordPress Studio: Check Studio CLI"
39+
},
40+
{
41+
"command": "wordpressStudio.showMcpConfig",
42+
"title": "WordPress Studio: Show MCP Config"
43+
},
44+
{
45+
"command": "wordpressStudio.copyMcpConfig",
46+
"title": "WordPress Studio: Copy MCP Config"
47+
}
48+
]
49+
}
50+
}
Lines changed: 148 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,148 @@
1+
---
2+
name: auditing
3+
description: Audit a Studio-backed WordPress site for performance, accessibility, and visible frontend quality issues, then recommend or validate improvements.
4+
---
5+
6+
# Auditing
7+
8+
Use this skill when the user wants to review, optimize, or verify an existing WordPress site rather than primarily build new functionality.
9+
10+
## Ownership
11+
12+
This skill owns:
13+
14+
- performance audits using Studio MCP tools
15+
- accessibility-focused review of color, contrast, motion, and readability
16+
- visible frontend quality review when the user asks for QA or polish
17+
- before-and-after audit comparison after fixes
18+
19+
Use `studio` for site resolution, screenshots, and MCP tool usage details.
20+
21+
## Principle
22+
23+
Start with the smallest audit that answers the user's request.
24+
25+
- If the user asks about speed, Core Web Vitals, or performance, prioritize the performance workflow.
26+
- If the user asks about accessibility, contrast, readability, or color usage, prioritize the accessibility workflow.
27+
- If the user asks for a general review, combine the relevant sections and keep the report practical.
28+
29+
Do not invent automated checks that the available tools do not provide. When a conclusion comes from visual inspection or code reading rather than a dedicated tool, say so.
30+
31+
## Workflow
32+
33+
### 1. Resolve the target site
34+
35+
Use `studio` to:
36+
37+
- identify the site
38+
- ensure it is running
39+
- confirm the page or URL path to review
40+
41+
If the user did not specify a page, default to `/`.
42+
43+
### 2. Pick the audit scope
44+
45+
Choose one or more of:
46+
47+
- Performance Audit
48+
- Accessibility Review
49+
- Visual QA
50+
51+
Tell the user which scope you are using when it is not obvious from the request.
52+
53+
Once you begin the actual audit workflow, call `record_workflow_event` with `workflow: "auditing"` and `stage: "started"`.
54+
55+
### 3. Performance Audit
56+
57+
Use `need_for_speed` for the requested path.
58+
59+
Interpret at least:
60+
61+
- TTFB
62+
- FCP
63+
- LCP
64+
- CLS
65+
- total page weight
66+
- request count
67+
- DOM size
68+
- JS, CSS, image, and font breakdown
69+
70+
Use these baseline thresholds:
71+
72+
| Metric | Good | Needs Improvement | Poor |
73+
|-------|------|-------------------|------|
74+
| TTFB | < 800 ms | 800-1800 ms | > 1800 ms |
75+
| FCP | < 1800 ms | 1800-3000 ms | > 3000 ms |
76+
| LCP | < 2500 ms | 2500-4000 ms | > 4000 ms |
77+
| CLS | < 0.1 | 0.1-0.25 | > 0.25 |
78+
79+
Use these page-composition warning signs:
80+
81+
- DOM elements above 1500
82+
- total page weight above 3 MB
83+
- total requests above 80
84+
- scripts above 20 files or 500 KB total
85+
- stylesheets above 10 files or 200 KB total
86+
87+
Translate findings into WordPress-specific actions where possible, such as:
88+
89+
- reducing or replacing heavy plugins
90+
- deferring or removing non-critical JS
91+
- reducing oversized images
92+
- trimming unused theme CSS
93+
- checking duplicate font loads
94+
- simplifying wrapper-heavy block layouts
95+
96+
### 4. Accessibility Review
97+
98+
Use `take_screenshot` plus theme or plugin code inspection as needed.
99+
100+
Focus on issues this repo can realistically help with:
101+
102+
- low text/background contrast
103+
- weak CTA contrast or ambiguous button states
104+
- missing or unclear hover and focus states
105+
- motion that should respect `prefers-reduced-motion`
106+
- readability issues caused by font size, line height, or dense layouts
107+
- color choices that make important information hard to distinguish
108+
109+
When the issue is visual, prefer `take_screenshot`-backed observations. Use `inspect_design` when the rendered DOM or computed styles would identify the root cause faster than code inspection.
110+
111+
When the issue appears structural, inspect the relevant theme or plugin files before recommending a fix.
112+
113+
### 5. Visual QA
114+
115+
When the user wants a broader quality pass, use `take_screenshot` to check:
116+
117+
- spacing and alignment
118+
- responsive layout issues
119+
- broken visual hierarchy
120+
- inconsistent component styling
121+
- awkward cropping or media balance
122+
123+
Keep this section focused on visible problems that materially affect the site.
124+
125+
### 6. Report clearly
126+
127+
Summarize:
128+
129+
- what you audited
130+
- the most important findings
131+
- the likely causes
132+
- the highest-value next fixes
133+
134+
Prefer a short prioritized report over a long exhaustive list.
135+
136+
### 7. Re-test after changes
137+
138+
If fixes are made during the same task, re-run the relevant audit steps and compare before versus after.
139+
140+
Call out what improved, what did not, and any remaining tradeoffs.
141+
142+
When the audit workflow is complete, call `record_workflow_event` with `workflow: "auditing"` and `stage: "completed"`.
143+
144+
## Important notes
145+
146+
- `need_for_speed` results are synthetic measurements from a local Studio environment. Use them primarily for diagnosis and before-versus-after comparison, not as production truth.
147+
- Accessibility observations in this workflow are often based on visual review and code inspection rather than a dedicated automated accessibility scanner.
148+
- When performance, accessibility, and design issues conflict, explain the tradeoff instead of over-optimizing one dimension silently.

0 commit comments

Comments
 (0)