agentleFS
Microsoft AzureKnown publisherAzure/LogicAppsUX/apps/vs-code-designer/CLAUDE.md

LogicAppsUX / vs-code-designer

CLAUDE.md114 starsChanged 5 months agoMITView on GitHub

The VS Code extension host for Azure Logic Apps. This is the main extension that gets published to the VS Code marketplace. Extension ↔ Webview messaging: The extension is packaged with dependencies: 1. Build: pnpm run build:extension 2. Copy files: Runs extension-copy-svgs.js 3. Install deps: cd dist && npm install 4. Package: vsce package Run Phase 4.2 only (requires workspaces from a prior Phase 4.1 run): Key files: designerActions.test.ts, run-e2e.ts, SKILL.md (detailed learning document)

The file

Show its rules and text

We split this CLAUDE.md into the rules it gives an agent

19 rules. About 0 are common, 11 are distinctive, and 8 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈11

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 8

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Run Phase 4.2 only (requires workspaces from a prior Phase 4.1 run):

    line 96
  2. Distinctive:

    Debugging: Use VS Code's "Run Extension" launch config

    line 124
  3. Distinctive:

    Reload: Use "Developer: Reload Window" after changes

    line 125
  4. Distinctive:

    Logs: Check "Output" panel → "Azure Logic Apps"

    line 126
  5. Very specific:

    Close all editors before opening overview: Call result.webview.switchBack() → driver.switchTo().defaultContent() → new …

    line 159
  6. Distinctive:

    Stateless workflows don't persist run history: Don't use Stateless workspaces for tests that verify runs in the overview page.

    line 163
  7. Very specific:

    Right-click the correct workflow.json: Use VSBrowser.instance.openResources(absolutePath) to reveal the file in Explorer first, then …

    line 177
  8. Distinctive:

    ALWAYS: run these commands after editing any file, before committing:

    line 211
  9. Very specific:

    Do NOT use --unsafe with Biome.

    line 219
  10. Very specific:

    Use string literals ('text') instead of template literals ( text ) when there are no interpolations

    line 221
  11. Very specific:

    Avoid unnecessary catch bindings — use catch { not catch (e) { when e is unused

    line 222
  12. Distinctive:

    Keep imports organized and remove unused imports

    line 223
  13. Very specific:

    Always use block statements with braces — if (x) { break.

    line 224
  14. Distinctive:

    After pushing E2E test changes, automatically monitor the GitHub Actions CI run and iterate on failures without waiting for the user to ask:

    line 228
  15. Distinctive:

    Wait ~20-25 minutes for the VS Code E2E test job to complete

    line 231
  16. Very specific:

    Use the GitHub MCP tools (fetch_webpage on the Actions run URL, or mcp_io_github_git_pull_request_read with get_status) to check the result

    line 232
  17. Distinctive:

    If the CI fails, analyze the failure logs (user will paste them if needed, or download screenshots)

    line 233
  18. Distinctive:

    Do NOT stop after pushing and tell the user "I'll wait" — proactively check and iterate.

    line 237
  19. Very specific:

    Read apps/vs-code-designer/src/graphify-out/GRAPH_REPORT.md for structural context (god nodes, communities, surprising connections).

    line 241

≈ “Common” is an estimate: at least 1 in 5 of the 12,729 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
CLAUDE.md
<!-- AUTO-GENERATED from docs/ai-setup/packages/vs-code-designer.md. DO NOT EDIT directly. -->

VS Code Designer Extension

The VS Code extension host for Azure Logic Apps. This is the main extension that gets published to the VS Code marketplace.

Purpose

  • VS Code extension entry point - Activates and manages the extension lifecycle
  • Command registration - Provides Logic Apps commands in VS Code
  • Webview hosting - Launches React-based designer panels
  • Azure integration - Connects to Azure services for workflow management
  • File system operations - Handles local Logic Apps projects

Commands

pnpm run build:extension         # Build extension
pnpm run vscode:designer:pack    # Package .vsix file
pnpm run test:extension-unit     # Run unit tests
pnpm run vscode:designer:e2e:ui  # E2E tests with UI

Structure

/src
  /app           - Extension activation and commands
  /commands      - VS Code command implementations
  /designers     - Webview panel management
  /services      - Azure service implementations
  /utils         - Helper utilities
/dist            - Build output and packaged extension

Key Components

Extension Activation (src/app/)

  • extension.ts - Main activation entry point
  • Registers commands, tree views, and webview providers

Command Handlers (src/commands/)

  • Workflow CRUD operations
  • Connection management
  • Deployment commands
  • Debug and run commands

Designers (src/designers/)

  • DesignerPanel - Main workflow designer webview
  • DataMapperPanel - Data transformation webview
  • Panel state management and messaging

Azure Services

  • ARM API clients for Logic Apps resources
  • Storage account integration
  • App Service deployment

Webview Communication

Extension ↔ Webview messaging:

// Extension sends to webview
panel.webview.postMessage({ type: 'WORKFLOW_LOADED', data: workflow })

// Webview sends to extension (via vscode-extension lib)
vscode.postMessage({ type: 'SAVE_WORKFLOW', data: workflow })

Extension Packaging

The extension is packaged with dependencies:

  1. Build: pnpm run build:extension
  2. Copy files: Runs extension-copy-svgs.js
  3. Install deps: cd dist && npm install
  4. Package: vsce package

Testing

Unit Tests

pnpm run test:extension-unit

E2E Tests (vscode-extension-tester)

pnpm run vscode:designer:e2e:ui      # With UI
pnpm run vscode:designer:e2e:headless # Headless

Phase 4.2 Designer Tests (2 tests, ~5 min)

The primary E2E tests are in src/test/ui/designerActions.test.ts (~2647 lines). They cover the complete workflow lifecycle:

  • Test 1 (Standard): Open designer → add Request trigger + Response action → save → debug → open overview → run trigger → verify all nodes succeeded
  • Test 2 (CustomCode): Open designer → add Compose action + fill inputs → save → debug → open overview → run trigger → verify Running → Succeeded transition → verify all nodes succeeded

Run Phase 4.2 only (requires workspaces from a prior Phase 4.1 run):

cd apps/vs-code-designer
npx tsup --config tsup.e2e.test.config.ts
$env:E2E_MODE = "designeronly"
node out/test/run-e2e.js

Key files: designerActions.test.ts, run-e2e.ts, SKILL.md (detailed learning document)

Configuration

package.json (Extension Manifest)

Defines:

  • Commands and keybindings
  • View containers and tree views
  • Configuration settings
  • Activation events

Dependencies

  • @microsoft/vscode-extension-logic-apps - Shared VS Code utilities
  • @microsoft/logic-apps-shared - Common Logic Apps utilities
  • Azure SDK packages for resource management
  • VS Code extension APIs

Development Tips

  1. Debugging: Use VS Code's "Run Extension" launch config
  2. Reload: Use "Developer: Reload Window" after changes
  3. Logs: Check "Output" panel → "Azure Logic Apps"
  4. Webview DevTools: Command Palette → "Open Webview Developer Tools"

ExTester E2E Test Knowledge Base

Full reference: See src/test/ui/SKILL.md for the complete learning document (700+ lines).

Phase Structure

Each test runs in its own fresh VS Code session to avoid workspace-switch contention:

PhaseTest FileWhat It Tests
4.1createWorkspace.test.tsWorkspace creation wizard (12 types)
4.2designerActions.test.tsStandard + CustomCode designer lifecycle
4.3inlineJavascript.test.tsExecute JavaScript Code action (ADO #10109800)
4.4statelessVariables.test.tsInitialize Variable action (ADO #10109878)
4.5designerViewExtended.test.tsParallel branches + run-after (ADO #10109401)
4.6keyboardNavigation.test.tsCtrl+Up/Down + Ctrl+Alt+P / Ctrl+Shift+P hotkey contract
4.7dataMapper.test.ts, demo, smoke, standaloneData Mapper + generic tests
4.11bundleCdnHealth.test.tsCDN integrity headers probe (Content-Length / Content-MD5 on the Workflows extension bundle). Pure Mocha — no VS Code session.

Shared Helper Modules

ModulePurpose
helpers.tsGeneral utilities: sleep, screenshots, dialog dismissal, activity bar
designerHelpers.tsDesigner interaction: open designer, canvas ops, search, save
runHelpers.tsDebug/run cycle: start debugging, overview page, run trigger, verify
workspaceManifest.tsWorkspace manifest types and I/O

Critical Rules for Writing New E2E Tests

  1. Close all editors before opening overview: Call result.webview.switchBack() → driver.switchTo().defaultContent() → new EditorView().closeAllEditors() → sleep(2000) before starting debug. Otherwise switchToOverviewWebview() enters the designer iframe instead of the overview iframe.
  2. Use findLastAddActionElement() for second+ actions: findAddActionElement() returns the first + button which inserts between trigger and first action. Use findLastAddActionElement() to append at the end of the flow.
  3. Stateless workflows don't persist run history: Don't use Stateless workspaces for tests that verify runs in the overview page. Use Stateful.
  4. Parameter panels use contenteditable editors: The designer doesn't use standard <label> + <input> pairs. Use [contenteditable="true"].editor-input selectors and index-based targeting. Click the node first with openNodeSettingsPanel() to ensure the panel is open.
  5. Each test needs its own phase: Tests sharing a VS Code session fail due to lingering processes, webview iframes in DOM, and extension host instability after workspace switches.
  6. Use Selenium Actions API for React clicks: driver.actions().move({ origin: element }).click().perform() — direct .click() doesn't trigger React event handlers in webview iframes.
  7. Command palette needs retries: executeOpenDesignerCommand() retries 5 times because the extension needs time to re-register commands after workspace switching.
  8. Multiple webview iframes: use switchToActiveDesignerFrame(): ExTester's new WebView().switchToFrame() always enters the FIRST iframe — wrong when multiple designers are open. Use raw Selenium driver.switchTo().frame(element) with polling to find the visible iframe.
  9. Designer tabs vs. file tabs — match on "(Workspace)": activateDesignerTab() must match tabs containing BOTH the workflow name AND "Workspace" to avoid clicking the workflow.json text editor tab instead of the designer panel.
  10. Right-click the correct workflow.json: Use VSBrowser.instance.openResources(absolutePath) to reveal the file in Explorer first, then right-click the selected row.
  11. Only use built-in operations (Request, Response) for reliable tests: Connector operations (Compose) may not appear if the design-time API hasn't loaded the catalog.
  12. Always run tests automatically after creating or modifying them: After writing or editing any test file, immediately: lint (npx biome check --write), build (npx tsup), and run (node out/test/run-e2e.js) — don't wait for the user to ask. Report pass/fail results with any failure details.

Running Tests

cd apps/vs-code-designer
npx tsup --config tsup.e2e.test.config.ts   # Compile

# Run modes:
$env:E2E_MODE = "full"                    # All phases (single runner, ~30+ min) — local debug fallback
$env:E2E_MODE = "createonly"              # Phase 4.1 only
$env:E2E_MODE = "designeronly"            # Phase 4.2 only (requires prior 4.1 manifest)
$env:E2E_MODE = "newtestsonly"            # Phases 4.3-4.6 only (requires prior 4.1 manifest)
$env:E2E_MODE = "conversiononly"          # Phases 4.8a-e only (requires prior 4.1 manifest)
$env:E2E_MODE = "conversioncreateonly"    # Phase 4.8b only (builds own legacy fixture)
$env:E2E_MODE = "nonlogicappstartup"      # Phase 4.0 only
$env:E2E_MODE = "bundleintegrityonly"     # Phase 4.11 — pure-Mocha CDN integrity probe (no VS Code)

# CI matrix shard modes (each runs on its own GitHub Actions runner):
$env:E2E_MODE = "independentonly"         # 4.0 + 4.8b + 4.11 — no Phase 4.1 dep
$env:E2E_MODE = "createplusdesigner"      # 4.1 → 4.2, 4.7
$env:E2E_MODE = "createplusnewtests"      # 4.1 → 4.3, 4.4, 4.5, 4.6
$env:E2E_MODE = "createplusconversion"    # 4.1 → 4.8a, 4.8c, 4.8d, 4.8e
node out/test/run-e2e.js

The four createplus* / independentonly modes are how .github/workflows/vscode-e2e.yml shards the suite across parallel runners. full remains the single-runner debug fallback.

Mandatory: Lint and Format After Every Edit

ALWAYS run these commands after editing any file, before committing:

# From repo root:
npx biome check --write <files>   # Format + safe lint fixes (NEVER use --unsafe)
npx tsup --config tsup.e2e.test.config.ts  # Verify compilation

Do NOT use --unsafe with Biome. If Biome reports errors that require --unsafe, fix them manually instead. Common Biome rules to follow when writing code:

  • Use string literals ('text') instead of template literals (`text`) when there are no interpolations
  • Avoid unnecessary catch bindings — use catch { not catch (e) { when e is unused
  • Keep imports organized and remove unused imports
  • Always use block statements with braces — if (x) { break; } not if (x) break;

CI Iteration Workflow

After pushing E2E test changes, automatically monitor the GitHub Actions CI run and iterate on failures without waiting for the user to ask:

  1. Push the commit
  2. Wait ~20-25 minutes for the VS Code E2E test job to complete
  3. Use the GitHub MCP tools (fetch_webpage on the Actions run URL, or mcp_io_github_git_pull_request_read with get_status) to check the result
  4. If the CI fails, analyze the failure logs (user will paste them if needed, or download screenshots)
  5. Fix the issues, build, commit, and push
  6. Go back to step 2

Do NOT stop after pushing and tell the user "I'll wait" — proactively check and iterate.

Graphify

Read apps/vs-code-designer/src/graphify-out/GRAPH_REPORT.md for structural context (god nodes, communities, surprising connections).

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.