frappe-app
БесплатноБез исполняемых скриптовНе проверенScaffold a new Frappe Framework v15 application with multi-layer architecture. Triggers: "create frappe app", "new frappe app", "scaffold frappe", "frappe app…
от sergio-bershadsky★ 15 звёзд на GitHubОб этом скилле
Frappe App Scaffolding
Create a professional Frappe Framework v15 application with multi-layer architecture following enterprise best practices.
When to Use
- Starting a new Frappe/ERPNext custom application
- Need production-ready app structure with proper separation of concerns
- Want multi-layer architecture (Controller → Service → Repository)
- Building apps that require clean, maintainable code organization
Arguments
/frappe-app <app_name> [--module <module_name>]
Examples:
/frappe-app inventory_management
/frappe-app hr_extension --module Human Resources
Procedure
Step 1: Gather Requirements
Ask the user for:
- App name (snake_case, e.g.,
inventory_pro) - App title (human-readable, e.g., "Inventory Pro")
- Primary module name (e.g., "Inventory", "HR", "Sales")
- Brief description of the app's purpose
Verify the current working directory is within a frappe-bench/apps folder:
pwd
ls -la
Step 2: Generate App Structure
Create the following multi-layer architecture:
<app_name>/
├── <app_name>/
│ ├── __init__.py
│ ├── hooks.py # App hooks and integrations
│ ├── modules.txt # Module definitions
│ ├── patches.txt # Database migrations
│ ├── <module_name>/ # Primary module
│ │ ├── __init__.py
│ │ ├── doctype/ # DocType definitions
│ │ │ └── __init__.py
│ │ ├── api/ # REST API endpoints (v2)
│ │ │ └── __init__.py
│ │ ├── services/ # Business logic layer
│ │ │ └── __init__.py
│ │ ├── repositories/ # Data access layer
│ │ │ └── __init__.py
│ │ └── report/ # Custom reports
│ │ └── __init__.py
│ ├── public/
│ │ ├── css/
│ │ └── js/
│ ├── templates/
│ │ ├── includes/
│ │ └── pages/
│ ├── www/ # Portal pages
│ └── tests/
│ ├── __init__.py
│ └── test_utils.py
├── pyproject.toml
├── README.md
└── license.txt
Step 3: Create Core Files
pyproject.toml
[project]
name = "<app_name>"
version = "0.0.1"
description = "<description>"
authors = [
{name = "<author>", email = "<email>"}
]
requires-python = ">=3.10"
readme = "README.md"
license = {text = "MIT"}
dependencies = [
"frappe>=15.0.0"
]
[project.optional-dependencies]
dev = [
"pytest>=7.0.0",
"pytest-cov>=4.0.0",
]
[build-system]
requires = ["flit_core>=3.9"]
build-backend = "flit_core.buildapi"
[tool.pytest.ini_options]
testpaths = ["<app_name>/tests"]
python_files = "test_*.py"
hooks.py
app_name = "<app_name>"
app_title = "<App Title>"
app_publisher = "<Author>"
app_description = "<Description>"
app_email = "<email>"
app_license = "MIT"
# Required Frappe version
required_apps = ["frappe"]
# v15: Enable type annotations in controllers
export_python_type_annotations = True
# Includes in <head>
# app_include_css = "/assets/<app_name>/css/<app_name>.css"
# app_include_js = "/assets/<app_name>/js/<app_name>.js"
# Document Events - prefer controller methods over hooks when possible
# doc_events = {
# "DocType Name": {
# "validate": "<app_name>.<module>.services.validation.validate_document",
# "on_submit": "<app_name>.<module>.services.workflow.on_submit",
# }
# }
# Scheduled Tasks
# scheduler_events = {
# "daily": [
# "<app_name>.<module>.tasks.daily_cleanup"
# ],
# "cron": {
# "0 9 * * *": [
# "<app_name>.<module>.tasks.morning_report"
# ]
# }
# }
# Permissions - override for custom logic
# has_permission = {
# "DocType Name": "<app_name>.<module>.permissions.has_permission"
# }
# Fixtures - data to export/import
# fixtures = [
# {"dt": "Custom Field", "filters": "module", "=", "<module_name>"},
# {"dt": "Property Setter", "filters": "module", "=", "<module_name>"},
# ]
# User Data Protection
# user_data_fields = [
# {"doctype": "DocType Name", "match_field": "owner", "personal_fields": ["email", "phone"]}
# ]
Base Service Class
Create <app_name>/<module>/services/base.py:
"""
Base service class providing common functionality for all services.
Services contain business logic and orchestrate operations.
"""
import frappe
from frappe import _
from typing import TYPE_CHECKING, Optional, Any
if TYPE_CHECKING:
from frappe.model.document import Document
class BaseService:
"""
Base class for all service layer classes.
Services should:
- Contain business logic
- Coordinate between repositories
- Handle transactions
- Validate business rules
"""
def __init__(self, user: Optional[str] = None):
self.user = user or frappe.session.user
def check_permission(
self,
doctype: str,
ptype: str = "read",
doc: Optional["Document"] = None,
throw: bool = True
Установить frappe-app в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл frappe-app?
Scaffold a new Frappe Framework v15 application with multi-layer architecture. Triggers: "create frappe app", "new frappe app", "scaffold frappe", "frappe app structure", "/frappe-app". Creates production-ready app structure with service layer, repository pattern, proper module organization, and v15 best practices.
Как установить скилл frappe-app?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл frappe-app запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic