engineering-principles
Core software engineering and design principles for writing production-quality code. Use as a reference when making design decisions, reviewing code, or when principled guidance is needed on modularity, abstraction, encapsulation, SOLID, DRY, KISS, YAGNI, and other foundational practices.
What this skill does
# Engineering Principles A reference for the core software engineering principles that govern how code is designed, structured, and maintained. These principles are language-agnostic and apply universally. ## Core Principles ### Modularity Each component has a single, well-defined responsibility. When you create or modify a module, ask: "Does this do exactly one thing? Could I replace it without touching its neighbors?" If a file grows beyond a coherent responsibility, split it. ### Abstraction Expose intent, hide mechanism. Public interfaces describe *what*, not *how*. When reviewing your code, ask: "Could someone use this without reading the implementation?" If not, your interface leaks. ### Encapsulation Data and the operations on that data belong together. Do not scatter related state across files. Do not expose internal fields that callers should not depend on. Use access boundaries — private members, module-scoped functions, closures — to enforce this. ### Separation of Concerns UI logic does not contain business rules. Business rules do not contain transport details. Data access does not contain presentation formatting. When you catch yourself mixing concerns, stop and restructure before continuing. ### Anticipation of Change Design for the change that is *likely*, not the change that is *possible*. Use interfaces and dependency injection at natural seam points. Do not over-abstract — a point of flexibility costs complexity, so place them deliberately where requirements are known to vary. ## Key Development Principles ### DRY (Don't Repeat Yourself) When you see the same logic in two places, extract it — but only if the duplication is *conceptual*, not merely textual. Two blocks of code that look similar but evolve independently are not duplication. True duplication means a bug fix in one place must also be applied in the other. ### KISS (Keep It Simple, Stupid) Prefer the straightforward solution. A clever one-liner that requires a comment to explain is worse than three obvious lines. Complexity is a cost; justify every unit of it. ### YAGNI (You Aren't Gonna Need It) Implement what is needed now. Do not build extension points, configuration options, or abstractions for hypothetical future requirements. When the future arrives, you will know more and can build the right thing then. ### SOLID Principles - **Single Responsibility:** A class/module has one reason to change. - **Open/Closed:** Extend behavior through composition or new implementations, not by modifying existing code. - **Liskov Substitution:** Subtypes must be substitutable for their base types without breaking correctness. - **Interface Segregation:** Depend on narrow, specific interfaces — not broad ones that force implementations to stub out methods they don't need. - **Dependency Inversion:** High-level policy depends on abstractions, not on low-level details. Inject dependencies rather than importing concrete implementations at the call site. ### Law of Demeter An object should only talk to its immediate collaborators. Avoid chaining through objects: `a.getB().getC().doThing()` couples you to the entire chain. Instead, ask `a` to do what you need, and let `a` delegate internally. ## Applying These Principles ### When Designing a New Module 1. Define the public interface first — what does the caller need? 2. Identify the single responsibility — if you cannot state it in one sentence, split 3. List the dependencies — are they abstractions or concrete implementations? 4. Consider what is likely to change — place flexibility at those seams, not everywhere ### When Modifying Existing Code 1. Understand the existing design before changing it 2. Respect existing module boundaries — do not leak concerns across them 3. If the existing design conflicts with the change, refactor the design first in a separate step 4. Do not mix refactoring with feature work in the same change ### When Reviewing Code Ask these questions: - Does each module have a single, clear responsibility? - Are implementation details hidden behind clean interfaces? - Could I change one module without rippling changes through its neighbors? - Is there genuine duplication, or just superficial similarity? - Is every abstraction earning its complexity cost? - Are dependencies flowing in one direction, without cycles? ### Red Flags - A module that imports from many unrelated modules — likely doing too much - A function that takes many parameters — likely has multiple responsibilities - A change that requires editing many files — likely boundaries are wrong - A piece of code that is hard to test — likely too coupled or doing too much - A name that does not communicate intent — likely the design is unclear
Related 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.