secondsky/sap-skillsGPL-3.033 files

Sap Cap Capire

|

Specification
Skill ID
secondsky/sap-skills/sap-cap-capire
Publisher
secondsky
Repository
sap-skills
Installs
0
Files
33
License
GPL-3.0
Synced
Sep 23, 2026
How to use it

Open any RiverX project, open the Skills panel in the chat, and search for this identifier. The files are fetched from the source repository at install time.

secondsky/sap-skills/sap-cap-capireInstalls these files
  • README.md
  • SKILL.md
  • agents/openai.yaml
  • references/annotations-reference.md
  • references/cdl-syntax.md
  • references/cli-complete.md
  • references/consuming-services-deployment.md
  • references/cql-patterns.md
  • references/cql-queries.md
  • references/csn-cqn-cxn.md
  • references/data-privacy-security.md
  • references/databases.md
  • references/deployment-cf.md
  • references/event-handlers-nodejs.md
  • references/event-handlers-patterns.md
  • references/extensibility-multitenancy.md
  • references/fiori-integration.md
  • references/java-runtime.md
  • references/localization-temporal.md
  • references/mcp-integration.md
  • references/mcp-use-cases.md
  • references/nodejs-runtime.md
  • references/plugins-reference.md
  • references/service-definitions.md
  • references/tools-complete.md
  • templates/bookshop-schema.cds
  • templates/catalog-service.cds
  • templates/fiori-annotations.cds
  • templates/mta.yaml
  • templates/package.json
  • templates/service-handler.js
  • templates/service-handler.ts
  • templates/xs-security.json

What this skill tells the agent

SAP CAP-Capire Development Skill

Related Skills

  • sap-fiori-tools: Use for UI layer development, Fiori Elements integration, and frontend application generation
  • sapui5: Use for custom UI development, advanced UI patterns, and freestyle application building
  • sap-btp-cloud-platform: Use for deployment options, Cloud Foundry/Kyma configuration, and BTP service integration
  • sap-hana-cli: Use for database management, schema inspection, and HDI container administration
  • sap-abap: Use for ABAP system integration, external service consumption, and SAP extensions
  • sap-btp-best-practices: Use for production deployment patterns and architectural guidance
  • sap-ai-core: Use when adding AI capabilities to CAP applications or integrating with SAP AI services
  • sap-cloud-sdk-ai: Use for SDK-level AI integration (chat completion, streaming, tool calling) in CAP event handlers
  • sap-cloud-sdk-ai-python: Use for Python-based AI integration with CAP Java or standalone BTP services
  • sap-api-style: Use when documenting CAP OData services or following API documentation standards
  • sap-dependency-security: Use for secure dependency, lockfile, supply-chain, and exact MCP server pin controls in CAP service repos

When to Use This Skill

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.

Common Issues

IssueFirst check
cds watch or cds serve failsVerify @sap/cds-dk, Node.js version, and project package.json scripts.
Entity/service not foundUse CAP MCP search_model when available, then inspect db/ and srv/ CDS files.
HANA deployment failsCheck HDI service binding, mta.yaml, and the HANA deployment references.
Authorization behaves unexpectedlyReview @requires, @restrict, XSUAA/IAS bindings, and user role mappings.

Table of Contents

  • Quick Start
  • Project Structure
  • Core Concepts
  • AI Integration
  • Database Setup
  • Deployment
  • Bundled Resources

Quick Start

Project Initialization

# 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

Basic Entity Example

using { 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;
}

Basic Service

using { 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;
}

MCP Integration

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 model
  • search_docs - Semantic search through CAP documentation for syntax, patterns, and best practices

Key Benefits:

  • Instant Model Discovery: Query your project's entities, associations, and services without reading files
  • Context-Aware Documentation: Find relevant CAP documentation based on semantic similarity, not keywords
  • Zero Configuration: No credentials or environment variables required
  • Offline-Capable: All searches are local (model) or cached (docs)

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.

CAP MCP and LSP Routing

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.

  • Use references/mcp-integration.md for MCP configuration and package pin checks.
  • Use references/mcp-use-cases.md only for workflow selection and illustrative impact examples.
  • Use .lsp.json as a Claude-compatible sidecar for CAP editor integration; other harnesses should not assume it is auto-loaded.
  • For Codex, OpenCode, editors, or other LSP-capable clients, configure the command manually as 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.
  • Without LSP integration, use the Markdown guidance, bundled references, rg, and CAP CLI checks directly.
  • Mark live deployment, HANA, XSUAA, and multitenancy verification pending unless the target project or tenant evidence is available.

Project Structure

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)

Core Concepts

CDS Built-in Types

CDS TypeSQL MappingCommon Use
UUIDNVARCHAR(36)Primary keys
String(n)NVARCHAR(n)Text fields
IntegerINTEGERWhole numbers
Decimal(p,s)DECIMAL(p,s)Monetary values
BooleanBOOLEANTrue/false
DateDATECalendar dates
TimestampTIMESTAMPDate/time

Common Aspects

using { cuid, managed, temporal } from '@sap/cds/common';
// cuid = UUID key
// managed = createdAt, createdBy, modifiedAt, modifiedBy
// temporal = validFrom, validTo

Event Handlers (Node.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 };
    });

Use this skill in a project

Open any RiverX project, search the Skills panel for secondsky/sap-skills/sap-cap-capire, and install it in one click.

Use this skill