service
Skill1 starsChanged 56 days agoApache-2.0View on GitHub
Scaffold a domain service in a domain module — the external entry point for an entity's reads/writes. Collaborators (batch writers, Kafka consumers, API services) call the service, never repositories directly. Use when adding domain logic / a read+write entry point for a domain.
Files
service — domain service scaffold
Generate the domain service that owns an entity's transaction boundary and is the only way the rest of the system touches its persistence.
Authority:
AGENTS.mdis binding. Review withkotlin-spring-review; tests withtest-authoring.
Where it goes
- The domain module (the persistence-owning module), package
com.example.domain.<domain>.service. Nopublickeyword. open class <Name>Service—openso Spring can proxy@Transactional.
Skeleton (see order/service/OrderService.kt)
@Service
@Transactional(readOnly = true)
open class <Name>Service(
private val <name>JdbcRepository: <Name>JdbcRepository,
private val <name>Repository: <Name>EntityRepository,
) {
@Transactional(propagation = Propagation.REQUIRES_NEW)
open fun bulkUpsert(models: List<<Name>>) {
<name>JdbcRepository.upsert(models)
}
open fun findBy<Field>(<field>: Collection<String>): List<<Name>> {
if (<field>.isEmpty()) return emptyList()
return <name>Repository.findBy<Field>In(<field>).map(<Name>Mapper::toModel)
}
}Rules (MUST)
open classannotated@Service. Class-level@Transactional(readOnly = true)is the default; write methods areopen funwith@Transactional(propagation = Propagation.REQUIRES_NEW)(so writes self-commit, decoupled from a batch chunk's resourceless transaction or a Kafka listener context).- Constructor injection only. Map at the boundary via the
mapper; the service holds models, not entities. JSON/serialization is the service's job, not the repository's. - Return empty collections early on empty input (avoid a needless DB hit).
- For generated single-parameter Kotlin lambdas, use
itunless a nested lambda needs an explicitly named inner parameter to disambiguate scope. Preserve API-required names for multi-parameter lambdas.
Hard constraints (build/ArchUnit fail otherwise)
- No field injection (
@Autowiredfield) anywhere under the application root package — constructor only (InjectionStyleArchTest). - Controllers/listeners reach persistence through the service, never the repository (
ControllerRepositoryAccessArchTest). Keep the service the single entry point. - Required beans use no
@ConditionalOnMissingBean— fail fast at boot if misconfigured.
Verify
Auto-detect the build system (gradle/maven/npm/pnpm/yarn) and run the domain module's compile/build task.
Related
[[entity]] · [[repository]] · [[mapper]]
Knowledge base
reference/principles.md— service-layer constitution (transaction boundary, readOnly default, propagation, idempotency, exception translation).reference/kb/INDEX.md— task → KB routing table.
Other versions10 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 10
- spotify/portal-ai-plugins★ 2.8ksame name
- crisandrews/ClawCode★ 63same name
- landaozhu/skills★ 27same name
- maxwellsdm1867/wheeler★ 12same name
- The-Utopia-Studio/skills★ 6same name
- gabriellst/codm★ 4same name
- wheslleyrimar/BuildCLI-Agents★ 3same name
- MohammadShehadeh/agent-skills★ 2same name
- mkreindel/seo-toolkit-template★ 1same name
- vijaysuperpositionist/skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository65 other files it gives its agents.
- agent-evalSkill
- architecture-review-workflowSkill
- backend-code-review-workflowSkill
- code-authoring-routerSkill
- code-diagram-extractSkill
- codex-agent-runtimeSkill
- design-pattern-applySkill
- diagram-stylerSkill
- document-designerSkill
- e2e-evidence-reportSkill
- e2e-report-rendererSkill
- e2e-runnerSkill
- e2e-scenario-authorSkill
- e2e-test-workflowSkill
- entitySkill
- enumSkill
- explore-dead-codeSkill
- flywaySkill
- git-flowSkill
- harness-proposeSkill
- harness-refineSkill
- java-spring-review-workflowSkill
- knowledge-auditSkill
- korean-dev-writerSkill
- kotlin-code-authoringSkill
- kotlin-spring-reviewSkill
- kotlin-spring-review-workflowSkill
- learnSkill
- mapperSkill
- markdown-publisherSkill
- mermaid-diagramsSkill
- mssql-code-authoringSkill
- nl-sql-querySkill
- notion-domain-contextSkill
- oop-design-reviewSkill
- opensearch-code-authoringSkill
- opensearch-optimizationSkill
- opensearch-query-reviewSkill
- opensearch-review-workflowSkill
- opensearch-schema-reviewSkill
- pdf-qaSkill
- playwright-e2eSkill
- postgres-code-authoringSkill
- postgres-query-reviewSkill
- postgres-review-workflowSkill
- postgres-risk-checkSkill
- postgres-schema-designSkill
- product-requirementsSkill
- product-ui-designSkill
- refactoring-catalogSkill
- repositorySkill
- requestSkill
- responseSkill
- retroSkill
- schema-doc-extractSkill
- security-scan-workflowSkill
- skill-updaterSkill
- start-taskSkill
- test-authoringSkill
- test-quality-refactoring-workflowSkill
- The first 60 shown.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

