Step-by-step flow for hook scaffolding. Keywords: hook, flow.
This doc contains the step-by-step flow. For inputs, tools, outputs, and safety, see /.system/skills/ssot/repo/scaffolding/new-hook/SKILL.md.
AI asks human for:
Human checkpoint: Confirm parameters before proceeding.
AI validates:
id uniqueness in existing hooksevent_type is valididAI runs orchestrator with --dry-run:
python scripts/devops/scaffold/new_hook.py --id "<hook_id>" --event-type "<event_type>" --blocking true --handler-kind script --handler-command "scripts/hooks/<hook_id>.py" --summary "Brief description of hook purpose" --order 100 --dry-run --json
AI presents planned_changes to human.
Human checkpoint: Review and approve planned changes.
AI runs orchestrator without --dry-run:
python scripts/devops/scaffold/new_hook.py --id "<hook_id>" --event-type "<event_type>" --blocking true --handler-kind script --handler-command "scripts/hooks/<hook_id>.py" --summary "Brief description of hook purpose" --json
The orchestrator validates the hook registration against hook.schema.yaml.
If handler script does not exist, the orchestrator creates a placeholder:
#!/usr/bin/env python3
"""Hook handler for <hook_id>."""
def handle(event):
"""Handle the <event_type> event."""
# TODO: Implement handler logic
return {"status": "ok"}
if __name__ == "__main__":
import json
import sys
event = json.loads(sys.stdin.read())
result = handle(event)
print(json.dumps(result))
AI verifies:
/.system/hooks/hooks.py --check passesAI records scaffold execution: