Frappe Code Interpreter Agent
Transforms vague or incomplete Frappe/ERPNext development requests into clear, actionable technical specifications mapped to the full 61-skill catalog.
Purpose: Bridge the gap between "what the user wants" and "what needs to be built"
When to Use This Agent
USER REQUEST ANALYSIS
|
+-- Request is vague/incomplete
| "Make the invoice do something when submitted"
| --> USE THIS AGENT
|
+-- Request lacks technical specifics
| "Add approval before order confirmation"
| --> USE THIS AGENT
|
+-- Multiple implementation paths possible
| "Automate inventory updates"
| --> USE THIS AGENT
|
+-- Request has clear technical specs already
| "Create Server Script on validate for Sales Invoice"
| --> Skip agent, use relevant frappe-* skills directly
Interpretation Workflow
STEP 1: EXTRACT INTENT
- What is the business problem?
- What should happen? When? To what data?
- Who should be affected (roles/users)?
STEP 2: IDENTIFY TRIGGER CONTEXT
- Document lifecycle event? (save/submit/cancel)
- User action? (button click, field change)
- Time-based? (daily, hourly, cron)
- External event? (webhook, API call)
STEP 3: DETERMINE MECHANISM
- Client Script, Server Script, or Controller?
- Hooks configuration needed?
- Custom app required?
- v16 extend_doctype_class applicable?
STEP 4: GENERATE SPECIFICATION
- DocType(s), event/trigger, mechanism, data flow
- Error handling requirements
- Version compatibility (v14/v15/v16)
STEP 5: MAP TO SKILLS
- List required frappe-* skills from full catalog
- Note dependencies between skills
See references/workflow.md for detailed steps.
Mechanism Selection Matrix
| Requirement Pattern |
Mechanism |
Custom App? |
| "Auto-calculate on form" |
Client Script + Server Script |
No |
| "Validate before save" |
Server Script (validate) |
No |
| "Send notification after submit" |
Server Script (on_submit) |
No |
| "Add button to form" |
Client Script |
No |
| "Scheduled report/sync" |
hooks.py scheduler_events |
Yes |
| "Filter list per user" |
Server Script (Permission Query) |
No |
| "Custom REST API" |
Server Script (API) or @frappe.whitelist() |
Depends |
| "Complex transaction with rollback" |
Controller |
Yes |
| "External library needed (requests)" |
Controller |
Yes |
| "Approval workflow" |
Built-in Workflow + optional Server Script |
No |
| "Print format customization" |
Jinja template (Print Format) |
No |
| "Custom report" |
Script Report or Query Report |
Depends |
| "Background processing" |
frappe.enqueue() |
Yes |
| "File upload handling" |
Controller + File hooks |
Yes |
| "Cache invalidation" |
Cache API + hooks |
Yes |
| "Website/portal page" |
Web template + routing |
Yes |
| "UI component (dashboard, etc.)" |
Page or Custom Page |
Yes |
Clarifying Questions Framework
1. WHAT Questions
- What DocType(s) are involved?
- What data needs to change?
- What should the outcome be?
2. WHEN Questions
- On form load? On field change? Before/after save?
- Before/after submit? On a schedule? Button click?
3. WHO Questions
- All users? Specific roles? Document owner only?
4. WHERE Questions
- In the form (UI)? Database only? Report? External system?
5. ERROR Questions
- Block the operation? Show warning? Log silently?
6. VERSION Questions (v16 considerations)
- Target single version or multi-version compatibility?
- Can we use
extend_doctype_class (v16) or need doc_events (v14+)?
- Type annotations desired? (v16 best practice)
Output Specification Template
ALWAYS generate specifications in this format:
## Technical Specification
### Summary
[One sentence describing what will be built]
### Business Requirement
[Original user request, clarified]
### Implementation
| Aspect | Value |
|--------|-------|
| **DocType(s)** | [List] |
| **Trigger** | [Event/action] |
| **Mechanism** | [Client Script / Server Script / Controller / etc.] |
| **Version** | [v14 / v15 / v16 / all] |
### Data Flow
1. [Step 1]
2. [Step 2]
### Error Handling
[Strategy]
### Required Skills
- [ ] frappe-skill-name - for [purpose]
### Validation Criteria
[How to verify it works]
Complete Skill Catalog (61 skills)
Syntax Layer (11 skills)
| Skill |
Use For |
frappe-syntax-clientscripts |
Client Script JS syntax |
frappe-syntax-serverscripts |
Server Script Python sandbox syntax |
frappe-syntax-controllers |
Controller class syntax |
frappe-syntax-hooks |
hooks.py configuration syntax |
frappe-syntax-hooks-events |
Document event hook syntax |
frappe-syntax-whitelisted |
@frappe.whitelist() syntax |
frappe-syntax-jinja |
Jinja template syntax |
frappe-syntax-scheduler |
Scheduler/enqueue syntax |
frappe-syntax-customapp |
App structure syntax |
frappe-syntax-doctypes |
DocType JSON definition syntax |
frappe-syntax-reports |
Report definition syntax |
Core Layer (7 skills)
| Skill |
Use For |
frappe-core-database |
Database operations, ORM, raw SQL |
frappe-core-permissions |
Permission system, roles, rules |
frappe-core-api |
REST API, resource API |
frappe-core-workflow |
Workflow engine, states, transitions |
frappe-core-notifications |
Email, push, system notifications |
frappe-core-files |
File upload, attachment, storage |
frappe-core-cache |
Redis cache, cache invalidation |
Implementation Layer (12 skills)
| Skill |
Use For |
frappe-impl-clientscripts |
Client Script implementation patterns |
frappe-impl-serverscripts |
Server Script implementation patterns |
frappe-impl-controllers |
Controller implementation patterns |
frappe-impl-hooks |
Hook implementation patterns |
frappe-impl-whitelisted |
Whitelisted method patterns |
frappe-impl-jinja |
Jinja template patterns |
frappe-impl-scheduler |
Scheduled task/background job patterns |
frappe-impl-customapp |
Custom app development workflow |
frappe-impl-reports |
Report building patterns |
frappe-impl-workflow |
Workflow implementation patterns |
frappe-impl-website |
Website/portal development |
frappe-impl-ui-components |
UI component patterns |
frappe-impl-integrations |
External system integration |
Error Layer (7 skills)
| Skill |
Use For |
frappe-errors-clientscripts |
Client Script error patterns |
frappe-errors-serverscripts |
Server Script error patterns |
frappe-errors-controllers |
Controller error patterns |
frappe-errors-hooks |
Hook error patterns |
frappe-errors-api |
API error patterns |
frappe-errors-permissions |
Permission error patterns |
frappe-errors-database |
Database error patterns |
Ops Layer (8 skills)
| Skill |
Use For |
frappe-ops-bench |
Bench CLI commands |
frappe-ops-deployment |
Production deployment |
frappe-ops-backup |
Backup and restore |
frappe-ops-performance |
Performance tuning |
frappe-ops-upgrades |
Version upgrade procedures |
frappe-ops-cloud |
Cloud hosting (FC, AWS, etc.) |
frappe-ops-app-lifecycle |
App versioning and releases |
frappe-ops-frontend-build |
Frontend asset building |
Testing Layer (2 skills)
| Skill |
Use For |
frappe-testing-unit |
Unit and integration tests |
frappe-testing-cicd |
CI/CD pipeline setup |
Agent Layer (5 skills)
| Skill |
Use For |
frappe-agent-interpreter |
THIS SKILL - requirement interpretation |
frappe-agent-validator |
Code validation before deployment |
frappe-agent-debugger |
Debugging Frappe issues |
frappe-agent-migrator |
Data migration planning |
frappe-agent-architect |
Architecture decision-making |
Skill Dependencies Map
| Mechanism |
Required Skills |
| Client Script |
frappe-syntax-clientscripts, frappe-impl-clientscripts, frappe-errors-clientscripts |
| Server Script (Doc Event) |
frappe-syntax-serverscripts, frappe-impl-serverscripts, frappe-errors-serverscripts |
| Server Script (API) |
frappe-syntax-serverscripts, frappe-core-api, frappe-errors-api |
| Server Script (Scheduler) |
frappe-syntax-serverscripts, frappe-syntax-scheduler, frappe-impl-scheduler |
| Server Script (Permission) |
frappe-syntax-serverscripts, frappe-core-permissions, frappe-errors-permissions |
| Controller |
frappe-syntax-controllers, frappe-impl-controllers, frappe-errors-controllers |
| Hooks |
frappe-syntax-hooks, frappe-impl-hooks, frappe-errors-hooks |
| Custom App |
frappe-syntax-customapp, frappe-impl-customapp, frappe-ops-bench |
| Jinja Template |
frappe-syntax-jinja, frappe-impl-jinja |
| Database Operations |
frappe-core-database, frappe-errors-database |
| Whitelisted Method |
frappe-syntax-whitelisted, frappe-impl-whitelisted |
| Workflow |
frappe-core-workflow, frappe-impl-workflow |
| Reports |
frappe-syntax-reports, frappe-impl-reports |
| Website/Portal |
frappe-impl-website, frappe-syntax-jinja |
| Integration |
frappe-impl-integrations, frappe-impl-customapp |
| Background Jobs |
frappe-impl-scheduler, frappe-syntax-scheduler |
| Testing |
frappe-testing-unit, frappe-testing-cicd |
| Deployment |
frappe-ops-deployment, frappe-ops-bench |
Common Pattern Recognition
| User Phrase |
Mechanism |
Key Skills |
| "auto-calculate", "automatically fill" |
Client Script + Server Script |
frappe-impl-clientscripts, frappe-impl-serverscripts |
| "validate", "check before save" |
Server Script (validate) |
frappe-impl-serverscripts |
| "prevent", "block", "don't allow" |
Server Script + frappe.throw() |
frappe-errors-serverscripts |
| "send email", "notify" |
Server Script or Notification |
frappe-core-notifications |
| "sync", "integrate", "API" |
Controller (custom app) |
frappe-impl-integrations |
| "every day", "schedule" |
Scheduler or hooks.py |
frappe-impl-scheduler |
| "only see their own" |
Permission Query |
frappe-core-permissions |
| "approval", "authorize" |
Built-in Workflow |
frappe-core-workflow, frappe-impl-workflow |
| "add button", "custom action" |
Client Script |
frappe-impl-clientscripts |
| "print format", "PDF" |
Jinja Template |
frappe-impl-jinja |
| "report", "dashboard" |
Script/Query Report |
frappe-impl-reports |
| "deploy", "go live" |
Deployment workflow |
frappe-ops-deployment |
| "test", "CI" |
Testing framework |
frappe-testing-unit |
| "cache", "performance" |
Cache + optimization |
frappe-core-cache, frappe-ops-performance |
Version Awareness
ALWAYS consider version compatibility:
| Feature |
v14 |
v15 |
v16 |
| Server Script sandbox |
Yes |
Yes |
Yes |
extend_doctype_class |
No |
No |
Yes |
| Chrome PDF rendering |
No |
No |
Yes |
| Data masking |
No |
No |
Yes |
| UUID naming rule |
No |
No |
Yes |
| Type annotations (best practice) |
No |
No |
Yes |
| Scheduler tick (seconds) |
240 |
60 |
60 |
job_id dedup |
No |
Yes |
Yes |
Agent Output Checklist
Before completing interpretation, ALWAYS verify:
See references/checklists.md for detailed checklists.
See references/examples.md for interpretation examples.
1---2name: frappe-agent-interpreter3description: Use when receiving vague or unclear ERPNext/Frappe development requests that need interpretation. Transforms requirements like 'make invoice auto-calculate' or 'add approval workflow' into concrete technical specifications. Determines which Frappe mechanisms to use and maps to the full 61-skill catalog. Keywords: vague requirement, clarify scope, translate business need, technical spec, implementation plan, what does this mean, unclear requirement, translate to code, how to build this.4license: MIT5---67# Frappe Code Interpreter Agent89Transforms vague or incomplete Frappe/ERPNext development requests into clear, actionable technical specifications mapped to the full 61-skill catalog.1011**Purpose**: Bridge the gap between "what the user wants" and "what needs to be built"1213## When to Use This Agent1415```16USER REQUEST ANALYSIS17|18+-- Request is vague/incomplete19| "Make the invoice do something when submitted"20| --> USE THIS AGENT21|22+-- Request lacks technical specifics23| "Add approval before order confirmation"24| --> USE THIS AGENT25|26+-- Multiple implementation paths possible27| "Automate inventory updates"28| --> USE THIS AGENT29|30+-- Request has clear technical specs already31| "Create Server Script on validate for Sales Invoice"32| --> Skip agent, use relevant frappe-* skills directly33```3435## Interpretation Workflow3637```38STEP 1: EXTRACT INTENT39 - What is the business problem?40 - What should happen? When? To what data?41 - Who should be affected (roles/users)?4243STEP 2: IDENTIFY TRIGGER CONTEXT44 - Document lifecycle event? (save/submit/cancel)45 - User action? (button click, field change)46 - Time-based? (daily, hourly, cron)47 - External event? (webhook, API call)4849STEP 3: DETERMINE MECHANISM50 - Client Script, Server Script, or Controller?51 - Hooks configuration needed?52 - Custom app required?53 - v16 extend_doctype_class applicable?5455STEP 4: GENERATE SPECIFICATION56 - DocType(s), event/trigger, mechanism, data flow57 - Error handling requirements58 - Version compatibility (v14/v15/v16)5960STEP 5: MAP TO SKILLS61 - List required frappe-* skills from full catalog62 - Note dependencies between skills63```6465See [references/workflow.md](references/workflow.md) for detailed steps.6667## Mechanism Selection Matrix6869| Requirement Pattern | Mechanism | Custom App? |70|---------------------|-----------|:-----------:|71| "Auto-calculate on form" | Client Script + Server Script | No |72| "Validate before save" | Server Script (validate) | No |73| "Send notification after submit" | Server Script (on_submit) | No |74| "Add button to form" | Client Script | No |75| "Scheduled report/sync" | hooks.py scheduler_events | Yes |76| "Filter list per user" | Server Script (Permission Query) | No |77| "Custom REST API" | Server Script (API) or @frappe.whitelist() | Depends |78| "Complex transaction with rollback" | Controller | Yes |79| "External library needed (requests)" | Controller | Yes |80| "Approval workflow" | Built-in Workflow + optional Server Script | No |81| "Print format customization" | Jinja template (Print Format) | No |82| "Custom report" | Script Report or Query Report | Depends |83| "Background processing" | frappe.enqueue() | Yes |84| "File upload handling" | Controller + File hooks | Yes |85| "Cache invalidation" | Cache API + hooks | Yes |86| "Website/portal page" | Web template + routing | Yes |87| "UI component (dashboard, etc.)" | Page or Custom Page | Yes |8889## Clarifying Questions Framework9091### 1. WHAT Questions92- What DocType(s) are involved?93- What data needs to change?94- What should the outcome be?9596### 2. WHEN Questions97- On form load? On field change? Before/after save?98- Before/after submit? On a schedule? Button click?99100### 3. WHO Questions101- All users? Specific roles? Document owner only?102103### 4. WHERE Questions104- In the form (UI)? Database only? Report? External system?105106### 5. ERROR Questions107- Block the operation? Show warning? Log silently?108109### 6. VERSION Questions (v16 considerations)110- Target single version or multi-version compatibility?111- Can we use `extend_doctype_class` (v16) or need `doc_events` (v14+)?112- Type annotations desired? (v16 best practice)113114## Output Specification Template115116ALWAYS generate specifications in this format:117118```markdown119## Technical Specification120121### Summary122[One sentence describing what will be built]123124### Business Requirement125[Original user request, clarified]126127### Implementation128129| Aspect | Value |130|--------|-------|131| **DocType(s)** | [List] |132| **Trigger** | [Event/action] |133| **Mechanism** | [Client Script / Server Script / Controller / etc.] |134| **Version** | [v14 / v15 / v16 / all] |135136### Data Flow1371. [Step 1]1382. [Step 2]139140### Error Handling141[Strategy]142143### Required Skills144- [ ] frappe-skill-name - for [purpose]145146### Validation Criteria147[How to verify it works]148```149150## Complete Skill Catalog (61 skills)151152### Syntax Layer (11 skills)153| Skill | Use For |154|-------|---------|155| `frappe-syntax-clientscripts` | Client Script JS syntax |156| `frappe-syntax-serverscripts` | Server Script Python sandbox syntax |157| `frappe-syntax-controllers` | Controller class syntax |158| `frappe-syntax-hooks` | hooks.py configuration syntax |159| `frappe-syntax-hooks-events` | Document event hook syntax |160| `frappe-syntax-whitelisted` | @frappe.whitelist() syntax |161| `frappe-syntax-jinja` | Jinja template syntax |162| `frappe-syntax-scheduler` | Scheduler/enqueue syntax |163| `frappe-syntax-customapp` | App structure syntax |164| `frappe-syntax-doctypes` | DocType JSON definition syntax |165| `frappe-syntax-reports` | Report definition syntax |166167### Core Layer (7 skills)168| Skill | Use For |169|-------|---------|170| `frappe-core-database` | Database operations, ORM, raw SQL |171| `frappe-core-permissions` | Permission system, roles, rules |172| `frappe-core-api` | REST API, resource API |173| `frappe-core-workflow` | Workflow engine, states, transitions |174| `frappe-core-notifications` | Email, push, system notifications |175| `frappe-core-files` | File upload, attachment, storage |176| `frappe-core-cache` | Redis cache, cache invalidation |177178### Implementation Layer (12 skills)179| Skill | Use For |180|-------|---------|181| `frappe-impl-clientscripts` | Client Script implementation patterns |182| `frappe-impl-serverscripts` | Server Script implementation patterns |183| `frappe-impl-controllers` | Controller implementation patterns |184| `frappe-impl-hooks` | Hook implementation patterns |185| `frappe-impl-whitelisted` | Whitelisted method patterns |186| `frappe-impl-jinja` | Jinja template patterns |187| `frappe-impl-scheduler` | Scheduled task/background job patterns |188| `frappe-impl-customapp` | Custom app development workflow |189| `frappe-impl-reports` | Report building patterns |190| `frappe-impl-workflow` | Workflow implementation patterns |191| `frappe-impl-website` | Website/portal development |192| `frappe-impl-ui-components` | UI component patterns |193| `frappe-impl-integrations` | External system integration |194195### Error Layer (7 skills)196| Skill | Use For |197|-------|---------|198| `frappe-errors-clientscripts` | Client Script error patterns |199| `frappe-errors-serverscripts` | Server Script error patterns |200| `frappe-errors-controllers` | Controller error patterns |201| `frappe-errors-hooks` | Hook error patterns |202| `frappe-errors-api` | API error patterns |203| `frappe-errors-permissions` | Permission error patterns |204| `frappe-errors-database` | Database error patterns |205206### Ops Layer (8 skills)207| Skill | Use For |208|-------|---------|209| `frappe-ops-bench` | Bench CLI commands |210| `frappe-ops-deployment` | Production deployment |211| `frappe-ops-backup` | Backup and restore |212| `frappe-ops-performance` | Performance tuning |213| `frappe-ops-upgrades` | Version upgrade procedures |214| `frappe-ops-cloud` | Cloud hosting (FC, AWS, etc.) |215| `frappe-ops-app-lifecycle` | App versioning and releases |216| `frappe-ops-frontend-build` | Frontend asset building |217218### Testing Layer (2 skills)219| Skill | Use For |220|-------|---------|221| `frappe-testing-unit` | Unit and integration tests |222| `frappe-testing-cicd` | CI/CD pipeline setup |223224### Agent Layer (5 skills)225| Skill | Use For |226|-------|---------|227| `frappe-agent-interpreter` | THIS SKILL - requirement interpretation |228| `frappe-agent-validator` | Code validation before deployment |229| `frappe-agent-debugger` | Debugging Frappe issues |230| `frappe-agent-migrator` | Data migration planning |231| `frappe-agent-architect` | Architecture decision-making |232233## Skill Dependencies Map234235| Mechanism | Required Skills |236|-----------|----------------|237| Client Script | `frappe-syntax-clientscripts`, `frappe-impl-clientscripts`, `frappe-errors-clientscripts` |238| Server Script (Doc Event) | `frappe-syntax-serverscripts`, `frappe-impl-serverscripts`, `frappe-errors-serverscripts` |239| Server Script (API) | `frappe-syntax-serverscripts`, `frappe-core-api`, `frappe-errors-api` |240| Server Script (Scheduler) | `frappe-syntax-serverscripts`, `frappe-syntax-scheduler`, `frappe-impl-scheduler` |241| Server Script (Permission) | `frappe-syntax-serverscripts`, `frappe-core-permissions`, `frappe-errors-permissions` |242| Controller | `frappe-syntax-controllers`, `frappe-impl-controllers`, `frappe-errors-controllers` |243| Hooks | `frappe-syntax-hooks`, `frappe-impl-hooks`, `frappe-errors-hooks` |244| Custom App | `frappe-syntax-customapp`, `frappe-impl-customapp`, `frappe-ops-bench` |245| Jinja Template | `frappe-syntax-jinja`, `frappe-impl-jinja` |246| Database Operations | `frappe-core-database`, `frappe-errors-database` |247| Whitelisted Method | `frappe-syntax-whitelisted`, `frappe-impl-whitelisted` |248| Workflow | `frappe-core-workflow`, `frappe-impl-workflow` |249| Reports | `frappe-syntax-reports`, `frappe-impl-reports` |250| Website/Portal | `frappe-impl-website`, `frappe-syntax-jinja` |251| Integration | `frappe-impl-integrations`, `frappe-impl-customapp` |252| Background Jobs | `frappe-impl-scheduler`, `frappe-syntax-scheduler` |253| Testing | `frappe-testing-unit`, `frappe-testing-cicd` |254| Deployment | `frappe-ops-deployment`, `frappe-ops-bench` |255256## Common Pattern Recognition257258| User Phrase | Mechanism | Key Skills |259|-------------|-----------|------------|260| "auto-calculate", "automatically fill" | Client Script + Server Script | `frappe-impl-clientscripts`, `frappe-impl-serverscripts` |261| "validate", "check before save" | Server Script (validate) | `frappe-impl-serverscripts` |262| "prevent", "block", "don't allow" | Server Script + frappe.throw() | `frappe-errors-serverscripts` |263| "send email", "notify" | Server Script or Notification | `frappe-core-notifications` |264| "sync", "integrate", "API" | Controller (custom app) | `frappe-impl-integrations` |265| "every day", "schedule" | Scheduler or hooks.py | `frappe-impl-scheduler` |266| "only see their own" | Permission Query | `frappe-core-permissions` |267| "approval", "authorize" | Built-in Workflow | `frappe-core-workflow`, `frappe-impl-workflow` |268| "add button", "custom action" | Client Script | `frappe-impl-clientscripts` |269| "print format", "PDF" | Jinja Template | `frappe-impl-jinja` |270| "report", "dashboard" | Script/Query Report | `frappe-impl-reports` |271| "deploy", "go live" | Deployment workflow | `frappe-ops-deployment` |272| "test", "CI" | Testing framework | `frappe-testing-unit` |273| "cache", "performance" | Cache + optimization | `frappe-core-cache`, `frappe-ops-performance` |274275## Version Awareness276277ALWAYS consider version compatibility:278279| Feature | v14 | v15 | v16 |280|---------|:---:|:---:|:---:|281| Server Script sandbox | Yes | Yes | Yes |282| `extend_doctype_class` | No | No | Yes |283| Chrome PDF rendering | No | No | Yes |284| Data masking | No | No | Yes |285| UUID naming rule | No | No | Yes |286| Type annotations (best practice) | No | No | Yes |287| Scheduler tick (seconds) | 240 | 60 | 60 |288| `job_id` dedup | No | Yes | Yes |289290## Agent Output Checklist291292Before completing interpretation, ALWAYS verify:293294- [ ] Business requirement is clear and unambiguous295- [ ] Trigger/event is identified296- [ ] Mechanism is selected with justification297- [ ] DocType(s) are specified298- [ ] Data flow is documented299- [ ] Error handling approach is defined300- [ ] Version compatibility is noted (v14/v15/v16)301- [ ] Required frappe-* skills are listed from full catalog302- [ ] Validation criteria are defined303- [ ] v16 considerations noted (extend_doctype_class, type annotations)304305See [references/checklists.md](references/checklists.md) for detailed checklists.306See [references/examples.md](references/examples.md) for interpretation examples.