mongo-failure-investigator
Investigates MongoDB test failures from a local log file (./tests.log).
Skill by enricogolfieri
Chalk Labs
Need help deploying mongo-failure-investigator?
Chalk Labs sets up agents like this inside real teams: connected to your tools, tested on your data, with a human in the loop where it matters.
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/enricogolfieri-mongo-failure-investigator
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: testing, writing
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/mongo-failure-investigator
What's inside
- Skill name
mongo-failure-investigator- Description
- Investigates MongoDB test failures from a local log file (./tests.log). Use this skill whenever the user says "investigate the test failure", "why did the test fail", "investigate the logs", "look at what failed", or anything pointing to a test failure that needs root cause analysis. Do not wait for an explicit request — if the user mentions a test failure and ./tests.log is present, invoke this skill immediately. This skill has two phases: Phase 1 is investigation (root cause + code pointers), Phase 2 is writing a repro — and Phase 2 only happens if the user explicitly agrees with the Phase 1 hypothesis.
- License
- Unlicense
- Instructions
- 129 lines in SKILL.md · view on GitHub
Files (1)
- SKILL.md
SKILL.md (first lines)
# MongoDB Test Failure Investigator
Test logs are large. Never read `./tests.log` whole — always use targeted grep
to extract only the relevant signal.
---
## Phase 1: Investigation
### Step 1 — Triage the log
Grep `./tests.log` with this pattern to surface all failure-relevant lines:
```
Task completed - FAILURE|failed to load|invariant|fassert|invalid access|BACKTRACE|\d+ threads? with tid|checkReplicatedDataHa|Tripwire assertion
```
Use at least 30 lines of context around each match (`-C 30`).
This gives you:
- The failure type and message
- Stack frames surrounding a crash
- The test name embedded in the log prefix `[js_test:<name>]`
Also scan near the top of the log for the resmoke invocation line:
```
resmoke.py run ... jstests/path/to/test.js
```
That gives you the exact file path of the test being run.
**Important**: if you see both `fassert`/`BACKTRACE` and `failed to load` for the
same test, the `failed to load` is a consequence of the crash — ignore it and
focus on the real failure.
### Step 2 — Read the failing test
From the resmoke invocation line, get the test file path and read it. You want to
understand:
- What the test is verifying
- The topology it sets up (standalone, replica set, sharded)
- The specific operations and assertions it exercises
### Step 3 — Failure-specific deep dive
Apply the strategy that matches the failure type from Step 1:
#### Crash — `fassert` / `invariant` / `BACKTRACE`
1. Extract the full backtrace from the log (all `#NN 0x... in ...` lines)
2. Skip the first ~10 frames (signal/stacktrace plumbing) — start from the first
`mongo::` application-code frame
3. Walk up the call chain from the `fassert`/`invariant` frame to understand which
function triggered it and what state it was checking
4. Read the relevant C++ source around the failing assertion
5. Pay particular attention to locking: `lockGlobal`, `DBLock`, `GlobalLock` in
the backtrace often indicate a lock-ordering violation or re-entrant locking issue
#### JS assertion failure
1. Find the JS stack trace in the log (distinct from any C++ backtrace)
2. Identify the exact `assert.*()` call that fired and its expected vs. actual values
3. Trace back through the test to understand what operation produced the unexpected result
4. Look at server-side log lines near the same timestamp for additional context
#### Timeout
1. Find what the test was waiting for when it timed out
2. Grep for `\d+ threads? with tid` — thread dumps often reveal deadlocked or stalled threads
3. Look at lock acquisition patterns in the log lines immediately preceding the timeout
4. Assess whether the operation was making any progress or was completely stuck
#### Data inconsistency — `checkReplicatedDataHa` / Tripwire
1. Identify which replica set members diverged
2. Look for replication lag signals or oplog gaps in the surrounding lines
3. Note the oplog operation that was being applied when divergence occurred
### Step 4 — Root cause summary
Present findings in this format — be specific, not verbose:
```
Failing test: jstests/path/to/test.js
Failure type: [crash | js assertion | timeout | data inconsistency]
Root cause: <1–3 sentences: what went wrong and why>
Key evidence: <2–3 most revealing log lines>
Code pointers: <file:line references to relevant source>
```
If the evidence is ambiguous, say so explicitly and describe what would
disambiguate it. Do not speculate beyond what the logs and code show.
Stop here. Phase 2 only begins if the user confirms they agree with the hypothesis.
---
## Phase 2: Repro (only when the user explicitly agrees with the Phase 1 hypothesis)
Create a minimal test that reproduces the failure:
**File**: `jstests/repro.js`
**Rules**:
- Spin up the topology that matches the failure: `ReplSetTest` for replication
issues, `ShardingTest` for sharding issues, `MongoRunner` for standalone
- Reproduce the specific failure with the smallest possible setup
- No extra assertions, no unrelated cleanup, no surrounding noise
- The test should fail when the bug is present (and ideally pass when it is fixed)
**Reference patterns**:
```js
// Replica set topology
import {ReplSetTest} from "jstests/libs/replsettest.js";
const rst = new ReplSetTest({nodes: 2});
rst.startSet();
rst.initiate();
// ... reproduce the failure ...
rst.stopSet();From enricogolfieri/workspace-mongo, Unlicense.
More from enricogolfieri/workspace-mongo
- 0.552score
trace-function
enricogolfieri
Statically trace what happens when a C++ function is called, including verified call edges, max-depth stack trace, and branch gates.
SkillBFreshness: B★ 1Claude Code +9 - 0.547score
ticket-implement
enricogolfieri
Implement an approved SERVER ticket plan: create branch, code+tests, validate, open a draft PR.
SkillBFreshness: B★ 1Claude Code +9 - 0.547score
ticket-plan
enricogolfieri
Start and plan a Jira ticket: load context, summarize scope, evaluate split, and produce an approved plan.
SkillBFreshness: B★ 1Claude Code +9 - 0.547score
ticket-resume
enricogolfieri
Resume a ticket from durable state and continue from its recorded phase.
SkillBFreshness: B★ 1Claude Code +9 - 0.547score
write-mongo-jstests
enricogolfieri
Write focused MongoDB jstests with explicit mocha cases, small mechanical topology helpers, purposeful comments, robust teardown, and correct ownership.
SkillBFreshness: B★ 1Claude Code +9 - 0.547score
ticket-analyse
enricogolfieri
Analyse PERF tickets and register each new experiment in state.json (patch, comparison links, notes paths).
SkillBFreshness: B★ 1Claude Code +9 - 0.547score
ticket-flush
enricogolfieri
Persist durable ticket session truth mid-chat: update state.json and create any memory files needed (context, session notes, experiment notes), indexed from…
SkillBFreshness: B★ 1Claude Code +9 - 0.544score
ticket-shared
enricogolfieri
Shared reference and state_memory.py for ticket-plan, ticket-implement, ticket-analyse, ticket-resume, and ticket-flush.
SkillBFreshness: B★ 1Claude Code +9 - 0.497score
mongo-pr-review
enricogolfieri
Performs deep pull request reviews by quickly explaining code changes and identifying potential bugs grouped by severity (critical, non-critical, nit).
SkillCFreshness: C★ 1Claude Code +9 - 0.497score
distributed-code-flow-diagrams
enricogolfieri
Generate scoped Mermaid diagrams for distributed code flows.
SkillCFreshness: C★ 1Claude Code +9 - 0.497score
extract-author-changes
enricogolfieri
Loads context for the current branch's PR-scope changes (merge-base to HEAD), including uncommitted edits, then confirms without summarizing.
SkillCFreshness: C★ 1Claude Code +9 - 0.497score
hot-bf-pings
enricogolfieri
Drafts Slack ping messages for hot Build Failures (BFs) from a Jira filter, listing the assignee, the SERVER dependency ticket, the GitHub PR, and a one-line…
SkillCFreshness: C★ 1Claude Code +9
Signals
- Stars
- 1
- Forks
- 0
- Open issues
- 0
- Last commit (this folder)
- Jun 15, 2026 (4 months ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- Unlicense
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from enricogolfieri
- 0.552score
trace-function
enricogolfieri
Statically trace what happens when a C++ function is called, including verified call edges, max-depth stack trace, and branch gates.
SkillBFreshness: B★ 1Claude Code +9 - 0.547score
ticket-resume
enricogolfieri
Resume a ticket from durable state and continue from its recorded phase.
SkillBFreshness: B★ 1Claude Code +9 - 0.547score
ticket-flush
enricogolfieri
Persist durable ticket session truth mid-chat: update state.json and create any memory files needed (context, session notes, experiment notes), indexed from…
SkillBFreshness: B★ 1Claude Code +9 - 0.547score
ticket-implement
enricogolfieri
Implement an approved SERVER ticket plan: create branch, code+tests, validate, open a draft PR.
SkillBFreshness: B★ 1Claude Code +9 - 0.547score
ticket-analyse
enricogolfieri
Analyse PERF tickets and register each new experiment in state.json (patch, comparison links, notes paths).
SkillBFreshness: B★ 1Claude Code +9 - 0.547score
ticket-plan
enricogolfieri
Start and plan a Jira ticket: load context, summarize scope, evaluate split, and produce an approved plan.
SkillBFreshness: B★ 1Claude Code +9
Done for you
Rather not set it up yourself?
Chalk Labs scopes, builds and runs agents for your team: the task audit, the eval harness, the integrations and the weekly ops report. Fixed scope, priced before we start.
See how we build AI agents →Read the case studies
Chalk Labs is a two-founder AI and growth studio. We build AI agents, CRMs and MVPs for Web3 and AI companies, and have shipped 50+ product and token launches.
- launches shipped
- 50+
- launches shipped
- media placements
- 500+
- media placements
- founders on every account
- 2
- founders on every account
Press we've placed: Forbes · CoinDesk · Decrypt · Cointelegraph · The Block
Rahil Jain, Co-founder, Chalk Labs. Ex-Goldman Sachs engineer. You talk to the person who builds it.
Get mongo-failure-investigator running in your business
Tell us what you want to automate. A founder replies within one working day with a plan, not a pitch deck.
Cite this page
mongo-failure-investigator skill. Agent Mart. https://agentmart.dev/skills/enricogolfieri-mongo-failure-investigator (last updated 2026-10-24)