Token导航 LogoToken导航TokenDH.com
开发需要联网github未标认证来源可访问许可证需确认审计通过

erpnext-syntax-customapperpnext 语法 customapp

Agent Skill

erpnext-syntax-customapp 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

1,152

周安装

48

GitHub Stars

87

下载量

384
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:erpnext-syntax-customapp(erpnext 语法 customapp)
来源仓库:https://github.com/openaec-foundation/erpnext_anthropic_claude_development_skill_package
仓库路径:skills/erpnext-syntax-customapp
安装命令:
npx skills add https://github.com/openaec-foundation/erpnext_anthropic_claude_development_skill_package --skill erpnext-syntax-customapp
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/openaec-foundation/erpnext_anthropic_claude_development_skill_package --skill erpnext-syntax-customapp

简介

提供自定义应用的完整语法规范,包括 build 配置、模块划分与迁移脚本写法。

  • 适用于 Codex、Claude、Cursor、Gemini CLI 中组织大型 ERPNext 扩展项目。
  • 包含 patches 与 fixtures 的 YAML 格式要求及依赖声明方式。
  • 使用前需熟悉 bench 工具链,确保 app 目录结构与命名符合规范。
  • erpnext-syntax-customapp 属于开发类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

ERPNext Custom App Syntax Skill

Complete syntax for building Frappe custom apps in v14/v15, including build configuration, module organization, patches and fixtures.

When to Use This Skill

USE this skill when you:

  • Create a new Frappe/ERPNext custom app
  • Configure pyproject.toml or setup.py
  • Organize modules within an app
  • Write database migration patches
  • Configure fixtures for data export/import
  • Manage app dependencies

DO NOT USE for:

  • DocType controllers (use erpnext-syntax-controllers)
  • Client Scripts (use erpnext-syntax-clientscripts)
  • Server Scripts (use erpnext-syntax-serverscripts)
  • Hooks configuration (use erpnext-syntax-hooks)

App Structure Overview

v15 (pyproject.toml - Primary)

apps/my_custom_app/
├── pyproject.toml                     # Build configuration
├── README.md
├── my_custom_app/                     # Main package
│   ├── __init__.py                    # MUST contain __version__!
│   ├── hooks.py                       # Frappe integration
│   ├── modules.txt                    # Module registration
│   ├── patches.txt                    # Migration scripts
│   ├── patches/                       # Patch files
│   ├── my_custom_app/                 # Default module
│   │   └── doctype/
│   ├── public/                        # Client assets
│   └── templates/                     # Jinja templates
└── .git/
See: references/structure.md for complete directory structure.

Critical Files

init.py (REQUIRED)

# my_custom_app/__init__.py
__version__ = "0.0.1"

CRITICAL: Without __version__ the flit build fails!

pyproject.toml (v15)

[build-system]
requires = ["flit_core >=3.4,<4"]
build-backend = "flit_core.buildapi"

[project]
name = "my_custom_app"
authors = [
    { name = "Your Company", email = "dev@example.com" }
]
description = "Description of your app"
requires-python = ">=3.10"
readme = "README.md"
dynamic = ["version"]
dependencies = []

[tool.bench.frappe-dependencies]
frappe = ">=15.0.0,<16.0.0"
erpnext = ">=15.0.0,<16.0.0"
See: references/pyproject-toml.md for all configuration options.

Modules

modules.txt

My Custom App
Integrations
Settings
Reports

Rules:

  • One module per line
  • Spaces in name → underscores in directory
  • Every DocType MUST belong to a module

Module Directory

my_custom_app/
├── my_custom_app/       # "My Custom App" module
│   ├── __init__.py      # REQUIRED
│   └── doctype/
├── integrations/        # "Integrations" module
│   ├── __init__.py      # REQUIRED
│   └── doctype/
└── settings/            # "Settings" module
    ├── __init__.py      # REQUIRED
    └── doctype/
See: references/modules.md for module organization.

Patches (Migration Scripts)

patches.txt with INI Sections

[pre_model_sync]
# Before schema sync - old fields still available
myapp.patches.v1_0.backup_old_data

[post_model_sync]
# After schema sync - new fields available
myapp.patches.v1_0.populate_new_fields
myapp.patches.v1_0.cleanup_data

Patch Implementation

# myapp/patches/v1_0/populate_new_fields.py
import frappe

def execute():
    """Populate new fields with default values."""

    batch_size = 1000
    offset = 0

    while True:
        records = frappe.get_all(
            "MyDocType",
            filters={"new_field": ["is", "not set"]},
            fields=["name"],
            limit_page_length=batch_size,
            limit_start=offset
        )

        if not records:
            break

        for record in records:
            frappe.db.set_value(
                "MyDocType",
                record.name,
                "new_field",
                "default_value",
                update_modified=False
            )

        frappe.db.commit()
        offset += batch_size

When Pre vs Post Model Sync?

SituationSection
Migrate data from old field[pre_model_sync]
Populate new fields[post_model_sync]
Data cleanup[post_model_sync]
See: references/patches.md for complete patch documentation.

Fixtures

hooks.py Configuration

fixtures = [
    # All records
    "Category",

    # With filter
    {
        "dt": "Custom Field",
        "filters": [["module", "=", "My Custom App"]]
    },

    # Multiple filters
    {
        "dt": "Property Setter",
        "filters": [
            ["module", "=", "My Custom App"],
            ["doc_type", "in", ["Sales Invoice", "Sales Order"]]
        ]
    }
]

Exporting

bench --site mysite export-fixtures --app my_custom_app

Common Fixture DocTypes

DocTypeUsage
Custom FieldCustom fields on existing DocTypes
Property SetterModify field properties
RoleCustom roles
WorkflowWorkflow definitions
See: references/fixtures.md for fixture configuration.

Minimal hooks.py

app_name = "my_custom_app"
app_title = "My Custom App"
app_publisher = "Your Company"
app_description = "Description"
app_email = "dev@example.com"
app_license = "MIT"

required_apps = ["frappe"]  # Or ["frappe", "erpnext"]

fixtures = [
    {"dt": "Custom Field", "filters": [["module", "=", "My Custom App"]]}
]

Creating and Installing App

# Create new app
bench new-app my_custom_app

# Install on site
bench --site mysite install-app my_custom_app

# Migrate (patches + fixtures)
bench --site mysite migrate

# Build assets
bench build --app my_custom_app

Version Differences

Aspectv14v15
Build configsetup.pypyproject.toml
Dependenciesrequirements.txtIn pyproject.toml
Build backendsetuptoolsflit_core
Python minimum>=3.10>=3.10
INI patches

Critical Rules

✅ ALWAYS

  1. Define __version__ in __init__.py
  2. Add dynamic = ["version"] in pyproject.toml
  3. Register modules in modules.txt
  4. Include __init__.py in EVERY directory
  5. Put Frappe dependencies in [tool.bench.frappe-dependencies]
  6. Add error handling in patches
  7. Use batch processing for large datasets

❌ NEVER

  1. Put Frappe/ERPNext in project dependencies (not on PyPI)
  2. Create patches without error handling
  3. Include user/transactional data in fixtures
  4. Hardcode site-specific values
  5. Process large datasets without batching

Fixtures vs Patches

WhatFixturesPatches
Custom Fields
Property Setters
Roles/Workflows
Data transformation
Data cleanup
One-time migration

Reference Files

FileContents
references/structure.mdComplete directory structure
references/pyproject-toml.mdBuild configuration options
references/modules.mdModule organization
references/patches.mdMigration scripts
references/fixtures.mdData export/import
references/examples.mdComplete app examples
references/anti-patterns.mdMistakes to avoid

See Also

  • erpnext-syntax-hooks - For hooks.py configuration
  • erpnext-syntax-controllers - For DocType controllers
  • erpnext-impl-customapp - For implementation patterns

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

36.77%
按下载量换算141

Claude

29.02%
按下载量换算111

Cursor

19.98%
按下载量换算77

Gemini CLI

10.63%
按下载量换算41

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills