openaec-foundation/frappe_claude_skill_package/frappe-impl-reports
Claude Code and agent skill by openaec-foundation/frappe_claude_skill_package
- community
Checking that the SKILL.md file is still in the repository.
Use when building Script Reports, Query Reports, dashboard charts, or Number Cards in ERPNext. Prevents empty report output from wrong column definitions, broken filters, and unoptimized SQL in large datasets. Covers Report Builder, Script Report (Python + JS), Query Report, Report filters, dashboard Chart DocType, Number Card, report permissions. Keywords: report, Script Report, Query Report, dashboard, chart, Number Card, filters, columns, execute, get_data, create report, custom report, dashboard chart, report empty, no data showing..
Install
npx vskill@latest install openaec-foundation/frappe_claude_skill_package/frappe-impl-reportsSKILL.md
The same SKILL.md was published earlier as openaec-foundation/frappe_claude_skill_package/frappe-impl-reports.
Frappe Report Building
Quick Reference
| Report Type | Best For | Access | Files | |
|---|---|---|---|---|
| Query Report | Simple SQL queries | System Manager only | SQL in DocType or .py | |
| Script Report | Complex logic, charts | Administrator + Dev Mode | .py + .js | |
| Report Builder | End-user ad-hoc reports | Any permitted user | UI only | |
| Prepared Report | Large datasets (>100k rows) | Same as source report | Background job |
Decision Tree: Which Report Type?
1. Creating a Script Report
File Structure
ALWAYS create via Desk: Report > New > Script Report > set "Is Standard = Yes" in Developer Mode.
Python: The execute() Function
Return value order (positional — ALWAYS maintain this order):
| Position | Name | Type | Required | |
|---|---|---|---|---|
| 1 | columns | list[dict] | YES | |
| 2 | data | list[dict] or list[list] | YES | |
| 3 | message | str or None | NO | |
| 4 | chart | dict or None | NO | |
| 5 | report_summary | list[dict] or None | NO | |
| 6 | skip_total_rows | bool | NO |
JavaScript: Filters
2. Creating a Query Report
Query Reports use raw SQL. ALWAYS use the legacy column format in SQL aliases:
Column format: "Label:Fieldtype/Options:Width"
Use %(filter_name)s for filter variables in WHERE clauses.
3. Adding Charts to Reports
Return a chart dict as the 4th element from execute():
Chart types: bar, line, pie, donut, percentage.
For multi-dataset charts (e.g., comparing periods):
4. Adding Report Summary
Return a list of summary dicts as the 5th element:
Indicator colors: Green, Blue, Orange, Red, Grey.
5. Prepared Reports
For reports that timeout on large datasets, add to the .js file:
When prepared_report: true, Frappe queues the report via background job. Users see cached results and can regenerate on demand.
6. Number Cards
Three types of Number Cards for workspace dashboards:
| Type | Source | Use Case | |
|---|---|---|---|
| Document Type | DocType aggregate | Count/sum of documents | |
| Report | Script/Query Report | KPI from report data | |
| Custom | Whitelisted method | Any computed value |
Document Type Number Card
Create via Desk > Number Card. Set DocType, aggregate function (Count/Sum/Avg), and filters.
Report-Based Number Card
Point to an existing report. The card displays the first row's first numeric column.
Custom Method Number Card
7. Dashboard Charts
Create via Desk > Dashboard Chart or programmatically in fixtures:
Source types: Report, Group By, Custom (whitelisted method).
Group By Chart
8. Building a Dashboard
Dashboards combine multiple charts and Number Cards:
9. Performance Optimization
- ALWAYS add indexes on columns used in WHERE/GROUP BY (
frappe.model.utils.add_index) - ALWAYS use
as_dict=Trueinfrappe.db.sql()— matches column fieldnames - NEVER use
SELECT *— specify exact columns - NEVER load full documents (
frappe.get_doc) inside report loops — use SQL - Use
frappe.qb(query builder) for parameterized queries in v14+ - For reports > 50k rows, ALWAYS enable
prepared_report: true - ALWAYS filter by
docstatusto exclude draft/cancelled documents
10. Common Patterns
Date Range Filter Pattern
Multi-Currency Pattern
Group By with Totals Pattern
See Also
- references/examples.md — Complete report examples
- references/anti-patterns.md — Common mistakes
- references/workflows.md — Step-by-step workflows
frappe-syntax-api— Frappe Python API referencefrappe-core-database— Database query patterns
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/source/impl/frappe-impl-reports/SKILL.md
Popularity
- Repository stars
- 91
- Repository forks
- 26
- 7-day trend score
- 23
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 30 Apr 2026, 7 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/openaec-foundation/frappe_claude_skill_package/frappe-impl-reports)