speq-code-guardrails

speq-code-guardrails is a skill for Claude Code from marconae/speq-skill. It costs 57 tokens per session (1,151 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/.

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.

agentmods
npx agentmods add skills/marconae/speq-skill/speq-code-guardrails
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.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.svg" alt="Measured on agentmods" height="20"></a>
Per session 57 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,151 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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.00057 $0.01151
Opus 5 $0.00028 $0.00575
Sonnet 5 $0.00011 $0.00230
Haiku 4.5 $0.00006 $0.00115

Measured today against content hash 94a62bc75b7e, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, 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 today.

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

Clean Code (Martin) TDD workflow and quality guardrails.

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. today Changed · +4 lines · -6 tokens per session 94a62bc75b7e
  2. 6d 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 (50 stars, last pushed today), licensed MIT. It adds 57 tokens to every session and 1,151 once invoked, about $0.0003 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-08-30.