--- name: sharepoint-list-insight-report-generator description: Use this skill whenever the user asks for an insights/reporting analysis of a SharePoint list from a connected SharePoint knowledge source; first validate the list exists, then generate and save a single-file interactive HTML report to a pre-approved SharePoint destination whose audience is no broader than the source list and items, and return its SharePoint URL. --- Before starting, verify that configured SharePoint connector actions, agent flows, or equivalent tools can discover approved lists and their schemas, retrieve list items page by page, and invoke **Create file** to return the created file's URL or path. A SharePoint knowledge source alone does not guarantee these capabilities. If any capability is unavailable, stop and name the missing capability. ## Step 1 – Identify the Target List 1. Read the user request and identify the requested SharePoint list name. 2. Inspect the selected SharePoint knowledge source. 3. Retrieve all available SharePoint lists. 4. Perform a case-insensitive exact match on list title (and any explicit aliases in list metadata). 5. Proceed only on an exact match or an explicit user selection; otherwise stop and prompt the user to choose from the available lists. ### Validation Logic Before performing any analysis, enumerate all SharePoint lists available in the selected knowledge source. The requested data source must be explicitly mapped to an existing SharePoint list. Allowed conditions to continue: - Exact list name match. - User explicitly selects a list from the available lists. - Alias defined in list metadata. Forbidden behavior: - Do not infer lists from business terminology. - Do not infer lists from column names. - Do not infer lists from data values. - Do not infer lists from semantic similarity. - Do not select a list because it appears related. Examples: User request: Create a report for Campaign Available lists: - Campaign - Product Catalog Result: Proceed with Campaign. User request: Create a report for sales data Available lists: - Campaign - Product Catalog Result: Stop. Return available lists. Ask the user to select one. User request: Create a report for quarterly revenue Available lists: - Campaign - Product Catalog Result: Stop. Do not select Campaign. ### If the requested list does not exist: - Stop the process immediately. - Do not analyze data. - Do not generate a report. - Return all available SharePoint lists. - Return closest matching list names. Proceed only if the requested list exists. For example: if the user requests "sales" and only a "Product" list exists that happens to contain sales-related data, stop and ask the user to choose an existing list from the knowledge source. --- ## Step 2 – Discover List Structure Retrieve: - List title - Internal name - Item count - Created date - Last modified date - All columns - Column types - Required fields - Indexed fields - Lookup fields - Choice fields - Person fields - Managed metadata fields Generate a schema summary. --- ## Step 3 – Analyze Data Analyze all accessible records within the confirmed scope, retrieving them page by page through the configured tool and following its continuation tokens. Before retrieving a detailed report, enforce the tool's row and report-size limits; when either limit is absent, also use a conservative cap of 1,000 rows. If the scope would exceed an applicable limit, ask the user to narrow it. Never silently truncate or sample records. Generate: ### General Statistics - Total records - Distinct values - Missing values - Data completeness score ### Trend Analysis - Monthly trends - Annual trends - Growth trends ### Category Analysis - Top categories - Frequency distribution - Ranking statistics ### Ownership Analysis - Records by owner - Top contributors ### Quality Analysis - Empty fields - Duplicate values - Potential anomalies --- ## Step 4 – Generate Insights Create business-oriented insights. Examples: - Most used categories - Fastest growing areas - Data quality issues - Process bottlenecks - Trends and anomalies Prioritize actionable recommendations. --- ## Step 5 – Build Interactive HTML Report Produce a single HTML file with all CSS and JavaScript embedded inline, except that Chart.js (version 4) may be loaded from an exact versioned CDN URL with matching SRI `integrity` metadata and `crossorigin="anonymous"` as the only permitted external dependency. If the exact version and matching SRI cannot be verified, do not load the CDN asset and use embedded browser APIs instead. Do not use external Bootstrap, DataTables, fonts, stylesheets, scripts, or other CDN resources. Implement table filtering, sorting, pagination, and responsive styling using embedded CSS and JavaScript. Treat SharePoint field names and values as untrusted data. Use a real JSON serializer; before embedding serialized data in a `