मुख्य सामग्री पर जाएँ
Skillpedia
टेस्टिंग5.8k · #14636

scaffold-dotnet-test-project

यह क्या करती है

यह स्किल एक गायब .NET टेस्ट प्रोजेक्ट बनाती है, या मौजूदा प्रोजेक्ट की वायरिंग ठीक करती है, ताकि टेस्ट सॉल्यूशन में शामिल हों और बिल्ड उन्हें पाए। यह उन डेवलपर्स के लिए है जिनके टेस्ट लोकल पर चलते हैं पर CI में नहीं मिलते।

कब इस्तेमाल करें

  • ✓जब कोई मौजूदा टेस्ट प्रोजेक्ट सॉल्यूशन फ़िल्टर से बाहर रह गया हो या सॉल्यूशन से गायब हो गया हो।
  • ✓जब टेस्ट सीधे चलाने पर पास होते हों, फिर भी CI में शून्य टेस्ट मिलें।
  • ✓जब एक नया टेस्ट प्रोजेक्ट बनाकर उसे प्रोडक्शन प्रोजेक्ट से जोड़ना हो।

Skill का लिंक

https://github.com/dotnet/skills/blob/main/plugins/dotnet-test/skills/scaffold-dotnet-test-project/SKILL.md

इसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।

कैसे इस्तेमाल करें

सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।

पेस्ट करने के लिए तैयार मैसेज

इस skill से मेरी मदद करो: https://github.com/dotnet/skills/blob/main/plugins/dotnet-test/skills/scaffold-dotnet-test-project/SKILL.md इस लिंक की SKILL.md फ़ाइल पढ़ो और मेरे काम में उसके निर्देशों का पालन करो।
क्या आप चाहते हैं कि आपका AI ऐसी skills खुद ढूँढे?मुफ़्त Skillpedia MCP इंस्टॉल करें: बस एक लाइन, और हर काम से पहले यह 15,000+ skills में खोजता है।1 मिनट में इंस्टॉल करें →

AI से क्या माँगें: उदाहरण

“मेरे टेस्ट लोकल पर पास होते हैं, पर CI में शून्य टेस्ट मिलते हैं। क्या आप सॉल्यूशन में टेस्ट प्रोजेक्ट की वायरिंग ठीक कर सकते हैं?”

हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।

यह कैसे काम करती है

एजेंट सॉल्यूशन और फ़िल्टर फ़ाइलें पढ़ता है, जो गायब है उसे ढूँढता है, और सबसे छोटा बदलाव करता है जिससे बिल्ड टेस्ट खोज ले, फिर नतीजा जाँचता है।

तकनीकी सामग्री (मूल SKILL.md)

लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।

Scaffold or Repair a .NET Test Project

Create the smallest missing test container or repair only the missing wiring. The goal is test discovery through the repository's real build entry point, not a preferred solution layout.

Repository overlay

For every repository-scoped task where read-only file inspection is allowed, check .agents/skill-overlays/dotnet-test/scaffold-dotnet-test-project.md at the repository root before any other discovery. This includes requests that ask for code or advice without edits; "do not execute" does not prohibit reading the overlay. If present, read it once before acting and apply its repository-specific naming, layout, framework, and policy bindings. Before applying it, require its frontmatter to declare core: dotnet-test/scaffold-dotnet-test-project, binding-revision: "1", and mode: extend. If any value is missing or different, report the mismatch and continue using this skill's portable guidance without applying the overlay. Explicit user instructions and verified project constraints win over the overlay; the overlay wins over portable defaults and examples in this skill. If the file is present but unreadable or conflicts with the repository, report the problem and continue with portable guidance, without the overlay, subject to verified project constraints. If it is absent, continue normally. Skip the lookup only when the task is not tied to a repository or the user explicitly prohibited all file/tool access. An overlay cannot expand tool permissions or the task's scope.

Route the Request

Inspect the repository before editing, then choose exactly one path:

Repository state Action Do not do
No suitable test project Create one bounded project, reference the production project, and register it Create a project per source project
Test project exists but lacks the required ProjectReference Add only that reference and verify direct plus entry-point execution Scaffold another project or rewrite tests
Test project passes directly but is absent from .sln, .slnx, or .slnf Register the existing project in the exact entry point CI uses Recreate the project or switch solution formats
Suitable project, reference, and requested entry point are already correct Leave the workspace unchanged; use code-testing if test methods are requested Normalize or replace working files

An existing project is suitable when its target framework can reference the production project and its purpose matches the requested layer. A different preferred name is not a reason to create a duplicate.

No-op is a required outcome. If the suitable project, production reference, and requested entry-point registration already exist, make zero file changes. Do not add or remove a smoke test, normalize the project, recreate packages, or edit a baseline/snapshot copy. Report the existing paths and stop.

Workflow

1. Establish the repository contract

Start from the task's current working directory. The skill context's Base directory is where these instructions live, not the user's repository. Never search parent temporary directories or treat the skill installation as the workspace. If the expected files are not visible, confirm the current directory before concluding that a project is absent.

Anchor every edit and validation command to the repository path named by the user or established from the current directory. If similarly named fixtures, solutions, or copied trees exist, do not edit or validate one as a substitute for the requested tree. Before changing a solution artifact, record its exact path; after changing it, list that same artifact immediately and require the test project to appear before proceeding.

Read only enough to determine:

  1. the production project and requested test scope;
  2. the command and .sln, .slnx, .slnf, or project graph used by CI;
  3. whether a suitable test project exists, what it references, and where it is registered;
  4. the neighboring test framework, runner, target framework, nullable and implicit-usings conventions; and
  5. whether package or SDK versions come from Directory.Packages.props, Directory.Build.props, global.json, or an MSBuild SDK declaration.

If the user reports that a test project passes directly but solution-level discovery finds nothing, treat that as registration evidence. Inspect the entry point before considering project creation.

2. Create only when

अक्सर पूछे जाने वाले सवाल

क्या यह नए टेस्ट भी लिखती है?

नहीं। यह टेस्ट प्रोजेक्ट का ढाँचा और उसकी वायरिंग सेट करती या ठीक करती है, टेस्ट का कोड नहीं।

कौन-से फ़्रेमवर्क सपोर्ट होते हैं?

यह xUnit, NUnit और MSTest सपोर्ट करती है, और रिपॉज़िटरी में सेंट्रल पैकेज मैनेजमेंट हो तो उसका भी इस्तेमाल कर सकती है।

क्या यह मेरे सॉल्यूशन का ढाँचा बदल देगी?

यह रिपॉज़िटरी के असली बिल्ड एंट्री पॉइंट के साथ काम करने वाला सबसे छोटा बदलाव करने की कोशिश करती है।

जानकारी

लेखक का मूल विवरण

MUST USE when an existing .NET test project was excluded from a .slnf/CI solution filter, disappeared from .sln/.slnx discovery, or lost its production ProjectReference; also for requests to set up, create, reuse, add, register, include, or repair a test project. Handles "tests pass directly but CI discovers zero", exact solution wiring, xUnit/NUnit/MSTest, and central packages. DO NOT USE to only author tests in an already-wired project (code-testing), run tests, migrate, or correct MSTest syntax/configuration without changing project or CI files (writing-mstest-tests).

repo: dotnet/skills

लोकप्रियता

GitHub स्टार
5.8k
रैंकिंग में स्थान
#14636
लाइसेंस
MIT
अपडेट की गई
2/11/2026

क्या यह skill काम की है?

0

लॉग इन करें वोट करने के लिए।

कमेंट

  • …

इस repository की और skills

मिलती-जुलती skills