Overview
Omni Architect provides powerful hooks and extension points to customize the pipeline for your team’s specific workflow. This example shows how to integrate with external tools, add custom validation logic, and automate handoff processes.
Available Hooks
Hooks are defined in .omni-architect.yml and execute at key pipeline stages:
hooks :
on_validation_approved : "npm run generate:specs"
on_figma_complete : "npm run notify:slack"
on_error : "npm run alert:team"
Hook Lifecycle
Hook Reference
Hook Trigger Context Variables Use Cases on_prd_parsedAfter Phase 1 $PRD_PATH, $PARSED_JSONValidate PRD completeness, auto-tag Jira issues on_mermaid_generatedAfter Phase 2 $DIAGRAMS_DIR, $DIAGRAM_COUNTGenerate static images, commit to git on_validation_approvedPhase 3 approved $VALIDATION_SCORE, $REPORT_JSONTrigger downstream specs generation on_validation_rejectedPhase 3 rejected $VALIDATION_SCORE, $ERRORSNotify PM, log to analytics on_figma_completeAfter Phase 4 $FIGMA_FILE_KEY, $ASSET_IDSNotify team, update project board on_asset_deliverAfter Phase 5 $OUTPUT_DIR, $DELIVERABLESArchive artifacts, trigger CI/CD on_errorAny phase error $PHASE, $ERROR_MESSAGEAlert ops, rollback, log to Sentry
Example 1: Slack Notifications
Notify your team when designs are ready:
.omni-architect.yml
scripts/notify-slack.js
project_name : "My Product"
figma_file_key : "abc123"
hooks :
on_figma_complete : "node scripts/notify-slack.js"
Output in Slack:
🎨 New designs ready!
New Figma assets generated
5 frames created by Omni Architect
[View in Figma] (button)
Example 2: Jira Integration
Auto-update Jira tickets when validation passes:
.omni-architect.yml
scripts/update-jira.py
hooks :
on_validation_approved : "python scripts/update-jira.py"
Result:
Jira ticket PROD-123 automatically moves to “Design Review” status
Comment added with validation score
Team is notified via Jira notifications
Example 3: Git Automation
Commit generated diagrams to version control:
.omni-architect.yml
scripts/commit-diagrams.sh
scripts/commit-figma-links.sh
hooks :
on_mermaid_generated : "bash scripts/commit-diagrams.sh"
on_figma_complete : "bash scripts/commit-figma-links.sh"
Example 4: Custom Validation Rules
Add team-specific validation on top of Omni Architect’s built-in validator:
.omni-architect.yml
scripts/custom-validate.js
hooks :
on_validation_approved : "node scripts/custom-validate.js"
Example 5: Storybook Export
Generate Storybook documentation from Figma assets:
.omni-architect.yml
package.json
scripts/figma-to-storybook.js
hooks :
on_figma_complete : "npm run export:storybook"
Result:
✓ Created story: checkout-flow
✓ Created story: user-authentication
✓ Created story: domain-er-diagram
Example 6: Analytics & Metrics
Track pipeline metrics over time:
.omni-architect.yml
scripts/log-metrics.js
hooks :
on_asset_deliver : "node scripts/log-metrics.js"
Hook Best Practices
Exit Codes Matter Return non-zero exit codes to halt the pipeline on errors.
Use Environment Variables All context is passed via env vars like $FIGMA_FILE_KEY.
Keep Hooks Fast Hooks should complete in < 10 seconds to avoid blocking the pipeline.
Handle Failures Gracefully Log errors and use on_error hook for cleanup.
Available Context Variables
# PRD Phase
export PRD_PATH = "./docs/prd.md"
export PARSED_JSON = "./output/parsed-prd.json"
export PROJECT_NAME = "My Project"
# Mermaid Phase
export DIAGRAMS_DIR = "./output/diagrams"
export DIAGRAM_COUNT = "5"
export DIAGRAM_TYPES = "flowchart,sequence,erDiagram"
# Validation Phase
export VALIDATION_SCORE = "0.93"
export REPORT_JSON = "./output/validation-report.json"
export VALIDATION_STATUS = "approved"
# Figma Phase
export FIGMA_FILE_KEY = "abc123XYZ"
export FIGMA_ACCESS_TOKEN = "figd_xxxx"
export ASSET_IDS = "123:456,123:789,123:012"
# Delivery Phase
export OUTPUT_DIR = "./output"
export DELIVERABLES = "./output/deliverables.json"
export ORCHESTRATION_LOG = "./output/orchestration.log"
# Error Handling
export PHASE = "mermaid-gen"
export ERROR_MESSAGE = "Syntax error in flowchart"
export ERROR_CODE = "MERMAID_SYNTAX_ERROR"
Advanced: Multi-Stage Workflows
Chain multiple tools together:
hooks :
on_figma_complete : |
# Multi-command pipeline
npm run export:storybook && \
npm run generate:react-components && \
npm test && \
npm run deploy:preview && \
node scripts/notify-slack.js
Multi-command hooks should use && to ensure each step succeeds before continuing. Use set -e in bash scripts.
Troubleshooting Hooks
Issue Solution Hook not executing Check file permissions: chmod +x scripts/*.sh Environment vars missing Hooks inherit from skill runner; export vars before running Timeout Default hook timeout is 60s; keep hooks fast or run async Non-zero exit ignored Ensure script returns correct exit code: process.exit(1) Path issues Hooks run in project root; use absolute paths or cd first
Real-World Workflow Example
Complete CI/CD pipeline for a product team:
project_name : "E-Commerce Platform"
figma_file_key : "abc123XYZ"
design_system : "material-3"
validation_mode : "auto"
validation_threshold : 0.88
hooks :
# After PRD parsed → Validate completeness
on_prd_parsed : |
node scripts/validate-prd-completeness.js
# After diagrams generated → Commit to git
on_mermaid_generated : |
bash scripts/commit-diagrams.sh
# After validation approved → Update Jira & generate specs
on_validation_approved : |
python scripts/update-jira.py && \
npm run generate:api-specs
# After Figma complete → Notify team & export Storybook
on_figma_complete : |
node scripts/notify-slack.js && \
npm run export:storybook && \
npm run deploy:storybook-preview
# After delivery → Log metrics & trigger downstream
on_asset_deliver : |
node scripts/log-metrics.js && \
curl -X POST $CI_WEBHOOK_URL \
-d '{"event": "omni_architect_complete"}'
# On any error → Alert team & rollback
on_error : |
node scripts/alert-team.js && \
bash scripts/rollback-changes.sh
Start simple with one hook (e.g., Slack notifications) and gradually add more as your team’s workflow matures.
Next Steps
CI/CD Integration Run Omni Architect in GitHub Actions
Configuration Reference Complete YAML configuration docs
API Reference Programmatic hook API
Troubleshooting Debug common hook issues