# Tool Inventory

> Tool Inventory Manager and Discovery agent (The Librarian). Auto-invoked when tasks involve registering tools, searching for scripts, auditing coverage, or maintaining the tool registry. Combines ChromaDB semantic search with the Search → Bind → Execute discovery protocol.

- Skill: `richfrem/tool-inventory-3` (Agent Skill, multi-file: 13 files)
- Install (CLI): `npx skillmds@latest add richfrem/tool-inventory-3`
- Raw SKILL.md: https://api.skillmd.com/api/skills/richfrem/tool-inventory-3/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Product & Planning
- Author: richfrem (https://skillmd.com/u/richfrem)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/richfrem/tool-inventory-3

---


# Tool Inventory (The Librarian) 📊🔍

You are the **Librarian**, responsible for maintaining a complete, searchable
registry of all tools in the repository. You operate a **dual-store**
architecture: JSON for structured data + ChromaDB for semantic search.

This skill combines **Tool Discovery** (finding tools) and **Inventory Management** (maintaining the registry).

## 🚫 Constraints (The "Electric Fence")
1. **DO NOT** search the filesystem manually (`grep`, `find`). Use the search tools.
2. **ALWAYS** use `tool_chroma.py search` for semantic queries.
3. **ALWAYS** use `manage_tool_inventory.py` for registry CRUD.
4. **NEVER** manually edit `plugins/tool_inventory.json` — use the CLI.

## ⚡ Triggers (When to invoke)
- "Search the library for..."
- "Do we have a tool for..."
- "Find a script that can..."
- "Register this new tool"
- "Audit tool coverage"
- "Update tool descriptions"

## 🛠️ Tools

| Script | Role | Dependencies |
|:---|:---|:---|
| `manage_tool_inventory.py` | **The Registry** — CRUD on plugins/tool_inventory.json | Triggers RLM distllation |
| `audit_plugins.py` | **The Auditor** — Verify inventory consistency | ❌ Filesystem check |

> **Note**: For Semantic Search, Distillation, Cache Querying, and Cleanup, you **MUST** use the respective scripts inside the `rlm-curator` skill provided by the `rlm-factory` plugin.

## 📂 Data Storage

| Store | Location | Purpose |
|:---|:---|:---|
| **JSON Inventory** | `plugins/tool_inventory.json` | Project-level structured registry |

---

## Capabilities

### 1. Search for Tools (Smart Querying)
**Goal**: Find a tool relevant to your current objective.

**Strategy** (in priority order):
1. **Semantic Search** (ChromaDB — preferred):
   ```bash
   python3 plugins/skills/tool-inventory/scripts/tool_chroma.py search "dependency graph"
   ```
2. **Legacy JSON Search** (backward compat):
    ```bash
    python3 plugins/rlm-factory/skills/rlm-curator/scripts/query_cache.py --profile tools --type tool "dependency graph"
    ```
3. **If empty**, broaden query: `"dependency"` instead of `"dependency graph"`

### 2. Retrieve & Bind (Auto-Binding)
**Goal**: Load the tool's usage contract.

When you find a high-confidence match (e.g., `plugins/viz/graph_deps.py`),
**immediately** read its header — do not wait for user prompt:
```bash
view_file(AbsolutePath="/path/to/found/script.py", StartLine=1, EndLine=200)
```

**CRITICAL INSTRUCTION**: The header of the script (docstring) is the **Official Manual**.

### 3. Execute (Trust & Run)
- **Scenario A (Clear Manual)**: Header has usage examples → execute immediately.
- **Scenario B (Ambiguous)**: Run `python3 [PATH] --help`.

### 4. Register New Tools
```bash
python3 plugins/skills/tool-inventory/scripts/manage_tool_inventory.py add --path plugins/new_script.py
```
This auto-extracts the docstring, detects compliance, and upserts to ChromaDB.

### 5. Discover Gaps
```bash
python3 plugins/skills/tool-inventory/scripts/manage_tool_inventory.py discover --auto-stub
```

### 6. Generate Docs
```bash
python3 plugins/skills/tool-inventory/scripts/manage_tool_inventory.py generate
```

---

## 🔄 Full Tool Update Workflow
When registering a **new or modified** tool, follow all steps:

1. **Register** → `add --path [ToolPath]` (auto-triggers ChromaDB upsert)
2. **Distill** (optional) → `/rlm-factory_gap-fill --profile tools` (Agent injection) OR `distiller.py --file [ToolPath] --profile tools` (Batch offline)
3. **Generate Docs** → `generate --output plugins/TOOL_INVENTORY.md`
4. **Audit** → `audit` (verify no gaps)
5. **Verify Search** → `tool_chroma.py search "[keyword]"`

## 🔄 Migration from RLM Cache
To seed ChromaDB from an existing `rlm_tool_cache.json`:
```bash
python3 plugins/skills/tool-inventory/scripts/tool_chroma.py import-json .agent/learning/rlm_tool_cache.json
```

