vscode-tdd-expert

Guide Test-Driven Development for VS Code extensions using Red-Green-Refactor cycles.

21|11|Updated Jul 4, 2025
One-click install
npx skills add https://github.com/s-hiraoku/vscode-sidebar-terminal --skill vscode-tdd-expert
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vscode-tdd-expert
Source: https://github.com/s-hiraoku/vscode-sidebar-terminal/tree/main/.claude/skills/vscode-tdd-expert
Command: npx skills add https://github.com/s-hiraoku/vscode-sidebar-terminal --skill vscode-tdd-expert

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides expert-level guidance for Test-Driven Development (TDD) in VS Code extension development following t-wada methodology. It helps teams write tests before implementation, create comprehensive test suites, implement Red-Green-Refactor cycles, and improve test coverage for extension components like WebViews, terminal managers, and activation logic.

Core Features & Use Cases

  • TDD Mastery: Understand core TDD principles and apply them to VS Code extensions.
  • Test Infrastructure: Set up unit, integration, and end-to-end tests with VS Code test tooling.
  • Workflow automation: Run Red-Green-Refactor cycles via npm scripts.
  • Quality gates: Improve test coverage and reliability for extension components.

Quick Start

Use the following commands to drive the TDD cycle: npm run tdd:red npm run tdd:green npm run tdd:refactor npm run tdd:quality-gate

Frequently Asked Questions about vscode-tdd-expert

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

FAQPage Schema
How do I set up Test-Driven Development for VS Code extensions?

Test-Driven Development for VS Code extensions involves writing tests before implementation using Mocha and Chai, then following the Red-Green-Refactor cycle. Set up your testing stack with npm scripts for tdd:red, tdd:green, and tdd:refactor to automate the workflow and drive coverage across unit, integration, and end-to-end tests.

What's the best way to test VS Code extension WebViews and activation logic?

Test WebViews and activation logic by writing assertions first, then implementing functionality. Use Mocha with Chai for assertions and Sinon for mocking dependencies. Apply mock strategies for session persistence and terminal manager interactions to isolate components and verify behavior before code exists.

Can I use Mocha and Chai for comprehensive VS Code extension testing?

Yes. Mocha and Chai form the core testing stack for VS Code extensions, supporting unit, integration, and end-to-end tests. Pair them with c8 for coverage tracking and Sinon for mocking to achieve quality gates and comprehensive test suites across extension commands, WebViews, and session persistence.

How do I implement the Red-Green-Refactor cycle in extension development?

The Red-Green-Refactor cycle writes failing tests first (red), implements minimal code to pass (green), then improves design (refactor). Run npm run tdd:red, tdd:green, and tdd:refactor as automated workflow steps to enforce the cycle and maintain test coverage for extension components.

What are the three laws of TDD and why do they matter for extensions?

TDD's three laws require writing tests before code, writing only enough code to pass tests, and refactoring only after tests pass. Following this methodology in VS Code extension development ensures test coverage, reduces bugs in WebViews and terminal managers, and improves long-term maintainability.

Do I need prior testing experience to apply TDD to VS Code extensions?

No, but familiarity with Mocha, Chai, and extension architecture accelerates adoption. TDD methodology applies regardless of experience level; start with unit tests for simple commands, progress to mocking for WebViews and activation logic, and use npm scripts to reinforce the workflow.