scaffold-api-service

Generate FastAPI service layers with MongoEngine, OpenTelemetry tracing, and DTOs.

9|2|Updated Nov 29, 2024
One-click install
npx skills add https://github.com/bbvch-ai/aihub-core --skill scaffold-api-service
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: scaffold-api-service
Source: https://github.com/bbvch-ai/aihub-core/tree/main/.claude/skills/scaffold-api-service
Command: npx skills add https://github.com/bbvch-ai/aihub-core --skill scaffold-api-service

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill eliminates the repetitive, error-prone work of writing boilerplate API service layers that must adhere to strict project conventions for tracing, DTO conversion, error handling, and stateless design, ensuring consistency across the entire backend codebase.

Core Features & Use Cases

  • Standardized Service Generation: Creates stateless service classes with OpenTelemetry tracing, CRUD operations, pagination support, and proper HTTP error handling aligned with existing project patterns.
  • Auto-Generated DTOs: Produces all required request/response DTOs, including paginated response types, following the project's i18n and field validation conventions.
  • Use Case: When adding a new "notification" resource to the Swiss AI-Hub API, use this skill to generate the full service layer and associated DTOs in seconds, matching existing code patterns exactly.

Quick Start

Use the scaffold-api-service skill to generate a service layer and DTOs for the new "workflow" resource.

Frequently Asked Questions about scaffold-api-service

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate a FastAPI service layer with MongoEngine without writing boilerplate?

You can generate a FastAPI service layer with MongoEngine by providing a resource name to automatically create stateless service classes with CRUD operations, pagination, and standardized HTTP error handling, eliminating manual boilerplate coding.

How do I add OpenTelemetry tracing to a new FastAPI backend resource automatically?

Adding OpenTelemetry tracing to a new FastAPI backend resource is automated by generating a service layer that includes built-in tracing integration, ensuring consistent observability across your codebase without manual instrumentation.

Does this API scaffolding tool generate request and response DTOs with i18n support?

Yes, this API scaffolding tool generates all required request and response DTOs, including paginated response types, while following your project's internationalization (i18n) and field validation conventions automatically.

Can I use this to scaffold a stateless service layer for an existing FastAPI project?

Yes, you can use this to scaffold a stateless service layer for an existing FastAPI project. It requires only a resource name as input and produces code that aligns with existing project patterns for tracing and error handling.

What is the best way to ensure consistent CRUD operations across a FastAPI backend codebase?

The best way to ensure consistent CRUD operations across a FastAPI backend codebase is to automate service layer generation, which enforces uniform operation patterns, stateless design, and standardized error handling for every new resource.

Are there limitations when scaffolding a FastAPI service layer with this automated approach?

The main limitation is that this automated scaffolding approach is specifically designed for FastAPI-based backend development using MongoEngine, requiring strict adherence to stateless service design and specific project conventions for DTO conversion and tracing.