How idrispwala-web/golden-rules works
golden-rules is a Claude Code setup wizard: users choose global rule modules and optional integrations, then it writes configuration and runtime files; a separate project command scaffolds project rules and packs. Its optional brain hooks synchronize a user-owned Git vault at session start and end. The graph also includes the documented status line, skills, and pack capabilities. Evidence is limited to the README and sampled excerpts; unsampled pack contents and integrations are represented only where documented.
Main entry points: cli.mjs Setup CLI · brain-pull.mjs Vault pull hook · brain-push.mjs Vault push hook · install.mjs Config installer
Components 17
Setup wizard
- Setup CLI
bin/cli.mjs - Prompt helpers
lib/ask.mjs - Environment detection
lib/detect.mjs - Config installer
lib/install.mjs
Configuration content
- Rule templates
templates/claude - Project packs
packs - Golden-rules skill
skills/golden-rules/SKILL.md
Project scaffolding
- Project initializer
lib/project.mjs
Claude runtime
- Status line
templates/runtime/statusline.mjs - Vault pull hook
templates/runtime/hooks/brain-pull.mjs - Vault push hook
templates/runtime/hooks/brain-push.mjs - Git sync helpers
templates/runtime/hooks/_git.mjs
Optional integrations
- Optional tools
- Skill installer
main.go
Other components
- User
- Claude Code
- User vault repo
Connections 21
- User → Setup CLI: runs setup
README.md - Setup CLI → Prompt helpers: asks questions
bin/cli.mjs - Setup CLI → Environment detection: checks environment
bin/cli.mjs - Setup CLI → Config installer: installs configuration
bin/cli.mjs - Setup CLI → Project initializer: dispatches project
bin/cli.mjs - Config installer → Rule templates: composes rules
lib/install.mjs - Setup CLI → Status line: configures command
bin/cli.mjs - Setup CLI → Vault pull hook: installs when selected
bin/cli.mjs - Setup CLI → Vault push hook: installs when selected
bin/cli.mjs - Setup CLI → Golden-rules skill: installs skill
bin/cli.mjs - Project initializer → Project packs: copies selected pack
lib/project.mjs - Status line → Claude Code: prints status
README.md - Claude Code → Vault pull hook: runs at session start
- Claude Code → Vault push hook: runs at session end
- Vault pull hook → Git sync helpers: uses sync helpers
templates/runtime/hooks/brain-pull.mjs - Vault push hook → Git sync helpers: uses sync helpers
templates/runtime/hooks/brain-push.mjs - Vault pull hook → User vault repo: pulls changes
templates/runtime/hooks/brain-pull.mjs - Vault push hook → User vault repo: commits and pushes
templates/runtime/hooks/brain-push.mjs - Setup CLI → Optional tools: offers installation
bin/cli.mjs - User → Skill installer: runs skill installer
README.md - Skill installer → Claude Code: installs skills and tools
main.go