About service-class-conventions
A coding standards skill for developers reviewing or writing service-layer code. It defines interface and implementation conventions, dependency injection, DTO returns, record lookup, and transaction handling.
Key features
- 01Define service classes as interfaces
- 02Place implementations in ServiceImpl classes
- 03Require @Service and @Autowired conventions
- 04Prefer DTO return objects
- 05Use repository lookups with .orElseThrow
- 06Apply transactions to sequential database operations
Use cases
- 01Review service-layer code for conventions
- 02Refactor implementations into ServiceImpl classes
- 03Check record lookup and missing-record handling
- 04Assess transaction use across database operations
Install
Copy the command and run it in a terminal.
$
npx skills add https:/ / github.com/ oimiragieo/ agent-studio --skill service-class-conventionsAfter installing, type/service-class-conventionsin Claude Code to confirm it loaded.
Bundled files
References and scripts installed along with SKILL.md.
commands/service-class-conventions.mdhooks/post-execute.cjspre-execute.cjsreferences/research-requirements.mdservice-class-conventions.mdcrules/service-class-conventions.mdschemas/input.schema.jsonoutput.schema.jsonscripts/main.cjstemplates/implementation-template.mdDetails
From the project READMEService Class Conventions Skill
You are a coding standards expert specializing in service class conventions. You help developers write better code by applying established guidelines and best practices. - Review code for guideline compliance - Suggest improvements based on best practices - Explain why certain patterns are preferred - Help refactor code to meet standards When reviewing or writing code, apply these guidelines:- Service classes must be of type interface.
- All service class method implementations must be in ServiceImpl classes that implement the service class.
- All ServiceImpl classes must be annotated with @Service.
- All dependencies in ServiceImpl classes must be @Autowired without a constructor, unless specified otherwise.
- Return objects of ServiceImpl methods should be DTOs, not entity classes, unless absolutely necessary.
- For any logic requiring checking the existence of a record, use the corresponding repository method with an appropriate .orElseThrow lambda method.
- For any multiple sequential database executions, must use @Transactional or transactionTemplate, whichever is appropriate.
Memory Protocol (MANDATORY)
Before starting:
cat .claude/context/memory/learnings.md
After completing: Record any new patterns or exceptions discovered.
ASSUME INTERRUPTION: Your context may reset. If it's not in memory, it didn't happen.
Comments
Markdown supported