skills/arckit-dfd/SKILL.md
Generate Yourdon-DeMarco Data Flow Diagrams (DFDs) with structured analysis notation
npx skillsauth add tractorjuice/arckit-codex arckit-dfdInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
You are an expert systems analyst helping create Data Flow Diagrams (DFDs) using Yourdon-DeMarco structured analysis notation. Your diagrams will use the standard Yourdon-DeMarco symbols and integrate with ArcKit's governance workflow.
| Symbol | Shape | Description | |--------|-------|-------------| | External Entity | Rectangle | Source or sink of data outside the system boundary | | Process | Circle (bubble) | Transforms incoming data flows into outgoing data flows | | Data Store | Open-ended rectangle (parallel lines) | Repository of data at rest | | Data Flow | Named arrow | Data in motion between components |
| Level | Name | Purpose | |-------|------|---------| | Level 0 | Context Diagram | Single process representing the entire system, showing all external entities and data flows crossing the system boundary | | Level 1 | Top-Level DFD | Decomposes the context diagram process into major sub-processes, showing data stores and internal flows | | Level 2+ | Detailed DFD | Further decomposes individual Level 1 processes into finer-grained sub-processes |
$ARGUMENTS
Note: Before generating, scan
projects/for existing project directories. For each project, list allARC-*.mdartifacts, checkexternal/for reference documents, and check000-global/for cross-project policies. If no external docs exist but they would improve output, ask the user.
Read existing project artifacts to understand what to diagram:
Read Requirements (if available):
Read Data Model (if available):
Read Architecture Principles (if available):
Read Existing Diagrams (if available):
external/ files) — extract existing data flow diagrams, process descriptions, system interfacesprojects/{project-dir}/external/ and re-run, or skip.".arckit/references/citation-instructions.md. Place inline citation markers (e.g., [PP-C1]) next to findings informed by source documents and populate the "External References" section in the template.If the user has not specified a DFD level in their arguments, ask the user:
Gathering rules (apply to all questions in this section):
Question 1 — header: DFD Level, multiSelect: false
"What level of Data Flow Diagram should be generated?"
If the user specified a level (e.g., $arckit-dfd level 1), skip this question and proceed directly.
Read .arckit/skills/mermaid-syntax/references/flowchart.md for official Mermaid syntax — node shapes, edge labels, subgraphs, and styling options.
Based on the selected level and project context, generate the Data Flow Diagram.
Use consistent naming throughout:
0 (represents entire system)1, 2, 3, etc.1.1, 1.2, 1.3, etc.D1, D2, D3, etc.Generate the DFD in two formats so the user can choose their preferred rendering tool:
data-flow-diagram DSLThis text format can be rendered using the open-source data-flow-diagram Python tool (pip install data-flow-diagram), which produces true Yourdon-DeMarco notation with circles, parallel lines, and rectangles.
DSL syntax reference:
# Elements
process ID "Label"
entity ID "Label"
store ID "Label"
# Flows (data in motion)
SOURCE --> DEST "flow label"
# Bidirectional flows
SOURCE <-> DEST "flow label"
Example — Level 0 (Context Diagram):
title Context Diagram - Online Payment System
entity CUST "Customer"
entity BANK "Bank System"
entity MERCH "Merchant"
process P0 "Online Payment\nSystem"
CUST --> P0 "Payment Request"
P0 --> CUST "Payment Confirmation"
P0 --> BANK "Transaction Authorisation"
BANK --> P0 "Authorisation Response"
MERCH --> P0 "Merchant Details"
P0 --> MERCH "Settlement Notification"
Example — Level 1:
title Level 1 DFD - Online Payment System
entity CUST "Customer"
entity BANK "Bank System"
entity MERCH "Merchant"
process P1 "1\nValidate\nPayment"
process P2 "2\nProcess\nTransaction"
process P3 "3\nSettle\nPayment"
store D1 "Transaction Log"
store D2 "Customer Records"
CUST --> P1 "Payment Request"
P1 --> CUST "Validation Error"
P1 --> D2 "Customer Lookup"
D2 --> P1 "Customer Details"
P1 --> P2 "Validated Payment"
P2 --> BANK "Authorisation Request"
BANK --> P2 "Authorisation Response"
P2 --> D1 "Transaction Record"
P2 --> P3 "Authorised Transaction"
D1 --> P3 "Transaction Details"
P3 --> MERCH "Settlement Notification"
P3 --> CUST "Payment Confirmation"
A Mermaid flowchart approximation for inline rendering in GitHub, VS Code, and online editors. Uses circles for processes, lined rectangles for data stores, and rectangles for external entities.
Example — Level 0:
flowchart LR
CUST["Customer"]
BANK["Bank System"]
MERCH["Merchant"]
P0(("Online Payment\nSystem"))
CUST -->|Payment Request| P0
P0 -->|Payment Confirmation| CUST
P0 -->|Transaction Authorisation| BANK
BANK -->|Authorisation Response| P0
MERCH -->|Merchant Details| P0
P0 -->|Settlement Notification| MERCH
Example — Level 1:
flowchart LR
CUST["Customer"]
BANK["Bank System"]
MERCH["Merchant"]
P1(("1. Validate\nPayment"))
P2(("2. Process\nTransaction"))
P3(("3. Settle\nPayment"))
D1[("D1: Transaction Log")]
D2[("D2: Customer Records")]
CUST -->|Payment Request| P1
P1 -->|Validation Error| CUST
P1 <-->|Customer Lookup / Details| D2
P1 -->|Validated Payment| P2
P2 -->|Authorisation Request| BANK
BANK -->|Authorisation Response| P2
P2 -->|Transaction Record| D1
P2 -->|Authorised Transaction| P3
D1 -->|Transaction Details| P3
P3 -->|Settlement Notification| MERCH
P3 -->|Payment Confirmation| CUST
Mermaid Shape Mapping:
| Yourdon-DeMarco | Mermaid Syntax | Example |
|-----------------|----------------|---------|
| Process (circle) | (("label")) | P1(("1. Validate")) |
| External Entity (rectangle) | ["label"] | CUST["Customer"] |
| Data Store (parallel lines) | [("label")] | D1[("D1: Transactions")] |
| Data Flow (arrow) | -->│label│ | A -->│data│ B |
Before writing the file, read .arckit/references/quality-checklist.md and verify all Common Checks plus the DFD per-type checks pass. Fix any failures before proceeding.
File Location: projects/{project_number}-{project_name}/diagrams/ARC-{PROJECT_ID}-DFD-{NNN}-v1.0.md
Read the template (with user override support):
.arckit/templates-custom/dfd-template.md exists in the project root.arckit/templates/dfd-template.md (default)Construct Document ID:
ARC-{PROJECT_ID}-DFD-{NNN}-v{VERSION} (e.g., ARC-001-DFD-001-v1.0){NNN}: Check existing files in diagrams/ and use the next number (001, 002, ...)The output document must include:
data-flow-diagram DSL — inside a dfd code blockmermaid code block| Process | Name | Inputs | Outputs | Logic Summary | Req. Trace | |---------|------|--------|---------|---------------|------------| | 1 | Validate Payment | Payment Request, Customer Details | Validated Payment, Validation Error | Check card format, verify customer exists, validate amount | FR-001, DR-002 |
| Store | Name | Contents | Access | Retention | PII | |-------|------|----------|--------|-----------|-----| | D1 | Transaction Log | Transaction ID, amount, status, timestamp | Read/Write by P2, Read by P3 | 7 years | No | | D2 | Customer Records | Name, email, card token, address | Read by P1, Write by P2 | Account lifetime | Yes |
| Data Flow | Composition | Source | Destination | Format | |-----------|-------------|--------|-------------|--------| | Payment Request | {customer_id, card_token, amount, currency, merchant_id} | Customer | P1 | JSON | | Validated Payment | {payment_id, customer_id, amount, merchant_id, validation_status} | P1 | P2 | Internal |
CRITICAL - Auto-Populate Document Control Fields:
Before completing the document, populate ALL document control fields in the header:
Populate Required Fields:
Auto-populated fields (populate these automatically):
[PROJECT_ID] → Extract from project path (e.g., "001" from "projects/001-project-name")[VERSION] → "1.0" (or increment if previous version exists)[DATE] / [YYYY-MM-DD] → Current date in YYYY-MM-DD format[DOCUMENT_TYPE_NAME] → "Data Flow Diagram"ARC-[PROJECT_ID]-DFD-v[VERSION] → Construct using format above[COMMAND] → "arckit.dfd"User-provided fields (extract from project metadata or user input):
[PROJECT_NAME] → Full project name from project metadata or user input[OWNER_NAME_AND_ROLE] → Document owner (prompt user if not in metadata)[CLASSIFICATION] → Default to ${user_config.default_classification}; if unavailable, use "OFFICIAL" for UK Gov, "PUBLIC" otherwiseCalculated fields:
[YYYY-MM-DD] for Review Date → Current date + 30 daysPending fields (leave as [PENDING]):
[REVIEWER_NAME] → [PENDING][APPROVER_NAME] → [PENDING][DISTRIBUTION_LIST] → Default to "Project Team, Architecture Team" or [PENDING]Populate Revision History:
| 1.0 | {DATE} | ArcKit AI | Initial creation from `$arckit-dfd` command | [PENDING] | [PENDING] |
Populate Generation Metadata Footer:
**Generated by**: ArcKit `$arckit-dfd` command
**Generated on**: {DATE} {TIME} GMT
**ArcKit Version**: {ARCKIT_VERSION}
**Project**: {PROJECT_NAME} (Project {PROJECT_ID})
**AI Model**: [Use actual model name]
**DFD Level**: [Context / Level 1 / Level 2 / All Levels]
Before finalizing, validate the DFD:
After creating the DFD, provide a summary:
DFD Created: {level} - {system_name}
Location: projects/{project}/diagrams/ARC-{PROJECT_ID}-DFD-{NUM}-v{VERSION}.md
Rendering Options:
- data-flow-diagram CLI: pip install data-flow-diagram && dfd < file.dfd
(Produces true Yourdon-DeMarco notation as SVG/PNG)
- Mermaid Live Editor: https://mermaid.live (paste Mermaid code)
- draw.io: https://app.diagrams.net (enable "Data Flow Diagrams" shapes)
- GitHub/VS Code: Mermaid code renders automatically
DFD Summary:
- External Entities: {count}
- Processes: {count}
- Data Stores: {count}
- Data Flows: {count}
Next Steps:
- $arckit-dfd level 1 — Decompose into sub-processes (if context diagram)
- $arckit-dfd level 2 — Detail a specific process (if Level 1 exists)
- $arckit-diagram — Generate C4 or deployment diagrams
- $arckit-data-model — Create formal data model from data stores
< or > (e.g., < 3 seconds, > 99.9% uptime) to prevent markdown renderers from interpreting them as HTML tags or emojitools
Procurement market intelligence — award-value benchmarks, top suppliers, incumbency and concentration, from the UK Tenders MCP
tools
Competitor landscape — rival suppliers, awarded-value market share, head-to-head and concentration, from the UK Tenders MCP
development
[COMMUNITY] Generate a SOCI Act Critical Infrastructure Risk Management Program (CIRMP) governance and evidence pack for Australian critical infrastructure assets.
development
[COMMUNITY] Generate an ASD operational technology cyber security assessment for Australian Government and critical-infrastructure projects with connected OT environments.