From c9b5c43103a57ac781f28ddbba8b2e86033145d7 Mon Sep 17 00:00:00 2001 From: Viktor Hofer Date: Mon, 16 Feb 2026 17:48:30 +0100 Subject: [PATCH 1/3] Add .NET/C# instructions to multi-language workflows --- .github/workflows/bot-detection.md | 2 +- .github/workflows/code-simplifier.md | 20 ++++++++++++++++++- .github/workflows/copilot-pr-merged-report.md | 2 ++ .github/workflows/pr-triage-agent.md | 4 ++-- .github/workflows/repo-audit-analyzer.md | 2 +- .../workflows/repository-quality-improver.md | 4 ++-- .github/workflows/shared/metrics-patterns.md | 4 ++-- 7 files changed, 29 insertions(+), 9 deletions(-) diff --git a/.github/workflows/bot-detection.md b/.github/workflows/bot-detection.md index 63f37c456b..ca3f9d7b0c 100644 --- a/.github/workflows/bot-detection.md +++ b/.github/workflows/bot-detection.md @@ -903,7 +903,7 @@ This workflow enforces determinism via a **precompute job**. - PR touches sensitive paths (any changed file matches): - `.github/workflows/` or `.github/actions/`: `+15` - `Dockerfile`, `Makefile`, `scripts/`, `actions/`: `+10` - - dependency manifests/lockfiles (`package.json`, `package-lock.json`, `pnpm-lock.yaml`, `yarn.lock`, `go.mod`, `go.sum`, `requirements*.txt`): `+6` + - dependency manifests/lockfiles (`package.json`, `package-lock.json`, `pnpm-lock.yaml`, `yarn.lock`, `go.mod`, `go.sum`, `requirements*.txt`, `*.csproj`, `Directory.Packages.props`): `+6` - Burst behavior: `+6` if the account authored `>= 5` issues/PRs in the window. - Near-duplicate content: `+8` if the account posted the same (or obviously templated) text `>= 3` times in the window. - New account age: `+8` if the account is `< 14 days` old. diff --git a/.github/workflows/code-simplifier.md b/.github/workflows/code-simplifier.md index ff01f82b42..c49c178018 100644 --- a/.github/workflows/code-simplifier.md +++ b/.github/workflows/code-simplifier.md @@ -72,7 +72,7 @@ Use GitHub tools to: For each merged PR or recent commit: - Use `pull_request_read` with `method: get_files` to list changed files - Use `get_commit` to see file changes in recent commits -- Focus on source code files (`.go`, `.js`, `.ts`, `.tsx`, `.cjs`, `.py`, etc.) +- Focus on source code files (`.go`, `.js`, `.ts`, `.tsx`, `.cjs`, `.py`, `.cs`, etc.) - Exclude test files, lock files, and generated files ### 1.3 Determine Scope @@ -95,6 +95,7 @@ Before simplifying, review the project's coding standards from relevant document - For Go projects: Check `AGENTS.md`, `DEVGUIDE.md`, or similar files - For JavaScript/TypeScript: Look for `CLAUDE.md`, style guides, or coding conventions - For Python: Check for style guides, PEP 8 adherence, or project-specific conventions +- For .NET/C#: Check `.editorconfig`, `Directory.Build.props`, or coding conventions in docs **Key Standards to Apply:** @@ -119,6 +120,14 @@ For **Python** projects: - Prefer explicit over implicit code - Use list/dict comprehensions where they improve clarity (not complexity) +For **.NET/C#** projects: +- Follow Microsoft C# coding conventions +- Use `var` only when the type is obvious from the right side +- Use file-scoped namespaces (`namespace X;`) where supported +- Prefer pattern matching over type casting +- Use `async`/`await` consistently, avoid `.Result` or `.Wait()` +- Use nullable reference types and annotate nullability + ### 2.2 Simplification Principles Apply these refinements to the recently modified code: @@ -203,6 +212,9 @@ npm test # For Python projects pytest + +# For .NET projects +dotnet test ``` If tests fail: @@ -224,6 +236,9 @@ npm run lint # For Python projects flake8 . || pylint . + +# For .NET projects +dotnet format --verify-no-changes ``` Fix any linting issues introduced by the simplifications. @@ -242,6 +257,9 @@ npm run build # For Python projects # (typically no build step, but check imports) python -m py_compile changed_files.py + +# For .NET projects +dotnet build ``` ## Phase 4: Create Pull Request diff --git a/.github/workflows/copilot-pr-merged-report.md b/.github/workflows/copilot-pr-merged-report.md index a423095c83..9481e63f4f 100644 --- a/.github/workflows/copilot-pr-merged-report.md +++ b/.github/workflows/copilot-pr-merged-report.md @@ -114,6 +114,7 @@ safeinputs-gh with args: "pr view --repo ${{ github.repository }} -- From the files list, count how many are test files: - Go test files: `*_test.go` - JavaScript test files: `*.test.js`, `*.test.cjs` +- .NET test files: `*Tests.cs`, `*Test.cs` - Count both added and modified test files **Step 2.3: Get Workflow Run Information** @@ -226,6 +227,7 @@ Create a concise report with the following structure: - **Test File Types**: - Go tests (`*_test.go`): [count] - JavaScript tests (`*.test.js`): [count] + - .NET tests (`*Tests.cs`): [count] ## Workflow Execution diff --git a/.github/workflows/pr-triage-agent.md b/.github/workflows/pr-triage-agent.md index a1ebb946e2..e439bd41c3 100644 --- a/.github/workflows/pr-triage-agent.md +++ b/.github/workflows/pr-triage-agent.md @@ -95,9 +95,9 @@ Determine category based on file patterns and PR description: **File Pattern Rules:** - **docs**: Changes only to `.md`, `.txt`, `.rst` files in `docs/`, `README.md`, `CHANGELOG.md` -- **test**: Changes only to `*_test.go`, `*_test.js`, `*.test.js` files +- **test**: Changes only to `*_test.go`, `*_test.js`, `*.test.js`, `*Tests.cs` files - **formatting**: Changes matching `.prettierrc`, `.editorconfig`, or whitespace-only diffs -- **chore**: Changes to `Makefile`, `.github/workflows/*.yml`, `go.mod`, `package.json`, CI configs +- **chore**: Changes to `Makefile`, `.github/workflows/*.yml`, `go.mod`, `package.json`, `*.csproj`, CI configs - **refactor**: Code changes with no new features or bug fixes (look for keywords: "refactor", "restructure", "reorganize") - **bug**: Keywords in title/description: "fix", "bug", "issue", "error", "crash" - **feature**: Keywords in title/description: "add", "implement", "new", "feature", "support" diff --git a/.github/workflows/repo-audit-analyzer.md b/.github/workflows/repo-audit-analyzer.md index aa769d5cd8..ac0e43cc21 100644 --- a/.github/workflows/repo-audit-analyzer.md +++ b/.github/workflows/repo-audit-analyzer.md @@ -119,7 +119,7 @@ tree -L 3 -d -I 'node_modules|.git|vendor' . || find . -type d -maxdepth 3 ! -pa ls -lh README* LICENSE* CONTRIBUTING* CODE_OF_CONDUCT* SECURITY* 2>/dev/null # Build and test files -find . -maxdepth 2 -name "Makefile" -o -name "*.mk" -o -name "package.json" -o -name "go.mod" -o -name "requirements.txt" -o -name "Cargo.toml" -o -name "pom.xml" -o -name "build.gradle" -o -name ".fsproj" -o -name "*.sln" +find . -maxdepth 2 -name "Makefile" -o -name "*.mk" -o -name "package.json" -o -name "go.mod" -o -name "requirements.txt" -o -name "Cargo.toml" -o -name "pom.xml" -o -name "build.gradle" -o -name "*.csproj" -o -name "*.fsproj" -o -name "*.sln" # Documentation find . -type d -name "docs" -o -name "documentation" -o -name "wiki" diff --git a/.github/workflows/repository-quality-improver.md b/.github/workflows/repository-quality-improver.md index e8f5b519fa..5936e609c5 100644 --- a/.github/workflows/repository-quality-improver.md +++ b/.github/workflows/repository-quality-improver.md @@ -172,14 +172,14 @@ SRC_LOC=$(find . -type f -name "*.go" ! -name "*_test.go" ! -path "./.git/*" | x echo "Test ratio: $(echo "scale=2; $TEST_LOC / $SRC_LOC" | bc)" # Test file count -find . -name "*_test.go" -o -name "*.test.js" | wc -l +find . -name "*_test.go" -o -name "*.test.js" -o -name "*Tests.cs" | wc -l ``` ### Security Analysis ```bash # Check for common security issues -grep -r "password\|secret\|api_key" --include="*.go" --include="*.js" . 2>/dev/null | grep -v "test" | wc -l +grep -r "password\|secret\|api_key" --include="*.go" --include="*.js" --include="*.cs" . 2>/dev/null | grep -v "test" | wc -l # Dependency vulnerability check (conceptual) go list -m all | head -20 diff --git a/.github/workflows/shared/metrics-patterns.md b/.github/workflows/shared/metrics-patterns.md index 77e80bac0b..5f6259b806 100644 --- a/.github/workflows/shared/metrics-patterns.md +++ b/.github/workflows/shared/metrics-patterns.md @@ -166,8 +166,8 @@ if [ -f /tmp/gh-aw/data/cloc_output.json ] && [ -s /tmp/gh-aw/data/cloc_output.j lines_of_code_total=$(jq '.SUM.code' /tmp/gh-aw/data/cloc_output.json) # Test LOC (find test files and measure) - # Scope: Files matching test patterns (*_test.go, *.test.js, *.test.cjs, test_*.py, *_test.py) - test_files=$(find . -name "*_test.go" -o -name "*.test.js" -o -name "*.test.cjs" -o -name "test_*.py" -o -name "*_test.py" 2>/dev/null) + # Scope: Files matching test patterns (*_test.go, *.test.js, *.test.cjs, test_*.py, *_test.py, *Tests.cs) + test_files=$(find . -name "*_test.go" -o -name "*.test.js" -o -name "*.test.cjs" -o -name "test_*.py" -o -name "*_test.py" -o -name "*Tests.cs" 2>/dev/null) if [ -n "$test_files" ]; then echo "$test_files" | xargs cloc --json --quiet > /tmp/gh-aw/data/test_cloc.json From 29bdcfc3068c38db871ee2ef12fb23d5de0954b4 Mon Sep 17 00:00:00 2001 From: Viktor Hofer Date: Mon, 16 Feb 2026 17:57:17 +0100 Subject: [PATCH 2/3] Add .slnx to solution file detection --- .github/workflows/repo-audit-analyzer.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/repo-audit-analyzer.md b/.github/workflows/repo-audit-analyzer.md index ac0e43cc21..509bd17224 100644 --- a/.github/workflows/repo-audit-analyzer.md +++ b/.github/workflows/repo-audit-analyzer.md @@ -119,7 +119,7 @@ tree -L 3 -d -I 'node_modules|.git|vendor' . || find . -type d -maxdepth 3 ! -pa ls -lh README* LICENSE* CONTRIBUTING* CODE_OF_CONDUCT* SECURITY* 2>/dev/null # Build and test files -find . -maxdepth 2 -name "Makefile" -o -name "*.mk" -o -name "package.json" -o -name "go.mod" -o -name "requirements.txt" -o -name "Cargo.toml" -o -name "pom.xml" -o -name "build.gradle" -o -name "*.csproj" -o -name "*.fsproj" -o -name "*.sln" +find . -maxdepth 2 -name "Makefile" -o -name "*.mk" -o -name "package.json" -o -name "go.mod" -o -name "requirements.txt" -o -name "Cargo.toml" -o -name "pom.xml" -o -name "build.gradle" -o -name "*.csproj" -o -name "*.fsproj" -o -name "*.sln" -o -name "*.slnx" # Documentation find . -type d -name "docs" -o -name "documentation" -o -name "wiki" From f21712113926019a66ad577b6afca1e6333dd913 Mon Sep 17 00:00:00 2001 From: Viktor Hofer Date: Mon, 16 Feb 2026 18:01:06 +0100 Subject: [PATCH 3/3] Apply suggestions from code review Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .github/workflows/copilot-pr-merged-report.md | 2 +- .github/workflows/pr-triage-agent.md | 2 +- .github/workflows/repository-quality-improver.md | 2 +- .github/workflows/shared/metrics-patterns.md | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/copilot-pr-merged-report.md b/.github/workflows/copilot-pr-merged-report.md index 9481e63f4f..b9742d0d31 100644 --- a/.github/workflows/copilot-pr-merged-report.md +++ b/.github/workflows/copilot-pr-merged-report.md @@ -227,7 +227,7 @@ Create a concise report with the following structure: - **Test File Types**: - Go tests (`*_test.go`): [count] - JavaScript tests (`*.test.js`): [count] - - .NET tests (`*Tests.cs`): [count] + - .NET tests (`*Tests.cs`, `*Test.cs`): [count] ## Workflow Execution diff --git a/.github/workflows/pr-triage-agent.md b/.github/workflows/pr-triage-agent.md index e439bd41c3..e11ea2fdc8 100644 --- a/.github/workflows/pr-triage-agent.md +++ b/.github/workflows/pr-triage-agent.md @@ -95,7 +95,7 @@ Determine category based on file patterns and PR description: **File Pattern Rules:** - **docs**: Changes only to `.md`, `.txt`, `.rst` files in `docs/`, `README.md`, `CHANGELOG.md` -- **test**: Changes only to `*_test.go`, `*_test.js`, `*.test.js`, `*Tests.cs` files +- **test**: Changes only to `*_test.go`, `*_test.js`, `*.test.js`, `*Tests.cs`, `*Test.cs` files - **formatting**: Changes matching `.prettierrc`, `.editorconfig`, or whitespace-only diffs - **chore**: Changes to `Makefile`, `.github/workflows/*.yml`, `go.mod`, `package.json`, `*.csproj`, CI configs - **refactor**: Code changes with no new features or bug fixes (look for keywords: "refactor", "restructure", "reorganize") diff --git a/.github/workflows/repository-quality-improver.md b/.github/workflows/repository-quality-improver.md index 5936e609c5..384ce6fcab 100644 --- a/.github/workflows/repository-quality-improver.md +++ b/.github/workflows/repository-quality-improver.md @@ -172,7 +172,7 @@ SRC_LOC=$(find . -type f -name "*.go" ! -name "*_test.go" ! -path "./.git/*" | x echo "Test ratio: $(echo "scale=2; $TEST_LOC / $SRC_LOC" | bc)" # Test file count -find . -name "*_test.go" -o -name "*.test.js" -o -name "*Tests.cs" | wc -l +find . -type f \( -name "*_test.go" -o -name "*.test.js" -o -name "*Tests.cs" -o -name "*Test.cs" \) | wc -l ``` ### Security Analysis diff --git a/.github/workflows/shared/metrics-patterns.md b/.github/workflows/shared/metrics-patterns.md index 5f6259b806..02a9f8e242 100644 --- a/.github/workflows/shared/metrics-patterns.md +++ b/.github/workflows/shared/metrics-patterns.md @@ -166,8 +166,8 @@ if [ -f /tmp/gh-aw/data/cloc_output.json ] && [ -s /tmp/gh-aw/data/cloc_output.j lines_of_code_total=$(jq '.SUM.code' /tmp/gh-aw/data/cloc_output.json) # Test LOC (find test files and measure) - # Scope: Files matching test patterns (*_test.go, *.test.js, *.test.cjs, test_*.py, *_test.py, *Tests.cs) - test_files=$(find . -name "*_test.go" -o -name "*.test.js" -o -name "*.test.cjs" -o -name "test_*.py" -o -name "*_test.py" -o -name "*Tests.cs" 2>/dev/null) + # Scope: Files matching test patterns (*_test.go, *.test.js, *.test.cjs, test_*.py, *_test.py, *Tests.cs, *Test.cs) + test_files=$(find . -name "*_test.go" -o -name "*.test.js" -o -name "*.test.cjs" -o -name "test_*.py" -o -name "*_test.py" -o -name "*Tests.cs" -o -name "*Test.cs" 2>/dev/null) if [ -n "$test_files" ]; then echo "$test_files" | xargs cloc --json --quiet > /tmp/gh-aw/data/test_cloc.json