- Next.js 14+ with App Router and TypeScript - Tailwind CSS and ShadCN UI styling - Zustand state management - Dexie.js for IndexedDB (local-first data) - Auth.js v5 for authentication - BMAD framework integration Co-Authored-By: Claude <noreply@anthropic.com>
7.0 KiB
name, description, nextStepFile, editPlan, targetWorkflowPath, architecture, stepFileRules, frontmatterStandards, menuHandlingStandards, outputFormatStandards, stepTypePatterns, workflowTypeCriteria, inputDiscoveryStandards, csvDataFileStandards, intentVsPrescriptive
| name | description | nextStepFile | editPlan | targetWorkflowPath | architecture | stepFileRules | frontmatterStandards | menuHandlingStandards | outputFormatStandards | stepTypePatterns | workflowTypeCriteria | inputDiscoveryStandards | csvDataFileStandards | intentVsPrescriptive |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| step-e-04-direct-edit | Apply direct user-requested changes to workflow | ./step-e-05-apply-edit.md | {bmb_creations_output_folder}/edit-plan-{workflow_name}.md | {targetWorkflowPath} | ../data/architecture.md | ../data/step-file-rules.md | ../data/frontmatter-standards.md | ../data/menu-handling-standards.md | ../data/output-format-standards.md | ../data/step-type-patterns.md | ../data/workflow-type-criteria.md | ../data/input-discovery-standards.md | ../data/csv-data-file-standards.md | ../data/intent-vs-prescriptive-spectrum.md |
Edit Step 4: Direct Edit
STEP GOAL:
Apply direct user-requested changes to the workflow, loading relevant standards and checking for non-compliance during editing.
MANDATORY EXECUTION RULES (READ FIRST):
Universal Rules:
- 🛑 NEVER make changes without user approval
- 📖 CRITICAL: Read the complete step file before taking any action
- 📋 YOU ARE A FACILITATOR, not an autonomous editor
- ✅ YOU MUST ALWAYS SPEAK OUTPUT In your Agent communication style with the config
{communication_language}
Step-Specific Rules:
- 🎯 Focus on user-requested changes
- 🚫 FORBIDDEN to make changes without approval
- 💬 Check for non-compliance while editing
- 📋 Load relevant standards for each change type
EXECUTION PROTOCOLS:
- 🎯 Work through each requested change
- 💾 Document each change in edit plan
- 📖 Load appropriate standards for each change type
- 🚫 IF non-compliance found: offer to fix before proceeding
CONTEXT BOUNDARIES:
- Edit plan contains direct change goals
- Focus: Apply user's requested changes
- Must check for compliance issues during edits
MANDATORY SEQUENCE
CRITICAL: Follow this sequence exactly. Do not skip or shortcut.
1. Read Edit Plan
Load the editPlan:
Read {editPlan} to review direct change goals from step 2.
2. For Each Direct Change Goal
Work through each change systematically:
A. Identify Change Type and Load Standards
For workflow.md changes:
- Load {architecture}
For step file changes:
- Load {stepFileRules}
- Load {stepTypePatterns}
- Load {intentVsPrescriptive}
For frontmatter changes:
- Load {frontmatterStandards}
For menu changes:
- Load {menuHandlingStandards}
For output/template changes:
- Load {outputFormatStandards}
For data file changes:
- Load {csvDataFileStandards}
For workflow type changes:
- Load {workflowTypeCriteria}
For discovery/input changes:
- Load {inputDiscoveryStandards}
B. Load Target File and Check Compliance
Load the file to be edited and review against standards:
"Loading: {filename} Standard: {standard file loaded}
Checking file against standards before making your change..."
IF NON-COMPLIANCE FOUND:
"⚠️ Compliance Issue Detected
Before I apply your change, I noticed this file is not fully compliant with {standard}:
Issue: {describe the non-compliance}
This could cause: {explain impact}
Should I fix this compliance issue before applying your change?
- [F]ix first - Fix compliance, then apply your change
- [C]ontinue anyway - Apply your change without fixing
- [E]xplain more - More details about the issue
Menu Handling Logic:
- IF F: Fix compliance first, then proceed to apply change
- IF C: Document user accepted risk, proceed with change
- IF E: Provide more details, then redisplay menu
- IF Any other: help user, then redisplay menu"
IF COMPLIANT:
"File is compliant. Proceeding with your change."
C. Present Current State and Proposed Change
"Current state of: {filename}
{show relevant section}
Your requested change: {summarize the change from edit plan}
Proposed modification: {show how the change will be made}
Should I apply this change?"
Wait for user approval.
D. Apply Change (If Approved)
Load the file, make the change:
**Applying change to: {filename}**
**Before:**
{show relevant section}
**After:**
{show modified section}
**Change applied.** ✅"
Update editPlan:
### Direct Changes Applied
**[{change type}]** {filename}
- ✅ Changed: {description}
- User approved: Yes
- Compliance check: Passed/Fixed/Accepted risk
3. Handle Common Change Patterns
Adding a New Step
- Load {stepFileRules}, {stepTypePatterns}, {intentVsPrescriptive}
- Check existing step numbering
- Determine appropriate step type
- Create step file with proper structure
- Update nextStepFile references in adjacent steps
- Verify menu handling compliance
Removing a Step
- Load {architecture}
- Check if step is referenced by other steps
- Update nextStepFile in previous step
- Confirm with user about impact
- Remove step file
- Verify no broken references
Modifying workflow.md
- Load {architecture}
- Check for progressive disclosure compliance (no step listings!)
- Update goal/role/routing as requested
- Ensure last section is routing
- Verify frontmatter completeness
Adding/Modifying Data Files
- Load {csvDataFileStandards}
- Check file size (warn if >500 lines)
- Verify CSV format if applicable
- Ensure proper headers
- Update step frontmatter references
Adding/Modifying Templates
- Load {outputFormatStandards}
- Determine template type
- Ensure variable consistency
- Update step frontmatter references
4. After All Changes Complete
Present summary:
"Direct Edit Summary:
Total Changes Requested: {count} Applied: {count} Skipped: {count} Modified: {count}
Compliance Issues Found During Editing: {count}
- Fixed: {count}
- User accepted risk: {count}
Files Modified:
- {file1}
- {file2}
- etc."
5. Present MENU OPTIONS
Display: "Direct Edits Applied. Select an Option: [C] Continue"
Menu Handling Logic:
- IF C: Update editPlan stepsCompleted, then load, read entirely, then execute {nextStepFile}
- IF Any other: help user respond, then redisplay menu
CRITICAL STEP COMPLETION NOTE
ONLY WHEN all direct changes are applied (or documented) and user confirms, will you then load and read fully {nextStepFile} to execute.
🚨 SYSTEM SUCCESS/FAILURE METRICS
✅ SUCCESS:
- All requested changes presented to user
- Relevant standards loaded for each change
- Compliance checked before each change
- User approval obtained for each change
- Non-compliance found and offered fix
- Changes applied correctly
- Edit plan updated
❌ SYSTEM FAILURE:
- Not loading relevant standards
- Not checking compliance before editing
- Making changes without user approval
- Missing non-compliance issues
- Not documenting changes
Master Rule: Load standards for each change type. Check compliance BEFORE applying changes. Offer to fix non-compliance when found.