Speq Code Guardrails logo

Speq Code Guardrails

Community
marconae
speq-code-guardrails

TDD cycle and code quality guardrails for the implementer and reviewer agents during /speq-implement. Not for general coding.

Overview

Publishermarconae
Repositoryspeq-skill
Skill namespeq-code-guardrails
Stars
54
Forks
10
Bundled files
Instructions only
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by marconae on GitHub. Read the source before you install it.

Installation

Install the Speq Code Guardrails AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/marconae/speq-skill/tree/main/.claude/skills/speq-code-guardrails
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/marconae/speq-skill.git /tmp/speq-skill
mkdir -p .claude/skills
cp -r /tmp/speq-skill/.claude/skills/speq-code-guardrails .claude/skills/speq-code-guardrails
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Speq Code Guardrails in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Speq Code Guardrails on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Speq Code Guardrails is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

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

PrincipleMeaning
KISSSimplest solution that works
YAGNIBuild for now, not hypotheticals
DRYExtract duplication on the third occurrence, not the second (Rule of Three)
Single Responsibility (SOLID)One function = one purpose
Boy ScoutLeave code cleaner than you found it
Root CauseFive 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

Functions

  • Small and focused
  • Few arguments (≤3 ideal)
  • No hidden side effects: a function changes nothing its name and contract do not announce
  • No boolean flags: split into separate methods
  • No selector arguments of any type: an argument that picks a branch means two functions
  • One level of abstraction per function: decide or do the work, not both
  • A function either mutates something or answers a question, never both in one call (Command-Query Separation)
  • No output parameters: return the value
  • Guard clauses first. One unindented main path
  • No undocumented ordering contract between calls: if a second call requires a first, make it unreachable without it

Errors

  • Failure is signalled by the language's own error mechanism, never a sentinel value, magic number, or in-band absent value
  • Absence is explicit: an empty collection or the language's optional type, never a stand-in for a value
  • Every error states what was attempted, the input that failed, and the constraint violated
  • Translate a third-party error into this module's own error type at the boundary: callers never handle a provider's error taxonomy
  • Never discard an error, never catch broadly: handle at one level, let the rest propagate
  • Errors signal exceptional conditions, not control flow
  • The failure path is written test-first, like any other behavior

Naming

  • Descriptive, unambiguous, pronounceable
  • Named constants over magic numbers
  • No prefixes or type encodings
  • Types are nouns, functions are verbs, predicates read as questions
  • One word per concept across the codebase
  • Name length matches scope: single letters only within a few lines
  • No role-suffix names that state no responsibility (Manager, Processor, Handler, Data, Info, Util)
  • A name reflects what a thing is for, never how it is built: keep transport, vendor, or storage format out of it
  • Domain vocabulary over generic programming vocabulary

Comments

  • Public/interface methods: brief doc comment stating what the method promises — purpose, and design intent or rationale when that is not self-evident from the signature
  • Private methods: no comments
  • No inline comments: make the code self-explanatory
  • No work tracking (TODOs, FIXMEs, ticket refs)

YAGNI Checks

  • Abstraction (interface, generic type, configuration value) with one implementation/caller? Inline it — unless it is a seam over I/O, nondeterminism, or a third party, or the concrete choice is expected to change. Those seams stay.
  • Feature flag or extension point nobody uses? Remove it.

Code Smells

SmellSignal
RigiditySmall changes cascade everywhere
FragilityOne change breaks unrelated code
ImmobilityCan't reuse code elsewhere
OpacityHard to understand at a glance

Attribution

Draws on established practice, including R. Martin (Clean Code, SOLID, Boy Scout Rule), K. Beck (TDD), and B. Meyer (Command-Query Separation).

Frequently asked questions

What does the Speq Code Guardrails AI skill do?

TDD cycle and code quality guardrails for the implementer and reviewer agents during /speq-implement. Not for general coding.

Why use Speq Code Guardrails on TypingMind?

Because you install it once and use it with any model. Speq Code Guardrails is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Speq Code Guardrails in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/marconae/speq-skill/tree/main/.claude/skills/speq-code-guardrails. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Speq Code Guardrails?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Speq Code Guardrails?

As many as you like. As long as a model supports skills, you can use Speq Code Guardrails with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Speq Code Guardrails AI skill free?

Yes. It is published on GitHub by marconae under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇