Skip to main content

Module init

Module init 

Source
Expand description

Project initialization for deciduous

deciduous init creates all the files needed for decision graph tracking with AI assistant integration (Claude Code and/or OpenCode).

Modules§

guard
How deciduous update writes the harness files it owns (commands, skills, hook scripts, agents.toml, OpenCode and Windsurf files) without destroying anything someone else put there.
templates
Template constants for deciduous init

Constants§

RETIRED_HOOK_SCRIPTS
Hook scripts deciduous installed before 1.0.3 to make agents log, for Claude Code and Windsurf alike. Logging is encouraged through the instructions and the tool replies now, not enforced by a hook, so update removes the ones it wrote.
RETIRED_WORKFLOWS
The GitHub Pages workflow init wrote before 1.0.5; update removes it when deciduous wrote it.

Functions§

ensure_board_hook_settings
Adds the board-mentions hook to .claude/settings.json for each event that does not run it yet. Everything already there, the user’s hooks included, is kept in its order; a file that is not valid JSON is reported and left alone, and a missing file is written from the template.
ensure_gitattributes
Route the graph file through the deciduous merge driver and mark it as generated so GitHub folds it in pull request diffs. An older line for the same purpose is upgraded in place.
ensure_merge_driver
Register the deciduous merge driver in this clone’s git config so two people editing the same record get a field-level merge instead of conflict markers. Git config is per clone, so this runs from init, update, and sync. Returns Ok(true) when it (re)wrote the config. Silently does nothing outside a git repository.
init_project
Initialize a new deciduous project with AI assistant integration
strip_retired_hook_settings
Takes the retired logging hooks out of .claude/settings.json: every command that runs deciduous log-loop, and every command that runs a retired script that is no longer on disk. A retired script the user wrote was kept, so the entry that runs it stays. Entries and events left empty are dropped; everything else, including key order, is kept. A file that is not valid JSON is reported and left alone.
update_all
deciduous update --all <dir>: every deciduous project directly under dir, and dir itself if it is one, updated one after another. A project is a directory with .deciduous/ and an assistant integration to update. One project failing does not stop the rest. Returns how many failed.
update_tooling
Update tooling files to the latest version (overwrites existing) Auto-detects which assistants are installed (.claude/ and/or .opencode/)