cap-developer
Skill1 starsChanged 4 months agoMITView on GitHub
Expert 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 when building a new CAP app, extending an existing one, or reviewing CAP code for correctness and idioms — regardless of whether the stack is Node.js or Java.
1 other project uses a version of this, 1 of them edited.
Adopted by
Most recently taken up by
- capire/skillsedited, first seen Jul 16, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 1
- capire/skills★ 1750% same
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
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-best-practicesSkill
- 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-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
Show its rules and text
We split this skill into the rules it gives an agent
23 rules. About 0 are common, 10 are distinctive, and 13 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈10
Distinctive · estimate
This author's own choices. Worth a look.
13
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 17
When in a new project, use the globally installed @sap/cds-dk (cli: cds).
- Very specific: line 21
When only working with cds models, you can simply start with cds w without needing to define a runtime.
- Distinctive: line 25
Always use the CAP MCP server to:
- Distinctive: line 26
Search CAP documentation before guessing at APIs or annotations
- Distinctive: line 27
Read the effective CDS model of an existing project before adding or changing anything
- Distinctive: line 29
Never use the CAP MCP server as Fiori/SAPUI5 documentation.
- Distinctive: line 40
Start a new project with:
- Very specific: line 48
When the runtime is known upfront, pass --java or --nodejs to cds init (see the runtime-specific reference files for details).
- Very specific: line 51
Never: run cds add sample — it scaffolds a full demo app into the project.
- Very specific: line 52
Use cds add tiny-sample only if the user explicitly wants a minimal starter model.
- Very specific: line 53
Use cds add <feature> (e.g.
- Very specific: line 61
Use Composition of many for parent-child / document structures.
- Very specific: line 62
Use localized String for user-facing text that needs translation
- Distinctive: line 65
Always expose db entities via projections in services — never expose db entities directly
- Very specific: line 68
Don't expose an entity just because it exists — shape the projection for the consumer: trim with excluding, add calculated fields or …
- Very specific: line 74
Avoid two projections in the same service pointing to the same underlying entity — CDS can't auto-redirect associations and will error.
- Very specific: line 77
Keep Fiori UI annotations in app/ annotation files, not in service definitions
- Distinctive: line 81
Prefer annotations over custom handler code.
- Distinctive: line 105
Only when declarative annotations aren't enough, write an event handler.
- Distinctive: line 114
Don't write handlers for things the generic service provider already handles.
- Very specific: line 130
Use --filter <Entity> to scope to specific entities (case-insensitive substring match.
- Distinctive: line 141
Write handlers for things the generic service provider already handles
- Very specific: line 143
Put user-facing strings inline — use _i18n/ bundles
≈ “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
What I do
Provide correct, lean, idiomatic guidance for CAP development — from project setup and CDS modeling through declarative annotations and programmatic event handlers.
Runtime Choice
When in a new project, use the globally installed @sap/cds-dk (cli: cds).
Defer the language choice until necessary.
This choice is only necessary once code is added or the app is deployed.
When only working with cds models, you can simply start with cds w without needing to define a runtime.
MCP Server
Always use the CAP MCP server to:
- Search CAP documentation before guessing at APIs or annotations
- Read the effective CDS model of an existing project before adding or changing anything
Never use the CAP MCP server as Fiori/SAPUI5 documentation. It contains useful information about how CAP integrates with Fiori/SAPUI5 but is not a complete reference for those frameworks.
Caveat on release notes and version tables: MCP search results sourced from release notes or
version recommendation tables may be outdated — they reflect what was true at the time of that
release, not necessarily today. Always cross-check version-specific claims (e.g. "recommended
Node.js version") against live sources like cds version, npm view, or the current Getting
Started page rather than trusting a snapshot from a past release note.
Project setup rules
Start a new project with:
cds init <name> # creates a subdirectory; omit <name> to init in cwd
cd <name>
cds watch # start the dev loop (works without a runtime for pure modeling)When the runtime is known upfront, pass --java or --nodejs to cds init (see the
runtime-specific reference files for details).
- Never run
cds add sample— it scaffolds a full demo app into the project. - Use
cds add tiny-sampleonly if the user explicitly wants a minimal starter model. - Use
cds add <feature>(e.g.hana,xsuaa,approuter,mta) to add features incrementally and only when needed (e.g. when deployment is requested).
CDS Modeling
Apply these conventions consistently:
- Reuse built-in aspects:
cuid,managed,temporalfrom@sap/cds/common - Use
Composition of manyfor parent-child / document structures;Association tofor references - Use
localized Stringfor user-facing text that needs translation - Naming: PascalCase for entities and types, camelCase for elements
- Define a
namespaceindb/schema.cdsto avoid naming collisions between db and service layers - Always expose db entities via projections in services — never expose db entities directly
- Expose only the elements clients actually need; use
{*, ...} excluding { ... }to trim (excludingonly works after the wildcard*selector) - Don't expose an entity just because it exists — shape the projection for the consumer: trim with
excluding, add calculated fields or flattened associations (e.g.author.name as author), and restrict with@restrict; only reach for actions/functions when the shape can't be expressed declaratively - Entities written to only internally don't belong in the public service; put them in an admin service if needed
- Avoid two projections in the same service pointing to the same underlying entity — CDS can't
auto-redirect associations and will error; remove the redundant projection or use
@cds.redirection.target - Keep Fiori UI annotations in
app/annotation files, not in service definitions
Declarative First
Prefer annotations over custom handler code. Only write handlers when declarative options are insufficient.
| Need | Annotation |
| Input validation (format) | @assert.format: '...' |
| Input validation (range) | @assert.range: [min, max] |
| Input validation (enum) | @assert.range enum { val1; val2; } |
| Target Entity exists check | @assert.target |
| Cross-field / exists check | @assert: (case when ... then '...' end) |
| Required field | @mandatory |
| Read-only entity | @readonly |
| Insert-only entity | @insertonly |
| Authorization | @restrict / @requires |
| Audit fields | : managed aspect |
| Draft support | @odata.draft.enabled |
| Derived / computed values | Calculated elements: total : Decimal = price * quantity; |
| Status-transition workflow (approve/reject/etc.) | @flow.status + @from / @to on actions pre-GA / Gamma |
Use Draft only when building a Fiori / SAPUI5 application. It is a complex mechanism that other UI frameworks cannot handle easily.
Programmatic custom logic
Only when declarative annotations aren't enough, write an event handler. Three phases exist (runtime-agnostic):
- before — input validation that can't be expressed declaratively; reject early before DB writes.
- on — custom actions and functions.
- after — side effects like emitting async events.
Two rules hold for both runtimes:
- Don't write handlers for things the generic service provider already handles.
- Rely on CAP's intrinsic transaction handling — no manual transactions.
The handler API differs substantially between runtimes. Read the matching reference for full guidance:
references/nodejs.md—srv.before/srv.on/srv.after,req.reject(code, message), intrinsic transactions, the round-trip-minimization pattern.references/java.md—@Before/@On/@Afterwith reflection-based event/entity detection, typedCdsResult<D>vs untypedResult,ServiceExceptionvsmessages.error, the race-condition-safe.set(field, expr)update pattern, and more.
Sample Data
Generate data files with the CLI, never create them manually or invent UUIDs.
- Generate CSVs for all entities:
cds add data --records <Amount>Use--filter <Entity>to scope to specific entities (case-insensitive substring match; use regex likebooks$to exclude.textscompositions). - Replace placeholder values (e.g.
title-29894036) with realistic domain content. Keep generated IDs and foreign-key references intact.
Gotcha: cds add data without --records generates header-only CSVs — always pass
--records.
Don't
- Write handlers for things the generic service provider already handles
- Hardcode tenant IDs, system IDs, or credentials anywhere
- Put user-facing strings inline — use
_i18n/bundles - Run
cds add sample
Runtime-specific don'ts (e.g. await inside cds.on('served', ...) in Node) live in the
respective reference file.
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.

