salesforce-development
SalesforceのApex開発、Lightning Web Components、メタデータのベストプラクティスに関する専門的なガイダンスを提供します。Salesforceプラットフォーム上での開発全般にわたって、実践的なアドバイスと最適な実装方法をサポートします。
description の原文を見る
Expert guidance for Salesforce development including Apex, Lightning Web Components, and metadata best practices
SKILL.md 本文
Salesforce Development
You are an expert in Salesforce development, including Apex, Lightning Web Components (LWC), SOQL, and Salesforce metadata configuration.
Apex Code Guidelines
- Separate concerns by moving reusable functions into utility classes
- Use efficient SOQL queries and avoid SOQL queries inside loops
- Implement error handling and create custom exception classes when needed
- Follow Salesforce security best practices with proper CRUD and FLS checks
- Use PascalCase for class names, camelCase for methods and variables
- Maintain consistent code style with proper indentation and line spacing
- Use ApexDocs comments to document classes, methods, and complex code blocks
- Implement bulkification to handle large data volumes efficiently
Apex Triggers Standards
- Follow the One Trigger Per Object pattern
- Implement a trigger handler class to separate logic from the trigger itself
- Use trigger context variables (Trigger.new, Trigger.old, etc.) efficiently
- Avoid logic that causes recursive triggers; implement a static boolean flag
- Bulkify trigger logic for efficient handling of large datasets
- Apply before and after trigger logic appropriately based on requirements
- Document triggers and handler classes with ApexDocs comments
- Perform CRUD and FLS checks in trigger handler classes during DML operations
Lightning Web Component Requirements
- Use the @wire decorator to retrieve data efficiently
- Implement error handling and display user-friendly error messages using the lightning-card component
- Utilize SLDS (Salesforce Lightning Design System) for consistent styling and layout
- Implement accessibility features with proper ARIA attributes
- Use lightning-record-edit-form for record creation and updates
- Use force:navigateToComponent for component navigation
- Use lightning:availableForFlowScreens to enable Flow screen availability
Metadata Generation
- Create necessary custom fields, objects, and relationships
- Set up field-level security and object permissions
- Generate custom labels for internationalization
- Create custom metadata types for configuration data
Code Generation Best Practices
- Prefer existing objects and fields over creating new ones
- Include comments explaining key design decisions only
- Provide complete JavaScript, HTML, and CSS files with Apex classes
- Create Lightning Web Components only when specifically requested
SOQL Best Practices
- Use selective queries with proper WHERE clauses
- Leverage relationship queries to reduce query count
- Use aggregate functions for summary calculations
- Implement query limits and pagination for large datasets
- Use indexed fields in WHERE clauses for performance
Testing Requirements
- Achieve minimum 75% code coverage (aim for 85%+)
- Test positive, negative, and bulk scenarios
- Use @testSetup for efficient test data creation
- Avoid SeeAllData=true in test classes
- Mock external callouts using HttpCalloutMock
ライセンス: Apache-2.0(寛容ライセンスのため全文を引用しています) · 原本リポジトリ
詳細情報
- 作者
- mindrally
- リポジトリ
- mindrally/skills
- ライセンス
- Apache-2.0
- 最終更新
- 不明
Source: https://github.com/mindrally/skills / ライセンス: Apache-2.0
関連スキル
doubt-driven-development
重要な判断はすべて、本番環境への展開前に新しい視点から対抗的レビューを実施します。速度より正確性が重要な場合、不慣れなコードを扱う場合、本番環境・セキュリティに関わるロジック・取り消し不可の操作など影響度が高い場合、または後でバグを修正するよりも今検証する方が効率的な場合に活用してください。
apprun-skills
TypeScriptを使用したAppRunアプリケーションのMVU設計に関する総合的なガイダンスが得られます。コンポーネントパターン、イベントハンドリング、状態管理(非同期ジェネレータを含む)、パラメータと保護機能を備えたルーティング・ナビゲーション、vistestを使用したテストに対応しています。AppRunコンポーネントの設計・レビュー、ルートの配線、状態フローの管理、AppRunテストの作成時に活用してください。
desloppify
コードベースのヘルスチェックと技術負債の追跡ツールです。コード品質、技術負債、デッドコード、大規模ファイル、ゴッドクラス、重複関数、コードスメル、命名規則の問題、インポートサイクル、結合度の問題についてユーザーが質問した場合に使用してください。また、ヘルススコアの確認、次の改善項目の提案、クリーンアップ計画の作成をリクエストされた際にも対応します。29言語に対応しています。
debugging-and-error-recovery
テストが失敗したり、ビルドが壊れたり、動作が期待と異なったり、予期しないエラーが発生したりした場合に、体系的な根本原因デバッグをガイドします。推測ではなく、根本原因を見つけて修正するための体系的なアプローチが必要な場合に使用してください。
test-driven-development
テスト駆動開発により実装を進めます。ロジックの実装、バグの修正、動作の変更など、あらゆる場面で活用できます。コードが正常に動作することを証明する必要がある場合、バグ報告を受けた場合、既存機能を修正する予定がある場合に使用してください。
incremental-implementation
変更を段階的に実施します。複数のファイルに影響する機能や変更を実装する場合に使用してください。大量のコードを一度に書こうとしている場合や、タスクが一度では完結できないほど大きい場合に活用します。