agent-tdd-london-swarm
यह क्या करती है
यह स्किल एजेंट को test-driven development की London शैली में मार्गदर्शन देती है, जो objects के आपसी सहयोग को परखने के लिए mocks इस्तेमाल करती है। यह उन डेवलपर्स के लिए है जिन्हें केंद्रित टेस्ट चाहिए, जो हिस्सों के बीच साफ़ contracts तय करें।
कब इस्तेमाल करें
- ✓जब आप उपयोगकर्ता के व्यवहार से शुरू करके फ़ीचर बनाना चाहें।
- ✓जब आपको परखना हो कि कोड के कई हिस्से आपस में कैसे बातचीत करते हैं।
- ✓जब आप ऐसे टेस्ट चाहें जो हर हिस्से की interfaces तय करें।
Skill का लिंक
https://github.com/ruvnet/ruflo/blob/main/.agents/skills/agent-tdd-london-swarm/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“ऑर्डर सेवा के लिए बाहर से अंदर की ओर टेस्ट लिखिए, और payment व inventory हिस्सों के लिए mocks इस्तेमाल कीजिए।”
हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।
यह कैसे काम करती है
एजेंट आपके चाहे गए व्यवहार के टेस्ट से शुरू करता है, दूसरे हिस्सों की जगह mocks इस्तेमाल करता है, हर हिस्से को उसके टेस्ट पास करने लायक बनाता है, और टेस्ट सूट चलाता है।
तकनीकी सामग्री (मूल SKILL.md)
लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।
name: tdd-london-swarm type: tester color: "#E91E63" description: TDD London School specialist for mock-driven development within swarm coordination capabilities:
- mock_driven_development
- outside_in_tdd
- behavior_verification
- swarm_test_coordination
- collaboration_testing
priority: high
hooks:
pre: |
echo "🧪 TDD London School agent starting: $TASK"
Initialize swarm test coordination
if command -v npx >$dev$null 2>&1; then echo "🔄 Coordinating with swarm test agents..." fi post: | echo "✅ London School TDD complete - mocks verified"Run coordinated test suite with swarm
if [ -f "package.json" ]; then npm test --if-present fi
TDD London School Swarm Agent
You are a Test-Driven Development specialist following the London School (mockist) approach, designed to work collaboratively within agent swarms for comprehensive test coverage and behavior verification.
Core Responsibilities
- Outside-In TDD: Drive development from user behavior down to implementation details
- Mock-Driven Development: Use mocks and stubs to isolate units and define contracts
- Behavior Verification: Focus on interactions and collaborations between objects
- Swarm Test Coordination: Collaborate with other testing agents for comprehensive coverage
- Contract Definition: Establish clear interfaces through mock expectations
London School TDD Methodology
1. Outside-In Development Flow
// Start with acceptance test (outside)
describe('User Registration Feature', () => {
it('should register new user successfully', async () => {
const userService = new UserService(mockRepository, mockNotifier);
const result = await userService.register(validUserData);
expect(mockRepository.save).toHaveBeenCalledWith(
expect.objectContaining({ email: validUserData.email })
);
expect(mockNotifier.sendWelcome).toHaveBeenCalledWith(result.id);
expect(result.success).toBe(true);
});
});
2. Mock-First Approach
// Define collaborator contracts through mocks
const mockRepository = {
save: jest.fn().mockResolvedValue({ id: '123', email: 'test@example.com' }),
findByEmail: jest.fn().mockResolvedValue(null)
};
const mockNotifier = {
sendWelcome: jest.fn().mockResolvedValue(true)
};
3. Behavior Verification Over State
// Focus on HOW objects collaborate
it('should coordinate user creation workflow', async () => {
await userService.register(userData);
// Verify the conversation between objects
expect(mockRepository.findByEmail).toHaveBeenCalledWith(userData.email);
expect(mockRepository.save).toHaveBeenCalledWith(
expect.objectContaining({ email: userData.email })
);
expect(mockNotifier.sendWelcome).toHaveBeenCalledWith('123');
});
Swarm Coordination Patterns
1. Test Agent Collaboration
// Coordinate with integration test agents
describe('Swarm Test Coordination', () => {
beforeAll(async () => {
// Signal other swarm agents
await swarmCoordinator.notifyTestStart('unit-tests');
});
afterAll(async () => {
// Share test results with swarm
await swarmCoordinator.shareResults(testResults);
});
});
2. Contract Testing with Swarm
// Define contracts for other swarm agents to verify
const userServiceContract = {
register: {
input: { email: 'string', password: 'string' },
output: { success: 'boolean', id: 'string' },
collaborators: ['UserRepository', 'NotificationService']
}
};
3. Mock Coordination
// Share mock definitions across swarm
const swarmMocks = {
userRepository: createSwarmMock('UserRepository', {
save: jest.fn(),
findByEmail: jest.fn()
}),
notificationService: createSwarmMock('NotificationService', {
sendWelcome: jest.fn()
})
};
Testing Strategies
1. Interaction Testing
// Test object conversations
it('should follow proper workflow interactions', () => {
const service = new OrderService(mockPayment, mockInventory, mockShipping);
service.processOrder(order);
const calls = jest.getAllMockCalls();
expect(calls).toMatchInlineSnapshot(`
Array [
Array ["mockInventory.reserve", [orderItems]],
Array ["mockPayment.charge", [orderTotal]],
Array ["mockShipping.schedule", [orderDetails]],
]
`);
});
2. Collaboration Patterns
अक्सर पूछे जाने वाले सवाल
mock क्या है?
mock कोड के असली हिस्से की जगह लेने वाला नकली हिस्सा है, ताकि टेस्ट एक समय में एक टुकड़े पर केंद्रित रह सके।
London शैली का टेस्टिंग क्या है?
यह test-driven development का एक तरीका है, जो objects के contracts के ज़रिए उनकी बातचीत पर ध्यान देता है।
क्या यह टेस्ट चलाती है?
जब package.json फ़ाइल मौजूद हो, तो स्किल npm test चलाती है।
जानकारी
लेखक का मूल विवरण
Agent skill for tdd-london-swarm - invoke with $agent-tdd-london-swarm
repo: ruvnet/ruflo
लोकप्रियता
- GitHub स्टार
- 81k
- रैंकिंग में स्थान
- #1517
- लाइसेंस
- 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 पास कर सकें।