# Map instrument narrow

> Map instrument narrow is an open-source agent skill for developer tools. Guides an agent to map unfamiliar code and instrument it before proposing a root-cause fix. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.

- **Kind:** Skill
- **Pricing:** Open source
- **Platforms:** Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf, Goose
- **Website:** https://github.com/chrisalehman/bionic/tree/main/skills/map-instrument-narrow
- **Repository:** https://github.com/chrisalehman/bionic
- **GitHub stars:** 10
- **License:** MIT
- **Skill name:** map-instrument-narrow
- **Collection:** https://github.com/chrisalehman/bionic
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-12-03

## About

This skill sets a three-phase debugging method for an agent: first map the architecture of the system under investigation, including library internals and async boundaries, then add broad diagnostic logging at state boundaries, and finally narrow down to the single function that mutates state. The agent writes an artifact at each gate and is told not to write fix code until data names a culprit.

The mapping phase calls for parallel research on source code, git state, environment readiness and inherited claims from earlier notes or handoff documents. Instrumentation is treated as disposable and kept separate from any eventual fix, and the skill limits itself to a small number of test runs per phase.

When one confirmed cause points to a deeper or sibling cause, the skill describes a root-cause tree that is worked through as fresh sub-investigations, with a stopping rule at a fixed depth or when scope grows too large. It expects a test scenario that can be run repeatedly, a codebase the agent can read, and TypeScript or similar logging in its examples.

## When your agent uses it

> Use when debugging requires understanding unfamiliar system internals before instrumentation will be interpretable — especially async execution, third-party library code, state mutations with no obvious code path between cause and effect, prior failed fix attempts, OR any diagnostic friction in a canonical-sdlc run

## What it can access

From a static check of the files on GitHub; nothing was run.

- [Instructions only, no scripts](https://github.com/chrisalehman/bionic/tree/HEAD/skills/map-instrument-narrow)
- [License: MIT](https://github.com/chrisalehman/bionic/tree/HEAD/skills/map-instrument-narrow)

## Features

- **Three-phase debugging gates:** Requires a written architecture map, broad state capture and a targeted per-call narrowing before any fix is attempted.
- **Architecture mapping:** Directs research into call chains, async boundaries and state ownership across your code and third-party libraries.
- **Diagnostic logging guidance:** Shows where to place before and after probes at state boundaries and how to read the captured values.
- **Root-cause tree tracking:** Records each cause as a node with evidence and parent-child links so deeper or sibling causes are investigated separately.
- **Inherited claim verification:** Checks handoff notes and prior agent assertions against the current repository state before relying on them.

## Good for

- Find why a state value is correct at one point and wrong later in an async flow
- Debug a failing test where a previous fix attempt did not address the cause
- Trace a bug that runs through a third-party library's internal code
- Work out which function silently changes state between two known points

## Install

### Claude Code

Copy the skill folder to `~/.claude/skills/map-instrument-narrow` to use it in all your projects:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/chrisalehman/bionic.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/map-instrument-narrow &&
cp -R "$tmp/skills/map-instrument-narrow" ~/.claude/skills/map-instrument-narrow &&
rm -rf "$tmp"
```

For one project only, put the folder in `.claude/skills/map-instrument-narrow` inside it instead.

### Codex

Copy the skill folder to `~/.agents/skills/map-instrument-narrow` to use it in every repository:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/chrisalehman/bionic.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/map-instrument-narrow &&
cp -R "$tmp/skills/map-instrument-narrow" ~/.agents/skills/map-instrument-narrow &&
rm -rf "$tmp"
```

For one repository only, put the folder in `.agents/skills/map-instrument-narrow` inside it instead.

### Cursor

Copy the skill folder to `~/.cursor/skills/map-instrument-narrow` to use it in every project:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/chrisalehman/bionic.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/map-instrument-narrow &&
cp -R "$tmp/skills/map-instrument-narrow" ~/.cursor/skills/map-instrument-narrow &&
rm -rf "$tmp"
```

For one project only, put the folder in `.cursor/skills/map-instrument-narrow` inside it instead.

### Gemini CLI

Run in a terminal (add `--scope workspace` to install it for the current workspace only):

```sh
gemini skills install https://github.com/chrisalehman/bionic.git --path skills/map-instrument-narrow
```

Or copy the folder to `~/.gemini/skills/map-instrument-narrow` yourself.

### VS Code

For GitHub Copilot in VS Code, copy the skill folder to `~/.copilot/skills/map-instrument-narrow`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/chrisalehman/bionic.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/map-instrument-narrow &&
cp -R "$tmp/skills/map-instrument-narrow" ~/.copilot/skills/map-instrument-narrow &&
rm -rf "$tmp"
```

For one project only, put the folder in `.github/skills/map-instrument-narrow` inside it instead.

### Other agents

Get the folder:

```sh
git clone --depth 1 https://github.com/chrisalehman/bionic.git
```

Then copy `bionic/skills/map-instrument-narrow` into your agent's skills folder as `map-instrument-narrow`. Agents that support SKILL.md read one folder per skill.

## FAQ

### When does Map instrument narrow trigger?

It applies when debugging needs an understanding of unfamiliar internals before instrumentation is useful, especially with async code, third-party libraries, unexplained state changes, earlier failed fixes, or diagnostic friction in a canonical-sdlc run.

### Does Map instrument narrow write fixes for me?

No. It forbids fix code during mapping and instrumentation and allows it only after data names a single culprit.

### Should the diagnostic logging be kept?

No. The skill treats instrumentation as disposable and says it should be removed or committed separately from the fix, unless the user explicitly asks for it to ship.

### How many test runs does Map instrument narrow expect?

It describes one test run for the broad capture and one for the targeted narrowing, and suggests returning to the mapping phase if more than two runs are needed.

### How do I install Map instrument narrow in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/map-instrument-narrow to use it in all your projects, or to .claude/skills/map-instrument-narrow in one project.

### Does Map instrument narrow run scripts?

No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

### Which AI agents can use Map instrument narrow?

Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose. Each reads skills in the SKILL.md format from its own folder; the install steps on this page list them.

### What are the best alternatives to Map instrument narrow?

The closest alternatives to Map instrument narrow are Principle fix root causes, Debug hypothesis, Diagnostic reasoning, Diagnosing bugs and Agent architecture audit.

## Where this comes from

- Description: from the skill's own SKILL.md.

## Alternatives

- [Principle fix root causes](https://ai-powered.com/skills/principle-fix-root-causes): Principle fix root causes is an open-source agent skill for developer tools.
- [Debug hypothesis](https://ai-powered.com/skills/debug-hypothesis): Debug hypothesis is an open-source agent skill for developer tools.
- [Diagnostic reasoning](https://ai-powered.com/skills/diagnostic-reasoning): Diagnostic reasoning is an open-source agent skill for developer tools.
- [Diagnosing bugs](https://ai-powered.com/skills/diagnosing-bugs): Diagnosing bugs is an open-source agent skill for developer tools.
- [Agent architecture audit](https://ai-powered.com/skills/agent-architecture-audit): Agent architecture audit is an open-source agent skill for developer tools.
- [Agent introspection debugging](https://ai-powered.com/skills/agent-introspection-debugging): Agent introspection debugging is an open-source agent skill for developer tools.
- [Trace architecture](https://ai-powered.com/skills/trace-architecture): Trace architecture is an open-source agent skill for developer tools.
- [Debugging and error recovery](https://ai-powered.com/skills/debugging-and-error-recovery): Debugging and error recovery is an open-source agent skill for developer tools.

---
Source: https://ai-powered.com/skills/map-instrument-narrow
