tdd
यह क्या करती है
यह स्किल एक बग फ़िक्स का मार्गदर्शन करती है जो एक केंद्रित रिग्रेशन टेस्ट से शुरू होता है। यह उन डेवलपर्स के लिए है जिन्हें यह सबूत चाहिए कि बग ठीक हुआ है और लौटेगा नहीं।
कब इस्तेमाल करें
- ✓जब आप टेस्ट-ड्रिवन डेवलपमेंट या रिग्रेशन टेस्ट माँगते हैं।
- ✓जब किसी बग का एक सरल, सस्ता टेस्ट हो जो टूटा व्यवहार दिखा सके।
- ✓जब आप ऐसा फ़िक्स चाहते हैं जिसे टेस्ट साबित करे कि वह लौटेगा नहीं।
Skill का लिंक
https://github.com/cursor/plugins/blob/main/harness/pstack/claude-code/skills/tdd/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“login बग ठीक कीजिए, लेकिन पहले एक विफल होने वाला टेस्ट लिखिए, ताकि हमें पता रहे कि वह सच में ठीक हुआ है।”
हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।
यह कैसे काम करती है
एजेंट बग का वर्णन करता है, एक छोटा टेस्ट लिखता है जिसे विफल होना चाहिए, उसे चलाकर विफलता की पुष्टि करता है, और फिर सबसे छोटा कोड बदलाव करता है जिससे टेस्ट पास हो। अगर सस्ता टेस्ट व्यावहारिक न हो, तो वह कोई और निकटतम जाँच इस्तेमाल करता है।
तकनीकी सामग्री (मूल SKILL.md)
लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।
TDD Bug Fix
When fixing a bug with a clear, cheap test path, make the broken behavior executable before changing production code. The goal is a focused regression test that fails before the fix and passes after it.
Do not force a test when it would be impractical. If the available test would require broad harness setup, brittle mocks, slow end-to-end infrastructure, production-only state, vague reproduction steps, or large unrelated fixture churn, skip adding a new test and use the closest useful verification instead.
Workflow
- Understand the bug. Identify the intended behavior, current behavior, affected path, and smallest observable reproduction.
- Choose the narrowest executable check. Prefer the closest unit, component, integration, or regression test already used for that codepath. If no practical test path is obvious, do not create one from scratch just to satisfy the workflow.
- Write the failing test first. Add the smallest focused test that would have caught the bug. The test should encode intended behavior, not mirror the current implementation.
- Run the new test before fixing. Confirm it fails for the intended reason. If it passes or fails for an unrelated reason, correct the test or reproduction before editing the implementation.
- Fix the bug. Make the smallest production change that satisfies the intended behavior while preserving nearby contracts.
- Rerun the regression test. Confirm the test now passes.
If a Failing Test Is Impractical
Use the closest executable regression check instead: a targeted script, manual reproduction command, browser automation, snapshot comparison, log assertion, or focused integration check.
Prefer no new test over a bad test. A bad test is one that mostly tests mocks, encodes current implementation details, depends on timing or unrelated global state, needs expensive infrastructure for a small fix, or would be deleted immediately after proving the fix.
Guardrails
- Do not change tests merely to match a wrong implementation.
- Do not weaken existing assertions unless the expected behavior has genuinely changed and the reason is clear.
- Keep the regression test focused on the bug. Avoid broad fixture churn or unrelated coverage expansion.
- If the bug is flaky, make the test deterministic where possible and document the signal being locked down.
- If the bug exposes a broader class of failures, first land the focused regression path, then consider additional sibling coverage.
Final Response
Report the evidence, not just the outcome:
- Name the failing-before test or executable check and the failure it produced.
- Name the passing-after test run and any nearby validation performed.
- If failing-before evidence could not be demonstrated, state why and describe the closest regression check used instead.
अक्सर पूछे जाने वाले सवाल
अगर कोई टेस्ट व्यावहारिक न हो तो?
स्किल उसे ज़बरदस्ती नहीं माँगती। वह उसके बजाय सबसे नज़दीकी उपयोगी जाँच इस्तेमाल करती है।
क्या टेस्ट को पहले विफल होना ज़रूरी है?
हाँ। नया टेस्ट फ़िक्स से पहले चलता है, ताकि पुष्टि हो कि वह सही कारण से विफल होता है।
टेस्ट पहले क्यों लिखें?
इससे पहले दिखता है कि बग मौजूद है, और बाद में दिखता है कि वह कब ठीक हुआ।
जानकारी
लेखक का मूल विवरण
Use only when the user explicitly asks for TDD, a failing test, or a regression test, OR when the bug has an obvious cheap local test target. Skip when the test path is unclear, expensive, integration-heavy, or not requested.
repo: cursor/plugins
लोकप्रियता
- GitHub स्टार
- 15k
- रैंकिंग में स्थान
- #10999
- लाइसेंस
- —
- अपडेट की गई
- 31/10/2026
कमेंट
- …
इस repository की और skills
advisor
15kअगर आप इसे चालू करते हैं, तो आपका एजेंट बड़े फ़ैसले से पहले या किसी त्रुटि में अटकने पर एक ज़्यादा शक्तिशाली दूसरे मॉडल से सलाह ले सकता है।
check-agent-compatibility
15kजाँचती है कि AI कोडिंग एजेंट किसी रिपॉज़िटरी को शुरू, सत्यापित और दस्तावेज़ित कर सकते हैं या नहीं, और एक अनुकूलता स्कोर के साथ मुख्य समस्याएँ लौटाती है।
cli-for-agents
15kआपके एजेंट को कमांड-लाइन टूल ऐसे डिज़ाइन या जाँचना सिखाती है कि AI एजेंट उन्हें बिना प्रॉम्प्ट चला सकें, साफ़ help टेक्स्ट और उदाहरणों के साथ।
continual-learning
15kपिछली चैट की समीक्षा का काम एक समर्पित मेमोरी अपडेटर को सौंपकर आपकी AGENTS.md नोट्स को अद्यतन रखती है।
मिलती-जुलती skills
test-driven-development
311kयह आपके एजेंट को किसी भी फ़ीचर या सुधार से पहले पहले असफल होने वाला टेस्ट लिखना, उसे असफल होते देखना, फिर पास करने वाला सबसे छोटा कोड लिखना सिखाती है।
verification-before-completion
311kयह आपके एजेंट को किसी काम, सुधार या build के पूरा या पास होने का दावा करने से पहले असली जांच चलाकर उसका आउटपुट पढ़ना सिखाती है।
migrate-to-shoehorn
310kआपकी टेस्ट फ़ाइलों में जोखिम भरे type casts की जगह shoehorn लाइब्रेरी लगाती है, ताकि टेस्ट अधूरे डेटा से भी type checks पास कर सकें।