Skip to content

Cross-Workflow Analysis ​

Patterns, principles, and insights extracted from analyzing all documented workflows.

Universal Workflow Structure ​

Almost every workflow follows a four-phase pattern:

┌─────────────────┐
│    SCOPE/       │  Define boundaries, understand context
│    TRIAGE       │  What are we working with?
└────────┬────────┘
         ▼
┌─────────────────┐
│    ANALYZE/     │  Gather information, identify targets
│    SURVEY       │  What needs attention?
└────────┬────────┘
         ▼
┌─────────────────┐
│    ACT/         │  Do the work
│    IMPLEMENT    │  Execute the core task
└────────┬────────┘
         ▼
┌─────────────────┐
│    VERIFY/      │  Confirm success
│    DOCUMENT     │  Record what was done
└─────────────────┘

Workflow-Specific Names ​

WorkflowPhase 1Phase 2Phase 3Phase 4
Bug FixReproduceLocateFixVerify
Security AuditScopeSurveyDeep DiveReport
Code ReviewContextReadFeedbackConclude
Feature ImplUnderstandDesignImplementVerify
RE BinaryCollectAnalyzeSynthesizeVerify
MalwareTriageStaticDynamicDocument
SteganographyTriageAnalyzeExtractVerify
Code SynthesisCollectGenerateVerify (D×C)Iterate

The names change, the structure doesn't.

Principle 1: Triage Before Dive ​

Every workflow starts with understanding what you're working with:

WorkflowTriage Step
Bug FixReproduce the bug first
Security AuditDefine threat model and scope
PerformanceMeasure baseline, identify if actually slow
RE Binaryfile, xxd, magic bytes before disassembly
MalwareSafe environment, file identification
Code ReviewUnderstand PR context and goals
SteganographyFile type, size, metadata before analysis

Why: Prevents wasted effort on wrong target, establishes baseline, identifies constraints.

Principle 2: Multiple Evidence Sources ​

No workflow trusts a single source of information:

WorkflowMultiple Sources
Performance Regressiongit bisect + profiler + traces + benchmarks
Flaky TestsLogs + race detectors + CI patterns + timing analysis
Production DebuggingLogs + metrics + traces + recent changes
Security AuditAutomated scanners + manual review + threat model
Dead CodeStatic analysis + runtime tracing + coverage
Bug InvestigationReproduction + logs + debugger + git history

Why: Each source has blind spots. Cross-referencing catches what individual sources miss.

Principle 3: Hypothesis-Driven Iteration ​

Most workflows follow a hypothesis-test-refine loop:

Form hypothesis → Test hypothesis → Refine or reject → Repeat
WorkflowHypothesis Pattern
RE Binary"This looks like a header" → parse → validate
Bug Fix"The bug is in X" → add logging → confirm/reject
Performance"Y is the bottleneck" → profile → measure
Flaky Test"Race condition in Z" → add synchronization → rerun
Cryptanalysis"Using weak RNG" → check entropy → verify

Why: Directed search beats exhaustive search. Wrong hypotheses still provide information.

Principle 4: Coarse-to-Fine Refinement ​

Start broad, zoom in on areas of interest:

WorkflowCoarse → Fine
Code ReviewArchitecture → modules → functions → lines
Security AuditAttack surface → high-risk areas → specific vulns
RE BinaryFile structure → sections → fields → bytes
PerformanceSystem → service → function → line
Codebase OnboardingSurvey → trace key paths → deep dive on core

Why: Efficient use of attention. Don't spend time on unimportant areas.

Principle 5: Domain-Specific Tools Matter ​

Each workflow has specialized tools that dramatically improve effectiveness:

DomainKey Tools
Securitysemgrep, bandit, SAST scanners
Performanceperf, flame graphs, profilers
Flaky TestsThreadSanitizer, race detectors
RE BinaryGhidra, hex editors, binwalk
MalwareSandboxes, Cuckoo, YARA
Code QualityLinters, type checkers
CryptoConstant-time checkers

Why: Generic tools miss domain-specific patterns. The right tool for the job.

Principle 6: Verification at Boundaries ​

Check correctness at transition points:

WorkflowBoundary Checks
Bug FixTest after fix, regression test
MigrationBehavior unchanged after each step
Binding GenerationTest at FFI boundary
Cross-LanguageDifferential testing old vs new
Feature ImplTests at each phase

Why: Catch errors early. Smaller search space when something breaks.

Principle 7: Output Should Inform Action ​

Workflow outputs should tell you what to do, not just present data:

Bad OutputGood Output
"Performance data collected""Function X is 80% of time, optimize there"
"Security scan complete""SQL injection at line 45, parameterize query"
"Review done""Block: auth bypass in login(), Fix: add check"
"Analysis finished""Dead code: remove files A, B, C"

Why: The human/LLM shouldn't have to interpret raw data. Conclusions are the value.

Common Workflow Patterns ​

The Reproduction Pattern ​

Before fixing, prove you can trigger the problem:

  • Bug Fix: Reproduce bug locally
  • Flaky Test: Reproduce flakiness (even probabilistically)
  • Performance: Reproduce slowness with benchmark
  • Security: PoC the vulnerability

The Bisection Pattern ​

When something changed, find when:

  • Performance: git bisect to find slow commit
  • Bug: git bisect to find breaking commit
  • Flaky: git bisect to find when test became flaky

The Differential Pattern ​

Compare known-good with suspected-bad:

  • RE Binary: Compare similar files to find structure
  • Migration: Compare output of old vs new
  • Performance: Compare fast vs slow runs
  • Synthesis: Compare generated code vs reference

The Isolation Pattern ​

Reduce to minimal case:

  • Bug: Minimal reproducer
  • Flaky: Smallest test that flakes
  • Performance: Isolated benchmark
  • Security: Minimal PoC

Workflow Composition ​

Workflows naturally compose:

Sequential ​

Bug Report → Bug Investigation → Bug Fix → Code Review

Nested ​

Feature Implementation
├── Question Answering (understand existing code)
├── Security Audit (new auth feature)
├── Implementation
│   └── Bug Fix (when tests fail)
└── Code Review

Conditional ​

if tests_fail:
    spawn Bug Investigation
elif performance_regressed:
    spawn Performance Regression Hunting
elif security_relevant:
    spawn Security Audit

Anti-Patterns Across Workflows ​

Anti-PatternAppears InWhy Bad
Skip triageAllWaste time on wrong thing
Single evidence sourceInvestigationMiss blind spots
Fix before understandBug FixCreate new bugs
No baselinePerformanceCan't measure improvement
No reproductionBug Fix, FlakyCan't verify fix
Review without contextCode ReviewMiss intent
Audit without threat modelSecurityMiss what matters

LLM Assistance Patterns ​

Every workflow has LLM-specific techniques that share structure:

Investigation Prompt ​

Given [artifact], identify:
1. [Specific question]
2. [Specific question]

Generation Prompt ​

Generate [output] that:
1. [Constraint]
2. [Constraint]
Based on: [context]

Review Prompt ​

Review [artifact] for [concerns]:
Check: [categories]
Output: [format]

Failure Mode Prevention ​

Every workflow documents failures, but documentation alone is unreliable. Prevention hierarchy (most to least reliable):

MethodReliabilityExample
ToolingHighLinter catches pattern, CI blocks merge
Type systemHighInvalid states unrepresentable
TestsMedium-HighRegression test encodes invariant
ProcessMediumWorkflow step forces check
DocumentationLowRequires someone to read and remember

The failure mode tables (| Failure | Detection | Recovery |) are useful for:

  • Human pattern matching after failure occurs
  • Knowing what to do when tooling doesn't exist yet
  • Identifying what tooling to build

But the real fix is encoding the failure mode in tooling so it can't happen silently.

Open Questions ​

Workflow Selection ​

How to choose the right workflow for a task?

  • Intent classification?
  • Trigger matching?
  • Multiple workflows in parallel?

Workflow Learning ​

Can workflows improve from experience?

  • Track success/failure
  • Adjust phases based on patterns
  • Codebase-specific customization

Cross-Workflow State ​

How to share context between composed workflows?

  • Investigation findings → Bug Fix
  • Security Audit findings → Code Review priorities
  • Performance data → Refactoring targets

See Also ​