Sdlc Guardrails logo

Sdlc Guardrails

Community
TsCarpe
sdlc-guardrails

Deterministic guardrail engine that enforces "write-it-and-it's-wrong" red-lines at write time - a PostToolUse hook runs engine/check.py on every Write/Edit and blocks violations per project-defined guardrails.yaml rules (forbid / require / require_if / count_ge), with pre-commit fallback and --check baseline scanning for legacy code. Engine is mechanism (one global copy), rules are content (per project). Use when 接入或配置红线拦截、给项目编写 guardrails 规则、排查 hook 拦截了或没拦、扫描存量违规基线,或用户说 guardrails、红线引擎、红线拦截、接入红线、规则文件、红线扫描、baseline scan.

Overview

PublisherTsCarpe
Repositoryclaude-sdlc-skills
Skill namesdlc-guardrails
Stars
65
Forks
0
Bundled files
8
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.

  • 8 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

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

Installation

Install the Sdlc 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/TsCarpe/claude-sdlc-skills/tree/main/skills/sdlc-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/TsCarpe/claude-sdlc-skills.git /tmp/claude-sdlc-skills
mkdir -p .claude/skills
cp -r /tmp/claude-sdlc-skills/skills/sdlc-guardrails .claude/skills/sdlc-guardrails
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Sdlc 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 Sdlc 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 Sdlc 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.

sdlc-guardrails:红线拦截引擎

把「写了就是错」的服从性规则从文档下沉为写文件瞬间的确定性拦截:引擎全局一份(本 skill 的 engine/check.py),规则各项目自写(.claude/guardrails.yaml),无规则文件 = no-op。

前置依赖:python3 + PyYAML(engine/check.py);git(pre-commit 提交兜底)。

何时用

  • 新项目接入红线拦截(下方三步接入)
  • 为已接入项目增删规则、调整 glob 与规则类型
  • 排障:为什么拦了 / 为什么没拦
  • 存量代码违规基线扫描(旧账出报告,不阻塞编辑)

架构(引擎与规则分离)

侧内容载体
引擎(机制)检查逻辑,python3 零项目知识engine/check.py,随 skill 装到用户级 ~/.claude/skills/sdlc-guardrails/
规则(内容)各项目的红线项目 .claude/guardrails.yaml,从被检文件向上逐级查找

规则四类:forbid(出现即违规)/ require(至少出现一次)/ require_if(命中 when 则 pattern 必须出现)/ count_ge(pattern 计数 ≥ anchor 计数)。字段写法与样例见 README.md。

三步接入(脆弱操作:按序执行,不给发挥空间)

  1. 挂载 hook:把 templates/settings-hook.json 的 hooks 段合并进项目 .claude/settings.json(保留已有事件),引擎路径用安装位置 ~/.claude/skills/sdlc-guardrails/engine/check.py(npx skills add 全局安装即在此;项目级安装(未加 -g)改用 <项目根>/.claude/skills/sdlc-guardrails/engine/check.py;~ 不展开则改用 $HOME)

  2. 写规则文件:项目根 .claude/guardrails.yaml——不凭空编规则,从用户红线清单或 README.md 样例起步

  3. pipe-test 实测(反馈环,必做):写一个故意违规的文件,执行

    bash
    echo '{"tool_input":{"file_path":"<违规文件绝对路径>"}}' \
      | python3 ~/.claude/skills/sdlc-guardrails/engine/check.py

    预期输出 {"decision":"block",...}。未实测拦截就宣布接入完成 = 失败。

日常操作

需求动作
增删规则编辑项目 guardrails.yaml,每次写入即时生效;改完 pipe-test 复验一条
Edit 存量文件引擎只查本次新增文本,存量旧账不阻塞编辑者
存量基线报告执行 python3 <引擎路径> --check <文件...>(违规 exit 1,人类可读输出)
git 提交兜底复制 templates/pre-commit 到 .githooks/,执行 git config core.hooksPath .githooks(模板默认只查 *.java,非 Java 项目改脚本内过滤串)

边界与排障

  • 规则纯 regex 不做 AST;类型/跨文件分析类规则不在此层,走 CI/测试期(ArchUnit 等)
  • 引擎异常静默 exit 0,永不打断 agent 循环——排障直接跑 pipe-test 看输出,不猜
  • OVAL @Validate↔profiles 跨文件对账:执行 engine/audit_profiles.py(对账工具,不是拦截器)

参考(一层引用)

  • README.md:架构细则、规则语法全量、语义要点(Write/Edit 差异、no-op 行为)、已知边界
  • references/guardrails.example.yaml:23 条规则示例(从零写规则时参考)
  • templates/:settings-hook.json(hook 挂载段)/ pre-commit(提交兜底);回归 runner 模板属 sdlc-test(../sdlc-test/templates/,单独安装本 skill 时该引用仅作来源说明,不依赖其存在)

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Sdlc Guardrails AI skill do?

Deterministic guardrail engine that enforces "write-it-and-it's-wrong" red-lines at write time - a PostToolUse hook runs engine/check.py on every Write/Edit and blocks violations per project-defined guardrails.yaml rules (forbid / require / require_if / count_ge), with pre-commit fallback and --check baseline scanning for legacy code. Engine is mechanism (one global copy), rules are content (per project). Use when 接入或配置红线拦截、给项目编写 guardrails 规则、排查 hook 拦截了或没拦、扫描存量违规基线,或用户说 guardrails、红线引擎、红线拦截、接入红线、规则文件、红线扫描、baseline scan.

Why use Sdlc Guardrails on TypingMind?

Because you install it once and use it with any model. Sdlc 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 Sdlc Guardrails in TypingMind?

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

Which AI models can use Sdlc 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 Sdlc Guardrails?

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

Is the Sdlc Guardrails AI skill free?

Yes. It is published on GitHub by TsCarpe 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 👇