xiaohongshu
xiaohongshu
data-insights
Generate actionable insights from transaction data. Use when implementing insight generators, anomaly detection, or data analysis features for financial/tax tracking applications.
Full skill instructions
This skill provides patterns for generating actionable insights from transaction data, specifically designed for tax and expense tracking applications.
Detects small, frequent purchases that add up significantly.
Trigger Rules:
Severity Calculation:
severity = Math.min(10, Math.floor(cumulativeTotal / 25))
Query Pattern:
// Group by merchant, count occurrences, sum totals
const quietLeaks = transactions
.filter(t => parseFloat(t.totalAmount) <= 20)
.reduce((acc, t) => {
const key = t.merchant || 'Unknown';
if (!acc[key]) acc[key] = { count: 0, total: 0, transactions: [] };
acc[key].count++;
acc[key].total += parseFloat(t.totalAmount);
acc[key].transactions.push(t.id);
return acc;
}, {});
// Filter to those with 3+ occurrences and $50+ total
return Object.entries(quietLeaks)
.filter(([_, data]) => data.count >= 3 && data.total >= 50)
.map(([merchant, data]) => ({
type: 'QUIET_LEAK',
title: `${merchant} adds up`,
summary: `${data.count} purchases totaling $${data.total.toFixed(2)}`,
severityScore: Math.min(10, Math.floor(data.total / 25)),
supportingTransactionIds: data.transactions
}));
Identifies merchants or categories with unusually high effective tax rates.
Trigger Rules:
Severity Calculation:
severity = Math.min(10, Math.floor((effectiveTaxRate - 0.08) * 100))
Query Pattern:
const taxDrag = transactions.reduce((acc, t) => {
const key = t.merchant || 'Unknown';
const taxRate = parseFloat(t.taxAmount) / parseFloat(t.totalAmount);
if (!acc[key]) acc[key] = { totalSpent: 0, totalTax: 0, transactions: [] };
acc[key].totalSpent += parseFloat(t.totalAmount);
acc[key].totalTax += parseFloat(t.taxAmount);
acc[key].transactions.push(t.id);
return acc;
}, {});
return Object.entries(taxDrag)
.filter(([_, data]) => {
const effectiveRate = data.totalTax / data.totalSpent;
return effectiveRate > 0.09 && data.totalSpent >= 100;
})
.map(([merchant, data]) => {
const effectiveRate = data.totalTax / data.totalSpent;
return {
type: 'TAX_DRAG',
title: `High tax burden at ${merchant}`,
summary: `${(effectiveRate * 100).toFixed(1)}% effective tax rate on $${data.totalSpent.toFixed(2)}`,
severityScore: Math.min(10, Math.floor((effectiveRate - 0.08) * 100)),
supportingTransactionIds: data.transactions
};
});
Detects month-over-month jumps, duplicates, or unusual amounts.
Trigger Rules:
Severity Calculation:
// For outliers
severity = Math.min(10, Math.floor((amount / average - 1) * 2))
// For MoM spikes
severity = Math.min(10, Math.floor((percentIncrease - 50) / 10))
Query Pattern:
const average = transactions.reduce((sum, t) => sum + parseFloat(t.totalAmount), 0) / transactions.length;
// Find outliers
const outliers = transactions
.filter(t => parseFloat(t.totalAmount) > average * 2)
.map(t => ({
type: 'SPIKE',
title: `Unusual expense: $${parseFloat(t.totalAmount).toFixed(2)}`,
summary: `${t.merchant || 'Unknown'} - ${((parseFloat(t.totalAmount) / average - 1) * 100).toFixed(0)}% above average`,
severityScore: Math.min(10, Math.floor((parseFloat(t.totalAmount) / average - 1) * 2)),
supportingTransactionIds: [t.id]
}));
// Find duplicates
const potentialDuplicates = findDuplicates(transactions);
All insight generators must return this standardized format:
interface Insight {
type: 'QUIET_LEAK' | 'TAX_DRAG' | 'SPIKE' | 'DUPLICATE' | 'MOM_INCREASE';
title: string; // Short, attention-grabbing headline
summary: string; // 1-2 sentence explanation
severityScore: number; // 1-10 scale for ranking
supportingTransactionIds: string[]; // For drill-down
}
src/lib/insights/
├── index.ts # Main getInsights() function
├── types.ts # Insight interface definitions
├── generators/
│ ├── quiet-leaks.ts # detectQuietLeaks()
│ ├── tax-drag.ts # detectTaxDrag()
│ └── spikes.ts # detectSpikes()
└── __tests__/
├── quiet-leaks.test.ts
├── tax-drag.test.ts
└── spikes.test.ts
xiaohongshu
technical spec
product ux expert
database patterns
Conduct multi-agent task orchestration and workflow coordination.
Initialize project with Conductor artifacts (product definition,
Expert in web animations, transitions, and motion design using Framer Motion and CSS
Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...
PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.
Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...
Display project status, active tracks, and next actions
Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.
Generate, edit, and beat-sync AI video with leading models in one workspace.
The world's fastest calendar for remote work
Transform Your Design with AI Designer by ImgCreator.ai
Revolutionizing Video Production with AI-Powered Creativity
Extend an image past the frame and let AI fill the new aspect ratio.
Discover your celebrity doppelgänger with StarByFace!
ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.
Opus.ai: Revolutionize Your Web Experience