用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/tomevault-io/skills-registry --skill sap-cap-nodejs-dev命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
| Use when this capability is needed.
> Use when this capability is needed.
Review architecture and API design for the vfs-s3 project. Use when the user mentions @architect, asks to review an issue's design, discuss module boundaries, API shape, or architectural decisions for vfs-s3. Also trigger when the user wants to create an ADR (Architecture Decision Record) or evaluate a technical approach for the project. Intended for dispatch from Codex automation or Claude routines; GitHub trigger phrase: @vfs-s3-bot please prepare design doc Use when this capability is needed.
基于 SOC 职业分类
正在显示 SKILL.md
| name | sap-cap-nodejs-dev |
| description | | Use when this capability is needed. |
Before doing anything, classify the request:
.cds are in scope; the UI app itself is not."@sap/cds + cds.ApplicationService, or documented
@cap-js/* plugins).When in doubt, ask the user to confirm the request fits the CAP Node.js scope before writing code.
@sap/cds, @sap/cds/common,
@cap-js/sqlite, @cap-js/hana, @cap-js/postgres, @cap-js/attachments,
@cap-js/audit-logging, @cap-js/change-tracking, @cap-js/telemetry, @cap-js/graphql,
@cap-js/mcp-server, @sap/cds-mtxs.@sap/cds/lib/*, node_modules/@sap/cds/lib/*, or any path the docs do not
describe."Every line of code not written is free of errors." — SAP Capire https://cap.cloud.sap/docs/get-started/features#less-code-%E2%86%92-less-mistakes
CAP captures domain knowledge and intent declaratively ("What, not How"). This skill follows that principle: prefer the CDS model, annotations, projections, and CAP's generic providers over hand-written handlers and SQL.
CAP's generic providers already handle: CRUD, nested documents, drafts, media, search, pagination, sorting, authentication / authorization, localization, input validation, auto-generated keys, concurrency control. Do not re-implement these in code.
Decision order when adding a new behavior — only drop to the next step if the previous one cannot express it:
@sap/cds/common.@mandatory, @assert.*, @readonly, @insertonly, @requires,
@restrict, @cds.persistence.*, @cds.search, @odata.draft.enabled, @odata.etag,
@UI.*.@flow.status + @from + @to. CAP validates the entry state and writes the target
state. See references/status-flow.md. ⚠ Currently Gamma in
capire — only adopt with explicit team acceptance.@cap-js/attachments, @cap-js/audit-logging, @cap-js/change-tracking,
@cap-js/telemetry, @cap-js/graphql, etc.@odata.etag (via managed.modifiedAt) for optimistic locking;
cds.tx(req) with .forUpdate() on the base entity when invariants span multiple rows.
See references/concurrency-control.md and
references/race-conditions.md.@from/@to,
@odata.etag, @assert.*, @requires, or a projection already does for free.Full explanation, examples, and the "is this PR domain-first?" checklist: references/domain-first.md.
| Concern | Where it lives |
|---|---|
| Keys, types, relationships | db/schema.cds |
| Required / range / format / unique | CDS @mandatory, @assert.* |
| Computed fields | CDS calculated elements (= expr, stored) |
| Exposed subset / filtered rows | srv/*.cds projection |
| Joins across entities | CDS view (as select from … join …) |
| Authorization (who can do what) | @requires, @restrict |
| Fiori UI shape | @UI.*, @Common.* annotations in CDS |
| i18n texts | _i18n/ .properties files |
| Seed / reference data | CSV in db/data/ |
| Cross-cutting concerns | @cap-js/* plugin (configured, not coded) |
| Genuine business logic | Node.js event handler in srv/*.js |
The app/ folder (UI applications) is out of scope for this skill.
project/
├── app/ # UI content ← out of scope
├── srv/ # Service definitions (.cds, .js/.ts) ← in scope
├── db/ # Data models, views, seed data ← in scope
│ ├── schema.cds
│ └── data/
├── package.json # Dependencies + CDS config ← in scope
└── .cdsrc.json # CDS configuration (optional)
npm i -g @sap/cds-dk @sap/cds-lsp
cds init <project-name>
cds watch
Add capabilities as needed (cds add hana | sqlite | xsuaa | mta | multitenancy | typescript).
Full CLI reference: references/cli-complete.md and
references/tools-complete.md.
Domain-first starter — model first, expose with a projection, no handler needed:
// db/schema.cds
using { cuid, managed } from '@sap/cds/common';
namespace my.bookshop;
entity Books : cuid, managed {
title : String(111) @mandatory;
stock : Integer @assert.range: [0, 99999];
price : Decimal(9,2);
}
// srv/catalog-service.cds
using { my.bookshop as my } from '../db/schema';
@requires: 'authenticated-user'
service CatalogService {
@readonly entity Books as projection on my.Books where stock > 0;
}
That's a working, validated, authorized, searchable OData service — zero JS.
For more entity / projection / view / annotation patterns, see the templates folder and the references below.
The skill integrates with the official CAP MCP server, giving the agent live access to the project's compiled CSN model and CAP docs:
search_model — fuzzy search entities, services, actions, and relationships in the CSN.search_docs — semantic search through CAP documentation.Setup: references/mcp-integration.md. Use cases: references/mcp-use-cases.md.
@flow.status + @from + @to for
state-machine use cases (capire Gamma).@odata.etag optimistic
locking, .forUpdate() pessimistic locking, draft serialization.i18n.properties and error-message bundle messages.properties for req.error / req.reject, built-in keys ASSERT_MANDATORY, ASSERT_RANGE, ASSERT_FORMAT, ASSERT_TARGET, MULTIPLE_ERRORS), temporal data.@cap-js/* plugins.cds CLI reference.Source: Fab2295/sap-skills — distributed by TomeVault.