frappe-devlisted
Install: claude install-skill prilk-consulting/frappe-agent-kit
# Frappe Framework Core Reference
## Usage
Use this skill when:
- Writing or reviewing DocType controllers, whitelisted API methods, or hooks.py wiring
- Database access decisions (`get_list` vs `get_all`, query builder vs raw SQL)
- Permission enforcement, background jobs, caching, desk client scripts
- Structuring a custom app that extends other apps' DocTypes
- Debugging Jinja/print-format errors → see [references/jinja-and-print-formats.md](references/jinja-and-print-formats.md)
- Validating a hand-written DocType JSON before migrate → run `scripts/validate_doctype_json.py <file>` (bundled in this skill; exit 4 = errors)
## Document Lifecycle Hooks
```python
class MyDocType(Document):
def before_insert(self): ... # before first save
def after_insert(self): ... # after first save
def validate(self): ... # before save (insert/update)
def before_save / on_update(self): ...
def before_submit / on_submit(self): ...
def before_cancel / on_cancel(self): ...
def on_trash(self): ... # before delete
```
## API Development
Two surfaces:
| Shape | URL | Use for |
|-------|-----|---------|
| **REST** | `/api/resource/<DocType>` (v1) or `/api/v2/document/<DocType>` (v15+) | Standard CRUD |
| **RPC** | `/api/method/<dotted.path>` | Custom server logic |
| **Webhook** | Webhook DocType (configured in UI) | Notify external systems |
### Whitelisted methods
```python
@frappe.whitelist()
def get_balance(customer):
frappe.h