Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

add-endpoint

БесплатноБез исполняемых скриптовНе проверен

Add a new ADT endpoint call (schema + contract + fixture). USE WHEN the user wants to add support for a new SAP ADT REST endpoint, add a new schema, or add a…

abapifyот abapify★ 20 звёзд на GitHub

Об этом скилле

Add a New ADT Endpoint

This skill guides adding support for a new SAP ADT REST endpoint. It covers schema definition, contract creation, fixture registration, and integration into the contract index.

Overview of the Layers

SAP ADT endpoint (HTTP)
    ↓
adt-schemas    packages/adt-schemas/src/schemas/generated/
               • Schema literal (TypeScript `as const` object from XSD)
               • Typed wrapper in typed.ts
    ↓
adt-contracts  packages/adt-contracts/src/
               • generated/schemas.ts   (toSpeciSchema wrapper)
               • adt/{module}/{file}.ts  (contract definition)
               • adt/{module}/index.ts  (module exports + aggregate)
    ↓
adt-fixtures   packages/adt-fixtures/src/
               • fixtures/{module}/{name}.xml  (real SAP XML sample)
               • fixtures/registry.ts          (path registration)

Step 1: Gather Endpoint Information

Before writing any code, obtain the endpoint's HTTP details and XML payload structure.

Tip: If the endpoint is undocumented or you need to research it first, use $adt-reverse-engineering for systematic discovery via live system, open source projects, and Sourcegraph code search.

Option A: Live System Available

If you have a running SAP system connection:

  1. Make a real HTTP request to the endpoint and capture the response XML:
    # Example using curl or adt-cli:
    # GET /sap/bc/adt/{path}/{objectname}
    
  2. Save the raw response to tmp/ for reference (see tmp-folder-testing):
    # adt get ZOBJECT_NAME -o tmp/response.xml
    
  3. Use the actual XML to design the schema and write the fixture.

Option B: No Live System — Web Research

If no system connection is available, research the endpoint:

  1. Search SAP ADT documentation and community resources:

  2. Search for XSD schema definitions:

    • Look in the existing XSD files under packages/adt-schemas/ for similar patterns
    • Search the abapGit repository for matching serializer names or object types
  3. Look at similar existing schemas in packages/adt-schemas/src/schemas/generated/schemas/sap/ for structural patterns.

  4. Construct a representative XML fixture based on research, clearly marked as synthesized:

    <?xml version="1.0" encoding="UTF-8"?>
    <!-- Source: GET /sap/bc/adt/{your-path}/{name} -->
    <!-- Note: Synthesized from documentation/research - verify against live system -->
    

Step 2: Create the Schema in adt-schemas

Schemas live in packages/adt-schemas/src/schemas/generated/schemas/.

2a: Add the schema literal

Create packages/adt-schemas/src/schemas/generated/schemas/sap/{schemaName}.ts:

Note on the Source: comment: Existing generated files reference xsd/sap/{name}.xsd pointing to XSD sources in packages/adt-schemas/.xsd/. For manually created schemas (derived from a live system response or research), use a descriptive comment instead.

/**
 * Schema for {description}
 *
 * Manually created — derived from live system response / research
 * Reference: GET /sap/bc/adt/{your-path}
 */

// Import dependencies (only schemas you actually use)
import adtcore from './adtcore';

export default {
  $xmlns: {
    adtcore: 'http://www.sap.com/adt/core',
    xsd: 'http://www.w3.org/2001/XMLSchema',
    myns: 'http://www.sap.com/adt/my-namespace', // ← your namespace
  },
  $imports: [adtcore],
  targetNamespace: 'http://www.sap.com/adt/my-namespace',
  attributeFormDefault: 'qualified',
  elementFormDefault: 'qualified',
  element: [
    {
      name: 'myRootElement', // ← root element name (camelCase)
      type: 'myns:MyRootType',
    },
  ],
  complexType: [
    {
      name: 'MyRootType',
      complexContent: {
        extension: {
          base: 'adtcore:AdtMainObject', // ← extend appropriate base type
          sequence: {
            element: [
              {
                name: 'myChild',
                type: 'xsd:string',
                minOccurs: '0',
              },
            ],
          },
          attribute: [
            {
              name: 'myAttr',
              type: 'xsd:string',
            },
          ],
        },
      },
    },
  ],
} as const;

Key rules for schema literals:

See xsd-best-practices for XSD validity rules and edge cases.

  • Must end with } as const
  • One root element per schema document
  • Use $imports for schemas you depend on (adtcore, abapoo, abapsource, etc.)
  • Names follow XSD conventions: complexType names are PascalCase
  • Look at
Полный SKILL.md на GitHub

Установить add-endpoint в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл add-endpoint?

Add a new ADT endpoint call (schema + contract + fixture). USE WHEN the user wants to add support for a new SAP ADT REST endpoint, add a new schema, or add a new API contract. Trigger words - new endpoint, add endpoint, new schema, add contract, support endpoint, SAP ADT API.

Как установить скилл add-endpoint?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл add-endpoint запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить add-endpoint с