parity-guard-test-pattern

parity-guard-test-pattern is a skill for Claude Code, Codex from fabioc-aloha/Alex_Skill_Mall. It costs 28 tokens per session (596 once invoked), scanned A, original, MIT.

A testing pattern that separates direct users of a code contract from wrapper functions that delegate the work to another implementation.

In plain words
What is it for?
Use it to check that direct callers meet shared rules while avoiding duplicate or misleading failures for delegating wrappers.
Why use it?
Treating both kinds of callers the same creates false alarms when a wrapper already handles the required behavior.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to check that direct callers meet shared rules while avoiding duplicate or misleading failures for delegating wrappers.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/fabioc-aloha/alex_skill_mall/parity-guard-test-pattern
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 fabioc-aloha/Alex_Skill_Mall --skill parity-guard-test-pattern
Clone the repo
git clone --depth 1 https://github.com/fabioc-aloha/Alex_Skill_Mall

Made for: Claude Code, Codex.

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 parity-guard-test-pattern

README.md
[![agentmods](https://agentmods.dev/badge/skills/fabioc-aloha/alex_skill_mall/parity-guard-test-pattern/github.svg)](https://agentmods.dev/skills/fabioc-aloha/alex_skill_mall/parity-guard-test-pattern)
Your own site
<a href="https://agentmods.dev/skills/fabioc-aloha/alex_skill_mall/parity-guard-test-pattern"><img src="https://agentmods.dev/badge/skills/fabioc-aloha/alex_skill_mall/parity-guard-test-pattern/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 parity-guard-test-pattern

Your own site · 80×15
<a href="https://agentmods.dev/skills/fabioc-aloha/alex_skill_mall/parity-guard-test-pattern"><img src="https://agentmods.dev/badge/skills/fabioc-aloha/alex_skill_mall/parity-guard-test-pattern.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 28 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 596 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. 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.00028 $0.00596
Opus 5.5 $0.00011 $0.00238
Sonnet 5.5 $0.00006 $0.00119
Haiku 4.5 $0.00003 $0.00060

Measured 1mo ago against content hash 1f0213dd72d6, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

parity-guard-test-pattern scanned grade A with 1 finding 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 1mo 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.

Runs shell commandslowCapability

Expected in a hook, worth knowing in a rule or an instructions file.

content.includes("child_process") &&
plugins/code-quality/parity-guard-test-pattern/skills/parity-guard-test-pattern/SKILL.md · 89 lines

How it starts

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

Parity Guard Test Pattern

The Problem

When checking that all callers of a contract implement it correctly, you get false positives from wrapper delegators:

// Contract: "All files that call exec() must handle exit code 2"

// Direct caller — MUST implement contract
execFileSync('node', [script]); // Must handle exit code

// Delegator — calls wrapper that already handles contract
runMuscle(script); // runMuscle handles exit code internally

Testing both the same way creates noise.

The Solution

Split tests into DIRECT callers and DELEGATION callers.

// parity-guard.test.js

const directCallers = findFiles((content) => 
  content.includes("child_process") && 
  /exec(File)?Sync|spawn/.test(content)
);

const wrapperCallers = findFiles((content) =>
  /runMuscle|muscleAndPrompt|executeScript/.test(content)
);

describe('Contract: exit code handling', () => {
  describe('Direct callers (must implement)', () => {
    directCallers.forEach(file => {
      it(`${file} handles exit code 2`, () => {
        const content = fs.readFileSync(file, 'utf8');
        expect(content).toMatch(/exitCode|status|code.*===?\s*2/);
      });
    });
  });

  describe('Delegators (exempt — wrapper handles)', () => {
    wrapperCallers.forEach(file => {
      it(`${file} uses contract-compliant wrapper`, () => {
        const content = fs.readFileSync(file, 'utf8');
        // Just verify they use the wrapper, not raw exec
        expect(content).not.toMatch(/execFileSync|execSync/);
      });
    });
  });
});

Classification Rules

Pattern Category Contract Obligation
require('child_process') + exec* Direct Must implement
import { spawn } + spawn() Direct Must implement
runMuscle() Delegator Exempt
shellExecute() (if contract-compliant) Delegator Exempt

Verification

  1. Direct callers all implement the contract
  2. Delegators use compliant wrappers
  3. No false positives from wrapper usage
  4. New callers are automatically classified

Read the full file on GitHub · 89 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. 1mo ago First seen · 89 lines · 28 tokens per session scan A 1f0213dd72d6

Subscribe to this mod's changes

parity-guard-test-pattern is a skill published in the GitHub repository fabioc-aloha/Alex_Skill_Mall (5 stars, last pushed 6d ago), licensed MIT. It adds 28 tokens to every session and 596 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 1 finding (runs shell commands). 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

ai-agents-empirical-probe-toolkit

Prove-it methods for this repo. Six recipes for runtime-contract probes, guard and threshold calibration, eval A/B, docs-vs-reality audits, reproduce-on-main CI triage, and negative-control test design, each with a worked example from repo history. Use when you say probe the runtime contract, calibrate this guard…

rjmurillo/ai-agents · 119 tokens

ai-agents-portability-campaign

Execute cross-harness hook changes for Claude Code and GitHub Copilot CLI using the settled official contract, versioned probes, generators, and runtime tests. Use for run the portability campaign, port hooks to a new harness, copilot hook timeout regression, or new copilot cli release, recheck the contract. Do NOT…

rjmurillo/ai-agents · 104 tokens

chaos-experiment

Design and document chaos engineering experiments. Guide steady state baseline, hypothesis formation, failure injection plans, and results analysis. Use when you say "design a chaos experiment", "plan a game day", "failure injection", "test resilience", or "chaos engineering". Do NOT use for security threat analysis…

rjmurillo/ai-agents · 84 tokens

repository-consumer-proof

Verify ai-agents hooks, installed dispatch, and behavior beyond green builds. Do NOT use for PR blockers (use repository-pr-recovery).

rjmurillo/ai-agents · 33 tokens

pr-quality-qa

Judge a local diff on test coverage, error handling, and whether the tests would fail if the code regressed, and return a PASS/WARN/CRITICALFAIL verdict. Use when you say qa review my changes, run the qa gate, or are these tests good enough. Do NOT use to run all six axes (use pr-quality-all), and do NOT use to write…

rjmurillo/ai-agents · 91 tokens

review

Review current code changes for bugs, regressions, test gaps, and project-guideline violations.

mochow13/keen-code · 21 tokens