tdd-workflow
यह क्या करती है
यह स्किल London स्कूल शैली में test-driven development चक्र का मार्गदर्शन करती है, जहाँ निर्भरताओं को पहले mock किया जाता है। यह उन डेवलपर्स के लिए है जो टेस्ट के नेतृत्व में फ़ीचर चरण-दर-चरण बनाना चाहते हैं।
कब इस्तेमाल करें
- ✓जब आप फ़ीचर को बाहर से अंदर की ओर, टेस्ट पहले लिखकर बनाना चाहते हैं।
- ✓जब आप किसी नए व्यवहार के लिए स्पष्ट red, green, refactor क्रम चाहते हैं।
- ✓जब किसी कार्य को पूरा घोषित करने से पहले अंतिम टेस्ट परिणाम जाँचने हों।
Skill का लिंक
https://github.com/ruvnet/ruflo/blob/main/plugins/ruflo-testgen/skills/tdd-workflow/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“discount calculation को टेस्ट पहले लिखकर बनाइए, mocked pricing service के लिए एक विफल टेस्ट से शुरू करके।”
हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।
यह कैसे काम करती है
स्किल mocked निर्भरताओं के साथ एक विफल टेस्ट लिखती है, उसे चलाकर देखती है कि वह सही कारण से विफल हो रहा है, फिर उसे पास करने वाला सबसे सरल कोड लिखती है, और फिर refactor करती है। सफलता घोषित करने से पहले वह लक्ष्य और regression टेस्ट चलाती है और असली परिणाम दर्ज करती है।
तकनीकी सामग्री (मूल SKILL.md)
लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।
Follow the TDD London School (mock-first) approach:
- Write the failing test first -- define expected behavior with mocked dependencies
- Run the test -- confirm it fails for the right reason
- Implement minimal code -- make the test pass with the simplest solution
- Refactor -- clean up while keeping tests green
- Repeat -- add the next behavior
Before starting: mcp__plugin_ruflo-core_ruflo__hooks_pre-task({ description: "TDD: FEATURE_NAME" })
Before reporting the outcome, run the final target tests and the regression suite after the last edit. Record the actual commands, exit codes, whether tests ran, and failing test names. The initial red test is expected during TDD; only the final validation determines success.
Call mcp__plugin_ruflo-core_ruflo__hooks_post-task with the observed result, including when the task is abandoned or validation is interrupted. Set completed, targetTestsRan, and regressionTestsRan to true only when observed; use null for missing exit codes. Skipped or unrun validation is not success. Never substitute an expected result for an observed one.
The following example maps those observations to the hook input (tool-call notation):
const success = completed && targetTestsRan && regressionTestsRan
&& targetExitCode === 0 && regressionExitCode === 0;
mcp__plugin_ruflo-core_ruflo__hooks_post-task({
taskId: "tdd-FEATURE",
success,
storeResults: true,
task: JSON.stringify({
feature: "FEATURE",
targetCommand, targetExitCode, targetTestsRan,
regressionCommand, regressionExitCode, regressionTestsRan,
failingTestNames,
failureReason: success ? null : failureReason
})
});
On failure, report success: false and the failing test names in task. If the runner failed before identifying tests, or the task was abandoned, state that reason instead of inventing test names.
Principles:
- Mock external dependencies at boundaries
- Test behavior, not implementation
- One assertion per test when possible
- Descriptive names:
should [behavior] when [condition]
अक्सर पूछे जाने वाले सवाल
क्या शुरुआती विफल टेस्ट समस्या है?
नहीं। स्रोत कहता है कि इस तरीके में पहला लाल टेस्ट अपेक्षित है। सिर्फ़ अंतिम सत्यापन सफलता तय करता है।
सफलता किसे माना जाता है?
लक्ष्य टेस्ट और regression suite, दोनों असल में चलें और पास हों। छोड़े गए टेस्ट सफलता नहीं हैं।
क्या यह परिणाम दर्ज करता है?
हाँ। यह कार्य का परिणाम देखे गए परिणामों के साथ memory hooks को भेजता है।
जानकारी
लेखक का मूल विवरण
TDD London School workflow -- mock-first, outside-in test development
repo: ruvnet/ruflo
लोकप्रियता
- GitHub स्टार
- 81k
- रैंकिंग में स्थान
- #1701
- लाइसेंस
- MIT
- अपडेट की गई
- 2/11/2026
कमेंट
- …
इस repository की और skills
agent-adaptive-coordinator
81kआपके एजेंट को काम बदलने पर AI एजेंटों के समूह को बाँटने और फिर से संतुलित करने में मदद करती है, और काम के हिसाब से लेआउट चुनती है।
agent-agent
81kआपके एजेंट को बड़े लक्ष्य को क्रमबद्ध कार्यों की योजना में बदलना सिखाती है, और स्थिति बदलने पर योजना फिर से बनाना भी।
agent-agentic-payments
81kAI खरीदारी के लिए खर्च के आदेश मैनेज करने में मदद करती है, जिसमें खर्च की सीमा, समय अवधि, व्यापारी नियम और signed मंज़ूरियाँ शामिल हैं।
agent-analyze-code-quality
81kआपके एजेंट को कोड की गुणवत्ता जाँचने में मदद करती है, बिना फ़ाइलें बदले code smells, technical debt और refactoring के सुझाव खोजकर।
मिलती-जुलती skills
test-driven-development
311kयह आपके एजेंट को किसी भी फ़ीचर या सुधार से पहले पहले असफल होने वाला टेस्ट लिखना, उसे असफल होते देखना, फिर पास करने वाला सबसे छोटा कोड लिखना सिखाती है।
verification-before-completion
311kयह आपके एजेंट को किसी काम, सुधार या build के पूरा या पास होने का दावा करने से पहले असली जांच चलाकर उसका आउटपुट पढ़ना सिखाती है।
migrate-to-shoehorn
310kआपकी टेस्ट फ़ाइलों में जोखिम भरे type casts की जगह shoehorn लाइब्रेरी लगाती है, ताकि टेस्ट अधूरे डेटा से भी type checks पास कर सकें।