원클릭으로
implement
// Implement features, bug fixes, or refactors in the vscode-sfdx-hardis VS Code extension. Use when the user asks to write code, fix a bug, add a feature, or make changes to the codebase.
// Implement features, bug fixes, or refactors in the vscode-sfdx-hardis VS Code extension. Use when the user asks to write code, fix a bug, add a feature, or make changes to the codebase.
Fix duplicate code issues reported by jscpd in the vscode-sfdx-hardis extension. Use when the user asks to fix, resolve, or address jscpd duplications, copy-paste detector findings, or MegaLinter COPYPASTE_JSCPD errors. Either factorizes the duplicates into shared helpers, or, when factorization would hurt clarity, adds jscpd ignore markers to silence them.
Fix security vulnerabilities reported by Trivy and OSV-Scanner in the vscode-sfdx-hardis extension. Use when the user asks to fix, triage, or address Trivy / OSV-Scanner / MegaLinter REPOSITORY_TRIVY / REPOSITORY_OSV_SCANNER findings. Tries upgrading the affected dependency first, then a yarn resolution override, and only ignores the finding if the vulnerability is genuinely non-exploitable in this extension's context.
Add a new monitoring command to the vscode-sfdx-hardis VS Code extension. Use when the user asks to add, register, or wire up a monitoring command (sf hardis:org:monitor:* or sf hardis:org:diagnose:* shown in the Org Monitoring menu and Monitoring Config Workbench).
Analyze code, architecture, data flow, or behavior in the vscode-sfdx-hardis VS Code extension. Use when the user asks to understand, trace, audit, or investigate how something works in this codebase.
Design new features, architectural changes, or refactors for the vscode-sfdx-hardis VS Code extension. Use when the user asks to plan, architect, or propose how to build something new or restructure existing code.
Write or update documentation, tooltips, translations, and help text for the vscode-sfdx-hardis VS Code extension. Use when the user asks to document, describe, explain for users, or update README/translations.
| name | implement |
| description | Implement features, bug fixes, or refactors in the vscode-sfdx-hardis VS Code extension. Use when the user asks to write code, fix a bug, add a feature, or make changes to the codebase. |
| compatibility | Designed for Claude Code (or similar products) |
| metadata | {"author":"cloudity","version":"1.0"} |
Implement features, fixes, or changes in the vscode-sfdx-hardis extension.
Read existing code before modifying. Understand the context and patterns already in use.
Write code following the style rules and patterns below.
Add i18n translations for any new user-facing strings (all 9 locale files).
Update CHANGELOG.md with a concise, user-friendly entry describing the change (see "Changelog entry" section below).
Verify by running yarn lint and yarn dev (or yarn build).
After any change to the repo (new feature, bug fix, UI change, command added, etc.), add a bullet under the ## Unreleased section at the top of CHANGELOG.md. If ## Unreleased does not exist, create it just under the # Changelog title.
Always read the existing ## Unreleased section first and merge your update with what is already there — do not append blindly.
## Unreleased, do not add a bullet for every incremental change (sub-fix, polish, follow-up tweak). Keep a single high-level summary bullet describing the feature as a whole, and refine its wording as the feature evolves.Good:
- Add new menu entry to configure the Generic AI Prompt template in your org- Fix authentication error message when connecting to a Git provider- Improve performance when loading the list of installed pluginsGood (multi-aspect feature with sub-bullets):
- Metadata Retriever: support folder-based types
- Folder selector appears in All Metadata mode for Report/Dashboard/EmailTemplate/Document
- Folder list cached 24h per org
- Parent folder metadata auto-included on retrieve when missing locally
Bad (too technical / internal):
- Update hardis-commands-provider.ts to register new tree item- Refactor SharedMixin to expose i18n getter- Bump simple-git from 3.35.0 to 3.36.0Bad (multiple aspects packed into one run-on sentence — split into sub-bullets instead):
- Metadata Retriever: in All Metadata mode, when you pick a folder-based type, a Folder selector now appears and is required before searching, the folder list is fetched from the org and cached for 24 hours per org, and when retrieving items of these types the parent folder metadata is also pulled in automatically when missing locally.If the change has no visible impact for users (pure internal refactor, test-only change, doc-only change inside source files), skip the changelog entry and mention this in your final summary to the user.
Always use {} after if, else, for, while - even for single statements. Always newline after { and before }:
if (condition) {
// ...
}
else {
// ...
}
camelCase (leading underscore allowed)UPPER_CASEPascalCaseyarn (not npm) for all package operationssf CLI commands (never legacy sfdx)Logger.log() for diagnostic output, not bare console.logt from ./i18n/i18n for all user-facing stringsCacheManager for expensive/repeated operations (org info, git status, plugin versions)register* pattern in src/commands/ for new commandsLogger.log() + vscode.window.showErrorMessage()execSfdxJson("sf hardis:command") or execCommandWithProgress(command, message, label)simpleGit() from simple-git--skipauth flag for performance when org authentication check is not neededpreLoadCache() for startup optimization{
id: "unique-command-id",
label: t("translationKey"),
tooltip: t("tooltipKey"),
command: "sf hardis:category:action",
requiresProject: true,
helpUrl: "https://sfdx-hardis.cloudity.com/hardis/category/action/"
}
sf hardis and must not contain &&src/webviews/lwc-ui/modules/s/<componentName>/.js, .html, .css filesSharedMixin:
import { SharedMixin } from "s/sharedMixin";
export default class MyComponent extends SharedMixin(LightningElement) { ... }
{i18n.keyName} in templates for static labelsthis.t("key", { var: value }) in JS getters for dynamic/interpolated stringswindow.sendMessageToVSCode({ type, data })VS Code webviews render in BOTH dark and light themes. Hardcoded colors break one of them. Every webview already loads two project-wide stylesheets (see src/webviews/lwc-ui-panel.ts getHtmlForWebview, around line 894) plus the official SLDS stylesheet — use those before writing custom CSS.
Loaded globally on every webview:
resources/global-theme.css — project-wide reusable classes, pre-themed via .slds-scope[data-theme="light"|"dark"].resources/global-theme-variables.css — SLDS palette tokens such as --slds-g-color-palette-purple-40 (auto light/dark via the CSS light-dark() function).out/assets/styles/salesforce-lightning-design-system.min.css — the official SLDS library.Check resources/global-theme.css first. Reusable, already-themed classes include:
.header-section, .header-content (+ .no-bg), .header-text, .header-title (+ .single-line), .header-subtitle..green, .teal, .gray, .blue, .purple, .orange, .yellow, .small color variants: .header-icon-container, .feature-icon-container, .icon-container..command-icon-container + one of .backup, .audit, .tests, .limits, .updates, .security, .legacy, .users, .licenses, .apex, .connected-apps, .metadata-access, .unused-metadata, .new-story, .pull-action, .package-action, .save-action..log-sections, .section-logs, .log-lines, .log-message, .log-timestamp, .log-icon, .answer-formatted, .download-panel, .select-option-desc, .submission-modal-backdrop, .submission-modal.Then check SLDS classes: .slds-badge (+ _lightest, _inverse), .slds-text-color_*, .slds-text-heading_*, .slds-box, .slds-button, .slds-icon, etc. Reference: https://www.lightningdesignsystem.com/.
Only if neither covers it, write a small custom rule using theme-aware tokens only:
global-theme-variables.css (e.g. var(--slds-g-color-palette-purple-40), var(--slds-g-color-palette-green-50)).var(--vscode-foreground), var(--vscode-editor-background), var(--vscode-descriptionForeground), var(--vscode-textLink-foreground), inherit, currentColor).#hex, rgb(), color: white, background: linear-gradient(#aaa, #bbb), font-family: "Inter", font-weight: 700. These do not adapt and produce unreadable text in the opposite mode.display, flex, gap, padding, margin, width, border-radius, overflow, position. These carry no color/typography..header-icon-container.teal, .command-icon-container.audit) — your rule wins on specificity tie-breaking and silently disables the theme-aware version.monitoringConfig.css) already redefine global classes with hardcoded hex colors. Treat these as legacy bugs, not patterns — do not copy them.When adding user-facing strings:
src/i18n/en.json (English, source of truth)fr.json, es.json, de.json, it.json, nl.json, ja.json, pl.json, pt-BR.json{{varName}} for interpolation variables{{varName}} placeholders and <br/> tags exactly as-is in all languagesmessage, descriptionexecCommandWithProgress()showErrorMessage, showInformationMessage, showWarning, updateTitleCommand IDs, file paths, CSS classes, brand names (Salesforce, GitHub, SFDMU, MegaLinter, Cloudity), technical terms (merge, commit, branch, scratch org, package.xml, Apex, SOQL, DevHub, CLI flags), [markers] in brackets
hardis-commands-provider.ts with id, label: t("key"), command, tooltip: t("tooltipKey"), requiresProject, helpUrlthemeUtils.ts getAllCommandIcons()src/commands/myCommand.ts with a register* functionsrc/commands.tssrc/webviews/lwc-ui/modules/s/<name>/ with .js, .html, .csssrc/commands/show<Name>.ts with register function using LwcUiPanel.display()src/commands.tsCONFIGURABLE_FIELDS in src/utils/pipeline/sfdxHardisConfigHelper.tsSECTIONS groupAfter implementing:
yarn lint - Check for ESLint issuesyarn dev or yarn build - Verify webpack compilation succeedsCHANGELOG.md has a user-friendly entry under ## Unreleased (or that the change is internal-only and was intentionally skipped)