Skip to content
Back to skills

Test First

ASecurity

Test-first workflow and conventions for writing tests: test behavior, not implementation; write acceptance scenarios before code; see red before green. Use when the user asks to write or add tests, or starts a new feature.

  • 16 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 20, 2026
ai-agentsgorefactoring

Security analysis

A100/100

Pro scans all 4 files and shows the line behind each finding

Scanned November 20, 2026

npx -y skills add DBAAZzz/skill-stow --skill test-first --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Test First?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Test First
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/dbaazzz-test-first/badge)](https://www.skillsdirectory.com/skills/dbaazzz-test-first)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: test-first
description: Test-first workflow and conventions for writing tests: test behavior, not implementation; write acceptance scenarios before code; see red before green. Use when the user asks to write or add tests, or starts a new feature.
---

# test-first

## Workflow

1. Write the acceptance scenario first: title it "subject + behavior + condition" and structure it as Given / When / Then.
2. Run the test and make sure it **fails first** (red), proving it really checks something.
3. Write the least code that makes it pass (green), then refactor, keeping the tests green throughout.

## Principles

- Test behavior, not implementation: refactoring shouldn't break tests.
- Run the test level that matches the change instead of the full suite every time; see `references/test-levels.md`.
- See [BDD scenarios](references/bdd-scenarios.md) for writing acceptance scenarios and [lint rules](references/lint-rules.md) for lint rules.

```ts
it('sends a signed-out user from the orders page to sign-in', async () => {
  // Given signed out
  await logout()
  // When opening the orders page
  await page.goto('/orders')
  // Then lands on sign-in
  expect(page.url()).toContain('/login')
})
```

Files in this skill

  • SKILL.md1.2 KB
  • references/bdd-scenarios.md354 B
  • references/test-levels.md262 B
  • scripts/run-changed.sh142 B

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.