* chore: refresh coding agent setup Remove the unused Squad configuration and align Copilot instructions with the current generated architecture. Add deterministic Windows cloud-agent dependency setup. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: b6c52095-fe7c-4482-8789-f490af2ffad3 * docs: update generated surface checklist Replace obsolete hand-written MCP wiring steps in the pull request template with the current generator and parity checks. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: b6c52095-fe7c-4482-8789-f490af2ffad3 --------- Copilot-Session: b6c52095-fe7c-4482-8789-f490af2ffad3
6.5 KiB
applyTo, excludeAgent
| applyTo | excludeAgent |
|---|---|
| .github/workflows/**/*.yml,**/*.csproj,global.json | code-review |
Development Workflow
Required process for all contributions
Branch Protection
⛔ NEVER commit directly to main
Enforced: PR reviews, CI/CD checks, create a branch first, up-to-date branches, no force pushes
Merge Strategy: Squash Merge
All PRs are merged using squash merge (single commit to main). This keeps git history clean and makes it easy to revert changes if needed. When you merge a PR:
- GitHub automatically squashes all commits from your branch into one commit
- Commit message is auto-populated from PR title/description — verify it's accurate before confirming merge
- Your feature branch can be safely deleted after merge
Development Process
- Create feature branch:
git checkout -b feature/name - Standards: Zero warnings, targeted tests pass, docs updated, security rules followed
- PR Checklist: Build passes, applicable tests pass, docs updated, patterns followed, changeset added when user-visible
- Check PR review comments: After creating PR, retrieve automated review feedback and fix all verified issues
- Versions: Automated via release workflow - don't update manually
PR Review Comment Workflow
After creating a PR, ALWAYS check for automated review comments:
# Retrieve inline code review comments using GitHub CLI
# ⚠️ IMPORTANT: for this public repo, gh CLI must be authenticated as a PERSONAL GitHub account.
# Enterprise Managed User (EMU) accounts cannot access public repos via gh CLI.
# Verify with: gh auth status
# If needed, select the personal account's token (Copilot CLI exposes it as an env var):
# $env:GH_TOKEN = $env:COPILOT_GH_ACCOUNT_github_2E_com_sbroenne # then verify: gh api user --jq '.login'
# (Admin ops — rulesets, disabling workflows, deleting runs — require this personal token, not the EMU account.)
gh api repos/sbroenne/mcp-server-excel/pulls/PULL_NUMBER/comments --paginate
Common automated reviewers:
- Copilot (code quality, performance, style)
- github-advanced-security (security scanning, code analysis)
Common issues to fix:
- Improper
/// <inheritdoc/>on constructors/test methods that don't override .AsSpan().ToString()inefficiency - use[..n]range operator instead- Nullable type access without null checks
foreach→.Select()for functional style- Nested if statements that can be combined
- Generic catch clauses - use specific exceptions or add justification
- Path.Combine security warnings - suppress with justification for test code
Fix all automated review comments before requesting human review.
Test Execution
See testing-strategy.instructions.md for complete test commands.
Quick reference:
- Development:
Category=Integration&RunType!=OnDemand&Feature!=VBA&Feature!=VBATrust - Session/batch changes: run
RunType=OnDemandinExcelMcp.ComInterop.Tests - Core OnDemand tests are environment-specific diagnostics and stay outside required CI
- VBA tests:
(Feature=VBA|Feature=VBATrust)&RunType!=OnDemand
CI/CD Workflows
Automated on Pull Requests:
ci.yml(CI Gate) - Release build + Excel-free audit gates + Excel-free CLI/MCP build smoke (always runs on PRs tomain, so it can be a required check). GitHub-hosted runners have no Excel, so Excel-dependent gates stay local-only in the pre-commit hook.codeql.yml- Security analysisdependency-review.yml- Dependency security scanning
Excel-Dependent Local Verification:
- GitHub-hosted runners do not have Excel, and the repository has no self-hosted Excel runner.
- Before merge, run the relevant Excel integration tests locally with an explicit timeout when changes affect the Core, CLI, or MCP runtime path.
- Run
& .\scripts\Test-E2E.ps1only for those runtime-impacting changes. This includes changes undersrc/ExcelMcp.ComInterop,src/ExcelMcp.Core,src/ExcelMcp.Service,src/ExcelMcp.CLI,src/ExcelMcp.McpServer, and source generators that feed CLI or MCP. - Plugin/build/publish, marketplace, skill, documentation, and test-only changes do not require Excel E2E unless the same commit also changes one of those runtime paths.
- For merge commits, pre-commit evaluates the staged result relative to the incoming merge parent so already-validated changes imported from
maindo not trigger unrelated Excel E2E. - Record the result and check the E2E attestation in the pull request template only when Excel E2E is applicable and finishes without failures or unresolved issues.
Workflow Config Updates
⚠️ Update ALL workflows when changing:
- .NET SDK version (
global.json+ all workflows) - Assembly/package names (
.csproj+ workflow references) - Runtime requirements (target framework + release notes)
- Project structure (path filters + build commands)
Quality Enforcement
Build Settings: TreatWarningsAsErrors=true, analyzers enabled
Security Rules (Errors): CA2100 (SQL injection), CA3003 (file path injection), CA3006 (process injection), CA5389 (archive traversal), CA5390 (hardcoded encryption), CA5394 (insecure randomness)
Release Process (Maintainers)
Release: Use workflow_dispatch on the release workflow with version bump (major/minor/patch) or custom version. Releases ALL components with same version:
- MCP Server → NuGet + ZIP
- CLI → NuGet + ZIP
- VS Code Extension → Marketplace + VSIX
- MCPB → Claude Desktop bundle
Before Releasing:
- Nothing manual — changesets accumulate in
.changeset/from individual PRs; the release workflow compiles them intoCHANGELOG.mdautomatically - Go to Actions → Release All Components → Run workflow
- Select version bump type (patch/minor/major) or enter a custom version
Workflow calculates version → builds all components → creates git tag → GitHub release with all artifacts
Quick release from terminal:
gh workflow run release.yml -f version_bump=patch # or minor/major
GitHub Issue Comment Protocol
ALWAYS verify @mention usernames before posting comments on issues or PRs.
- Read the issue/PR to confirm the actual author's GitHub handle
- Use the correct handle in @mentions — never guess from display names
- Wrong @mentions are embarrassing and may notify the wrong person
- When posting on multiple issues in sequence, re-verify each author (they differ!)
Key Principles
- Feature branches mandatory
- Tests required
- CI/CD must pass
- Documentation updated
- Version management automated
- Security enforced