xiaohongshu
xiaohongshu
erpnext-syntax-customapp
Deterministic syntax for building Frappe custom apps including app structure, pyproject.toml, modules, patches and fixtures
Full skill instructions
Complete syntax for building Frappe custom apps in v14/v15, including build configuration, module organization, patches and fixtures.
USE this skill when you:
DO NOT USE for:
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.mdfor complete directory structure.
# my_custom_app/__init__.py
__version__ = "0.0.1"
CRITICAL: Without __version__ the flit build fails!
[build-system]
requires = ["flit_core >=3.4,<4"]
build-backend = "flit_core.buildapi"
[project]
name = "my_custom_app"
authors = [
{ name = "Your Company", email = "[email protected]" }
]
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.mdfor all configuration options.
My Custom App
Integrations
Settings
Reports
Rules:
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.mdfor module organization.
[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
# 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
| Situation | Section |
|---|---|
| Migrate data from old field | [pre_model_sync] |
| Populate new fields | [post_model_sync] |
| Data cleanup | [post_model_sync] |
See:
references/patches.mdfor complete patch documentation.
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"]]
]
}
]
bench --site mysite export-fixtures --app my_custom_app
| DocType | Usage |
|---|---|
Custom Field | Custom fields on existing DocTypes |
Property Setter | Modify field properties |
Role | Custom roles |
Workflow | Workflow definitions |
See:
references/fixtures.mdfor fixture configuration.
app_name = "my_custom_app"
app_title = "My Custom App"
app_publisher = "Your Company"
app_description = "Description"
app_email = "[email protected]"
app_license = "MIT"
required_apps = ["frappe"] # Or ["frappe", "erpnext"]
fixtures = [
{"dt": "Custom Field", "filters": [["module", "=", "My Custom 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
| Aspect | v14 | v15 |
|---|---|---|
| Build config | setup.py | pyproject.toml |
| Dependencies | requirements.txt | In pyproject.toml |
| Build backend | setuptools | flit_core |
| Python minimum | >=3.10 | >=3.10 |
| INI patches | ✅ | ✅ |
__version__ in __init__.pydynamic = ["version"] in pyproject.tomlmodules.txt__init__.py in EVERY directory[tool.bench.frappe-dependencies]| What | Fixtures | Patches |
|---|---|---|
| Custom Fields | ✅ | ❌ |
| Property Setters | ✅ | ❌ |
| Roles/Workflows | ✅ | ❌ |
| Data transformation | ❌ | ✅ |
| Data cleanup | ❌ | ✅ |
| One-time migration | ❌ | ✅ |
| File | Contents |
|---|---|
references/structure.md | Complete directory structure |
references/pyproject-toml.md | Build configuration options |
references/modules.md | Module organization |
references/patches.md | Migration scripts |
references/fixtures.md | Data export/import |
references/examples.md | Complete app examples |
references/anti-patterns.md | Mistakes to avoid |
erpnext-syntax-hooks - For hooks.py configurationerpnext-syntax-controllers - For DocType controllerserpnext-impl-customapp - For implementation patternsxiaohongshu
technical spec
product ux expert
database patterns
Conduct multi-agent task orchestration and workflow coordination.
Initialize project with Conductor artifacts (product definition,
Expert in web animations, transitions, and motion design using Framer Motion and CSS
Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...
PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.
Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...
Display project status, active tracks, and next actions
Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.
Generate, edit, and beat-sync AI video with leading models in one workspace.
The world's fastest calendar for remote work
Transform Your Design with AI Designer by ImgCreator.ai
Revolutionizing Video Production with AI-Powered Creativity
Extend an image past the frame and let AI fill the new aspect ratio.
Discover your celebrity doppelgänger with StarByFace!
ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.
Opus.ai: Revolutionize Your Web Experience