systematic-debugging-hivemind
Skill51 starsChanged 7 months agoMITView on GitHub
This skill provides the systematic debugging methodology specifically adapted for the HiveMind v3.0 Relational Cognitive Engine. It instructs agents on HOW to debug using HiveMind-specific commands and hooks. This skill DOES NOT execute code. It instructs the Agent on WHICH Commands to use and in WHAT sequence. Activate this skill when: - Test failures occur (npm test fails) - LSP diagnostics publish errors - Runtime errors in production - Unexpected behavior in hooks or commands Step 1.1: Capture the Failure…
In this repository17 other files it gives its agents.
- .github/copilot-instructions.mdCopilot instructions
- .github/get-shit-done/templates/copilot-instructions.mdCopilot instructions
- context-first-gatekeepingSkill
- debug-orchestrationSkill
- delegation-intelligenceSkill
- hivefiver-bilingual-tutorSkill
- hivefiver-domain-pack-routerSkill
- hivefiver-gsd-compatSkill
- hivefiver-mcp-research-loopSkill
- hivefiver-persona-routingSkill
- hivefiver-ralph-taskingSkill
- hivefiver-skill-auditorSkill
- hivefiver-spec-distillationSkill
- hivemind-architect-strategistSkill
- hivemind-governanceSkill
- parallel-debugging-hivemindSkill
- sequential-orchestrationSkill
The file
We split this skill into the rules it gives an agent
7 rules. About 0 are common, 3 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 18
Test failures occur (npm test fails)
- Very specific: line 72
Use grep to find all references
- Very specific: line 116
When debugging hooks (src/hooks/*.ts):
- Very specific: line 138
When debugging commands (bin/hivemind-tools.cjs):
- Distinctive: line 157
When debugging state management:
- Distinctive: line 176
When debugging test failures:
- Distinctive: line 203
If you catch yourself thinking:
≈ “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.
Files
Skill: systematic-debugging-hivemind
Overview
This skill provides the systematic debugging methodology specifically adapted for the HiveMind v3.0 Relational Cognitive Engine. It instructs agents on HOW to debug using HiveMind-specific commands and hooks.
Core Principle
NO FIXES WITHOUT ROOT CAUSE INVESTIGATION FIRSTThis skill DOES NOT execute code. It instructs the Agent on WHICH Commands to use and in WHAT sequence.
When to Use
Activate this skill when:
- Test failures occur (
npm testfails) - LSP diagnostics publish errors
- Runtime errors in production
- Unexpected behavior in hooks or commands
The Debugging Phases
Phase 1: Evidence Gathering (Command: read, glob, grep)
Step 1.1: Capture the Failure Signal
// Use hivemind_session to establish debug context
hivemind_session({
action: "start",
mode: "quick_fix",
focus: "Debug [specific error]"
})Step 1.2: Read the Error Output
- For test failures: Run
npm testand capture full output - For LSP errors: Read the diagnostic file
- For runtime errors: Capture stack trace
Step 1.3: Identify the Scope
// Determine affected files via grep
grep({ include: "*.ts", pattern: "<error_keyword>" })Phase 2: Root Cause Investigation (Command: scan_hierarchy, recall_mems)
Step 2.1: Check for Known Solutions
// Recall from memory
hivemind_memory({
action: "recall",
query: "[error pattern]",
shelf: "solutions"
})
// Check anchors
hivemind_anchor({ action: "list" })Step 2.2: Analyze Context Drift
// Check if debugging is compromised by stale context
hivemind_inspect({ action: "drift" })Step 2.3: Trace the Data Flow
- Identify where the bad value originates
- Trace up the call stack to find source
- Use
grepto find all references
Phase 3: Hypothesis Formation (Agent Reasoning)
Step 3.1: State the Hypothesis
"I believe [X] is the root cause because [Y evidence]"Step 3.2: Isolate the Problem
- Create minimal reproduction
- Test in isolation
Phase 4: Verification & Fix (Command: write, bash)
Step 4.1: Create Failing Test First
npm test -- --grep "<test_name>"Step 4.2: Apply Minimal Fix
- ONE change at a time
- No "while I'm here" improvements
Step 4.3: Verify
npm test
npx tsc --noEmitStep 4.4: Save to Memory
hivemind_memory({
action: "save",
shelf: "solutions",
content: "Root cause: [X], Fix: [Y]",
tags: "debug,bugfix,[category]"
})HiveMind-Specific Debugging Patterns
Pattern 1: Hook Debugging
When debugging hooks (src/hooks/*.ts):
- Check Hook Registration
// Read the hook index
read({ filePath: "src/hooks/index.ts" })- Verify Event Binding
// Look for the hook registration pattern
grep({ include: "*.ts", pattern: "experimental\\..*\\.transform" })- Test with Minimal Input
# Trigger the hook manually
node bin/hivemind-tools.cjs session trace <timestamp>Pattern 2: Command Debugging
When debugging commands (bin/hivemind-tools.cjs):
- Verify Command Exists
ls bin/- Check Command Implementation
read({ filePath: "src/lib/[command].ts" })- Test Command in Isolation
node bin/hivemind-tools.cjs [command] --helpPattern 3: Session/State Debugging
When debugging state management:
- Inspect Current State
hivemind_inspect({ action: "scan" })- Check Hierarchy Integrity
scan_hierarchy({ action: "status" })- Review Recent Memory
hivemind_memory({ action: "recall", limit: 10 })Pattern 4: Test Suite Debugging
When debugging test failures:
- Run Single Test
npm test -- --grep "<test_name>"- Run in Watch Mode
npm test -- --watch- Check Test File Structure
glob({ pattern: "tests/**/*.test.ts" })Pre-Flight Checklist (BEFORE Output)
- Did I call
hivemind_session({ action: "start" })first? - Did I gather evidence before proposing fixes?
- Did I check memory for known solutions?
- Did I verify the hypothesis with minimal test?
- Did I save the solution to memory?
Red Flags - STOP
If you catch yourself thinking:
- "Quick fix for now, investigate later"
- "Just try changing X and see if it works"
- "I think X is probably the cause"
ALL of these mean: STOP. Return to Phase 1.
Related Skills
parallel-debugging-hivemind: For concurrent hypothesis testingdebug-orchestration: For orchestrating multiple debug agentshivemind-governance: For maintaining context during long debug sessionsevidence-discipline: For verification requirements
File References
- Hook patterns:
src/hooks/*.ts - Command patterns:
bin/hivemind-tools.cjs,src/lib/*.ts - State patterns:
.hivemind/state/,graph/*.json - Test patterns:
tests/**/*.test.ts
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
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.

