Agent skill

Espocrm Development

by bobmatnyc in bobmatnyc/claude-mpm

Comprehensive guide for developing on EspoCRM - metadata-driven CRM with service layer architecture

MITAuto-check passedSales & Support

Install Espocrm Development

skills CLI
$ npx skills add bobmatnyc/claude-mpm --skill espocrm-development -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install bobmatnyc/claude-mpm espocrm-development --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/bobmatnyc/claude-mpm.git skills-src && mkdir -p .claude/skills && cp -r skills-src/src/claude_mpm/skills/bundled/php/espocrm-development .claude/skills/espocrm-development && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
espocrm-development
GitHub stars
155
Token cost
~1.7k tokens
SKILL.md length
476 words
Files
7 (incl. references)
Skills in repo
52
Repo updated
First seen
Licence
MIT

At a glance

Comprehensive guide for developing on EspoCRM - metadata-driven CRM with service layer architecture

  • Works in 6 steps: Metadata-Driven: Entity definitions,… → Service Layer: All business logic… → ORM EntityManager: Central access point… → …
  • Sales & Support work in your project
  • SKILL.md covers Overview, When to Use This Skill, The Iron Law and Core Architecture Principles, plus 7 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Espocrm Development is an agent skill from bobmatnyc/claude-mpm. Comprehensive guide for developing on EspoCRM - metadata-driven CRM with service layer architecture

Its SKILL.md is about 1.7k tokens, which your agent loads only when the skill is triggered. The skill folder holds 7 other files, including reference files (for example `references/architecture.md`, `references/common-tasks.md` and `references/development-workflow.md`).

It sits in Sales & Support. It works with PHP. The repository describes itself as: Claude Multi-Agent Project Manager — multi-channel orchestration, GitHub-first SDK mode, and plugin system for Claude. The licence is MIT.

When your agent uses it

  • Sales & Support work in your project

Example prompts

  • “/espocrm-development”

Workflow steps

6 steps, taken from the first numbered list in SKILL.md.

  1. Metadata-Driven: Entity definitions, layouts, field configs live in JSON
  2. Service Layer: All business logic implemented in Service classes
  3. ORM EntityManager: Central access point for all database operations
  4. Dependency Injection: Constructor injection, never pass Container
  5. Hook System: Lifecycle events for validation and side effects (not business logic)
  6. Repository Pattern: Entities accessed through repositories

What it can do on your machine

Read from SKILL.md and the folder at commit 25203d3. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are php and bash).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Espocrm Development loads about 1.7k tokens when it runs, and up to ~29k if it reads all its reference files. Until then it costs about 30 tokens; SKILL.md has 476 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~30
When it runs · the whole SKILL.md, loaded when a task matches
~1.7k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~29k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from bobmatnyc/claude-mpm at commit 25203d3, republished under its MIT licence (© bobmatnyc). 476 words, ~1,695 tokens.

Download SKILL.mdSave it as .claude/skills/espocrm-development/SKILL.md (or your agent's skills folder). This skill also uses 6 other files; get the full folder from GitHub.
name
espocrm-development
description
Comprehensive guide for developing on EspoCRM - metadata-driven CRM with service layer architecture
version
1.0.0
category
development
author
Claude MPM Team
license
MIT
progressive_disclosure.references
architecture.md, development-workflow.md, hooks-and-services.md, frontend-customization.md, common-tasks.md, testing-debugging.md
context_limit
800
tags
espocrm, php, crm, metadata-driven, orm
effort
high

EspoCRM Development

Overview

EspoCRM is a metadata-driven CRM platform where configuration lives in JSON files, business logic belongs in Services, and data access happens through ORM EntityManager. This skill enforces architectural patterns to prevent common mistakes like passing Container dependencies, bypassing the service layer, or implementing business logic in hooks.

When to Use This Skill

Activate when developing custom EspoCRM modules, entities, relationships, hooks, services, API endpoints, or integrations. Use especially when: working with ORM (EntityManager required), implementing business logic (belongs in Services), creating hooks (use interfaces), modifying metadata (requires cache rebuild), or building custom field types.

The Iron Law

BUSINESS LOGIC IN SERVICES, NOT HOOKS | DATA ACCESS VIA ENTITYMANAGER, NEVER DIRECT PDO | NEVER PASS CONTAINER AS DEPENDENCY

If you're accessing Container directly or writing business logic in hooks, you're violating architecture.

Core Architecture Principles

  1. Metadata-Driven: Entity definitions, layouts, field configs live in JSON
  2. Service Layer: All business logic implemented in Service classes
  3. ORM EntityManager: Central access point for all database operations
  4. Dependency Injection: Constructor injection, never pass Container
  5. Hook System: Lifecycle events for validation and side effects (not business logic)
  6. Repository Pattern: Entities accessed through repositories

Quick Start

  1. Setup Development Environment - Use ext-template, work in src/ directory (EspoCRM 7.4+), understand metadata structure: custom/Espo/Modules/{ModuleName}/Resources/metadata/

  2. Access Data with EntityManager

    php
    use Espo\ORM\EntityManager;
    
    public function __construct(private EntityManager $entityManager) {}
    
    // Find entity
    $account = $this->entityManager->getEntityById('Account', $id);
    
    // Query with conditions
    $collection = $this->entityManager
        ->getRDBRepository('Contact')
        ->where(['accountId' => $accountId])
        ->find();
  3. Implement Business Logic in Services

    php
    namespace Espo\Modules\MyModule\Services;
    
    use Espo\Services\Record;
    
    class MyEntity extends Record {
        public function customAction(string $id, object $data): object {
            // Business logic here
            $entity = $this->entityManager->getEntityById($this->entityType, $id);
            // ... process ...
            $this->entityManager->saveEntity($entity);
            return $entity;
        }
    }
  4. Register Hooks for Lifecycle Events

    php
    namespace Espo\Modules\MyModule\Hooks\Account;
    
    use Espo\ORM\Entity;
    use Espo\Core\Hook\Hook\BeforeSave;
    
    class MyHook implements BeforeSave {
        public function beforeSave(Entity $entity, array $options): void {
            // Validation or side effects only
            if ($entity->isAttributeChanged('status')) {
                // React to changes
            }
        }
    }
  5. Rebuild Cache After Changes

    bash
    bin/command rebuild

Hook Types (Interfaces)

EspoCRM provides 7 hook types - ALWAYS use interfaces: BeforeSave (validation before save), AfterSave (side effects after save), BeforeRemove (validation before delete), AfterRemove (cleanup after delete), AfterRelate (relationship creation), AfterUnrelate (relationship removal), AfterMassRelate (bulk relationship operations).

Show full SKILL.md (205 more words)Show less

Navigation

For detailed information:

  • Architecture: Metadata system, ORM, DI container, repository pattern, and core architectural patterns
  • Development Workflow: Module creation, custom entities, fields, APIs, and extension development process
  • Hooks and Services: Service layer implementation, hook types, dependency injection, and business logic patterns
  • Frontend Customization: View system, client-side development, and UI customization
  • Common Tasks: Scheduled jobs, emails, PDFs, ACL, workflows, and integration patterns
  • Testing and Debugging: Unit tests, debugging techniques, performance optimization, and common pitfalls

Key Patterns

Correct Pattern:

php
✅ Service with injected dependencies
✅ EntityManager for data access
✅ Hooks using interfaces
✅ Type declarations on all methods
✅ Exceptions for error handling

Incorrect Patterns:

php
❌ Passing Container as dependency
❌ Direct PDO database access
❌ Business logic in hooks
❌ Hook base classes instead of interfaces
❌ Missing type declarations

Common Mistakes to Avoid

  • Never pass Container - Inject specific dependencies instead
  • Don't bypass EntityManager - Use ORM, not raw queries
  • Business logic doesn't belong in hooks - Use Services
  • Always rebuild cache - After metadata changes (bin/command rebuild)
  • Use interfaces for hooks - Not base classes
  • Type everything - PHP 7.4+ requires type declarations
  • Throw exceptions - Don't return booleans for errors

Integration with Other Skills

  • systematic-debugging: Debug EspoCRM issues using logs and step debugging
  • verification-before-completion: Always test with cache rebuild before claiming complete
  • test-driven-development: Write unit tests for Services and hooks

The Bottom Line

EspoCRM is metadata-driven with a service layer architecture.

Understand the metadata system. Use EntityManager for data. Implement business logic in Services. Use hooks for lifecycle events only. Rebuild cache after changes.

This is the EspoCRM way.

© bobmatnyc, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 6 other files (references) in src/claude_mpm/skills/bundled/php/espocrm-development of bobmatnyc/claude-mpm.

  • SKILL.md
  • references/architecture.md
  • references/common-tasks.md
  • references/development-workflow.md
  • references/frontend-customization.md
  • references/hooks-and-services.md
  • references/testing-debugging.md

Open the folder on GitHubat commit 25203d3

Compare with similar skills

Espocrm Development next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Espocrm Development compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Espocrm Development this skillbobmatnyc/claude-mpm155—~1.7kAutomated safety check: PassMIT
Skill Doli DevmoduleDolibarr/dolibarr7.7k1 repos~3.3kAutomated safety check: PassMIT
Skill Doli DevDolibarr/dolibarr7.7k—~2.9kAutomated safety check: PassMIT
Skeeks Cmsskeeks-cms/cms138—~4.4kAutomated safety check: PassBSD-3-Clause
Skill Doli Test PhpunitDolibarr/dolibarr7.7k1 repos~1.3kAutomated safety check: PassMIT
Deskcomm Extensaomelgarafael/DeskcommCRM4.5k—~2.7kAutomated safety check: PassMIT

Similar skills

  • Skill Doli Devmodule

    Dolibarr/dolibarr

    A skill your agent uses when developing a Dolibarr ERP/CRM external module, working with database queries, or asking about Dolibarr best practices.

    7.7k GitHub starsUsed in 1 repo~3.3k tokens
    Sales & SupportAuto-check passed
  • Skill Doli Dev

    Dolibarr/dolibarr

    A skill your agent uses when developing Dolibarr ERP/CRM code, working with database queries, or asking about Dolibarr best practices.

    7.7k GitHub stars~2.9k tokensUpdated today
    Sales & SupportAuto-check passed
  • Skeeks Cms

    skeeks-cms/cms

    Develop SkeekS CMS/Yii PHP code and handle advanced or unfamiliar site content, AI-managed themes and HTML pages, shop, MCP, REST and OAuth2 workflows.

    138 GitHub stars~4.4k tokensUpdated today
    Sales & SupportAuto-check passed
  • Skill Doli Test Phpunit

    Dolibarr/dolibarr

    Creates or modify PHP unit tests for Dolibarr ERP/CRM functions and methods.

    7.7k GitHub starsUsed in 1 repo~1.3k tokens
    Testing & QAAuto-check passed
  • Deskcomm Extensao

    melgarafael/DeskcommCRM

    Guia para criar uma extensão do DeskcommCRM — o pacote declarativo — em vez de abrir um PR no núcleo.

    4.5k GitHub stars~2.7k tokensUpdated today
    Sales & SupportAuto-check passed
  • Zsxq

    unnoo/zsxq-skill

    知识星球 CLI(zsxq-cli)与底层接口完整操作指南,涵盖星球和内容管理、Skill Pay 微信支付场景。当用户提到知识星球、zsxq、小密圈、星球、登录/认证、发帖、评论、回答、编辑、删除主题、定时发布/定时任务/定时回答、投票、问答主题、markdown 正文、AI…

    304 GitHub stars~3.8k tokensUpdated 17 days ago
    Sales & SupportAuto-check passed

More from bobmatnyc/claude-mpm

All 52 skills in this repo
  • Build MCP Server

    bobmatnyc/claude-mpm

    Create high-quality MCP servers that enable LLMs to effectively interact with external services.

    155 GitHub stars~2k tokensUpdated 1 mo ago
    Auto-check passed
  • Env Manager

    bobmatnyc/claude-mpm

    Environment variable validation, synchronization, and management across local development, CI/CD, and deployment platforms

    155 GitHub stars~2k tokensUpdated 1 mo ago
    Auto-check: notes
  • Session Analyzer

    bobmatnyc/claude-mpm

    Debug and teach agentic coding: a deterministic-first session timeline + cost report, with optional narrative polish and a standalone JSX visualiser.

    155 GitHub stars~2.2k tokensUpdated 1 mo ago
    Auto-check passed
  • Software Patterns

    bobmatnyc/claude-mpm

    Decision framework for architectural patterns including DI, SOA, Repository, Domain Events, Circuit Breaker, and Anti-Corruption Layer.

    155 GitHub stars~1.8k tokensUpdated 1 mo ago
    Auto-check passed
  • Verification Before Completion

    bobmatnyc/claude-mpm

    Run verification commands and confirm output before claiming success

    155 GitHub starsUsed in 2 repos~1k tokens
    Auto-check passed
  • Dependency Audit

    bobmatnyc/claude-mpm

    Dependency audit and cleanup workflow for maintaining healthy project dependencies.

    155 GitHub stars~3.5k tokensUpdated 1 mo ago
    Auto-check passed

Works with

Categories

Questions about Espocrm Development

What does Espocrm Development do?

Comprehensive guide for developing on EspoCRM - metadata-driven CRM with service layer architecture. Espocrm Development is an agent skill from bobmatnyc/claude-mpm.

When should I use Espocrm Development?

Espocrm Development fits situations like: sales & Support work in your project.

How do I install Espocrm Development in Claude Code?

Run `npx skills add bobmatnyc/claude-mpm --skill espocrm-development -a claude-code`. Or copy the skill folder (src/claude_mpm/skills/bundled/php/espocrm-development in bobmatnyc/claude-mpm) into .claude/skills/espocrm-development in your project. Claude Code loads it when a task matches its description.

How do I install Espocrm Development in Codex?

Run `npx skills add bobmatnyc/claude-mpm --skill espocrm-development -a codex`. Or copy the skill folder (src/claude_mpm/skills/bundled/php/espocrm-development in bobmatnyc/claude-mpm) into .agents/skills/espocrm-development in your project. Codex loads it when a task matches its description.

Can I use Espocrm Development in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add bobmatnyc/claude-mpm --skill espocrm-development -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/espocrm-development, .gemini/skills/espocrm-development, .github/skills/espocrm-development and .opencode/skills/espocrm-development in your project.

What does Espocrm Development need to run?

SKILL.md names no scripts, command-line tools or credentials: Espocrm Development is instructions for the agent only.

Does Espocrm Development access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Espocrm Development safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Espocrm Development use?

Espocrm Development is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Espocrm Development use?

About 1.7k tokens (SKILL.md is roughly 6.8k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 27k tokens, read only when the agent opens those files.

What are the alternatives to Espocrm Development?

Skills that share tags, products or a category with Espocrm Development: Skill Doli Devmodule (Dolibarr/dolibarr, 7.7k stars), Skill Doli Dev (Dolibarr/dolibarr, 7.7k stars), Skeeks Cms (skeeks-cms/cms, 138 stars) and Skill Doli Test Phpunit (Dolibarr/dolibarr, 7.7k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Espocrm Development?

bobmatnyc (a GitHub user) maintains it in bobmatnyc/claude-mpm, which has 155 GitHub stars. The repository holds 52 skills in this directory. The repository was last updated on August 31, 2026.

Source: bobmatnyc/claude-mpm on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.