# Agents

> Let your coding agent look up the right import, layout, and error codes for the version you use.

## Quick setup

Paste this into your agent to install from source, add the selection skill, and show future sessions where to find the documentation.

Prompt · set up KnotkitCopy prompt

```
Set up Knotkit in this project.

1. Follow https://knotkit.jkomyno.dev/getting-started.md#install-from-source to build and install the package. Use "bundler" or "nodenext" module resolution in TypeScript.
2. Run `npx skills add jkomyno/knotkit --skill knotkit-select` to install the skill that picks a module for a task.
3. Add this to AGENTS.md (or CLAUDE.md):

   Knotkit: pick a module from node_modules/knotkit/capabilities.json, then read node_modules/knotkit/<name>/README.md. Import from 'knotkit/<name>'; there is no root import. Create structures with the exported factory functions, branch on error.code, and pass seeds and orderings explicitly.

If something is unclear, read https://knotkit.jkomyno.dev/llms.txt.
```

## Read the docs as Markdown

| URL                      | Contents                                                                          |
| ------------------------ | --------------------------------------------------------------------------------- |
| `/llms.txt`              | Start here for the full, abridged, and topic-specific bundles.                    |
| `/llms-small.txt`        | Abridged documentation focused on usage, guides, and module pages.                |
| `/llms-full.txt`         | Full documentation, including the API reference.                                  |
| `/<page>.md`             | Any single page: `/modules/heap/` is `/modules/heap.md`.                          |
| `/_llms-txt/<group>.txt` | The module pages of one group, such as `collections.txt`. `/llms.txt` lists them. |

Every page also has a **Copy Markdown** control under its title, with a menu to open the Markdown twin, Claude, or ChatGPT.

## Install the skill

`knotkit-select` reads the capability index from your installed package. Ask your agent to merge several sorted feeds, for example, and the skill can look up the relevant exports and when to use them.

```bash
npx skills add jkomyno/knotkit --skill knotkit-select
```

The [`skills`](https://www.npmjs.com/package/skills) CLI needs Node.js 22.20 or later. Add `-g` to install for every project. Without the CLI, copy [`skills/knotkit-select`](https://github.com/jkomyno/knotkit/tree/main/skills/knotkit-select) into your agent’s skills directory.

## What ships in the package

An agent working offline finds the same facts in `node_modules/knotkit`:

* `capabilities.json`: for every module, what it solves, what it is not for, its exports, the rule for choosing each layout, and its error codes.
* `<name>/README.md`: usage, the full API with costs, and how the structure works.
* `<name>/knotkit.capability.json`: one module’s record.

## A standing instruction

For an `AGENTS.md` or `CLAUDE.md` without the skill:

```md
Knotkit: use node_modules/knotkit/capabilities.json or https://knotkit.jkomyno.dev/choosing.md to pick a module. Then
read its page at https://knotkit.jkomyno.dev/modules/<name>.md. Import from 'knotkit/<name>', create structures with
factories, branch on error.code, and pass seeds and orderings explicitly.
```

Each module page ends with a prompt specific to that module.
