<< All versions
Skill v1.0.0
currentAutomated scan100/100syntaxarc/archipy-plugin/scaffold-service
──Details
PublishedSeptember 28, 2026 at 01:40 AM
Content Hashsha256:14f866b11a7a5275...
Git SHA
──Files
Files (1 file, 3.0 KB)
SKILL.md3.0 KBactive
SKILL.md · 89 lines · 3.0 KB
version: "1.0.0" name: scaffold-service description: >- Scaffold a thin FastAPI router or gRPC servicer under services/{domain}/v{n}/ with AppUtils bootstrap. Use for "add an endpoint/route/API", "expose via REST/gRPC", or "new API version".
Scaffold ArchiPy Service
Read first
Read these plugin rules in full before generating files (paths relative to this skill directory; Claude Code: ${CLAUDE_SKILL_DIR}/../../rules/):
../../rules/architecture-for-apps.mdc../../rules/using-archipy-services.mdc../../rules/config-and-di.mdc
Before writing files
- Inspect existing transports, domain DTOs/logics, app bootstrap, DI wiring, and service tests.
- Infer domain, API version, framework, and sync/async style when established by the repository.
- Ask only for unresolved choices. Default to
v1and FastAPI only when no project convention exists. - Preserve existing routes, servicers, and bootstrap code; integrate without overwriting.
Prefer ArchiPy
bash
uv add "archipy[fastapi]" # HTTPuv add "archipy[grpc]" # gRPC
Generate
text
services/<domain>/v{n}/└── <domain>_service.py
FastAPI
- Thin router: request → domain
*InputDTO→ logic →*OutputDTO. - Export
create_<domain>_v{n}_router(container)formanage.py/ app factory. - Map domain errors to HTTP status; no business rules / atomic UoW decorators here.
gRPC
- Thin servicer calling logic; sync servicers with
AppUtils.create_grpc_app, async withcreate_async_grpc_app. - Export
register_<domain>_v{n}_servicers(server, container)that adds the servicers to a server built by
AppUtils; the entrypoint and the BDD harness (/scaffold-bdd) both call it, so neither binds a port inside it.
- Do not mix sync/async servicer styles on one server.
Bootstrap (entrypoint)
Prefer AppUtils — do not hand-roll bare FastAPI() / grpc.server():
python
from archipy.helpers.utils.app_utils import AppUtilsfrom archipy.configs.base_config import BaseConfigapp = AppUtils.create_fastapi_app()app.include_router(create_<domain>_v1_router(container))
uvicorn in manage.py from config.FASTAPI (SERVE_HOST, SERVE_PORT, RELOAD, PROXY_HEADERS, FORWARDED_ALLOW_IPS).
Do not
- Version in path (
v1,v2), not in business logic. - Do not re-implement CORS/exception handlers/stock gRPC interceptors AppUtils already wires.
- Wire logic via DI container.
- Never hardcode host/port.
Verify
- Run the repository's formatter and linter on generated Python.
- Run the Behave scenarios that exercise the route/servicer through the BDD harness (
/scaffold-bdd); add one
when the endpoint is new.
- Confirm route/servicer registration, DTO mapping, domain-error mapping, and DI resolution.
- Run the
archipy-reviewersubagent on the changes and fix every Must fix finding it reports. - Report files, dependency changes, and commands run.
Docs
- https://syntaxarc.github.io/ArchiPy/getting-started/project_structure/
- https://syntaxarc.github.io/ArchiPy/tutorials/helpers/