salesforce-component-standards
यह क्या करती है
यह गाइड Salesforce के यूज़र इंटरफ़ेस कंपोनेंट बनाने में मदद करती है जो सुरक्षित, एक्सेसिबल हों और सबसे अच्छे तरीकों का पालन करें। यह सुनिश्चित करती है कि कंपोनेंट Salesforce डिज़ाइन सिस्टम (SLDS) के साथ अच्छी तरह काम करें और इस्तेमाल में आसान हों।
कब इस्तेमाल करें
- ✓Salesforce के लिए नए विज़ुअल हिस्से (कंपोनेंट) बनाते समय।
- ✓मौजूदा कंपोनेंट की समीक्षा करते समय, ताकि सुनिश्चित हो कि वे सुरक्षित और कुशल हैं।
- ✓जब आप चाहते हैं कि आपके कंपोनेंट Salesforce की क्वालिटी मानकों का पालन करें।
Skill का लिंक
https://github.com/github/awesome-copilot/blob/main/skills/salesforce-component-standards/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“मैं अपना Lightning Web component सभी यूज़र के लिए एक्सेसिबल कैसे बनाऊँ?”
हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।
यह कैसे काम करती है
गाइड हर कंपोनेंट प्रकार (LWC, Aura, Visualforce) के लिए खास नियम बताती है। यह समझाती है कि डेटा, सुरक्षा, विज़ुअल स्टाइलिंग और टेस्टिंग को कैसे संभालें, ताकि सब कुछ तय मानकों के अनुसार हो।
तकनीकी सामग्री (मूल SKILL.md)
लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।
Salesforce Component Quality Standards
Apply these checks to every LWC, Aura component, and Visualforce page you write or review.
Section 1 — LWC Quality Standards
1.1 Data Access Pattern Selection
Choose the right data access pattern before writing JavaScript controller code:
| Use case | Pattern | Why |
|---|---|---|
| Read a single record reactively (follows navigation) | @wire(getRecord, { recordId, fields }) |
Lightning Data Service — cached, reactive |
| Standard CRUD form for a single object | <lightning-record-form> or <lightning-record-edit-form> |
Built-in FLS, CRUD, and accessibility |
| Complex server query or filtered list | @wire(apexMethodName, { param }) on a cacheable=true method |
Allows caching; wire re-fires on param change |
| User-triggered action, DML, or non-cacheable server call | Imperative apexMethodName(params).then(...).catch(...) |
Required for DML — wired methods cannot be @AuraEnabled without cacheable=true |
| Cross-component communication (no shared parent) | Lightning Message Service (LMS) | Decoupled, works across DOM boundaries |
| Multi-object graph relationships | GraphQL @wire(gql, { query, variables }) |
Single round-trip for complex related data |
1.2 Security Rules
| Rule | Enforcement |
|---|---|
No raw user data in innerHTML |
Use {expression} binding in the template — the framework auto-escapes. Never use this.template.querySelector('.el').innerHTML = userValue |
Apex @AuraEnabled methods enforce CRUD/FLS |
Use WITH USER_MODE in SOQL or explicit Schema.sObjectType checks |
| No hardcoded org-specific IDs in component JavaScript | Query or pass as a prop — never embed record IDs in source |
@api properties from parent: validate before use |
A parent can pass anything — validate type and range before using as a query parameter |
1.3 SLDS 2 and Styling Standards
- Never hardcode colours:
color: #FF3366→ usecolor: var(--slds-c-button-brand-color-background)or a semantic SLDS token. - Never override SLDS classes with
!important— compose with custom CSS properties. - Use
<lightning-*>base components wherever they exist:lightning-button,lightning-input,lightning-datatable,lightning-card, etc. - Base components include built-in SLDS 2, dark mode, and accessibility — avoid reimplementing their behaviour.
- If using custom CSS, test in both light mode and dark mode before declaring done.
1.4 Accessibility Requirements (WCAG 2.1 AA)
Every LWC component must pass all of these before it is considered done:
- All form inputs have
<label>oraria-label— never use placeholder as the only label - All icon-only buttons have
alternative-textoraria-labeldescribing the action - All interactive elements are reachable and operable by keyboard (Tab, Enter, Space, Escape)
- Colour is not the only means of conveying status — pair with text, icon, or
aria-*attributes - Error messages are associated with their input via
aria-describedby - Focus management is correct in modals — focus moves into the modal on open and back on close
1.5 Component Communication Rules
| Direction | Mechanism |
|---|---|
| Parent → Child | @api property or calling a @api method |
| Child → Parent | CustomEvent — this.dispatchEvent(new CustomEvent('eventname', { detail: data })) |
| Sibling / unrelated components | Lightning Message Service (LMS) |
| Never use | document.querySelector, window.*, or Pub/Sub libraries |
For Flow screen components:
- Events that need to reach the Flow runtime must set
bubbles: trueandcomposed: true. - Expose
@api valuefor two-way binding with the Flow variable.
1.6 JavaScript Performance Rules
- No side effects in
connectedCallback: it runs on every DOM attach — avoid DML, heavy computation, or rendering state mutations here. - Guard
renderedCallback: always use a boolean guard to prevent infinite render loops. - Avoid reactive property traps: setting a reactive property inside
renderedCallbackcauses a re-render — use it only when necessary and guarded. - Do not store large datasets in component state — paginate or stream large results instead.
1.7 Jest Test Requirements
Every component that handles user interaction or retrieves Apex data must have a Jest test:
// Minimum test coverage expectations
…
अक्सर पूछे जाने वाले सवाल
LWC, Aura और Visualforce क्या हैं?
ये अलग-अलग तकनीकें हैं जिनसे Salesforce के अंदर यूज़र इंटरफ़ेस बनाया जाता है।
SLDS 2 क्या है?
यह Salesforce का डिज़ाइन सिस्टम है, जो कंपोनेंट का रूप और अहसास तय करता है ताकि विज़ुअल एकरूपता बनी रहे।
'accessibility' (WCAG 2.1 AA) का क्या मतलब है?
इसका मतलब है कि कंपोनेंट सभी लोगों के लिए इस्तेमाल योग्य होने चाहिए, जिनमें दृष्टि, सुनने या हाथ-पैरों से जुड़ी दिक्कत वाले लोग भी शामिल हैं, और यह एक अंतरराष्ट्रीय मानक का पालन करता है।
जानकारी
लेखक का मूल विवरण
Quality standards for Salesforce Lightning Web Components (LWC), Aura components, and Visualforce pages. Covers SLDS 2 compliance, accessibility (WCAG 2.1 AA), data access pattern selection, component communication rules, XSS prevention, CSRF enforcement, FLS/CRUD in AuraEnabled methods, view state management, and Jest test requirements. Use this skill when building or reviewing any Salesforce UI
repo: github/awesome-copilot
लोकप्रियता
- GitHub स्टार
- 40k
- रैंकिंग में स्थान
- #7413
- लाइसेंस
- MIT
- अपडेट की गई
- 15/10/2026
कमेंट
- …
इस repository की और skills
acquire-codebase-knowledge
40kआपके एजेंट को किसी मौजूदा code प्रोजेक्ट को समझने और उसका documentation बनाने में मदद करता है। यह नए लोगों को प्रोजेक्ट से जोड़ने या architecture का सार जानने में उपयोगी है।
acreadiness-assess
40kआपके एजेंट को किसी प्रोजेक्ट की AI के लिए तैयारी जाँचने और रिपोर्ट बनाने देता है। यह समझने में उपयोगी है कि प्रोजेक्ट AI tools इस्तेमाल करने के लिए कितना तैयार है।
acreadiness-generate-instructions
40kआपके एजेंट को assessment के आधार पर AI tools के लिए निर्देश बनाने में मदद करता है। यह बताता है कि AI कोड के साथ बेहतर कैसे काम करे और पहचानी गई कमियाँ कैसे दूर हों।
acreadiness-policy
40kआपके एजेंट को AI प्रोजेक्ट assessment के लिए नीतियाँ तय करने या लागू करने में मदद करता है। यह प्रोजेक्ट्स के मूल्यांकन को मानक बनाने और compliance सुनिश्चित करने में उपयोगी है।
मिलती-जुलती skills
angular-developer
280kआपके एजेंट को Angular code बनाने और प्रोजेक्ट स्ट्रक्चर पर सलाह देने में मदद करता है। नए प्रोजेक्ट शुरू करने, code के हिस्से बनाने, या performance और accessibility सुधारने में उपयोगी है।
frontend-a11y
280kआपके एजेंट को web interfaces को सबके लिए accessible बनाने में मदद करता है। यह सुनिश्चित करता है कि websites और apps screen readers और keyboard navigation के साथ अच्छे से काम करें।
frontend-patterns
280kआपके एजेंट को React और Next.js में frontend development के modern patterns लागू करने में मदद करता है। यह performance optimize करता है, state manage करता है और best practices फॉलो करवाता है।