Works with the AI Agents you already use

    customer segmentation dashboard

    by Naveen S

    1

    A Flask and React dashboard for automated K-Means customer segmentation, KPI tracking, and PDF/Excel reporting.

    Free

    Security scanned
    customer segmentation dashboard

    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

    1. Restart the backend to register the new /api/top-customers route.
    2. Run npm run dev in the frontend directory to view the new table in the Insights tab.
    3. Verify the Revenue column exists in your uploaded CSV to ensure data populates correctly.

    AIInsights.jsx

    TSX · React component

    Generated

    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

    1. Upload a customer dataset through the React frontend to trigger the Flask /upload endpoint.
    2. Process the data via the backend pipeline which detects columns, standardizes features, and runs the K-Means algorithm.
    3. Analyze the resulting segments, KPIs, and AI-generated insights within the dashboard views.
    4. Extend the system by adding new API routes in app.py or custom chart components in the React components/ 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. 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. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 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
    GitHubOpencollectiveEslintTidelift
    Software
    PythonNode.jsGit

    Permissions

    Terminal / Shell
    Network Access
    Read Files
    Write Files

    Allowed Hosts

    registry.npmjs.org
    opencollective.com
    eslint.org
    github.com
    tidelift.com
    api.github.com

    File Scopes

    backend/**/*.py
    backend/requirements.txt
    frontend/src/**/*.{js
    jsx
    css}
    frontend/*.{js
    json}
    frontend/.env.production
    render.yaml
    .github/workflows/*.yml
    *.bat
    Listed17 days ago

    What's inside

    Creator

    Naveen S

    Naveen S

    Frequently Asked Questions

    The skill includes the complete source code for both the Flask backend and React frontend, pre-configured deployment blueprints for Render, GitHub Actions workflows for CI/CD, and a sample dataset to get you started immediately.

    The system automatically handles CSV, Excel, JSON, and Pickle files. It features a normalization engine that maps various header names to standard fields, meaning you don't need to manually reformat your CRM exports before uploading.

    While the skill defaults to 4 clusters to ensure optimal performance, you can easily adjust the cluster count or the feature selection logic by modifying the 'clustering.py' configuration file included in the package.

    The dashboard is designed for Python 3.10+ environments and integrates seamlessly with any AI agent capable of managing full-stack web applications. It uses standard REST APIs, making it compatible with most modern orchestration frameworks.

    Unlike generic code snippets, this skill manages the complex state between scikit-learn's data outputs and React's visualization requirements. It ensures that any extensions you add won't break the existing data pipeline or reporting engine.

    Currently, the dashboard uses in-memory storage optimized for single-worker deployments and supports datasets up to 50MB. This makes it ideal for department-level tools or processing monthly marketing exports.

    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.

    Free