erpnext-code-interpreter
32
总安装量
11
周安装量
#11576
全站排名
安装命令
npx skills add https://github.com/openaec-foundation/erpnext_anthropic_claude_development_skill_package --skill erpnext-code-interpreter
Agent 安装分布
claude-code
8
opencode
6
github-copilot
6
codex
6
amp
6
Skill 文档
ERPNext Code Interpreter Agent
This agent transforms vague or incomplete ERPNext development requests into clear, actionable technical specifications.
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 already has clear technical specs â
â "Create Server Script on validate for Sales Invoice" â
â âââ Skip agent, use relevant syntax/impl skills directly â
â â
âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
Interpretation Workflow
âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
â CODE INTERPRETER 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? â
â â
â STEP 4: GENERATE SPECIFICATION â
â ââââââââââââââââââââââââââââââ â
â ⢠DocType(s) involved â
â ⢠Event/trigger type â
â ⢠Implementation mechanism â
â ⢠Data flow â
â ⢠Error handling requirements â
â ⢠Version compatibility â
â â
â STEP 5: MAP TO SKILLS â
â ââââââââââââââââââââââ â
â ⢠List required skills for implementation â
â ⢠Note any dependencies between skills â
â â
âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
â See references/workflow.md for detailed workflow steps.
Mechanism Selection Matrix
Use this to determine WHICH mechanism fits the requirement:
âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
â REQUIREMENT â MECHANISM MAPPING â
âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ¤
â â
â "Auto-calculate on form" â
â âââ Client Script (refresh_field) + Server Script (validate) â
â â
â "Validate before save" â
â âââ Server Script (Document Event: validate) â
â â
â "Send notification after submit" â
â âââ Server Script (Document Event: on_submit) â
â â
â "Add button to form" â
â âââ Client Script (custom_buttons) â
â â
â "Scheduled report/sync" â
â âââ Server Script (Scheduler) or hooks.py scheduler_events â
â â
â "Filter list per user territory" â
â âââ Server Script (Permission Query) â
â â
â "Custom REST API" â
â âââ Server Script (API) or @frappe.whitelist() â
â â
â "Complex transaction with rollback" â
â âââ Controller (custom app required) â
â â
â "External library needed" â
â âââ Controller (custom app required) â
â â
â "Approval workflow" â
â âââ Built-in Workflow + Server Script for custom logic â
â â
â "Print format customization" â
â âââ Jinja template (Print Format) â
â â
âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
Clarifying Questions Framework
When a request is ambiguous, ask these questions:
1. WHAT Questions
⢠What DocType(s) are involved?
⢠What data needs to change?
⢠What should the outcome be?
2. WHEN Questions
⢠When should this happen?
- On form load?
- On field change?
- Before/after save?
- Before/after submit?
- On a schedule?
- When user clicks something?
3. WHO Questions
⢠Who should this affect?
- All users?
- Specific roles?
- Document owner only?
⢠Who should NOT be affected?
4. WHERE Questions
⢠Where should changes appear?
- In the form (UI)?
- In the database only?
- In a report?
- In an external system?
5. ERROR Questions
⢠What if the action fails?
- Block the operation?
- Show warning but continue?
- Log and continue silently?
â See references/examples.md for interpretation examples.
Output Specification Template
Generate specifications in this format:
## Technical Specification
### Summary
[One sentence describing what will be built]
### Business Requirement
[The 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]
3. [Step 3]
### Error Handling
[How errors should be handled]
### Required Skills
- [ ] skill-name-1 - for [purpose]
- [ ] skill-name-2 - for [purpose]
### Validation Criteria
[How to verify the implementation works correctly]
Skill Dependencies Map
Based on the mechanism, these skills are needed:
| Mechanism | Required Skills |
|---|---|
| Client Script | erpnext-syntax-clientscripts, erpnext-impl-clientscripts, erpnext-errors-clientscripts |
| Server Script (Doc Event) | erpnext-syntax-serverscripts, erpnext-impl-serverscripts, erpnext-errors-serverscripts |
| Server Script (API) | erpnext-syntax-serverscripts, erpnext-api-patterns, erpnext-errors-api |
| Server Script (Scheduler) | erpnext-syntax-serverscripts, erpnext-syntax-scheduler, erpnext-impl-scheduler |
| Server Script (Permission) | erpnext-syntax-serverscripts, erpnext-permissions, erpnext-errors-permissions |
| Controller | erpnext-syntax-controllers, erpnext-impl-controllers, erpnext-errors-controllers |
| Hooks | erpnext-syntax-hooks, erpnext-impl-hooks, erpnext-errors-hooks |
| Custom App | erpnext-syntax-customapp, erpnext-impl-customapp |
| Jinja Template | erpnext-syntax-jinja, erpnext-impl-jinja |
| Database Operations | erpnext-database, erpnext-errors-database |
| Whitelisted Method | erpnext-syntax-whitelisted, erpnext-impl-whitelisted |
Common Pattern Recognition
Pattern: “Auto-calculate [field] based on [other fields]”
Interpretation:
⢠Need real-time update on form â Client Script
⢠Need validated calculation on save â Server Script (validate)
⢠Usually BOTH for best UX
Specification:
- Client Script: field change triggers, refresh_field
- Server Script: validate event, same calculation as backup
Pattern: “Send email/notification when [condition]”
Interpretation:
⢠After document action â Server Script (on_update/on_submit)
⢠Scheduled digest â Server Script (Scheduler)
Specification:
- Use frappe.sendmail() or Notification DocType
- Consider: who receives, template, attachments
Pattern: “Prevent [action] if [condition]”
Interpretation:
⢠Block save â Server Script (validate) with frappe.throw()
⢠Block submit â Server Script (before_submit) with frappe.throw()
⢠Block cancel â Server Script (before_cancel) with frappe.throw()
Specification:
- Determine correct event (validate vs before_submit)
- Define clear error message for user
Pattern: “Sync with external system”
Interpretation:
⢠Real-time sync on save â Controller (needs requests library)
⢠Batch sync â Scheduler in hooks.py (needs requests library)
⢠Cannot use Server Script (imports blocked)
Specification:
- Custom app REQUIRED
- Controller class or hooks.py scheduler_events
- Error handling for API failures
â See references/examples.md for more patterns.
Version Awareness
Always consider version compatibility:
| Feature | v14 | v15 | v16 |
|---|---|---|---|
| Server Script sandbox | â | â | â |
extend_doctype_class hook |
â | â | â |
| Chrome PDF rendering | â | â | â |
| Data masking | â | â | â |
| UUID naming rule | â | â | â |
| Scheduler tick (seconds) | 240 | 60 | 60 |
Agent Output Checklist
Before completing interpretation, verify:
- Business requirement is clear and unambiguous
- Trigger/event is identified
- Mechanism is selected with justification
- DocType(s) are specified
- Data flow is documented
- Error handling approach is defined
- Version compatibility is noted
- Required skills are listed
- Validation criteria are defined
â See references/checklists.md for detailed checklists.