@salesforce/afv-skills 1.37.0 → 1.38.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/skills/agentforce-generate/README.md +20 -3
- package/skills/agentforce-generate/SKILL.md +253 -440
- package/skills/agentforce-generate/assets/agent-spec-template.md +6 -2
- package/skills/agentforce-generate/assets/agents/order-service.agent +16 -12
- package/skills/agentforce-generate/assets/agents/production-faq.agent +4 -4
- package/skills/agentforce-generate/assets/agents/router-first.agent +5 -5
- package/skills/agentforce-generate/assets/agents/template-single-subagent.agent +4 -4
- package/skills/agentforce-generate/assets/agents/verification-gate.agent +8 -6
- package/skills/agentforce-generate/assets/agents/voice-knowledge-grounded.agent +9 -9
- package/skills/agentforce-generate/assets/agents/voice-service-agent.agent +7 -7
- package/skills/agentforce-generate/assets/patterns/README.md +3 -3
- package/skills/agentforce-generate/assets/patterns/action-callbacks.agent +5 -5
- package/skills/agentforce-generate/assets/patterns/advanced-input-bindings.agent +6 -8
- package/skills/agentforce-generate/assets/patterns/bidirectional-routing.agent +11 -13
- package/skills/agentforce-generate/assets/patterns/critical-input-collection.agent +11 -16
- package/skills/agentforce-generate/assets/patterns/lifecycle-events.agent +2 -3
- package/skills/agentforce-generate/assets/patterns/llm-controlled-actions.agent +6 -7
- package/skills/agentforce-generate/assets/patterns/open-gate-routing.agent +3 -3
- package/skills/agentforce-generate/assets/patterns/prompt-template-action.agent +14 -19
- package/skills/agentforce-generate/assets/patterns/system-instruction-overrides.agent +11 -20
- package/skills/agentforce-generate/references/actions-reference.md +2 -2
- package/skills/agentforce-generate/references/agent-audit-and-repair.md +135 -0
- package/skills/agentforce-generate/references/agent-audit-candidate-verification.md +160 -0
- package/skills/agentforce-generate/references/agent-audit-diagnostic-catalog.md +156 -0
- package/skills/agentforce-generate/references/agent-audit-diagnostics-actions-state.md +176 -0
- package/skills/agentforce-generate/references/agent-audit-diagnostics-architecture-evaluation.md +68 -0
- package/skills/agentforce-generate/references/agent-audit-diagnostics-instructions-routing.md +283 -0
- package/skills/agentforce-generate/references/agent-audit-evaluation-loop.md +191 -0
- package/skills/agentforce-generate/references/agent-audit-repair-report.md +143 -0
- package/skills/agentforce-generate/references/agent-audit-scope-path-review.md +180 -0
- package/skills/agentforce-generate/references/agent-design-and-spec-creation.md +105 -59
- package/skills/agentforce-generate/references/agent-script-core-language.md +144 -61
- package/skills/agentforce-generate/references/agent-subagent-map-diagrams.md +33 -23
- package/skills/agentforce-generate/references/agent-validation-and-debugging.md +37 -11
- package/skills/agentforce-generate/references/agentscript-toolchain.md +112 -0
- package/skills/agentforce-generate/references/architecture-patterns.md +81 -18
- package/skills/agentforce-generate/references/common-control-flow-pitfalls.md +255 -0
- package/skills/agentforce-generate/references/control-flow-actions-sequencing.md +198 -0
- package/skills/agentforce-generate/references/control-flow-lifecycle-side-effects.md +87 -0
- package/skills/agentforce-generate/references/examples.md +22 -22
- package/skills/agentforce-generate/references/instruction-resolution.md +123 -83
- package/skills/agentforce-generate/references/known-issues.md +1 -2
- package/skills/agentforce-generate/references/optimization-pattern-1-data-flow.md +4 -0
- package/skills/agentforce-generate/references/optimization-pattern-2-deterministic-logic.md +33 -0
- package/skills/agentforce-generate/references/optimization-pattern-3-reference-syntax.md +32 -3
- package/skills/agentforce-generate/references/optimization-pattern-4-escalation.md +2 -2
- package/skills/agentforce-generate/references/patterns-by-requirement.md +3 -1
- package/skills/agentforce-generate/references/posture-and-determinism.md +103 -22
- package/skills/agentforce-generate/references/reference-map.md +19 -3
- package/skills/agentforce-generate/references/scoring-rubric.md +1 -1
- package/skills/agentforce-generate/references/voice-latency-heuristics.md +4 -0
- package/skills/agentforce-generate/references/voice-modality-reference.md +4 -4
- package/skills/agentforce-generate/references/zen-of-agentscript.md +139 -23
- package/skills/agentforce-generate/scripts/agentscript-sdk-loader.mjs +133 -0
- package/skills/agentforce-generate/scripts/index-agent.mjs +141 -0
- package/skills/agentforce-generate/scripts/setup-agentscript-sdk.mjs +337 -0
- package/skills/automation-sandbox-post-copy-config-generate/SKILL.md +1 -1
- package/skills/automation-sandbox-post-copy-configure/SKILL.md +433 -0
- package/skills/automation-sandbox-post-copy-configure/assets/api_request_templates.json +89 -0
- package/skills/automation-sandbox-post-copy-configure/examples/sample_config_input.json +40 -0
- package/skills/automation-sandbox-post-copy-configure/examples/sample_execution_summary.md +79 -0
- package/skills/automation-sandbox-post-copy-configure/references/api_endpoints.md +273 -0
- package/skills/automation-sandbox-post-copy-configure/references/authentication.md +94 -0
- package/skills/automation-sandbox-post-copy-configure/references/execution_phasing.md +93 -0
- package/skills/automation-sandbox-post-copy-configure/references/rules_gotchas.md +35 -0
- package/skills/automation-sandbox-post-copy-configure/scripts/classify-patch-result.mjs +88 -0
- package/skills/automation-sandbox-post-copy-configure/scripts/map-metadata-key.mjs +98 -0
- package/skills/automation-sandbox-post-copy-configure/scripts/plan-phases.mjs +98 -0
- package/skills/automation-sandbox-post-copy-configure/scripts/resolve-target-org.mjs +56 -0
- package/skills/design-systems-slds-validate/SKILL.md +14 -13
- package/skills/dx-code-analyzer-custom-rule-create/examples/xpath-examples.md +1 -1
- package/skills/dx-code-analyzer-custom-rule-create/references/xpath-patterns-security.md +1 -1
- package/skills/dx-org-devhub-configure/SKILL.md +268 -0
- package/skills/dx-org-devhub-configure/examples/status-output.md +39 -0
- package/skills/dx-org-devhub-configure/scripts/devhub.sh +650 -0
- package/skills/dx-org-devhub-configure/scripts/test-devhub.sh +116 -0
- package/skills/dx-org-manage/SKILL.md +135 -42
- package/skills/dx-org-manage/assets/derive-alias.sh +95 -0
- package/skills/dx-org-manage/assets/scratch-def.seed.json +6 -0
- package/skills/dx-org-manage/examples/README.md +1 -1
- package/skills/dx-org-manage/examples/scratch-orgs/delete_output.json +8 -0
- package/skills/dx-org-manage/examples/scratch-orgs/display_output.json +23 -0
- package/skills/dx-org-manage/examples/scratch-orgs/list_output.json +58 -0
- package/skills/dx-org-manage/examples/scratch-orgs/resume_output.json +38 -0
- package/skills/dx-org-manage/examples/scratch-orgs/success_definition_file.json +1 -1
- package/skills/dx-org-manage/examples/scratch-orgs/success_edition.json +1 -1
- package/skills/dx-org-manage/examples/scratch-orgs/success_shape.json +41 -0
- package/skills/dx-org-manage/examples/scratch-orgs/success_snapshot.json +1 -1
- package/skills/dx-org-manage/examples/snapshots/error_output.json +3 -3
- package/skills/dx-org-manage/references/creating-scratch-org.md +2 -2
- package/skills/dx-org-manage/references/creating-snapshot.md +1 -2
- package/skills/dx-org-manage/references/definition_file_options.md +24 -0
- package/skills/dx-org-manage/references/edition_types.md +10 -8
- package/skills/dx-org-manage/references/opening-org.md +11 -12
- package/skills/dx-org-manage/references/scratch-org-create.md +303 -0
- package/skills/dx-org-manage/references/scratch-org-operations.md +135 -0
- package/skills/experience-aura-lwc-migrate/SKILL.md +120 -0
- package/skills/experience-aura-lwc-migrate/references/aura-api-expert.md +170 -0
- package/skills/experience-aura-lwc-migrate/references/aura-data-expert.md +172 -0
- package/skills/experience-aura-lwc-migrate/references/aura-migration-guidelines.md +299 -0
- package/skills/experience-aura-lwc-migrate/references/aura-prd-framework.md +79 -0
- package/skills/experience-aura-lwc-migrate/references/aura-redundant-code-expert.md +24 -0
- package/skills/experience-aura-lwc-migrate/references/aura-reference-expert.md +140 -0
- package/skills/experience-aura-lwc-migrate/references/aura-resolver-expert.md +115 -0
- package/skills/experience-aura-lwc-migrate/references/aura-slots-expert.md +67 -0
- package/skills/experience-aura-lwc-migrate/references/aura-style-expert.md +62 -0
- package/skills/experience-aura-lwc-migrate/references/aura-to-lwc-completeness-checklist.md +188 -0
- package/skills/experience-aura-lwc-migrate/references/aura-values-expert.md +67 -0
- package/skills/experience-content-media-search/SKILL.md +17 -12
- package/skills/experience-content-media-stock-image-search/SKILL.md +192 -0
- package/skills/experience-content-media-stock-image-search/scripts/download-stock-image.py +102 -0
- package/skills/experience-lds-best-practices-apply/SKILL.md +245 -0
- package/skills/experience-lds-best-practices-apply/references/adapter-apis.md +1640 -0
- package/skills/experience-lds-best-practices-apply/references/lds-data-consistency.md +126 -0
- package/skills/experience-lds-best-practices-apply/references/lds-expert.md +429 -0
- package/skills/experience-lds-best-practices-apply/references/lds-referential-integrity.md +322 -0
- package/skills/experience-lds-best-practices-apply/references/wire-adapter-types.md +1511 -0
- package/skills/experience-lds-graphql-generate/SKILL.md +222 -0
- package/skills/experience-lds-graphql-generate/references/generation-guide.md +236 -0
- package/skills/experience-lds-graphql-generate/references/generation-mutation.md +277 -0
- package/skills/experience-lds-graphql-generate/references/generation-query.md +237 -0
- package/skills/experience-lds-graphql-generate/scripts/fetch-lds-graphql-schema.sh +230 -0
- package/skills/experience-lds-graphql-generate/scripts/test-lds-graphql-query.sh +128 -0
- package/skills/experience-lwc-accessibility-validate/SKILL.md +112 -0
- package/skills/experience-lwc-accessibility-validate/references/reviewers/sc-1-1-1-non-text-content.md +88 -0
- package/skills/experience-lwc-accessibility-validate/references/reviewers/sc-1-3-1-i-lists.md +52 -0
- package/skills/experience-lwc-accessibility-validate/references/reviewers/sc-1-3-1-ii-tables.md +106 -0
- package/skills/experience-lwc-accessibility-validate/references/reviewers/sc-1-3-1-iii-form-labels.md +78 -0
- package/skills/experience-lwc-accessibility-validate/references/reviewers/sc-1-3-1-iv-regions.md +26 -0
- package/skills/experience-lwc-accessibility-validate/references/reviewers/sc-1-3-1-v-groups.md +66 -0
- package/skills/experience-lwc-accessibility-validate/references/reviewers/sc-1-3-5-identify-input.md +70 -0
- package/skills/experience-lwc-accessibility-validate/references/reviewers/sc-1-4-3-contrast.md +115 -0
- package/skills/experience-lwc-accessibility-validate/references/reviewers/sc-2-1-1-keyboard.md +47 -0
- package/skills/experience-lwc-accessibility-validate/references/reviewers/sc-2-4-4-link-purpose.md +39 -0
- package/skills/experience-lwc-accessibility-validate/references/reviewers/sc-2-4-6-headings-labels.md +50 -0
- package/skills/experience-lwc-accessibility-validate/references/reviewers/sc-2-5-1-pointer-gestures.md +54 -0
- package/skills/experience-lwc-accessibility-validate/references/reviewers/sc-2-5-2-pointer-cancellation.md +49 -0
- package/skills/experience-lwc-accessibility-validate/references/reviewers/sc-2-5-3-label-in-name.md +77 -0
- package/skills/experience-lwc-accessibility-validate/references/reviewers/sc-2-5-7-dragging-movement.md +45 -0
- package/skills/experience-lwc-accessibility-validate/references/reviewers/sc-3-2-1-on-focus.md +55 -0
- package/skills/experience-lwc-accessibility-validate/references/reviewers/sc-3-2-2-on-input.md +51 -0
- package/skills/experience-lwc-accessibility-validate/references/reviewers/sc-3-3-1-error-identification.md +84 -0
- package/skills/experience-lwc-accessibility-validate/references/reviewers/sc-3-3-2-labels-instructions.md +50 -0
- package/skills/experience-lwc-accessibility-validate/references/reviewers/sc-3-3-3-error-suggestion.md +64 -0
- package/skills/experience-lwc-accessibility-validate/references/reviewers/sc-4-1-2-i-name.md +105 -0
- package/skills/experience-lwc-accessibility-validate/references/reviewers/sc-4-1-2-ii-role.md +99 -0
- package/skills/experience-lwc-accessibility-validate/references/reviewers/sc-4-1-2-iii-value.md +97 -0
- package/skills/experience-lwc-accessibility-validate/references/vision/sc-1-1-1-non-text-content.md +83 -0
- package/skills/experience-lwc-accessibility-validate/references/vision/sc-1-4-1-use-of-color.md +62 -0
- package/skills/experience-lwc-accessibility-validate/references/vision/sc-1-4-10-resize-reflow.md +18 -0
- package/skills/experience-lwc-accessibility-validate/references/vision/sc-1-4-11-non-text-contrast.md +43 -0
- package/skills/experience-lwc-accessibility-validate/references/vision/sc-1-4-3-contrast.md +25 -0
- package/skills/experience-lwc-accessibility-validate/scripts/contrast-ratio.py +153 -0
- package/skills/experience-lwc-design-generate/SKILL.md +261 -0
- package/skills/experience-lwc-design-generate/references/figma-to-prd-blueprint.md +66 -0
- package/skills/experience-lwc-design-generate/references/prd-analysis-template.md +17 -0
- package/skills/experience-lwc-design-generate/scripts/check-component-name.sh +75 -0
- package/skills/experience-lwc-design-generate/scripts/detect-project-tools.sh +97 -0
- package/skills/experience-lwc-runtime-observe/SKILL.md +244 -0
- package/skills/experience-lwc-runtime-observe/examples/component-preview-and-dom.md +41 -0
- package/skills/experience-lwc-runtime-observe/scripts/extract-dom.sh +79 -0
- package/skills/experience-lwc-runtime-observe/scripts/open-frontdoor.sh +46 -0
- package/skills/experience-lwc-runtime-observe/scripts/verify-toolchain.sh +48 -0
- package/skills/experience-lwc-security-validate/SKILL.md +151 -0
- package/skills/experience-lwc-security-validate/examples/review-report.md +6 -0
- package/skills/experience-lwc-security-validate/examples/score-report.sarif.json +32 -0
- package/skills/experience-lwc-security-validate/references/lws-security-expert.md +986 -0
- package/skills/experience-lwc-security-validate/references/security-analysis.md +611 -0
- package/skills/experience-lwc-security-validate/scripts/check-lwc-import.sh +166 -0
- package/skills/experience-lwc-security-validate/scripts/validate-sarif.sh +131 -0
- package/skills/experience-ui-bundle-2gp-deploy/SKILL.md +454 -0
- package/skills/experience-ui-bundle-2gp-deploy/assets/CustomApplication.app-meta.xml +12 -0
- package/skills/experience-ui-bundle-2gp-deploy/assets/PermissionSet.permissionset-meta.xml +9 -0
- package/skills/experience-ui-bundle-2gp-deploy/scripts/find-bundle-package-dir.sh +53 -0
- package/skills/experience-ui-bundle-agentforce-client-generate/SKILL.md +104 -26
- package/skills/experience-ui-bundle-agentforce-client-generate/references/constraints.md +35 -24
- package/skills/experience-ui-bundle-agentforce-client-generate/references/examples.md +92 -1
- package/skills/experience-ui-bundle-agentforce-client-generate/references/style-tokens.md +2 -0
- package/skills/experience-ui-bundle-agentforce-client-generate/references/troubleshooting.md +14 -1
- package/skills/experience-ui-bundle-agentforce-client-generate/scripts/detect-framework.sh +67 -0
- package/skills/experience-ui-bundle-deploy/SKILL.md +83 -14
- package/skills/experience-ui-bundle-deploy/assets/Communities.settings-meta.xml +19 -0
- package/skills/experience-ui-bundle-deploy/assets/org-setup.config.template.json +5 -0
- package/skills/experience-ui-bundle-deploy/assets/social-login-auth-providers.apex +158 -0
- package/skills/experience-ui-bundle-deploy/references/config-scaffold.md +13 -1
- package/skills/experience-ui-bundle-deploy/references/social-login.md +179 -0
- package/skills/experience-ui-bundle-frontend-generate/SKILL.md +14 -0
- package/skills/experience-ui-bundle-mfa-configure/SKILL.md +6 -5
- package/skills/experience-ui-bundle-mfa-configure/references/social-login.md +15 -7
- package/skills/experience-ui-bundle-salesforce-data-access/SKILL.md +41 -5
- package/skills/experience-ui-bundle-salesforce-data-access/references/caching.md +10 -22
- package/skills/experience-ui-bundle-salesforce-data-access/references/graphql-hand-authoring.md +4 -19
- package/skills/experience-ui-bundle-salesforce-data-access/references/migration.md +5 -0
- package/skills/experience-ui-bundle-salesforce-data-access/references/sdk-api.md +33 -150
- package/skills/mobile-platform-native-capabilities-integrate/references/nfc.md +35 -0
- package/skills/platform-apex-generate/SKILL.md +8 -7
- package/skills/platform-apex-test-generate/SKILL.md +3 -1
- package/skills/platform-apex-test-run/SKILL.md +9 -8
- package/skills/platform-lightning-type-widget-coordinate/SKILL.md +1 -1
- package/skills/platform-lightning-type-widget-coordinate/examples/existing-lightning-type-with-widget-prompt.md +1 -1
- package/skills/platform-lightning-type-widget-coordinate/examples/new-lightning-type-with-widget-prompt.md +1 -1
- package/skills/platform-lightning-type-widget-coordinate/references/validation-gates.md +3 -3
- package/skills/platform-mcp-tool-widget-coordinate/SKILL.md +43 -67
- package/skills/platform-mcp-tool-widget-coordinate/examples/action-name-source-prompt.md +1 -2
- package/skills/platform-mcp-tool-widget-coordinate/examples/apex-invocable-source-prompt.md +2 -3
- package/skills/platform-mcp-tool-widget-coordinate/examples/nested-object-list-source-prompt.md +163 -0
- package/skills/platform-mcp-tool-widget-coordinate/examples/nested-object-single-source-prompt.md +198 -0
- package/skills/platform-mcp-tool-widget-coordinate/examples/pasted-tool-output-prompt.md +0 -1
- package/skills/platform-mcp-tool-widget-coordinate/references/build-plan-format.md +17 -11
- package/skills/platform-mcp-tool-widget-coordinate/references/mcp-tool-output-discovery.md +48 -15
- package/skills/platform-mcp-tool-widget-coordinate/references/two-clt-modeling.md +73 -10
- package/skills/platform-mcp-tool-widget-coordinate/references/validation-gates.md +48 -8
- package/skills/platform-policy-rule-generate/SKILL.md +22 -12
- package/skills/platform-policy-rule-generate/references/deploy-errors.md +1 -1
- package/skills/platform-policy-rule-generate/references/policy-schema-full.md +8 -29
- package/skills/platform-policy-rule-generate/references/templates-advanced.md +1 -1
- package/skills/platform-sharing-owd-configure/SKILL.md +20 -8
- package/skills/platform-sharing-owd-configure/references/access_levels.md +14 -1
- package/skills/platform-sharing-rules-generate/SKILL.md +67 -35
- package/skills/platform-sharing-rules-generate/examples/create-cases.md +16 -17
- package/skills/platform-sharing-rules-generate/examples/delete-cases.md +34 -79
- package/skills/platform-sharing-rules-generate/examples/edit-cases.md +13 -26
- package/skills/platform-sharing-rules-generate/scripts/count-remaining-rules.sh +33 -0
- package/skills/platform-widget-generate/SKILL.md +3 -5
- package/skills/platform-widget-generate/examples/conditional.json +18 -13
- package/skills/platform-widget-generate/examples/list-with-foreach.json +2 -2
- package/skills/platform-widget-generate/examples/single-object.json +2 -2
- package/skills/platform-widget-generate/references/schema-from-lightning-type.md +27 -6
- package/skills/platform-widget-generate/references/widget-bundle-layout.md +4 -3
- package/skills/service-itsm-agentic-setup-cmdb-access-assign/SKILL.md +287 -0
- package/skills/service-itsm-agentic-setup-cmdb-access-assign/references/mcp-invocation.md +260 -0
- package/skills/service-itsm-agentic-setup-cmdb-bundle-deploy/SKILL.md +252 -0
- package/skills/service-itsm-agentic-setup-cmdb-bundle-deploy/references/mcp-invocation.md +204 -0
- package/skills/service-itsm-agentic-setup-cmdb-configure/SKILL.md +259 -0
- package/skills/service-itsm-agentic-setup-cmdb-configure/references/mcp-invocation.md +188 -0
- package/skills/service-itsm-agentic-setup-cmdb-coordinate/SKILL.md +197 -0
- package/skills/service-itsm-agentic-setup-cmdb-coordinate/examples/output-templates.md +77 -0
- package/skills/service-itsm-agentic-setup-cmdb-discovery-configure/SKILL.md +316 -0
- package/skills/service-itsm-agentic-setup-cmdb-discovery-configure/references/mcp-invocation.md +221 -0
- package/skills/service-itsm-incident-priority-configure/SKILL.md +168 -0
- package/skills/service-itsm-incident-priority-configure/examples/matrix-operations.md +200 -0
- package/skills/service-itsm-incident-priority-configure/examples/render-matrix.md +54 -0
- package/skills/service-itsm-incident-priority-configure/examples/seed-full-matrix.md +52 -0
- package/skills/service-itsm-incident-priority-configure/references/sf-cli-invocation.md +264 -0
- package/skills/platform-mcp-tool-widget-coordinate/examples/nested-object-source-prompt.md +0 -191
- package/skills/platform-policy-rule-generate/references/fixtures-index.md +0 -29
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
## SC 1.4.3 - Contrast (Minimum) (Level AA)
|
|
2
|
+
|
|
3
|
+
The visual presentation of text and images of text has a contrast ratio of at least 4.5:1, except for large text (at least 3:1), incidental text (part of inactive components, purely decorative, not visible, or part of a picture containing significant other visual content), and logotypes.
|
|
4
|
+
|
|
5
|
+
You are a UI/UX accessibility expert specializing in color contrast analysis for WCAG 2.2 SC 1.4.3 compliance. Your job is to analyze Lightning Web Components (LWCs) to identify text contrast issues.
|
|
6
|
+
|
|
7
|
+
Your task is to identify contrast issues by examining text colors against their backgrounds. Look for the following problems:
|
|
8
|
+
|
|
9
|
+
CONTRAST ISSUES TO IDENTIFY:
|
|
10
|
+
|
|
11
|
+
- Text with insufficient contrast ratio against background
|
|
12
|
+
- Links with poor contrast that don't meet minimum requirements
|
|
13
|
+
- Form labels, placeholders, and input text with low contrast or insufficient contrast ratio
|
|
14
|
+
- Error messages, success messages, and status text with insufficient contrast
|
|
15
|
+
- Button text, navigation text, and interactive elements with poor contrast
|
|
16
|
+
- Table headers and content with insufficient contrast
|
|
17
|
+
|
|
18
|
+
ANALYSIS APPROACH:
|
|
19
|
+
|
|
20
|
+
1. Examine text colors against their background colors
|
|
21
|
+
2. Identify contrast ratios that fall below WCAG requirements
|
|
22
|
+
3. Consider the context and importance of the text
|
|
23
|
+
4. Focus on real accessibility impacts for users with low vision
|
|
24
|
+
|
|
25
|
+
For any issues you find, provide specific descriptions of the contrast problem and actionable recommendations for achieving proper contrast ratios.
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""WCAG 2.2 SC 1.4.3 / 1.4.11 contrast-ratio calculator.
|
|
3
|
+
|
|
4
|
+
Computes the exact WCAG contrast ratio between a foreground and a background
|
|
5
|
+
color so the accessibility reviewer never has to approximate relative luminance
|
|
6
|
+
by hand (which is unreliable and has produced inconsistent findings). The
|
|
7
|
+
reviewer resolves the two colors from the component's HTML/CSS, then invokes
|
|
8
|
+
this script; the printed verdict is authoritative.
|
|
9
|
+
|
|
10
|
+
Usage:
|
|
11
|
+
contrast-ratio.py FOREGROUND BACKGROUND [--large] [--json]
|
|
12
|
+
|
|
13
|
+
Arguments:
|
|
14
|
+
FOREGROUND Text color. Accepts #RGB, #RRGGBB, rgb(r,g,b) or rgba(r,g,b,a).
|
|
15
|
+
BACKGROUND Background color. Must be opaque (#RGB/#RRGGBB/rgb()); used as
|
|
16
|
+
the compositing base when FOREGROUND carries an alpha channel.
|
|
17
|
+
|
|
18
|
+
Options:
|
|
19
|
+
--large Classify the text as large-scale (>=24px, or >=18.66px bold),
|
|
20
|
+
which uses the 3:1 threshold instead of 4.5:1 for the primary
|
|
21
|
+
PASS/FAIL. Both thresholds are always reported regardless.
|
|
22
|
+
--json Emit a machine-readable JSON object instead of the text report.
|
|
23
|
+
|
|
24
|
+
Exit codes:
|
|
25
|
+
0 Ratio meets the applicable threshold (PASS)
|
|
26
|
+
1 Ratio is below the applicable threshold (FAIL)
|
|
27
|
+
2 Argument / parse error
|
|
28
|
+
"""
|
|
29
|
+
|
|
30
|
+
import argparse
|
|
31
|
+
import json
|
|
32
|
+
import re
|
|
33
|
+
import sys
|
|
34
|
+
|
|
35
|
+
_STANDARD_THRESHOLD = 4.5
|
|
36
|
+
_LARGE_THRESHOLD = 3.0
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
def _parse_color(value):
|
|
40
|
+
"""Return (r, g, b, a) with channels in 0-255 and alpha in 0.0-1.0."""
|
|
41
|
+
s = value.strip()
|
|
42
|
+
|
|
43
|
+
m = re.fullmatch(r"#([0-9a-fA-F]{3})", s)
|
|
44
|
+
if m:
|
|
45
|
+
r, g, b = (int(c * 2, 16) for c in m.group(1))
|
|
46
|
+
return r, g, b, 1.0
|
|
47
|
+
|
|
48
|
+
m = re.fullmatch(r"#([0-9a-fA-F]{6})", s)
|
|
49
|
+
if m:
|
|
50
|
+
h = m.group(1)
|
|
51
|
+
return int(h[0:2], 16), int(h[2:4], 16), int(h[4:6], 16), 1.0
|
|
52
|
+
|
|
53
|
+
m = re.fullmatch(
|
|
54
|
+
r"rgba?\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*(?:,\s*([\d.]+)\s*)?\)",
|
|
55
|
+
s,
|
|
56
|
+
)
|
|
57
|
+
if m:
|
|
58
|
+
r, g, b = (int(round(float(m.group(i)))) for i in (1, 2, 3))
|
|
59
|
+
a = float(m.group(4)) if m.group(4) is not None else 1.0
|
|
60
|
+
for ch in (r, g, b):
|
|
61
|
+
if not 0 <= ch <= 255:
|
|
62
|
+
raise ValueError(f"channel out of range in '{value}'")
|
|
63
|
+
if not 0.0 <= a <= 1.0:
|
|
64
|
+
raise ValueError(f"alpha out of range in '{value}'")
|
|
65
|
+
return r, g, b, a
|
|
66
|
+
|
|
67
|
+
raise ValueError(
|
|
68
|
+
f"unrecognized color '{value}' — use #RGB, #RRGGBB, rgb(), or rgba()"
|
|
69
|
+
)
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
def _composite(fg, bg):
|
|
73
|
+
"""Alpha-composite fg over an opaque bg; return an opaque (r, g, b)."""
|
|
74
|
+
fr, fgc, fb, fa = fg
|
|
75
|
+
br, bgc, bb, _ = bg
|
|
76
|
+
if fa >= 1.0:
|
|
77
|
+
return fr, fgc, fb
|
|
78
|
+
return (
|
|
79
|
+
round(fr * fa + br * (1 - fa)),
|
|
80
|
+
round(fgc * fa + bgc * (1 - fa)),
|
|
81
|
+
round(fb * fa + bb * (1 - fa)),
|
|
82
|
+
)
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
def _relative_luminance(rgb):
|
|
86
|
+
"""WCAG relative luminance for an opaque sRGB (r, g, b) triple."""
|
|
87
|
+
def _lin(c):
|
|
88
|
+
c /= 255.0
|
|
89
|
+
return c / 12.92 if c <= 0.03928 else ((c + 0.055) / 1.055) ** 2.4
|
|
90
|
+
|
|
91
|
+
r, g, b = (_lin(c) for c in rgb)
|
|
92
|
+
return 0.2126 * r + 0.7152 * g + 0.0722 * b
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
def contrast_ratio(foreground, background):
|
|
96
|
+
"""Exact WCAG contrast ratio between two color strings (>= 1.0)."""
|
|
97
|
+
fg = _parse_color(foreground)
|
|
98
|
+
bg = _parse_color(background)
|
|
99
|
+
if bg[3] < 1.0:
|
|
100
|
+
raise ValueError(
|
|
101
|
+
f"background '{background}' is translucent — its rendered color "
|
|
102
|
+
"depends on the layer beneath it and cannot be determined. Resolve "
|
|
103
|
+
"the effective opaque background and pass that instead."
|
|
104
|
+
)
|
|
105
|
+
fg_rgb = _composite(fg, bg)
|
|
106
|
+
l1 = _relative_luminance(fg_rgb)
|
|
107
|
+
l2 = _relative_luminance(bg[:3])
|
|
108
|
+
lighter, darker = (l1, l2) if l1 >= l2 else (l2, l1)
|
|
109
|
+
return (lighter + 0.05) / (darker + 0.05)
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
def main(argv=None):
|
|
113
|
+
parser = argparse.ArgumentParser(add_help=True)
|
|
114
|
+
parser.add_argument("foreground")
|
|
115
|
+
parser.add_argument("background")
|
|
116
|
+
parser.add_argument("--large", action="store_true")
|
|
117
|
+
parser.add_argument("--json", action="store_true", dest="as_json")
|
|
118
|
+
args = parser.parse_args(argv)
|
|
119
|
+
|
|
120
|
+
try:
|
|
121
|
+
ratio = contrast_ratio(args.foreground, args.background)
|
|
122
|
+
except ValueError as exc:
|
|
123
|
+
print(f"ERROR: {exc}", file=sys.stderr)
|
|
124
|
+
return 2
|
|
125
|
+
|
|
126
|
+
threshold = _LARGE_THRESHOLD if args.large else _STANDARD_THRESHOLD
|
|
127
|
+
passes = ratio >= threshold
|
|
128
|
+
result = {
|
|
129
|
+
"foreground": args.foreground,
|
|
130
|
+
"background": args.background,
|
|
131
|
+
"ratio": round(ratio, 2),
|
|
132
|
+
"textClass": "large" if args.large else "standard",
|
|
133
|
+
"threshold": threshold,
|
|
134
|
+
"passesStandard": ratio >= _STANDARD_THRESHOLD,
|
|
135
|
+
"passesLarge": ratio >= _LARGE_THRESHOLD,
|
|
136
|
+
"verdict": "PASS" if passes else "FAIL",
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
if args.as_json:
|
|
140
|
+
print(json.dumps(result))
|
|
141
|
+
else:
|
|
142
|
+
print(
|
|
143
|
+
f"{result['ratio']}:1 {result['verdict']} "
|
|
144
|
+
f"({result['textClass']} text, threshold {threshold}:1) | "
|
|
145
|
+
f"standard 4.5:1 {'pass' if result['passesStandard'] else 'fail'}, "
|
|
146
|
+
f"large 3:1 {'pass' if result['passesLarge'] else 'fail'}"
|
|
147
|
+
)
|
|
148
|
+
|
|
149
|
+
return 0 if passes else 1
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
if __name__ == "__main__":
|
|
153
|
+
sys.exit(main())
|
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: experience-lwc-design-generate
|
|
3
|
+
description: "Use when you need to create a brand new Lightning Web Component from a Figma design, a Product Requirements Document, or another design artifact — orchestrating the five-phase workflow (gather requirements → generate code → optimize → lint/format/compile → test) and stitching together the specialized skills for SLDS, LDS, base components, optimization, and testing. Use this skill whenever the user mentions building a new LWC from Figma, building an LWC from a PRD, generating an LWC from a design or screenshot, or migrating an Aura component as a fresh LWC build. DO NOT TRIGGER when refactoring an existing LWC (use experience-lwc-generate), for Aura → LWC in-place migration (out of scope for this skill), for standalone SLDS token or styling work (use design-systems-slds-apply), or for standalone data-layer work (use experience-lds-best-practices-apply or experience-lds-data-requirements-generate)."
|
|
4
|
+
metadata:
|
|
5
|
+
version: "1.0"
|
|
6
|
+
cliTools:
|
|
7
|
+
- tool: ["eslint"]
|
|
8
|
+
semver: ">=8.0"
|
|
9
|
+
- tool: ["prettier"]
|
|
10
|
+
semver: ">=2.0"
|
|
11
|
+
- tool: ["python3"]
|
|
12
|
+
semver: ">=3.8"
|
|
13
|
+
relatedSkills:
|
|
14
|
+
- design-systems-slds-apply
|
|
15
|
+
- experience-lds-best-practices-apply
|
|
16
|
+
- experience-lds-data-requirements-generate
|
|
17
|
+
- experience-lwc-accessibility-validate
|
|
18
|
+
- experience-lwc-base-components-integrate
|
|
19
|
+
- experience-lwc-generate
|
|
20
|
+
- experience-lwc-rtl-validate
|
|
21
|
+
- experience-lwc-runtime-observe
|
|
22
|
+
- experience-lwc-security-validate
|
|
23
|
+
- experience-lwc-typescript-migrate
|
|
24
|
+
---
|
|
25
|
+
<!-- adk-managed-skill -->
|
|
26
|
+
|
|
27
|
+
# Creating LWC Components from Design
|
|
28
|
+
|
|
29
|
+
Orchestrate the end-to-end creation of a new Lightning Web Component from a design input (Figma, PRD, Aura source, or user description). This is the top-level workflow skill — it sequences the specialized sibling skills that own each stage. Org-aware data (LDS schema introspection, design-frame inspection) is resolved by handing off to `experience-lds-data-requirements-generate` or via design-tool URLs the user provides.
|
|
30
|
+
|
|
31
|
+
## When to Use
|
|
32
|
+
|
|
33
|
+
- Building a brand-new LWC from a Figma frame, PRD, or written spec.
|
|
34
|
+
- Migrating an Aura component to LWC as a fresh build (in-place Aura → LWC porting is out of scope for this skill).
|
|
35
|
+
- Creating a component whose requirements are still partly implicit and need distillation into a PRD before coding.
|
|
36
|
+
|
|
37
|
+
Do NOT use this skill for:
|
|
38
|
+
- Refactoring an existing LWC (use `experience-lwc-generate`).
|
|
39
|
+
- Aura → LWC in-place migration (out of scope for this skill).
|
|
40
|
+
- Pure styling or data-layer work (use the specialized skills directly).
|
|
41
|
+
|
|
42
|
+
## Prerequisites
|
|
43
|
+
|
|
44
|
+
- At least one design input: Figma URL, PRD markdown, Aura component source, or a textual spec.
|
|
45
|
+
- Target path (module folder) for the new LWC.
|
|
46
|
+
- For data-backed components: access to the org so `experience-lds-data-requirements-generate` and `experience-lds-best-practices-apply` can resolve the schema and adapter shapes.
|
|
47
|
+
|
|
48
|
+
## Knowledge Bases
|
|
49
|
+
|
|
50
|
+
- [references/prd-analysis-template.md](references/prd-analysis-template.md) — PRD section skeleton (copy it verbatim when producing a PRD).
|
|
51
|
+
- [references/figma-to-prd-blueprint.md](references/figma-to-prd-blueprint.md) — Figma-specific guidance for translating a frame into PRD sections (componentName/tagName, contentRequirements, dataRequirements, interactions, componentCommunication, states, accessibility/responsiveness/styling/localization/security). Read this before Phase 1.2 when the input is a Figma design.
|
|
52
|
+
|
|
53
|
+
## Workflow (mandatory five phases)
|
|
54
|
+
|
|
55
|
+
### Phase 1 — Gather PRD & requirements
|
|
56
|
+
|
|
57
|
+
**Goal:** produce a consolidated PRD that every later phase consumes.
|
|
58
|
+
|
|
59
|
+
1. **Obtain raw requirements** — collect the PRD, design spec, Figma URL, Aura source, or user text.
|
|
60
|
+
2. **Figma → PRD** (if applicable): follow [references/figma-to-prd-blueprint.md](references/figma-to-prd-blueprint.md) for the full Figma-frame analysis and PRD section guidelines. Inputs you need from the user: the Figma URL, a screenshot of the target frame, and (if Dev Mode is available) the metadata export for the node. Translate into the PRD skeleton from [references/prd-analysis-template.md](references/prd-analysis-template.md) using the section-by-section guidance in the blueprint.
|
|
61
|
+
3. **Aura → PRD** (if migrating): enumerate the Aura component's functionality that must be preserved — markup, controller/helper actions, events, attributes, and wired data — and feed that inventory into the PRD as explicit requirements. (In-place Aura → LWC porting is out of scope; this step only captures behavior for a fresh build.)
|
|
62
|
+
4. **Data requirements** (if the component reads/writes data): hand off to `experience-lds-data-requirements-generate`. That skill produces a validated data specification (object/field API names, recommended LDS API, implementation approach). Paste its output verbatim into the PRD.
|
|
63
|
+
5. **Adapter exploration**: hand off to `experience-lds-best-practices-apply` for the adapter selection rules (UI API vs GraphQL vs Apex) and the recommended wiring for the chosen approach.
|
|
64
|
+
6. **Naming**: `componentName` must be camelCase (e.g., `productCard`) and `tagName` must be its kebab-case form (e.g., `product-card`). Validate both with the bundled script — do not eyeball the check:
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
"<skill_dir>/scripts/check-component-name.sh" <componentName> <tagName>
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
The script exits nonzero (with an actionable stderr message) if either name is malformed or if the kebab form of `componentName` does not equal `tagName`.
|
|
71
|
+
|
|
72
|
+
**Deliverable:** a comprehensive PRD covering purpose, content, data, interactions, states, a11y, responsiveness, styling direction, localization, and security. Keep it checked into the workspace (e.g., `packages/skills/<skill>-workspace/<iteration>/PRD.md`).
|
|
73
|
+
|
|
74
|
+
### Phase 2 — Generate component code
|
|
75
|
+
|
|
76
|
+
**Goal:** initial `.html`, `.js`, `.css`, `.js-meta.xml` that strictly reflect the PRD.
|
|
77
|
+
|
|
78
|
+
1. Hand off to `experience-lwc-generate` with the PRD content as the spec. That skill owns PRD → code translation (events, getters, `@api`, `.js-meta.xml`, AI metadata) and is the authoring source of truth.
|
|
79
|
+
2. Use the SLDS decision hierarchy from `design-systems-slds-apply`:
|
|
80
|
+
1. Prefer a matching Lightning Base Component (`experience-lwc-base-components-integrate`).
|
|
81
|
+
2. Otherwise pick an SLDS Blueprint or utility class (per `design-systems-slds-apply`).
|
|
82
|
+
3. Otherwise write custom CSS using SLDS styling hooks (also covered in `design-systems-slds-apply`).
|
|
83
|
+
3. Re-confirm the authoring baseline by walking the `experience-lwc-generate` checklist before proceeding.
|
|
84
|
+
4. Translate every PRD data requirement to either a wire adapter (UIAPI / GraphQL) or an explicit TODO.
|
|
85
|
+
5. Adhere strictly to the PRD:
|
|
86
|
+
- Only include features and behaviors the PRD describes.
|
|
87
|
+
- Mark uncertain areas with `// TODO:` comments that quote the PRD language raising the ambiguity.
|
|
88
|
+
- Add extensive code comments explaining intent.
|
|
89
|
+
- Do not split the component into more sub-components than the PRD implies.
|
|
90
|
+
|
|
91
|
+
**Deliverable:** a first-pass LWC bundle in the target path.
|
|
92
|
+
|
|
93
|
+
### Phase 3 — Optimize component
|
|
94
|
+
|
|
95
|
+
**Goal:** apply performance, maintainability, and best-practice fixes.
|
|
96
|
+
|
|
97
|
+
1. Walk the optimization checklist below before any other review:
|
|
98
|
+
- Single responsibility, encapsulation, reusability.
|
|
99
|
+
- Minimize DOM operations; batch updates via properties.
|
|
100
|
+
- Audit event handlers and lifecycle hook usage (`renderedCallback` guards).
|
|
101
|
+
- Consider lazy loading for heavy children.
|
|
102
|
+
2. Hand off to `experience-lwc-generate` for the LWC best-practices review pass (anti-patterns, reactivity, composition).
|
|
103
|
+
3. Hand off to the compliance suite for the pre-ship review — `experience-lwc-accessibility-validate` (a11y), `experience-lwc-security-validate` (LWS + Product Security), and `experience-lwc-rtl-validate` (RTL i18n). Run them together for the full quality pass.
|
|
104
|
+
4. If the component touches data, hand off to `experience-lds-best-practices-apply` for cache/consistency and referential-integrity checks.
|
|
105
|
+
5. Apply every accepted finding. Keep the PRD as the source of truth — do not add scope under the guise of optimization.
|
|
106
|
+
|
|
107
|
+
### Phase 4 — Lint, format, compile-check
|
|
108
|
+
|
|
109
|
+
Condition: only run steps whose tooling is configured in the project.
|
|
110
|
+
|
|
111
|
+
1. **Detect project tooling** — invoke the bundled detection script from the project root and read its `<tool>=yes|no` lines. Do NOT eyeball `package.json` / dotfiles in prose:
|
|
112
|
+
|
|
113
|
+
```bash
|
|
114
|
+
"<skill_dir>/scripts/detect-project-tools.sh" <projectRoot>
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
Sample output:
|
|
118
|
+
|
|
119
|
+
```text
|
|
120
|
+
eslint=yes
|
|
121
|
+
prettier=yes
|
|
122
|
+
cursor-rules=no
|
|
123
|
+
lwc-compiler=yes
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
Run the substeps below only for tools reported `yes`; skip the rest.
|
|
127
|
+
2. **ESLint** (if `eslint=yes`) — run and fix all violations.
|
|
128
|
+
3. **Prettier** (if `prettier=yes`) — run for consistent formatting.
|
|
129
|
+
4. **Cursor rules** (if `cursor-rules=yes`) — apply every rule the project ships.
|
|
130
|
+
5. **LWC compiler** (if `lwc-compiler=yes`) — run via local dev server or SFDX; resolve every syntax/template error before moving on.
|
|
131
|
+
|
|
132
|
+
**Deliverable:** clean, validated component code.
|
|
133
|
+
|
|
134
|
+
### Phase 5 — Create tests
|
|
135
|
+
|
|
136
|
+
Hand off to `experience-lwc-accessibility-jest-run` for automated accessibility Jest coverage; add general-purpose Jest coverage in the same pass following the `experience-lwc-generate` test guidance, plus UTAM page object generation if the team requires it.
|
|
137
|
+
|
|
138
|
+
**Deliverable:** the LWC bundle with a passing test suite at or above the project's coverage threshold.
|
|
139
|
+
|
|
140
|
+
## Definition of Done
|
|
141
|
+
|
|
142
|
+
A new component built from this workflow is "done" only when **every** item below is true. Treat this as the canonical readiness checklist — copy it into the PR description so reviewers can confirm each line.
|
|
143
|
+
|
|
144
|
+
**Code completion** — no implementation gaps:
|
|
145
|
+
|
|
146
|
+
1. Every PRD requirement is either implemented or explicitly annotated with a `TODO:` and a linked tracking item. No silent gaps.
|
|
147
|
+
2. No `TODO`, `FIXME`, or `console.log` / `console.table` / `alert()` left in production paths.
|
|
148
|
+
3. No commented-out code blocks, no empty function bodies, no placeholder values, no dummy data, no unreferenced imports.
|
|
149
|
+
4. No `lwc:dom="manual"` regions or third-party-library escape hatches without a comment explaining why a native LWC pattern wasn't used.
|
|
150
|
+
|
|
151
|
+
**Compliance and quality:**
|
|
152
|
+
|
|
153
|
+
5. `.js-meta.xml` AI metadata passes the audit in `experience-lwc-generate` (component-wide `<ai><description>` set, plus an `<ai><property name="…" aiDescription="…"/></ai>` entry for every `@api` member exposed through `<targetConfig>`; no marketing language).
|
|
154
|
+
6. SLDS styling passes `design-systems-slds-apply` verification — no raw hex / px values, only styling hooks and SLDS utility classes.
|
|
155
|
+
7. Accessibility pass complete: `experience-lwc-accessibility-validate` for source review + `experience-lwc-accessibility-jest-run` for automated tests, both green.
|
|
156
|
+
8. Security + RTL pass complete: `experience-lwc-security-validate` + `experience-lwc-rtl-validate`, both green.
|
|
157
|
+
|
|
158
|
+
**Data + tests:**
|
|
159
|
+
|
|
160
|
+
9. Data layer verified against the referenced LDS adapters (every wire / imperative call is documented in the PRD's data section and matches one of the adapters from `experience-lds-best-practices-apply` or `experience-lds-data-requirements-generate`).
|
|
161
|
+
10. Jest tests green at the required coverage level for the project. New tests cover every `@api` surface, every dispatched event, and every error path (failed wire, failed apex, validation rejection).
|
|
162
|
+
11. UTAM page objects produced for any UI flow that needs cross-component browser-level testing (skip if not needed).
|
|
163
|
+
|
|
164
|
+
## Cross-References
|
|
165
|
+
|
|
166
|
+
- Skills chained by this workflow (in phase order):
|
|
167
|
+
- `experience-lds-data-requirements-generate` — Phase 1.4 data spec (and Phase 1.5 adapter exploration alongside `experience-lds-best-practices-apply`).
|
|
168
|
+
- `design-systems-slds-apply`, `experience-lwc-base-components-integrate` — Phase 2 styling decisions.
|
|
169
|
+
- `experience-lwc-generate` — Phase 2 authoring baseline + Phase 3 best-practices review + Phase 5 AI-metadata audit.
|
|
170
|
+
- `experience-lds-best-practices-apply` — Phase 2/3 data-layer adapter selection and consistency review.
|
|
171
|
+
- `experience-lwc-accessibility-validate`, `experience-lwc-security-validate`, `experience-lwc-rtl-validate` — Phase 3 a11y/security/RTL review.
|
|
172
|
+
- `experience-lwc-accessibility-jest-run` — Phase 5 automated a11y test generation.
|
|
173
|
+
- Optional: add o11y instrumentation as a separate pass once the component stabilizes.
|
|
174
|
+
- `experience-lwc-typescript-migrate` — optional once JS is green.
|
|
175
|
+
- When the new component ships behind a flag, gate it with a feature flag during rollout.
|
|
176
|
+
- `experience-lwc-api-docs-generate` — once the public API surface is stable.
|
|
177
|
+
- Org-aware inputs used by this workflow:
|
|
178
|
+
- Figma URL + screenshot (and, if available, the developer's Dev Mode metadata export) — Phase 1.2 Figma input.
|
|
179
|
+
- `experience-lds-data-requirements-generate` owns the org-schema introspection and data-spec validation used in Phase 1 when the component needs org-backed data — hand off to that skill rather than duplicating its work here.
|
|
180
|
+
|
|
181
|
+
## Examples
|
|
182
|
+
|
|
183
|
+
**Phase 1 PRD skeleton (fill from the Figma/PRD/Aura input)**
|
|
184
|
+
|
|
185
|
+
```text
|
|
186
|
+
Component: productCard (<product-card>)
|
|
187
|
+
Purpose: Render a compact summary of a product with quick actions.
|
|
188
|
+
|
|
189
|
+
Content requirements
|
|
190
|
+
- Hero image (Product.HeroImage__c)
|
|
191
|
+
- Title (Product.Name)
|
|
192
|
+
- Subtitle (Product.Tagline__c)
|
|
193
|
+
- Primary CTA button ("Add to cart")
|
|
194
|
+
- Secondary CTA icon button ("Favorite")
|
|
195
|
+
|
|
196
|
+
Data requirements
|
|
197
|
+
- Input: @api recordId (Product Id)
|
|
198
|
+
- Adapter: getRecord (UIAPI) with fields Name, Tagline__c, HeroImage__c
|
|
199
|
+
- Events out: addtocart{detail.recordId}, favorite{detail.recordId, detail.value}
|
|
200
|
+
|
|
201
|
+
States
|
|
202
|
+
- Loading (data not yet resolved)
|
|
203
|
+
- Error (adapter error)
|
|
204
|
+
- Empty (no record found)
|
|
205
|
+
- Default
|
|
206
|
+
|
|
207
|
+
Accessibility
|
|
208
|
+
- Title uses <h3>
|
|
209
|
+
- Icon-only button carries aria-label="Favorite"
|
|
210
|
+
- Card is a labelled region (role="group", aria-labelledby)
|
|
211
|
+
|
|
212
|
+
Responsiveness
|
|
213
|
+
- Full width < 480px
|
|
214
|
+
- Side-by-side image + text >= 480px
|
|
215
|
+
|
|
216
|
+
Styling
|
|
217
|
+
- Uses lightning-card wrapper
|
|
218
|
+
- Surface color: --slds-g-color-surface-container-1
|
|
219
|
+
- Shadow: --slds-g-shadow-1
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
**Phase 2 skeleton**
|
|
223
|
+
|
|
224
|
+
```javascript
|
|
225
|
+
import { LightningElement, api, wire } from 'lwc';
|
|
226
|
+
import { getRecord } from 'lightning/uiRecordApi';
|
|
227
|
+
import NAME from '@salesforce/schema/Product__c.Name';
|
|
228
|
+
import TAGLINE from '@salesforce/schema/Product__c.Tagline__c';
|
|
229
|
+
import HERO from '@salesforce/schema/Product__c.HeroImage__c';
|
|
230
|
+
|
|
231
|
+
const FIELDS = [NAME, TAGLINE, HERO];
|
|
232
|
+
|
|
233
|
+
export default class ProductCard extends LightningElement {
|
|
234
|
+
@api recordId;
|
|
235
|
+
|
|
236
|
+
@wire(getRecord, { recordId: '$recordId', fields: FIELDS })
|
|
237
|
+
record;
|
|
238
|
+
|
|
239
|
+
get hasRecord() { return this.record?.data != null; }
|
|
240
|
+
get isLoading() { return !this.record; }
|
|
241
|
+
get hasError() { return !!this.record?.error; }
|
|
242
|
+
get name() { return this.record?.data?.fields?.Name?.value ?? ''; }
|
|
243
|
+
get tagline() { return this.record?.data?.fields?.Tagline__c?.value ?? ''; }
|
|
244
|
+
get heroUrl() { return this.record?.data?.fields?.HeroImage__c?.value ?? ''; }
|
|
245
|
+
|
|
246
|
+
handleAddToCart() {
|
|
247
|
+
this.dispatchEvent(new CustomEvent('addtocart', { detail: { recordId: this.recordId }, bubbles: true, composed: true }));
|
|
248
|
+
}
|
|
249
|
+
handleFavorite(event) {
|
|
250
|
+
this.dispatchEvent(new CustomEvent('favorite', { detail: { recordId: this.recordId, value: event.detail.value }, bubbles: true, composed: true }));
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
## Verification
|
|
256
|
+
|
|
257
|
+
- Every PRD section is traceable to at least one block of code or an explicit TODO.
|
|
258
|
+
- Phases 1–5 were executed in order; no step was skipped.
|
|
259
|
+
- Accessibility, SLDS, data-layer, and AI metadata reviews all pass.
|
|
260
|
+
- Coverage meets or exceeds the project's threshold.
|
|
261
|
+
- The component renders correctly in `experience-lwc-runtime-observe` across the responsive breakpoints enumerated in the PRD.
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
# Figma → PRD Blueprint
|
|
2
|
+
|
|
3
|
+
You are a specialized assistant focused on converting Figma designs into a LWC Component.
|
|
4
|
+
|
|
5
|
+
TASK: Analyze the provided Figma frame and generate a complete PRD following the specified structure, then hand off to `experience-lwc-generate` to generate the LWC Component.
|
|
6
|
+
|
|
7
|
+
## PRD Generation Process
|
|
8
|
+
|
|
9
|
+
1. Analyze the Figma frame carefully, identifying all visual elements, interactions, data structures, and component relationships
|
|
10
|
+
2. Extract relevant component information including:
|
|
11
|
+
- Visual hierarchy and content elements
|
|
12
|
+
- Interactive elements and their behaviors
|
|
13
|
+
- Data requirements and dependencies
|
|
14
|
+
- Design patterns and styling information
|
|
15
|
+
- Accessibility considerations
|
|
16
|
+
- Responsive behaviors
|
|
17
|
+
3. Organize this information according to the PRD blueprint schema
|
|
18
|
+
4. Generate a comprehensive markdown document that fully describes the component requirements
|
|
19
|
+
|
|
20
|
+
## Guidelines for Key Sections
|
|
21
|
+
|
|
22
|
+
### componentName and tagName
|
|
23
|
+
|
|
24
|
+
- Use a descriptive name based on the component's purpose
|
|
25
|
+
- Follow naming conventions: camelCase for componentName (e.g., `productCard`) and kebab-case for tagName (e.g., `product-card`)
|
|
26
|
+
|
|
27
|
+
### contentRequirements
|
|
28
|
+
|
|
29
|
+
- Identify all visual elements in the Figma frame that display content
|
|
30
|
+
- Document text blocks, images, icons, buttons, and other UI elements
|
|
31
|
+
- Explain what each element displays and why it's necessary
|
|
32
|
+
|
|
33
|
+
### dataRequirements
|
|
34
|
+
|
|
35
|
+
- Determine what data is needed to power each content element
|
|
36
|
+
- Identify where the data should come from (properties, events, etc.)
|
|
37
|
+
- Document how the data will be used
|
|
38
|
+
|
|
39
|
+
### interactions
|
|
40
|
+
|
|
41
|
+
- Document all user interactions visible in the design (clicks, hovers, etc.)
|
|
42
|
+
- Describe the expected behavior for each interaction
|
|
43
|
+
- Explain the purpose behind each interaction
|
|
44
|
+
|
|
45
|
+
### componentCommunication
|
|
46
|
+
|
|
47
|
+
- Identify events the component should emit or listen for
|
|
48
|
+
- Describe what data should be passed in these communications
|
|
49
|
+
- Explain why this communication is necessary
|
|
50
|
+
|
|
51
|
+
### states
|
|
52
|
+
|
|
53
|
+
- Identify different visual states shown in the design (default, hover, active, error, etc.)
|
|
54
|
+
- Document conditions that trigger state changes
|
|
55
|
+
- Explain the purpose of each state
|
|
56
|
+
|
|
57
|
+
### accessibility, responsiveness, styling, localization, and security
|
|
58
|
+
|
|
59
|
+
- Extract any relevant information from the design
|
|
60
|
+
- Make reasonable assumptions where the design doesn't specify these aspects
|
|
61
|
+
- Provide detailed requirements that align with best practices
|
|
62
|
+
- For styling, follow SLDS patterns: use Lightning Base Components where possible (see `experience-lwc-base-components-integrate`), then SLDS Blueprints, then SLDS styling hooks (see `design-systems-slds-apply`)
|
|
63
|
+
|
|
64
|
+
## Output Format
|
|
65
|
+
|
|
66
|
+
Provide the complete PRD as a valid markdown document. Ensure all required fields are completed with detailed, specific information extracted from the Figma design.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Your task
|
|
2
|
+
|
|
3
|
+
Review {{SUBJECT}} and identify {{DOMAIN}} issues.
|
|
4
|
+
Return your analysis as report in SARIF JSON format with no additional text or explanation.
|
|
5
|
+
|
|
6
|
+
## Instructions for identifying {{DOMAIN}} issues.
|
|
7
|
+
|
|
8
|
+
The instructions below provide list of possible issues with the explanation how to find and report those.
|
|
9
|
+
Each section corresponds to a specific issue and describes what patterns to look for.
|
|
10
|
+
|
|
11
|
+
{{INSTRUCTIONS}}
|
|
12
|
+
|
|
13
|
+
## Requirements to output
|
|
14
|
+
|
|
15
|
+
- Return ONLY valid JSON without any additional information
|
|
16
|
+
- Do not write JSON to a file, just respond with it
|
|
17
|
+
- List of results should be empty if no issues were found
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# Validates that the two names an LWC bundle requires are in the correct
|
|
3
|
+
# case conventions and are consistent with each other:
|
|
4
|
+
#
|
|
5
|
+
# componentName — camelCase (e.g. `productCard`)
|
|
6
|
+
# tagName — kebab-case (e.g. `product-card`)
|
|
7
|
+
#
|
|
8
|
+
# Also verifies the kebab-case form of `componentName` equals `tagName`,
|
|
9
|
+
# so `productCard` / `product-card` passes but `productCard` /
|
|
10
|
+
# `productcard` (missing dash) does not.
|
|
11
|
+
#
|
|
12
|
+
# Usage:
|
|
13
|
+
# <skill_dir>/scripts/check-component-name.sh <componentName> <tagName>
|
|
14
|
+
#
|
|
15
|
+
# Exit codes:
|
|
16
|
+
# 0 — both names conform to their conventions and are consistent
|
|
17
|
+
# 1 — validation failure (message on stderr describing which rule failed)
|
|
18
|
+
# 2 — usage error
|
|
19
|
+
|
|
20
|
+
set -euo pipefail
|
|
21
|
+
|
|
22
|
+
fail() {
|
|
23
|
+
echo "check-component-name: $*" >&2
|
|
24
|
+
exit 1
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
if [ "$#" -ne 2 ]; then
|
|
28
|
+
echo "usage: $0 <componentName> <tagName>" >&2
|
|
29
|
+
exit 2
|
|
30
|
+
fi
|
|
31
|
+
|
|
32
|
+
component_name="$1"
|
|
33
|
+
tag_name="$2"
|
|
34
|
+
|
|
35
|
+
python3 - "$component_name" "$tag_name" <<'PY'
|
|
36
|
+
import re
|
|
37
|
+
import sys
|
|
38
|
+
|
|
39
|
+
component_name, tag_name = sys.argv[1], sys.argv[2]
|
|
40
|
+
|
|
41
|
+
CAMEL_RE = re.compile(r"^[a-z][a-zA-Z0-9]*$")
|
|
42
|
+
KEBAB_RE = re.compile(r"^[a-z][a-z0-9]*(-[a-z0-9]+)+$")
|
|
43
|
+
|
|
44
|
+
errors = []
|
|
45
|
+
|
|
46
|
+
if not CAMEL_RE.match(component_name):
|
|
47
|
+
errors.append(
|
|
48
|
+
f"componentName `{component_name}` is not camelCase — must start with a "
|
|
49
|
+
"lowercase letter and contain only letters/digits (e.g. `productCard`)."
|
|
50
|
+
)
|
|
51
|
+
|
|
52
|
+
if not KEBAB_RE.match(tag_name):
|
|
53
|
+
errors.append(
|
|
54
|
+
f"tagName `{tag_name}` is not kebab-case — must start with a lowercase "
|
|
55
|
+
"letter and contain at least one `-` separator with lowercase segments "
|
|
56
|
+
"(e.g. `product-card`)."
|
|
57
|
+
)
|
|
58
|
+
|
|
59
|
+
if not errors:
|
|
60
|
+
# componentName -> expected kebab-case: insert `-` before each interior
|
|
61
|
+
# uppercase letter and lowercase everything.
|
|
62
|
+
expected = re.sub(r"([A-Z])", r"-\1", component_name).lower()
|
|
63
|
+
if expected != tag_name:
|
|
64
|
+
errors.append(
|
|
65
|
+
f"tagName `{tag_name}` does not match componentName `{component_name}` "
|
|
66
|
+
f"— expected kebab-case form `{expected}`."
|
|
67
|
+
)
|
|
68
|
+
|
|
69
|
+
if errors:
|
|
70
|
+
for e in errors:
|
|
71
|
+
print(f"check-component-name: {e}", file=sys.stderr)
|
|
72
|
+
sys.exit(1)
|
|
73
|
+
|
|
74
|
+
print(f"check-component-name: OK ({component_name} / {tag_name})")
|
|
75
|
+
PY
|