Scaffold archipy logic
Skill SyntaxArc/archipy-plugin/skills/scaffold-archipy-logic
Scaffold an ArchiPy logic class with unit-of-work decorator and domain DTO I/O. Use when adding a use-case under logics/{domain}/.From its SKILL.md
npx -y skills add SyntaxArc/archipy-plugin --skill scaffold-archipy-logicAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 2 stars2 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
2.1 KB, as published. Nobody here has run it
Scaffold ArchiPy Logic
Before writing files
Ask the user for:
- Domain name (e.g.
user) - Logic name / file stem (e.g.
user_registration→user_registration_logic.py) - Sync or async atomic (default sync if
postgres+sqlalchemy; async ifpostgres+sqlalchemy-async)
Prefer ArchiPy
uv add "archipy[postgres,sqlalchemy]"
# or: uv add "archipy[postgres,sqlalchemy-async]"
Generate
logics/<domain>/
└── <name>_logic.py
Stub shape:
- Google-style class/method docstrings; double quotes;
X | Ytyping. - Constructor injects the domain repository (or port) — do not construct adapters.
- Public method: domain
*InputDTOin → domain*OutputDTOout. - Decorate with
postgres_sqlalchemy_atomic_decoratororasync_postgres_sqlalchemy_atomic_decorator.
from archipy.helpers.decorators.sqlalchemy_atomic import postgres_sqlalchemy_atomic_decorator
class UserRegistrationLogic:
"""Handles user registration within a single database transaction."""
def __init__(self, user_repository: UserRepository) -> None:
self._user_repository = user_repository
@postgres_sqlalchemy_atomic_decorator
def register_user(self, input_dto: UserRegistrationInputDTO) -> UserRegistrationOutputDTO:
"""Validate and create a user.
Args:
input_dto: Registration data from the service layer.
Returns:
Output DTO for the newly created user.
"""
...
Create missing domain DTO stubs under models/dtos/<domain>/domain/v1/ if they do not exist.
Constraints
- No FastAPI / gRPC imports.
- May call other domain logics; never another domain’s repository.
- No atomic / UoW decorators on repositories or services — only logics.
- Wire via DI in
configs/containers.py.