# Website Tests: Test-First Checks on the Built Site

> Native Node.js TDD for web projects that validates HTML build output, asset integrity, and client business rules.

Website Tests: Test-First Checks on the Built Site is a free AI agent skill on Agensi by Siyakha Digital by Thebe Ramathebane, in Testing & Debugging. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: Free
- Creator: [Siyakha Digital by Thebe Ramathebane](https://www.agensi.io/creators/thebe-ramathebane)
- Category: [Testing & Debugging](https://www.agensi.io/skills/testing-debugging)
- Version: 1.0
- Last updated: 2026-11-29
- Security: scan passed (2026-11-29); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/website-tests-test-first-checks-on-the-built-site
- Tags: testing, node-js, tdd, static-site-generators, web-development

## About this skill

Ship web projects with confidence by testing the actual build output rather than framework internals. This skill implements a strict test-driven development (TDD) workflow for static sites and web applications, ensuring every feature, client rule, and content fact is verified against the final HTML files. It eliminates the risk of broken links, missing assets, or incorrect business logic reaching production.

### What it does
- **HTML Validation** verifies that every page builds correctly with essential SEO tags, one `h1`, and accessibility skip links.
- **Asset Integrity** checks that every internal link, image source, and `srcset` URL points to a physical file in the build directory.
- **Fact Checking** ensures specific client data like phone numbers or addresses appear where required while flagging unsourced claims.
- **Performance Budgeting** monitors image file sizes to ensure they stay under defined limits and include necessary width/height attributes.
- **Feature Contracts** validates complex behaviors like mailto subjects, coordinate strings, and conditional UI components like video players.

### How it works
1. **Red Stage** writes a failing test for the new behavior or bug fix using Node's native test runner.
2. **Green Stage** implements the minimal code change necessary to pass the test.
3. **Build & Verify** runs the full suite against the `/out/` directory and performs a visual check of the generated page.
4. **Refactor & Update** maintains the suite by updating tests that fail due to deliberate design changes.

### Frameworks & tools
This skill uses the native `node:test` runner and `node:assert/strict` module, requiring zero external npm dependencies. It operates directly on the filesystem using `node:fs` to parse built HTML and assets.

### Why this beats prompting it yourself
Standard prompts often suggest heavy testing frameworks like Jest or Playwright which add bloat and slow down development. This skill enforces a "test-first" methodology centered on the actual build artifacts, ensuring that what the user sees is exactly what was tested without false positives from framework script payloads.

### Use cases
- **Regression Testing** during a site-wide refactor to ensure navigation and contact details remain unchanged.
- **Link Auditing** to automatically find 404s in internal links and image sources before deployment.
- **Content Enforcement** to guarantee specific business rules, like ensuring WhatsApp links only appear on specific pages.
- **Asset Optimization** to catch oversized images or missing alt text during the build process.

### Known limitations
Does not test live network requests or external URLs. Tests are restricted to the local build output and filesystem. Requires a build step that generates static HTML files.

## Requires

- Optional: Node.js 18+ (built-in test runner, no packages)

## How to use this skill

1. Connect your AI agent to Agensi once: add the MCP server https://mcp.agensi.io/mcp/auth and sign in with your Agensi account (OAuth, no API key). Steps for Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and other agents: https://www.agensi.io/docs/mcp-setup
2. Ask your agent: "Use the Website Tests: Test-First Checks on the Built Site skill from Agensi" and describe your task.
3. Your agent loads the skill from Agensi when it needs it. Nothing is downloaded.

## Frequently asked questions

### How is this different from standard unit testing or integration testing?

Unlike tools that test code logic, Site Tests validates the final HTML files in your build directory. This ensures that what your users actually see—including links, SEO tags, and asset paths—is functional and accurate before you deploy.

### Which AI agents and web frameworks are compatible with Site Tests?

This skill is compatible with any AI agent that can execute Node.js scripts and access a local filesystem. It is ideal for developers using static site generators (like Next.js, Astro, or Eleventy) that output to a directory like `/out` or `/dist`.

### Do I need to install heavy third-party libraries to use this skill?

No, this skill is built using the native Node.js test runner and file system modules. It requires zero external npm dependencies, keeping your project lightweight and avoiding the bloat associated with heavy testing frameworks like Jest or Playwright.

### Can this skill test live API endpoints or external third-party links?

Site Tests focuses exclusively on the local build output and filesystem integrity. It does not perform live network requests or verify external URLs, making it extremely fast and suitable for offline CI/CD pipelines.

### What exactly is included in the Site Tests skill package?

You receive the core TDD logic, a suite of pre-configured test patterns for HTML and asset validation, and the workflow instructions to integrate it into your agent's development cycle. This includes templates for link auditing, SEO verification, and content fact-checking.

---

Source: [Agensi](https://www.agensi.io), the marketplace of skills for AI agents. Any MCP-compatible agent (Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and more) connects at https://mcp.agensi.io/mcp/auth and signs in with an Agensi account; setup for every agent: https://www.agensi.io/docs/mcp-setup. Append .md to any skill, guide or docs address on agensi.io for its markdown version.
