agentsbestfriend 0.12.0 → 0.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,26 +1,30 @@
1
- # agentsbestfriend
1
+ # AgentsBestFriend (abf)
2
2
 
3
3
  Give your AI coding agents superpowers — a local [MCP](https://modelcontextprotocol.io/) server for fast, token-efficient code navigation, search & analysis.
4
4
 
5
- Works with **VS Code Copilot**, **Cursor**, **Claude Code/Desktop**, **Codex**, **Cline**, **Zed**, and any other MCP-compatible agent.
5
+ Works with **VS Code Copilot**, **Cursor**, **Claude Code/Desktop**, **Codex**, **Cline**, **Zed**, **Gemini CLI**, **Goose**, **OpenCode**, and any other MCP-compatible agent.
6
6
 
7
- ## What it does
7
+ ---
8
8
 
9
- AI agents waste tokens re-reading files and searching blindly. ABF gives them purpose-built tools that return exactly what they need:
9
+ ## Why?
10
10
 
11
- | Tool | Purpose |
11
+ AI coding agents waste tokens re-reading files and searching blindly. ABF gives them purpose-built tools that return exactly what they need — in compact, structured responses that preserve context.
12
+
13
+ ## Tools
14
+
15
+ | Tool | What it does |
12
16
  |---|---|
13
- | `abf_search` | Code search — exact (ripgrep), keyword-ranked, or semantic |
14
- | `abf_symbols` | Functions, classes, exports in a file (AST-based) |
15
- | `abf_chunk` | Smart file chunk by symbol name or line range |
16
- | `abf_project_overview` | Tech stack, structure, dependencies at a glance |
17
+ | `abf_search` | Code search — exact (ripgrep), keyword-ranked, or semantic (embedding-based) |
18
+ | `abf_symbols` | Functions, classes, exports in a file (AST-based for TS/JS, regex for Python) |
19
+ | `abf_chunk` | Smart file chunk by symbol name, chunk index, or file overview |
20
+ | `abf_project_overview` | Tech stack, folder structure, key dependencies at a glance |
17
21
  | `abf_dependencies` | Import graph — who imports what |
18
22
  | `abf_impact` | Find all usages of a symbol across the project |
19
- | `abf_git` | Commits, blame, diff (recent/staged/unstaged) |
20
- | `abf_file_summary` | Search LLM-generated file summaries |
21
- | `abf_conventions` | Detected naming & style conventions |
22
- | `abf_index` | Index status & rebuild |
23
- | `abf_ping` | Health check |
23
+ | `abf_git` | Git log, blame, diff (recent/staged/unstaged) |
24
+ | `abf_file_summary` | Full-text search across LLM-generated file summaries (FTS5, OR/AND mode) |
25
+ | `abf_conventions` | Detected naming, structure, and formatting conventions |
26
+ | `abf_index` | Index status, rebuild, incremental update, or trigger re-summarization |
27
+ | `abf_ping` | Health check — returns version and project root |
24
28
 
25
29
  ## Install
26
30
 
@@ -31,36 +35,34 @@ npm install -g agentsbestfriend
31
35
  ### Prerequisites
32
36
 
33
37
  - **Node.js** ≥ 20
34
- - **ripgrep** — `brew install ripgrep` / `apt install ripgrep`
38
+ - **ripgrep** — `brew install ripgrep` (macOS) / `apt install ripgrep` (Linux)
35
39
  - **git**
36
- - **Ollama** (optional, for summaries & semantic search) [ollama.com](https://ollama.com)
40
+ - **Ollama** (optional) for summaries & semantic search: [ollama.com](https://ollama.com)
37
41
 
38
42
  ## Quick Start
39
43
 
40
44
  ```bash
41
- # Initialize a project (indexes files, optionally installs MCP for your agents)
42
45
  abf init
43
-
44
- # Or initialize a specific path
45
- abf init /path/to/project
46
-
47
- # Check everything is working
48
- abf doctor
49
46
  ```
50
47
 
51
- During `abf init`, you'll be asked whether to install ABF as an MCP server for your coding agents. Pick the agents you use (Cursor, VS Code, Claude Code, etc.) and ABF handles the rest via [add-mcp](https://github.com/neondatabase/add-mcp).
48
+ `abf init` walks you through everything:
49
+
50
+ 1. **Indexes your project** — discovers and indexes all files via `git ls-files`
51
+ 2. **Generates LLM summaries & embeddings** (if Ollama is running) — with live `(12/80)` progress
52
+ 3. **Adds `.abf/` to `.gitignore`** — prompts before writing
53
+ 4. **Installs ABF as an MCP server** for your agents — you pick which agents (Cursor, VS Code, Claude Code, etc.) and whether to use `npx agentsbestfriend start` (always latest) or `abf start` (local install)
52
54
 
53
55
  ### Manual Agent Setup
54
56
 
55
- If you prefer to configure manually, add ABF as a stdio MCP server:
57
+ If you prefer to configure manually, add ABF as a stdio MCP server. Using `npx` is recommended — it always runs the latest published version without requiring a global install:
56
58
 
57
59
  **VS Code / GitHub Copilot** (`.vscode/mcp.json`):
58
60
  ```json
59
61
  {
60
62
  "servers": {
61
63
  "abf": {
62
- "command": "abf",
63
- "args": ["start"]
64
+ "command": "npx",
65
+ "args": ["agentsbestfriend", "start"]
64
66
  }
65
67
  }
66
68
  }
@@ -71,8 +73,8 @@ If you prefer to configure manually, add ABF as a stdio MCP server:
71
73
  {
72
74
  "mcpServers": {
73
75
  "abf": {
74
- "command": "abf",
75
- "args": ["start"]
76
+ "command": "npx",
77
+ "args": ["agentsbestfriend", "start"]
76
78
  }
77
79
  }
78
80
  }
@@ -83,51 +85,64 @@ If you prefer to configure manually, add ABF as a stdio MCP server:
83
85
  {
84
86
  "mcpServers": {
85
87
  "abf": {
86
- "command": "abf",
87
- "args": ["start"]
88
+ "command": "npx",
89
+ "args": ["agentsbestfriend", "start"]
88
90
  }
89
91
  }
90
92
  }
91
93
  ```
92
94
 
95
+ > Set `ABF_PROJECT_ROOT` in the `env` block if the agent does not pass its working directory automatically.
96
+
93
97
  ## CLI Commands
94
98
 
95
99
  ```
96
- abf start Start MCP server in stdio mode (used by agents)
97
- abf init [path] Initialize index & optionally install MCP for agents
98
- abf index [path] Re-index a project
99
- abf status [path] Show index status
100
- abf config Interactive configuration editor
101
- abf doctor System health checks (Node, ripgrep, git, Ollama)
102
- abf portal Interactive terminal dashboard
100
+ abf start Start MCP server in stdio mode (used by agents)
101
+ abf init [path] Index project, set up .gitignore entry, install MCP for agents
102
+ abf skill [path] Install or update the ABF workflow skill for your coding agents
103
+ abf index [path] Re-index a project (incremental by default)
104
+ abf status [path] Show index stats
105
+ abf config Interactive configuration editor
106
+ abf doctor Health checks (Node, ripgrep, git, Ollama)
107
+ abf portal Interactive TUI dashboard
103
108
  ```
104
109
 
105
110
  ## How It Works
106
111
 
107
- ABF maintains a lightweight SQLite index (`.abf/index.db`) per project containing:
108
-
109
- - **File metadata** — paths, hashes, languages, line counts
110
- - **Symbols** — functions, classes, interfaces, types extracted via AST (ts-morph for TS/JS, regex for Python & others)
111
- - **Imports** — dependency edges between files
112
- - **Summaries** — LLM-generated file descriptions (optional, via Ollama)
113
- - **Embeddings** — vectors for semantic search (optional, via Ollama)
112
+ ABF maintains a lightweight SQLite index (`.abf/index.db`) inside each project root. The index is built once and updated incrementally — only changed files are re-processed. A file watcher keeps it current as you edit.
114
113
 
115
- The index updates incrementally — only changed files are re-processed.
114
+ | Table | Contents |
115
+ |---|---|
116
+ | `files` | Paths, hashes, languages, line counts, LLM summaries |
117
+ | `symbols` | Functions, classes, interfaces, types (AST-extracted) |
118
+ | `imports` | Dependency edges between files |
119
+ | `embeddings` | Float32 vectors for semantic search (chunked for large files) |
120
+ | `file_chunks` | Smart chunks aligned to symbol boundaries |
121
+ | `files_fts` | FTS5 full-text index over summaries |
116
122
 
117
123
  ## Optional: LLM Enrichment
118
124
 
119
- With [Ollama](https://ollama.com) running locally, ABF can generate file summaries and embeddings for semantic search:
125
+ With [Ollama](https://ollama.com) running locally, ABF generates file summaries and embeddings:
120
126
 
121
127
  ```bash
122
- ollama pull qwen2.5-coder:1.5b # summaries
123
- ollama pull nomic-embed-text # embeddings
128
+ ollama pull qwen2.5-coder:1.5b # file summaries
129
+ ollama pull nomic-embed-text # embeddings / semantic search
124
130
  ```
125
131
 
126
- Without Ollama, all tools work normally semantic search falls back to keyword mode.
132
+ Both `abf init` and `abf portal Re-index` show live progress:
133
+
134
+ ```
135
+ ◆ Generating LLM summaries... (14/80)
136
+ ◆ Generating embeddings... (28/80)
137
+ ```
138
+
139
+ Large files are automatically split into chunks for embedding — no context-length errors.
140
+
141
+ Without Ollama, all tools still work normally. Semantic search falls back to keyword mode.
127
142
 
128
143
  ## Configuration
129
144
 
130
- Global config at `~/.abf/config.json`. Edit with `abf config` or `abf portal`.
145
+ Global config at `~/.abf/config.json`. Edit interactively with `abf config` or via `abf portal`.
131
146
 
132
147
  ```json
133
148
  {
@@ -142,7 +157,8 @@ Global config at `~/.abf/config.json`. Edit with `abf config` or `abf portal`.
142
157
  "indexing": {
143
158
  "autoWatch": true,
144
159
  "respectGitignore": true,
145
- "maxFileSizeKb": 512
160
+ "maxFileSizeKb": 512,
161
+ "excludedPatterns": ["*.min.js", "*.min.css", "*.map", "*.lock"]
146
162
  },
147
163
  "search": {
148
164
  "defaultMaxResults": 20
@@ -150,9 +166,50 @@ Global config at `~/.abf/config.json`. Edit with `abf config` or `abf portal`.
150
166
  }
151
167
  ```
152
168
 
169
+ ## Architecture
170
+
171
+ ```
172
+ AgentsBestFriend/
173
+ ├── packages/
174
+ │ ├── core/ Shared logic — DB, config, search, analysis, indexer, LLM
175
+ │ ├── server/ MCP server (11 tools)
176
+ │ └── cli/ Commander.js CLI + TUI portal
177
+ ├── turbo.json
178
+ └── package.json
179
+ ```
180
+
181
+ Built with Turborepo + pnpm workspaces. Core modules:
182
+
183
+ | Module | Purpose |
184
+ |---|---|
185
+ | `@abf/core/db` | Drizzle ORM + SQLite (WAL, FTS5) |
186
+ | `@abf/core/config` | Zod-validated config |
187
+ | `@abf/core/search` | ripgrep, keyword scorer, semantic (cosine similarity) |
188
+ | `@abf/core/analysis` | ts-morph AST, conventions detector, project overview |
189
+ | `@abf/core/indexer` | git ls-files discovery, incremental pipeline, file watcher |
190
+ | `@abf/core/llm` | Ollama client, summary & chunked embedding pipelines |
191
+ | `@abf/core/git` | Git CLI wrapper |
192
+
193
+ ## Development
194
+
195
+ ```bash
196
+ # Install dependencies
197
+ pnpm install
198
+
199
+ # Build all packages
200
+ pnpm build
201
+
202
+ # Watch mode
203
+ pnpm dev
204
+
205
+ # Type-check
206
+ pnpm type-check
207
+ ```
208
+
153
209
  ## Links
154
210
 
155
211
  - **GitHub**: [github.com/TheRealFloatDev/AgentsBestFriend](https://github.com/TheRealFloatDev/AgentsBestFriend)
212
+ - **npm**: [npmjs.com/package/agentsbestfriend](https://npmjs.com/package/agentsbestfriend)
156
213
  - **Issues**: [github.com/TheRealFloatDev/AgentsBestFriend/issues](https://github.com/TheRealFloatDev/AgentsBestFriend/issues)
157
214
  - **MCP Spec**: [modelcontextprotocol.io](https://modelcontextprotocol.io)
158
215
 
@@ -1,211 +1,173 @@
1
1
  ---
2
2
  name: abf
3
- description: "Use AgentsBestFriend (ABF) MCP tools for codebase navigation, search, and analysis instead of native file-reading tools. USE WHEN: exploring unfamiliar code, understanding architecture, searching across files, tracing imports/dependencies, analyzing change impact, reading large files, or needing project context. Prefer ABF tools over read_file, grep_search, semantic_search, and list_dir for multi-file workflows they return pre-structured, token-efficient results in a single call."
3
+ description: "MANDATORY: AgentsBestFriend (ABF) MCP tools are connected and MUST be used for ALL code navigation, search, and analysis. NEVER use read_file, grep_search, semantic_search, or list_dir for exploring code ABF tools are faster, return structured results, and use 50–80% fewer tokens. USE FOR: any file reading, code search, symbol lookup, dependency tracing, impact analysis, git history, or architecture questions. Load this skill IMMEDIATELY whenever working in a codebase."
4
4
  ---
5
5
 
6
- # AgentsBestFriend (ABF) — Codebase Navigation Skill
6
+ # AgentsBestFriend (ABF) — MANDATORY Code Navigation
7
7
 
8
- ABF is a local MCP server that provides AI-optimized tools for navigating, searching, and analyzing code repositories. These tools return structured, compact results that save 50–80% of tokens compared to manually reading files.
8
+ > **CRITICAL**: ABF MCP tools are available and MUST be your default for all code exploration.
9
+ > Using `read_file`, `grep_search`, or `list_dir` when ABF tools exist is **always wrong**.
9
10
 
10
- ## When to Use ABF Tools
11
-
12
- **Always prefer ABF tools when you need to:**
11
+ ---
13
12
 
14
- - Understand a project's structure or tech stack
15
- - Search for code across files (exact, keyword, or semantic)
16
- - Read specific functions or classes from large files
17
- - Trace imports, dependencies, or reverse dependencies
18
- - Assess the impact of changing a symbol
19
- - Get multi-file context around an entry point
13
+ ## ABSOLUTE RULES
20
14
 
21
- **Use native tools only when:**
15
+ 1. **NEVER call `read_file` to explore code** — use `abf_chunk` (by symbol) or `abf_symbols` first
16
+ 2. **NEVER call `grep_search`** — use `abf_search` (exact/keyword/semantic modes)
17
+ 3. **NEVER call `list_dir`** — use `abf_project_overview` or `abf_dependencies`
18
+ 4. **NEVER call `semantic_search`** — use `abf_search mode: "semantic"` or `abf_file_summary`
19
+ 5. **ALWAYS start a new codebase with `abf_project_overview`** — not by listing directories
20
+ 6. **ALWAYS use `abf_impact` before modifying a symbol** — never guess what depends on it
21
+ 7. **ALWAYS use `abf_conventions` before writing new code** — not by reading config files
22
22
 
23
- - Making edits to files (ABF is read-only)
24
- - Checking for lint/compile errors
25
- - Running terminal commands
26
- - The ABF MCP server is not connected
23
+ ---
27
24
 
28
- ## Decision Matrix
25
+ ## Quick Decision Reference
26
+
27
+ | What you want to do | CORRECT tool | WRONG approach |
28
+ | -------------------------------- | --------------------------- | -------------------------------------- |
29
+ | Understand the project | `abf_project_overview` | `list_dir` + reading package.json |
30
+ | Find a function/class definition | `abf_search` mode: exact | `grep_search` |
31
+ | Read a specific function | `abf_chunk` symbol: "name" | `read_file` entire file |
32
+ | See what a file exports | `abf_symbols` | `read_file` + manual scan |
33
+ | Find files about a topic | `abf_search` mode: keyword | multiple `semantic_search` calls |
34
+ | Trace what a file imports | `abf_dependencies` | `grep_search` for import statements |
35
+ | Who calls this function? | `abf_impact` symbol: "name" | `grep_search` with manual filtering |
36
+ | Understand project style | `abf_conventions` | reading eslint + tsconfig + prettier |
37
+ | Get context around a file | `abf_context_bundle` | 5–10 `read_file` + `abf_symbols` calls |
38
+ | Search file descriptions | `abf_file_summary` | no native equivalent |
39
+ | Git history / blame / diff | `abf_git` | `run_in_terminal` with git commands |
40
+ | Index status or rebuild | `abf_index` | nothing |
29
41
 
30
- | Task | ABF Tool | Instead of |
31
- | ------------------------------------------------- | ---------------------------- | ---------------------------------------------------------------------- |
32
- | Orient in a new project | `abf_project_overview` | Reading README + listing directories + checking package.json |
33
- | Find where something is defined | `abf_search` (exact mode) | `grep_search` |
34
- | Find files related to a concept | `abf_search` (keyword mode) | Multiple `semantic_search` + `grep_search` calls |
35
- | Read a specific function from a large file | `abf_chunk` with symbol name | `read_file` (which loads entire file or requires guessing line ranges) |
36
- | List all exports of a file | `abf_symbols` | `read_file` and scanning manually |
37
- | Understand what a file imports and who imports it | `abf_dependencies` | Multiple `grep_search` calls for import statements |
38
- | Get multi-file context around one entry point | `abf_context_bundle` | 5–10 calls to `read_file` + `abf_symbols` + `abf_dependencies` |
39
- | Find all usages of a function/class | `abf_impact` | `grep_search` with manual filtering |
40
- | Understand project conventions | `abf_conventions` | Reading multiple config files manually |
41
- | Search by file purpose/description | `abf_file_summary` | No native equivalent |
42
- | Check git history or blame | `abf_git` | `run_in_terminal` with git commands |
43
- | Persist notes / context across sessions | `abf_notes` | External files, comments, or memory tools |
42
+ ---
44
43
 
45
- ## Recommended Workflows
44
+ ## Workflows
46
45
 
47
- ### 1. First Contact with a Codebase
46
+ ### Starting work on any codebase
48
47
 
49
48
  ```
50
- 1. abf_project_overview architecture, tech stack, entry points
51
- 2. abf_conventions coding style, patterns, naming
52
- 3. abf_search (keyword: "main topic") find relevant files
49
+ 1. abf_project_overview ALWAYS first — architecture, stack, entry points
50
+ 2. abf_conventions style, patterns, naming before writing anything
51
+ 3. abf_search (keyword mode) find relevant files for the task
53
52
  ```
54
53
 
55
- ### 2. Understanding a Specific File
54
+ ### Reading code in a file
56
55
 
57
56
  ```
58
- 1. abf_symbols (file) see all exports/functions at a glance
59
- 2. abf_chunk (file, symbol: "name") read just the function you care about
60
- 3. abf_dependencies (file) → see what it imports and who imports it
57
+ 1. abf_symbols (file) see all exports/functions first
58
+ 2. abf_chunk (symbol: "name") read exactly the function you need
59
+ only use read_file if you need the ENTIRE file
61
60
  ```
62
61
 
63
- ### 3. Deep Dive into a Feature
62
+ ### Understanding a feature
64
63
 
65
64
  ```
66
- 1. abf_context_bundle (entry file, depth: 2, include: "smart")
67
- full source of entry + signatures of all dependencies in ONE call
68
- 2. If needed: abf_chunk to read specific dependency functions
65
+ abf_context_bundle (entry file, depth: 2)
66
+ full source of entry + signatures of all deps in ONE call
67
+ replaces 5–10 read_file calls
69
68
  ```
70
69
 
71
- ### 4. Change Impact Analysis
70
+ ### Before changing anything
72
71
 
73
72
  ```
74
- 1. abf_impact (symbol: "functionName") → all files and lines referencing it
75
- 2. abf_context_bundle (entry, focus_symbol: "functionName", reverse: true)
76
- → focused view of the function + its callers
73
+ abf_impact (symbol: "functionName")
74
+ ALL files and lines that reference it — never skip this
77
75
  ```
78
76
 
79
- ### 5. Searching for Code
77
+ ### Searching for code
80
78
 
81
79
  ```
82
- - Know the exact name? → abf_search mode: "exact"
83
- - Exploring a concept? → abf_search mode: "keyword"
84
- - Describe what you need? → abf_file_summary (searches LLM-generated descriptions)
85
- - Semantic similarity? → abf_search mode: "semantic" (requires Ollama)
80
+ Exact name known? → abf_search mode: "exact"
81
+ Exploring a concept? → abf_search mode: "keyword"
82
+ By file purpose? → abf_file_summary (searches LLM descriptions)
83
+ Semantic match? → abf_search mode: "semantic"
86
84
  ```
87
85
 
88
- ### 6. Cross-Session Memory
89
-
90
- ```
91
- 1. abf_notes action: "save" (title, content, tags) → persist decisions, context, TODOs
92
- 2. abf_notes action: "search" (query) → recall notes by keyword (FTS5)
93
- 3. abf_notes action: "list" (tag: "architecture") → browse notes by tag
94
- 4. abf_notes action: "update" / "delete" → maintain your notepad
95
- ```
86
+ ---
96
87
 
97
88
  ## Tool Reference
98
89
 
99
- ### abf_project_overview
100
-
101
- **When:** Starting work on a project, or when asked "what does this project do?"
102
- **Saves:** Reading README + package.json + listing directories manually (3–5 calls → 1)
90
+ ### `abf_project_overview`
103
91
 
104
- - Returns: tech stack, frameworks, entry points, directory structure, language distribution, architectural patterns
105
- - No index required — works immediately
92
+ Returns tech stack, frameworks, entry points, folder structure, language distribution, architectural patterns.
93
+ **Required params:** none
94
+ **Use it:** at the start of every new task in an unfamiliar codebase.
106
95
 
107
- ### abf_search
96
+ ### `abf_search`
108
97
 
109
- **When:** Looking for code, files, or patterns across the project
110
- **Saves:** Multiple grep_search or semantic_search calls
98
+ - `mode: "exact"` ripgrep regex, returns matching lines with context
99
+ - `mode: "keyword"` ranks every file by keyword density, best for exploration
100
+ - `mode: "semantic"` — embedding similarity (requires Ollama index)
101
+ - `path_filter` — narrow scope (e.g. `"src/**/*.ts"`)
111
102
 
112
- - `mode: "exact"` — ripgrep-powered, supports regex, returns matching lines with context
113
- - `mode: "keyword"` — scores every file by keyword density, best for exploration
114
- - `mode: "semantic"` — embedding similarity (requires Ollama + index with embeddings)
115
- - Use `path_filter` to narrow scope (e.g. `"src/**/*.ts"`)
103
+ ### `abf_chunk`
116
104
 
117
- ### abf_context_bundle
105
+ Read a specific function/class without loading the full file.
118
106
 
119
- **When:** You need to understand a file in the context of its dependencies
120
- **Saves:** 5–10 calls to read_file + abf_symbols + abf_dependencies (biggest saver)
107
+ - `symbol: "functionName"` returns the full body of that symbol
108
+ - No symbol returns a chunk map; then use `chunk_index` for a specific section
121
109
 
122
- - `include: "smart"` (default) — full source for entry, signatures for deps
123
- - `include: "signatures"` — compact type signatures only (minimal tokens)
124
- - `include: "full"` — full source code for all files up to depth
125
- - `focus_symbol` — only follows imports relevant to one function/class
126
- - `reverse: true` — also shows who imports this file
127
- - `depth: 0–4` — how far to follow the import graph
110
+ ### `abf_symbols`
128
111
 
129
- ### abf_chunk
112
+ All exports, functions, classes, interfaces in a file with line ranges.
113
+ Call this before `abf_chunk` to see what's available.
130
114
 
131
- **When:** You need to read a specific function/class from a file without loading the entire file
132
- **Saves:** read_file loading hundreds of irrelevant lines
115
+ ### `abf_context_bundle`
133
116
 
134
- - Call with `symbol: "functionName"` to get its full source code directly
135
- - Call without symbol first to get a chunk overview, then use `chunk_index` to retrieve specific sections
117
+ **Biggest token saver.** Returns entry file + signatures/source of all its imports in one call.
136
118
 
137
- ### abf_symbols
138
-
139
- **When:** You need to see what a file exports without reading its full content
140
- **Saves:** read_file + mentally parsing the file structure
141
-
142
- - Returns: function signatures, classes, interfaces, types, variables with line ranges
143
- - Shows export status (★ = exported) and nesting
144
-
145
- ### abf_dependencies
146
-
147
- **When:** Tracing what a file imports or finding who depends on it
148
- **Saves:** Multiple grep_search calls for import statements
149
-
150
- - Returns both imports and reverse dependencies (imported_by)
151
-
152
- ### abf_impact
153
-
154
- **When:** Assessing how widely a symbol is used before changing it
155
- **Saves:** grep_search + manual filtering of false positives
119
+ - `include: "smart"` (default) — full source for entry, signatures for deps
120
+ - `include: "full"` — full source for everything
121
+ - `focus_symbol` only follow imports relevant to one function
122
+ - `depth: 0–4` how far to follow the import graph
156
123
 
157
- - Returns all files and specific lines that reference the symbol
158
- - Classifies usage type (call, import, type reference, etc.)
124
+ ### `abf_dependencies`
159
125
 
160
- ### abf_file_summary
126
+ Returns both imports (what this file uses) and reverse dependencies (who imports this file).
161
127
 
162
- **When:** Searching by file purpose rather than exact code text
163
- **Saves:** No native equivalent — unique capability
128
+ ### `abf_impact`
164
129
 
165
- - Full-text search across LLM-generated file descriptions
166
- - Requires summaries to be generated first (`abf_index` action: summarize)
130
+ All files and specific lines that reference a symbol.
131
+ **Always call before modifying a function, class, or exported type.**
167
132
 
168
- ### abf_conventions
133
+ ### `abf_conventions`
169
134
 
170
- **When:** Understanding project style before making changes
171
- **Saves:** Reading eslint, tsconfig, prettier, and other config files manually
135
+ Detected naming patterns, design patterns, folder structure conventions — with confidence scores and examples.
172
136
 
173
- - Detects naming patterns, design patterns, folder structure conventions
174
- - Returns confidence scores and examples
137
+ ### `abf_file_summary`
175
138
 
176
- ### abf_git
139
+ Full-text search across LLM-generated file descriptions (FTS5/BM25 ranked).
140
+ Use when you want to find files by purpose, not by exact code text.
177
141
 
178
- **When:** Checking history, blame, or diffs
179
- **Saves:** Running git commands in terminal and parsing output
142
+ - `match_mode: "or"` (default) broader results
143
+ - `match_mode: "and"` stricter matching
180
144
 
181
- - Actions: log, file_history, blame, diff
182
- - Structured output ready for analysis
145
+ ### `abf_git`
183
146
 
184
- ### abf_index
147
+ Structured git output — no terminal needed.
185
148
 
186
- **When:** Managing the ABF index
149
+ - `action: "log"` recent commits
150
+ - `action: "file_history"` — commits touching a file
151
+ - `action: "blame"` — line-by-line authorship
152
+ - `action: "diff"` — staged, unstaged, or between commits
187
153
 
188
- - `status` — check index health
189
- - `rebuild` — full re-index
190
- - `update` — incremental update
191
- - `summarize` — generate LLM summaries (requires Ollama)
154
+ ### `abf_index`
192
155
 
193
- ### abf_ping
156
+ - `action: "status"` — index health and file count
157
+ - `action: "rebuild"` — full re-index
158
+ - `action: "update"` — incremental update
159
+ - `action: "summarize"` — generate LLM summaries (requires Ollama)
194
160
 
195
- **When:** Verifying ABF is running
161
+ ### `abf_ping`
196
162
 
197
- - Returns server version, project root, and status
163
+ Returns server version and project root. Use to verify ABF is connected.
198
164
 
199
- ### abf_notes
165
+ ---
200
166
 
201
- **When:** Persisting context, decisions, TODOs, or any information across agent sessions
202
- **Saves:** External scratch files, scattered comments, or relying on memory tools
167
+ ## When ABF Tools Are NOT Needed
203
168
 
204
- - `action: "save"`create a note with title, content, and optional comma-separated tags
205
- - `action: "get"` retrieve a note by ID or exact title
206
- - `action: "list"`browse all notes, optionally filtered by tag
207
- - `action: "search"`full-text search (FTS5 with BM25 ranking); supports AND/OR mode
208
- - `action: "update"`update title, content, or tags on an existing note by ID
209
- - `action: "delete"` — remove a note by ID
210
- - Stored in `.abf/notes.db` — survives re-indexing
211
- - Project-scoped: each project has its own notepad
169
+ - **Writing/editing files**ABF is read-only; use your normal edit tools
170
+ - **Running tests or build commands** use the terminal
171
+ - **Checking lint/type errors** use native diagnostic tools
172
+ - **ABF is not connected** fall back to native tools, then reconnect with `abf start`
173
+ - **ABF returned no useful result** if you already called the appropriate ABF tool and the output didn't answer your question (e.g. `abf_search` returned nothing, `abf_chunk` didn't find the symbol), fall back to native tools for that specific lookup. Do not skip ABF preemptively — only fall back _after_ ABF has been tried.