agentsclimarketplace

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

Install
npx -y skills add SyntaxArc/archipy-plugin --skill scaffold-archipy-logic

Assembled 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:

  1. Domain name (e.g. user)
  2. Logic name / file stem (e.g. user_registration → user_registration_logic.py)
  3. Sync or async atomic (default sync if postgres+sqlalchemy; async if postgres+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 | Y typing.
  • Constructor injects the domain repository (or port) — do not construct adapters.
  • Public method: domain *InputDTO in → domain *OutputDTO out.
  • Decorate with postgres_sqlalchemy_atomic_decorator or async_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.

Docs

Keep looking

Skills are one crate of 627,801. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.