general-principles
Apply for general-principles. --- description: Applies general coding standards and best practices for Scala 3 development, focusing on SOLID, DRY, KISS, YAGNI and idiomatic functional-programming style. Tailored for an sbt projec
Best use case
general-principles is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Apply for general-principles. --- description: Applies general coding standards and best practices for Scala 3 development, focusing on SOLID, DRY, KISS, YAGNI and idiomatic functional-programming style. Tailored for an sbt projec
Teams using general-principles should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/general-principles/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How general-principles Compares
| Feature / Agent | general-principles | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Apply for general-principles. --- description: Applies general coding standards and best practices for Scala 3 development, focusing on SOLID, DRY, KISS, YAGNI and idiomatic functional-programming style. Tailored for an sbt projec
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
Related Guides
SKILL.md Source
# ========== GENERAL PRINCIPLES ========== --- description: Applies general coding standards and best practices for Scala 3 development, focusing on SOLID, DRY, KISS, YAGNI and idiomatic functional-programming style. Tailored for an sbt project that uses Kafka Streams. globs: **/*.scala alwaysApply: true --- # ========== GENERAL PRINCIPLES ========== - You are an experienced Senior Scala Developer. - You always adhere to SOLID, DRY, KISS and YAGNI principles. - Prefer *pure* functions; minimise side-effects. Where effects are required, make them explicit (e.g. using scala.util.Try, Either, or cats-effect IO/Task if adopted). - Use *val* over *var*; collections must be immutable unless mutability is proven cheaper & safe. - Replace *null* with Option, Either or a domain-specific ADT. - Use pattern matching exhaustively and handle the *default* case only when truly open-ended. - Prefer for-comprehensions, map/flatMap/fold, and higher-order functions over imperative loops. - Prefer *case classes* and *sealed traits* for algebraic data types. - Extract common logic into private or package-private helpers; avoid long methods (> 30 LOC). - Prefer extension methods or type classes over inheritance when adding behaviour. - Keep public APIs small, surface only what the module owns. - Break every task into the smallest composable pure functions before wiring them together. # ========== NAMING & SYNTAX ========== - Class / object / trait names are UpperCamelCase nouns (e.g. *NotificationStreamApp*). - Methods & vals are lowerCamelCase verbs or nouns (e.g. *process*, *serde*, *productKey*). - Constants use `SCREAMING_SNAKE_CASE`. - Similar to Java’s static final members, if the member is final, immutable and it belongs to a package object or an object, it may be considered a constant. - Symbolic names (`|>`) are allowed *only* when they align with widespread FP idioms. - Match expressions use `match`/`case` over nested if/else chains; for simple two-branch logic prefer `if … then … else …` expressions. # ========== ERROR HANDLING & LOGGING ========== - Catch the most specific Exception first; convert checked Java exceptions to an ADT or `Try`. - No empty `catch` blocks; log at *debug* or *error* level with a meaningful message. - Leverage `scala.util.Using` (or cats-effect `Resource`) for auto-closing resources. - Avoid “defensive” logging or `println`; use SLF4J (Logback) with the *scala-logging* wrapper. # ========== TESTING ========== - Use ScalaTest in a **Given-When-Then** layout with the use of AnyFlatSpec. - Focus on critical paths and business invariants; do not over-test boilerplate. - Property-based tests (ScalaCheck) for pure functions with non-trivial invariants. - Set up integration tests as a subproject named “integration” and treat integration tests as standard tests # ========== PERFORMANCE & SAFETY ========== - Avoid blocking calls inside Kafka stream processing; if unavoidable, off-load to a dedicated thread-pool. - Convert Java collections to Scala equivalents once at the boundary; never bounce back and forth. - Use underscore-separated digits for large numeric literals (e.g. `val timeoutMs = 30_000`). # ========== MODERN SCALA 3 FEATURES ========== - Use *Enums* for finite alternatives instead of Java-style enums. - Embrace *opaque types* to avoid accidental misuse of primitive wrappers. - Use *context parameters* (`using`) for type-class evidence instead of classic implicit lists when convenient. - Prefer `given`/`using` syntax over `implicit` where supported. # ========== CLEAN BUILD ========== - The sbt build uses **scalafmt** for formatting; treat any scalafmt violation as a build error.
Related Skills
general-best-practices
General software development best practices covering code quality, testing, security, performance, and maintainability across technology stacks
convex-development-general
Applies general rules for Convex development, emphasizing schema design, validator usage, and correct handling of system fields.
coding-principles
Language-agnostic coding principles for maintainability, readability, and quality. Use when implementing features, refactoring code, or reviewing code quality.
architecture-principles
Core architecture principles (SSOT, DRY, Anti-Spaghetti) for maintainable code design. Use when planning features, implementing code, or reviewing architecture to prevent duplication and technical debt.
apply-key-principles
Apply and validate the 7 Key Principles to code - TDD, Fail Fast, Modular, Reuse, Open Source, No Debt, Excellence. Checks code compliance and suggests improvements. Use during code review or refactoring.
api-design-principles
Master REST and GraphQL API design principles to build intuitive, scalable, and maintainable APIs that delight developers. Use when designing new APIs, reviewing API specifications, or establishing API design standards.
ui-ux-principles
Apply core UI/UX design principles for intuitive, beautiful interfaces. Covers visual hierarchy, color theory, typography, spacing systems, Gestalt principles, usability heuristics, and user-centered design. Use for design decisions, layout planning, and creating polished user experiences.
animation-principles
Applies Disney's 12 animation principles to UI motion design. Use when improving animation quality, designing micro-interactions, creating easing curves, or making transitions feel natural and purposeful.
bgo
Automates the complete Blender build-go workflow, from building and packaging your extension/add-on to removing old versions, installing, enabling, and launching Blender for quick testing and iteration.
moai-lang-{{LANGUAGE_SLUG}}
{{LANGUAGE_NAME}} best practices with modern frameworks, {{PRIMARY_DOMAIN}}, and performance optimization for 2025
moai-lang-elixir
Elixir 1.17+ development specialist covering Phoenix 1.7, LiveView, Ecto, and OTP patterns. Use when developing real-time applications, distributed systems, or Phoenix projects.
moai-lang-csharp
Enterprise C# 13 development with .NET 9, async/await, LINQ, Entity Framework Core, ASP.NET Core, and Context7 MCP integration for modern backend and enterprise applications.