lane-policy

Assigns test behaviors to unit, integration, e2e, or contract lanes with trigger and coverage rules.

10|7|Updated Feb 23, 2026
One-click install
npx skills add https://github.com/xiaolai/tdd-guardian-for-claude --skill lane-policy-xiaolai
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: lane-policy
Source: https://github.com/xiaolai/tdd-guardian-for-claude/tree/main/skills/tdd-guardian/lane-policy
Command: npx skills add https://github.com/xiaolai/tdd-guardian-for-claude --skill lane-policy-xiaolai

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Teams struggle to decide where each test belongs, which causes slow suites gating every task, mocked databases passing invalid SQL, and coverage numbers corrupted by misconfigured lanes. This Skill provides a decision framework for placing each behavior in the cheapest lane that can actually verify it. ## Core Features & Use Cases - Lane taxonomy: Defines unit, integration, e2e, and contract lanes with boundaries, typical runtimes, default triggers, and coverage participation, plus optional smoke, load, and security lanes. - Placement rules: Maps concrete behaviors (SQL correctness, auth middleware, OAuth handshakes, state machines) to the correct lane, with a tiebreaker rule for borderline cases. - Trigger and coverage configuration: Binds lanes to taskCompleted, commit, push, or manual gates based on cost, and governs how lane coverage reports merge into threshold checks. - Use Case: When designing a test matrix for a web service, use this Skill to decide that ORM query semantics belong in the integration lane on commit, while the checkout flow belongs in e2e on push with coverage set to none. ## Quick Start Ask the AI to decide which test lane a given behavior belongs to and how that lane should be triggered and counted toward coverage.

Frequently Asked Questions about lane-policy

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

FAQPage Schema
How do I decide between unit and integration tests?

Assign each behavior to the cheapest lane that can actually verify it, not the cheapest it can be written in. If the test would still pass when the real collaborator is broken, such as mocked SQL that is invalid, it belongs one lane higher in integration.

What is the difference between unit, integration, e2e, and contract tests?

Unit tests cover in-process logic with no I/O, integration tests use real adapters like databases and HTTP, e2e tests drive the deployed system through its real interface, and contract tests verify the agreement between two services.

Should e2e tests run on every commit or only on push?

E2e suites that drive a browser or deployed environment and take over five minutes should bind to the push trigger, not taskCompleted or commit. A slow suite on the tight loop makes people disable the tooling entirely.

Should e2e tests contribute to code coverage totals?

E2e lanes default to coverage none because browser coverage needs an instrumented build and a browser-side collector. Configuring include without that instrumentation produces missing or empty reports that corrupt the merged totals.

Why is mocking the database in an integration test a problem?

An integration lane that mocks the database is a unit lane in disguise, since a mocked DB cannot violate a constraint or prove transaction isolation. Use a real database or testcontainers, and pair every mocked boundary in unit tests with a real-path integration test.

How many test lanes does a project need at minimum?

A repo needs exactly one lane to be configured. A pure library with no I/O needs only unit, while lanes should be added only when the repo actually has the corresponding behavior, such as integration for adapters or e2e for a UI.