Agent skill

Tests Guard Intentional Workarounds

by divinevideo in divinevideo/divine-mobile

Before removing code that looks redundant, wasteful, or "wrong" based on log observations or code review instinct, grep the test suite for tests whose names describe the exact behavior you're about…

MPL-2.0Auto-check passedTesting & QA

Install Tests Guard Intentional Workarounds

skills CLI
$ npx skills add divinevideo/divine-mobile --skill tests-guard-intentional-workarounds -a claude-code

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

GitHub CLI
$ gh skill install divinevideo/divine-mobile tests-guard-intentional-workarounds --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/divinevideo/divine-mobile.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/tests-guard-intentional-workarounds .claude/skills/tests-guard-intentional-workarounds && 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
tests-guard-intentional-workarounds
GitHub stars
266
Token cost
~2.2k tokens
SKILL.md length
1,042 words
Files
1
Skills in repo
103
Repo updated
First seen
Licence
MPL-2.0

At a glance

Before removing code that looks redundant, wasteful, or "wrong" based on log observations or code review instinct, grep the test suite for tests whose names describe the exact behavior you're about…

  • Works in 5 steps: Grep for tests that assert the exact… → Read the test comment, not just the… → Correlate with your production log → …
  • Tempted to remove a function call that looks redundant based on a production log
  • SKILL.md covers Problem, Context / Trigger Conditions, Solution and Verification, plus 3 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Tests Guard Intentional Workarounds is an agent skill from divinevideo/divine-mobile. Before removing code that looks redundant, wasteful, or "wrong" based on log observations or code review instinct, grep the test suite for tests whose names describe the exact behavior you're about to remove. A test whose title literally describes the "weird" thing (e.g. "calls play() even when player reports playing", "retries even when first call succeeded", "skips cache even when fresh") is a load-bearing workaround, and the production log you're reacting to is probably the workaround working as designed — not…

Its SKILL.md is about 2.2k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Testing & QA, covering Test generation and Failing and flaky tests. The licence is MPL-2.0.

When your agent uses it

  • Tempted to remove a function call that looks redundant based on a production log
  • About to simplify a conditional that seems to always take the same branch
  • Reviewing code and thinking why would anyone write this?
  • A log line shows a state that seems impossible

Example prompts

  • “re about to remove. A test whose title literally describes the”
  • “thing (e.g.”
  • “retries even when first call succeeded”
  • “/tests-guard-intentional-workarounds”

Workflow steps

5 steps, taken from the step headings in SKILL.md.

  1. Grep for tests that assert the exact behavior
  2. Read the test comment, not just the assertion
  3. Correlate with your production log
  4. Preserve behavior, improve observability
  5. If CI already caught you, revert and learn

What it can do on your machine

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

    No scripts in the folder and no shell commands in SKILL.md (its code samples are bash and dart).

    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

Tests Guard Intentional Workarounds loads about 2.2k tokens when it runs. Until then it costs about 251 tokens; SKILL.md has 1,042 words of instructions outside code blocks.

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

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 divinevideo/divine-mobile at commit c3d6f7e, republished under its MPL-2.0 licence (© divinevideo). 1,042 words, ~2,242 tokens.

Download SKILL.mdSave it as .claude/skills/tests-guard-intentional-workarounds/SKILL.md (or your agent's skills folder).
name
tests-guard-intentional-workarounds
description
Before removing code that looks redundant, wasteful, or "wrong" based on log observations or code review instinct, grep the test suite for tests whose names describe the exact behavior you're about to remove. A test whose title literally describes the "weird" thing (e.g. "calls play() even when player reports playing", "retries even when first call succeeded", "skips cache even when fresh") is a load-bearing workaround, and the production log you're reacting to is probably the workaround working as designed — not a bug. Use when: (1) Tempted to remove a function call that "looks redundant" based on a production log, (2) About to "simplify" a conditional that seems to always take the same branch, (3) Reviewing code and thinking "why would anyone write this?", (4) A log line shows a state that seems impossible or contradictory (e.g. playing=true but positionMs=0 for seconds), (5) CI surfaces a failing test whose name describes exactly what your fix removed.
author
Claude Code
version
1.0.0
date
2026-04-05

Tests Guard Intentional Workarounds

Problem

You observe a production log line that looks clearly wrong — a function being called when its precondition already appears satisfied, a retry firing when the first attempt seemed to work, state being set to the value it already holds. Instinct says "this is a redundant no-op, I'll remove it." You remove it, run local tests (which may even pass if coverage is thin), push to CI, and a test fails with a title that describes exactly the behavior you just removed. The comment on that test explains a subtle platform bug or race condition that required the "redundant" call as a workaround.

The log line you reacted to wasn't evidence of a bug. It was evidence of the workaround executing correctly for the exact scenario it was designed for.

Context / Trigger Conditions

Apply this skill's caution when ANY of these hold:

  1. Redundant-looking call: You're about to wrap a call in if (!already_X) or delete it outright because logs show it firing when X is already true.
  2. Impossible state in logs: Logs show a state combination that seems logically impossible or contradictory (playing=true + positionMs=0 for seconds, isLoading=false + data still empty, etc.).
  3. "Why would anyone write this?": Reading code and you can't imagine a reason for a defensive check, extra await, or secondary call.
  4. Simplifying a conditional: A branch looks dead because you believe the condition can't be reached, or both branches look identical to you.
  5. Receiving a failing test: CI returns a failure with a test title that names exactly the behavior your change removed or modified.

Solution

Before touching the "redundant" code, run this five-step check:

Step 1: Grep for tests that assert the exact behavior

Search the test suite for the function name, the state you think is redundant, and any synonyms:

bash
# Example: considering removing player.play() on rebuffer complete
grep -rn "player.play" test/ | grep -iE "already|even when|still|twice|redundant"
grep -rn "rebuffer.*play\|playing.*true.*play" test/

Look specifically for test names containing phrases like:

  • "even when X" / "even if X"
  • "still calls Y when Z"
  • "twice on Y" / "idempotent"
  • "after Y" (especially "after seek", "after error", "after reconnect")
  • "recovers from" / "nudges" / "resumes"
  • The specific state word from your log (stalled, frozen, orphan, race)
Step 2: Read the test comment, not just the assertion

If you find a matching test, read the comment above the assertion, not just the expect() call. The comment almost always explains why the otherwise-redundant behavior is required. Look for phrases like:

  • "mpv/iOS/Chrome/Safari can X even when Y"
  • "nudge", "kick", "wake up", "unstick"
  • "workaround for", "due to", "race with"
  • Bug tracker references, commit SHAs, PR numbers
Step 3: Correlate with your production log

Re-read the log line that prompted the "fix" through the lens of the test comment. Does the log state match the bug scenario the test describes?

  • If the test says "mpv reports playing=true while stalled at positionMs=0" and your log shows playing=true, positionMs=0, you are looking at the bug the workaround exists to handle. The workaround is working.
  • If the log state doesn't match the test's stated scenario, you may have found a new bug OR a genuinely redundant branch. Proceed carefully.
Step 4: Preserve behavior, improve observability

If the workaround is load-bearing, don't remove it. Instead:

  • Add or improve the log message so future-you understands the intent (nudge_stalled_decoder is clearer than redundant_play).
  • Add a code comment referencing the test that guards this behavior (// See test: "rebuffer recovery calls play() even when playing=true").
  • If the volume is noisy, consider downgrading the log level or sampling it, but keep the behavior.
Step 5: If CI already caught you, revert and learn

If you've already pushed and CI surfaced the guarding test:

  1. Don't "fix" the test to match the new behavior. The test is the spec.
  2. Revert just the behavior change — keep any unrelated improvements (logging, comments, etc.).
  3. Read the test comment carefully and update your mental model of the system.
  4. Commit the revert with a message that captures the lesson so the next engineer reading git blame understands why the "redundant" call is there.
Show full SKILL.md (382 more words)Show less

Verification

After applying this skill, you should be able to answer:

  • Is there a test whose name describes the behavior I'm about to remove?
  • If yes, does its comment explain a bug/race/platform quirk that justifies it?
  • Does the production log I'm reacting to match that bug's scenario?
  • Can I explain in one sentence why the "redundant" behavior exists, with enough detail that a reviewer would agree?

If you can't answer all four, you don't yet know enough to remove the code.

Example

Scenario (real, Flutter + media_kit video player):

Production log from iOS:

STUTTER_DEBUG rebuffer_auto_play index=48 positionMs=0 playing=true

Instinct: "Why call player.play() when player.state.playing is already true? That's a no-op at best. Let me add if (!player.state.playing)."

Wrong fix applied. CI fails:

 - [FAILED] VideoFeedController post-seek rebuffer recovery
   rebuffer recovery calls play() even when player reports playing

Reading the test (which was already in the repo):

dart
test(
  'rebuffer recovery calls play() even when player reports playing',
  () async {
    // ...
    // Simulate rebuffer completes while player reports playing=true.
    // mpv can stall (no frame output) even when playing=true after a
    // seek, so we always call play() to nudge the decoder.
    when(() => setup.state.playing).thenReturn(true);
    // ...
    verify(setup.player.play).called(greaterThanOrEqualTo(1));
  },
);

The test comment documents the exact bug: mpv's playing=true does not guarantee frame output after a seek or network hiccup. The "redundant" play() call is specifically to unstick the decoder in that state. The production log showing positionMs=0, playing=true for seconds is the bug happening in production — and the workaround is the reason videos recover instead of staying frozen.

Correct response: Revert the if (!playing) guard. Keep it calling play() unconditionally. If the log is noisy, rename the log tag from rebuffer_auto_play to decoder_nudge to reflect the actual purpose, and add a source comment pointing at the test.

Notes

  • This skill is about code you didn't write. Your own recent code is unlikely to have a hidden workaround you forgot about.
  • Particularly common in: video/audio playback, network retry paths, browser quirks, GPU/driver workarounds, filesystem race conditions, distributed systems idempotency, animation/layout pipelines.
  • A test whose name contains the phrase "even when" or "even if" is the single strongest signal that you're looking at a guarded workaround.
  • Conversely, if you add a workaround, write the test with a name that literally describes the surprising behavior, so the next engineer (or future-you) gets the warning you wish you'd gotten.
  • Related: superpowers:verification-before-completion (don't claim a fix works until you've actually run the test that guards the behavior) and simplify (which should also respect this rule — don't simplify away code that a test explicitly asserts).

References

  • Original session: Divine Mobile PR #2737, iOS video stutter debugging, 2026-04-05.
  • Related skill: mock-call-count-retry-fallback — for the inverse case where adding retry logic breaks test call counts.

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

Files

Just SKILL.md in .agents/skills/tests-guard-intentional-workarounds of divinevideo/divine-mobile.

Open the folder on GitHubat commit c3d6f7e

Compare with similar skills

Tests Guard Intentional Workarounds 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.

Tests Guard Intentional Workarounds compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Tests Guard Intentional Workarounds this skilldivinevideo/divine-mobile266—~2.2kAutomated safety check: PassMPL-2.0
Code SolvingHoangTheQuyen/think-better122—~3.7kAutomated safety check: PassMIT
Ue Test AuthoringJasonMa0012/MooaToon750—~2.1kAutomated safety check: NotesCustom licence
Eval Triage And Improvementmicrosoft/eval-guide138—~5.9kAutomated safety check: PassMIT
Raven Test Triagemarinasundstrom/raven108—~1.4kAutomated safety check: PassMIT
Make Git Escrowinternet-court/internet-court-skill6.6k1 repos~922Automated safety check: NotesMIT

Similar skills

  • Code Solving

    HoangTheQuyen/think-better

    Structured coding workflow for non-trivial code work: debug, build features, refactor, optimize, migrate and review code through 7 steps with evidence-based quality gates.

    122 GitHub stars~3.7k tokensUpdated yesterday
    Testing & QAAuto-check passed
  • Ue Test Authoring

    JasonMa0012/MooaToon

    A skill your agent uses when writing or modifying UE automated tests (Automation, CQTest, Functional, Gauntlet, LowLevel) with Rider MCP available.

    750 GitHub stars~2.1k tokensUpdated 22 days ago
    Testing & QAAuto-check: notes
  • Eval Triage And Improvement

    microsoft/eval-guide

    Official

    A skill your agent uses when the user's Copilot Studio agent evaluations have come back and they need to interpret scores, diagnose root causes of underperforming test cases, find remediation steps…

    138 GitHub stars~5.9k tokensUpdated 3 mo ago
    Testing & QAAuto-check passed
  • Raven Test Triage

    marinasundstrom/raven

    Testing and stabilization workflow for the Raven compiler test suite.

    108 GitHub stars~1.4k tokensUpdated today
    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.6k GitHub starsUsed in 1 repo~922 tokens
    Testing & QAAuto-check: notes
  • Test Blindspots

    Neeeophytee/finding-unknowns-skills

    Find consequential behavior that a passing test suite does not establish, using focused exploratory checks.

    344 GitHub stars~676 tokensUpdated 12 days ago
    Testing & QAAuto-check passed

More from divinevideo/divine-mobile

All 103 skills in this repo
  • Fix ArgoCD ExternalSecret deployment failing with "namespace X is not permitted in project Y".

    266 GitHub stars~931 tokensUpdated today
    Auto-check passed
  • Art Direct

    divinevideo/divine-mobile

    Art direction for any content — reads text, PDF, Word, HTML, PPT, then proposes 2-3 creative directions with photography style, mood, and visual language.

    266 GitHub stars~4.8k tokensUpdated today
    Auto-check passed
  • Async Await Null Race Condition

    divinevideo/divine-mobile

    Fix "Null check operator used on a null value" errors when an object is set to null during an async await.

    266 GitHub stars~881 tokensUpdated today
    Auto-check passed
  • AWS V4 Signing Custom Headers Gcs

    divinevideo/divine-mobile

    Add custom metadata headers (x-amz-meta-) to AWS v4 signed requests for GCS S3-compatible API.

    266 GitHub stars~1k tokensUpdated today
    Auto-check passed
  • Bash Herestring Newline Secrets

    divinevideo/divine-mobile

    Fix password/secret authentication failures caused by trailing newlines when creating Google Cloud secrets (or similar) with bash here-strings.

    266 GitHub stars~791 tokensUpdated today
    Auto-check passed
  • Fix silent video/media processing failures caused by URL extraction code that filters on file extensions (.mp4, .webm, .webp).

    266 GitHub stars~1.1k tokensUpdated today
    Auto-check passed

Questions about Tests Guard Intentional Workarounds

What does Tests Guard Intentional Workarounds do?

Before removing code that looks redundant, wasteful, or "wrong" based on log observations or code review instinct, grep the test suite for tests whose names describe the exact behavior you're about…. Tests Guard Intentional Workarounds is an agent skill from divinevideo/divine-mobile. Before removing code that looks redundant, wasteful, or "wrong" based on log observations or code review instinct, grep the test suite for tests whose names describe the exact behavior you're about to remove.

When should I use Tests Guard Intentional Workarounds?

Tests Guard Intentional Workarounds fits situations like: tempted to remove a function call that looks redundant based on a production log; about to simplify a conditional that seems to always take the same branch; reviewing code and thinking why would anyone write this?; A log line shows a state that seems impossible.

How do I install Tests Guard Intentional Workarounds in Claude Code?

Run `npx skills add divinevideo/divine-mobile --skill tests-guard-intentional-workarounds -a claude-code`. Or copy the skill folder (.agents/skills/tests-guard-intentional-workarounds in divinevideo/divine-mobile) into .claude/skills/tests-guard-intentional-workarounds in your project. Claude Code loads it when a task matches its description.

How do I install Tests Guard Intentional Workarounds in Codex?

Run `npx skills add divinevideo/divine-mobile --skill tests-guard-intentional-workarounds -a codex`. Or copy the skill folder (.agents/skills/tests-guard-intentional-workarounds in divinevideo/divine-mobile) into .agents/skills/tests-guard-intentional-workarounds in your project. Codex loads it when a task matches its description.

Can I use Tests Guard Intentional Workarounds 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 divinevideo/divine-mobile --skill tests-guard-intentional-workarounds -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/tests-guard-intentional-workarounds, .gemini/skills/tests-guard-intentional-workarounds, .github/skills/tests-guard-intentional-workarounds and .opencode/skills/tests-guard-intentional-workarounds in your project.

What does Tests Guard Intentional Workarounds need to run?

SKILL.md names no scripts, command-line tools or credentials: Tests Guard Intentional Workarounds is instructions for the agent only.

Does Tests Guard Intentional Workarounds 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 Tests Guard Intentional Workarounds 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 Tests Guard Intentional Workarounds use?

Tests Guard Intentional Workarounds is published under the MPL-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Tests Guard Intentional Workarounds use?

About 2.2k tokens (SKILL.md is roughly 9k 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 Tests Guard Intentional Workarounds?

Skills that share tags, products or a category with Tests Guard Intentional Workarounds: Code Solving (HoangTheQuyen/think-better, 122 stars), Ue Test Authoring (JasonMa0012/MooaToon, 750 stars), Eval Triage And Improvement (microsoft/eval-guide, 138 stars) and Raven Test Triage (marinasundstrom/raven, 108 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Tests Guard Intentional Workarounds?

divinevideo (a GitHub organization) maintains it in divinevideo/divine-mobile, which has 266 GitHub stars. The repository holds 103 skills in this directory. The repository was last updated on October 10, 2026.

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