FR-050: Workflows Directory Structure Reorganization
Status: 🟡 PENDING INTAKE
Implementing Task: E6:S07:T107
Priority: MEDIUM - Improve organization and maintainability of workflow definitions
Estimated Effort: Medium
Created: 2026-03-09
Last updated: 2026-03-09
Version: v0.4.18.1+2
Code: E2:S?? (TBD)
Problem Statement​
The workflows directory /Users/rms/Documents/projects/ai-dev-kit/packages/frameworks/workflow mgt/workflows is currently unmanaged and lacks proper organization. Workflow files are not organized into workflow-named subdirectories, making it difficult to:
- Locate specific workflows - Files are scattered without clear grouping
- Maintain workflow organization - No consistent structure for workflow definitions
- Scale workflow management - Adding new workflows lacks clear placement guidelines
- Prevent file conflicts - Risk of filename collisions and confusion
Current State Analysis​
Current Directory Structure​
workflows/
├── rw/ # Mixed workflow files
│ ├── release-workflow.yaml
│ ├── other-files...
└── [unorganized files]
Issues Identified​
- Flat Structure - All workflow files in single directory
- Mixed Content - Different workflow types intermingled
- No Clear Boundaries - Difficult to identify workflow scope
- Maintenance Burden - Hard to find and update specific workflows
- Scalability Issues - Adding new workflows creates confusion
Proposed Solution​
1. Create Workflow-Named Subdirectories​
Reorganize workflows into individual subdirectories by workflow name:
workflows/
├── release-workflow/ # RW - Release Workflow
│ ├── release-workflow.yaml
│ ├── release-steps.yaml
│ ├── release-config.yaml
│ └── release-docs.md
├── changelog-management-workflow/ # CMW
│ ├── cmw-workflow.yaml
│ ├── cmw-config.yaml
│ └── cmw-steps.yaml
├── update-kanban-workflow/ # UKW
│ ├── ukw-workflow.yaml
│ ├── ukw-config.yaml
│ └── ukw-steps.yaml
├── post-implementation-review/ # PIR
│ ├── pir-workflow.yaml
│ ├── pir-config.yaml
│ └── pir-checklist.yaml
└── common/ # Shared workflow components
├── templates/
├── schemas/
└── utilities/
2. Standardize Workflow Directory Structure​
Each workflow subdirectory should follow this pattern:
{workflow-name}/
├── {workflow-name}-workflow.yaml # Main workflow definition
├── {workflow-name}-config.yaml # Configuration parameters
├── {workflow-name}-steps.yaml # Step definitions (if custom)
├── {workflow-name}-docs.md # Workflow documentation
└── tests/ # Workflow-specific tests
├── test_{workflow-name}.py
└── fixtures/
3. Create Workflow Registry​
Add a workflow-registry.yaml file to track all workflows:
workflow_registry:
version: "1.0.0"
last_updated: "2026-03-09"
workflows:
release-workflow:
name: "Release Workflow"
abbreviation: "RW"
description: "Complete release process with version management"
directory: "release-workflow/"
main_file: "release-workflow.yaml"
triggers: ["RW", "RW -k", "RW -d"]
steps: 17
changelog-management-workflow:
name: "Changelog Management Workflow"
abbreviation: "CMW"
description: "Manage changelog size and organization"
directory: "changelog-management-workflow/"
main_file: "cmw-workflow.yaml"
triggers: ["CMW"]
steps: 5
update-kanban-workflow:
name: "Update Kanban Workflow"
abbreviation: "UKW"
description: "Update Kanban board documentation"
directory: "update-kanban-workflow/"
main_file: "ukw-workflow.yaml"
triggers: ["UKW"]
steps: 8
post-implementation-review:
name: "Post-Implementation Review"
abbreviation: "PIR"
description: "Review implementation after release"
directory: "post-implementation-review/"
main_file: "pir-workflow.yaml"
triggers: ["PIR"]
steps: 6
common_components:
templates: "common/templates/"
schemas: "common/schemas/"
utilities: "common/utilities/"
4. Update Workflow Discovery​
Modify workflow loading mechanisms to use the new structure:
- Update workflow orchestrator to read from workflow registry
- Modify discovery scripts to search subdirectories
- Update documentation to reflect new organization
- Create migration scripts for existing workflows
Acceptance Criteria​
Functional Requirements​
-
✅ Directory Structure Created
- All workflows moved to named subdirectories
- Consistent structure across all workflow directories
- Common directory for shared components
-
✅ Workflow Registry Implemented
- Complete registry of all workflows
- Metadata for each workflow
- Easy discovery and loading
-
✅ Migration Completed
- Existing workflows moved to new structure
- No broken references or imports
- All functionality preserved
-
✅ Documentation Updated
- README reflects new structure
- Workflow documentation updated
- Migration guide provided
Non-Functional Requirements​
-
✅ Backward Compatibility
- Existing workflow functionality unchanged
- No breaking changes to workflow execution
- Graceful migration path
-
✅ Maintainability
- Clear organization makes workflows easy to find
- Consistent structure simplifies maintenance
- Easy to add new workflows
-
✅ Scalability
- Structure supports many workflows
- No naming conflicts
- Clear boundaries between workflows
Implementation Plan​
Phase 1: Analysis and Planning (Day 1)​
- Inventory all existing workflow files
- Map current files to new structure
- Identify dependencies and references
- Create migration plan
Phase 2: Create New Structure (Day 1)​
- Create workflow subdirectories
- Set up common directory structure
- Create workflow registry template
- Establish naming conventions
Phase 3: Migrate Existing Workflows (Day 1-2)​
- Move Release Workflow files to
release-workflow/ - Organize CMW files to
changelog-management-workflow/ - Structure UKW files to
update-kanban-workflow/ - Arrange PIR files to
post-implementation-review/ - Set up common shared components
Phase 4: Update References (Day 2)​
- Update workflow orchestrator paths
- Modify import statements
- Update documentation references
- Fix configuration file paths
Phase 5: Testing and Validation (Day 2)​
- Test all workflow discovery mechanisms
- Validate workflow execution still works
- Test new workflow registry functionality
- Verify documentation accuracy
Phase 6: Cleanup (Day 2)​
- Remove old empty directories
- Update README and guides
- Create maintenance documentation
- Final validation
Risks and Mitigations​
Risk: Broken References​
- Mitigation: Comprehensive search for all file references
- Fallback: Keep backup of original structure during migration
Risk: Workflow Execution Failure​
- Mitigation: Test each workflow after migration
- Rollback: Maintain original structure in parallel during testing
Risk: Discovery Mechanism Issues​
- Mitigation: Update all loading code before migration
- Testing: Comprehensive testing of workflow discovery
Timeline​
- Day 1: Analysis, create structure, begin migration
- Day 2: Complete migration, update references, testing
- Total: 2 days
Dependencies​
- FR-049 (Canonical RW Steps) - Must reference canonical definitions
- Existing workflow infrastructure - Required for integration
- Workflow orchestrator - Must be updated for new paths
Success Metrics​
- Organization - All workflows in named subdirectories
- Discoverability - Easy to find any workflow
- Maintainability - Clear structure for adding new workflows
- Functionality - All workflows work as before
- Documentation - Clear guides for new structure
Stakeholder Review​
Review Status: TODO
Reviewers: TBD
Review Date: TBD
Approval Status: TODO
This FR establishes a proper directory structure for workflow management, improving organization, maintainability, and scalability of the workflow system.