commerce-admin
Skill0 starsChanged 44 days agoApache-2.0View on GitHub
Merchant back-office composition: orders table + detail drawer, inventory table with stock-edit forms, a KPI/chart sales dashboard and a fulfillment kanban wired to `useOrders`/`useProducts`. Uses the table, chart, metric-card, form and kanban skills instead of reimplementing them. Use when building admin or store-manager screens.
In this repository15 other files it gives its agents.
- authSkill
- cart-checkoutSkill
- chartSkill
- commerce-coreSkill
- dashboard-motionSkill
- drawerSkill
- formSkill
- kanbanSkill
- mediaSkill
- metric-cardSkill
- modalSkill
- product-catalogSkill
- product-detailSkill
- sidenavSkill
- tableSkill
The file
Files
Commerce Admin Skill
When to use
The merchant/back-office side of a commerce web app — orders, inventory, a sales dashboard, and
fulfillment. This skill is composition: it wires the existing app skills
(table, chart, metric-card,
form, kanban) to the commerce data. Depends on the
commerce-core skill (useOrders, useProducts, commerce.ts).
Generate useOrders/useProducts from commerce-core first (they load public/data/orders.json and
public/data/products.json).
Pages to plan
| Page | Path | Built from |
| Sales dashboard | / or /dashboard | metric-card (KPIs) + chart (sales over time) + recent orders (table) |
| Orders | /orders | table (orders) + order detail drawer |
| Inventory | /inventory | table (products) + stock-edit form/drawer |
| Fulfillment | /fulfillment | kanban (orders grouped by status) |
Component paths follow app/components/features/{domain}/…. Do NOT reimplement DataTable, charts,
metric cards, or the kanban board — generate them from their own skills and feed them commerce data.
Orders table — app/pages/orders.vue
<script setup lang="ts">
import { useOrders } from '~/composables/useOrders'
import DataTable from '~/components/shared/DataTable.vue'
import type { ColumnDef } from '~/composables/useDataTable'
definePageMeta({ layout: 'default' })
const { orders, loading, error } = useOrders()
const columns: ColumnDef[] = [
{ key: 'number', label: 'Order', sortable: true },
{ key: 'customer', label: 'Customer', sortable: true, filterable: true },
{ key: 'status', label: 'Status', sortable: true },
{ key: 'total', label: 'Total', sortable: true },
{ key: 'createdAt', label: 'Date', sortable: true },
]
const statusClass: Record<string, string> = {
pending: 'bg-muted text-muted-foreground',
paid: 'bg-primary/10 text-primary',
fulfilled: 'bg-primary/10 text-primary',
shipped: 'bg-primary/10 text-primary',
delivered: 'bg-secondary/15 text-secondary',
cancelled: 'bg-destructive/10 text-destructive',
refunded: 'bg-destructive/10 text-destructive',
}
function fmt(n: number) { return new Intl.NumberFormat('en-US', { style: 'currency', currency: 'USD' }).format(n) }
</script>
<template>
<div class="py-6">
<h1 class="mb-6 text-2xl font-bold text-foreground">Orders</h1>
<DataTable :columns="columns" :rows="orders" :loading="loading" :error="error" searchable exportable>
<template #cell-status="{ value }">
<span :class="['inline-flex rounded-full px-2 py-0.5 text-xs font-medium capitalize', statusClass[value] ?? 'bg-muted text-muted-foreground']">{{ value }}</span>
</template>
<template #cell-total="{ value }">
<span class="tabular-nums">{{ fmt(value) }}</span>
</template>
</DataTable>
</div>
</template>- Row click / an actions cell opens an order detail drawer (from the drawer skill and form skill) showing line items, customer, and a status selector. Editing status updates the row (local mock state).
- The DataTable already provides the loading/error/empty/data states — do not re-implement them.
Sales dashboard KPIs — wire metric-card to useOrders
MetricCard (from the metric-card skill) is used directly inside a grid — it takes label / value /
variant / icon-color props (no :metrics array prop). The point is the values are derived from
useOrders, never hardcoded:
<script setup lang="ts">
import { computed } from 'vue'
import { useOrders } from '~/composables/useOrders'
import MetricCard from '~/components/shared/MetricCard.vue'
const { orders, revenue } = useOrders()
const orderCount = computed(() => orders.value.length)
const aov = computed(() => (orderCount.value ? revenue.value / orderCount.value : 0))
const pending = computed(() => orders.value.filter((o) => o.status === 'pending').length)
function money(n: number) { return new Intl.NumberFormat('en-US', { style: 'currency', currency: 'USD', maximumFractionDigits: 0 }).format(n) }
</script>
<template>
<div class="grid grid-cols-1 gap-4 sm:grid-cols-2 xl:grid-cols-4">
<MetricCard label="Revenue" :value="money(revenue)" variant="icon" icon-color="primary" />
<MetricCard label="Orders" :value="orderCount" variant="default" />
<MetricCard label="Avg order value" :value="money(aov)" variant="default" />
<MetricCard label="Pending" :value="pending" variant="icon" icon-color="secondary" />
</div>
</template>Generate MetricCard from the metric-card skill (match its exact props). Add a
chart (line/bar) of
revenue or order count over time using the orders' createdAt, and a "Recent orders" table limited to
the latest few.
Inventory & fulfillment
- Inventory (
/inventory): atableofuseProducts().productswith columns name / category / price / stock (inStock/inventory); a stock-edit drawer (form skill) to adjust values (local mock state). - Fulfillment (
/fulfillment): akanbanboard whose columns are order statuses (pending → paid → fulfilled → shipped → delivered), cards are orders fromuseOrders; moving a card updates that order's status locally.
Non-negotiables
- Compose existing skills — generate DataTable/charts/metric cards/kanban from
table/chart/metric-card/kanban; never hand-roll them here. - All commerce data comes from
useOrders/useProducts(fromcommerce-core) — never hardcode orders or inventory in the page. - Status is rendered as a token-coloured badge (
bg-primary/10 text-primary,bg-destructive/10 …, …) — never hardcoded hex/green/red. - Money via
Intl.NumberFormat+tabular-nums. Dashboard KPIs are derived from the data (revenue/orders/AOV/pending), not placeholder numbers. - This is a frontend with mock data — edits (status changes, stock edits) are local/mock; there is no backend or persistence beyond the mock JSON.
- Renders in
layout: default(sidebar shell); auth/role gating (if any) follows thesidenav/authskills.
Colour & polish
- Order/fulfilment status pills.
- Render category colour as a tinted chip:
bg-[hsl(var(--chart-N)/0.12)] text-[hsl(var(--chart-N))]. - Row hover; a status legend above the table.
success/destructiveare for genuine good/bad meaning only — never decoration.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

