speq-code-guardrails

speq-code-guardrails is a skill for Claude Code from marconae/speq-skill. It costs 54 tokens per session (1,197 once invoked), scanned A, original, MIT.

Coding rules built around TDD, or test-driven development: write a failing test, make it pass with the smallest change, then clean up the code.

In plain words
What is it for?
Use them when implementing or reviewing code. They cover test design, dependency choices, errors, side effects, edge cases, and the evidence needed to support conclusions.
Why use it?
They reduce unsupported claims, unnecessary dependencies, weak error handling, and production changes that have not been checked by a focused test.

Skill for Claude Code

Written for Claude Code: installed under .claude/.

Good fit Use them when implementing or reviewing code. They cover test design, dependency choices, errors, side effects, edge cases, and the evidence needed to support conclusions.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/marconae/speq-skill/speq-code-guardrails
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 marconae/speq-skill --skill speq-code-guardrails
Clone the repo
git clone --depth 1 https://github.com/marconae/speq-skill

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 speq-code-guardrails

README.md
[![agentmods](https://agentmods.dev/badge/skills/marconae/speq-skill/speq-code-guardrails/github.svg)](https://agentmods.dev/skills/marconae/speq-skill/speq-code-guardrails)
Your own site
<a href="https://agentmods.dev/skills/marconae/speq-skill/speq-code-guardrails"><img src="https://agentmods.dev/badge/skills/marconae/speq-skill/speq-code-guardrails/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 speq-code-guardrails

Your own site · 80×15
<a href="https://agentmods.dev/skills/marconae/speq-skill/speq-code-guardrails"><img src="https://agentmods.dev/badge/skills/marconae/speq-skill/speq-code-guardrails.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 54 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,197 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 pass 7 Sept 2026
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.00054 $0.01197
Opus 5.5 $0.00022 $0.00479
Sonnet 5.5 $0.00011 $0.00239
Haiku 4.5 $0.00005 $0.00120

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

Security

Grade A, and why

speq-code-guardrails 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 8d 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/speq-code-guardrails/SKILL.md · 118 lines

How it starts

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

Code Guardrails

TDD workflow and quality guardrails. Draws on established practice, including work by R. Martin, K. Beck, B. Meyer, and Toyota's Five Whys.

Golden Rule

No production code without a failing test first. Before changing existing code that has no test, add one that captures its current behavior first.

Evidence Rule

No claim without evidence. Run command, show output, then claim.

Dependency Rule

No new dependency without confirming the standard library or an already-installed dependency cannot do it first.

TDD Cycle (London School)

RED    → Write failing test, run it, show failure
GREEN  → Minimal code to pass, run test, show pass
REFACTOR → Clean up, run test + lint, show output

Run ONLY the test you created/changed, not the full suite.

Tests

  • Arrange, act, assert. One concept per test.
  • The test name states the condition and the expected behavior.
  • Independent and repeatable: no shared mutable state, no real clock, network, filesystem, or unseeded randomness.
  • Cover every branch and every edge case: empty, single, maximum, off-by-one, transition, and each way the operation can fail.
  • Assert observable behavior, never internal state.
  • Pure logic is tested without doubles. Orchestration is tested with doubles at its abstractions. Adapters are tested against the real thing.
  • Test code follows every rule in this document, same as production code.
  • A skipped or ignored test is a defect. Fix it or delete it.

Guiding Principles

Principle Meaning
KISS Simplest solution that works
YAGNI Build for now, not hypotheticals
DRY Extract duplication on the third occurrence, not the second (Rule of Three)
Single Responsibility (SOLID) One function = one purpose
Boy Scout Leave code cleaner than you found it
Root Cause Five Whys — fix the source, not the symptom

Design

  • Law of Demeter: talk only to immediate collaborators
  • Dependency direction, module depth, and boundary placement: see /speq-design-philosophy

Read the full file on GitHub · 118 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. 8d ago Changed · -3 tokens per session 0fc90c3e97f5
  2. 15d ago Changed 7122fe66c01a
  3. 25d ago Changed 40cadf909528
  4. 1mo ago Changed · +4 lines · -6 tokens per session 94a62bc75b7e
  5. 1mo ago First seen · 114 lines · 63 tokens per session scan A 0be122d286e5

Subscribe to this mod's changes

speq-code-guardrails is a skill published in the GitHub repository marconae/speq-skill (55 stars, last pushed 3d ago), licensed MIT. It adds 54 tokens to every session and 1,197 once invoked, about $0.0002 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.