Skip to main content

---

title: "Sync Documentation" component_type: hook version: "1.0.0" audience: contributor status: stable summary: " Documentation Sync Hook for CODITECT" keywords: ['documentation', 'sync'] tokens: ~1500 created: 2025-12-22 updated: 2025-12-22

Documentation Sync Hook for CODITECT

Automatically updates component inventories and documentation when new files are created. Keeps AGENT-INDEX.md, skills catalog, and COMPLETE-INVENTORY.md in sync with actual components.

Event: PostToolUse Matcher: tool_name = "Write" Trigger: When new .coditect/agents/.md, .coditect/skills//SKILL.md, or .coditect/commands/*.md files are created

File: sync_documentation.py

Classes

DocumentationSyncer

Syncs documentation when new components are created

Functions

main()

Main hook entry point

extract_component_info(file_path, content)

Extract metadata from component file

should_update_inventory(file_path)

Check if file should trigger inventory update

get_component_type(file_path)

Determine component type from file path

update_agent_index(agent_info)

Update AGENT-INDEX.md with new agent

update_complete_inventory(component_type, component_info)

Update COMPLETE-INVENTORY.md with new component

sync(file_path, content)

Perform documentation sync

Usage

python sync_documentation.py