Agent skill

Write Tests

by JamieMason in JamieMason/syncpack

Write tests for Syncpack using the TestBuilder pattern. An agent skill from JamieMason/syncpack.

MITAuto-check passedTesting & QA

Install Write Tests

skills CLI
$ npx skills add JamieMason/syncpack --skill write-tests -a claude-code

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

GitHub CLI
$ gh skill install JamieMason/syncpack write-tests --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/JamieMason/syncpack.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/write-tests .claude/skills/write-tests && 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
write-tests
GitHub stars
2.1k
Token cost
~2.3k tokens
SKILL.md length
358 words
Files
2
Skills in repo
11
Repo updated
First seen
Licence
MIT

At a glance

Write tests for Syncpack using the TestBuilder pattern. An agent skill from JamieMason/syncpack.

  • Works in 4 steps: Read 2-3 tests in the same *_test.rs and… → Write failing test → just test → confirm… → Ask before implementing → …
  • Adding tests for commands
  • SKILL.md covers Golden rules, TDD, Quick start and Sub-module organisation, plus 8 more sections
  • Calls just and cargo

What it does

Write Tests is an agent skill from JamieMason/syncpack. Write tests for Syncpack using the TestBuilder pattern. Use when adding tests for commands, validation logic, or any new functionality. Covers TestBuilder API, assertion patterns, and common test scenarios.

Its SKILL.md is about 2.3k tokens, which your agent loads only when the skill is triggered. The skill folder holds 1 other file (for example `patterns.md`).

It sits in Testing & QA, covering Test generation. It works with npm. The repository describes itself as: Consistent dependency versions in large JavaScript Monorepos. The licence is MIT.

When your agent uses it

  • Adding tests for commands
  • Validation logic
  • Any new functionality

Example prompts

  • “/write-tests”

Workflow steps

4 steps, taken from the first numbered list in SKILL.md.

  1. Read 2-3 tests in the same *_test.rs and copy the pattern
  2. Write failing test → just test → confirm RED
  3. Ask before implementing
  4. Implement minimal code → GREEN → just format

What it can do on your machine

Read from SKILL.md and the folder at commit 958d306. 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:

    • just
    • cargo

    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

Write Tests loads about 2.3k tokens when it runs. Until then it costs about 55 tokens; SKILL.md has 358 words of instructions outside code blocks.

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

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 JamieMason/syncpack at commit 958d306, republished under its MIT licence (© JamieMason). 358 words, ~2,287 tokens.

Download SKILL.mdSave it as .claude/skills/write-tests/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
write-tests
description
Write tests for Syncpack using the TestBuilder pattern. Use when adding tests for commands, validation logic, or any new functionality. Covers TestBuilder API, assertion patterns, and common test scenarios.

Write Tests

Golden rules

  • Use TestBuilder — never construct Context manually.
  • Assert with expect(&ctx).to_have_instances(vec![...]) — never index ctx.instances.
  • Async-first: #[tokio::test] + .run().await is the canonical entry.

TDD

  1. Read 2-3 tests in the same *_test.rs and copy the pattern
  2. Write failing test → just test → confirm RED
  3. Ask before implementing
  4. Implement minimal code → GREEN → just format

Quick start

rust
use {
  crate::{
    instance::{FixableInstance::*, InstanceState, SuspectInstance::*, UnfixableInstance::*, ValidInstance::*},
    test::{
      builder::TestBuilder,
      expect::{expect, ExpectedInstance},
    },
  },
  serde_json::json,
};

#[tokio::test]
async fn pinned_version_replaces_anything_different() {
  let ctx = TestBuilder::new()
    .with_package(json!({
      "name": "package-a",
      "version": "1.0.0",
      "devDependencies": {"foo": "workspace:*"}
    }))
    .with_version_group(json!({
      "dependencies": ["foo"],
      "pinVersion": "1.2.0"
    }))
    .run()
    .await;
  expect(&ctx).to_have_instances(vec![
    ExpectedInstance {
      state: InstanceState::valid(IsLocalAndValid),
      dependency_name: "package-a",
      id: "package-a in /version of package-a",
      actual: "1.0.0",
      expected: Some("1.0.0"),
      overridden: None,
    },
    ExpectedInstance {
      state: InstanceState::fixable(DiffersToPin),
      dependency_name: "foo",
      id: "foo in /devDependencies of package-a",
      actual: "workspace:*",
      expected: Some("1.2.0"),
      overridden: None,
    },
  ]);
}

Sub-module organisation

Group related scenarios under nested modules — see pinned_test.rs, catalog_defs_test.rs:

rust
mod local {
  use super::*;
  #[tokio::test] async fn refuses_to_pin_local_version() { ... }
}

mod normal {
  use super::*;
  #[tokio::test] async fn an_already_pinned_version_is_valid() { ... }
}

mod registry_updates {
  use super::*;
  #[tokio::test] async fn def_marked_outdated_when_registry_has_newer_version() { ... }
}

File location

Test typeLocation
Version-group behaviour (pin, ban, ranges …)src/version_group/<group>_test.rs
Catalog discovery wiringsrc/version_group/{catalog,bun_catalog}_test.rs
Fix mutationssrc/commands/fix_test.rs
Format passsrc/visit_formatting/format_test.rs
Other unit testsCo-located: src/foo.rs ↔ src/foo_test.rs

Builder methods

Source of truth: src/test/builder.rs.

MethodPurpose
.with_package(json!({...}))Add one package.json
.with_packages(vec![...])Add many
.with_version_group(json!({...}))Add one version group
.with_version_groups(vec![...])Add many
.with_semver_group(json!({...}))Add a semver group
.with_config(json!({...}))Base config (e.g. customTypes, dependencyGroups)
.with_strict(bool)Strict mode (Suspect → error)
.with_subcommand("update")Override subcommand (default: lint, or update if registry set)
.with_pnpm_catalogs(yaml)Inject pnpm-workspace.yaml; implies pnpm PM
.with_bun_catalogs(json!({...}))Synthetic Bun root with /catalog, /catalogs/{n}; implies Bun PM
.with_bun_workspaces_catalogs(json!({...}))Same, nested under /workspaces/
.with_{pnpm,bun,npm,yarn,unknown}_package_manager()Force PM detection
.with_registry_updates(json!({"react":[...]}))Mock npm registry; implies subcommand=update
.with_update_target(UpdateTarget::Minor)Bound update target
.run().await → ContextPrimary end-to-end (full pipeline through disk + discovery)
.build()Sync, no visit — context-wiring tests
.build_and_visit_packages()Sync + visit_packages — fix tests, older suites
.build_and_visit_formatting()Sync + visit_formatting
.build_with_registry_and_visit().awaitSync wiring + async registry mock + visit
Show full SKILL.md (147 more words)Show less

ExpectedInstance fields

rust
ExpectedInstance {
  state: InstanceState::fixable(DiffersToPin),  // valid / fixable / unfixable / suspect
  dependency_name: "react",                     // = `internal_name` (alias-aware)
  id: "react in /dependencies of package-a",    // {dep} in {/path} of {package_or_yaml}
  actual: "17.0.0",                             // raw specifier on disk
  expected: Some("18.0.0"),                     // None = ignore; Some("") = remove
  overridden: None,                             // semver-group override target, if any
}

id location examples:

  • /dependencies, /devDependencies, /peerDependencies
  • /version of package-a (local version)
  • /packageManager, /engines/node
  • /catalog of pnpm-workspace.yaml, /catalogs/<name> of pnpm-workspace.yaml
  • /customVersion, /custom/config/version (via customTypes)

Patterns

→ patterns.md: banned, pinned, sameRange, pnpm catalogs, bun catalogs, semver ranges, registry updates.

Fix tests

src/commands/fix_test.rs builds with .build_and_visit_packages() then runs fix::run(ctx, &SilentReporter, &disk). dry_run = true is the default (set by mock::config_from_mock), so is_dirty() and post-fix contents stay observable. Set ctx.config.cli.dry_run = false only when asserting writes through a recording MockDiskIo (see pnpm_fix_writes_yaml_to_disk).

Common mistakes

WrongRight
#[test] fn foo() + .run().await#[tokio::test] async fn foo()
use crate::instance_state::*use crate::instance::*
"pinned": "1.0.0""pinVersion": "1.0.0"
Context { ... }TestBuilder::new()...
ctx.instances[0]expect(&ctx).to_have_instances(vec![...])
.build() then check states.run().await (or .build_and_visit_packages() for sync)
Missing SuspectInstance::* importImport all 4: FixableInstance::*, ValidInstance::*, SuspectInstance::*, UnfixableInstance::*

Running

bash
just test                            # all
cargo test pinned_test               # pattern match
cargo test test_name -- --nocapture  # with stdout

Reference tests

  • src/version_group/banned_test.rs — banned + custom types
  • src/version_group/pinned_test.rs — sub-modules, semver-group interaction
  • src/version_group/same_range_test.rs — range satisfaction
  • src/version_group/catalog_test.rs — pnpm catalogs
  • src/version_group/bun_catalog_test.rs — bun catalogs (sync .build())
  • src/version_group/preferred_semver_test.rs — registry updates, update targets

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

Files

SKILL.md and 1 other file in .claude/skills/write-tests of JamieMason/syncpack.

  • SKILL.md
  • patterns.md

Open the folder on GitHubat commit 958d306

Compare with similar skills

Write Tests 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.

Write Tests compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Write Tests this skillJamieMason/syncpack2.1k—~2.3kAutomated safety check: PassMIT
Test ScopeGlitterKill/sdl-mcp490—~586Automated safety check: PassCustom licence
Pre Commitwellwelwel/poku1.2k—~728Automated safety check: PassMIT
Make Git Escrowinternet-court/internet-court-skill6.4k1 repos~922Automated safety check: NotesMIT
Write Testsryokun6/ryos1.3k—~1.7kAutomated safety check: PassAGPL-3.0
Backend Test Writeraiskillstore/marketplace4301 repos~1.1kAutomated safety check: PassNone

Similar skills

  • Test Scope

    GlitterKill/sdl-mcp

    Determine which test suites are affected by recent code changes and run only the relevant ones.

    490 GitHub stars~586 tokensUpdated 16 days ago
    Testing & QAAuto-check passed
  • Pre Commit

    wellwelwel/poku

    Run the mandatory pre-commit checks for the poku repository before staging a commit.

    1.2k GitHub stars~728 tokensUpdated 3 mo ago
    Testing & QAAuto-check passed
  • Make Git Escrow

    internet-court/internet-court-skill

    Create a new git escrow bounty for a test suite. An agent skill from internet-court/internet-court-skill.

    6.4k GitHub starsUsed in 1 repo~922 tokens
    Testing & QAAuto-check: notes
  • Write Tests

    ryokun6/ryos

    Write and run ryOS tests with Bun's native test runner (bun:test).

    1.3k GitHub stars~1.7k tokensUpdated today
    Testing & QAAuto-check passed
  • Backend Test Writer

    aiskillstore/marketplace

    A skill your agent uses when generating tests for backend code (Express routes, MongoDB models, Node services) - analyzes file type, detects test framework from package.json, generates comprehensive…

    430 GitHub starsUsed in 1 repo~1.1k tokens
    Testing & QAAuto-check passed
  • Generate Tests

    coco-research/coco

    A skill your agent uses when asked to generate tests for a file, module or component, to raise coverage, or to bootstrap a suite for untested code.

    473 GitHub stars~1.7k tokensUpdated today
    Testing & QAAuto-check passed

More from JamieMason/syncpack

All 11 skills in this repo
  • Document Code

    JamieMason/syncpack

    Add and update the documentation website for Syncpack. An agent skill from JamieMason/syncpack.

    2.1k GitHub stars~1.3k tokensUpdated 11 days ago
    Auto-check passed
  • Fix Bug

    JamieMason/syncpack

    Debug and fix bugs in Syncpack using scientific debugging methodology.

    2.1k GitHub stars~1.2k tokensUpdated 11 days ago
    Auto-check passed
  • Front Loading

    JamieMason/syncpack

    Put the answer first, then context and details follow. An agent skill from JamieMason/syncpack.

    2.1k GitHub stars~1.9k tokensUpdated 11 days ago
    Auto-check passed
  • Search Code

    JamieMason/syncpack

    Search for code patterns in Syncpack. An agent skill from JamieMason/syncpack.

    2.1k GitHub stars~581 tokensUpdated 11 days ago
    Auto-check passed
  • Signal Over Noise

    JamieMason/syncpack

    Maximize useful information per word by removing filler, obvious explanations, and hedging language.

    2.1k GitHub stars~1.5k tokensUpdated 11 days ago
    Auto-check passed
  • Testing Gaps

    JamieMason/syncpack

    Run coverage, inspect results, and identify missing test scenarios for a given source file.

    2.1k GitHub stars~766 tokensUpdated 11 days ago
    Auto-check passed

Works with

Categories

Questions about Write Tests

What does Write Tests do?

Write tests for Syncpack using the TestBuilder pattern. An agent skill from JamieMason/syncpack. Write Tests is an agent skill from JamieMason/syncpack. Write tests for Syncpack using the TestBuilder pattern.

When should I use Write Tests?

Write Tests fits situations like: adding tests for commands; validation logic; any new functionality.

How do I install Write Tests in Claude Code?

Run `npx skills add JamieMason/syncpack --skill write-tests -a claude-code`. Or copy the skill folder (.claude/skills/write-tests in JamieMason/syncpack) into .claude/skills/write-tests in your project. Claude Code loads it when a task matches its description.

How do I install Write Tests in Codex?

Run `npx skills add JamieMason/syncpack --skill write-tests -a codex`. Or copy the skill folder (.claude/skills/write-tests in JamieMason/syncpack) into .agents/skills/write-tests in your project. Codex loads it when a task matches its description.

Can I use Write Tests 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 JamieMason/syncpack --skill write-tests -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/write-tests, .gemini/skills/write-tests, .github/skills/write-tests and .opencode/skills/write-tests in your project.

What does Write Tests need to run?

Going by SKILL.md and its folder, Write Tests needs the command-line tools its instructions call (just and cargo).

Does Write Tests 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 Write Tests 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 Write Tests use?

Write Tests 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 Write Tests use?

About 2.3k tokens (SKILL.md is roughly 9.1k 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 Write Tests?

Skills that share tags, products or a category with Write Tests: Test Scope (GlitterKill/sdl-mcp, 490 stars), Pre Commit (wellwelwel/poku, 1.2k stars), Make Git Escrow (internet-court/internet-court-skill, 6.4k stars) and Write Tests (ryokun6/ryos, 1.3k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Write Tests?

JamieMason (a GitHub user) maintains it in JamieMason/syncpack, which has 2,099 GitHub stars. The repository holds 11 skills in this directory. The repository was last updated on September 26, 2026.

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