home / skills / shotaiuchi / dotclaude / debug-dataflow

debug-dataflow skill

/dotclaude/skills/debug-dataflow

This skill helps you trace data through transformation pipelines to identify where values become incorrect or unexpected during debugging.

npx playbooks add skill shotaiuchi/dotclaude --skill debug-dataflow

Review the files below or copy the command above to add this skill to your agents.

Files (1)
SKILL.md
2.1 KB
---
name: debug-dataflow
description: >-
  Data flow tracing investigation. Apply when debugging data transformation
  errors, boundary conditions, type conversions, null propagation, and
  unexpected data mutations.
user-invocable: false
---

# Data Flow Tracer Investigation

Trace data through transformation pipelines to identify where values become incorrect or unexpected.

## Investigation Checklist

### Input Validation Trail
- Verify inputs are validated at the entry point before processing
- Check for missing validation on optional or nullable fields
- Identify inputs that bypass validation through alternative paths
- Verify boundary values are handled correctly at each stage
- Look for implicit assumptions about input format or encoding

### Transformation Chain
- Trace data through each transformation step end to end
- Identify steps where data shape or structure changes unexpectedly
- Check for lossy transformations that discard significant information
- Verify mapping functions handle all possible input variants
- Look for order-dependent transformations applied inconsistently

### Type Coercion
- Identify implicit type conversions that alter data semantics
- Check for precision loss in numeric type widening or narrowing
- Verify string-to-number and number-to-string conversions are safe
- Look for truthy/falsy coercion that changes boolean logic
- Detect encoding mismatches in string or byte conversions

### Null/Undefined Propagation
- Trace null values from origin through all downstream consumers
- Check for missing null guards at function boundaries
- Identify optional chaining gaps that allow null to propagate
- Verify default value assignments handle all falsy cases correctly
- Look for null coalescing that masks legitimate null signals

## Output Format

Report findings with confidence ratings:

| Confidence | Description |
|------------|-------------|
| High | Root cause clearly identified with supporting evidence |
| Medium | Probable cause identified but needs verification |
| Low | Hypothesis formed but insufficient evidence |
| Inconclusive | Unable to determine from available information |

Overview

This skill traces data through transformation pipelines to locate where values become incorrect, lost, or unexpectedly changed. It focuses on inputs, mapping steps, type coercion, and null propagation to produce actionable findings. Results include confidence-rated hypotheses and recommended fixes for the most likely root causes.

How this skill works

The skill inspects each stage of a dataflow: input validation, transformation chain, type conversions, and downstream consumers. It checks boundary conditions, implicit assumptions, and missing guards, then compiles a concise report with confidence ratings (High, Medium, Low, Inconclusive). The output highlights steps where data shape, type, or nullability diverged from expectations and suggests targeted remediation.

When to use it

  • Debugging incorrect values after a pipeline change or deployment
  • Investigating intermittent failures due to boundary or edge cases
  • Auditing pipelines for unsafe type conversions or precision loss
  • Confirming where null/undefined values originate and propagate
  • Validating that mapping functions cover all input variants

Best practices

  • Start from the entry point and trace forward through every transformation step
  • Record data shape and types at stage boundaries to spot drift or lossy steps
  • Check and enforce explicit validation for optional and nullable fields
  • Prefer explicit type conversions and coercion checks over implicit behavior
  • Assign conservative confidence to hypotheses and gather evidence before fixing

Example use cases

  • Find where an integer unexpectedly becomes a float or string during ETL
  • Locate the transformation that drops optional metadata fields
  • Trace a null value back to the missing default assignment in an upstream service
  • Reveal order-dependent mappings that produce inconsistent output across environments
  • Detect encoding mismatches causing corrupted string fields after a transfer

FAQ

What evidence supports a High confidence rating?

High confidence requires direct observations showing the data state before and after a specific step and matching transformation logic that explains the change.

How do I handle cases with insufficient logs or traces?

Mark findings as Low or Inconclusive, add targeted instrumentation at suspected boundaries, and re-run traces to collect the missing evidence.