rulebound init
Initialize .rulebound/ in your project with a rules directory, config file, starter rule, and pre-commit hook.
Usage
rulebound init [options]
Options
| Flag | Description |
|---|---|
--examples | Copy example rules to get started |
--no-hook | Skip pre-commit hook installation |
What It Creates
| Path | Description |
|---|---|
.rulebound/config.json | Project configuration template |
.rulebound/rules/global/example-rule.md | Starter rule |
.git/hooks/pre-commit | Pre-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:
- Edit
.rulebound/config.jsonwith your project info (stack, scope, team) - Add rules as markdown files in
.rulebound/rules/ - Run
rulebound rules listto verify - Run
rulebound generate --agent claude-codeto create agent configs - Run
rulebound validate --plan "your plan"to test validation
If the rules directory already exists,
initwill exit without overwriting.