tdd-workflow

Automate Test-Driven Development red-green-refactor cycles for Apex and LWC projects.

2|Updated Mar 18, 2026
One-click install
npx skills add https://github.com/bhanu91221/claude-sfdx-iq --skill tdd-workflow-bhanu91221
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tdd-workflow
Source: https://github.com/bhanu91221/claude-sfdx-iq/tree/main/skills/tdd-workflow
Command: npx skills add https://github.com/bhanu91221/claude-sfdx-iq --skill tdd-workflow-bhanu91221

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Test-Driven Development (TDD) in Salesforce follows the Red-Green-Refactor cycle: write a failing test first, implement the minimum code to pass, then refactor. Coverage is a byproduct of proper TDD.

Core Features & Use Cases

  • Red-Green-Refactor cycle described with concrete examples for Apex, Triggers, and LWC.
  • Supports scaling tests from single records to 200+ bulk scenarios and security constraints.
  • Provides a full cycle methodology from red to green to refactor, including test setup and guardrails.

Quick Start

Begin a TDD cycle by writing a failing test first, then implement only enough production code to pass.

Frequently Asked Questions about tdd-workflow

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I practice test-driven development for Apex triggers and LWC components?

Test-driven development for Apex and LWC follows the red-green-refactor cycle: write a failing test first, implement the minimum code to pass, then refactor. This approach covers triggers, service layers, and Lightning Web Components with concrete examples.

Can I scale TDD unit tests for bulk data scenarios in Salesforce?

Yes, TDD unit tests can scale from single records to 200+ bulk scenarios in Salesforce. The workflow demands guardrails like bulk-safe queries and fail-fast tests to ensure your Apex code handles large data volumes securely.

What security constraints should I enforce when writing Apex test classes?

Apex test classes should enforce security constraints using security-enforcement patterns. The TDD workflow demands these guardrails alongside bulk-safe queries and fail-fast tests to ensure your Salesforce code meets strict quality and security standards.

Does TDD workflow support Lightning Web Components or only Apex code?

The TDD workflow supports both Lightning Web Components and Apex code. It provides a full cycle methodology including red-green-refactor examples, test setup, and iterative refinement for LWC projects, triggers, and service layers.

Why does my test coverage approach fail to improve Salesforce code quality?

Test coverage is a byproduct of proper TDD, not the primary goal. Writing failing tests first and implementing only enough production code to pass ensures quality, whereas simply chasing coverage numbers often fails to improve actual code behavior.

What is the red-green-refactor cycle in Salesforce unit testing?

The red-green-refactor cycle is a test-driven development practice where you write a failing test first, implement the minimum production code to pass it, then refactor. It provides a structured methodology for iterative refinement in Apex and LWC projects.