Guidance for AI agents (Claude Code or otherwise) working on this codebase.
Read the affected file fully before editing. The codebase is small — read all relevant files in parallel before proposing a plan.
actions → config only. It must never import model or ui.
model → config, ui, actions. No circular deps.
ui → config only.
model.New() in model/model.go. Do not duplicate spring construction elsewhere.
~/.config/pspterm/config.yaml belongs to the user. Code changes must not overwrite it. Only config/defaults.go is authoritative for the initial template.
main.go writes the exit path to real stdout while the TUI draws to /dev/tty. Do not "fix" this by merging the output streams.
- Add the type constant/string handling in
actions/executor.goExecute()switch. - Add the field to
config.Itemstruct inconfig/config.go. - Document the new type in
config/defaults.goheader comment. - Update
CLAUDE.mditem type list.
- Add the lipgloss style to
ui/styles.goStylesstruct andNewStyles(). - Render in
model/model.goView(). - Adjust
usedLinesconstant inView()if the element takes a fixed line.
Categories with scan: true are populated from XDG .desktop files at load time.
Scan logic lives in config/scan.go. Scan categories are excluded from the item manager (read-only).
Edit config/defaults.go for the two config-driven colors (accent_color, dim_color).
Edit hardcoded colors directly in ui/styles.go NewStyles() for structural colors (divider, clock, far categories, normal items).
Only touch harmonica.NewSpring(...) args in model.New() and tickInterval in model/model.go.
angFreq10–18: sweet spot for XMB feel.dampingRatio0.45–0.7: below 1.0 = underdamped (bouncy). Do not go below 0.4 or it oscillates too long.
- Add
wave_enabledor wave rendering back — removed intentionally. - Add global state or
init()functions. - Use
os.Exitoutside ofmain.go. - Skip reading a file before editing it.
- Create new packages beyond the existing five (
main,config,model,ui,actions). - Auto-commit or auto-push changes.