/cap-developer:cap-cds-reviewfrom cap-developer
Reviews CDS data models in CAP (Cloud Application Programming Model) projects for correctness, best practices, and potential issues. Produces a structured report with severity-rated findings covering naming conventions, associations, annotations, reuse patterns, service projections, and performance.
Ships in cap-developer. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Perform a comprehensive review of CDS data models in CAP (Cloud Application Programming Model) projects. Produce a structured report with categorized findings rated by severity, helping developers catch issues early and align with CAP idioms.
Always use the CAP MCP server to:
cds-mcp_search_model) to understand the full picture including resolved aspects and importscds-mcp_search_docs) when unsure about a convention or annotationCollect all .cds files in the project. Focus on:
db/ — domain model (schema, types, aspects)srv/ — service definitions and projectionsapp/ — annotation files (if present)Use the MCP model search to get the effective (compiled) model for cross-referencing.
Evaluate the model against each category below. Only report actual findings — skip categories where everything looks good. For each finding, assign a severity:
| Severity | Meaning |
|---|---|
| error | Will cause runtime failures, data loss, or broken APIs |
| warning | Deviates from best practice; likely causes maintainability or performance issues |
| info | Suggestion for improvement; not strictly wrong but could be better |
| Rule | Rationale |
|---|---|
Entities and types: PascalCase (e.g. Books, OrderItems) | CDS convention; consistent OData entity set names |
Elements: camelCase (e.g. createdAt, orderNo) | CDS convention; maps cleanly to JSON property names |
Namespace declared in db/schema.cds | Avoids naming collisions between db and srv layers |
Service names: PascalCase with Service suffix (e.g. CatalogService) | Convention for discoverability |
File names: kebab-case matching the service name (e.g. catalog-service.cds) | Convention-based handler discovery |
Watch for:
Data, Info, Item without qualifier)CustOrdItm vs CustomerOrderItems)| Rule | Rationale |
|---|---|
Use cuid aspect for UUID primary keys | Standard, runtime auto-fills on insert |
| Avoid multi-column natural keys unless business requires them | Simplifies associations and OData navigation |
| Every entity must have at least one key | Required for persistence and OData addressing |
Watch for:
cuid| Rule | Rationale |
|---|---|
Use managed aspect on root/independent entities that need audit trails | Auto-fills createdAt/By, modifiedAt/By |
Don't blindly apply managed to composition children | Children are created/modified together with their parent — the parent's audit fields already capture who and when; adding managed to every child just bloats the DB with redundant data |
Use temporal aspect for time-slice entities | Enables built-in time-travel queries |
| Factor repeated element groups into custom aspects | DRY; single place to evolve |
Import from @sap/cds/common for standard types | Currency, Country, Language already modeled |
When reviewing managed usage, ask: does this entity have an independent lifecycle where you'd want to know separately who last touched it? Root entities and independently-addressable entities: yes. Composition children that are always edited through their parent: usually no.
Watch for:
createdAt : Timestamp / modifiedAt : Timestamp without managedmanaged applied indiscriminately to all entities including composition children (ask if audit fields on children are actually needed)@sap/cds/common when using countries, currencies, or languages| Rule | Rationale |
|---|---|
Composition of many for parent-child / document structures | Lifecycle coupling; cascade delete; draft support |
Association to for cross-references between independent entities | No lifecycle coupling |
to many associations must have an ON condition | Required since CDS 9; compiler error without it |
Backlink associations in children use Association to <Parent> | Required for explicit compositions |
Watch for:
Composition used between independent entities (over-coupling)Association used for header-item relationships (losing cascade semantics)Association to many without ON condition (breaks in CDS 9+)| Rule | Rationale |
|---|---|
Specify String lengths (e.g. String(100)) | Prevents oversized DB columns; explicit contracts |
Use localized String for user-facing translatable text | Enables built-in i18n text handling |
Use reuse types (Currency, Country, Language) from common | Consistent code-list handling |
| Prefer typed enums over free-text status fields | Type safety; value-help generation |
Use Decimal(precision, scale) for money/quantities | Avoids floating-point issues |
Watch for:
String without length (defaults to 5000 chars unless configured)String or LargeString without length used for content that might be a file/attachment — ask whether the field is meant to store document bodies, rich text, or binary content; if so, recommend using a media entity or the CAP attachment service (@cap-js/attachments) instead of inlining large content into a regular entityInteger used for monetary values (precision loss)String instead of enum or code-list associationDouble/Float for financial amounts| Rule | Rationale |
|---|---|
| Never expose db entities directly — always via projections | Decouples API from storage; allows trimming |
Use excluding { ... } to hide internal elements | Don't expose internal fields (UUIDs of FK tables, audit fields clients don't need) |
One service per .cds file | Convention-based handler discovery |
| Don't expose entities that are only written internally | Reduce API surface; use admin service if needed |
| Avoid two projections of the same entity in one service | CDS can't auto-redirect associations; causes errors |
Watch for:
entity X as projection on db.X exposing everything unchanged (is trimming needed?)@readonly on reference/code-list entities exposed for value-help only| Rule | Rationale |
|---|---|
Use @title and @description (not OData-specific variants) | Protocol-agnostic; mapped automatically |
Keep Fiori UI annotations in app/ annotation files | Separation of concerns; db/srv stay UI-agnostic |
Use @mandatory instead of custom handler validation | Declarative; works with generic providers |
Use @assert.format, @assert.range for input validation | Declarative; less handler code |
Use @restrict / @requires for authorization | Declarative; enforced by CAP framework |
Use @readonly / @insertonly where appropriate | Declarative; no handler needed |
Watch for:
@UI.* annotations in srv/ or db/ files instead of app/@assert.*@title on important elements (hurts Fiori auto-generation)@odata.draft.enabled without a Fiori Elements consumer| Rule | Rationale |
|---|---|
| Avoid deeply nested compositions (>3 levels) | Deep expand queries become expensive |
| Don't model large blobs/attachments inline | Use dedicated attachment service or media entity |
Consider @cds.search for entities with free-text search needs | Enables efficient full-text search |
| Calculated elements are read-only and re-computed on every read | Don't use for expensive computations |
Watch for:
@cds.persistence.index)Structure the output as follows:
## CDS Model Review
### Summary
<1-2 sentence overview: number of findings by severity>
### Findings
#### <Category Name>
| # | Severity | Location | Finding | Recommendation |
|---|----------|----------|---------|----------------|
| 1 | warning | db/schema.cds:15 | ... | ... |
...repeat for each category with findings...
### Positive Observations
<Brief notes on things done well — encourages good patterns>
Rules for the report:
After presenting the report, offer to:
cap-developer skill.package.json with @sap/cds version info, note the CDS version
to ensure recommendations are compatible (e.g., ON conditions for to many are required
starting CDS 9).What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
10 skills in this plugin
/cap-add-remote-serviceAdd a remote service integration to an existing CAP Node.js application using the Calesi pattern. Imports external APIs (from other CAP apps or OData/S4 sources), creates consumption views, wires up delegation and data federation handlers, and validates the result with cds watch. Use when a developer wants to consume an external service in their CAP app./cap-check-setupCheck and validate a CAP development environment. Inspects Node.js version, npm, @sap/cds-dk, Java, Maven, and optional tools like CF CLI, kubectl, and pack. Reports what is installed, what is outdated, and what is missing. Use when setting up a new machine, onboarding a developer, or diagnosing "works on my machine" problems./cap-developerExpert guidance for building and extending CAP (Cloud Application Programming Model) applications in either Node.js or Java. Covers project initialization, CDS modeling, declarative annotations, and custom handler best practices for both runtimes. Use for concrete, self-contained CAP tasks — add an entity or service, write a handler, check an idiom — or as reference material, regardless of whether the stack is Node.js or Java. For a staged, collaborative walkthrough of a whole app, use `cap-guided-dev` instead./cap-guided-devGuided, step-by-step co-development flow for building a CAP (Cloud Application Programming Model) application together with the developer, one stage at a time, instead of one-shotting the whole app. Walks through eleven stages — rough idea, domain model, services, constraints, custom handlers, plugins, MCPs/agents, authentication/authorization, shipment, operations, and improvements/upgrades — pausing to align with the developer at each step and delegating to the specialist CAP skills as needed. Use this whenever a developer wants to build a CAP app collaboratively, wants a guided or walkthrough experience, is starting a CAP project from a vague idea, or explicitly asks to go step by step rather than generating everything at once./cap-messagingAdd event-driven pub-sub messaging to a CAP Node.js application. Covers declaring events in CDS, emitting and receiving events with srv.emit/srv.on, the transactional outbox for reliable delivery, local development with file-based-messaging, connecting to production brokers (SAP Event Mesh, SAP Cloud Application Event Hub), and hybrid testing with cds bind. Use this skill whenever a developer wants to add messaging, async events, pub-sub, cross-service event communication, or integrate with a message broker in a CAP app./cap-mtxDevelop and deploy multitenant CAP Node.js SaaS applications using @sap/cds-mtxs. Covers enabling multitenancy, MTX sidecar setup, extensibility and feature toggles, local and hybrid testing, deploying to Cloud Foundry (MTA) and Kyma (Helm), tenant lifecycle management, approuter/XSUAA/IAS wiring, and common deployment pitfalls.npx claudepluginhub capire/skills --plugin cap-developerOther plugins' skills for the same job