shift-left-verification
Universal progressive testing and shift-left verification standard (Google Small Tests, Stripe level). Codifies fast deterministic unit tests (<100ms, zero…
от hemanth17r★ 33 звезды на GitHub
Установить shift-left-verification в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
Shift-Left Progressive Verification Standard
1. The Core Philosophy: Verification as an Architecture Forcing Function
In high-performance engineering, testing is not an afterthought phase; it is an architectural forcing function executed continuously at each milestone.
- Code that is difficult to unit test is badly architected code (spaghetti coupling, hidden side-effects, hardcoded clocks, or direct network calls inside domain logic).
- Designing for testability naturally forces code to be pure, modular, and dependency-injected.
- Catching a bug at the local authoring gate takes 3 seconds. Catching it in a staging or production environment takes hours.
2. Principle 1: Google's "Small Tests" Rule (The Zero I/O Mandate)
Classify unit tests strictly by execution physics. 80%+ of a project's tests must be Small Tests:
┌────────────────────────────────────────┐
│ GOOGLE SMALL TEST STANDARD │
├────────────────────────────────────────┤
│ • Execution Time: < 100 milliseconds │
│ • Network Access: ZERO (Banned) │
│ • Disk File I/O: ZERO (Banned) │
│ • Sleep / Delays: ZERO (Banned) │
│ • Environment: Single Process │
└────────────────────────────────────────┘
- Implementation: Keep business calculations, state machines, math, data mappers, and validation logic pure and headless.
- Execution: A suite of 50 pure unit tests must execute in under 100ms locally (e.g. via
Vitest,Jest,pytest), giving instant developer feedback with zero latency.
3. Principle 2: Atomic Co-Development & Micro-Commits
Never accumulate large unverified feature branches. Break work into atomic, milestone-gated slices:
- Write an Atomic Slice: Implement a single pure unit of logic (30 to 100 lines).
- Co-Locate the Test: Keep the test file immediately adjacent to the source:
src/features/bounties/ ├── calculateReward.ts └── calculateReward.test.ts - Run the Verification Gate: Confirm tests pass locally before touching downstream presentation or storage layers.
- Atomic Commit: Commit the implementation and its corresponding test together in the exact same commit:
git commit -m "feat(bounties): implement dynamic sector reward calculation with unit test"
4. The 3 Testing Traps to Eliminate
Tests must accelerate development velocity, not become brittle maintenance liabilities.
Trap 1: The "Mocking Illusion"
- ❌ Anti-Pattern: Mocking the database, the ORM, the network client, and external APIs. You end up testing mock configuration while production crashes on real schemas.
- ✅ The Fix: Never mock what you can keep pure. Test core logic with real in-memory inputs and outputs. Reserve real I/O verification for separate integration tests.
Trap 2: Testing Implementation Details Instead of Contracts
- ❌ Anti-Pattern: Using spies to assert that an internal private method was invoked:
Refactoring internal implementation breaks the test, even when the external behavior is 100% correct.expect(service._privateCacheHelper).toHaveBeenCalledTimes(1); - ✅ The Fix: Treat components and functions as black boxes. Assert public inputs and observable outputs/state changes only.
Trap 3: Unit-Testing Pixels & Styling
- ❌ Anti-Pattern: Writing unit tests asserting CSS classes or DOM heights (
expect(el).toHaveClass('px-4 py-2')). - ✅ The Fix: Test state, data flow, and user interaction, not visual styling. Verify that clicking an item toggles selection; verify visual aesthetics through browser inspection.
5. Pre-Flight Verification Checklist
Before marking any milestone or task complete, verify:
- Zero I/O: Do unit tests execute without network, file, or database roundtrips?
- Sub-Second Speed: Does the test suite run in milliseconds?
- Co-Located Test Files: Is the test placed directly next to the module it tests?
- Contract-Only Assertions: Are tests asserting public outputs rather than private implementation details?
- Zero Pixel Tests: Are tests free from fragile CSS class or DOM geometry assertions?
- Edge Cases Covered: Are boundary conditions (empty lists, null values, negative counts, zero thresholds) explicitly tested?
- Atomic Commit Ready: Is the unit test staged and committed alongside the feature code?
6. Progressive Slice-by-Slice Wiring & Responsiveness Gate
Never batch-dump 4-5 buttons, form fields, or interactive controls and test only after the entire feature is added. Every interactive control must be verified progressively as it is wired:
- Zero Dummy / Placeholder Controls: Every button, input,
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл shift-left-verification?
Universal progressive testing and shift-left verification standard (Google Small Tests, Stripe level). Codifies fast deterministic unit tests (<100ms, zero I/O), atomic co-development (commit logic and test in the same changeset), milestone verification gates, and eliminates the 3 testing traps (mocking illusions, testing private implementation details, and pixel assertions). Trigger when writing unit tests, setting up test suites, verifying milestones, practicing TDD/co-development, designing testable architecture, or when asked to "write tests", "add tests", "test this", "need tests", "add test coverage", or "how should we test this".
Как установить скилл shift-left-verification?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл shift-left-verification запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
doc-coauthoring
AnthropicGuide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision…
academy-guide
AnthropicStop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials…
internal-comms
AnthropicA set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill…
skill-development
AnthropicThis skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill…