Skills Plugins MCP Prompt Model 博客 我的中心

java-springboot

Get best practices for developing applications with Spring Boot.

DeepseekModel 官方收录技能 质量 优秀 · 90 v1.0.0

获取

https://deepseekmodel.com/api/download.php?id=github-awesome-copilot-skills-java-springboot-skill-md&format=skill
下载 .skill 标准格式,含 system_prompt 与 model_config,导入任意 Agent 框架即可使用
.skill 文件中 system_prompt 字段的实际内容。
name java-springboot description Get best practices for developing applications with Spring Boot. Spring Boot Best Practices Your goal is to help me write high-quality Spring Boot applications by following established best practices. Project Setup & Structure Build Tool: Use Maven ( pom.xml ) or Gradle ( build.gradle ) for dependency management. Starters: Use Spring Boot starters (e.g., spring-boot-starter-web , spring-boot-starter-data-jpa ) to simplify dependency management. Package Structure: Organize code by feature/domain (e.g., com.example.app.order , com.example.app.user ) rather than by layer (e.g., com.example.app.controller , com.example.app.service ). Dependency Injection & Components Constructor Injection: Always use constructor-based injection for required dependencies. This makes components easier to test and dependencies explicit. Immutability: Declare dependency fields as private final . Component Stereotypes: Use @Component , @Service , @Repository , and @Controller / @RestController annotations appropriately to define beans. Configuration Externalized Configuration: Use application.yml (or application.properties ) for configuration. YAML is often preferred for its readability and hierarchical structure. Type-Safe Properties: Use @ConfigurationProperties to bind configuration to strongly-typed Java objects. Profiles: Use Spring Profiles ( application-dev.yml , application-prod.yml ) to manage environment-specific configurations. Secrets Management: Do not hardcode secrets. Use environment variables, or a dedicated secret management tool like HashiCorp Vault or AWS Secrets Manager. Web Layer (Controllers) RESTful APIs: Design clear and consistent RESTful endpoints. DTOs (Data Transfer Objects): Use DTOs to expose and consume data in the API layer. Do not expose JPA entities directly to the client. Validation: Use Java Bean Validation (JSR 380) with annotations ( @Valid , @NotNull , @Size ) on DTOs to validate request payloads. Error Handling: Implement a global exception handler using @ControllerAdvice and @ExceptionHandler to provide consistent error responses. Service Layer Business Logic: Encapsulate all business logic within @Service classes. Statelessness: Services should be stateless. Transaction Management: Use @Transactional on service methods to manage database transactions declaratively. Apply it at the most granular level necessary. Data Layer (Repositories) Spring Data JPA: Use Spring Data JPA repositories by extending JpaRepository or CrudRepository for standard database operations. Custom Queries: For complex queries, use @Query or the JPA Criteria API. Projections: Use DTO projections to fetch only the necessary data from the database. Logging SLF4J: Use the SLF4J API for logging. Logger Declaration: private static final Logger logger = LoggerFactory.getLogger(MyClass.class); Parameterized Logging: Use parameterized messages ( logger.info("Processing user {}...", userId); ) instead of string concatenation to improve performance. Testing Unit Tests: Write unit tests for services and components using JUnit 5 and a mocking framework like Mockito. Integration Tests: Use @SpringBootTest for integration tests that load the Spring application context. Test Slices: Use test slice annotations like @WebMvcTest (for controllers) or @DataJpaTest (for repositories) to test specific parts of the application in isolation. Testcontainers: Consider using Testcontainers for reliable integration tests with real databases, message brokers, etc. Security Spring Security: Use Spring Security for authentication and authorization. Password Encoding: Always encode passwords using a strong hashing algorithm like BCrypt. Input Sanitization: Prevent SQL injection by using Spring Data JPA or parameterized queries. Prevent Cross-Site Scripting (XSS) by properly encoding output.
Agent 识别该技能的关键词,点击任意一个即可复制。

该技能未提供触发词。

下载的 .skill 包内含以下字段。
字段 说明
format格式标识(skill/v1)
skill_id技能唯一 ID
name技能名称
version版本号
description技能描述
category所属分类(数组)
trigger_words触发词列表
tags标签列表
source来源标识
source_url来源链接(本页地址)
exported_at导出时间(每次下载生成)
system_prompt系统提示词正文
model_config模型参数:provider / model / temperature / max_tokens / top_p
examples示例
install_guide各平台导入说明(Coze / Dify / Claude / 自定义框架)
同一份技能可按不同平台格式导出。
.skill 标准格式,含 system_prompt 与 model_config,导入任意 Agent 框架即可使用 下载
.skillpro 增强格式,额外含脚本 / 工具 / 依赖 / 钩子占位 下载
.json 纯 JSON 导出,只含 system_prompt 与模型参数 下载
Coze 带 frontmatter 的 Markdown,Coze 平台导入用 下载
Dify Dify DSL,创建应用后直接导入 下载

每日精选 Skill 推荐,免费送到你邮箱

输入邮箱,每天接收一个精选 AI Agent 技能推荐。完全免费,持续更新。

验证码 --

提交后我们会发送一封确认邮件,点击邮件里的链接才会开始收信。

完全免费,取消任意时间。我们不会发送垃圾邮件。