agentleFS
aemerson-commitsaemerson-commits/shareable-skills/skills/temporal-forensics/SKILL.md

temporal-forensics

Skill1 starsChanged 8 months agoMITView on GitHub

Team D diagnostic — temporal analysis for intermittent issues. Hunts race conditions, stale state, cache timing, and async ordering.

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:

    When the issue occurs vs when it doesn't (if known)

    line 16
  2. Distinctive:

    If no timing pattern found: escalate to Team E (might be a regression — something changed recently).

    line 97

≈ “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

Temporal Forensics (Team D)

For intermittent issues that come and go, or that seemed fixed but returned. The problem is timing-dependent — this team finds the timing.

When to Use

  • Directly: when the issue is intermittent or timing-related
  • Via router: /persistent-issue classifies as Category D

Input

  • Evidence Document from /persistent-issue
  • When the issue occurs vs when it doesn't (if known)

Agent Team (Fan-Out/Fan-In, all model: "opus")

Dispatch 3 agents simultaneously:

Agent 1: Race Condition Hunter

Search for race conditions and async ordering issues.

Evidence: [paste Evidence Document]

Check these patterns in the affected code:
1. **useEffect ordering**: Are multiple useEffects competing for the same state?
   - Check deps arrays — are they stable? (object/array refs change every render)
   - Is there a useEffect that sets state that triggers another useEffect?
2. **Concurrent fetches**: Are multiple API calls racing?
   - Check if responses can arrive out of order
   - Check if a slow response overwrites a fast one
3. **State updates during unmount**: Is a component setting state after unmounting?
   - Check for missing cleanup in useEffect return
4. **Cache read-after-write**: Is code reading cache immediately after writing?
   - Eventually consistent stores may return stale data after immediate writes
5. **API rate limits**: Are concurrent mutations exhausting budget?
   - Check for parallel mutations without rate limiting

Output: Specific race condition with timing diagram showing the failure path

Agent 2: Stale State Detective

Search for stale data, expired caches, and closure captures.

Evidence: [paste Evidence Document]

Check:
1. **Cache TTL**: Is the cache TTL too long? Too short?
   - Is the issue that data is correct in source but stale in cache?
2. **localStorage**: Is the app reading old localStorage data?
   - Column settings, tab preferences, toggles
   - Cross-reference saved values against current defaults
3. **React closures**: Is a callback capturing stale state?
   - Check useCallback deps — missing deps means stale closure
   - Check event handlers defined inside render without useCallback
4. **Sync lag**: Do background sync processes run at intervals?
   - Is the user expecting immediate updates that won't appear until next sync?
5. **Cache format mismatch**: Is code reading cache without proper deserialization?
   - Compressed cache keys read without decompression return garbage
6. **Browser cache**: Is the browser serving a stale JavaScript bundle?
   - Check if content hashing is working (filenames should have hashes)

Output: Specific stale state source + what triggers the staleness

Agent 3: Timing Profiler

Analyze timing correlations.

Evidence: [paste Evidence Document]

Check:
1. **Cron timing**: Does the issue correlate with scheduled task schedules?
   - Check all cron intervals and their UTC offsets
   - Account for DST changes (UTC-only schedules shift relative to local time)
2. **Deploy timing**: Did the issue appear right after a deploy?
   - Secret changes can unregister cron triggers in some platforms
   - Build artifacts might be stale (deployed from wrong directory?)
3. **Cache expiry window**: Does the issue appear at specific intervals?
   - Map intervals to known cache TTLs and sync frequencies
4. **User session timing**: Does it happen after being idle?
   - Auth token expiry
   - localStorage TTL checks

Output: Timing pattern identified + correlation with specific system event

Synthesis

Main agent merges timing findings: "The issue is intermittent because [timing condition]. It manifests when [trigger A] coincides with [state B]. The fix is [make the timing deterministic / extend TTL / add retry / fix the race]."

If no timing pattern found: escalate to Team E (might be a regression — something changed recently).

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.