Skip to main content

Module items

Module items 

Source

Functions§

delete_item
Delete an item by ID. Returns the deleted item.
detect_cycle
Check if adding a dependency would create a cycle. Returns the cycle path if one exists.
find_item_file
Find the file path for an item by its ID. Accepts both full IDs (JOY-0042-A3) and short-form (JOY-0042). Short-form returns an error if ambiguous (multiple matches).
load_item
Load a single item by ID.
load_items
Load all items from the .joy/items/ directory.
next_id
Generate the next item ID by scanning existing files. Returns “ACRONYM-0001” for the first item, increments the highest found. All items share one number space regardless of type.
remove_references
Remove references to a deleted item from other items’ deps and parent fields.
save_item
Save an item to .joy/items/{ID}-{slug}.yaml.
title_hash_suffix
Generate 2 hex digits from the title for collision-safe IDs (ADR-027).
update_item
Update an item in place (overwrites its file).