mcpField
S
service-class-conventions

service-class-conventions

github.com/oimiragieoDevelopment4442 installsUpdated 17w ago
Repository

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

  1. 01Define service classes as interfaces
  2. 02Place implementations in ServiceImpl classes
  3. 03Require @Service and @Autowired conventions
  4. 04Prefer DTO return objects
  5. 05Use repository lookups with .orElseThrow
  6. 06Apply transactions to sequential database operations

Use cases

  1. 01Review service-layer code for conventions
  2. 02Refactor implementations into ServiceImpl classes
  3. 03Check record lookup and missing-record handling
  4. 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-conventions

After 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.md
hooks/
post-execute.cjs
pre-execute.cjs
references/
research-requirements.md
service-class-conventions.mdc
rules/
service-class-conventions.md
schemas/
input.schema.json
output.schema.json
scripts/
main.cjs
templates/
implementation-template.md

Details

From the project README

Service 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.
Example usage: ``` User: "Review this code for service class conventions compliance" Agent: [Analyzes code against guidelines and provides specific feedback] ```

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