Configuration
.omni-architect.yml
Available Hooks
on_validation_approved
Triggered: After diagram validation is approved (all modes)
Timing: Before Figma generation begins
Use Cases:
- Generate technical specifications from validated diagrams
- Update project documentation
- Trigger downstream processes
- Notify stakeholders of validation success
package.json):
scripts/generate-specs.js
on_figma_complete
Triggered: After all Figma assets are successfully generated
Timing: After Phase 4 (Figma Generation) completes
Use Cases:
- Send Slack/Teams notifications with Figma links
- Update project management tools (Jira, Linear)
- Trigger design review workflows
- Generate design handoff documentation
- Start frontend development tasks
package.json):
scripts/notify-slack.js
on_error
Triggered: When any error occurs during pipeline execution
Timing: Immediately after error detection (any phase)
Use Cases:
- Alert team of failures
- Log errors to monitoring systems
- Trigger rollback procedures
- Create incident tickets
- Send email notifications
package.json):
scripts/alert-team.js
Hook Execution
Command Format
Hooks can execute any shell command:Execution Context
Hooks execute in the project root directory with access to:- Environment variables: All env vars from the shell
- Generated artifacts: Output files in
.omni-architect/directory - Exit codes: Non-zero exit codes are logged but don’t halt execution
Output Files Available
| File | Hook Availability | Description |
|---|---|---|
.omni-architect/parsed-prd.json | on_validation_approved+ | Parsed PRD structure |
.omni-architect/diagrams/*.mmd | on_validation_approved+ | Mermaid diagram source |
.omni-architect/validation-report.json | on_validation_approved+ | Validation scores and feedback |
.omni-architect/figma-assets.json | on_figma_complete | Figma node IDs and URLs |
.omni-architect/orchestration-log.json | All hooks | Complete execution log |
.omni-architect/error-log.json | on_error | Error details and stack trace |
Common Patterns
Slack Notification
Jira Ticket Update
scripts/update-jira.js
Generate Documentation
package.json
scripts/generate-docs.js
CI/CD Integration
Best Practices
Use npm Scripts for Complex Logic
Use npm Scripts for Complex Logic
Keep hook commands simple by delegating to npm scripts:
Handle Errors Gracefully
Handle Errors Gracefully
Ensure hook scripts handle errors and log appropriately:
Use Environment Variables for Secrets
Use Environment Variables for Secrets
Never hardcode tokens or credentials:
Log Hook Execution
Log Hook Execution
Add logging to track hook execution:
Test Hooks Independently
Test Hooks Independently
Test hook scripts outside of Omni Architect:
Hook Execution Flow
Complete Example
Here’s a production-ready hook configuration:.omni-architect.yml
package.json:
Troubleshooting
Hook Not Executing
Problem: Hook command doesn’t run Solution:- Check YAML syntax (proper indentation)
- Verify command exists:
which npmorwhich node - Check execution permissions for shell scripts:
chmod +x scripts/hook.sh - Review orchestration log:
.omni-architect/orchestration-log.json
Hook Fails Silently
Problem: Hook runs but doesn’t produce expected result Solution:- Add explicit logging to hook script
- Check exit codes:
echo $?after running hook manually - Verify environment variables are set:
printenv | grep SLACK_WEBHOOK
Can’t Access Output Files
Problem: Hook can’t read.omni-architect/*.json files
Solution:
- Ensure hook runs after file generation (correct hook type)
- Check file permissions:
ls -la .omni-architect/ - Verify file exists before reading:
Next Steps
Configuration Overview
Review all configuration options
Pipeline Overview
Understand the complete pipeline flow