Agent skill

Test First

by deanhume in deanhume/html-minifier

Enforces a strict test-driven development (TDD) workflow for the HTML Minifier repo.

MITAuto-check passedTesting & QA

Install Test First

skills CLI
$ npx skills add deanhume/html-minifier --skill test-first -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install deanhume/html-minifier test-first --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/deanhume/html-minifier.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.github/skills/test-first .claude/skills/test-first && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
test-first
GitHub stars
142
Token cost
~876 tokens
SKILL.md length
431 words
Files
1
Skills in repo
1
Repo updated
First seen
Licence
MIT

At a glance

Enforces a strict test-driven development (TDD) workflow for the HTML Minifier repo.

  • Works in 4 steps: Write the test first → Run the test and watch it fail (RED) → Ask the user before implementing (CONFIRM) → …
  • You are asked to add
  • SKILL.md covers Mandatory workflow and Hard rules
  • Calls dotnet

What it does

Test First is an agent skill from deanhume/html-minifier. Enforces a strict test-driven development (TDD) workflow for the HTML Minifier repo. Use this skill whenever you are asked to add, change, or fix any behavior in the minification pipeline, feature flags, file-extension handling, or any other production code. It forces you to write a failing test first, run it to watch it fail (red), and then ask the user for permission before writing any implementation code.

Its SKILL.md is about 880 tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Testing & QA, covering Test-driven development. It works with Blazor, C# and .NET. The repository describes itself as: Fast command-line HTML minifier — works on any HTML, with special support for Razor and Web Forms views. Parallel processing, safe preservation of <pre/<code/Knockout blocks, and… The licence is MIT.

When your agent uses it

  • You are asked to add
  • Fix any behavior in the minification pipeline
  • File-extension handling
  • Any other production code

Example prompts

  • “Use the test-first skill to enforce a strict test-driven development (TDD) workflow for the HTML Minifier repo”
  • “/test-first”

Workflow steps

4 steps, taken from the step headings in SKILL.md.

  1. Write the test first
  2. Run the test and watch it fail (RED)
  3. Ask the user before implementing (CONFIRM)
  4. Implement until green (GREEN)

What it can do on your machine

Read from SKILL.md and the folder at commit e9e45d5. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • dotnet

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Test First loads about 876 tokens when it runs. Until then it costs about 106 tokens; SKILL.md has 431 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~106
When it runs · the whole SKILL.md, loaded when a task matches
~876

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from deanhume/html-minifier at commit e9e45d5, republished under its MIT licence (© deanhume). 431 words, ~876 tokens.

Download SKILL.mdSave it as .claude/skills/test-first/SKILL.md (or your agent's skills folder).
name
test-first
description
Enforces a strict test-driven development (TDD) workflow for the HTML Minifier repo. Use this skill whenever you are asked to add, change, or fix any behavior in the minification pipeline, feature flags, file-extension handling, or any other production code. It forces you to write a failing test first, run it to watch it fail (red), and then ask the user for permission before writing any implementation code.

Test-First (TDD) Skill

This skill makes you follow a strict red → confirm → green workflow. You must not write or modify production code before completing the steps below in order. There are no exceptions unless the user explicitly says "skip the test" or "no test needed" for this change.

Mandatory workflow

1. Write the test first

Before touching any production code, write a test that captures the desired new behavior or reproduces the bug.

  • Tests live in HtmlMinifier.Tests/. Behavior tests go in MinificationTests.cs, flag-parsing tests in ArgumentsTests.cs, and file extension tests in FileExtensionTests.cs.
  • Tests call StreamReaderExtension.MinifyHtmlCode(string, Features) directly — no file I/O.
  • Put HTML input strings and expected-output strings in HtmlMinifier.Tests/DataHelpers.cs as static string constants (raw \r\n-delimited).
  • For bug fixes, follow the naming pattern GithubIssueNN_ShouldReturnCorrectly and add a comment linking to the issue.
  • Use noFeatures (new Features(new string[0])) when no flags are needed.

The test must assert the target behavior (what the code should do after your fix), so that it fails against the current code.

2. Run the test and watch it fail (RED)

Run the new test and confirm it fails for the right reason (an assertion failure showing the gap, not a compile error or unrelated crash):

bash
dotnet test HtmlMinifier.Tests\HtmlMinifier.Tests.csproj --filter "FullyQualifiedName~<YourTestName>"
  • If it passes, the test is not actually exercising new behavior — fix the test before continuing.
  • If it fails to compile, fix only the test code (or add the minimal new member signature it references) until it compiles and fails on the assertion.

Show the user the failing test output so the red state is visible.

Show full SKILL.md (177 more words)Show less
3. Ask the user before implementing (CONFIRM)

After demonstrating the failing test, you must stop and ask the user for permission to proceed using the ask_user tool. Do not write implementation code in the same turn.

Ask a clear yes/no question, for example:

"The test is written and failing as expected. May I proceed to implement the fix?"

Only continue once the user approves. If they want changes to the test or approach, revise and re-run before asking again.

4. Implement until green (GREEN)

Once approved, write the minimal production code (in StreamReaderExtension.cs, Features.cs, StringExtension.cs, or Program.cs as appropriate) to make the test pass. Then re-run the focused test, and finally the full suite to confirm no regressions:

bash
dotnet test HtmlMinifier.sln

Hard rules

  • Never write or edit production code before the test exists, fails, and the user has approved.
  • Never weaken or delete the failing assertion just to make it pass — make the production code satisfy the test.
  • If the user asks you to skip the test, comply but state clearly that the TDD workflow was bypassed at their request.

© deanhume, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .github/skills/test-first of deanhume/html-minifier.

Open the folder on GitHubat commit e9e45d5

Compare with similar skills

Test First next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Test First compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Test First this skilldeanhume/html-minifier142—~876Automated safety check: PassMIT
New EndpointVonage/vonage-dotnet-sdk118—~11kAutomated safety check: PassApache-2.0
Maui Hot Reload Diagnosticsdavidortinau/maui-skills174—~1.3kAutomated safety check: PassMIT
Dotnet10 Featuresrunceel/ReactiveProperty944—~2.7kAutomated safety check: PassMIT
Blazor Component Authordotnet/skills5.6k1 repos~830Automated safety check: PassMIT
Using Dotnetnovotnyllc/dotnet-artisan233—~2.3kAutomated safety check: WarnMIT

Similar skills

  • New Endpoint

    Vonage/vonage-dotnet-sdk

    Add a new endpoint, use case, or product to the Vonage .NET SDK.

    118 GitHub stars~11k tokensUpdated 4 mo ago
    Testing & QAAuto-check passed
  • Maui Hot Reload Diagnostics

    davidortinau/maui-skills

    Diagnose and troubleshoot .NET MAUI Hot Reload issues (C Hot Reload, XAML Hot Reload, Blazor Hybrid).

    174 GitHub stars~1.3k tokensUpdated 3 mo ago
    MobileAuto-check passed
  • Dotnet10 Features

    runceel/ReactiveProperty

    Reference for the .NET 10 / C 14 features that are relevant to the ReactiveProperty repository.

    944 GitHub stars~2.7k tokensUpdated 1 mo ago
    DevelopmentAuto-check passed
  • Official

    Writes and reviews Blazor .razor components with correct parameters, EventCallback, lifecycle, async and disposal patterns, for components that need no JavaScript interop.

    5.6k GitHub starsUsed in 1 repo~830 tokens
    Frontend & DesignAuto-check passed
  • Using Dotnet

    novotnyllc/dotnet-artisan

    Detects .NET intent for any C, ASP.NET Core, EF Core, Blazor, MAUI, Uno Platform, WPF, WinUI, SignalR, gRPC, xUnit, NuGet, or MSBuild request from prompt keywords and repository signals (.sln…

    233 GitHub stars~2.3k tokensUpdated today
    Backend & APIsAuto-check: warnings
  • Maui Safe Area

    dotnet/skills

    Official

    .NET MAUI safe area and edge-to-edge layout guidance for .NET 10+.

    5.6k GitHub starsUsed in 1 repo~3.2k tokens
    MobileAuto-check passed

Works with

Categories

Questions about Test First

What does Test First do?

Enforces a strict test-driven development (TDD) workflow for the HTML Minifier repo. Test First is an agent skill from deanhume/html-minifier. Enforces a strict test-driven development (TDD) workflow for the HTML Minifier repo.

When should I use Test First?

Test First fits situations like: you are asked to add; fix any behavior in the minification pipeline; file-extension handling; any other production code.

How do I install Test First in Claude Code?

Run `npx skills add deanhume/html-minifier --skill test-first -a claude-code`. Or copy the skill folder (.github/skills/test-first in deanhume/html-minifier) into .claude/skills/test-first in your project. Claude Code loads it when a task matches its description.

How do I install Test First in Codex?

Run `npx skills add deanhume/html-minifier --skill test-first -a codex`. Or copy the skill folder (.github/skills/test-first in deanhume/html-minifier) into .agents/skills/test-first in your project. Codex loads it when a task matches its description.

Can I use Test First in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add deanhume/html-minifier --skill test-first -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/test-first, .gemini/skills/test-first, .github/skills/test-first and .opencode/skills/test-first in your project.

What does Test First need to run?

Going by SKILL.md and its folder, Test First needs the command-line tools its instructions call (dotnet).

Does Test First access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Test First safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Test First use?

Test First is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Test First use?

About 876 tokens (SKILL.md is roughly 3.5k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Test First?

Skills that share tags, products or a category with Test First: New Endpoint (Vonage/vonage-dotnet-sdk, 118 stars), Maui Hot Reload Diagnostics (davidortinau/maui-skills, 174 stars), Dotnet10 Features (runceel/ReactiveProperty, 944 stars) and Blazor Component Author (dotnet/skills, 5.6k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Test First?

deanhume (a GitHub user) maintains it in deanhume/html-minifier, which has 142 GitHub stars. The repository was last updated on October 7, 2026.

Source: deanhume/html-minifier on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.