EspoCRM Development

Enforce EspoCRM architectural patterns for custom module development.

Updated Jan 30, 2026
One-click install
npx skills add https://github.com/MacPhobos/research-mind --skill espocrm-development-macphobos
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: EspoCRM Development
Source: https://github.com/MacPhobos/research-mind/tree/main/.claude/skills/toolchains-php-frameworks-espocrm
Command: npx skills add https://github.com/MacPhobos/research-mind --skill espocrm-development-macphobos

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill prevents common development mistakes in EspoCRM by enforcing architectural patterns, ensuring business logic is in Services, data access is via EntityManager, and Container dependencies are not passed directly.

Core Features & Use Cases

  • Architectural Enforcement: Guides developers to follow EspoCRM's core principles.
  • Service Layer Logic: Ensures business logic resides in Service classes.
  • ORM Data Access: Mandates the use of EntityManager for all database operations.
  • Hook System: Promotes correct implementation of hooks using interfaces for lifecycle events.
  • Use Case: When developing a new custom entity and its associated business logic, activate this Skill to ensure all logic is correctly placed in a Service class and data is accessed through the EntityManager, preventing common anti-patterns.

Quick Start

Activate this skill when developing custom EspoCRM modules to ensure adherence to architectural principles.

Frequently Asked Questions about EspoCRM Development

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I enforce EspoCRM architectural patterns when developing custom modules?

To enforce EspoCRM architectural patterns, place business logic in Service classes, access data via EntityManager, and implement hooks using interfaces. This prevents anti-patterns like passing Container dependencies directly or bypassing the ORM layer.

Where should business logic reside in EspoCRM custom entity development?

Business logic in EspoCRM should reside strictly within Service classes. The Service layer handles core operations, ensuring separation from data access logic, which is managed entirely through the EntityManager and ORM system.

Why avoid passing Container dependencies directly in EspoCRM development?

Passing Container dependencies directly in EspoCRM creates tight coupling and anti-patterns. Correct development injects specific dependencies into Services, maintaining architectural integrity and ensuring business logic remains testable and decoupled from the framework core.

Does EspoCRM require EntityManager for all database operations?

Yes, EspoCRM requires EntityManager for all database operations. Bypassing the ORM to access the database directly breaks architectural patterns, removes lifecycle hook triggering, and prevents proper data access abstraction within custom modules.

What is the correct way to implement the hook system in EspoCRM?

The correct way to implement the EspoCRM hook system is by using interfaces for entity lifecycle events. This ensures hooks integrate properly with the ORM and Service layer, maintaining predictable execution when business logic triggers data changes.