Skip to content
Agentmart
Submit a tool

rebalance-tests

Use when rebalancing CI test harness shards, Rust coverage shards, or both from recent timings.

Skill by character-ai

IndexedMIT★ 7
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/character-ai-rebalance-tests

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Use when rebalancing CI test harness shards, Rust coverage shards, or both from recent timings. Creates one PR and verifies the selected shard plan.

Use cases: testing, devops

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/rebalance-tests

Tools it pre-approves 3

From allowed-tools in SKILL.md: the agent may use these without asking you each time.

  • Bash,
  • Read,
  • Write

What's inside

Skill name
rebalance-tests
Description
Use when rebalancing CI test harness shards, Rust coverage shards, or both from recent timings. Creates one PR and verifies the selected shard plan.
License
MIT
Allowed tools
Bash,, Read,, Write
Instructions
110 lines in SKILL.md · view on GitHub

Before installing

  • Pre-approves some shell commands

Files (2)

  • SKILL.md
  • rebalance.md · scripts/

SKILL.md (first lines)

**MANDATORY: Follow the complete shared lifecycle contract in `${CLAUDE_PLUGIN_ROOT}/skills/shared/run-lifecycle.md` with declared skill `rebalance-tests`.**

# /rebalance-tests

**MANDATORY: READ ENTIRE FILE before composing user-facing prose: `$PWD/skills/shared/readability-style.md`.**

**Dev-only operator skill** (`.claude/skills/` and not exported by the plugin).

Run the checked Rust `rebalance-tests run` workflow. Keep
`scripts/rebalance.md` aligned with this prompt and the command contract.

## Usage

```
/rebalance-tests [--kind {harness,rust,all}] [--repo owner/name] [--n-runs N] [--branch-prefix PREFIX] [--n-verify-runs N] [--n-rust-shards N] [--max-shard-wall-clock SECONDS] [--max-rust-shard-wall-clock SECONDS] [--experimental-wall-clock-override NOTE] [--compile-affinity TARGET=GROUP:SECONDS] [--workflow FILE] [--baseline-branch BRANCH] [--dry-run]
```

All flags are optional. `--kind` defaults to `all`, and `--branch-prefix`
defaults to `rebalance-shards`.

## Safety contract

Before collecting timings, and again immediately before a candidate write, the
command fetches `origin/main` and requires a clean, unstashed symbolic `main`
checkout whose `HEAD`, local `main`, and `origin/main` revisions match. It then
uses the typed GitHub Actions owner to collect complete baseline evidence and
passes it to the pure Rust planning contract.

- `harness` preserves the complete same-run harness, bootstrap, and jobs cohort.
  It rejects missing evidence, target inventory drift, modeled wall-clock
  regressions, and an over-budget unchanged layout.
- `rust` requires a complete jobs-API cohort for every configured
  `rust-full shard N` cell. It accepts the legacy monolithic `rust-full` job as
  a one-shard baseline, and verifies the resized matrix against the approved
  slowest-shard threshold.
- `all` requires both selected legs to pass before a write.
- `--dry-run` performs the preflight and planning checks, but writes no
  artifact and creates no branch, commit, push, pull request, or workflow run.

The command exits before branch creation when the plan is a no-op. A documented
`--experimental-wall-clock-override NOTE` can admit only a modeled or measured
harness or Rust coverage wall-clock regression. It cannot bypass stale,
skipped, or incomplete evidence.

## Writes, publication, and verification

The workflow writes only `Makefile` and `.github/workflows/ci.yaml`, through
the existing shard grammars and atomic write owners. A Rust workflow resize
updates the matrix and its matching configured counts in one atomic write. It
validates the proposed harness partition before publication.
If publication fails before a pull request exists, it restores written
artifacts, returns to `main`, and removes the local branch. A branch whose push
completed or has an ambiguous outcome is reported if the typed Git owner cannot
prove that it is safe to delete.

After it creates a pull request, the command dispatches and waits for
`--n-verify-runs` successful workflow runs on the PR branch. It verifies the
same fail-closed Rust decision contract against those exact run IDs. A failed
post-PR verification leaves the PR available for review. Merge stays
operator-owned.

## How to invoke

Run from the repository root:

```bash
cargo build --locked --release --package larch-cli
LARCH_BINARY="$PWD/target/release/larch" \
"${CLAUDE_PLUGIN_ROOT}/scripts/larch.sh" rebalance-tests run [flags]
```

Pass all skill arguments to `rebalance-tests run` unchanged:

```
/rebalance-tests --kind all --n-runs 3
/rebalance-tests --kind rust --repo owner/name --dry-run
```

## Flags

| Flag | Default | Description |
|------|---------|-------------|
| `--kind` | `all` | Selected leg: `harness`, `rust`, or `all` |
| `--repo` | origin remote | GitHub repository in `owner/name` form; must match `origin` |
| `--n-runs` | `5` | Successful baseline runs to sample, from 1 through 20 |
| `--branch-prefix` | `rebalance-shards` | Prefix for the new branch |
| `--n-verify-runs` | `3` | Successful verification runs to dispatch |
| `--n-rust-shards` | configured | Expected `rust-full-shards` matrix count, from 1 through 32 |
| `--max-shard-wall-clock` | `300` | Maximum harness job wall-clock in seconds |
| `--max-rust-shard-wall-clock` | `600` | Maximum Rust coverage shard wall-clock in seconds |
| `--experimental-wall-clock-override NOTE` | unset | Documented harness or Rust wall-clock experiment |
| `--compile-affinity TARGET=GROUP:SECONDS` | unset | Repeatable shared compile setup declaration |
| `--workflow` | `ci.yaml` | Workflow file to sample and dispatch |
| `--baseline-branch` | `main` | Baseline branch |
| `--dry-run` | false | Plan without any mutation |

## Implementation surface

| Surface | Responsibility |
|--------|---------------|
| `larch rebalance-tests run` | Immutable-main preflight, planning composition, atomic writes, branch and PR publication, verification, and recovery |
| `larch rebalance-tests plan` / `verify` | Pure versioned planning and verification decisions |
| `larch ci-timing` | Typed GitHub Actions timing collection, including `rust-jobs` |
| `larch test-shard` | Deterministic packing and Makefile shard grammar |

The focused workflow tests live in
`crates/larch-cli/src/rebalance_tests_workflow.rs` and
`crates/larch-cli/tests/rebalance_tests_workflow.rs`.

From character-ai/larch, MIT.

More from character-ai/larch

Signals

Stars
7
Forks
4
Open issues
6
Last commit (this folder)
Aug 25, 2026 (2 months ago)
Last release
Sep 8, 2026 (1 month ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from character-ai

Cite this page

rebalance-tests skill. Agent Mart. https://agentmart.dev/skills/character-ai-rebalance-tests (last updated 2026-10-24)