tdd
यह क्या करती है
यह स्किल एजेंट को पहले टेस्ट लिखकर, फिर उसे पास करने वाला सबसे छोटा कोड लिखकर निर्माण का मार्गदर्शन देती है। यह उन डेवलपर के लिए है जो चाहते हैं कि हर बदलाव कोड से पहले लिखे गए टेस्ट से साबित हो।
कब इस्तेमाल करें
- ✓जब आप नया व्यवहार एक-एक छोटे कदम में टेस्ट-पहले बनवाना चाहें।
- ✓जब आप चाहें कि कोई बग पहले ऐसा टेस्ट लिखकर ठीक हो जो उसे दोबारा पैदा करे।
- ✓जब आप चाहें कि टेस्ट कोड से नहीं, किसी भरोसेमंद स्रोत से लिखे जाएँ।
Skill का लिंक
https://github.com/Yeachan-Heo/oh-my-claudecode/blob/main/skills/tdd/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“हमारी प्राइसिंग स्पेक के उदाहरणों का इस्तेमाल करके डिस्काउंट नियम को टेस्ट-पहले बनाइए, एक छोटे कदम में।”
हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।
यह कैसे काम करती है
एजेंट तय बिंदु पर अगला टेस्ट लिखता है, पुष्टि करता है कि वह अपेक्षित कारण से फ़ेल होता है, और फिर उसे पास कराने वाला सबसे छोटा बदलाव लिखता है। यह चक्र दोहराया जाता है, और रिफ़ैक्टरिंग को बाद की समीक्षा के चरण के लिए रखा जाता है।
तकनीकी सामग्री (मूल SKILL.md)
लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।
TDD
Red-green in small steps, at seams that were agreed in advance. In a launch run the seam list is C2's approved output; outside launch, agree the seams with the user before the first test exists — a seam nobody approved gets no tests.
The loop
One test → one implementation → repeat:
- Write the next test at a seam. Run it. Watch it fail for the reason you expect — a test that cannot fail is not a test.
- Implement the smallest change that turns it green.
- Repeat. Each test is a tracer bullet: a narrow but complete path through the behavior, not a layer finished in isolation.
Rules
- Expected values come from an independent source of truth — a spec line, a worked example, a documented output. Never from the implementation under test: a test that asserts what the code happens to do is a mirror, not a check.
- Substitute at the seam's declared boundary class only — in-process, locally substitutable, owned-remote port, or true-external, the class C2 records for each seam. No substitutes inside the boundary the test is exercising.
- Refactoring is not part of the loop. It belongs to the review stage; the repair worker owns it. Do not refactor mid-red-green.
- A bug fix starts with the failing test that reproduces it — reproduction before theory, the debugger's rule.
- When proposing a seam, say in one line what it catches and what it lets through — a seam choice nobody can price is a guess, not a decision.
When no seam fits
If the behavior cannot be tested at any approved seam, stop and say so: report the missing seam as a finding (it feeds architecture-survey and refit) rather than inventing a seam or testing through internals.
Output
- The seam list used, with boundary classes and each seam's catch/miss line
- Red/green evidence — the failing run and the passing run
- Any seam-absence findings
अक्सर पूछे जाने वाले सवाल
क्या टेस्ट वही लिखते हैं जो कोड करता है?
नहीं। अपेक्षित मान किसी स्वतंत्र स्रोत से आते हैं, जैसे स्पेक या कार्य उदाहरण, न कि परीक्षण किए जा रहे कोड से।
टेस्ट कहाँ लिखे जाने चाहिए?
सिर्फ़ पहले से तय बिंदुओं पर, ताकि ऐसे बिंदु के लिए टेस्ट न लिखा जाए जिसे किसी ने मंज़ूर न किया हो।
रिफ़ैक्टरिंग कब होती है?
लाल-हरे चक्र के भीतर नहीं। वह बाद के समीक्षा चरण में होती है।
जानकारी
लेखक का मूल विवरण
Test-first at pre-agreed seams — one test, one implementation, tracer-bullet red/green; independent expected values; substitutions only at the seam's boundary class; launch Phase 4 reference.
लोकप्रियता
- GitHub स्टार
- 41k
- रैंकिंग में स्थान
- #7027
- लाइसेंस
- MIT
- अपडेट की गई
- 2/11/2026
कमेंट
- …
इस repository की और skills
agent-doc-discipline
41kयह आपके एजेंट को ऐसे निर्देश लिखना सिखाती है जिन्हें दूसरे AI एजेंट बिना अतिरिक्त समझ के फ़ॉलो कर सकें।
ai-slop-cleaner
41kयह आपके एजेंट को AI से लिखे गए ऐसे कोड को साफ़ करने में मदद करती है जो चलता है पर फूला हुआ या दोहराव वाला है, बिना उसका व्यवहार बदले।
architecture-survey
41kयह आपके एजेंट को कोडबेस की संरचना देखकर उन हिस्सों की सूची बनाने में मदद करती है जिन्हें बदलना कठिन होता जा रहा है, सबूत के साथ, बिना खुद कुछ बदले।
ask-navigator
41kयह आपके एजेंट को एक धुंधले प्रोजेक्ट को साफ़ फ़ैसले वाले सवालों के नक्शे में बदलने में मदद करती है, फिर उन्हें एक-एक करके हल करती है।
मिलती-जुलती skills
test-driven-development
311kयह आपके एजेंट को किसी भी फ़ीचर या सुधार से पहले पहले असफल होने वाला टेस्ट लिखना, उसे असफल होते देखना, फिर पास करने वाला सबसे छोटा कोड लिखना सिखाती है।
verification-before-completion
311kयह आपके एजेंट को किसी काम, सुधार या build के पूरा या पास होने का दावा करने से पहले असली जांच चलाकर उसका आउटपुट पढ़ना सिखाती है।
migrate-to-shoehorn
310kआपकी टेस्ट फ़ाइलों में जोखिम भरे type casts की जगह shoehorn लाइब्रेरी लगाती है, ताकि टेस्ट अधूरे डेटा से भी type checks पास कर सकें।