Skip to content

Commit 70710df

Browse files
authored
Add recipe search and aclib_read tool (#15)
* Add recipe search and aclib_read tool * Point skill description to recipes and early loading * Add members and search to aclib_read
1 parent 0908781 commit 70710df

9 files changed

Lines changed: 1180 additions & 75 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,24 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
77

88
### Added
99
- Database paths with the extension .accda (Access add-in files) are accepted by all tools.
10+
- `aclib_find` also searches the recipes of the catalog (`_codelib/recipes`, title, English and German
11+
keywords, imports) and returns matching recipes before the modules; the best recipe comes with its text
12+
if at least two search words (one for a one-word query) are whole words of its title or keywords.
13+
- MCP tool `aclib_read`: read a file listed in the catalog (recipe, test, example, module) from the same
14+
source as `aclib_find`, without file access of the client. Modules are returned as documentation extract
15+
by default (header, public members with their comments, enums); `content="code"` returns the complete
16+
source.
17+
- `aclib_read` parameters `members` (code of single procedures with their comment block, also private
18+
ones; unknown names are reported with the member names of the file) and `search` (lines of one VBA file
19+
matching a regular expression, with line number and enclosing procedure).
20+
- `aclib_find` searches and returns the summaries of public members (catalog format version 2); catalogs
21+
in the previous format keep working.
22+
23+
### Changed
24+
- Skill `aclib-import`: recipes in discovery and usage (recipe, then examples/tests, then module
25+
documentation via `aclib_read`); ACLib modules are used as they are, a bug or a missing feature of
26+
general use is fixed in the module (after describing it to the user) instead of building code around it,
27+
and the change is sent back to the CodeLib.
1028

1129
## [0.2.0] - 2026-11-18
1230

‎README.md‎

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ Set them in the MCP server configuration, e.g.:
6161
|---|---|---|---|
6262
| `aclib_get_version` | `database_path` | no | add-in and API version |
6363
| `aclib_get_config` | `database_path`, `source?`, `repo?` | no | configured repositories, resulting source |
64-
| `aclib_find` | `database_path`, `query`, `source?`, `repo?`, `limit?` | no | matching catalog modules: path, description, dependencies, variants, tests/examples, public members |
64+
| `aclib_find` | `database_path`, `query`, `source?`, `repo?`, `limit?`, `overview?` | no | matching recipes (the best one with its text), then matching catalog modules: path, description, dependencies, variants, tests/examples, public members with summary |
65+
| `aclib_read` | `database_path`, `path`, `content?`, `members?`, `search?`, `source?`, `repo?` | no | text of a file listed in the catalog: recipe, test, example; for a module its documentation (`content=doc`, default) or the complete code (`content=code`); for VBA files the code of single procedures (`members`) or the lines matching a regular expression with line number and procedure (`search`) |
6566
| `aclib_list_installed` | `database_path` | no | ACLib modules in the database (from their `<codelib>` blocks) |
6667
| `aclib_resolve` | `database_path`, `files[]`, `mode?`, `tests?`, `examples?`, `source?`, `repo?` | no | files incl. dependencies, references, tests/examples, planned action, missing files |
6768
| `aclib_import` | same as `aclib_resolve` | yes (may overwrite) | imported/skipped files, missing dependencies, added/removed references, messages |
@@ -73,14 +74,16 @@ Set them in the MCP server configuration, e.g.:
7374
- `repo`: GitHub repository `owner/name[@branch]` (default `AccessCodeLib/AccessCodeLib@master`)
7475

7576
The read-only tools can be allowed permanently in the MCP client; `aclib_import` and `aclib_compile`
76-
should require approval.
77+
should require approval. `aclib_read` reads recipes, tests, examples and modules from the repository
78+
through the server, so the agent needs no file access to the local repository (no permission prompt per
79+
file); it reads only files listed in the catalog.
7780

7881
## Skill
7982

8083
[`skills/aclib-import/SKILL.md`](skills/aclib-import/SKILL.md) describes the workflow for agents
81-
(find modules in the ACLib catalog → check version → list installed → resolve → import after approval →
82-
compile). If the usage of a module is unclear, the skill points agents to its tests and examples listed in
83-
the catalog. For Claude Code, copy the
84+
(find recipes and modules in the ACLib catalog → check version → list installed → resolve → import after
85+
approval → compile). For the usage of a module the skill points agents to the recipes, examples and tests
86+
listed in the catalog and to the module documentation (`aclib_read`). For Claude Code, copy the
8487
folder `skills/aclib-import` to `~/.claude/skills/`.
8588

8689
## How it works

‎skills/aclib-import/SKILL.md‎

Lines changed: 50 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
name: aclib-import
3-
description: Import or update AccessCodeLib (ACLib) modules in a Microsoft Access database via the aclib-import MCP server (ACLib Import Wizard automation API). Use when the user wants to include or update an ACLib module (e.g. SqlTools, FilterStringBuilder, filter form, StringCollection), needs a module with a <codelib> block, wants dynamic SQL secured with ACLib data modules, asks which ACLib module solves a task (find or choose a module for X), or asks which ACLib modules are installed.
3+
description: Find, choose and import AccessCodeLib (ACLib) modules for a Microsoft Access database via the aclib-import MCP server. Load this skill as soon as ACLib might help with a task (e.g. filter or search forms, dynamic SQL criteria, text and collection helpers) - before planning the solution, choosing modules or asking the user which modules to use. ACLib recipes show which modules to combine for a task and how the authors mean them to be used; start with them. Also use it to import or update modules, read module documentation, tests or examples, and list installed modules.
44
---
55

66
# ACLib import via the aclib-import MCP server
@@ -22,7 +22,8 @@ Only the tools of the `aclib-import` MCP server are used.
2222
|---|---|---|
2323
| `aclib_get_version` | `database_path` | no |
2424
| `aclib_get_config` | `database_path`, `source?`, `repo?` | no |
25-
| `aclib_find` | `database_path`, `query`, `source?`, `repo?`, `limit?` | no |
25+
| `aclib_find` | `database_path`, `query`, `source?`, `repo?`, `limit?`, `overview?` | no |
26+
| `aclib_read` | `database_path`, `path`, `content?`, `members?`, `search?`, `source?`, `repo?` | no |
2627
| `aclib_list_installed` | `database_path` | no |
2728
| `aclib_resolve` | `database_path`, `files[]`, `mode?`, `tests?`, `examples?`, `source?`, `repo?` | no |
2829
| `aclib_import` | same as `aclib_resolve` | yes (may overwrite) |
@@ -38,21 +39,26 @@ Only the tools of the `aclib-import` MCP server are used.
3839

3940
## Catalog (finding modules)
4041
The repository contains a generated module catalog built from the `<codelib>` header blocks:
41-
- `_codelib/catalog/catalog.md`: one line per module, grouped by folder: path, kind, `[P]` (predeclared
42-
class), description, `uses` (direct dependencies), `same object name as` (variants). Small enough to
43-
read completely.
42+
- `_codelib/catalog/catalog.md`: recipes, then one line per module, grouped by folder: path, kind, `[P]`
43+
(predeclared class), description, `uses` (direct dependencies), `same object name as` (variants).
44+
Small enough to read completely.
4445
- `_codelib/catalog/catalog.json`: details per module: `path`, `name`, `kind`, `description`,
4546
`descriptionSource` (`tag`/`header`/`none`), `predeclaredId`, `uses`, `usesTransitive`, `usedBy`,
46-
`replaces`, `sameObjectName`, `references`, `tests`, `examples`, `executes`, `publicMembers`.
47-
Large file: never read it
48-
completely, search the entry by `"path": "<file>"` (e.g. Grep with about 80 lines of context).
47+
`replaces`, `sameObjectName`, `references`, `tests`, `examples`, `executes`, `publicMembers`
48+
(`signature`, `summary`); `recipes` (`path`, `title`, `keywords`, `imports`, `files`).
49+
Large file: never read it completely; use `aclib_find`.
50+
51+
Recipes (`_codelib/recipes/*.md`) are short task-oriented guides from the ACLib authors: which modules to
52+
import for a task, usage code, notes. They show how the modules are meant to be used together, e.g. a
53+
search form with filter controls or sorting a continuous form.
4954

5055
Searching (saves tokens): call `aclib_find` with several English synonyms of the task (the catalog is
51-
English and the match is literal text, not meaning; e.g. a "Suchformular" is `search filter criteria form`).
52-
Any word may match, modules with more matching words rank higher. It returns only matching modules with
53-
`uses`, `sameObjectName`, `tests`, `examples` and the matching `publicMembers`. If nothing matches (or with
54-
`overview=true`) it returns a compact list of all modules: choose by meaning from it. Never conclude that
55-
no suitable module exists from one unsuccessful search.
56+
English and the match is literal text, not meaning; e.g. a "Suchformular" is `search filter criteria form`;
57+
recipe keywords are also German). Any word may match, entries with more matching words rank higher. It
58+
returns matching recipes first (path, title, modules to import; the best one with its text) and then the
59+
matching modules with `uses`, `sameObjectName`, `tests`, `examples` and the matching `publicMembers`. If
60+
nothing matches (or with `overview=true`) it returns a compact list of all recipes and modules: choose by
61+
meaning from it. Never conclude that no suitable module exists from one unsuccessful search.
5662

5763
Catalog location (from `aclib_get_config`):
5864
- `localRepositoryPath` set: read `<localRepositoryPath>/_codelib/catalog/catalog.md` and `catalog.json`.
@@ -76,18 +82,25 @@ Selecting modules:
7682
- Request only the main module(s); dependencies are added by `aclib_resolve`.
7783
- If the catalog contains nothing suitable, say so. Do not invent modules or paths.
7884

79-
## Using a module (tests as usage reference)
80-
- If it is unclear how a module is meant to be used, read its tests and examples: they show typical
81-
calls, parameters and expected results. The catalog lists them per module (`tests`, `examples`
82-
in `catalog.json`); read them from the catalog location (local repository or GitHub raw).
83-
Reading does not require an import.
84-
- If the tests do not cover the intended use either, say so; do not guess the behaviour.
85+
## Using a module
86+
- Recipes, examples and tests describe how a module is meant to be used. Start with the recipe found by
87+
`aclib_find`, then the examples or tests of the module in question (`aclib_read`; the paths are listed
88+
per module in `tests`/`examples` and per recipe in `files`). Reading does not require an import.
89+
- For details of a module read its documentation (`aclib_read`, default: header, public members with
90+
their comments, enums).
91+
- For implementation details or a change of a module read its code with `aclib_read`: `members` returns
92+
single procedures (comment block and body, also private ones), `search` the matching lines of one file
93+
with line number and enclosing procedure, `content="code"` the complete file.
94+
ACLib modules are tested; reviewing other modules or the dependencies is not needed to use them.
95+
- `aclib_read` reads from the same source as `aclib_find` (no file access of the client needed) and only
96+
files listed in the catalog.
97+
- If neither covers the intended use, say so; do not guess the behaviour.
8598

8699
## Workflow
87100
0. **Discover (only if the user did not name the file paths):** search the catalog (`aclib_find`, see Catalog), then
88-
show the user a table of candidates: file, description, relevant public members, dependencies
89-
(`usesTransitive`), tests/examples. Recommend one with a short reason and wait for the user's choice.
90-
Mark candidates that are already installed (step 2).
101+
show the user a matching recipe (title, modules to import) and a table of candidates: file, description,
102+
relevant public members, dependencies (`usesTransitive`), tests/examples. Recommend one with a short
103+
reason and wait for the user's choice. Mark candidates that are already installed (step 2).
91104
1. **Check API:** `aclib_get_version`. On error: stop, see Troubleshooting.
92105
2. **Installed modules:** `aclib_list_installed`. Do not propose installed modules again as new imports.
93106
3. **Plan (read only):** `aclib_resolve` with the requested files and options.
@@ -106,9 +119,13 @@ Selecting modules:
106119
- `tests=true` imports AccUnit test classes; they need the AccUnit test environment in the database,
107120
otherwise the project will not compile (the dependency is not listed in `references`). Ask the user
108121
whether AccUnit is set up before importing tests.
109-
- ACLib modules may be edited in the project when needed. Keep such changes small and tell the user about
110-
them: they have to be sent back to the CodeLib by exporting with the ACLib Import Wizard (this skill and
111-
the MCP server do not export). Local edits that were not sent back are lost on an `overwrite`.
122+
- ACLib modules are used as they are. If a module has a bug or lacks something of general use (not
123+
project-specific), fix or extend the module instead of building code around it: describe the change
124+
to the user first, keep it small and in the style of the module. Project-specific code stays in the
125+
project.
126+
- A changed ACLib module has to be sent back to the CodeLib by exporting it with the ACLib Import
127+
Wizard (this skill and the MCP server do not export); otherwise the change is lost on the next
128+
`overwrite`.
112129
- Before an import with the action `overwrite` (also `mode=all`), point out that edits of the module in the
113130
project would be replaced and ask the user to send them back to the CodeLib first, or to confirm that
114131
nothing needs to be kept.
@@ -148,6 +165,14 @@ Selecting modules:
148165
- `aclib_get_version`: `version`, `api`.
149166
- `aclib_get_config`: `source`, `repository`, `localRepositoryPath`, `privateRepositoryPath`,
150167
`github{owner,repo,branch}`, `hasGitHubToken`, `importTestsDefault`.
168+
- `aclib_find`: `catalog`, `recipes[{path,kind="recipe",title,imports,text?,textError?}]` (only if a recipe matches;
169+
`text` for the best one), `total`, `shown`, `modules[{path,kind,description,descriptionSource,
170+
predeclaredId?,uses?,replaces?,sameObjectName?,tests?,examples?,publicMembers[{signature,summary?}],
171+
publicMembersTruncated?}]`, optional `overview[]`, `note`.
172+
- `aclib_read`: `path`, `content` (`doc` = documentation extract of a module, `full` = complete file,
173+
`members`/`search`/`members+search`), `source`, `text` (doc/full); with `members`:
174+
`members[{name,kind,line,text}]`, `notFound[]` and `availableMembers[]` for unknown names; with `search`:
175+
`matches[{line,text,member?}]`.
151176
- `aclib_list_installed`: `database`, `modules[{name,type,file}]`.
152177
- `aclib_resolve` file entry: `name`, `file`, `requestedPath`, `type` (module/class/form/report/package),
153178
`exists`, `action`, `description`, `license`, `replaces`, `dependencies`,

0 commit comments

Comments
 (0)