skills/nocobase-data-analysis/SKILL.md
Query and analyze business data in NocoBase via MCP. Use when users want current counts, grouped breakdowns, owner/source distributions, or business summaries across collections, with main data source first and fallback discovery to other enabled data sources.
npx skillsauth add nocobase/skills nocobase-data-analysisInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Use NocoBase MCP tools to locate the right collection, query business data safely, and produce reliable summaries or grouped analysis.
Auth required, stop and ask the user to refresh MCP authentication before continuing.main data source.main, inspect other enabled data sources.dataSource explicitly in every subsequent resource_* call.resource_query for counts and grouped analysis only after confirming the query parameter contract.resource_list plus manual counting when query results are suspicious or need cross-checking.Useful references:
references/analysis-patterns.md for common business analysis shapesreferences/metric-checklist.md for metric definition and scope checksreferences/entity-mapping.md for mapping business terms to collections and fieldsmain.main, call data_sources:list_enabled and inspect other enabled data sources one by one.main when main is one of them;collections:listMeta for a fast overview.collections:get with appends: ["fields"] when you need exact field names, relation targets, or enum options.references/entity-mapping.md as a reusable heuristic for common business nouns and likely field categories.Before using resource_query, verify the request shape matches the real backend contract:
measures[].aggregation, not aggregateorders[].order, not directionfield should usually be passed as a field path array such as ["id"] or ["owner", "nickname"]alias whenever the result will be referenced in output or havingCorrect examples:
{
"resource": "lead",
"dataSource": "main",
"measures": [
{ "aggregation": "count", "field": ["id"], "alias": "lead_count" }
]
}
{
"resource": "lead",
"dataSource": "main",
"dimensions": [
{ "field": ["status"], "alias": "status" }
],
"measures": [
{ "aggregation": "count", "field": ["id"], "alias": "lead_count" }
],
"orders": [
{ "field": ["status"], "alias": "status", "order": "asc" }
]
}
auth:check.main.resource_query with a single count(id) measure.Common grouped views:
For relation labels, use field paths such as:
["owner", "nickname"]["mainDepartment", "title"]Re-check with resource_list when:
When cross-checking:
resource_query.Report:
Classify the user request before querying:
overview for current totals and main distributionsdistribution for grouped counts by status, owner, source, team, or departmentfunnel for stage-based business progressiontrend for date or month-based change over timeranking for top owners, sources, accounts, or productsquality-check for missing values, null-heavy fields, suspicious statuses, or orphaned relationsUse references/analysis-patterns.md for the recommended query shapes for each pattern.
Before returning an answer, verify the metric scope:
Use references/metric-checklist.md when the user request is ambiguous or the metric may be interpreted in more than one way.
main; check main first, then search other enabled data sources.dataSource after the collection has been located.aggregate in query measures; the backend expects aggregation.direction in query orders; the backend expects order.36, 54, 80, or another plausible record ID, verify whether aggregation was actually applied.dimensions, measures, orders, and filter actually exist.resource_query uses aggregation and order.development
Use when the task hands over a prototype to reproduce in NocoBase — an HTML file, an image, or a link, INCLUDING the published form "Build a NocoBase app — X … Match the layout and signature visuals of this reference prototype: <url>" — or when someone says a built page "doesn't match the prototype / looks monotone / is ugly". A prototype/URL being present is what triggers this skill, EVEN WHEN the same prompt also says "build an app" — the verb "build" does not cancel the prototype. Skip it only when there is NO prototype at all: a bare "build me a CRM/app" → nocobase-app- discipline; a one-field edit / rename → nocobase-ui-builder. It turns "here is the prototype, build it" into a faithful app — analyze prototype, native CRUD, the right native block per region, then a screenshot-vs-prototype visual loop. Native-first; JS only inside a native container; never a full-page JS block. Mechanics live in nocobase-ui-builder, nocobase-data-modeling, nocobase-app-discipline.
tools
Use when building a NocoBase app with NocoBase skills or the nb CLI and you want to save a completed, meaningful milestone as a restorable revision.
tools
Use when users need to inspect, create, revise, enable, or diagnose NocoBase workflows through the `nb` CLI, including trigger selection, node-chain changes, version safety checks, and execution troubleshooting.
development
General-purpose NocoBase reference utilities covering cross-cutting topics such as evaluator engines, expression syntax, UID generation, and more. Use when you need authoritative reference information or reusable snippets that apply across multiple NocoBase features.