Create API Service Layer

VerifiedSafe

Creates types, contracts, adapter, and service layer for a resource following the project's architecture (sections 4.1-4.3). Use when adding API integration to a module. It asks for endpoint details and generates the full data layer with strict separation between API types and app contracts.

Sby Skills Guide Bot
DevelopmentIntermediate
6/2/2026
Claude Code
#api-integration#data-layer#types#adapters#services

Recommended for

Automated summary

Creates the complete data layer (types, contracts, adapter, and service) for an API resource following the project's architecture.

Strengths

  • Enforces separation of concerns
  • Generates consistent, reusable code
  • Includes TypeScript validation
  • Follows defined architecture

Limitations

  • Requires clear API specification from user
  • May not handle complex nested data
  • Assumes Angular-style HTTP client
When to use it

When adding a new API integration to an Angular application following the project's architecture.

When not to use it

When the project does not use these layers or when a simple fetch is sufficient.

Security analysis

Safe
Quality score85/100

The skill generates TypeScript source files based on user input and runs a non-destructive TypeScript compilation check. It does not execute external commands, download scripts, or access sensitive data. All tools used (Read, Write, Edit, Bash for tsc, Glob, Grep) are for legitimate local code generation and validation.

No concerns found

How this analysis is made

Examples

Add user API integration
Use dev-create-service for User resource. Endpoint: /api/users, response: { id: number, name: string, email: string }. Operations: GET list, GET by ID, POST.
Add product API integration
Create service for Product. Base URL: /api/products. Response: { id: number, title: string, price: number, category: string }. Operations: GET list, GET by ID, PATCH, DELETE.
Add orders API integration
Add data layer for Order resource. Endpoint: /api/orders. Response: { id: number, customer_id: number, items: { product_id: number, quantity: number }[], status: string }. Operations: GET list, POST.

name: dev-create-service description: "Use when adding API integration to a module - creates types, contracts, adapter, and service layer." user-invocable: true argument-hint: "[resource-name]" allowed-tools: Read, Write, Edit, Bash, Glob, Grep

Create the complete data layer for a resource following docs/ARCHITECTURE.md sections 4.1-4.3.

Resource: $ARGUMENTS

Steps

  1. Read docs/ARCHITECTURE.md sections 4.1 (Services), 4.2 (Adapters), 4.3 (Types).

  2. Ask the user:

    • What is the endpoint base URL? (e.g. /api/marketplace)
    • What is the response JSON format? (ask for an example or describe the fields)
    • Which operations? (GET list, GET by ID, POST, PATCH, DELETE)
  3. Create in order:

    a. types/[resource].types.ts -- mirrors API exactly (snake_case) b. types/[resource].contracts.ts -- app contract (camelCase, correct types) c. adapters/[resource].adapter.ts -- inbound (API->App) + outbound (App->API) d. services/[resource].service.ts -- HttpClient only, inject(HttpClient), @Injectable({ providedIn: 'root' })

  4. Required rules:

    • Service: NO try/catch, NO .map()/.filter()/new Date()
    • Adapter: pure functions, no side effects
    • Types separated: .types.ts (API) != .contracts.ts (App)
  5. Validate: npx tsc --noEmit

From the file to a first result

The download contains exactly the content displayed on this page. This copy may differ from the latest version in the source repository.

View the source and supporting files

This download contains SKILL.md only. Any scripts, references, templates and dependencies are not included. Get the required files from the source, preserving their directory structure, before continuing.

1. Download the file

Download SKILL.md

From the root of a test project, save the file as .skill-downloads/create-api-service-layer-mm8o525m/SKILL.md, or use the command below. This folder is for inspecting the skill before installation.

Command for macOS/Linux or WSL: requires a POSIX shell and curl. On Windows without WSL, use the download button and create the folder manually.

mkdir -p '.skill-downloads/create-api-service-layer-mm8o525m' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/create-api-service-layer-mm8o525m/download' --output '.skill-downloads/create-api-service-layer-mm8o525m/SKILL.md.part' && mv '.skill-downloads/create-api-service-layer-mm8o525m/SKILL.md.part' '.skill-downloads/create-api-service-layer-mm8o525m/SKILL.md'

2. Check prerequisites

Read SKILL.md before using it. If it references scripts or external services, inspect them and prepare the required access in your test environment.

Tools declared by the author (check availability in your agent): Read, Write, Edit, Bash, Glob, Grep

No recognized prerequisites section in this file. This does not mean it is self-contained: libraries, tools and access requirements may be mentioned elsewhere in the content or source repository.

The platforms on this page are catalog indications. The paths below follow tool documentation; they do not prove this skill has been run in those tools. No minimum tool version is confirmed for this listing.

3. Load the skill

After inspection, copy the complete folder into your project using one of the commands below, then open a new tool session. The command stops if a folder with the same name already exists: compare the files before replacing it.

Claude Code
test -f '.skill-downloads/create-api-service-layer-mm8o525m/SKILL.md' && test -s '.skill-downloads/create-api-service-layer-mm8o525m/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/dev-create-service' && cp -R '.skill-downloads/create-api-service-layer-mm8o525m' '.claude/skills/dev-create-service'

OpenSkills

OpenSkills must already be installed. The local install/read procedure is checked with OpenSkills 1.5.0, which requires Node.js ≥ 20.6.0. Catalog slugs are not resolved automatically.

Official OpenSkills installation
openskills install './.skill-downloads/create-api-service-layer-mm8o525m'

openskills read 'create-api-service-layer-mm8o525m'

Reading should display the installed file content and its base directory. It does not run the skill or install its dependencies.

For an agent that reads AGENTS.md, then sync the index. This command changes AGENTS.md: review the diff before using it.

openskills sync

Manual method or another tool: attach SKILL.md to a conversation, or open it in an agent that can read files. Include any required supporting resources. No universal folder is recognized by every tool.

4. Try a first task

Use a short, synthetic input: an API endpoint, a small document or an interface brief. In a new conversation, attach the file or give the agent its path, then adapt this request:

Read .skill-downloads/create-api-service-layer-mm8o525m/SKILL.md and apply its instructions to this example: [describe a test input]. Identify any missing files, dependencies or access. Produce the result requested by the skill without inventing data or running unreviewed scripts.

Expected result: output matching the skill instructions, or a precise list of missing prerequisites. A read confirmation alone does not validate a first use. If an external resource is unavailable, that path remains untested.

Related skills