docs(10): create phase plan for workflow modularization
Phase 10: Workflow Modularization - 4 plan(s) in 3 wave(s) - Wave 1: Orphan cleanup (1 plan) - Wave 2: Sub-workflow extraction (2 plans parallel) - Wave 3: Integration verification (1 plan) - Ready for execution Plans: - 10-01: Remove 8 orphan nodes - 10-02: Extract container-update sub-workflow (DEBT-03) - 10-03: Extract container-actions sub-workflow - 10-04: Integration verification with user checkpoint Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,216 @@
|
||||
---
|
||||
phase: 10-workflow-modularization
|
||||
plan: 04
|
||||
type: execute
|
||||
wave: 3
|
||||
depends_on: [10-02, 10-03]
|
||||
files_modified: [n8n-workflow.json]
|
||||
autonomous: false
|
||||
|
||||
must_haves:
|
||||
truths:
|
||||
- "All text commands work after modularization"
|
||||
- "All inline keyboard flows work after modularization"
|
||||
- "All batch operations work after modularization"
|
||||
- "Main workflow is significantly smaller than before"
|
||||
artifacts:
|
||||
- path: "n8n-workflow.json"
|
||||
provides: "Modularized main workflow"
|
||||
min_lines: 4000
|
||||
- path: "n8n-container-update.json"
|
||||
provides: "Update sub-workflow"
|
||||
contains: "executeWorkflowTrigger"
|
||||
- path: "n8n-container-actions.json"
|
||||
provides: "Actions sub-workflow"
|
||||
contains: "executeWorkflowTrigger"
|
||||
key_links:
|
||||
- from: "n8n-workflow.json"
|
||||
to: "n8n-container-update.json"
|
||||
via: "Execute Sub-workflow"
|
||||
pattern: "executeWorkflow"
|
||||
- from: "n8n-workflow.json"
|
||||
to: "n8n-container-actions.json"
|
||||
via: "Execute Sub-workflow"
|
||||
pattern: "executeWorkflow"
|
||||
---
|
||||
|
||||
<objective>
|
||||
Perform full integration verification of modularized workflow and checkpoint with user.
|
||||
|
||||
Purpose: After extracting update and actions to sub-workflows, verify the entire bot still works correctly. This includes edge cases and flows that may not have been explicitly tested in prior plans.
|
||||
|
||||
Output: Verified working modularized workflow, user confirmation, and updated ROADMAP showing phase complete.
|
||||
</objective>
|
||||
|
||||
<execution_context>
|
||||
@/home/luc/.claude/get-shit-done/workflows/execute-plan.md
|
||||
@/home/luc/.claude/get-shit-done/templates/summary.md
|
||||
</execution_context>
|
||||
|
||||
<context>
|
||||
@.planning/PROJECT.md
|
||||
@.planning/ROADMAP.md
|
||||
@.planning/phases/10-workflow-modularization/10-RESEARCH.md
|
||||
@.planning/phases/10-workflow-modularization/10-01-SUMMARY.md
|
||||
@.planning/phases/10-workflow-modularization/10-02-SUMMARY.md
|
||||
@.planning/phases/10-workflow-modularization/10-03-SUMMARY.md
|
||||
@n8n-workflow.json
|
||||
@n8n-container-update.json
|
||||
@n8n-container-actions.json
|
||||
</context>
|
||||
|
||||
<tasks>
|
||||
|
||||
<task type="auto">
|
||||
<name>Task 1: Comprehensive functionality audit</name>
|
||||
<files>n8n-workflow.json, n8n-container-update.json, n8n-container-actions.json</files>
|
||||
<action>
|
||||
Run through all bot functionality systematically to verify nothing was broken by modularization.
|
||||
|
||||
**Text command tests:**
|
||||
1. `/start` or `/status` - Should show help or status
|
||||
2. `status` - Should list all containers with inline keyboard
|
||||
3. `status <container>` - Should show specific container status
|
||||
4. `start <container>` - Should start and confirm
|
||||
5. `stop <container>` - Should prompt confirmation, then stop
|
||||
6. `restart <container>` - Should restart and confirm
|
||||
7. `update <container>` - Should prompt confirmation, show progress, complete
|
||||
8. `logs <container>` - Should show logs
|
||||
9. `logs <container> 100` - Should show 100 lines of logs
|
||||
10. `batch start <names>` - Should batch start
|
||||
11. `batch stop <names>` - Should batch stop with confirmation
|
||||
12. `batch update <names>` - Should batch update with confirmation
|
||||
|
||||
**Inline keyboard tests:**
|
||||
1. Container list navigation (pagination if >10 containers)
|
||||
2. Container submenu display
|
||||
3. Start button (on stopped container)
|
||||
4. Stop button with confirmation dialog
|
||||
5. Restart button
|
||||
6. Update button with confirmation dialog
|
||||
7. Update progress messages
|
||||
8. Logs button with refresh
|
||||
9. Back navigation
|
||||
10. Batch selection mode
|
||||
11. Batch execution with progress
|
||||
|
||||
**Edge cases:**
|
||||
1. Container not found (fuzzy match suggestions)
|
||||
2. Ambiguous container name (disambiguation)
|
||||
3. Update when already up to date
|
||||
4. Action on already running/stopped container
|
||||
5. Confirmation timeout (30 seconds)
|
||||
|
||||
Document any issues found.
|
||||
</action>
|
||||
<verify>
|
||||
- All text commands execute without errors
|
||||
- All inline keyboard flows work
|
||||
- Batch operations complete successfully
|
||||
- Edge cases handled gracefully
|
||||
</verify>
|
||||
<done>Full functionality audit completed, issues documented</done>
|
||||
</task>
|
||||
|
||||
<task type="auto">
|
||||
<name>Task 2: Measure modularization impact</name>
|
||||
<files>n8n-workflow.json, n8n-container-update.json, n8n-container-actions.json</files>
|
||||
<action>
|
||||
Quantify the improvements from modularization:
|
||||
|
||||
1. **Line count comparison:**
|
||||
- Original main workflow: ~8,485 lines
|
||||
- New main workflow: Count lines
|
||||
- Update sub-workflow: Count lines
|
||||
- Actions sub-workflow: Count lines
|
||||
- Calculate total and reduction percentage
|
||||
|
||||
2. **Node count comparison:**
|
||||
- Original: ~248 nodes (after orphan cleanup: ~240)
|
||||
- New main workflow: Count nodes
|
||||
- Update sub-workflow: Count nodes
|
||||
- Actions sub-workflow: Count nodes
|
||||
|
||||
3. **Code duplication analysis:**
|
||||
- Before: Update flow duplicated (text + callback paths)
|
||||
- After: Single update flow in sub-workflow
|
||||
- Document specific duplication eliminated
|
||||
|
||||
4. **Document the modular structure:**
|
||||
```
|
||||
Main Workflow (n8n-workflow.json)
|
||||
├── Telegram Trigger
|
||||
├── Authentication
|
||||
├── Command Routing
|
||||
├── Confirmation Dialogs
|
||||
└── Sub-workflow Calls
|
||||
├── container-update (for all update operations)
|
||||
└── container-actions (for start/stop/restart)
|
||||
```
|
||||
|
||||
Create a summary table of before/after metrics.
|
||||
</action>
|
||||
<verify>
|
||||
- Line counts documented for all workflow files
|
||||
- Node counts documented
|
||||
- Reduction percentage calculated
|
||||
- Modular structure documented
|
||||
</verify>
|
||||
<done>Modularization impact measured and documented</done>
|
||||
</task>
|
||||
|
||||
<task type="checkpoint:human-verify" gate="blocking">
|
||||
<what-built>
|
||||
Modularized n8n workflow with:
|
||||
- Main workflow calling sub-workflows for container operations
|
||||
- Container Update sub-workflow (handles all update paths)
|
||||
- Container Actions sub-workflow (handles start/stop/restart)
|
||||
- Orphan nodes cleaned up
|
||||
- Duplicated update code consolidated (DEBT-03)
|
||||
</what-built>
|
||||
<how-to-verify>
|
||||
Please test the following in Telegram:
|
||||
|
||||
1. **Basic commands:**
|
||||
- Send `status` - Should show container list keyboard
|
||||
- Send `update <container>` - Should prompt confirmation, then update
|
||||
|
||||
2. **Inline keyboard flow:**
|
||||
- Tap a container from the list
|
||||
- Try Start/Stop/Restart buttons
|
||||
- Try Update button (with confirmation)
|
||||
- Try Logs button
|
||||
|
||||
3. **Batch operation:**
|
||||
- Start batch mode and select 2 containers
|
||||
- Execute a batch action
|
||||
|
||||
Report any issues or confirm all functionality works as expected.
|
||||
</how-to-verify>
|
||||
<resume-signal>Type "approved" to complete Phase 10, or describe any issues found</resume-signal>
|
||||
</task>
|
||||
|
||||
</tasks>
|
||||
|
||||
<verification>
|
||||
1. All text commands work correctly
|
||||
2. All inline keyboard flows work correctly
|
||||
3. All batch operations work correctly
|
||||
4. Edge cases handled (not found, disambiguation, timeouts)
|
||||
5. Main workflow line count reduced significantly
|
||||
6. Update flow exists in single location (sub-workflow)
|
||||
7. Actions flow exists in single location (sub-workflow)
|
||||
8. User has verified bot works from their phone
|
||||
</verification>
|
||||
|
||||
<success_criteria>
|
||||
- MOD-01: Main workflow broken into logical sub-workflows (update, actions)
|
||||
- MOD-02: Sub-workflows callable from main without duplication
|
||||
- DEBT-03: Update flow consolidated (no longer duplicated)
|
||||
- All v1.1 functionality preserved
|
||||
- User verification passed
|
||||
</success_criteria>
|
||||
|
||||
<output>
|
||||
After completion, create `.planning/phases/10-workflow-modularization/10-04-SUMMARY.md`
|
||||
</output>
|
||||
Reference in New Issue
Block a user