Overview
The current template system (BEFORE_STARTING_TEMPLATE, PROGRESS_REPORTING_TEMPLATE, ERROR_RECOVERY_TEMPLATE) uses text inclusion patterns. This issue proposes refactoring to an event-driven architecture with workflow lifecycle hooks.
This issue only needs to:
- change the the static text inclusion to be removed
- convert the TEMPLATES to workflow assignments
- attach the new workflow-assignments to the correct event-handlers:
a. BEFORE_STARTING_TEMPLATE --> preSciptBegins
b. PROGRESS_REPORTING_TEMPLATE --> postAssignemtnComplete
c. ERROR_RECOVERY_TEMPLATE --> onAssignmentFailure
Current State
Templates are included via static text references:
- BEFORE_STARTING_TEMPLATE - Pre-execution checklist
- PROGRESS_REPORTING_TEMPLATE - Status update format
- ERROR_RECOVERY_TEMPLATE - Error handling protocol
Included in 4 assignments:
- orchestrate-dynamic-workflow.md
- orchestrate-new-project.md
- create-app-plan.md
- create-application-foundation.md
Proposed Architecture
Replace templates with event hooks:
Event Lifecycle
- preScriptBegins - Before workflow execution starts
- postStepComplete - After each step completes
- on-assignment-failure -assignment failure or error
- preCreateAssignment - Before creating sub-assignments
- postAssignmentComplete - After sub-assignment finishes
Dynamic-workflow event system already exists.
- documented in dynamic0workflow-syntax.
Benefits
- Separation of Concerns - Workflow logic separate from procedural checks
- Reusability - Event handlers can be shared across workflows
- Flexibility - Add/modify hooks without changing core workflow
- Traceability - Clear audit trail of lifecycle events
- Testability - Event handlers can be tested independently
Implementation Plan
- Migrate existing 4 assignments to new pattern
- Document migration guide for custom workflows
Acceptance Criteria
Related
- Follows completion of FB-010 (template integration)
- Builds on FB-012 (workflow documentation)
- Part of architectural evolution toward more modular system
Overview
The current template system (BEFORE_STARTING_TEMPLATE, PROGRESS_REPORTING_TEMPLATE, ERROR_RECOVERY_TEMPLATE) uses text inclusion patterns. This issue proposes refactoring to an event-driven architecture with workflow lifecycle hooks.
This issue only needs to:
a. BEFORE_STARTING_TEMPLATE --> preSciptBegins
b. PROGRESS_REPORTING_TEMPLATE --> postAssignemtnComplete
c. ERROR_RECOVERY_TEMPLATE --> onAssignmentFailure
Current State
Templates are included via static text references:
Included in 4 assignments:
Proposed Architecture
Replace templates with event hooks:
Event Lifecycle
Dynamic-workflow event system already exists.
Benefits
Implementation Plan
Acceptance Criteria
Related