agentleFS
patonkikhpatonkikh/APES/skills/architecture/data-flow-analyzer/skill.md

data-flow-analyzer

Skill3 starsChanged 4 months agoMITView on GitHub

Analyze and document data flows across the system: data origins, transformations, storage, retention, and compliance boundaries. Use when working on solution architecture, C4 diagrams, APIs, ADRs, or system design.

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 2 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use STRIDE or LINDDUN for threat modeling sensitive flows.

    line 117
  2. Distinctive:

    Document encryption per flow crossing trust boundaries.

    line 118

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
skill.md

Data Flow Analyzer

Purpose

Analyze and document data flows across the system: data origins, transformations, storage, retention, and compliance boundaries.

Input: Container diagram, integration plan, data entities (optional), compliance requirements
Output: Data Flow document with DFD-style diagrams, data inventory, and privacy classification Examples: See examples.md for worked input/output.


Workflow

Step 1: Identify data entities

List core data entities:

EntityDescriptionOwner containerSensitivity

Sensitivity: Public, Internal, Confidential, PII, PHI, PCI.

Step 2: Map data origins and sinks

For each entity:

  • Source (user input, external system, generated)
  • Storage locations (database, cache, file, queue)
  • Consumers (containers, external systems)
  • Retention period

Step 3: Document transformations

StepInputTransformationOutputContainer

Include validation, enrichment, aggregation, anonymization.

Step 4: Draw data flow diagram

flowchart LR
    user[User] -->|PII| api[API]
    api -->|encrypted| db[(Database)]
    api -->|event| queue[Queue]

Label flows with data type and protocol. Mark trust boundary crossings.

Step 5: Compliance analysis

RequirementData affectedControlGap

Cover: GDPR, encryption at rest/transit, right to deletion, audit logging.

Step 6: Identify risks

  • Data duplication across stores
  • Unencrypted sensitive flows
  • Missing retention policy
  • Cross-border transfer

Step 7: Validate

Run Validation checklist.


Decision Rules

ConditionAction
No container/integration contextStop; run container-diagram-builder or integration-planner
PII without classificationClassify before proceeding; flag if unknown
Sensitive data in logsFlag as Critical finding
Retention undefined for PIIRecommend policy; mark as gap
Data flow crosses trust boundary unencryptedFlag as High severity

Validation

  • All core entities inventoried with sensitivity
  • Each entity has source, storage, consumers
  • Transformations documented for sensitive data
  • DFD diagram with labeled flows
  • Trust boundaries marked
  • Compliance requirements checked
  • ≥3 data risks identified with severity
  • Retention policy stated or flagged as gap

Anti-patterns

  • Data swamp — duplicate entities across stores without sync strategy.
  • PII everywhere — sensitive data in logs, caches, analytics without controls.
  • Missing lineage — unknown data origin for compliance-critical fields.
  • Implicit retention — data kept forever by default.
  • Diagram without labels — arrows without data type or volume indication.

Best Practices

  • Use STRIDE or LINDDUN for threat modeling sensitive flows.
  • Document encryption per flow crossing trust boundaries.
  • Align with integration-planner contracts.
  • Map to GDPR lawful basis where applicable.
  • Separate analytics data flows from operational flows.

Output Structure

# Data Flow Analysis: [System Name]

## Data Inventory
| Entity | Sensitivity | Owner | Storage | Retention |
|--------|-------------|-------|---------|-----------|

## Transformations
| Step | Input | Transform | Output |
|------|-------|-----------|--------|

## Data Flow Diagram
```mermaid
[diagram]

Trust Boundaries

BoundaryData crossingControls

Compliance

RequirementStatusGap

Risks

IDSeverityFindingRemediation

---

# Next Skills

| Outcome | Recommended Skill |
|---------|-------------------|
| Plan scaling for data layer | `architecture/scalability-advisor` |
| Review security | `architecture/architecture-review` |
| Update integration plan | `architecture/integration-planner` |
| Document data decision | `architecture/adr-generator` |

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.