agentleFS
clice-ioclice-io/clice/.claude/skills/build-and-test/SKILL.md

build-and-test

Skill2k starsChanged 6 days agoApache-2.0View on GitHub

Read before building clice or running its test suites — where they run (a box where the `box` command exists, else here), what a change runs, the commands, other platforms, reading the results.

8 other projects use a version of this.

Adopted by

Steady: 0 new projects took it in the last 4 weeks, none the 4 weeks before.thin data

Week of Oct 4: 0 new projectsWeek of Oct 11: 0 new projectsWeek of Oct 18: 0 new projectsWeek of Oct 25: 0 new projectsWeek of Nov 1: 0 new projectsWeek of Nov 8: 0 new projectsWeek of Nov 15: 0 new projectsWeek of Nov 22: 0 new projects
Oct 2026Nov 2026Nov 2026
New projects taking a version of this file each week, over the 8 weeks our latest run read: only 0 in all, so this is a hint, not a trend.

Most recently taken up by

Who's talking about clice-io/clice

The biggest 5 of 11 mentions linking to the repository that our crawl found. Each line is their own headline.

See all 11

Talked about on GitHub (11 times).

On GitHub · 11

6 more on GitHub

The file

We split this skill into the rules it gives an agent

3 rules. 0 are common, 2 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 7 edited versions we read keep these.

  • 2

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Every push: the unit tests and the cases, RelWithDebInfo, beside CI — push without waiting for them.

    line 16
  2. Very specific:

    Before running a suite, check the binary was built after your last source edit (on a box: after your last box push): a pass on a stale …

    line 38
  3. Distinctive:

    Only a linux box restores main's CI caches (Bazel's and ThinLTO's), of Linux x64 and Windows x64 RelWithDebInfo: a Debug build or another …

    line 62

“Common” is measured: kept by at least 6 in 10 of the 7 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Building and testing clice

Where it runs

Where the box command is installed (command -v box; the agent-box skill), every build and suite runs on a box, not on this machine: it hosts every agent's session, and one build saturates it. Only the tools' own tests (pixi run npm test -w tools, no build) run here. Without box, everything runs here.

Either way, builds and suites go through Bash run_in_background, which notifies on exit — not a detached script polled by timed wake-ups.

What a change runs

  • Every push: the unit tests and the cases, RelWithDebInfo, beside CI — push without waiting for them.
  • Async code, shutdown or position math: the Debug suites too, beside the RelWithDebInfo ones. ASan and the assertions — clice's, clang's and kotatsu's — live only there. Debug builds Linux x64 and macOS arm64 alone: xclang has the ASan libclang only there.
  • Command handling: the compat suite (pixi run compat-test). It needs the build systems and compilers CI has: the pixi environments cuda and toolchains, and the system's — on Linux the image CI's job runs in (tests/compat/Dockerfile; on a box, see "On a box"), on Windows what compat-test.yml installs. Where CI is set, a box included, a missing one fails its scenario instead of skipping it.
  • editors/: the editors' end-to-end tests (pixi run -e editor editor-test, Zed's zed-e2e); on Linux without a display, under xvfb-run -a.
  • A new command, flag, clice/* request or clice.toml key: a case that exercises it, or CI's coverage check fails (tests/README.md, "Coverage").
  • A failure on one platform: reproduced and fixed on that OS — a box of it, or a machine of yours — not by pushing guesses at CI.

Commands

  • Build: pixi run build [type] = npx bazel build --config=[type] //:dist (npm's bazelisk), the type RelWithDebInfo (the default) or Debug. Each type has its own output directory: build/[type]/bin is Bazel's output tree, with bin/clice, bin/unittests and the resource directory lib/clang in it — the tests and everything else run build/[type]/bin/bin/clice.
  • More targets and Bazel options go after --, built beside //:dist: //:package and //:symbols are the release archive and the symbol package, clice.gsym (build/[type]/bin/clice.tar.gz and clice-symbol.tar.xz, .zip on Windows).
  • libclang is ThinLTO bitcode: a link redoes its code generation (minutes) unless lld's ThinLTO cache (bazel/clice.bazelrc) has it, so the first link on a machine is slow and later ones take seconds.
  • npx bazel exists once pixi run install-tests (or a build) has run. Building on Windows takes a short output root first (docs/en/guide/build.md).
  • compile_commands.json for clice's own sources: npx bazel run @compdb//:refresh -- --output_groups=+compilation_prerequisites_INTERNAL_ (of //...): the added output group builds what the commands read but the aspect does not, the generated headers and the _virtual_includes trees, which go stale otherwise.
  • Unit tests: pixi run -e test-run unit-test [type]; one of them: -- --test-filter=SuiteName.CaseName (also SuiteName.*).
  • Cases: pixi run -e test-run cases-test [type]; some of them: CLICE_CASES=<path prefix> pixi run -e test-run cases-test [type], the prefix e.g. hover/ or hover/templates/06_template_forms. The "Running" section of tests/README.md lists the rest.
  • Both: pixi run -e test-run test [type]. The suites run in the test-run environment, as in CI.
  • Every target also cross-builds on Linux x64, as CI builds them all: pixi run build RelWithDebInfo -- --platforms=@xclang//platforms:<triple>, the triples being the targets of .github/workflows/test.yml. build/[type] points at the last build's output tree: after a cross build, the suites here would run the other platform's programs — build natively again first.

Reading the results

  • Write the output to a file (> /tmp/<topic>-build.log 2>&1), then read the exit code and the log's tail (Build did NOT complete successfully, FAILED, the suite summary) — never the whole log, never through a pipe: | tail reports tail's exit code (a failed build looks green), pipefail + | grep error fails when there is nothing to find.
  • Before running a suite, check the binary was built after your last source edit (on a box: after your last box push): a pass on a stale binary verifies nothing.
  • A failing case is named <topic>/<subtopic>/<case> > <test>; CLICE_CASES=<topic>/<subtopic>/<case> reruns it alone.

On a box

id=$(box up clice-io/clice)        # ~1 min
box push $id                       # tracked files only: `git add` new ones first
box run $id 'pixi run build RelWithDebInfo' > /tmp/<topic>-build.log 2>&1 &&
box run $id 'pixi run -e test-run test RelWithDebInfo' > /tmp/<topic>-test.log 2>&1
  • The Linux compat suite runs in CI's image, tagged by the Dockerfile's SHA-256, as the box's own user, with the checkout, the caches (Bazel's output tree among them) and pixi mounted at their own paths; --init lets bazel shutdown see its server exit:
box run $id 'src=$(realpath .) && docker run --rm --init -e CI \
  -v "$src:$src" -v "$HOME/.cache:$HOME/.cache" -v "$HOME/.pixi:$HOME/.pixi" -w "$src" \
  ghcr.io/clice-io/compat-linux:$(sha256sum tests/compat/Dockerfile | cut -d" " -f1) \
  bash -c "export PATH=$HOME/.pixi/bin:\$PATH && pixi install -e node -e cuda -e toolchains && pixi run -e node compat-test"' \
  > /tmp/<topic>-compat.log 2>&1
  • Boxes are plentiful: verification runs in parallel, never one run after another on one box. Each kind of work gets a box of its own — RelWithDebInfo and Debug, each target, each side of an A/B — and the cases split over several with the shard argument (pixi run -e test-run cases-test RelWithDebInfo 2/3, whole subtopics per shard).
  • A box is leased once and reused, warm, for every later push; never box down it — an idle box stops by itself after an hour.
  • Only a linux box restores main's CI caches (Bazel's and ThinLTO's), of Linux x64 and Windows x64 RelWithDebInfo: a Debug build or another cross target starts cold.
  • Another platform: build on a linux box with the platform's triple, run on a box of that platform (--os). That box only runs the suites (a windows box builds nothing: no Bazel cache, only the test-run environment):
lin=$(box up clice-io/clice)
win=$(box up clice-io/clice --os windows)    # or windows-arm, macos, macos-intel, linux-arm
box push $lin && box push $win
box run $lin 'pixi run build RelWithDebInfo -- --platforms=@xclang//platforms:x86_64-w64-mingw32' &&
box cp $lin $win build/RelWithDebInfo/bin/bin build/RelWithDebInfo/bin/lib --exclude '*.runfiles' --exclude '*.dSYM' &&
box run $win 'pixi run -e test-run unit-test RelWithDebInfo'

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.