Install any skill in seconds. Free to start, no credit card required.
Get Started Free →SAP Cloud Application Programming Model (CAP) development skill using Capire documentation. Use when: building CAP applications, defining CDS models, implementing services, working with SAP HANA/SQLite/PostgreSQL databases, deploying to SAP BTP Cloud Foundry or Kyma, implementing Fiori UIs, handling authorization, multitenancy, or messaging. Covers CDL/CQL/CSN syntax, Node.js and Java runtimes, event handlers, OData services, and CAP plugins.
.claude/skills/secondsky-sap-cap-capire/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-02 | ✗→✓ | ▲ Improved | 165% | 0% |
| case-05 | ✗→✓ | ▲ Improved | 269% | 0% |
| case-08 | ✗→✓ | ▲ Improved | 214% | 0% |
| case-19 | ✗→✓ | ▲ Improved | 136% | 0% |
| case-22 | ✗→✓ | ▲ Improved | 305% | 0% |
Use this skill when creating CAP projects, modeling CDS entities/services, implementing Node.js or Java event handlers, configuring HANA/SQLite/PostgreSQL persistence, deploying to BTP Cloud Foundry or Kyma, adding Fiori UIs, configuring authorization/multitenancy/messaging, or using CAP MCP/LSP tooling.
| Issue | First check | |-------|-------------| | cds watch or cds serve fails | Verify @sap/cds-dk, Node.js version, and project package.json scripts. | | Entity/service not found | Use CAP MCP search_model when available, then inspect db/ and srv/ CDS files. | | HANA deployment fails | Check HDI service binding, mta.yaml, and the HANA deployment references. | | Authorization behaves unexpectedly | Review @requires, @restrict, XSUAA/IAS bindings, and user role mappings. |
sh# Use an approved CAP toolchain: # - project-local devDependencies # - user-local npm prefix # - enterprise-managed Node/CAP installation # Ensure cds and optional cds-lsp commands are on PATH. cds --version # Create new project cds init <project-name> cds init <project-name> --add sample,hana # Start development server with live reload cds watch # Add capabilities cds add hana # SAP HANA database cds add sqlite # SQLite for development cds add xsuaa # Authentication cds add mta # Cloud Foundry deployment cds add multitenancy # SaaS multitenancy cds add typescript # TypeScript support
cdsusing { cuid, managed } from '@sap/cds/common'; namespace my.bookshop; entity Books : cuid, managed { title : String(111) not null; author : Association to Authors; stock : Integer; price : Decimal(9,2); } entity Authors : cuid, managed { name : String(111); books : Association to many Books on books.author = $self; }
cdsusing { my.bookshop as my } from '../db/schema'; service CatalogService @(path: '/browse') { @readonly entity Books as projection on my.Books; @readonly entity Authors as projection on my.Authors; @requires: 'authenticated-user' action submitOrder(book: Books:ID, quantity: Integer) returns String; }
This skill integrates with the official CAP MCP (Model Context Protocol) server, providing AI agents with live access to your project's compiled CDS model and CAP documentation.
Available MCP Tools:
search_model - Fuzzy search for CDS entities, services, actions, and relationships in your compiled CSN modelsearch_docs - Semantic search through CAP documentation for syntax, patterns, and best practicesKey Benefits:
Setup: See MCP Integration Guide for configuration with Claude Code, opencode, or GitHub Copilot. MCP package pins are governed by sap-dependency-security and validated by npm run validate:mcp-security.
Use Cases: See MCP Use Cases for illustrative local workflow examples and planning assumptions, not repository-verified ROI.
Agent Integration: The specialized agents (cap-cds-modeler, cap-service-developer, cap-project-architect, cap-performance-debugger) automatically use these MCP tools as part of their workflows.
Use MCP first for local model and docs questions, then fall back to direct file search when MCP is unavailable. Use rg -n "<entity|service|aspect|annotation|handler|cds compile|deployment>" references/*.md srv db app to locate the narrowest reference before loading long CAP guides.
references/mcp-integration.md for MCP configuration and package pin checks.references/mcp-use-cases.md only for workflow selection and illustrative impact examples..lsp.json as a Claude-compatible sidecar for CAP editor integration; other harnesses should not assume it is auto-loaded.node <sap-cap-capire-plugin-root>/lsp/cds-lsp-launcher.mjs --stdio. This still requires @sap/cds-lsp to be installed through an approved project-local devDependency, user-local npm prefix, or enterprise-managed toolchain, with cds-lsp available on PATH.rg, and CAP CLI checks directly.project/
├── app/ # UI content (Fiori, UI5)
├── srv/ # Service definitions (.cds, .js/.ts)
├── db/ # Data models and schema
│ ├── schema.cds # Entity definitions
│ └── data/ # CSV seed data
├── package.json # Dependencies and CDS config
└── .cdsrc.json # CDS configuration (optional)| CDS Type | SQL Mapping | Common Use | |----------|-------------|------------| | UUID | NVARCHAR(36) | Primary keys | | String(n) | NVARCHAR(n) | Text fields | | Integer | INTEGER | Whole numbers | | Decimal(p,s) | DECIMAL(p,s) | Monetary values | | Boolean | BOOLEAN | True/false | | Date | DATE | Calendar dates | | Timestamp | TIMESTAMP | Date/time |
cdsusing { cuid, managed, temporal } from '@sap/cds/common'; // cuid = UUID key // managed = createdAt, createdBy, modifiedAt, modifiedBy // temporal = validFrom, validTo
js// srv/cat-service.js module.exports = class CatalogService extends cds.ApplicationService { init() { const { Books } = this.entities; // Before handlers - validation this.before('CREATE', Books, req => { if (!req.data.title) req.error(400, 'Title required'); }); // On handlers - custom logic this.on('submitOrder', async req => { const { book, quantity } = req.data; // Custom business logic return { success: true }; }); return super.init(); } }
jsconst { Books } = cds.entities; // SELECT with conditions const books = await SELECT.from(Books) .where({ stock: { '>': 0 } }) .orderBy('title'); // INSERT await INSERT.into(Books) .entries({ title: 'New Book', stock: 10 }); // UPDATE await UPDATE(Books, bookId) .set({ stock: { '-=': 1 } });
CAP applications integrate with SAP AI Core via the SAP Cloud SDK for AI. The recommended pattern uses the Orchestration Service through CAP event handlers, with all credential management handled by BTP service bindings.
yamlresources: - name: my-ai-core type: org.cloudfoundry.managed-service parameters: service: aicore service-plan: extended
bashcds bind -2 <AICORE_INSTANCE> && cds-tsx watch --profile hybrid
jsimport { OrchestrationClient } from '@sap-ai-sdk/orchestration'; module.exports = class AnalysisService extends cds.ApplicationService { async init() { const { Feedback } = this.entities; this.on('analyzeFeedback', async (req) => { const userText = req.data.text; const client = new OrchestrationClient({ promptTemplating: { model: { name: 'gpt-4o' }, prompt: [ { role: 'system', content: 'Categorize feedback as JSON: sentiment, category, urgency.' }, { role: 'user', content: '{{?userText}}' } ] } }); const response = await client.chatCompletion({ placeholderValues: { userText } }); const aiResult = response.getContent(); await INSERT.into('FeedbackResults').entries({ originalText: userText, analysisJson: aiResult }); return aiResult; }); return super.init(); } };
LLM calls can take 30-60 seconds. Never process them synchronously in production — the BTP load balancer will timeout before the LLM responds.
jsthis.on('analyzeFeedback', async (req) => { const id = await INSERT.into('FeedbackResults').entries({ originalText: req.data.text, status: 'processing' }); cds.spawn(() => processWithLLM(id, req.data.text)); return req.reply(202, { id, status: 'processing' }); }); async function processWithLLM(id, text) { const response = await client.chatCompletion({ placeholderValues: { userText: text } }); await UPDATE('FeedbackResults', id).set({ analysisJson: response.getContent(), status: 'completed' }); }
cdsentity Documents { key id : UUID; content : String(5000); embedding : Vector(1536); }
Use this with the HANA Cloud Vector Engine and AI Core orchestration grounding to build RAG scenarios directly in your CAP data model.
Do not hardcode prompts in event handlers. Store them in JSON files or a CDS configuration entity so they can be updated without redeployment:
cdsentity PromptTemplates { key id : UUID; name : String(100); systemPrompt : LargeString; updatedBy : String; modifiedAt : Timestamp; }
Node.js containers with AI SDK processing large text payloads require at least 512MB memory in the MTA descriptor. The AI SDK and JSON payload handling consume more memory than typical CAP services.
For complete SDK documentation, see sap-cloud-sdk-ai skill. For AI Core platform setup and orchestration configuration, see sap-ai-core skill.
json// package.json { "cds": { "requires": { "db": { "[development]": { "kind": "sqlite", "credentials": { "url": ":memory:" } }, "[production]": { "kind": "hana" } } } } }
shcds add hana cds deploy --to hana
db/data/my.bookshop-Books.csv<namespace>-<EntityName>.csvsh# Add CF deployment support cds add hana,xsuaa,mta,approuter # Build and deploy npm install --package-lock-only mbt build cf deploy mta_archives/<project>_<version>.mtar
shcds add multitenancy
Configuration:
json{ "cds": { "requires": { "multitenancy": true } } }
cds// Service-level @requires: 'authenticated-user' service CatalogService { ... } // Entity-level @restrict: [ { grant: 'READ' }, { grant: 'WRITE', to: 'admin' } ] entity Books { ... }
shcds init [name] # Create project cds add <feature> # Add capability cds watch # Dev server with live reload cds serve # Start server cds compile <model> # Compile CDS to CSN/SQL/EDMX cds deploy --to hana # Deploy to HANA cds build # Build for deployment cds env # Show configuration cds repl # Interactive REPL cds version # Show version info
cuid and managed aspects from @sap/cds/commondb/, services in srv/, UI in app/| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-06 | pass→pass | 7,255 | 4,313 | -41% | 1 | 1 | 0% | 1,264 | 5,126 | +306% | 0 | 0 | — |
case-07 | pass→pass | 4,914 | 3,453 | -30% | 1 | 1 | 0% | 874 | 5,010 | +473% | 0 | 0 | — |
case-01 | fail→fail | 20,018 | 18,222 | -9% | 1 | 1 | 0% | 3,908 | 8,055 | +106% | 0 | 0 | — |
case-02 | fail→pass | 14,026 | 11,230 | -20% | 1 | 1 | 0% | 2,447 | 6,477 | +165% | 0 | 0 | — |
case-03 | pass→pass | 9,426 | 5,293 | -44% | 1 | 1 | 0% | 1,746 | 5,402 | +209% | 0 | 0 | — |
case-04 | pass→pass | 5,928 | 3,248 | -45% | 1 | 1 | 0% | 1,100 | 5,015 | +356% | 0 | 0 | — |
case-05 | fail→pass | 8,187 | 2,547 | -69% | 1 | 1 | 0% | 1,320 | 4,872 | +269% | 0 | 0 | — |
case-08 | fail→pass | 9,728 | 5,443 | -44% | 1 | 1 | 0% | 1,750 | 5,492 | +214% | 0 | 0 | — |
case-09 | pass→pass | 10,225 | 5,604 | -45% | 1 | 1 | 0% | 1,873 | 5,469 | +192% | 0 | 0 | — |
case-10 | pass→pass | 7,075 | 4,603 | -35% | 1 | 1 | 0% | 1,256 | 5,284 | +321% | 0 | 0 | — |
case-11 | pass→pass | 11,889 | 6,467 | -46% | 1 | 1 | 0% | 2,153 | 5,680 | +164% | 0 | 0 | — |
case-12 | pass→pass | 8,798 | 4,740 | -46% | 1 | 1 | 0% | 1,430 | 5,238 | +266% | 0 | 0 | — |
case-13 | pass→pass | 10,967 | 9,919 | -10% | 1 | 1 | 0% | 1,968 | 6,249 | +218% | 0 | 0 | — |
case-14 | pass→pass | 12,057 | 5,154 | -57% | 1 | 1 | 0% | 1,993 | 5,268 | +164% | 0 | 0 | — |
case-15 | fail→fail | 32,414 | 5,831 | -82% | 1 | 1 | 0% | 2,210 | 5,446 | +146% | 0 | 0 | — |
case-16 | pass→pass | 7,021 | 5,124 | -27% | 1 | 1 | 0% | 1,111 | 5,231 | +371% | 0 | 0 | — |
case-17 | pass→pass | 15,435 | 9,676 | -37% | 1 | 1 | 0% | 2,767 | 6,111 | +121% | 0 | 0 | — |
case-18 | pass→pass | 10,243 | 6,449 | -37% | 1 | 1 | 0% | 1,759 | 5,514 | +213% | 0 | 0 | — |
case-19 | fail→pass | 13,294 | 4,014 | -70% | 1 | 1 | 0% | 2,158 | 5,102 | +136% | 0 | 0 | — |
case-20 | pass→pass | 9,301 | 6,806 | -27% | 1 | 1 | 0% | 1,551 | 5,591 | +260% | 0 | 0 | — |
case-21 | pass→pass | 10,016 | 5,504 | -45% | 1 | 1 | 0% | 1,625 | 5,368 | +230% | 0 | 0 | — |
case-22 | fail→pass | 8,488 | 6,104 | -28% | 1 | 1 | 0% | 1,337 | 5,419 | +305% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted, and 21 counted toward the lift figure. The other 1 produced results that are not comparable between the two arms, so they are excluded from the headline rather than averaged into it. The headline lift of +23 percentage points is the difference between those two pass rates over the 21 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.