ワンクリックで
solid-srp-pattern
Implements the Single Responsibility Principle (SRP) from SOLID, ensuring a class has one reason to change.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Implements the Single Responsibility Principle (SRP) from SOLID, ensuring a class has one reason to change.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
Implements v1 ConfigMap manifests for injecting configuration data into pods via environment variables, volume mounts, and command-line arguments.
Implements apps/v1 Deployment YAML manifests with rolling update strategies, replica scaling, and rollback procedures for stateless application workloads.
Implements networking.k8s.io/v1 Ingress resources with HTTP/HTTPS routing, TLS termination, path-based routing, and ingress controller configuration.
Implements Istio service mesh patterns (sidecar injection, traffic splitting, circuit breaking, retries, and mTLS) for advanced traffic management and zero-downtime deployments in Kubernetes.
Implements networking.k8s.io/v1 NetworkPolicy resources with ingress and egress rules, pod selector targeting, and network segmentation for microservice isolation.
Implements v1 PersistentVolume, StorageClass, and PersistentVolumeClaim manifests with static/dynamic provisioning, access modes, and reclaim policies for Kubernetes storage.
| name | solid-srp-pattern |
| description | Implements the Single Responsibility Principle (SRP) from SOLID, ensuring a class has one reason to change. |
| license | MIT |
| compatibility | opencode |
| metadata | {"version":"1.0.0","domain":"architecture","triggers":"single responsibility principle, solid principles, gof patterns","archetypes":["educational"],"anti_triggers":["brainstorming","vague ideation"],"response_profile":{"verbosity":"low","directive_strength":"high","abstraction_level":"operational"},"role":"implementation","scope":"implementation","output-format":"code","related-skills":"solid-ocp-pattern,"} |
archetypes: implementation, educational anti_triggers: multiple responsibilities response_profile: verbosity: medium directive_strength: high abstraction_level: tactical
Implements the Single Responsibility Principle from SOLID, ensuring a class has one reason to change.
This section should succinctly explain the scenarios where the Single Responsibility Principle is applicable:
Verbosity: Medium
Directive Strength: High
Abstraction Level: Tactical
When you want to ensure that a class or module has a single responsibility.
To improve the maintainability and understandability of the code.
When making changes to a class, ensuring impacts are minimized.
package main
import (
"fmt"
)
// User represents a user model
type User struct {
Name string
Email string
}
// UserRepository handles user-related database operations
type UserRepository struct {}
func (UserRepository) Save(u User) {
// Logic to save user to database
fmt.Println("Saving user:", u)
}
// EmailService manages email notifications
type EmailService struct {}
func (EmailService) SendEmail(email string, message string) {
// Logic to send email
fmt.Println("Sending email to:", email, "Message:", message)
}
package main
func main() {
userRepo := UserRepository{}
emailService := EmailService{}
user := User{Name: "John Doe", Email: "john@example.com"}
userRepo.Save(user)
emailService.SendEmail(user.Email, "Welcome to our service!")
}