Use for cross-language coding best practices, design patterns, and principles that apply to Ruby, Rust, Python, and TypeScript.
From psnnpx claudepluginhub aladac/claude-pluginsThis skill uses the workspace's default tool permissions.
Guides Next.js Cache Components and Partial Prerendering (PPR) with cacheComponents enabled. Implements 'use cache', cacheLife(), cacheTag(), revalidateTag(), static/dynamic optimization, and cache debugging.
Migrates code, prompts, and API calls from Claude Sonnet 4.0/4.5 or Opus 4.1 to Opus 4.5, updating model strings on Anthropic, AWS, GCP, Azure platforms.
Optimizes cloud costs on AWS, Azure, GCP via rightsizing, tagging strategies, reserved instances, spot usage, and spending analysis. Use for expense reduction and governance.
| Tool | Purpose |
|---|---|
Read | Read source files for analysis |
Write | Create new source files |
Edit | Modify existing code |
Glob | Find source files by pattern |
Grep | Search code for patterns |
Bash | Run linters, formatters, tests |
psn:code:ruby, psn:code:rust, psn:code:python, psn:code:typescriptpsn:code:*-test skillspsn:code:*-tooling skillsCross-language patterns that improve readability and maintainability.
Exit early. Keep the happy path unindented.
# Prefer: Guard clauses
def process(user)
return unless user
return if user.banned?
raise ArgumentError, "No email" unless user.email
# Happy path at base indentation
send_notification(user)
end
# Avoid: Nested conditionals
def process(user)
if user
unless user.banned?
if user.email
send_notification(user)
end
end
end
end
Why: The first reads top-to-bottom. The second requires mental stack management.
Test files mirror source structure exactly:
# Source # Test
lib/something/something_else.rb → spec/something/something_else_spec.rb
src/users/service.py → tests/users/test_service.py
src/orders/validator.ts → src/orders/validator.test.ts
src/parser/mod.rs → src/parser/mod.rs (inline #[cfg(test)])
Why: One-to-one mapping = instant navigation. No hunting.
Categorize by domain, not by type:
# Yes - domain-driven
src/
users/
models.py
services.py
orders/
models.py
services.py
# No - flat soup
src/
user_models.py
user_services.py
order_models.py
Why: Domains scale independently. Flat files become unmanageable.
Make invalid states unrepresentable:
// Bad: stringly-typed
fn send_email(to: String) { ... }
// Good: validated at construction
struct Email(String);
impl Email {
fn parse(s: &str) -> Result<Self, EmailError> { ... }
}
fn send_email(to: Email) { ... } // Can't pass invalid email
Applies to all languages:
@dataclass with __post_init__TryFromHandle errors where they enter your system:
┌─────────────────────────────────────────────┐
│ Your Application │
│ ┌─────────┐ ┌─────────┐ ┌─────────┐ │
│ │ Service │→ │ Domain │→ │ Service │ │
│ └────┬────┘ └─────────┘ └────┬────┘ │
│ │ VALIDATE HERE │ HANDLE │
└───────┼─────────────────────────┼──────────┘
External External
Why: Core domain logic stays clean. Boundaries handle the messy real world.
# Magic: What does this do?
@auto_inject
@cache(ttl=300)
@retry(3)
def process(data): ...
# Explicit: Clear dependencies
def process(
data: InputData,
cache: Cache,
logger: Logger,
max_retries: int = 3,
) -> Result: ...
When magic is okay: Framework conventions (Rails, Django) where everyone knows the patterns.
Favor mixins and delegation over deep class hierarchies:
# Prefer: Composition
class Dog
include Walkable
include Barkable
end
# Avoid: Deep inheritance
class Animal; end
class Mammal < Animal; end
class Canine < Mammal; end
class Dog < Canine; end
Why: Inheritance is rigid. Composition is flexible.
Cognitive psychology tells us humans can hold 7±2 items in working memory.
| Element | Classic | Modern | Guidance |
|---|---|---|---|
| Method/Function | 10 lines | No hard limit | Single responsibility |
| Class/Module | 100 lines | No hard limit | Single reason to change |
| File | 200-300 lines | No hard limit | One concept per file |
| Line width | 80 chars | 80-120 chars | Don't wrap mid-expression |
Names should reveal intent without requiring comments:
# Vague
def process(d):
return [x for x in d if x > 0]
# Clear
def filter_positive_values(numbers: list[int]) -> list[int]:
return [n for n in numbers if n > 0]
# Bad: restates code
# Increment counter by one
counter += 1
# Good: explains reasoning
# Rate limit requires 1-second gaps between API calls
sleep(1)
| Practice | Why |
|---|---|
| Guard clauses | Reduces nesting, reads top-to-bottom |
| Test mirroring | Instant navigation |
| Directory structure | Scales with domain complexity |
| Parse don't validate | Invalid states unrepresentable |
| Boundary handling | Clean core, messy edges |
| Explicit over magic | Maintainability wins |
| Composition | Flexible over rigid |
| 7±2 rule | Respect cognitive limits |