btp-best-practices
Skill1 starsChanged 4 months agoMITView on GitHub
SAP BTP enterprise architecture best practices — runtime selection (CF vs Kyma), CAP project setup, MTA structure, XSUAA security, destination management, resilience patterns, CI/CD pipeline design, observability, cost optimization. Use when designing BTP solutions or implementing deployment pipelines.
- Installs packages
In this repository413 other files it gives its agents.
- .agents/AGENTS.mdAGENTS.md
- AGENTS.mdAGENTS.md
- .codex/AGENTS.mdAGENTS.md
- .cursor/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- sap-router-skillCopilot instructions
- .cursor/rules/sap-router.mdcCursor rule
- abap-cloud-migrationSkill
- abap-cloudSkill
- abap-code-patternsSkill
- abap-code-reviewSkill
- abap-docs-referenceSkill
- abapgitSkill
- abapSkill
- abap-snippetSkill
- abap-sql-amdpSkill
- abap-system-infoSkill
- abap-unit-testingSkill
- arc-1-skillsSkill
- atc-cloudificationSkill
- authorization-iamSkill
- automation-pilot-catalog-explorerSkill
- automation-pilot-command-generationSkill
- automation-pilot-command-reviewSkill
- automation-pilot-content-management-via-apiSkill
- automation-pilot-debuggerSkill
- automation-pilot-executions-apiSkill
- automation-pilot-executor-executescriptSkill
- automation-pilot-executor-httprequestSkill
- automation-pilot-mcp-server-generationSkill
- automation-pilot-scheduled-executions-apiSkill
- badi-enhancementSkill
- btp-abap-environmentSkill
- btp-build-work-zoneSkill
- btp-business-application-studioSkill
- btp-ciasSkill
- btp-cloud-foundrySkill
- btp-cloud-identitySkill
- btp-cloud-loggingSkill
- btp-cloud-platformSkill
- btp-cloud-transport-managementSkill
- btp-connectivitySkill
- btp-developer-guideSkill
- btp-diagram-generatorSkill
- btp-integration-suiteSkill
- btp-job-schedulingSkill
- btp-master-data-integrationSkill
- btp-service-managerSkill
- cap-add-remote-serviceSkill
- cap-developerSkill
- cap-triviaSkill
- capture-answerSkill
- cap-upgradeSkill
- cds-view-entitiesSkill
- claude-abap-skillsSkill
- claude-memSkill
- clean-abapSkill
- context-modeSkill
- cpi-iflow-developmentSkill
- engine-cap-developmentSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 1 is distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 27
Rule: Default to CF unless you need custom containers, sidecars, or K8s-native features.
- Very specific: line 135
Use cf scale to right-size memory (start 256M, increase on OOM)
- Very specific: line 137
Use HANA Cloud with data_volume_limit sized to actual usage
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
SAP BTP Best Practices
Prerequisites
- BTP Global Account with entitlements for: CF runtime, XSUAA, HANA (or HDI), Destination Service
cfCLI with MultiApps plugin:cf install-plugin multiapps- CAP CLI:
npm install -g @sap/cds-dk - MBT (MTA Build Tool):
npm install -g mbt - Git repository for source control
1. Choose Runtime: Cloud Foundry vs Kyma
- Cloud Foundry — Java/Node.js/Python/Go, native CAP support, simpler ops, auto-scaler
- Kyma (K8s) — any container, HPA scaling, Istio service mesh, higher complexity
Rule: Default to CF unless you need custom containers, sidecars, or K8s-native features.
2. Create a CAP Project with MTA
cds init my-project
cd my-project
cds add mta # generates mta.yaml
cds add app # adds UI (SAP Fiori elements)
cds add xs-security # adds xs-security.json
cds add hana # adds HANA persistence3. Build and Deploy
mbt build
cf deploy mta_archives/my-project_1.0.0.mtar4. MTA Structure
_schema-version: "3.1"
ID: my-project
version: 1.0.0
modules:
- name: my-project-srv
type: nodejs
path: gen/srv
requires:
- name: my-project-hdi
- name: my-project-xsuaa
parameters:
memory: 512M
resources:
- name: my-project-hdi
type: com.sap.xs.hdi-container
- name: my-project-xsuaa
type: org.cloudfoundry.managed-service
parameters:
service: xsuaa
service-plan: application
config: xs-security.json5. Configure XSUAA Security
{
"xsappname": "my-project",
"tenant-mode": "dedicated",
"scopes": [
{ "name": "$XSAPPNAME.User" },
{ "name": "$XSAPPNAME.Admin" }
],
"role-templates": [
{ "name": "User", "scope-references": ["$XSAPPNAME.User"] },
{ "name": "Admin", "scope-references": ["$XSAPPNAME.User", "$XSAPPNAME.Admin"] }
]
}6. Destination for On-Premise S/4HANA
{
"Name": "s4hana-backend",
"Type": "HTTP",
"URL": "https://s4hana.internal.corp:443",
"ProxyType": "OnPremise",
"Authentication": "PrincipalPropagation",
"sap-client": "100"
}Requires Cloud Connector installed and configured with trust to BTP subaccount.
7. Resilience Patterns
- Circuit Breaker — 50% failure threshold, 30s reset → unstable downstreams
- Retry — 3 attempts, exponential backoff (1s/2s/4s) → transient failures
- Timeout — 60s default, per-service configurable → long-running calls
- Bulkhead — max 10 concurrent requests → resource isolation
For CAP: cds require @sap/cds-feature-resilience (Node.js) or resilience4j (Java).
8. CI/CD Pipeline
stages:
- build: mbt build
- test: cds test
- lint: eslint && cds lint
- deploy-dev: cf deploy mta_archives/*.mtar
- smoke: curl -sf https://dev.app.example.com/health
- deploy-prd: manual approval gate9. Observability
- SAP Cloud Logging — centralized logs (OpenSearch + Kibana dashboard)
- SAP Alert Notification — proactive alerts on service events
- SAP Automation Pilot — automated incident response runbooks
- BTP Cockpit — service health and metric dashboards
10. Cost Optimization
- Use
cf scaleto right-size memory (start 256M, increase on OOM) - Enable auto-scaler to scale down during off-hours
- Use HANA Cloud with
data_volume_limitsized to actual usage - Review entitlements quarterly — remove unused service instances
Pitfalls
Deploy fails: "service instance not found"
- Cause: MTA references a resource name that doesn't match an existing service instance
- Solution: Ensure resource
namein mta.yaml matchescf servicesoutput exactly
XSUAA token expires mid-session
- Cause: Default token TTL is 12 hours; no refresh token configured
- Solution: Implement token refresh in app interceptor; or increase
oauth2-configuration.token-validityin xs-security.json
On-premise destination returns 403
- Cause: Cloud Connector trust not established or Principal Propagation not configured
- Solution: Verify Cloud Connector → subaccount trust in BTP Cockpit; check principal propagation mapping in Cloud Connector
App crashes with "memory exceeded"
- Cause: CF hard memory limit — app OOM-killed if container exceeds allocation
- Solution:
cf scale my-app -m 1Gor optimize memory leaks; monitor viacf app my-app
Service quota exceeded on deploy
- Cause: Subaccount entitlements insufficient for requested service plan
- Solution: BTP Cockpit → Entitlements → increase quota for the service, or remove unused instances
MTA ID mismatch causes XSUAA conflict
- Cause: MTA
IDdiffers fromxsappnamein xs-security.json - Solution: Keep MTA
IDandxsappnameidentical to avoid scope registration errors
Verification
# Verify deployment
cf apps
cf services
# Health check
curl -sf https://<app-route>/health
# Verify XSUAA scopes
cf env my-project-srv | grep -A20 xsuaa
# Check destination connectivity
cf curl "/v3/service_instances/<destination-guid>/parameters"Confirm:
cf deploycompletes with zero errors- App health endpoint returns 200
- XSUAA scopes match role-templates in xs-security.json
- Destination service resolves on-premise backend via Cloud Connector
- No services in
cf servicesshow "create failed" status
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
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.

