Token导航 LogoToken导航TokenDH.com
开发操作浏览器github未标认证来源可访问许可证需确认审计提醒

frappe-impl-customappFrappe impl 定制应用程序

Agent Skill

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

总安装

618

周安装

26

GitHub Stars

87

下载量

216
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

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

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

简介

用于处理 GitHub 仓库、Issue 和 Pull Request 协作信息。

  • 适合在需要围绕仓库状态或代码变更进行整理时使用。frappe-impl-customapp 属于开发类 Skill,可作为该场景下的辅助能力补充。
  • 可结合来源仓库和原始 README 核验具体用法。
  • 安装前建议确认权限范围和维护状态,避免触发不必要操作。
  • 注意是否会触发联网、命令执行或文件读写,确保安全使用。

SKILL.md

Frappe Custom App - Implementation

Workflow for building a custom Frappe app from scratch. For exact syntax, see frappe-syntax-customapp.

Version: v14/v15/v16 compatible


Main Decision: Do You Need a Custom App?

WHAT CHANGES DO YOU NEED?
|
+-- Add fields to existing DocType?
|   +-- NO APP NEEDED: Custom Field + Property Setter
|
+-- Simple automation/validation (<50 lines)?
|   +-- NO APP NEEDED: Server Script or Client Script
|
+-- Complex business logic, new DocTypes, or Python code?
|   +-- YES: Create custom app
|
+-- Integration with external system (needs imports)?
|   +-- YES: Custom app REQUIRED (Server Scripts block imports)
|
+-- Custom reports with complex queries?
|   +-- Script Report (no app) vs Query Report (app optional)

Rule: ALWAYS start with the simplest solution. Server Scripts + Custom Fields solve 70% of needs without a custom app.


Step 1: Create App Structure

cd ~/frappe-bench
bench new-app my_app
# Prompts: Title, Description, Publisher, Email, License

ALWAYS verify immediately:

# my_app/my_app/__init__.py MUST have:
__version__ = "0.0.1"

Step 2: Configure pyproject.toml (v15+)

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

[project]
name = "my_app"
authors = [{ name = "Your Company", email = "dev@example.com" }]
description = "Your app description"
requires-python = ">=3.10"
readme = "README.md"
dynamic = ["version"]
dependencies = [
    "requests>=2.28.0"   # Only PyPI packages here
]

[tool.bench.frappe-dependencies]
frappe = ">=15.0.0,<16.0.0"
# erpnext = ">=15.0.0,<16.0.0"  # Only if needed

Rule: NEVER put frappe or erpnext in [project].dependencies -- they are NOT on PyPI.


Step 3: Configure hooks.py

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

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

fixtures = []  # Configured later

Rule: ALWAYS declare required_apps with all dependencies.


Step 4: Define Modules

# my_app/my_app/modules.txt
My App
App SizeModule Strategy
1-5 DocTypesONE module with app name
6-15 DocTypes2-4 modules by functional area
15+ DocTypesModules by business domain

Rule: Each DocType belongs to EXACTLY one module. Module name in modules.txt maps to directory: My Custom App --> my_custom_app/.

Adding a Module

mkdir -p my_app/my_app/new_module/doctype
touch my_app/my_app/new_module/__init__.py
# Add "New Module" to modules.txt
bench --site mysite migrate

Step 5: Install and Create DocTypes

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

# Create DocType (via UI recommended, or CLI)
bench --site mysite new-doctype "My Document" --module "My App"

This creates:

my_app/my_app/doctype/my_document/
+-- my_document.json    # DocType definition
+-- my_document.py      # Controller
+-- my_document.js      # Client script
+-- test_my_document.py # Tests

Step 6: Add Hooks

doc_events (v14/v15/v16)

doc_events = {
    "Sales Invoice": {
        "validate": "my_app.events.sales_invoice.validate",
        "on_submit": "my_app.events.sales_invoice.on_submit"
    }
}

extend_doctype_class (v16 ONLY -- preferred)

extend_doctype_class = {
    "Sales Invoice": "my_app.overrides.sales_invoice.CustomSalesInvoice"
}

Rule: ALWAYS call super().method() when overriding lifecycle methods in v16.

Scheduler Events

scheduler_events = {
    "daily": ["my_app.tasks.daily_cleanup"],
    "cron": {"0 9 * * 1-5": ["my_app.tasks.morning_report"]}
}

See frappe-impl-hooks and frappe-impl-scheduler for complete patterns.


Step 7: Add Patches

Create Patch File

mkdir -p my_app/my_app/patches/v1_0
touch my_app/my_app/patches/__init__.py
touch my_app/my_app/patches/v1_0/__init__.py
# my_app/my_app/patches/v1_0/populate_defaults.py
import frappe

def execute():
    if not frappe.db.has_column("My DocType", "target_field"):
        return  # Skip if not applicable

    batch_size = 1000
    offset = 0
    while True:
        records = frappe.get_all("My DocType",
            limit_page_length=batch_size, limit_start=offset)
        if not records:
            break
        for r in records:
            frappe.db.set_value("My DocType", r.name,
                "target_field", "default", update_modified=False)
        frappe.db.commit()
        offset += batch_size

Register in patches.txt

[pre_model_sync]
# Patches that run BEFORE schema changes (backup data from deleted fields)

[post_model_sync]
# Patches that run AFTER schema changes (populate new fields)
my_app.patches.v1_0.populate_defaults

Rules:

  • ALWAYS check if patch is needed (guard clause)
  • ALWAYS batch process 1000+ records
  • ALWAYS commit after each batch
  • NEVER run untested patches on production

Step 8: Fixtures Management

Configure in hooks.py

fixtures = [
    {"dt": "Custom Field", "filters": [["module", "=", "My App"]]},
    {"dt": "Property Setter", "filters": [["module", "=", "My App"]]},
    {"dt": "Role", "filters": [["name", "in", ["My App User", "My App Manager"]]]},
    {"dt": "Workflow", "filters": [["document_type", "=", "My DocType"]]},
    "My Category",  # All records of your own config DocType
]

Export and Verify

bench --site mysite export-fixtures --app my_app
ls my_app/my_app/fixtures/
# custom_field.json, property_setter.json, etc.

Rules:

  • ALWAYS filter fixtures to YOUR app's customizations
  • NEVER include transactional data (invoices, orders)
  • NEVER export without filters for shared DocTypes (Custom Field, Workflow)
  • Fixtures auto-import during bench migrate

Step 9: Development Workflow

Essential Commands

# After schema changes (DocType fields, hooks.py, patches)
bench --site mysite migrate

# After JS/CSS changes
bench build --app my_app

# After Python changes (controllers, events)
bench --site mysite clear-cache

# Full restart (production)
bench restart

# Watch mode (development)
bench watch  # Auto-rebuilds on file changes

Development Cycle

1. Edit code/DocType
2. bench --site mysite migrate (if schema changed)
3. bench build --app my_app (if JS/CSS changed)
4. bench --site mysite clear-cache (if Python changed)
5. Test in browser
6. Repeat

Step 10: Testing the App

# Run all tests
bench --site mysite run-tests --app my_app

# Run specific test
bench --site mysite run-tests --module my_app.my_module.doctype.my_doctype.test_my_doctype

# Run with verbose output
bench --site mysite run-tests --app my_app -v

See frappe-testing-unit for writing test cases.


Step 11: Packaging for Distribution

Via Git (standard method)

cd apps/my_app
git init && git add . && git commit -m "Initial commit"
git remote add origin https://github.com/org/my_app.git
git push -u origin main

Install on Another Site

# On target bench
bench get-app https://github.com/org/my_app.git
bench --site target-site install-app my_app
bench --site target-site migrate

Version Management

# my_app/my_app/__init__.py
__version__ = "1.0.0"  # Semantic versioning: MAJOR.MINOR.PATCH
Change TypeVersion BumpExample
Breaking changesMAJOR1.x -> 2.0.0
New featuresMINOR1.1.x -> 1.2.0
Bug fixesPATCH1.2.0 -> 1.2.1

Step 12: App Dependencies

Frappe/ERPNext Dependencies

# hooks.py
required_apps = ["frappe", "erpnext"]  # Install order matters
# pyproject.toml
[tool.bench.frappe-dependencies]
frappe = ">=15.0.0,<16.0.0"
erpnext = ">=15.0.0,<16.0.0"

Python Package Dependencies

[project]
dependencies = ["requests>=2.28.0", "pandas>=1.5.0"]

Rule: NEVER create circular dependencies between apps.


Version-Specific Considerations

Aspectv14v15v16
Build configsetup.pypyproject.tomlpyproject.toml
DocType extensiondoc_eventsdoc_eventsextend_doctype_class preferred
Python minimum3.103.103.11
Patch formatINI sectionsINI sectionsINI sections

v16 Breaking Changes to Know

  • extend_doctype_class hook: Cleaner extension via mixins
  • Data masking: Field-level privacy configuration
  • UUID naming: New naming rule option
  • Chrome PDF: wkhtmltopdf deprecated

Critical Rules Summary

ALWAYS

  1. Start with bench new-app - NEVER create structure manually
  2. Define __version__ in __init__.py
  3. Use dynamic = ["version"] in pyproject.toml
  4. Test patches on database copy before production
  5. Filter fixtures to your app's customizations only
  6. Version your patches (v1_0, v2_0 directories)
  7. Test installation on a fresh site

NEVER

  1. Put frappe/erpnext in [project].dependencies
  2. Include transactional data in fixtures
  3. Hardcode site-specific values (use settings DocTypes)
  4. Skip frappe.db.commit() in large patches
  5. Delete fields without backup patch
  6. Modify core ERPNext files directly

Reference Files

FileContents
workflows.md8 step-by-step implementation guides
decision-tree.mdComplete decision flowcharts
examples.md5 complete working app examples
anti-patterns.mdCommon mistakes to avoid

See Also

  • frappe-syntax-customapp - Exact syntax reference
  • frappe-syntax-hooks - Hooks configuration syntax
  • frappe-impl-hooks - Hook implementation patterns
  • frappe-core-database - Database operations for patches
  • frappe-impl-scheduler - Scheduled task implementation
  • frappe-ops-bench - Bench commands reference
  • frappe-ops-app-lifecycle - App versioning and release management
  • frappe-testing-unit - Writing tests for your app
  • frappe-testing-cicd - CI/CD pipeline for app testing

适合场景

01

用户想查找某类 Agent Skill 时

02

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

03

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

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

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

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

平台分布

Codex

36.4%
按下载量换算79

Claude

28.02%
按下载量换算61

Cursor

18.1%
按下载量换算39

Gemini CLI

9.55%
按下载量换算21

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

操作浏览器

该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

安装前确认

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

来源信息

继续浏览同类 Skills