agent-glovebox: Skill for Claude Code

.claude/skills/defect-to-guard/SKILL.md

defect-to-guard is a skill for Claude Code from AlexanderMattTurner/agent-glovebox. It costs 222 tokens per session (4,466 once invoked), scanned A, original, Apache-2.0.

A prompt-submission hook that runs selected safety and event-handling commands before the coding agent sees a submitted prompt. A hook is an automatic action triggered by a specific event.

In plain words
What is it for?
Use it to sanitize submitted prompts, discard superseded CI events, and forward watcher events when watcher support is enabled.
Why use it?
It lets the project inspect or process incoming prompts and related watcher or CI events at the start of a session. The commands can be advisory or run through the project's safe-launch wrapper.

Skill for Claude Code

Written for Claude Code: installed under .claude/. Also seen: reads .claude/ paths; mentions CLAUDE.md.

This is AlexanderMattTurner/agent-glovebox's own configuration. It tells Claude Code how to work on agent-glovebox itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything agent-glovebox configures →

Reuse

Borrowing it

Nothing to install: this file belongs to AlexanderMattTurner/agent-glovebox. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/AlexanderMattTurner/agent-glovebox/main/.claude/skills/defect-to-guard/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/AlexanderMattTurner/agent-glovebox

Made for: Claude Code.

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 defect-to-guard

README.md
[![agentmods](https://agentmods.dev/badge/skills/alexandermattturner/agent-glovebox/defect-to-guard/github.svg)](https://agentmods.dev/skills/alexandermattturner/agent-glovebox/defect-to-guard)
Your own site
<a href="https://agentmods.dev/skills/alexandermattturner/agent-glovebox/defect-to-guard"><img src="https://agentmods.dev/badge/skills/alexandermattturner/agent-glovebox/defect-to-guard/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 defect-to-guard

Your own site · 80×15
<a href="https://agentmods.dev/skills/alexandermattturner/agent-glovebox/defect-to-guard"><img src="https://agentmods.dev/badge/skills/alexandermattturner/agent-glovebox/defect-to-guard.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 222 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,466 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. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 2 findings, up to high

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • high Prompt Injection · line 44
    Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.
    Fix: Audit all comments and invisible characters. Remove any instructions that direct the agent to perform unauthorized actions. Use plain, reviewable content.
  • medium Rogue Agent · line 40
    Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.
    Fix: Remove any persistence mechanisms (cron jobs, startup scripts, state files). Skills should not maintain state across sessions without explicit user consent.
How audits are shown
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.00222 $0.04466
Opus 5.5 $0.00089 $0.01786
Sonnet 5.5 $0.00044 $0.00893
Haiku 4.5 $0.00022 $0.00447

Measured 11d ago against content hash 94da6c97f0b6, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

defect-to-guard 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 11d 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.

.claude/skills/defect-to-guard/SKILL.md · 110 lines

How it starts

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

From one defect to a standing invariant

When a defect earns a guard proposal

A defect you fixed does not owe a guard. Propose one only when a GENERIC CI check would have caught the whole CLASS without anticipating this specific error, AND that class can recur. A one-off, a class the fix itself makes unreachable, and a class an existing check already covers each get no entry. When one does qualify, the output is a ## Proposed guards entry in the PR body, never a guard shipped in the same PR — root CLAUDE.md § Guard budget owns that rule and the cost/benefit arithmetic the entry must show, and it charges a substantial expansion of an existing check the same way. The steps:

  1. Name the class the bug belongs to — a documented-but-unrouted subcommand, a parsed-but-undeclared flag, a referenced-but-undocumented env var, a feature whose lib code is written but never wired onto the live path, a portability divergence, a swallowed error.
  2. Find whether a guard for that class already exists (cli-dispatch-sync, check-cli-flags-documented, check-env-documented, the layer-engagement self-test, check-exit-suppression) and, if so, why it didn't fire — a gap in the existing guard is itself the bug.
  3. If none exists, prefer a check that iterates the SSOT and asserts the second copy, so it covers every future member for free and never names the instance (the anti-lockstep doctrine's forward form — a generic guard is an SSOT-completeness check, not a per-case assertion).
  4. Pick the cheapest mechanism that can express the class, in this order: a type the compiler already tracks, then an AST rule, then a line or regex lint. The order tracks the false-positive rate. A type follows the value, so it never guesses at a shape; an AST rule sees structure, so it skips a match inside a string literal, a comment or a fixture; a text lint matches characters, so every legitimate use of those characters earns a disable comment, and each one hides the next real finding on its line. tsc --noEmit (pnpm check) covers the non-test *.mjs under scripts/, .claude/hooks/, .github/actions/, glovebox-github-app/ and vm-kit/, and nothing else there — tsconfig.json include names those globs and exclude drops **/*.test.mjs, so the Python and shell beside them get no type check at all. For a file it does cover, a provenance type needs no new machinery: brand the safe constructor's return value and make the dangerous sink accept only the brand. Reach for a line lint only when the class has no syntax to bind to — a banned word in prose, a path convention — and say in the proposal why. Show the mechanism, never just name it: the proposal carries the smallest snippet a reader can check — the signature that changes and the one line that now fails. "A provenance type" is a label; the three lines below are the thing, and a reviewer can judge them in ten seconds.

Read the full file on GitHub · 110 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. 11d ago Changed · -2 lines 94da6c97f0b6
  2. 14d ago Changed 734b2b3040fb
  3. 19d ago Changed e198d5321e24
  4. 1mo ago Changed 2bd720adb82b
  5. 1mo ago Changed · +2 lines 3530491608a6
  6. 1mo ago Changed cd3cc1835ac4
  7. 1mo ago Changed 1f391c5762ef
  8. 1mo ago First seen · 110 lines · 222 tokens per session scan A 1c92976a50b6

Subscribe to this mod's changes

defect-to-guard is a skill published in the GitHub repository AlexanderMattTurner/agent-glovebox (68 stars, last pushed today), licensed Apache-2.0. It adds 222 tokens to every session and 4,466 once invoked, about $0.0009 per session on Opus 5.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-08-30.

Related

Other skills, from other repositories

local-ai-agents

Build local-first AI agents that run entirely on a developer workstation with Microsoft Foundry Local and Qwen function-calling models. Covers Small Language Models (SLMs), the OpenAI-compatible local endpoint, sandboxed local tools, local RAG with Chroma, local MCP servers, hybrid cloud/local routing, and the…

microsoft/ai-agents-for-beginners · 200 tokens

systematic-debugging

Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.

obra/superpowers · 21 tokens

next-cache-components-adoption

Turn on Cache Components in a Next.js app and resolve the blocking routes it surfaces. Use when the user wants to enable, adopt, or migrate to Cache Components, flip the cacheComponents flag, work through a flood of blocking-prerender / instant validation errors, run the cache-components-instant-false codemod, or…

vercel/next.js · 95 tokens

chat-pet-sprite-creation

Use when creating or changing VS Code chat pet sprite art, sprite sheets, state animations, eye treatments, Stable/Insiders variants, or pet transitions under src/vs/workbench/contrib/chat/browser/widget/media/chatPet.

microsoft/vscode · 53 tokens

cpu-profile-analysis

Analyze V8/Chrome CPU profiles (.cpuprofile) and DevTools trace files (Trace-.json). Use when: profiling performance, investigating slow functions, comparing code paths, finding bottlenecks, analyzing timeToRequest, understanding call trees from sampling profiler data, analyzing layout/paint/rendering, investigating…

microsoft/vscode · 71 tokens

insight-error-page

Write or audit an insight-kind error page for the Next.js dev overlay. Use when creating a new errors/ .mdx page, auditing an existing one, or checking that a page matches the framework fix cards. Covers page structure, title alignment, FixCard cards with Copy prompt button, code snippets, terminology verification…

vercel/next.js · 83 tokens