Project Instructions#
Decision Graph Workflow#
THIS IS MANDATORY. Log decisions IN REAL-TIME, not retroactively.
The Core Rule#
BEFORE you do something -> Log what you're ABOUT to do
AFTER it succeeds/fails -> Log the outcome
CONNECT immediately -> Link every node to its parent
AUDIT regularly -> Check for missing connections
Behavioral Triggers - MUST LOG WHEN:#
| Trigger | Log Type | Example |
|---|---|---|
| User asks for a new feature | goal with -p |
"Add dark mode" |
| Choosing between approaches | decision |
"Choose state management" |
| About to write/edit code | action |
"Implementing Redux store" |
| Something worked or failed | outcome |
"Redux integration successful" |
| Notice something interesting | observation |
"Existing code uses hooks" |
CRITICAL: Capture VERBATIM User Prompts#
Prompts must be the EXACT user message, not a summary. When a user request triggers new work, capture their full message word-for-word.
BAD - summaries are useless for context recovery:
# DON'T DO THIS - this is a summary, not a prompt
deciduous add goal "Add auth" -p "User asked: add login to the app"
GOOD - verbatim prompts enable full context recovery:
# Use --prompt-stdin for multi-line prompts
deciduous add goal "Add auth" -c 90 --prompt-stdin << 'EOF'
I need to add user authentication to the app. Users should be able to sign up
with email/password, and we need OAuth support for Google and GitHub. The auth
should use JWT tokens with refresh token rotation.
EOF
# Or use the prompt command to update existing nodes
deciduous prompt 42 << 'EOF'
The full verbatim user message goes here...
EOF
When to capture prompts:
- Root
goalnodes: YES - the FULL original request - Major direction changes: YES - when user redirects the work
- Routine downstream nodes: NO - they inherit context via edges
Updating prompts on existing nodes:
deciduous prompt <node_id> "full verbatim prompt here"
cat prompt.txt | deciduous prompt <node_id> # Multi-line from stdin
Prompts are viewable in the TUI detail panel (deciduous tui) and web viewer.
⚠️ CRITICAL: Maintain Connections#
The graph's value is in its CONNECTIONS, not just nodes.
| When you create... | IMMEDIATELY link to... |
|---|---|
outcome |
The action/goal it resolves |
action |
The goal/decision that spawned it |
option |
Its parent decision |
observation |
Related goal/action |
Root goal nodes are the ONLY valid orphans.
Quick Commands#
deciduous add goal "Title" -c 90 -p "User's original request"
deciduous add action "Title" -c 85
deciduous link FROM TO -r "reason" # DO THIS IMMEDIATELY!
deciduous serve # View live (auto-refreshes every 30s)
deciduous sync # Export for static hosting
# Metadata flags
# -c, --confidence 0-100 Confidence level
# -p, --prompt "..." Store the user prompt (use when semantically meaningful)
# -f, --files "a.rs,b.rs" Associate files
# -b, --branch <name> Git branch (auto-detected)
# --commit <hash|HEAD> Link to git commit (use HEAD for current commit)
# Branch filtering
deciduous nodes --branch main
deciduous nodes -b feature-auth
⚠️ CRITICAL: Link Commits to Actions/Outcomes#
After every git commit, link it to the decision graph!
git commit -m "feat: add auth"
deciduous add action "Implemented auth" -c 90 --commit HEAD
deciduous link <goal_id> <action_id> -r "Implementation"
The --commit HEAD flag captures the commit hash and links it to the node. The web viewer will show commit messages, authors, and dates.
Git History & Deployment#
# Export graph AND git history for web viewer
deciduous sync
# This creates:
# - docs/graph-data.json (decision graph)
# - docs/git-history.json (commit info for linked nodes)
To deploy to GitHub Pages:
deciduous syncto export- Push to GitHub
- Settings > Pages > Deploy from branch > /docs folder
Your graph will be live at https://<user>.github.io/<repo>/
Branch-Based Grouping#
Nodes are auto-tagged with the current git branch. Configure in .deciduous/config.toml:
[branch]
main_branches = ["main", "master"]
auto_detect = true
Audit Checklist (Before Every Sync)#
- Does every outcome link back to what caused it?
- Does every action link to why you did it?
- Any dangling outcomes without parents?
Session Start Checklist#
deciduous nodes # What decisions exist?
deciduous edges # How are they connected? Any gaps?
git status # Current state
Multi-User Sync#
Share decisions across teammates:
# Export your branch's decisions
deciduous diff export --branch feature-x -o .deciduous/patches/my-feature.json
# Apply patches from teammates (idempotent)
deciduous diff apply .deciduous/patches/*.json
# Preview before applying
deciduous diff apply --dry-run .deciduous/patches/teammate.json
PR workflow: Export patch → commit patch file → PR → teammates apply.
API Trace Capture#
Capture Claude API traffic to correlate decisions with actual API work:
# Run Claude through the deciduous proxy
deciduous proxy -- claude
# View traces in TUI (press 't' for Trace view)
deciduous tui
# View traces in web viewer (click "Traces" tab)
deciduous serve
Auto-linking: When running through deciduous proxy, any deciduous add commands automatically link to the active API span. You'll see output like:
Created action #42 "Implementing auth" [traced: span #7]
This lets you see exactly which API calls produced which decisions - perfect for "vibe coding" visibility.
Trace commands:
deciduous trace sessions # List all sessions
deciduous trace spans <session_id> # List spans in a session
deciduous trace link <session_id> <node_id> # Manual linking
deciduous trace prune --days 30 # Cleanup old traces