[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M699E855ZZE5JQQVPDGM78Y3":3,"skill-same:01M699E855ZZE5JQQVPDGM78Y3":99},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":8,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":18,"categories":19,"keywords":30,"publishedAt":54,"linkOnly":55,"markdownContent":56,"markdownBody":57,"frontMatter":58,"refName":60,"commitSha":61,"skillDirectory":62,"forksCount":63,"repositoryHtmlUrl":64,"repositoryHomepageUrl":17,"ownerHtmlUrl":65,"ownerBlogUrl":66,"ownerDescription":67,"updatedAt":68,"install":69,"resources":82},"01M699E855ZZE5JQQVPDGM78Y3","find-untested-sources","未测试源文件查找","MANDATORY for static source-to-test pairing: find or list source files\u002Fmodules without corresponding tests, or suggest test locations from repository structure. Invoke even for a tiny package; do not substitute manual globbing. Uses Roslyn for C#\u002F.NET and tree-sitter for Python, TS\u002FJS, Go, Java, Rust, Ruby, Kotlin, Swift, PowerShell, and C++. DO NOT USE FOR: real line\u002Fbranch\u002FCobertura data, coverage-backed test priorities, CRAP risk, or grading existing tests.","静态源文件与测试配对的必需技能：查找或列出没有对应测试的源文件\u002F模块，或根据仓库结构建议测试位置。即使是极小的包也应调用，不要用手动 glob 搜索替代。对 C#\u002F.NET 使用 Roslyn，对 Python、TS\u002FJS、Go、Java、Rust、Ruby、Kotlin、Swift、PowerShell 和 C++ 使用 tree-sitter。不要用于：真实的行\u002F分支\u002FCobertura 数据、基于覆盖率的测试优先级、CRAP 风险或对现有测试进行评分。","microsoft\u002Ftestfx","microsoft","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F6154722?v=4","01M698VYDXZ6JW5WH3CRV650R8","Microsoft","01M699C71CJ91B5WZ3AXG3GG2M",1059,"MIT",null,"https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Ftestfx\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Ffind-untested-sources\u002FSKILL.md",[20,25],{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},"01M8BQGD5WG86P4AQ5GPSSKBFR","测试工程师","PROFESSION","适用职业",{"categoryNo":26,"categoryName":27,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8BQJH394GT47X57A9Q8G7HX","测试与质量保障","SCENARIO","使用场景",[31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53],"sources","find untested sources","find","branch","invoke","static","line","grading","structure","priorities","files","modules","coverage","list","swift","ruby","powershell","data","repository","test","rust","python","go","2026-11-10 10:12:30",false,"---\nname: find-untested-sources\ndescription: >\n  MANDATORY for static source-to-test pairing: find or list source files\u002Fmodules\n  without corresponding tests, or suggest test locations from repository\n  structure. Invoke even for a tiny package; do not substitute manual globbing.\n  Uses Roslyn for C#\u002F.NET and tree-sitter for Python, TS\u002FJS, Go, Java, Rust,\n  Ruby, Kotlin, Swift, PowerShell, and C++. DO NOT USE FOR: real\n  line\u002Fbranch\u002FCobertura data, coverage-backed test priorities, CRAP risk, or\n  grading existing tests.\nlicense: MIT\n---\n\n# Find Untested Sources\n\n## Purpose\n\nCoverage tools answer \"which lines were executed?\" — they require a green build\nand a passing test run, which is minutes-to-tens-of-minutes on a real repo. The\nquestion this skill answers is different and much cheaper:\n\n> _Which source files have no test file referencing any of their declared\n> types\u002Fsymbols?_\n\nThat's the question an agent asks **before** writing a new test — and it can be\nanswered statically in a few seconds by parsing source files, with **no build,\nno dependency resolution, and no compilation**. The output is a deterministic\ntest-pairing map that lets the agent pick the next file to test without reading\nthe entire codebase first.\n\n## Two engines — pick one\n\nThis skill ships two interchangeable analyzers with a compatible JSON contract:\n\n| Engine | Script | Use when |\n|--------|--------|----------|\n| **Roslyn (C#)** | `scripts\u002FFind-UntestedSources.cs` | The repo is **.NET-only**. Parses every `.cs` file with the Roslyn syntax API and does strict **namespace disambiguation**, so it is materially more accurate on duplicated short names like `Settings` or `Context`. |\n| **tree-sitter (polyglot)** | `scripts\u002Ffind_untested_sources.py` | The repo is **not exclusively C#**, or you want one tool across C#, Python, TypeScript\u002FJavaScript, Go, Java, Rust, Ruby, Kotlin, Swift, PowerShell, and C++. |\n\nFor a .NET-only repository, **prefer the Roslyn engine** — its namespace-aware\npairing beats the polyglot engine's identifier overlap.\n\n## Required workflow\n\n1. Use the narrowest repository or package root named by the caller. Do not scan\n   a parent workspace when the request identifies a subdirectory.\n2. Execute the appropriate analyzer once. Do not replace analyzer execution with\n   manual globbing, filename matching, or visual inspection.\n   For polyglot analysis, pass `--include-tested` when the answer must distinguish\n   paired sources from unpaired sources.\n   \"Static pairing only\" prohibits compiling the target repository and running\n   its tests; it does not prohibit launching this skill's parse-only analyzer.\n   State that distinction briefly when the caller also says \"do not build.\"\n   Treat analyzer dependencies as environment prerequisites: do not install\n   packages, try the wrong engine, build the repository, or fall back to a manual\n   scan when an analyzer invocation fails. Report the prerequisite failure instead.\n3. Base the result on the analyzer's JSON. Preserve its paired\u002Funpaired\n   classification and suggested relative path; do not guess a different path.\n4. When the caller named a subdirectory, prefix analyzer-relative paths with\n   that subdirectory so reported paths are workspace-relative.\n5. Report the requested result plus the static-pairing coverage caveat. Do not\n   append build, package-install, test-run, or coverage commands. When paired\n   sources exist, name their covering test files so the unpaired classification\n   is auditable.\n\n## When to Use\n\n- User asks \"where should I add tests based on source pairing?\", \"which files\n  have no tests?\", \"find unpaired source files\", or \"give me a static test gap\n  list\".\n- Before invoking a test-generation agent, to produce a source-pairing worklist.\n- After generating tests, to verify each new test file pairs to a source file.\n- To enumerate \"weakly paired\" source files (only one referring test) for\n  follow-up depth checks.\n\n## When Not to Use\n\n- **Line\u002Fbranch coverage** — use `coverage-analysis`.\n- **Priorities derived from real coverage data** — use `coverage-analysis`.\n- **CRAP-score \u002F risk hotspots** — use `coverage-analysis`.\n- **Are existing tests strong?** — use `test-gap-analysis` (mutation reasoning)\n  or `assertion-quality`.\n\n## Roslyn engine (C#)\n\n### Prerequisites\n\n- .NET SDK that supports file-based apps (`dotnet run script.cs`). Pinned in the\n  repo's `global.json` (SDK 11 preview or later).\n- No internet access required beyond the initial NuGet restore of\n  `Microsoft.CodeAnalysis.CSharp` on first run.\n\n### Usage\n\n```powershell\n# From the skill folder\ndotnet run scripts\u002FFind-UntestedSources.cs -- \u003Crepo-root> [--top N]\n\n# Save the report\ndotnet run scripts\u002FFind-UntestedSources.cs -- \u003Crepo-root> > pairing.json\n\n# Iterate the untested list, highest-API-surface first\n$report = Get-Content pairing.json | ConvertFrom-Json\n$report.untested | Select-Object -First 10 source, decl_count, suggested_test_path\n```\n\nDiagnostics go to stderr; JSON goes to stdout.\n\n### Output schema\n\n```jsonc\n{\n  \"repo\": \"\u003Cabsolute path>\",\n  \"elapsed_ms\": 8883,\n  \"counts\": {\n    \"source_files\": 3036,\n    \"test_files\": 867,\n    \"untested_files\": 1852,\n    \"paired_files\": 1184\n  },\n  \"untested\": [\n    {\n      \"source\": \"src\u002FFoo\u002FBar.cs\",\n      \"decl_count\": 8,            \u002F\u002F # of type declarations in the file\n      \"suggested_test_path\":      \u002F\u002F mirror of source under a discovered test project\n        \"tests\u002FFoo.Tests\u002FBar\u002FBarTests.cs\"\n    }\n  ],\n  \"source_to_tests\": {\n    \"src\u002FFoo\u002FBaz.cs\": [\n      \"tests\u002FFoo.Tests\u002FBazTests.cs\",\n      \"tests\u002FFoo.IntegrationTests\u002FScenarios\u002FBazScenarios.cs\"\n    ]\n  }\n}\n```\n\n### How it works\n\n1. **File discovery** — recursive walk pruning `bin\u002F`, `obj\u002F`, `node_modules\u002F`,\n   `.git\u002F`, `.vs\u002F`, `packages\u002F`, and any dotted subdir. Skips generated files\n   (`.g.cs`, `.Designer.cs`, `.AssemblyInfo.cs`).\n2. **Test vs source classification** — walks up to the nearest `.csproj` and\n   marks it a test project if the project name ends in `.Tests`, `.Test`,\n   `.UnitTests`, `.IntegrationTests`, `.E2E`, `.EndToEnd`, `.Spec`, `.Specs`, or\n   the content references `Microsoft.NET.Test.Sdk`, `MSTest.Sdk`,\n   `Microsoft.Testing.Platform`, `xunit`, `NUnit`, `TUnit`, or\n   `\u003CIsTestProject>true\u003C\u002FIsTestProject>`.\n3. **Source index (parallel)** — parse each source file with\n   `CSharpSyntaxTree.ParseText` (syntax only, no compilation); record every\n   `BaseTypeDeclarationSyntax` \u002F `DelegateDeclarationSyntax` as\n   `(ShortName, EnclosingNamespace, FilePath)`.\n4. **Test scan (parallel)** — parse each test file, collect `using` directives +\n   enclosing namespace, walk every `IdentifierToken`, look it up in the\n   short-name index, and **disambiguate strictly**: an identifier is attributed\n   only if the declaration's namespace matches one of the test file's `using`\n   directives, the enclosing namespace, or a prefix of them. This avoids noise\n   where common names like `Settings` or `Context` match every project.\n5. **Pairing & suggestion** — invert into `source → [tests]`. Build a\n   production-to-test project map from `\u003CProjectReference>` entries; for each\n   untested source, mirror its in-project relative path under the referencing\n   test project to suggest a path.\n6. **JSON emit** — ordered by declaration count desc, then alphabetical.\n\n## Polyglot engine (tree-sitter)\n\n### Prerequisites\n\n- Python 3.10+.\n- `pip install tree-sitter-language-pack` (single self-contained wheel that\n  bundles parsers for 300+ languages and the high-level `process()` API). No\n  native build, no per-language grammar install.\n\n### Usage\n\n```powershell\n# From the skill folder\npython scripts\u002Ffind_untested_sources.py \u003Crepo-root>\n\n# Restrict to a language (repeatable)\npython scripts\u002Ffind_untested_sources.py \u003Crepo-root> --lang python --lang typescript\n\n# Truncate the report (top 20 by declared API surface)\npython scripts\u002Ffind_untested_sources.py \u003Crepo-root> --limit-untested 20 > pairing.json\n\n# Iterate, highest-API-surface first\n$report = Get-Content pairing.json | ConvertFrom-Json\n$report.untested_sources | Select-Object -First 10 path, declaration_count, suggested_test_path\n```\n\nPass `--include-tested` to additionally emit `tested_sources` (omitted by\ndefault to keep the payload small for LLM consumption). Diagnostics go to\nstderr; JSON goes to stdout.\n\n### Output schema\n\n```jsonc\n{\n  \"repo_root\": \"\u003Cabsolute path>\",\n  \"summary\": {\n    \"source_files\": 3138,\n    \"test_files\": 761,\n    \"tested_source_files\": 1419,\n    \"untested_source_files\": 1719,\n    \"orphan_test_files\": 15,\n    \"languages\": [\"csharp\"]\n  },\n  \"untested_sources\": [\n    {\n      \"path\": \"src\u002FFoo\u002FBar.cs\",\n      \"language\": \"csharp\",\n      \"declaration_count\": 8,\n      \"declarations\": [\"Bar\", \"BarOptions\", \"IBar\", \"...\"],\n      \"suggested_test_path\": \"src\u002FFoo\u002FBarTests.cs\"\n    }\n  ],\n  \"orphan_tests\": [\n    { \"path\": \"tests\u002FSomeIntegrationTest.cs\", \"language\": \"csharp\" }\n  ]\n}\n```\n\n### How it works\n\n1. **File discovery** — recursive walk pruning common build\u002Fvendor dirs (`bin`,\n   `obj`, `node_modules`, `target`, `dist`, `build`, `vendor`, `__pycache__`,\n   `.venv`, `.git`, …) and generated files (`.d.ts`, `.g.cs`, `.Designer.cs`,\n   `_pb2.py`, `*.min.js`, `AssemblyInfo.cs`, …).\n2. **Language detection** — `detect_language_from_path` maps the extension to a\n   supported language; unknown extensions are skipped.\n3. **Test-vs-source classification** — per-language path heuristics:\n\n   | Language | Test rule |\n   |---|---|\n   | Python | path contains `tests\u002F`\u002F`test\u002F`; or filename starts with `test_` or ends `_test.py`; or `conftest.py`. |\n   | JS\u002FTS\u002FTSX | path contains `__tests__`, `tests`, `test`, `spec`, `e2e`; or filename contains `.test.`\u002F`.spec.`. |\n   | Go | filename ends `_test.go`. |\n   | Java | path contains `test`\u002F`tests`; or filename ends `Test.java`\u002F`Tests.java`. |\n   | Rust | path contains `tests\u002F`\u002F`benches\u002F`. |\n   | C# | path contains `tests\u002F`; or project segment ends `.Tests`\u002F`.Test`\u002F`.UnitTests`\u002F`.IntegrationTests`; or filename ends `Tests`\u002F`Test`. |\n   | Ruby | path contains `spec\u002F`\u002F`test\u002F`; or filename ends `_spec.rb`\u002F`_test.rb`. |\n   | Kotlin | path contains `test\u002F`\u002F`tests\u002F`\u002F`spec\u002F`; or filename ends `Test.kt`\u002F`Tests.kt`\u002F`Spec.kt`. |\n   | Swift | path contains `test\u002F`\u002F`tests\u002F`\u002F`uitests\u002F`\u002F`integrationtests\u002F` (case-insensitive); or filename ends `Test.swift`\u002F`Tests.swift`. |\n   | PowerShell | path contains `test\u002F`\u002F`tests\u002F`\u002F`pester\u002F`; or filename ends `.Tests.ps1`\u002F`.Test.ps1`. |\n   | C++ | path contains `test\u002F`\u002F`tests\u002F`\u002F`testing\u002F`; or filename starts `test_` or ends `_test.cpp`\u002F`_tests.cpp`. |\n\n4. **Per-file extraction** — `process(text, ProcessConfig(structure, imports,\n   symbols))` returns declared items, raw import statements, and a flat declared\n   -name list.\n5. **Pairing** — for each test file, union **import resolution** (per language,\n   e.g. Python `from pkg.mod import x` → `pkg\u002Fmod.py`; Java `import a.b.C;` →\n   `a\u002Fb\u002FC.java`; C# `using` is namespace-not-file, so a no-op) with **identifier\n   overlap** (word-like tokens, length ≥ 4, matched against declared names).\n6. **JSON emit** — `untested_sources` ordered by declaration count descending.\n\n## Limitations (be honest with the agent)\n\nBoth engines are static, parse-only heuristics that trade a little accuracy for\norders-of-magnitude lower cost than coverage. Known gaps:\n\n- **Reflection \u002F DI-resolved types** referenced only via a string name or\n  container resolution won't be detected — the type's short name never appears\n  in the test source.\n- **Extension methods** invoked as instance methods (C#): the declaring static\n  class is not named, so its file is not credited.\n- **`var`, target-typed `new()`, pattern matching** lose the type token; the\n  file-level union usually still catches it through other references.\n- **Short identifier names** (polyglot, \u003C 4 chars) are dropped to avoid noisy\n  pairings on names like `id`, `db`, `Tag`.\n- **Monorepo path aliases** (TS path mapping, Java module-info) are not\n  resolved; a suffix-match fallback may pick the wrong source if two files share\n  a trailing path segment.\n\nFor these cases, run actual coverage (`coverage-analysis`) on the unpaired\ncandidates the agent has already triaged.\n\nAlways label the final result as a static pairing heuristic, not evidence of\nline or branch coverage. Include that caveat even when every requested source\nfile has an obvious matching or missing test.\n\n## Outputs the agent should consume\n\n- `untested[*].source` \u002F `untested_sources[*].path` — pick the next source file\n  to test (highest declaration count first).\n- `*.suggested_test_path` — drop-in target for the new test file; the Roslyn\n  engine honors the test project that already `\u003CProjectReference>`s the source's\n  project, so `dotnet sln add` is not needed. The polyglot engine may suggest a\n  co-located test when no test root is discoverable. When a source sibling is\n  already paired, its test directory is the established convention and must be\n  reused for the missing sibling rather than falling back to source co-location.\n- `source_to_tests` (Roslyn) \u002F `--include-tested` `tested_sources` (polyglot) —\n  verify a newly written test file lands in the list for the intended source.\n- `orphan_tests` (polyglot) — tests that don't reference any same-language\n  source file; useful for triaging stale or integration-only tests.\n","# Find Untested Sources\n\n## Purpose\n\nCoverage tools answer \"which lines were executed?\" — they require a green build\nand a passing test run, which is minutes-to-tens-of-minutes on a real repo. The\nquestion this skill answers is different and much cheaper:\n\n> _Which source files have no test file referencing any of their declared\n> types\u002Fsymbols?_\n\nThat's the question an agent asks **before** writing a new test — and it can be\nanswered statically in a few seconds by parsing source files, with **no build,\nno dependency resolution, and no compilation**. The output is a deterministic\ntest-pairing map that lets the agent pick the next file to test without reading\nthe entire codebase first.\n\n## Two engines — pick one\n\nThis skill ships two interchangeable analyzers with a compatible JSON contract:\n\n| Engine | Script | Use when |\n|--------|--------|----------|\n| **Roslyn (C#)** | `scripts\u002FFind-UntestedSources.cs` | The repo is **.NET-only**. Parses every `.cs` file with the Roslyn syntax API and does strict **namespace disambiguation**, so it is materially more accurate on duplicated short names like `Settings` or `Context`. |\n| **tree-sitter (polyglot)** | `scripts\u002Ffind_untested_sources.py` | The repo is **not exclusively C#**, or you want one tool across C#, Python, TypeScript\u002FJavaScript, Go, Java, Rust, Ruby, Kotlin, Swift, PowerShell, and C++. |\n\nFor a .NET-only repository, **prefer the Roslyn engine** — its namespace-aware\npairing beats the polyglot engine's identifier overlap.\n\n## Required workflow\n\n1. Use the narrowest repository or package root named by the caller. Do not scan\n   a parent workspace when the request identifies a subdirectory.\n2. Execute the appropriate analyzer once. Do not replace analyzer execution with\n   manual globbing, filename matching, or visual inspection.\n   For polyglot analysis, pass `--include-tested` when the answer must distinguish\n   paired sources from unpaired sources.\n   \"Static pairing only\" prohibits compiling the target repository and running\n   its tests; it does not prohibit launching this skill's parse-only analyzer.\n   State that distinction briefly when the caller also says \"do not build.\"\n   Treat analyzer dependencies as environment prerequisites: do not install\n   packages, try the wrong engine, build the repository, or fall back to a manual\n   scan when an analyzer invocation fails. Report the prerequisite failure instead.\n3. Base the result on the analyzer's JSON. Preserve its paired\u002Funpaired\n   classification and suggested relative path; do not guess a different path.\n4. When the caller named a subdirectory, prefix analyzer-relative paths with\n   that subdirectory so reported paths are workspace-relative.\n5. Report the requested result plus the static-pairing coverage caveat. Do not\n   append build, package-install, test-run, or coverage commands. When paired\n   sources exist, name their covering test files so the unpaired classification\n   is auditable.\n\n## When to Use\n\n- User asks \"where should I add tests based on source pairing?\", \"which files\n  have no tests?\", \"find unpaired source files\", or \"give me a static test gap\n  list\".\n- Before invoking a test-generation agent, to produce a source-pairing worklist.\n- After generating tests, to verify each new test file pairs to a source file.\n- To enumerate \"weakly paired\" source files (only one referring test) for\n  follow-up depth checks.\n\n## When Not to Use\n\n- **Line\u002Fbranch coverage** — use `coverage-analysis`.\n- **Priorities derived from real coverage data** — use `coverage-analysis`.\n- **CRAP-score \u002F risk hotspots** — use `coverage-analysis`.\n- **Are existing tests strong?** — use `test-gap-analysis` (mutation reasoning)\n  or `assertion-quality`.\n\n## Roslyn engine (C#)\n\n### Prerequisites\n\n- .NET SDK that supports file-based apps (`dotnet run script.cs`). Pinned in the\n  repo's `global.json` (SDK 11 preview or later).\n- No internet access required beyond the initial NuGet restore of\n  `Microsoft.CodeAnalysis.CSharp` on first run.\n\n### Usage\n\n```powershell\n# From the skill folder\ndotnet run scripts\u002FFind-UntestedSources.cs -- \u003Crepo-root> [--top N]\n\n# Save the report\ndotnet run scripts\u002FFind-UntestedSources.cs -- \u003Crepo-root> > pairing.json\n\n# Iterate the untested list, highest-API-surface first\n$report = Get-Content pairing.json | ConvertFrom-Json\n$report.untested | Select-Object -First 10 source, decl_count, suggested_test_path\n```\n\nDiagnostics go to stderr; JSON goes to stdout.\n\n### Output schema\n\n```jsonc\n{\n  \"repo\": \"\u003Cabsolute path>\",\n  \"elapsed_ms\": 8883,\n  \"counts\": {\n    \"source_files\": 3036,\n    \"test_files\": 867,\n    \"untested_files\": 1852,\n    \"paired_files\": 1184\n  },\n  \"untested\": [\n    {\n      \"source\": \"src\u002FFoo\u002FBar.cs\",\n      \"decl_count\": 8,            \u002F\u002F # of type declarations in the file\n      \"suggested_test_path\":      \u002F\u002F mirror of source under a discovered test project\n        \"tests\u002FFoo.Tests\u002FBar\u002FBarTests.cs\"\n    }\n  ],\n  \"source_to_tests\": {\n    \"src\u002FFoo\u002FBaz.cs\": [\n      \"tests\u002FFoo.Tests\u002FBazTests.cs\",\n      \"tests\u002FFoo.IntegrationTests\u002FScenarios\u002FBazScenarios.cs\"\n    ]\n  }\n}\n```\n\n### How it works\n\n1. **File discovery** — recursive walk pruning `bin\u002F`, `obj\u002F`, `node_modules\u002F`,\n   `.git\u002F`, `.vs\u002F`, `packages\u002F`, and any dotted subdir. Skips generated files\n   (`.g.cs`, `.Designer.cs`, `.AssemblyInfo.cs`).\n2. **Test vs source classification** — walks up to the nearest `.csproj` and\n   marks it a test project if the project name ends in `.Tests`, `.Test`,\n   `.UnitTests`, `.IntegrationTests`, `.E2E`, `.EndToEnd`, `.Spec`, `.Specs`, or\n   the content references `Microsoft.NET.Test.Sdk`, `MSTest.Sdk`,\n   `Microsoft.Testing.Platform`, `xunit`, `NUnit`, `TUnit`, or\n   `\u003CIsTestProject>true\u003C\u002FIsTestProject>`.\n3. **Source index (parallel)** — parse each source file with\n   `CSharpSyntaxTree.ParseText` (syntax only, no compilation); record every\n   `BaseTypeDeclarationSyntax` \u002F `DelegateDeclarationSyntax` as\n   `(ShortName, EnclosingNamespace, FilePath)`.\n4. **Test scan (parallel)** — parse each test file, collect `using` directives +\n   enclosing namespace, walk every `IdentifierToken`, look it up in the\n   short-name index, and **disambiguate strictly**: an identifier is attributed\n   only if the declaration's namespace matches one of the test file's `using`\n   directives, the enclosing namespace, or a prefix of them. This avoids noise\n   where common names like `Settings` or `Context` match every project.\n5. **Pairing & suggestion** — invert into `source → [tests]`. Build a\n   production-to-test project map from `\u003CProjectReference>` entries; for each\n   untested source, mirror its in-project relative path under the referencing\n   test project to suggest a path.\n6. **JSON emit** — ordered by declaration count desc, then alphabetical.\n\n## Polyglot engine (tree-sitter)\n\n### Prerequisites\n\n- Python 3.10+.\n- `pip install tree-sitter-language-pack` (single self-contained wheel that\n  bundles parsers for 300+ languages and the high-level `process()` API). No\n  native build, no per-language grammar install.\n\n### Usage\n\n```powershell\n# From the skill folder\npython scripts\u002Ffind_untested_sources.py \u003Crepo-root>\n\n# Restrict to a language (repeatable)\npython scripts\u002Ffind_untested_sources.py \u003Crepo-root> --lang python --lang typescript\n\n# Truncate the report (top 20 by declared API surface)\npython scripts\u002Ffind_untested_sources.py \u003Crepo-root> --limit-untested 20 > pairing.json\n\n# Iterate, highest-API-surface first\n$report = Get-Content pairing.json | ConvertFrom-Json\n$report.untested_sources | Select-Object -First 10 path, declaration_count, suggested_test_path\n```\n\nPass `--include-tested` to additionally emit `tested_sources` (omitted by\ndefault to keep the payload small for LLM consumption). Diagnostics go to\nstderr; JSON goes to stdout.\n\n### Output schema\n\n```jsonc\n{\n  \"repo_root\": \"\u003Cabsolute path>\",\n  \"summary\": {\n    \"source_files\": 3138,\n    \"test_files\": 761,\n    \"tested_source_files\": 1419,\n    \"untested_source_files\": 1719,\n    \"orphan_test_files\": 15,\n    \"languages\": [\"csharp\"]\n  },\n  \"untested_sources\": [\n    {\n      \"path\": \"src\u002FFoo\u002FBar.cs\",\n      \"language\": \"csharp\",\n      \"declaration_count\": 8,\n      \"declarations\": [\"Bar\", \"BarOptions\", \"IBar\", \"...\"],\n      \"suggested_test_path\": \"src\u002FFoo\u002FBarTests.cs\"\n    }\n  ],\n  \"orphan_tests\": [\n    { \"path\": \"tests\u002FSomeIntegrationTest.cs\", \"language\": \"csharp\" }\n  ]\n}\n```\n\n### How it works\n\n1. **File discovery** — recursive walk pruning common build\u002Fvendor dirs (`bin`,\n   `obj`, `node_modules`, `target`, `dist`, `build`, `vendor`, `__pycache__`,\n   `.venv`, `.git`, …) and generated files (`.d.ts`, `.g.cs`, `.Designer.cs`,\n   `_pb2.py`, `*.min.js`, `AssemblyInfo.cs`, …).\n2. **Language detection** — `detect_language_from_path` maps the extension to a\n   supported language; unknown extensions are skipped.\n3. **Test-vs-source classification** — per-language path heuristics:\n\n   | Language | Test rule |\n   |---|---|\n   | Python | path contains `tests\u002F`\u002F`test\u002F`; or filename starts with `test_` or ends `_test.py`; or `conftest.py`. |\n   | JS\u002FTS\u002FTSX | path contains `__tests__`, `tests`, `test`, `spec`, `e2e`; or filename contains `.test.`\u002F`.spec.`. |\n   | Go | filename ends `_test.go`. |\n   | Java | path contains `test`\u002F`tests`; or filename ends `Test.java`\u002F`Tests.java`. |\n   | Rust | path contains `tests\u002F`\u002F`benches\u002F`. |\n   | C# | path contains `tests\u002F`; or project segment ends `.Tests`\u002F`.Test`\u002F`.UnitTests`\u002F`.IntegrationTests`; or filename ends `Tests`\u002F`Test`. |\n   | Ruby | path contains `spec\u002F`\u002F`test\u002F`; or filename ends `_spec.rb`\u002F`_test.rb`. |\n   | Kotlin | path contains `test\u002F`\u002F`tests\u002F`\u002F`spec\u002F`; or filename ends `Test.kt`\u002F`Tests.kt`\u002F`Spec.kt`. |\n   | Swift | path contains `test\u002F`\u002F`tests\u002F`\u002F`uitests\u002F`\u002F`integrationtests\u002F` (case-insensitive); or filename ends `Test.swift`\u002F`Tests.swift`. |\n   | PowerShell | path contains `test\u002F`\u002F`tests\u002F`\u002F`pester\u002F`; or filename ends `.Tests.ps1`\u002F`.Test.ps1`. |\n   | C++ | path contains `test\u002F`\u002F`tests\u002F`\u002F`testing\u002F`; or filename starts `test_` or ends `_test.cpp`\u002F`_tests.cpp`. |\n\n4. **Per-file extraction** — `process(text, ProcessConfig(structure, imports,\n   symbols))` returns declared items, raw import statements, and a flat declared\n   -name list.\n5. **Pairing** — for each test file, union **import resolution** (per language,\n   e.g. Python `from pkg.mod import x` → `pkg\u002Fmod.py`; Java `import a.b.C;` →\n   `a\u002Fb\u002FC.java`; C# `using` is namespace-not-file, so a no-op) with **identifier\n   overlap** (word-like tokens, length ≥ 4, matched against declared names).\n6. **JSON emit** — `untested_sources` ordered by declaration count descending.\n\n## Limitations (be honest with the agent)\n\nBoth engines are static, parse-only heuristics that trade a little accuracy for\norders-of-magnitude lower cost than coverage. Known gaps:\n\n- **Reflection \u002F DI-resolved types** referenced only via a string name or\n  container resolution won't be detected — the type's short name never appears\n  in the test source.\n- **Extension methods** invoked as instance methods (C#): the declaring static\n  class is not named, so its file is not credited.\n- **`var`, target-typed `new()`, pattern matching** lose the type token; the\n  file-level union usually still catches it through other references.\n- **Short identifier names** (polyglot, \u003C 4 chars) are dropped to avoid noisy\n  pairings on names like `id`, `db`, `Tag`.\n- **Monorepo path aliases** (TS path mapping, Java module-info) are not\n  resolved; a suffix-match fallback may pick the wrong source if two files share\n  a trailing path segment.\n\nFor these cases, run actual coverage (`coverage-analysis`) on the unpaired\ncandidates the agent has already triaged.\n\nAlways label the final result as a static pairing heuristic, not evidence of\nline or branch coverage. Include that caveat even when every requested source\nfile has an obvious matching or missing test.\n\n## Outputs the agent should consume\n\n- `untested[*].source` \u002F `untested_sources[*].path` — pick the next source file\n  to test (highest declaration count first).\n- `*.suggested_test_path` — drop-in target for the new test file; the Roslyn\n  engine honors the test project that already `\u003CProjectReference>`s the source's\n  project, so `dotnet sln add` is not needed. The polyglot engine may suggest a\n  co-located test when no test root is discoverable. When a source sibling is\n  already paired, its test directory is the established convention and must be\n  reused for the missing sibling rather than falling back to source co-location.\n- `source_to_tests` (Roslyn) \u002F `--include-tested` `tested_sources` (polyglot) —\n  verify a newly written test file lands in the list for the intended source.\n- `orphan_tests` (polyglot) — tests that don't reference any same-language\n  source file; useful for triaging stale or integration-only tests.\n",{"name":5,"license":16,"description":59},"MANDATORY for static source-to-test pairing: find or list source files\u002Fmodules without corresponding tests, or suggest test locations from repository structure. Invoke even for a tiny package; do not substitute manual globbing. Uses Roslyn for C#\u002F.NET and tree-sitter for Python, TS\u002FJS, Go, Java, Rust, Ruby, Kotlin, Swift, PowerShell, and C++. DO NOT USE FOR: real line\u002Fbranch\u002FCobertura data, coverage-backed test priorities, CRAP risk, or grading existing tests.\n","main","f8f2bfd77819bb789d4736ce7db4a567a37fcf7e",".agents\u002Fskills\u002Ffind-untested-sources",315,"https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Ftestfx","https:\u002F\u002Fgithub.com\u002Fmicrosoft","https:\u002F\u002Fopensource.microsoft.com","Open source projects and samples from Microsoft","2026-11-14 14:01:43",{"source":9,"skillName":5,"commands":70,"prompt":80,"zipAvailable":81},[71,74,77],{"tool":72,"command":73},"npx","npx skills add microsoft\u002Ftestfx --skill find-untested-sources",{"tool":75,"command":76},"bunx","bunx skills add microsoft\u002Ftestfx --skill find-untested-sources",{"tool":78,"command":79},"pnpm","pnpm dlx skills add microsoft\u002Ftestfx --skill find-untested-sources","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Ftestfx\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Ffind-untested-sources\u002FSKILL.md",true,[83,89,95],{"path":84,"resourceType":85,"resourceTypeDesc":86,"sizeBytes":87,"sourceHtmlUrl":88},"agents\u002Fopenai.yaml","REFERENCE","参考文档",91,"https:\u002F\u002Fgithub.com\u002Fnichee\u002Fdotfiles\u002Fblob\u002Fmain\u002Fclaude\u002Fskills\u002Fqa\u002Fagents\u002Fopenai.yaml",{"path":90,"resourceType":91,"resourceTypeDesc":92,"sizeBytes":93,"sourceHtmlUrl":94},"scripts\u002Ffind_untested_sources.py","SCRIPT","脚本",27382,"https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Ftestfx\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Ffind-untested-sources\u002Fscripts\u002Ffind_untested_sources.py",{"path":96,"resourceType":91,"resourceTypeDesc":92,"sizeBytes":97,"sourceHtmlUrl":98},"scripts\u002FFind-UntestedSources.cs",16276,"https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Ftestfx\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Ffind-untested-sources\u002Fscripts\u002FFind-UntestedSources.cs",[100,126,155,180,204,232],{"skillNo":101,"name":102,"nameZh":17,"description":103,"descriptionZh":17,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":104,"categories":105,"keywords":106,"publishedAt":54},"01M70GYY0AV0JGMTHE2CN6TNYK","dotnet-breaking-changes","Use before changing .NET\u002FC# code whose callers you do not control: a NuGet library, or a repo with PublicAPI.Shipped\u002FUnshipped.txt, ApiCompat, multiple TargetFrameworks, InternalsVisibleTo, or generated (.g.cs) partials. Green builds miss silent breaks from optional parameters, parameter names, sealing, const values, nullability, and #if. USE FOR: \"without breaking existing callers\"; adding a public method, overload, optional parameter, or interface member to a shipped library; renaming a public method or an internal helper a friend assembly uses; consolidating duplicated logic; changing a signature, nullability, default, or attribute; adding a target framework; RS0016\u002FRS0017 or ApiCompat errors; \"is this PR breaking?\". For a rename, extract, or merge, also invoke csharp-refactoring. DO NOT USE FOR: an executable whose callers all live in one project; renaming a local variable or private member, even in a shipped library; formatting; framework\u002FSDK\u002FNuGet upgrades (use dotnet-upgrade).","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Ftestfx\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fdotnet-breaking-changes\u002FSKILL.md",[],[107,108,109,110,111,112,113,114,115,116,117,35,118,119,120,121,122,123,124,125],"dotnet","dotnet breaking changes","changes","green","project","default","local","errors","interface","generated","upgrade","you","code","refactoring","merge","rename","library","live","assembly",{"skillNo":127,"name":128,"nameZh":129,"description":130,"descriptionZh":131,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":132,"categories":133,"keywords":136,"publishedAt":54},"01M699HHE9DTZWAMPB1ZR7ZKSW","testfx-test-value-evidence","TestFx 测试值证据应用","Apply the vendored test-value-evidence skill with TestFx toolchain, assertion, parallel-safety, packed-consumer, and review conventions. Use when implementing or reviewing behavior-changing TestFx PRs or commits, including source-only changes.","结合 TestFx 工具链、断言、并行安全、打包消费者（packed-consumer）和评审约定，应用项目内置的 test-value-evidence 技能。在实现或评审会改变行为的 TestFx PR 或提交时使用，包括仅修改源代码的变更。","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Ftestfx\u002Fblob\u002Fmain\u002F.github\u002Fskills\u002Ftestfx-test-value-evidence\u002FSKILL.md",[134,135],{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},{"categoryNo":26,"categoryName":27,"taxonomyType":28,"taxonomyTypeDesc":29},[50,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,109,152,153,154],"testfx test value evidence","test value evidence","evidence","value","review","parallel","toolchain","commits","implementing","prs","only","use","when","apply","with","behavior","Safety","conventions",{"skillNo":156,"name":157,"nameZh":158,"description":159,"descriptionZh":160,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":161,"categories":162,"keywords":165,"publishedAt":54},"01M699HEYWH1B9XGNBFY8J2FZS","testfx-parallel-safety-preflight","TestFx 并行安全预检","Check concurrency and isolation before implementing or refactoring TestFx tests, lifecycle code, helpers, shared-state declarations, or production paths those tests exercise. Use before narrowing DoNotParallelize or ResourceLock, changing parallelization settings, or introducing asynchronous workers; repeat against the final diff.","在实现或重构 TestFx 测试、生命周期代码、辅助函数、共享状态声明，或这些测试所覆盖的生产代码路径之前，检查并发性与隔离性。在缩小 DoNotParallelize 或 ResourceLock 的使用范围、更改并行化设置或引入异步工作线程之前使用；并针对最终 diff 重复检查。","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Ftestfx\u002Fblob\u002Fmain\u002F.github\u002Fskills\u002Ftestfx-parallel-safety-preflight\u002FSKILL.md",[163,164],{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},{"categoryNo":26,"categoryName":27,"taxonomyType":28,"taxonomyTypeDesc":29},[166,153,167,142,168,169,145,170,119,171,120,172,173,174,175,176,177,178,148,179],"testfx parallel safety preflight","preflight","shared","asynchronous","exercise","concurrency","paths","isolation","helpers","diff","parallelization","lifecycle","tests","workers",{"skillNo":181,"name":182,"nameZh":183,"description":184,"descriptionZh":185,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":186,"categories":187,"keywords":190,"publishedAt":54},"01M699HC61ZV9GJ2C8JV03951G","testfx-localization-validation","TestFx 本地化校验","Validate generated TestFx localization catalogs, resource IDs, placeholders and locked tokens. Use for RESX\u002FXLF changes, OneLoc PRs, localization build failures, duplicate targets or units, and orphaned translation entries.","验证生成的 TestFx 本地化目录、资源 ID、占位符和锁定标记。适用于 RESX\u002FXLF 变更、OneLoc PR、本地化构建失败、重复的目标文本或翻译单元，以及孤立的翻译条目。","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Ftestfx\u002Fblob\u002Fmain\u002F.github\u002Fskills\u002Ftestfx-localization-validation\u002FSKILL.md",[188,189],{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},{"categoryNo":26,"categoryName":27,"taxonomyType":28,"taxonomyTypeDesc":29},[191,192,193,194,195,196,197,198,199,146,116,148,200,201,109,202,203],"testfx localization validation","validation","localization","validate","translation","ids","for","tokens","entries","units","duplicate","targets","build",{"skillNo":205,"name":206,"nameZh":207,"description":208,"descriptionZh":209,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":210,"categories":211,"keywords":214,"publishedAt":54},"01M699H9J2NWQXE4BDT6R0FH7S","testfx-acceptance-validation","TestFx 验收验证","Validate TestFx shipping paths and capable CI execution using packed consumers, package\u002Fcache provenance, exact exits and artifacts, and selected-versus-executed test evidence. Use for acceptance regressions, package\u002FMSBuild\u002Flauncher\u002Fprotocol changes, or skipped-only CI results; not for unrelated unit-only or documentation changes.","使用打包后的消费者、包与缓存来源、精确的退出码和产物，以及选中测试与实际执行测试的证据，验证 TestFx 的交付路径及有效的 CI 执行。适用于验收回归、包\u002FMSBuild\u002F启动器\u002F协议变更，或仅有跳过测试的 CI 结果；不适用于无关的纯单元测试或文档变更。","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Ftestfx\u002Fblob\u002Fmain\u002F.github\u002Fskills\u002Ftestfx-acceptance-validation\u002FSKILL.md",[212,213],{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},{"categoryNo":26,"categoryName":27,"taxonomyType":28,"taxonomyTypeDesc":29},[215,216,192,50,217,139,218,219,220,147,221,148,222,223,224,225,226,227,228,229,230,231,172,197],"testfx acceptance validation","acceptance","msbuild","launcher","ci","execution","package","cache","artifacts","provenance","documentation","unrelated","shipping","results","protocol","unit","ci results",{"skillNo":233,"name":234,"nameZh":235,"description":236,"descriptionZh":237,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":238,"categories":239,"keywords":246,"publishedAt":54},"01M699H70BB999BT4F627T1PHE","session-delivery-hygiene","会话交付规范管控","Gate local-session scope, persistent delivery, live PR state, integration provenance, and owned cleanup. Use before implementing guidance changes, changing or pushing PR work, diagnosing package\u002Foutput mismatches, or handing off implementation.","把控本地会话范围、持久化交付、实时 PR 状态、集成来源以及责任范围内的清理工作。在实施指导变更、修改或推送 PR、诊断包与产物不匹配，或交接实现工作之前使用。","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Ftestfx\u002Fblob\u002Fmain\u002F.github\u002Fskills\u002Fsession-delivery-hygiene\u002FSKILL.md",[240,243],{"categoryNo":241,"categoryName":242,"taxonomyType":23,"taxonomyTypeDesc":24},"01M8BQ6TQZN6R52WBJ9H8NRMQM","软件开发工程师",{"categoryNo":244,"categoryName":245,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8BR5V701HCN066VEP7H4812","代码仓库协作管理",[247,248,249,250,251,145,113,252,253,124,254,221,148,224,255,256,109,257,258,259],"session delivery hygiene","delivery","session","hygiene","scope","cleanup","work","pr","output","state","integration","guidance","gate"]