You are an expert software engineer and VS Code extension developer working on Zowe Explorer.
This repository includes custom agent skills located in .agents/skills/ to help with specific workflows. You can invoke them by mentioning their name or asking to perform the related task.
breaking-changes: Audit pull requests for breaking changes (API and behavioral) in the monorepo.code-quality: Refactor, deduplicate, and improve TypeScript code quality using Zowe Explorer specific patterns.regression-check: Review code changes for functional correctness and regressions before merging or release.review-prs: Review pull requests for code quality, security, and Zowe V3 conformance.testing: Write and maintain Vitest unit tests and WDIO/Cucumber end-to-end tests using project-specific helpers and conventions.zedc: Use the Zowe Explorer Development CLI for sandboxed testing and environment setup (only when explicitly requested).
- Install:
pnpm install(always use pnpm) - Build:
pnpm build(builds sequentially: API -> webviews -> ZE -> FTP extension) - Build Parallel:
pnpm build:parallel - Test (All):
pnpm test - Test (Package):
cd packages/<package-name> && pnpm test - Test (Single File):
cd packages/<package-name> && pnpm exec vitest <test-file-name> - E2E Tests:
cd packages/zowe-explorer && pnpm test:e2e(runs WebDriver-automated tests in VS Code) - Lint & Format:
pnpm lintandpnpm pretty - Check Dependencies:
pnpm madge(detects circular dependencies) - Clean:
pnpm fresh-clone(wipesnode_modules- useful when switching branches) - Update SDKs:
pnpm update-sdks(updates Zowe SDK versions to latest from NPM) - Package:
pnpm package(prepares all packages and ZE VSIX for distribution & testing) - Prepublish:
cd packages/zowe-explorer && pnpm vscode:prepublish(updates localized strings)
Zowe Explorer (ZE) is an extension for Visual Studio Code that offers access to z/OS mainframe resources.
Tech Stack: TypeScript, VS Code Extension API, Node.js, Webpack, Vitest, pnpm.
The project is a monorepo managed by pnpm. zowe-explorer depends on zowe-explorer-api using workspace:* references.
packages/zowe-explorer-api/: API and extensibility framework.packages/zowe-explorer/: Main VS Code extension (tree views, UI).packages/zowe-explorer-ftp-extension/: Sample extension implementing FTP (zftp) profile support.
Note: Changes in the API can sometimes require a full monorepo build (pnpm build) to be picked up by the VS Code extension.
- Logic vs UI: Use
Actionsclasses (e.g.,MvsActions.ts) to separate business logic from UI/Tree view providers. - UI Utilities: Use the
Guiutility (fromzowe-explorer-api) for all user interactions likeshowInputBox,showQuickPick, and error/warning messages. - Logging: Use
ZoweLoggerfor important events, specifically inerrorandwarncases. Avoid logging for trivial or highly frequent operations. - API Usage: Prefer using
zowe-explorer-apito interact with mainframe resources instead of raw SDK calls where possible.
Error Handling:
// ✅ Good - Uses AuthUtils.errorHandling for consistent user feedback
try {
await api.dataSet(filter);
} catch (error) {
await AuthUtils.errorHandling(error, {
apiType: ZoweExplorerApiType.Mvs,
profile: node.getProfile(),
scenario: "Dataset listing",
});
}Logging:
// ✅ Good - Logs with context before handling
ZoweLogger.error(`Operation failed for ${profile}: ${error.message}`);- Unit Tests: Standardized with
vitest. Located in__tests__directories within each package. - End-to-End Tests: BDD-style tests using
wdioand Cucumber inpackages/zowe-explorer/__tests__/__e2e__/(require a real Zowe team config and.env). - Mocks: Use
jest-mock-vscodefor VS Code API mocking and follow established mock patterns. - Coverage: Maintain or improve coverage when adding new logic.
pnpm testgenerates coverage reports. - For deeper guidance (mock factories,
MockedProperty, e2e env vars, page-object conventions, anti-patterns), use thetestingskill in.agents/skills/testing/SKILL.md.
- ✅ Always do:
- Use
vscode.workspace.fsor Zowe filesystem providers for file access. - Use
extensionContext.storageUriorglobalStorageUrifor temporary files. - Sanitize user inputs before passing to shell commands.
- Run
pnpm lint,pnpm pretty, andpnpm buildbefore submitting PRs.
- Use
⚠️ Ask first:- Before adding new external dependencies (check if they exist in the monorepo first to minimize bundle size).
- Before making changes that might break backward compatibility in
zowe-explorer-api.
- 🚫 Never do:
- NEVER use direct
fsorpathcalls for mainframe resources. - NEVER use hardcoded temporary directories.
- NEVER log user credentials or passwords to the console.
- NEVER read
config.yamlor user's Zowe config for more context (**/zowe.config.*json).
- NEVER use direct
- Consider using Conventional Commits and isolating file changes by scope.
- Add a new changelog entry in format
- This sentence summarizes the changes of this pull request. [#Issue Number](https://github.com/zowe/zowe-explorer-vscode/issue/XXXX OR matching PR link)in the appropriate changelog file. pnpm lint,pnpm pretty, andpnpm buildmust pass before PR is ready.- Run
cd packages/zowe-explorer && pnpm vscode:prepublishand commit any resultant changes.