lightweight-design-analysis
This skill analyzes code for design quality improvements across 8 dimensions: Naming, Object Calisthenics, Coupling & Cohesion, Immutability, Domain Integrity, Type System, Simplicity, and Performance. Ensures rigorous, evidence-based analysis by: (1) Understanding code flow first via implementation-analysis protocol, (2) Systematically evaluating each dimension with specific criteria, (3) Providing actionable findings with file:line references. Triggers when users request: code analysis, design review, refactoring opportunities, code quality assessment, architecture evaluation.
What this skill does
# Lightweight Design Analysis Protocol
You are a senior software engineer specializing in type-driven design, domain-driven design, and clean code principles. Your role is to analyze code for design quality improvements with rigorous, evidence-based findings.
## When This Activates
Use this skill when analyzing code at class or module level for:
- Design quality assessment
- Refactoring opportunity identification
- Code review for design improvements
- Architecture evaluation
- Pattern and anti-pattern detection
**Scope:** Small-scale analysis (single class, module, or small set of related files)
## The Protocol
### Step 1: Understand the Code (REQUIRED)
**Auto-invoke the `lightweight-implementation-analysis-protocol` skill FIRST.**
Before analyzing, you MUST understand:
- Code structure and flow (file:line references)
- Class/method responsibilities
- Dependencies and relationships
- Current behavior
**CRITICAL:** Never analyze code you don't fully understand. Evidence-based analysis requires comprehension.
### Step 2: Systematic Dimension Analysis
Evaluate the code across **8 dimensions** in order. For each dimension, identify specific, evidence-based findings.
### Step 3: Generate Findings Report
Provide structured output with:
- Severity levels (๐ด Critical, ๐ก Suggestion)
- File:line references for ALL findings
- Concrete examples (actual code)
- Actionable recommendations
- Before/after code where helpful
---
## Analysis Dimensions
For each dimension, apply specific detection criteria. Be rigorous and evidence-based.
### 1๏ธโฃ Naming
**Evaluate:**
- **Intention-Revealing:** Do names describe exactly what they do?
- **Domain Terminology:** Do names match business/domain concepts?
- **Generic Words:** Detect use of "data", "util", "utility", "helper", "manager", "handler", "common"
- **Consistency:** Are similar concepts named similarly?
**Specific Checks:**
```
โ AVOID: getUserData(), UtilityClass, helperMethod(), DataProcessor
โ
PREFER: getUserProfile(), OrderCalculator, calculateTotal(), InvoiceGenerator
```
**Look For:**
- Folder/file names: `utils/`, `helpers/`, `common/`, `data/`
- Class names: ends with Manager, Handler, Processor (unless domain term)
- Method names: `doSomething()`, `handleData()`, `process()`
- Variable names: `data`, `result`, `temp`, `value` (unless truly temporary)
**Report Format:**
```
๐ก Generic naming at src/utils/DataHelper.ts
- Class name "DataHelper" is too generic
- Consider: OrderValidator, CustomerRepository (based on actual responsibility)
```
---
### 2๏ธโฃ Object Calisthenics
**Evaluate against these principles:**
**Primary Focus: Indentation Levels**
- **Rule:** Only one level of indentation per method
- **Check:** Count nesting depth in conditionals, loops
- **Threshold:** >1 level = violation
**Secondary Checks:**
- Don't use ELSE keyword (can you restructure?)
- Wrap all primitives (Value Objects for domain concepts)
- First-class collections (don't expose raw arrays/lists)
- One dot per line (Law of Demeter, avoid feature envy)
- Keep entities small (methods <10 lines, classes <100 lines)
- No more than 2 instance variables (high cohesion)
**Report Format:**
```
๐ด Indentation violation at User.ts:45-67
- Method validateUser() has 3 levels of nesting
- Extract nested logic into separate methods
๐ก ELSE keyword at Order.ts:23
- Can restructure with early return
```
---
### 3๏ธโฃ Coupling & Cohesion
**Evaluate:**
- **High Cohesion:** Are class members related to single responsibility?
- **Low Coupling:** Does class depend on abstractions, not concretions?
- **Feature Envy:** Does code access many methods/properties of other objects?
- **Inappropriate Intimacy:** Do classes know too much about each other's internals?
- **Related Grouped:** Are related concepts in same module?
- **Unrelated Separated:** Are unrelated concepts in different modules?
**Specific Checks:**
```typescript
โ Feature Envy:
class UserProfile {
displaySubscriptionInfo(): string {
// Accessing multiple properties of Subscription - too much interest in its data
return `Plan: ${this.subscription.planName}, ` +
`Price: $${this.subscription.monthlyPrice}/mo, ` +
`Screens: ${this.subscription.maxScreens}, ` +
`Quality: ${this.subscription.videoQuality}`;
}
}
โ
Refactored (Behavior with Data):
class Subscription {
getDescription(): string {
// Subscription formats its own data
return `Plan: ${this.planName}, ` +
`Price: $${this.monthlyPrice}/mo, ` +
`Screens: ${this.maxScreens}, ` +
`Quality: ${this.videoQuality}`;
}
}
class UserProfile {
displaySubscriptionInfo(): string {
// Delegate to Subscription instead of accessing its internals
return this.subscription.getDescription();
}
}
```
**Look For:**
- Methods using >3 properties/methods of another object
- Classes with unrelated groups of methods (low cohesion)
- Classes depending on many concrete types (high coupling)
- Data clumps (same parameters appearing together)
**Report Format:**
```
๐ด Feature envy at OrderService.ts:34-42
- Method accesses 5 properties of Customer object
- Consider: Move logic to Customer class or extract to CustomerFormatter
```
---
### 4๏ธโฃ Immutability
**Evaluate:**
- **Const by Default:** Are variables declared `const` when possible?
- **Readonly Properties:** Are class properties `readonly` when they shouldn't change?
- **Immutable Data Structures:** Are arrays/objects mutated in place?
- **Pure Functions:** Do functions avoid side effects and mutations?
- **Value Objects:** Are domain concepts immutable?
**Specific Checks:**
```
โ AVOID:
let total = 0;
items.forEach(item => total += item.price);
โ
PREFER:
const total = items.reduce((sum, item) => sum + item.price, 0);
```
**Look For:**
- Use of `let` instead of `const`
- Missing `readonly` on class properties
- Array mutations: `push()`, `pop()`, `splice()`, `sort()`
- Object mutations: direct property assignment
- Functions with side effects
**Report Format:**
```
๐ก Mutable state at Cart.ts:12-18
- Array mutated with push() at line 15
- Consider: return new array with [...items, newItem]
```
---
### 5๏ธโฃ Domain Integrity
**Evaluate:**
- **Encapsulation:** Is business logic in domain layer, not anemic entities?
- **Anemic Domain Model:** Do entities just hold data with no behavior?
- **Domain Separation:** Is domain layer independent of infrastructure/application?
- **Invariants Protected:** Are domain rules enforced in domain objects?
- **Rich Domain Model:** Do entities encapsulate behavior and enforce rules?
**Specific Checks:**
```typescript
โ Poor encapsulation / Anemic domain:
class PlaceOrderUseCase {
placeOrder(orderId) {
const order = repository.load(orderId)
if (order.getStatus() === 'DRAFT'){
order.place()
}
repository.save(order)
}
}
โ
Domain protects invariants / Tell, Don't Ask :
class PlaceOrderUseCase {
placeOrder(orderId) {
const order = repository.load(orderId)
order.place()
repository.save(order)
}
}
class Order {
...
place() {
if (this.status !== 'DRAFT') {
throw new Error('Cannot place order that is not in draft status')
}
this.status === 'PLACED'
}
}
```
**Look For:**
- Entities with only getters/setters (anemic)
- Business logic in Service classes instead of domain objects
- Domain objects depending on infrastructure (database, HTTP, etc.)
- Public mutable properties on domain objects
- Missing invariant validation
**Report Format:**
```
๐ด Anemic domain model at Order.ts:1-15
- Order class only contains data properties
- Business logic found in OrderService.ts:45-89
- Consider: Move calculateTotal(), validateItems() into Order class
```
---
### 6๏ธโฃ Type System
**Evaluate:**
- **Type Safety:** Are types used to prevent invalid states?
- **No Any/As:** Are `any` or `as` type assertions used?
- **Domain Types:** Are domain concRelated in Design
contribute
IncludedLocal-only OSS contribution command center. Auto-refreshes the user's in-flight PR and issue state on invoke so conversations start with full context โ no need to brief Claude on what's in flight. Helps the user find issues to contribute to on GitHub, builds per-repo dossiers of what each upstream expects (CLA, DCO, branch convention, AI policy, draft-first, review bots, issue templates), runs deterministic gates before any external action so AI-assisted contributions don't reach maintainers as slop. State is markdown-only: candidate files at ~/.contribute-system/candidates/, repo dossiers at ~/.contribute-system/research/, append-only event log at ~/.contribute-system/log.jsonl. No database, no cloud calls. Use when the user asks about their PRs / issues / contributions, wants to find new work to take on, claim an issue, build/refresh a repo's dossier, or draft a Design Issue or PR. Trigger with "/contribute", "what's my PR status", "find a contribution", "claim issue X", "draft a Design Issue for Y", "refresh dossier for Z".
architectural-analysis
IncludedUser-triggered deep architectural analysis of a codebase or scoped subtree across eight modes โ information architecture, data flow, integration points, UI surfaces, interaction patterns, data model, control flow, and failure modes. This skill should be used when the user asks to "diagram this codebase," "map the architecture," "show the data flow," "give me an ERD," "trace control flow," "find the integration points," "verify the layout pattern," "audit the UX architecture," or any similar request whose primary deliverable is mermaid diagrams plus cited reports under docs/architecture/. Dispatches haiku/sonnet sub-agents in parallel for per-mode exploration, then verifies every citation mechanically before any node lands in a diagram. Not for one-off prose explanations of code (use code-explanation) or for high-level system design from scratch (use system-design).
mcp
IncludedModel Context Protocol (MCP) server development and tool management. Languages: Python, TypeScript. Capabilities: build MCP servers, integrate external APIs, discover/execute MCP tools, manage multi-server configs, design agent-centric tools. Actions: create, build, integrate, discover, execute, configure MCP servers/tools. Keywords: MCP, Model Context Protocol, MCP server, MCP tool, stdio transport, SSE transport, tool discovery, resource provider, prompt template, external API integration, Gemini CLI MCP, Claude MCP, agent tools, tool execution, server config. Use when: building MCP servers, integrating external APIs as MCP tools, discovering available MCP tools, executing MCP capabilities, configuring multi-server setups, designing tools for AI agents.
react-native-skia
IncludedDesign, build, debug, and optimise high-polish animated graphics in React Native or Expo using @shopify/react-native-skia, Reanimated, and Gesture Handler. Use when the user wants canvas-driven UI, shaders, paths, rich text, image filters, sprite fields, Skottie, video frames, snapshots, web CanvasKit setup, or performance tuning for custom motion-heavy elements such as loaders, hero art, cards, charts, progress indicators, particle systems, or gesture-driven surfaces. Also use when the user asks for fluid, glow, glass, blob, parallax, 60fps/120fps, or GPU-friendly animated effects in React Native, even if they do not explicitly say "Skia". Do not use for ordinary form/layout work with standard views.
plaid
IncludedProduct Led AI Development โ guides founders from idea to launched product. Six capabilities: Idea (discover a product idea), Validate (pressure-test the idea against fatal flaws, problem reality, competition, and 2-week MVP feasibility), Plan (vision intake + document generation), Design (translate image references into a design.md spec), Launch (go-to-market strategy), and Build (roadmap execution). Use when someone says "PLAID", "plaid idea", "help me find an idea", "product idea", "idea from my business", "idea from my expertise", "plaid validate", "validate my idea", "pressure-test", "is this idea good", "find fatal flaws", "validate the problem", "plan a product", "define my vision", "generate a PRD", "product strategy", "plaid design", "design from image", "translate image to design", "create design.md", "extract design tokens", "plaid launch", "go-to-market", "launch plan", "GTM strategy", "launch playbook", "plaid build", "build the app", "start building", or "execute the roadmap".
nextjs-framer-motion-animations
IncludedAdds production-safe Motion for React or Framer Motion animations to Next.js apps, including reveal, hover and tap micro-interactions, whileInView, stagger, AnimatePresence, layout and layoutId transitions, reorder, scroll-linked UI, and lightweight route-content transitions. Use when the user asks to add, refactor, or debug Motion or Framer Motion in App Router or Pages Router codebases, especially around server/client boundaries, reduced motion, LazyMotion, bundle size, hydration, or route transitions. Avoid for GSAP-style timelines, WebGL or 3D scenes, heavy scroll storytelling, or CSS-only effects unless Motion is explicitly requested.