Dev Guardrails for Openclaw

A universal behavior and guardrail layer for AI coding agents that enforces engineering discipline, prevents scope creep, and guarantees production-viable code quality.

nagi-226
v3.0.0
Jun 5, 2026
0
531
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install dev-guardrails

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install dev-guardrails using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is Dev Guardrails?

Dev Guardrails is a critical behavioral and constraint layer designed for AI coding assistants like Claude Code, Codex, and Gemini CLI. Acting as a Senior Principal Engineer with a conscience, this skill establishes a robust, multi-layered defense mechanism to prevent blind compliance, hallucinations, code degradation, and out-of-control scope creep during development sessions.

By integrating this tool into your Openclaw Skills workspace, you elevate your AI agents from simple code generators into disciplined, self-monitoring software engineers. The system maintains a dynamic Project Contract, tracks cumulative changes via a Scope Dashboard, runs automated regression/iteration gates, and enforces strict quality audits to ensure every line of code generated is production-ready, secure, and aligned with your design architecture.

Dev Guardrails Use Cases

  • Preventing Scope Creep: When users continuously add minor requests that accumulate into major architectural drift, the system triggers alerts to renegotiate the project scope.
  • Handling Vague or Ambiguous Prompts: When instructions lack concrete platform, framework, or structural definitions, forcing the agent to clarify requirements instead of hallucinating defaults.
  • Technical Sanity Checks: Stopping the agent from executing impossible requests, such as nation-scale scalability on simple local storage, by presenting viable downgrades.
  • Ensuring Production Quality: Eradicating placeholder logic (like "// TODO" comments) and ensuring code runs out of the box with edge-case handling.
  • Managing Low-Engagement Clients: Utilizing the Commitment Protocol to break infinite feedback loops when users respond with non-committal terms like 'do whatever' or 'you decide'.

How Dev Guardrails Works

  1. Instruction Reception: The agent receives a development prompt and immediately passes it through a reactive Instruction Guard to analyze ambiguity or boundary violations.
  2. Project Contract Lock-in: For non-trivial tasks, the agent proposes a concrete scope and architecture, freezing a baseline contract upon user confirmation.
  3. Continuous Scope Monitoring: The Project Supervisor tracks file-change audits and counts accumulative additions, triggering alerts if drift exceeds 30% of the original contract.
  4. Regression & Health Gates: Prior to delivery, the agent executes a silent smoke trace to guarantee zero regressions and validates codebase maintainability via Iteration Health Checks.
  5. Five-Dimension Quality Audit: The system scans the generated codebase across Architecture, Security, Performance, Code Quality, and Testing dimensions, categorizing issues by severity.
  6. Deviation Correction: If the project veers off course, a structured 5-step process halts execution, visualizes wasted effort, and offers explicit re-planning pathways.

Dev Guardrails Setup

To deploy Dev Guardrails within your Openclaw Skills ecosystem, configure your workspace directory to include the behavioral configuration and boundary rules:

  1. Clone or download the skill file and its reference boundaries:
mkdir -p .claw/skills/dev-guardrails
cp SKILL.md .claw/skills/dev-guardrails/
  1. Setup boundaries and scenarios in your project references directory to provide concrete capability guardrails:
mkdir -p .claw/references
cat << 'EOF' > .claw/references/boundaries.md
# Capability Boundaries
| Within Capability | Refuse/Red Line |
|---|---|
| Lightweight IM (<10k users) | Nation-scale platforms |
| Regional e-commerce | Database kernels / OS |
| Enterprise RAG + AI | General LLM training |
EOF
  1. Initialize with your AI Agent (e.g., Claude Code, Codex, Gemini CLI) by loading the skill dynamically at session startup so that the project-level supervisor begins monitoring immediately.

Dev Guardrails Data Schema & Taxonomy

This skill maintains a series of mental registers and file-change audits to track development consistency across multi-turn sessions. The system organizes its data and telemetry as follows:

Mental State Registries

Registry Name Structure Tracking Strategy
Project Contract Scope, Architecture, Exclusions, Constraints, Milestones Frozen upon initial confirmation (Principle 5)
Scope Dashboard Cumulative additions (%), total feature count, architecture drift Updated after each completed task request
Churn Tracker Initial direction, log of direction changes, wasted LOC / turns Incremented upon each architectural or focus shift
Guardrail Activity Log Turn number, layer triggered, violation type, resolution outcome Append-only log for cross-layer audit trails

File-Change Audit Trail

The system maintains a strict mapping of session file diffs:

  • src/path/file.ext -> Classed as REQUESTED or NOT REQUESTED (triggers SF-L1 to SF-L4 audits to prevent over-engineering)
  • tests/path/test.ext -> Evaluated via the Regression Gate and Necessity Test to isolate side-effects

Dev Guardrails Advanced Features

  • Commitment Protocol (M7-A): Employs a three-strike escalation rule to force non-committal users into locking down a default technical proposal or pausing development.
  • Complexity Multiplier (M7-B): Detects buzzword-stacking (e.g., AI + Blockchain + Web3) and calculates a risk score to systematically break down bloated architectures.
  • Zero-Bypass Reliability Gate (M6): Runs silent background checks ensuring existing entry points are intact and code features a clean rollback path even if bypassed by the user.
  • Before/After Quantification (M8-C): Automatically generates comparative tables illustrating metrics like cyclomatic complexity, dead code reduction, and test coverage between version iterations.
  • Scope Fidelity Escalation (M9-A): Instantly detects agent overreach and unnecessary formatting changes, reverting any code changes that fail the strict Necessity Test.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*