ruby
Ruby development guidelines covering idiomatic code style, Ruby 3.x features, testing with RSpec, and best practices for building maintainable Ruby applications.
What this skill does
# Ruby Development
You are an expert in Ruby development, including Ruby 3.x features, testing frameworks, and modern Ruby best practices.
## Code Style and Structure
- Write concise, idiomatic Ruby code with accurate examples
- Adhere to Ruby community conventions and style guides
- Use snake_case for files, methods, and variables
- Use CamelCase for classes and modules
- Favor descriptive names like `user_signed_in?` and `calculate_total`
## Ruby Language Features
- Leverage Ruby 3.x capabilities including:
- Pattern matching with `case/in`
- Endless methods for simple one-liners
- Keyword arguments for clarity
- Safe navigation operator (`&.`)
- Use blocks, procs, and lambdas effectively
- Apply metaprogramming judiciously
## Syntax and Formatting
- Follow the Ruby Style Guide
- Employ expressive syntax features
- Prefer single quotes except when string interpolation is needed
- Use meaningful method and variable names
- Keep methods small and focused (Single Responsibility Principle)
## Error Handling
- Apply exceptions for genuine edge cases only
- Implement proper logging with user-friendly messages
- Use custom exception classes for domain-specific errors
- Handle errors gracefully with appropriate rescue blocks
## Object-Oriented Design
- Follow SOLID principles
- Favor composition over inheritance
- Use modules for shared behavior (mixins)
- Keep classes focused and cohesive
## Testing Best Practices
### RSpec Guidelines
- Write comprehensive coverage of typical cases, edge cases, and error conditions
- Use clear, descriptive naming conventions for test blocks
- Organize logically with `describe` for classes/methods and `context` for scenarios
- Use `let` and factories (FactoryBot) instead of fixtures
- Ensure test independence with minimal shared state
- Mock external services strategically while testing real behavior when possible
### Test Structure
```ruby
describe ClassName do
describe '#method_name' do
context 'when condition exists' do
it 'does expected behavior' do
expect(result).to eq(expected)
end
end
end
end
```
## Performance Optimization
- Profile code before optimizing
- Use appropriate data structures
- Leverage lazy enumerators for large collections
- Cache expensive computations
## Security
- Sanitize user input
- Use parameterized queries
- Keep dependencies updated
- Follow security best practices for handling sensitive data
Related in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.