# Apply Allra Database Standards

Backend teams need consistent rules for JPA entities, QueryDSL repositories, DTO projections, and transactions. This skill guides Claude, Codex, and Claude Code to apply Allra database conventions during implementation and review.

## Install

```bash
npx skillstore add allra-fintech/allra-database-schema
```

## Metadata

- - Slug: allra-fintech-allra-database-schema
- - Version: 1.0.0
- - Author: Allra-Fintech
- - GitHub username: Allra-Fintech
- - License: MIT
- - Repository: https://github.com/Allra-Fintech/allra-ai-skills/tree/main/backend-plugin/skills/database-schema
- - Ref: main
- - Supported tools: Claude, Codex, Claude Code
- - Risk level: safe
- - Quality score: 80
- - Quality tier: silver
- - Public page: https://skillstore.pages.dev/skills/allra-fintech-allra-database-schema
- - Manifest: https://skillstore.pages.dev/api/skills/allra-fintech-allra-database-schema/manifest

## Capabilities

- Guides JPA repository and QueryDSL support interface structure.
- Recommends DTO projection patterns using records and QueryDSL annotations.
- Explains where QueryDSL queries should live based on the from clause.
- Applies Spring transaction annotation rules for read and write service methods.
- Provides JPA entity mapping guidance for columns, enums, auditing, and lazy relationships.

## Use Cases

- Create a New Entity: Use the skill to shape entity fields, constructors, factory methods, auditing columns, and lazy relationships.
- Review QueryDSL Repositories: Use the skill to check repository placement, support interfaces, DTO projections, and QueryDSL compatibility.
- Standardize Transactions: Use the skill to decide when service methods need read-only or write transaction annotations.

## Prompt Templates

### Add Transaction Annotations

```
Review this Spring service and add the correct @Transactional annotation to each public method using Allra rules.
```

### Design a JPA Entity

```
Create a JPA entity for this domain object using Allra entity design rules, including columns, enums, auditing, and relationship loading.
```

### Build QueryDSL Repository Support

```
Implement a QueryDSL repository support pattern for this search requirement, and place the query in the repository that matches the from clause.
```

### Audit Database Layer Consistency

```
Review these repository, service, DTO, and entity changes against Allra database standards. Report each issue and suggest focused fixes.
```

## Limitations

- Does not inspect a live database schema or migration history.
- Does not generate database-specific SQL performance plans.
- Assumes a Spring Boot, JPA, and Hibernate backend context.
- Project-specific database rules may override this guidance.

## Best Practices

- Give the model the relevant entity, repository, DTO, and service files together.
- State the target database engine when compatibility or functions matter.
- Ask for a review checklist when applying the skill to a pull request.

## Anti Patterns

- Do not use the skill as a replacement for database migration review.
- Do not request direct repository implementation injection into services.
- Do not apply QueryDSL projection rules when the project does not use QueryDSL.

## Security Audit

- - Safe to publish: true
- - Audited at: 2026-06-28T09:26:36.445\+00:00
- - Summary: Static analysis reported external command, network, weak crypto, and reconnaissance patterns, but review found these are false positives in Markdown documentation and Java examples. No executable scripts, network endpoints, credential handling, prompt injection attempts, or malicious intent were found in SKILL.md.

## Stats

- - Views: 212
- - Downloads: 4
- - Favorites: 0
- - Popularity score: 0
