Self Discipline for Openclaw

A robust system for enforcing AI agent instruction compliance through root cause analysis and automated bash-based validators.

ivangdavila
v1.0.1
Feb 25, 2026
0
1.2k
0

Install & Download

1. ClawHub CLI

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

npx clawhub@latest install self-discipline

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 self-discipline 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 Self Discipline?

The Self Discipline skill is a sophisticated framework designed to eliminate the repetition of AI agent errors. Unlike basic logging tools, this skill implements a systematic approach to instruction compliance by analyzing the root causes of failure and verifying that corrective actions are permanently integrated into the agent's workflow. By leveraging Openclaw Skills for self-regulation, developers can transform frustrated feedback into rigorous, automated safeguards.

The skill operates on the principle that "I'll remember next time" is an insufficient fix. It uses a structured directory system to store active rules and incident history, ensuring that every lesson learned is backed by technical enforcement. Whether you are managing complex codebases or sensitive data, this skill provides the infrastructure needed to maintain absolute compliance with your specific operational requirements.

Self Discipline Use Cases

  • When an agent ignores specific project instructions or repeats previous mistakes.
  • Critical scenarios where security breaches, data loss, or production errors must never happen again.
  • Explicitly invoking the /discipline command to formalize a new rule or preference.
  • Scenarios requiring automated pre-action validation, such as checking for secrets before a git commit.

How Self Discipline Works

  1. The process is triggered by user frustration keywords, critical failures, or the explicit use of the /discipline command.
  2. The skill immediately performs a Severity Assessment (Critical, Medium, or Low) to determine the depth of the required response.
  3. A Root Cause Protocol is initiated using the 5 Whys method to identify specifically why an instruction was not followed (e.g., context overflow or file not in load path).
  4. Flow Verification is executed to trace the agent's logical path and ensure the new instruction is actually reachable in future sessions.
  5. For critical issues, the skill generates an automated Validator script (bash) that programmatically blocks non-compliant actions.
  6. All rules and incidents are logged in a persistent local directory to track enforcement metrics and streaks of compliance.

Self Discipline Setup

On first use, initialize the skill by following the integration guidelines in the setup documentation. The skill creates a local workspace to manage all rules and validators.

# The skill automatically manages this directory structure:
mkdir -p ~/self-discipline/validators/{pre-commit,pre-send,custom}
touch ~/self-discipline/{memory.md,rules.md,incidents.md}

Self Discipline Data Schema & Taxonomy

The Self Discipline skill maintains a strict local data hierarchy to ensure privacy and persistence within the Openclaw Skills ecosystem.

Component Path Description
Memory ~/self-discipline/memory.md Stores severity thresholds, active rules, and compliance statistics.
Rules ~/self-discipline/rules.md The core repository of active discipline rules that are always loaded.
Incidents ~/self-discipline/incidents.md A detailed log of failures including the 5 Whys root cause analysis.
Validators ~/self-discipline/validators/ Executable bash scripts that enforce compliance before commits or messages.
Flow Analysis ~/self-discipline/flow-analysis/ Traces of agent instruction paths to verify fix reachability.

Self Discipline Advanced Features

  • Automated Bash Validators: Create custom scripts that exit with non-zero codes to physically block the agent from making prohibited moves.
  • 5 Whys Root Cause Protocol: A structured diagnostic tool that distinguishes between model failure and architectural context issues.
  • Flow Reachability Tracing: Verifies that instructions are placed in files actually read by the agent (system prompt, AGENTS.md, etc.).
  • Severity-Based Escalation: Automatically promotes recurring minor violations to critical status, triggering mandatory automated validators.
  • Local-First Architecture: Ensures all enforcement logs and rules remain on the user's machine with no external network requirements.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*