- Home
- Skills
- Frontend & Web Apps
- customer segmentation dashboard
Works with the AI Agents you already use
customer segmentation dashboard
by Naveen S
A Flask and React dashboard for automated K-Means customer segmentation, KPI tracking, and PDF/Excel reporting.
Free
customer segmentation dashboard
Example session with this skill installed
I need to add a new API endpoint that returns the top 10 customers by Revenue for the current session and display this as a new table component in the AI Insights page.
- Read your context and instructions
- Compiled the customer segmentation dashboard
- Generated the UI component
I have implemented the new endpoint in the backend and created the corresponding UI component in the frontend.
Implementation Details
Backend: backend/data_processor.py
Added a helper to extract top customers from the current session dataframe.
def get_top_customers(df, n=10):
if df is None or df.empty:
return []
top_df = df.sort_values(by='Revenue', ascending=False).head(n)
# Convert numpy types for JSON safety
return top_df.to_dict(orient='records')
Backend: backend/app.py
Registered the new route and wired it to the session data.
@app.route('/api/top-customers', methods=['GET'])
def top_customers():
session_id = get_session_id()
df = SESSIONS.get(session_id, {}).get('df')
data = get_top_customers(df)
return safe_json(data)
Frontend: frontend/src/utils/api.js
Added the API call to the client.
export const fetchTopCustomers = (sessionId) =>
api.get('/top-customers', { headers: { 'X-Session-ID': sessionId } });
Frontend: frontend/src/pages/AIInsights.jsx
Integrated the new table component to display the data.
Next steps
- Restart the backend to register the new
/api/top-customersroute. - Run
npm run devin the frontend directory to view the new table in the Insights tab. - Verify the
Revenuecolumn exists in your uploaded CSV to ensure data populates correctly.
AIInsights.jsx
TSX · React component
Example file from a real run - the skill writes it into your workspace.
Connects securely to your tools. The creator never sees your data.
About this skill
Manual customer segmentation is a bottleneck for marketing teams and developers alike. This skill provides a specialized environment for maintaining and extending a full-stack Customer Segmentation Dashboard, bridging the gap between raw scikit-learn clustering and a functional React UI. It eliminates the need to manually wire up data pipelines, standardise messy CSV headers, or build complex Recharts visualizations from scratch.
What it does
- Data Ingestion handles CSV, Excel, JSON, and Pickle files with automatic column normalization and cleaning.
- K-Means Clustering executes automated customer segmentation using scikit-learn, featuring automatic feature selection and segment labeling.
- KPI Generation calculates core metrics including CLV, purchase frequency, and revenue distributions.
- Interactive Visualization renders dynamic scatter plots, growth charts, and demographic breakdowns using Recharts.
- Export Engine generates professional Excel and PDF reports using openpyxl and reportlab.
- Deployment Readiness includes pre-configured Render blueprints and GitHub Actions for CI/CD.
How it works
- Upload a customer dataset through the React frontend to trigger the Flask
/uploadendpoint. - Process the data via the backend pipeline which detects columns, standardizes features, and runs the K-Means algorithm.
- Analyze the resulting segments, KPIs, and AI-generated insights within the dashboard views.
- Extend the system by adding new API routes in
app.pyor custom chart components in the Reactcomponents/directory.
Frameworks & tools
Built with Python 3.10+, Flask 3, scikit-learn, and pandas on the backend. The frontend utilizes React 19, Vite, Tailwind CSS 4, and Recharts. Deployment is configured for Render and GitHub Actions.
Why this beats prompting it yourself
Generic prompts often fail to maintain the state between a Flask session and a React context. This skill understands the specific data flow between scikit-learn's standardized outputs and the frontend's expected JSON shape, ensuring new features don't break the existing clustering logic or export formatting.
Use cases
- Add custom business logic to the automated segment labeling system.
- Implement new visualization types for specific metrics like churn risk or loyalty.
- Extend file support to include proprietary database exports or specific CRM formats.
- Deploy a private analytics internal tool for marketing teams to bypass manual Excel work.
Known limitations
Uses in-memory session storage which requires a single-worker deployment. Datasets are limited to 50MB and the K-Means implementation defaults to 4 clusters unless modified in clustering.py.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Free to use
No account required to browse
Trust & safety
Security scan
Security scan passed 17 days ago
- Free with an Agensi account
- Accounts
GitHub
Opencollective
Eslint
Tidelift
- Software
Python
Node.js
Git
Permissions
Allowed Hosts
File Scopes
What's inside
Creator
Naveen S
Frequently Asked Questions
New in Frontend & Web Apps
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Frontend & Web Apps.