Skillpedia
الاختبار81k · #1517

agent-tdd-london-swarm

ما الذي تفعله

تُرشد هذه المهارة الوكيل خلال أسلوب London للتطوير المدفوع بالاختبار، الذي يستخدم المحاكاة لاختبار طريقة تعاون الكائنات. وهي موجهة للمطورين الذين يريدون اختبارات مركزة تحدد عقوداً واضحة بين الأجزاء.

متى تستخدمها

  • ✓عندما تريد بناء ميزة تبدأ من سلوك المستخدم.
  • ✓عندما تحتاج إلى اختبار كيفية تفاعل عدة أجزاء من الشيفرة.
  • ✓عندما تريد اختبارات تحدد الواجهات التي يجب أن يقدمها كل جزء.

رابط المهارة

https://github.com/ruvnet/ruflo/blob/main/.agents/skills/agent-tdd-london-swarm/SKILL.md

انسخه والصقه في الذكاء الاصطناعي الذي تستخدمه (Claude أو ChatGPT أو Cursor) واطلب منه اتباع التعليمات.

طريقة الاستخدام

أسهل طريقة: انسخ الرسالة والصقها في الذكاء الاصطناعي الذي تستخدمه. سيقرأ المهارة وينفّذ تعليماتها.

رسالة جاهزة للصق

استخدم هذه المهارة لمساعدتي: https://github.com/ruvnet/ruflo/blob/main/.agents/skills/agent-tdd-london-swarm/SKILL.md اقرأ ملف SKILL.md في هذا الرابط ونفّذ تعليماته لمهمتي.
تريد أن يجد الذكاء الاصطناعي مهارات مثل هذه بنفسه؟ثبّت خادم Skillpedia MCP المجاني: سطر واحد، ويبحث في 15,000+ مهارة قبل كل مهمة.ثبّته في دقيقة واحدة →

مثال على ما تطلبه من الذكاء الاصطناعي

“اكتب اختبارات لخدمة الطلبات من الخارج إلى الداخل، مع استخدام المحاكاة لجزأي الدفع والمخزون.”

5 مهارات جديدة كل أسبوع. قراءة في دقيقة واحدة.

كيف تعمل

يبدأ وكيلك باختبار للسلوك المطلوب، ويستخدم المحاكاة لتمثيل الأجزاء الأخرى، ويبني كل جزء ليجتاز اختباراته، ثم يشغّل مجموعة الاختبارات.

المحتوى التقني (ملف 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

  1. Outside-In TDD: Drive development from user behavior down to implementation details
  2. Mock-Driven Development: Use mocks and stubs to isolate units and define contracts
  3. Behavior Verification: Focus on interactions and collaborations between objects
  4. Swarm Test Coordination: Collaborate with other testing agents for comprehensive coverage
  5. 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)؟

هي بديل عن جزء حقيقي من الشيفرة، فيركز الاختبار على جزء واحد في كل مرة.

ما هو أسلوب London للاختبار؟

هو طريقة من التطوير المدفوع بالاختبار تركز على تفاعل الكائنات عبر عقودها.

هل تشغّل الاختبارات؟

تشغّل المهارة الأمر npm test عند وجود ملف package.json.

التفاصيل

الوصف الأصلي من المؤلف

Agent skill for tdd-london-swarm - invoke with $agent-tdd-london-swarm

repo: ruvnet/ruflo

الشعبية

نجوم GitHub
81k
الترتيب
#1517
الترخيص
MIT
آخر تحديث
2‏/11‏/2026

هل هذه المهارة مفيدة؟

0

سجّل الدخول للتصويت.

التعليقات

  • …

المزيد من المهارات من هذا المستودع

مهارات مشابهة