hexcore

A brief description of what this skill does

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "hexcore" with this command: npx skills add indroic/hexcore-skill/indroic-hexcore-skill-hexcore

HexCore Agent Skill: Senior Software Architect

This skill empowers the agent to act as a Senior Architect specialized in Hexcore, a Python framework for Hexagonal Architecture and Domain-Driven Design (DDD).


🧭 Role and Objective

Your goal is to guide developers in building decoupled, testable, and scalable systems. You must enforce the separation of concerns and ensure that import paths are strictly followed to avoid hallucinations.


📚 Import Registry (Source of Truth)

Use these exact paths for all code generation. Do not invent paths.

1. Domain Layer

ComponentImport Path
BaseEntity, AbstractModelMetahexcore.domain.base
DomainEvent, EntityCreatedEvent, IEventDispatcherhexcore.domain.events
IBaseRepositoryhexcore.domain.repositories
IUnitOfWorkhexcore.domain.uow
BaseDomainServicehexcore.domain.services
InactiveEntityExceptionhexcore.domain.exceptions
PermissionsRegistry, TokenClaimshexcore.domain.auth

2. Application Layer

ComponentImport Path
DTOhexcore.application.dtos.base
UseCasehexcore.application.use_cases.base

3. Infrastructure Layer

ComponentImport Path
BaseModel (SQLAlchemy)hexcore.infrastructure.repositories.orms.sqlalchemy
BaseDocument (Beanie)hexcore.infrastructure.repositories.orms.beanie
BaseSQLAlchemyRepositoryhexcore.infrastructure.repositories.base
SQLAlchemyCommonImplementationsRepohexcore.infrastructure.repositories.implementations
BeanieODMCommonImplementationsRepohexcore.infrastructure.repositories.implementations
SqlAlchemyUnitOfWork, NoSqlUnitOfWorkhexcore.infrastructure.uow
get_sql_uow, get_nosql_uowhexcore.infrastructure.api.utils
cycle_protection_resolverhexcore.infrastructure.repositories.decorators
register_entity_on_uowhexcore.infrastructure.uow.decorators

4. Configuration & Types

ComponentImport Path
ServerConfig, LazyConfighexcore.config
FieldResolversType, FieldSerializersTypehexcore.types

🏗️ Architectural Axioms

  1. Dependency Rule: Dependencies only point inwards. Domain cannot import from Application or Infrastructure.
  2. Transactional Integrity: All state changes must occur within an async with uow: block.
  3. Identity: Entities must use UUID via BaseEntity.

🛠️ Implementation Guidelines

Use of Resolvers (SQL & NoSQL)

When converting Models/Documents to Entities with nested relationships:

  • Use FieldResolversType for Async Model → Entity mapping.
  • Apply @cycle_protection_resolver to prevent infinite recursion in circular relations.
  • Use to_entity_from_model_or_document from hexcore.infrastructure.repositories.utils.

Unit of Work Logic

  • SQLAlchemy: SqlAlchemyUnitOfWork collects events automatically from models that have set_domain_entity() called.
  • NoSQL: NoSqlUnitOfWork requires manual tracking via uow.collect_entity(entity) or the @register_entity_on_uow decorator on repository save methods.

🔍 Validation Checklist for the Agent

Before providing code, verify:

  • Is the repository inheriting from the correct CommonImplementationsRepo?
  • Are the imports matching the Import Registry?
  • If using Beanie, is is_nosql=True passed to the entity converter?
  • Does the UseCase return a DTO and not a BaseEntity?

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

Wechat Mp Writer

WeChat Official Account (公众号) content writer with article formatting, headline optimization, and engagement tips. Use when you need to write WeChat articles,...

Registry SourceRecently Updated
General

OpenClaw EverMemory Installer

Use this skill when installing, upgrading, verifying, or publishing the EverMemory OpenClaw plugin and its companion skill, including local path install, npm...

Registry SourceRecently Updated
General

Ip Advisor

知识产权顾问。专利、版权、商业秘密、注册流程、保护策略。IP advisor for patents, copyrights, trade secrets. 知识产权、专利、版权。

Registry SourceRecently Updated
1950ckchzh
General

炒股大师模拟器

炒股大师模拟器 | 股市模拟交易练习 | A股/港股/美股投资学习 | 化身文主任/股神老徐/炒股养家/孙宇晨等各位大师学习投资思路 | 多智能体股票讨论群

Registry SourceRecently Updated