Documentation
AI Agents
Point coding agents at version-matched micro-rq docs bundled in node_modules.
AI coding agents
micro-rq ships version-matched agent docs inside the npm package.
When an app installs micro-rq, those docs are available at node_modules/micro-rq/dist/docs/ after installation.
Point coding agents at those local docs so they use the installed package version instead of stale training data or guessed APIs.
Key points
- Works with agents that read
AGENTS.mdinstructions. - Keeps API guidance tied to the installed
micro-rqversion. - Avoids generated hooks, wrapper APIs, or options that are not part of
micro-rq.
Bundled docs path
The package build copies agent-focused docs into dist/docs.
After installing the package, agents should read from the installed dependency path in the consuming project.
1node_modules/micro-rq/dist/docs/2 index.md3 create-micro-api.md4 create-token-provider.md5 resources.md6 tanstack-query.md7 errors.mdAGENTS.md block
Run the CLI command from your project root to add the managed block automatically.
The command creates AGENTS.md when it does not exist, updates the existing micro-rq block when it does, and avoids adding duplicates.
1npx micro-rq agents initManual AGENTS.md block
If you prefer to edit AGENTS.md yourself, add this managed block to the root AGENTS.md file in projects that use micro-rq.
Keep project-specific instructions outside the begin and end markers so this block can be updated later without overwriting local rules.
1<!-- BEGIN:micro-rq-agent-rules -->2 3# micro-rq: ALWAYS read docs before coding4 5Before any micro-rq work, find and read the relevant doc in `node_modules/micro-rq/dist/docs/`. The installed package docs are the source of truth for this project's micro-rq version.6 7Use micro-rq to define REST resources once and pass generated query/mutation configs directly to TanStack Query. Do not wrap TanStack Query, generate hooks, or invent APIs that are not documented in the bundled docs.8 9<!-- END:micro-rq-agent-rules -->How agents should use it
Before editing any micro-rq API client, resource, auth, query, mutation, invalidation, or error-handling code, read the relevant local doc file.
Use index.md first when the task is broad. Use the focused files when the task names a specific feature.
- `create-micro-api.md`
- API clients, shared config,
extend, headers, and error observation. - `resources.md`
- Resource definitions, endpoint variables, request mappers, and query keys.
- `tanstack-query.md`
useQuery,useMutation, prefetching, invalidation, and direct calls.- `create-token-provider.md`
- Access tokens, refresh tokens, retry behavior, and auth modes.
- `errors.md`
MicroApiError,MicroAuthRequiredError, and error handling.