.squad/skills/project-conventions/SKILL.md
Core conventions and patterns for ExcelMcp
npx skillsauth add sbroenne/mcp-server-excel project-conventionsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
ExcelMcp is a Windows-only toolset for programmatic Excel automation via COM interop, with TWO equal entry points: MCP Server (for AI assistants) and CLI (for scripting/agents). .NET/C# codebase.
Core commands NEVER wrap batch.Execute() in try-catch that returns error results. Let exceptions propagate naturally — batch.Execute() handles them via TaskCompletionSource.
// ✅ CORRECT
return await batch.Execute((ctx, ct) => {
// operation
return ValueTask.FromResult(new OperationResult { Success = true });
});
// ❌ WRONG — double-wraps, loses stack context
try { return await batch.Execute(...); }
catch (Exception ex) { return new OperationResult { Success = false, ErrorMessage = ex.Message }; }
ALL dynamic COM objects must be released in finally blocks using ComUtilities.Release(ref obj!). NEVER use catch blocks to swallow exceptions.
Success == true ⟹ ErrorMessage == null || ErrorMessage == "". Set Success in try block, always false in catch.
isError: true for business errors; throw McpException for validationAnsiConsole.MarkupLineerror field for compatibility and add richer diagnostics additively (errorMessage, isError, exceptionType, hresult, innerError) instead of renaming contracts in place.ServiceResponse transport first so both entry points receive the same failure detail.[Description("...")] attributes to each exposed parameter that needs to appear in the published schema./// <param> comments are not enough by themselves for MCP client discoverability; verify the live schema with an integration test that calls ListToolsAsync().tests/ExcelMcp.Core.Tests/, tests/ExcelMcp.McpServer.Tests/, tests/ExcelMcp.CLI.Tests/dotnet test tests/ExcelMcp.Core.Tests --filter "Feature=<name>&RunType!=OnDemand"success=false, isError=true, error == errorMessage, expected exceptionType, and scenario-specific presence/absence of errorCategory, hresult, and innerError.1 on business-error paths (for example, missing sheet or invalid input). If the setup command itself returns non-JSON stdout, treat that as startup/harness noise and surface raw stdout/stderr in the helper exception instead of misclassifying it as a contract failure.ServiceAction coverage and current MCP tool docs first.TreatWarningsAsErrors=true with .NET analyzerssrc/ExcelMcp.ComInterop/ — COM patterns, STA threading, sessions
src/ExcelMcp.Core/ — Excel business logic, commands
src/ExcelMcp.Service/ — Session management, command routing
src/ExcelMcp.McpServer/ — MCP protocol tools
src/ExcelMcp.CLI/ — Command-line interface
src/ExcelMcp.Generators*/ — Source generators
tests/ — Integration tests (no unit tests)
skills/shared/ — Single source of truth for docs/prompts
Before classifying a formatting bug as missing functionality, check both range and range_format.
range owns value/formula-adjacent display formats such as set-number-formatrange_format owns visual styling and layout actions such as format-range, auto-fit-columns, and auto-fit-rowsIf the capability already exists under one of those tools, treat it as a discoverability/API-shape issue first, not a backend feature gap.
For real batching work, prefer existing list-of-objects patterns over ad hoc JSON blobs. IRangeEditCommands.Sort(... List<SortColumn> ...) is a precedent that the shared surface can carry structured collections cleanly.
queryTable.Refresh(false) (synchronous).IClassFixture<T> AND [Collection("...")].set-values fails with ArgumentOutOfRangeException, inspect for jagged List<List<object?>> input before blaming COM.Before assigning a bug to Core, check three things in order:
Use this especially for reports that claim a hard product limit or a missing feature. Wide-range failures and formatting gaps are often mis-triaged when tests or tool surfaces already cover the scenario elsewhere.
tools
Excel CLI automation skill for Windows workbooks. Use when a coding agent needs token-efficient, scriptable, or unattended Excel automation via excelcli commands. Best for CI/CD, scheduled jobs, batch processing, PowerShell workflows, and bulk workbook edits. Supports Power Query, DAX, PivotTables, Tables, Ranges, Charts, VBA, Data Models, screenshots, and formatting. Triggers: excelcli, Excel CLI, command line, batch, script, automation, CI/CD, scheduled, PowerShell, unattended, coding agent, workbook processing.
tools
Excel MCP Server skill for Windows workbook automation. Use when an assistant needs rich MCP tools to create, inspect, modify, format, or analyze Excel files. Supports Power Query (M), Data Model/DAX, PivotTables, Tables, Ranges, Charts, Slicers, formatting, screenshots, VBA macros, connections, and calculation mode. Triggers: Excel, spreadsheet, workbook, xlsx, xlsm, Power Query, DAX, PivotTable, chart, dashboard, VBA, MCP.
development
Core conventions and patterns for this codebase
data-ai
{what this skill teaches agents}