rulebound init

Initialize .rulebound/ in your project with a rules directory, config file, starter rule, and pre-commit hook.

Usage

rulebound init [options]

Options

FlagDescription
--examplesCopy example rules to get started
--no-hookSkip pre-commit hook installation

What It Creates

PathDescription
.rulebound/config.jsonProject configuration template
.rulebound/rules/global/example-rule.mdStarter rule
.git/hooks/pre-commitPre-commit hook (if git repo exists)

Config Template

{
  "project": {
    "name": "",
    "stack": [],
    "scope": [],
    "team": ""
  },
  "extends": [],
  "rulesDir": ".rulebound/rules"
}

Pre-Commit Hook

The auto-installed hook runs rulebound diff --ref HEAD on every commit. If violations are found, the commit is blocked.

# Skip the hook during init
rulebound init --no-hook

# Install/remove the hook separately
rulebound hook
rulebound hook --remove

Examples

# Basic initialization
rulebound init

# With example rules
rulebound init --examples

# Without pre-commit hook
rulebound init --no-hook

Next Steps

After initialization:

  1. Edit .rulebound/config.json with your project info (stack, scope, team)
  2. Add rules as markdown files in .rulebound/rules/
  3. Run rulebound rules list to verify
  4. Run rulebound generate --agent claude-code to create agent configs
  5. Run rulebound validate --plan "your plan" to test validation

If the rules directory already exists, init will exit without overwriting.