handle-modus-checkbox-value-bug

handle-modus-checkbox-value-bug is a skill for Cursor from julianoczkowski/create-trimble-app. It costs 22 tokens per session (1,313 once invoked), scanned A, original, MIT.

A workaround for a Modus checkbox bug where its reported value is the opposite of whether it is checked.

In plain words
What is it for?
Use it whenever a React app reads value-change events from ModusCheckbox, especially in forms and checkbox state handling.
Why use it?
It prevents forms and other logic from treating checked boxes as unchecked, or unchecked boxes as checked.

Skill for Cursor

Written for Cursor: installed under .cursor/.

Good fit Use it whenever a React app reads value-change events from ModusCheckbox, especially in forms and checkbox state handling.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/julianoczkowski/create-trimble-app/handle-modus-checkbox-value-bug
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add julianoczkowski/create-trimble-app --skill handle-modus-checkbox-value-bug
Clone the repo
git clone --depth 1 https://github.com/julianoczkowski/create-trimble-app

Made for: Cursor.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for handle-modus-checkbox-value-bug

README.md
[![agentmods](https://agentmods.dev/badge/skills/julianoczkowski/create-trimble-app/handle-modus-checkbox-value-bug/github.svg)](https://agentmods.dev/skills/julianoczkowski/create-trimble-app/handle-modus-checkbox-value-bug)
Your own site
<a href="https://agentmods.dev/skills/julianoczkowski/create-trimble-app/handle-modus-checkbox-value-bug"><img src="https://agentmods.dev/badge/skills/julianoczkowski/create-trimble-app/handle-modus-checkbox-value-bug/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for handle-modus-checkbox-value-bug

Your own site · 80×15
<a href="https://agentmods.dev/skills/julianoczkowski/create-trimble-app/handle-modus-checkbox-value-bug"><img src="https://agentmods.dev/badge/skills/julianoczkowski/create-trimble-app/handle-modus-checkbox-value-bug.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 22 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,313 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00022 $0.01313
Opus 5 $0.00011 $0.00656
Sonnet 5 $0.00004 $0.00263
Haiku 4.5 $0.00002 $0.00131

Measured 5d ago against content hash 268b2d213bcd, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

handle-modus-checkbox-value-bug scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

templates/react/.cursor/skills/handle-modus-checkbox-value-bug/SKILL.md · 203 lines

How it starts

The opening of the file, as written. The whole thing — 203 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Handle Modus Checkbox Value Bug

Apply the critical value inversion workaround for ModusWcCheckbox components.

Critical Bug

The ModusWcCheckbox web component has a value inversion bug where the value property returns the opposite of the actual checked state:

  • When checkbox is checked: target.value returns false
  • When checkbox is unchecked: target.value returns true

This is the opposite of what developers expect.

When to Use

Use this skill when:

  • Implementing checkbox functionality with ModusCheckbox
  • Fixing checkbox-related bugs
  • Handling checkbox value changes
  • Creating forms with checkboxes

Reference Implementation

See src/components/ModusCheckbox.tsx:116-130 for the complete workaround implementation.

The Fix

Always invert the value when reading from checkbox events:

const handleValueChange = (event: Event) => {
  const customEvent = event as CustomEvent<InputEvent>;
  
  // 🚨 CRITICAL: Handle the value inversion bug
  const rawValue = (customEvent.target as HTMLModusWcCheckboxElement).value;
  const actualValue = !rawValue; // ✅ CORRECT: Invert the value
  
  // Use actualValue for your logic
  setChecked(actualValue);
};

Complete Pattern

import { useEffect, useRef } from "react";
import { ModusWcCheckbox } from "@trimble-oss/moduswebcomponents-react";

export default function ModusCheckbox({
  value = false,
  onValueChange,
}: {
  value?: boolean;
  onValueChange?: (event: CustomEvent<boolean>) => void;
}) {
  const checkboxRef = useRef<HTMLModusWcCheckboxElement>(null);

  useEffect(() => {
    const checkbox = checkboxRef.current;
    if (!checkbox) return;

    const handleValueChange = (event: Event) => {
      const customEvent = event as CustomEvent<InputEvent>;
      
      // 🚨 CRITICAL BUG WORKAROUND: The ModusWcCheckbox component has a value
      // inversion bug where the `value` property returns the opposite of the
      // actual checked state. This function corrects this by inverting the
      // raw value before passing it to the parent component.
      const rawValue = (customEvent.target as HTMLModusWcCheckboxElement).value;
      const actualValue = !rawValue; // ✅ CORRECT: Invert the value

      // Create a new event with the corrected value
      const correctedEvent = new CustomEvent("valueChange", {
        detail: actualValue,
        bubbles: true,
        cancelable: true,
      });

      onValueChange?.(correctedEvent);
    };

    if (onValueChange) {
      checkbox.addEventListener("inputChange", handleValueChange);
    }

    return () => {
      if (onValueChange) {
        checkbox.removeEventListener("inputChange", handleValueChange);
      }
    };
  }, [onValueChange]);

  return (
    <ModusWcCheckbox
      ref={checkboxRef}
      value={value}
    />
  );
}

Read the full file on GitHub · 203 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 5d ago First seen · 203 lines · 22 tokens per session scan A 268b2d213bcd

Subscribe to this mod's changes

handle-modus-checkbox-value-bug is a skill published in the GitHub repository julianoczkowski/create-trimble-app (3 stars, last pushed 2mo ago), licensed MIT. It adds 22 tokens to every session and 1,313 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories

angular

Use when building, refactoring, or debugging Angular (v20/21+): standalone components, signals, zoneless change detection, @if/@for/@defer control flow, inject() DI, resource()/httpResource(), RxJS interop, NgRx SignalStore, ng CLI. NOT React (that is react), NOT Next.js (that is nextjs), NOT a TypeScript language…

ericrisco/rsc-harness · 89 tokens

aiox-dev

Full Stack Developer (Dex). Use for code implementation, debugging, refactoring, and development best practices.

SynkraAI/aiox-core · 24 tokens

module-federation

Add, review, or debug client-rendered Module Federation support in Rsbuild-first TypeScript applications. Covers host/remote roles, exposes, remotes, shared dependencies, generated types, runtime loading failures, and observability checks.

soulcodex/agentic · 51 tokens

swiftui-performance-audit

Audit and improve SwiftUI runtime performance. Use for requests to diagnose slow rendering, janky scrolling, high CPU/memory usage, excessive view updates, or layout thrash in SwiftUI apps.

patrickserrano/lacquer · 45 tokens

module-federation-debugging

Diagnose Module Federation failures with evidence-first triage across manifests, remote entries, runtime errors, shared dependencies, generated types, browser loading, Node/SSR loading, and hydration boundaries.

soulcodex/agentic · 44 tokens

transition-tracing

Find and evidence the transitions between surfaces — where navigation actually goes, what triggers it, and the file:line that proves it — without inventing edges from mere links.

Eliyce/paqad-ai · 38 tokens