BU

build-and-test

Executes the full dual-path test suite to verify project integrity after code changes.

Install

mkdir -p .claude/skills/build-and-test && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/14618" && unzip -o skill.zip -d .claude/skills/build-and-test && rm skill.zip

Installs to .claude/skills/build-and-test

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Rebuild cx and run the full dual-path test suite. Use
53 charsno explicit “when” trigger
Beginner

Key capabilities

  • Rebuild the `cx` project
  • Run the full dual-path test suite
  • Verify tests under native path
  • Verify tests through self-hosted `cx`
  • Report pass/fail status for tests
  • Identify self-host path divergence

How it works

The skill executes a command to compile `cx.c` and then runs `tests/all.c` twice, once natively and once through the self-hosted `cx`, reporting the summary of passed tests.

Inputs & outputs

You give it
Source code changes in `cx.c`, `toys.c`, or `tests/*.c`
You get back
Test suite pass/fail summary for both native and self-hosted paths

When to use build-and-test

  • Verifying system stability after C code changes
  • Running the dual-path regression suite
  • Debugging self-host path divergence

About this skill

build-and-test

The project's single verification gate. tests/all.c runs every test twice — once natively (build/cx <file>) and once through self-hosted cx (build/cx cx.c <file>). A change is not done until both paths report SUMMARY: 45/45 tests passed.

The command

cc -Wall -Wpedantic -o build/cx cx.c && build/cx cx.c tests/all.c

That's it. No flags, no selection — run the whole suite. Selecting a subset hides regressions in other tests the change might have broken by accident.

Reading the output

The suite prints per-stage headers and per-test OK/FAIL lines. The line to grep for at the end is:

SUMMARY: N/45 tests passed.
  • 45/45: done. Report success and stop.
  • <45/45: regression. Find the first FAIL: line (or the first stage that shows lower counts on its second pass), that's where the self-host path diverged.

When it fails under self-host only

A test that passes natively but fails the second time through is almost always hitting one of the patterns in .claude/rules/cx-constraints.md:

  • stacked case labels
  • break inside braced switch case
  • local shadowing a non-zero global
  • bytecode overflow of code_pool
  • a stubbed #else __cx__ intrinsic branch

Narrow the failing test to the smallest repro, then check which pattern fits.

What not to do

  • Don't --no-verify or -w your way around warnings. Fix them.
  • Don't skip tests because they're "flaky." The suite is deterministic; flakiness means a real bug.
  • Don't claim success on partial runs.

When not to use it

  • When changes are not to `cx.c`, `toys.c`, or `tests/*.c`
  • When only a subset of tests needs to be run

Limitations

  • The skill is specific to the `cx` project and its test suite
  • It requires all tests to pass for both execution paths
  • It does not allow selecting a subset of tests

How it compares

This skill automates the entire verification gate, ensuring all tests are run against both native and self-hosted paths, unlike manually running individual tests or only one execution path.

Compared to similar skills

build-and-test side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
build-and-test (this skill)04moNo flagsBeginner
e2e-testing-patterns82moNo flagsIntermediate
testing-workflow169moReviewIntermediate
perf-lighthouse135moReviewIntermediate

Try saying

Example prompts that trigger this skill in your AI assistant.

You might also like

Search skills

Search the agent skills registry