ModelKG Service Scaffold
Overview
Create a new backend service with the standard ModelKG structure, wiring, and conventions. Use this skill to keep new services consistent with existing ones.
Workflow
- Decide the service name, port, and API prefix.
- Scaffold files from the template (script or manual copy).
- Wire Docker Compose and gateway routing.
- Add the service to OpenAPI aggregation (if external consumers need it).
- Run and verify health + OpenAPI.
Quick Start (recommended)
Run the scaffold script from the repo root:
python skills_proposal/modelkg-service-scaffold/scripts/scaffold_service.py \
--name collaboration-engine \
--port 8006 \
--api-prefix /api/collaboration
This writes to backend/services/<name> and fills placeholders in the template.
Manual Scaffold (if needed)
Copy assets/service-template/ into backend/services/<name> and replace:
__SERVICE_NAME__
__SERVICE_PORT__
__API_PREFIX__
Wiring & Validation
- Follow
references/compose-gateway.md for Compose and Traefik labels.
- Follow
references/openapi-aggregation.md if the service should appear in /api/openapi.json.
- Use
references/service-checklist.md as the final checklist.
Resources
- scripts/
scaffold_service.py: creates a service folder from the template.
- references/
service-checklist.md: post-scaffold checklist.
compose-gateway.md: Compose and gateway routing snippets.
openapi-aggregation.md: how to add a service to the aggregated spec.
- assets/
service-template/: Dockerfile, requirements, and FastAPI skeleton.