Create Data Flow Diagram - Workflow Instructions
<critical>The workflow execution engine is governed by: {project_root}/.faos/core/tasks/workflow.xml</critical>
<critical>You MUST have already loaded and processed: {installed_path}/workflow.yaml</critical>
<critical>This workflow creates data flow diagrams (DFD) in Excalidraw format.</critical>
<workflow>
<step n="0" goal="Contextual Analysis">
<action>Review user's request and extract: DFD level, processes, data stores, external entities</action>
<check if="ALL requirements clear"><action>Skip to Step 5</action></check>
</step>
<step n="1" goal="Assess Depth and Select Visual Pattern">
<action>Based on the user's request, determine the DFD depth level per {{helpers}} Depth Assessment:</action>
<action>Present assessment:
- Simple/Conceptual (10-20 elements): Context diagram (Level 0), single process with boundaries
- Standard (20-40 elements): Level 1 DFD, major processes and data flows
- Comprehensive/Technical (40-80 elements): Level 2 DFD, detailed sub-processes
</action>
<action>State your assessment: "This looks like a [depth] DFD because [reason]"</action>
<action>Select the best visual pattern from {{helpers}} Visual Pattern Library. For DFDs, common patterns are:
- fan-out: For processes distributing data to multiple stores or entities
- convergence: For data aggregation from multiple sources into a process
- pipeline: For linear data transformations (ETL-style flows)
- gap/break: For showing system boundaries in context diagrams
- cluster: For grouping related processes at higher DFD levels
</action>
<action>State: "I recommend the [pattern] pattern because it argues that [specific argument]"</action>
<action>Ask: "Does this depth and pattern match your intent? (yes/adjust)"</action>
<action>WAIT for confirmation</action>
<check if="user says adjust">
<action>Revise depth and/or pattern based on feedback</action>
<action>Confirm revised choices</action>
</check>
</step>
<step n="2" goal="Identify DFD Level" elicit="true">
<action>Ask: "What level of DFD do you need?"</action>
<action>Present options:
1. Context Diagram (Level 0) - Single process showing system boundaries
2. Level 1 DFD - Major processes and data flows
3. Level 2 DFD - Detailed sub-processes
4. Custom - Specify your requirements
</action>
<action>WAIT for selection</action>
</step>
<step n="3" goal="Gather Requirements" elicit="true">
<action>Ask: "Describe the processes, data stores, and external entities in your system"</action>
<action>WAIT for user description</action>
<action>Summarize what will be included and confirm with user</action>
</step>
<step n="4" goal="Theme Setup" elicit="true">
<action>Check for existing theme.json, ask to use if exists</action>
<check if="no existing theme">
<action>Ask: "Choose a DFD color scheme:"</action>
<action>Present numbered options:
1. Standard DFD
- Process: #e3f2fd (light blue)
- Data Store: #e8f5e9 (light green)
- External Entity: #f3e5f5 (light purple)
- Border: #1976d2 (blue)
2. Colorful DFD
- Process: #fff9c4 (light yellow)
- Data Store: #c5e1a5 (light lime)
- External Entity: #ffccbc (light coral)
- Border: #f57c00 (orange)
3. Minimal DFD
- Process: #f5f5f5 (light gray)
- Data Store: #eeeeee (gray)
- External Entity: #e0e0e0 (medium gray)
- Border: #616161 (dark gray)
4. Custom - Define your own colors
</action>
<action>WAIT for selection</action>
<action>Create theme.json based on selection, including semantic color mapping per {{helpers}}</action>
</check>
</step>
<step n="5" goal="Plan DFD Structure">
<action>List all processes with numbers (1.0, 2.0, etc.)</action>
<action>List all data stores (D1, D2, etc.)</action>
<action>List all external entities</action>
<action>Map all data flows with labels</action>
<action>Apply the selected visual pattern to the layout plan</action>
<action>Show planned structure, confirm with user</action>
</step>
<step n="6" goal="Load Resources">
<action>Load {{templates}} and extract `dataflow` section</action>
<action>Load visual_patterns from {{templates}} for the selected pattern</action>
<action>Load {{library}}</action>
<action>Load theme.json</action>
<action>Load {{helpers}}</action>
</step>
<step n="7" goal="Build DFD Elements">
<critical>Apply the design philosophy from {{helpers}}: This DFD must ARGUE a point about data flow, not just list processes. Follow the selected visual pattern for layout.</critical>
<critical>Use descriptive string IDs per {{helpers}} ID conventions (e.g., "validate_order_ellipse" not "proc_1")</critical>
<critical>Prefer free-floating text for data flow labels, boundary annotations, and DFD level indicators. Target less than 30% containerized text per {{helpers}} Text Strategy.</critical>
<substep>Build Order:
1. External entities (rectangles, bold border) with descriptive IDs
2. Processes (circles/ellipses with numbers) with descriptive IDs
3. Data stores (parallel lines or rectangles) with descriptive IDs
4. Data flows (labeled arrows) with descriptive IDs
5. Free-floating annotations and boundary labels
</substep>
<substep>DFD Rules:
- Processes: Numbered (1.0, 2.0), verb phrases
- Data stores: Named (D1, D2), noun phrases
- External entities: Named, noun phrases
- Data flows: Labeled with data names, arrows show direction
- No direct flow between external entities
- No direct flow between data stores
- Apply semantic color based on element role per {{helpers}}
</substep>
<substep>Layout:
- External entities at edges
- Processes in center
- Data stores between processes
- Minimize crossing flows
- Left-to-right or top-to-bottom flow
- Follow the selected visual pattern's layout rules from {{templates}}
</substep>
<check if="planned element count exceeds 30">
<action>Switch to section-by-section generation per {{helpers}} Section-by-Section Generation Protocol</action>
<action>Identify logical sections (e.g., external entities, core processes, data stores)</action>
<action>Generate each section separately, using namespaced seeds</action>
<action>After all sections: merge, validate cross-section arrows, verify boundElements</action>
</check>
<check if="depth is Comprehensive/Technical">
<action>Add evidence artifacts per {{helpers}} Evidence Artifacts guide</action>
<action>Embed real data payload shapes or query examples next to relevant processes (max 5)</action>
</check>
</step>
<step n="8" goal="Optimize and Save">
<action>Verify DFD rules compliance</action>
<action>Strip unused elements and elements with isDeleted: true</action>
<action>Save to {{default_output_file}}</action>
</step>
<step n="9" goal="Validate JSON Syntax">
<critical>NEVER delete the file if validation fails - always fix syntax errors</critical>
<action>Run: node -e "JSON.parse(require('fs').readFileSync('{{default_output_file}}', 'utf8')); console.log('Valid JSON')"</action>
<check if="validation fails (exit code 1)">
<action>Read the error message carefully - it shows the syntax error and position</action>
<action>Open the file and navigate to the error location</action>
<action>Fix the syntax error (add missing comma, bracket, or quote as indicated)</action>
<action>Save the file</action>
<action>Re-run validation with the same command</action>
<action>Repeat until validation passes</action>
</check>
<action>Once validation passes, confirm with user</action>
</step>
<step n="10" goal="Visual Preview (Optional)" optional="true">
<action>Load {{render_validate}}</action>
<action>Run: python3 {{render_script}} {{default_output_file}}</action>
<check if="exit code is 2 (Playwright not installed)">
<action>Skip: "Playwright not available — skipping PNG preview. DFD is still valid."</action>
</check>
<check if="exit code is 0">
<action>View the generated PNG file</action>
<action>Audit against design vision: Does the DFD ARGUE its point about data flow?</action>
<action>Check: overlapping text, misaligned arrows, spacing issues, color rendering</action>
<check if="issues found">
<action>Fix the JSON</action>
<action>Re-render (max 3 cycles)</action>
</check>
<action>Ask: "Keep the PNG preview file? (yes/no)"</action>
</check>
</step>
<step n="11" goal="Validate Content">
<invoke-task>Validate against {{validation}} using {faos}/core/tasks/validate-workflow.xml</invoke-task>
</step>
</workflow>
Quality Checklist
Create Data Flow Diagram - Validation Checklist
Design Quality
Generation Quality
DFD Notation
Structure
Completeness
Layout
Technical Quality
1---2name: excalidraw-dataflow3description: "Create data flow diagrams (DFD) in Excalidraw format showing data movement between systems and processes."4tags: [excalidraw, diagrams, dataflow, visualization]5metadata:6 source: https://skillmd.com/skills/frank-luongt/excalidraw-dataflow7---89# Create Data Flow Diagram - Workflow Instructions1011```xml12<critical>The workflow execution engine is governed by: {project_root}/.faos/core/tasks/workflow.xml</critical>13<critical>You MUST have already loaded and processed: {installed_path}/workflow.yaml</critical>14<critical>This workflow creates data flow diagrams (DFD) in Excalidraw format.</critical>1516<workflow>1718 <step n="0" goal="Contextual Analysis">19 <action>Review user's request and extract: DFD level, processes, data stores, external entities</action>20 <check if="ALL requirements clear"><action>Skip to Step 5</action></check>21 </step>2223 <step n="1" goal="Assess Depth and Select Visual Pattern">24 <action>Based on the user's request, determine the DFD depth level per {{helpers}} Depth Assessment:</action>25 <action>Present assessment:26 - Simple/Conceptual (10-20 elements): Context diagram (Level 0), single process with boundaries27 - Standard (20-40 elements): Level 1 DFD, major processes and data flows28 - Comprehensive/Technical (40-80 elements): Level 2 DFD, detailed sub-processes29 </action>30 <action>State your assessment: "This looks like a [depth] DFD because [reason]"</action>31 <action>Select the best visual pattern from {{helpers}} Visual Pattern Library. For DFDs, common patterns are:32 - fan-out: For processes distributing data to multiple stores or entities33 - convergence: For data aggregation from multiple sources into a process34 - pipeline: For linear data transformations (ETL-style flows)35 - gap/break: For showing system boundaries in context diagrams36 - cluster: For grouping related processes at higher DFD levels37 </action>38 <action>State: "I recommend the [pattern] pattern because it argues that [specific argument]"</action>39 <action>Ask: "Does this depth and pattern match your intent? (yes/adjust)"</action>40 <action>WAIT for confirmation</action>41 <check if="user says adjust">42 <action>Revise depth and/or pattern based on feedback</action>43 <action>Confirm revised choices</action>44 </check>45 </step>4647 <step n="2" goal="Identify DFD Level" elicit="true">48 <action>Ask: "What level of DFD do you need?"</action>49 <action>Present options:50 1. Context Diagram (Level 0) - Single process showing system boundaries51 2. Level 1 DFD - Major processes and data flows52 3. Level 2 DFD - Detailed sub-processes53 4. Custom - Specify your requirements54 </action>55 <action>WAIT for selection</action>56 </step>5758 <step n="3" goal="Gather Requirements" elicit="true">59 <action>Ask: "Describe the processes, data stores, and external entities in your system"</action>60 <action>WAIT for user description</action>61 <action>Summarize what will be included and confirm with user</action>62 </step>6364 <step n="4" goal="Theme Setup" elicit="true">65 <action>Check for existing theme.json, ask to use if exists</action>66 <check if="no existing theme">67 <action>Ask: "Choose a DFD color scheme:"</action>68 <action>Present numbered options:69 1. Standard DFD70 - Process: #e3f2fd (light blue)71 - Data Store: #e8f5e9 (light green)72 - External Entity: #f3e5f5 (light purple)73 - Border: #1976d2 (blue)7475 2. Colorful DFD76 - Process: #fff9c4 (light yellow)77 - Data Store: #c5e1a5 (light lime)78 - External Entity: #ffccbc (light coral)79 - Border: #f57c00 (orange)8081 3. Minimal DFD82 - Process: #f5f5f5 (light gray)83 - Data Store: #eeeeee (gray)84 - External Entity: #e0e0e0 (medium gray)85 - Border: #616161 (dark gray)8687 4. Custom - Define your own colors88 </action>89 <action>WAIT for selection</action>90 <action>Create theme.json based on selection, including semantic color mapping per {{helpers}}</action>91 </check>92 </step>9394 <step n="5" goal="Plan DFD Structure">95 <action>List all processes with numbers (1.0, 2.0, etc.)</action>96 <action>List all data stores (D1, D2, etc.)</action>97 <action>List all external entities</action>98 <action>Map all data flows with labels</action>99 <action>Apply the selected visual pattern to the layout plan</action>100 <action>Show planned structure, confirm with user</action>101 </step>102103 <step n="6" goal="Load Resources">104 <action>Load {{templates}} and extract `dataflow` section</action>105 <action>Load visual_patterns from {{templates}} for the selected pattern</action>106 <action>Load {{library}}</action>107 <action>Load theme.json</action>108 <action>Load {{helpers}}</action>109 </step>110111 <step n="7" goal="Build DFD Elements">112 <critical>Apply the design philosophy from {{helpers}}: This DFD must ARGUE a point about data flow, not just list processes. Follow the selected visual pattern for layout.</critical>113 <critical>Use descriptive string IDs per {{helpers}} ID conventions (e.g., "validate_order_ellipse" not "proc_1")</critical>114 <critical>Prefer free-floating text for data flow labels, boundary annotations, and DFD level indicators. Target less than 30% containerized text per {{helpers}} Text Strategy.</critical>115116 <substep>Build Order:117 1. External entities (rectangles, bold border) with descriptive IDs118 2. Processes (circles/ellipses with numbers) with descriptive IDs119 3. Data stores (parallel lines or rectangles) with descriptive IDs120 4. Data flows (labeled arrows) with descriptive IDs121 5. Free-floating annotations and boundary labels122 </substep>123124 <substep>DFD Rules:125 - Processes: Numbered (1.0, 2.0), verb phrases126 - Data stores: Named (D1, D2), noun phrases127 - External entities: Named, noun phrases128 - Data flows: Labeled with data names, arrows show direction129 - No direct flow between external entities130 - No direct flow between data stores131 - Apply semantic color based on element role per {{helpers}}132 </substep>133134 <substep>Layout:135 - External entities at edges136 - Processes in center137 - Data stores between processes138 - Minimize crossing flows139 - Left-to-right or top-to-bottom flow140 - Follow the selected visual pattern's layout rules from {{templates}}141 </substep>142143 <check if="planned element count exceeds 30">144 <action>Switch to section-by-section generation per {{helpers}} Section-by-Section Generation Protocol</action>145 <action>Identify logical sections (e.g., external entities, core processes, data stores)</action>146 <action>Generate each section separately, using namespaced seeds</action>147 <action>After all sections: merge, validate cross-section arrows, verify boundElements</action>148 </check>149150 <check if="depth is Comprehensive/Technical">151 <action>Add evidence artifacts per {{helpers}} Evidence Artifacts guide</action>152 <action>Embed real data payload shapes or query examples next to relevant processes (max 5)</action>153 </check>154 </step>155156 <step n="8" goal="Optimize and Save">157 <action>Verify DFD rules compliance</action>158 <action>Strip unused elements and elements with isDeleted: true</action>159 <action>Save to {{default_output_file}}</action>160 </step>161162 <step n="9" goal="Validate JSON Syntax">163 <critical>NEVER delete the file if validation fails - always fix syntax errors</critical>164 <action>Run: node -e "JSON.parse(require('fs').readFileSync('{{default_output_file}}', 'utf8')); console.log('Valid JSON')"</action>165 <check if="validation fails (exit code 1)">166 <action>Read the error message carefully - it shows the syntax error and position</action>167 <action>Open the file and navigate to the error location</action>168 <action>Fix the syntax error (add missing comma, bracket, or quote as indicated)</action>169 <action>Save the file</action>170 <action>Re-run validation with the same command</action>171 <action>Repeat until validation passes</action>172 </check>173 <action>Once validation passes, confirm with user</action>174 </step>175176 <step n="10" goal="Visual Preview (Optional)" optional="true">177 <action>Load {{render_validate}}</action>178 <action>Run: python3 {{render_script}} {{default_output_file}}</action>179 <check if="exit code is 2 (Playwright not installed)">180 <action>Skip: "Playwright not available — skipping PNG preview. DFD is still valid."</action>181 </check>182 <check if="exit code is 0">183 <action>View the generated PNG file</action>184 <action>Audit against design vision: Does the DFD ARGUE its point about data flow?</action>185 <action>Check: overlapping text, misaligned arrows, spacing issues, color rendering</action>186 <check if="issues found">187 <action>Fix the JSON</action>188 <action>Re-render (max 3 cycles)</action>189 </check>190 <action>Ask: "Keep the PNG preview file? (yes/no)"</action>191 </check>192 </step>193194 <step n="11" goal="Validate Content">195 <invoke-task>Validate against {{validation}} using {faos}/core/tasks/validate-workflow.xml</invoke-task>196 </step>197198</workflow>199```200201202## Quality Checklist203204# Create Data Flow Diagram - Validation Checklist205206## Design Quality207208- [ ] DFD makes a clear visual argument about data flow (not just listing processes)209- [ ] Isomorphism Test: Data flow structure communicates without labels210- [ ] Education Test: Unfamiliar viewer understands data movement in 30 seconds211- [ ] Visual pattern applied consistently (fan-out/convergence/pipeline/gap/cluster)212- [ ] Depth level matches user intent (Context/Level 1/Level 2)213- [ ] Free-floating text used for flow labels and boundary annotations (target <30% containerized)214- [ ] Semantic colors encode element roles (primary for processes, secondary for stores)215- [ ] All IDs are descriptive strings (e.g., "validate_order_ellipse" not "proc_1")216217## Generation Quality218219- [ ] If >30 elements: section-by-section generation used with namespaced seeds220- [ ] Descriptive string IDs follow `{component}_{role}_{type}` pattern221- [ ] Cross-section arrows have valid startBinding and endBinding222- [ ] Evidence artifacts present for Comprehensive/Technical depth (if applicable)223- [ ] Evidence artifacts use dark rectangle styling with monospace text224225## DFD Notation226227- [ ] Processes shown as circles/ellipses228- [ ] Data stores shown as parallel lines or rectangles229- [ ] External entities shown as rectangles230- [ ] Data flows shown as labeled arrows231- [ ] Follows standard DFD notation232233## Structure234235- [ ] All processes numbered correctly236- [ ] All data flows labeled with data names237- [ ] All data stores named appropriately238- [ ] External entities clearly identified239240## Completeness241242- [ ] All inputs and outputs accounted for243- [ ] No orphaned processes (unconnected)244- [ ] Data conservation maintained245- [ ] Level appropriate (context/level 0/level 1)246247## Layout248249- [ ] Logical flow direction (left to right, top to bottom)250- [ ] No crossing data flows where avoidable251- [ ] Balanced layout252- [ ] Grid alignment maintained253254## Technical Quality255256- [ ] All elements properly grouped257- [ ] Arrows have proper bindings258- [ ] Text readable and properly sized259- [ ] No elements with `isDeleted: true`260- [ ] JSON is valid261- [ ] File saved to correct location262