agentsmesh 0.25.0 → 0.26.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/CHANGELOG.md +19 -0
- package/README.md +104 -457
- package/dist/canonical.js.map +1 -1
- package/dist/cli.js +249 -248
- package/dist/engine.js.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/targets.js.map +1 -1
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -6,64 +6,70 @@
|
|
|
6
6
|
|
|
7
7
|
[](https://github.com/sampleXbro/agentsmesh/actions/workflows/ci.yml)
|
|
8
8
|
[](https://www.npmjs.com/package/agentsmesh)
|
|
9
|
+
[](https://www.npmjs.com/package/agentsmesh)
|
|
9
10
|
[](https://codecov.io/gh/sampleXbro/agentsmesh)
|
|
10
|
-
[](LICENSE)
|
|
11
|
-
[](https://www.typescriptlang.org/)
|
|
12
11
|
[](https://nodejs.org/)
|
|
13
|
-
[](https://samplexbro.github.io/agentsmesh)
|
|
15
|
-
[](https://github.com/sampleXbro/agentsmesh/pulls)
|
|
12
|
+
[](LICENSE)
|
|
13
|
+
[](https://samplexbro.github.io/agentsmesh/)
|
|
16
14
|
|
|
17
15
|
</div>
|
|
18
16
|
|
|
19
|
-
Every AI coding assistant has its own
|
|
20
|
-
|
|
21
|
-
**AgentsMesh** fixes this. It is an open-source CLI and TypeScript library: write your rules, commands, agents, skills, MCP servers, hooks, ignore files, and permissions once in `.agentsmesh/`, run `agentsmesh generate`, and every tool gets its native config. `agentsmesh import` pulls existing tool configs back into the one source, and `agentsmesh check` catches drift in CI.
|
|
17
|
+
Every AI coding assistant has its own config format — `CLAUDE.md`, `AGENTS.md`, `.cursor/rules/*.mdc`, `.github/copilot-instructions.md`, and more. Keeping the same rules, prompts, MCP servers, hooks, and permissions in sync across all of them by hand is tedious, and they drift apart fast.
|
|
22
18
|
|
|
23
|
-
**
|
|
19
|
+
**AgentsMesh is one canonical source for all of it.** Write your rules, commands, agents, skills, MCP servers, hooks, ignore patterns, and permissions once in `.agentsmesh/`, run `agentsmesh generate`, and every tool gets its native config — with cross-file links automatically rebased to each tool's paths. `agentsmesh import` pulls existing configs back into the one source, `agentsmesh convert` migrates straight from one tool to another, and `agentsmesh check` fails CI when anything drifts.
|
|
24
20
|
|
|
25
|
-
|
|
21
|
+
**And your agents learn from your repo.** With [lessons](#teach-your-agents-lessons), an agent saves a short rule whenever something goes wrong — a failing test, a review comment, a wrong assumption — and recalls it automatically before it touches the same files again. One shared memory, read and written by every AI tool you use.
|
|
26
22
|
|
|
27
|
-
|
|
23
|
+
> [!NOTE]
|
|
24
|
+
> Full documentation, guides, and the per-tool reference live at **[samplexbro.github.io/agentsmesh](https://samplexbro.github.io/agentsmesh/)**.
|
|
28
25
|
|
|
29
26
|
## Install
|
|
30
27
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
### Homebrew (macOS / Linux) — no Node.js required
|
|
28
|
+
Every install method ships the same CLI (`agentsmesh`, plus the shorter `amsh` alias) and the same TypeScript library.
|
|
34
29
|
|
|
35
30
|
```bash
|
|
31
|
+
# Homebrew (macOS / Linux) — no Node.js required
|
|
36
32
|
brew tap samplexbro/agentsmesh
|
|
37
33
|
brew install agentsmesh
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
### Standalone binary (Linux / macOS / Windows) — no Node.js required
|
|
41
34
|
|
|
42
|
-
|
|
35
|
+
# Standalone binary (Linux / macOS / Windows) — no Node.js required
|
|
43
36
|
curl -fsSL https://github.com/sampleXbro/agentsmesh/releases/latest/download/install.sh | sh
|
|
37
|
+
|
|
38
|
+
# npm / pnpm / yarn — requires Node.js 20+
|
|
39
|
+
npm install -g agentsmesh # or: pnpm add -g agentsmesh / yarn global add agentsmesh
|
|
40
|
+
npm install -D agentsmesh # pin per-repo as a dev dependency (run with npx)
|
|
41
|
+
npx agentsmesh --help # run once without installing
|
|
44
42
|
```
|
|
45
43
|
|
|
46
|
-
|
|
44
|
+
Standalone binaries are also on [GitHub Releases](https://github.com/sampleXbro/agentsmesh/releases/latest). The Node install additionally exposes the [typed programmatic API](https://samplexbro.github.io/agentsmesh/reference/programmatic-api/).
|
|
47
45
|
|
|
48
|
-
|
|
46
|
+
## 60-second quickstart
|
|
47
|
+
|
|
48
|
+
Works on Linux, macOS, and Windows. After [installing](#install):
|
|
49
49
|
|
|
50
50
|
```bash
|
|
51
|
-
|
|
52
|
-
#
|
|
53
|
-
|
|
54
|
-
pnpm add -D agentsmesh # pnpm
|
|
55
|
-
yarn add -D agentsmesh # yarn
|
|
56
|
-
# or run once without installing:
|
|
57
|
-
npx agentsmesh --help
|
|
51
|
+
agentsmesh init # scaffold .agentsmesh/ + agentsmesh.yaml
|
|
52
|
+
agentsmesh generate # write native configs for every enabled tool
|
|
53
|
+
agentsmesh check # CI-friendly drift gate against .agentsmesh/.lock
|
|
58
54
|
```
|
|
59
55
|
|
|
60
|
-
|
|
56
|
+
On an interactive terminal, **`init` runs a short wizard** — nothing is written until you finish, so `Ctrl-C` cancels cleanly:
|
|
57
|
+
|
|
58
|
+
1. **Targets** — multi-select which tools to generate for (recommended ones first; nothing is pre-selected).
|
|
59
|
+
2. **Import** — if it detects existing configs (`.cursor/`, `.claude/`, `.github/copilot-instructions.md`, …), it offers to import them all into `.agentsmesh/`.
|
|
60
|
+
3. **Lessons** — enable the shared agent memory (default **yes**).
|
|
61
|
+
4. **Generate** — optionally run `generate` right away.
|
|
61
62
|
|
|
62
|
-
|
|
63
|
+
`--global` runs the same wizard for user-level config (global-capable targets only, no Lessons step). Pass `--yes`, `--json`, or run in a non-TTY/CI shell to skip the wizard and keep the scripted behavior. `init` also seeds the [self-serve MCP server](#why-developers-use-agentsmesh) into `mcp.json`.
|
|
64
|
+
|
|
65
|
+
- **`generate`** writes `CLAUDE.md`, `AGENTS.md`, `.cursor/`, `.github/copilot-instructions.md`, and the rest — rewriting canonical file references to each tool's native paths so cross-file links keep working.
|
|
66
|
+
- **`check`** exits non-zero when generated files drift from `.agentsmesh/.lock` — drop it into CI.
|
|
67
|
+
|
|
68
|
+
Skipped lessons during setup? Add them later (on a fresh or existing repo) with `agentsmesh init --lessons`. Installed as a dev dependency? Prefix each command with `npx`.
|
|
63
69
|
|
|
64
70
|
## Before / After
|
|
65
71
|
|
|
66
|
-
**Before — fragmented assistant-native config in one repo:**
|
|
72
|
+
**Before — fragmented, assistant-native config in one repo:**
|
|
67
73
|
|
|
68
74
|
```text
|
|
69
75
|
CLAUDE.md
|
|
@@ -80,134 +86,85 @@ AGENTS.md
|
|
|
80
86
|
|
|
81
87
|
```text
|
|
82
88
|
.agentsmesh/
|
|
83
|
-
rules/
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
lessons/
|
|
93
|
-
lessons.json
|
|
94
|
-
```
|
|
95
|
-
|
|
96
|
-
```bash
|
|
97
|
-
agentsmesh generate
|
|
89
|
+
rules/_root.md # the root rule every tool projects
|
|
90
|
+
commands/ # reusable slash-style prompts
|
|
91
|
+
agents/ # agent definitions
|
|
92
|
+
skills/ # composable skills (+ supporting files)
|
|
93
|
+
mcp.json # MCP server definitions
|
|
94
|
+
hooks.yaml # pre/post tool hooks
|
|
95
|
+
permissions.yaml # allow/deny rules
|
|
96
|
+
ignore # paths the assistant must not touch
|
|
97
|
+
lessons/ # optional recall/capture memory
|
|
98
98
|
```
|
|
99
99
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
---
|
|
103
|
-
|
|
104
|
-
## 60-second quickstart
|
|
105
|
-
|
|
106
|
-
Works on Linux, macOS, and Windows. Install via [Homebrew, a standalone binary, or any Node.js package manager](#install), then:
|
|
107
|
-
|
|
108
|
-
```bash
|
|
109
|
-
agentsmesh init # scaffold .agentsmesh/ + agentsmesh.yaml
|
|
110
|
-
agentsmesh generate # produce native configs for every enabled tool
|
|
111
|
-
agentsmesh check # CI-friendly drift gate against .agentsmesh/.lock
|
|
112
|
-
```
|
|
113
|
-
|
|
114
|
-
- **`init`** — creates `agentsmesh.yaml`, `agentsmesh.local.yaml`, and the canonical `.agentsmesh/` directory.
|
|
115
|
-
- **`generate`** — writes `CLAUDE.md`, `AGENTS.md`, `.cursor/`, `.github/copilot-instructions.md`, etc. from canonical sources.
|
|
116
|
-
- **`check`** — exits non-zero if generated files have drifted from `.agentsmesh/.lock`. Drop into CI.
|
|
117
|
-
|
|
118
|
-
Want your agents to learn from this repo too? Add the optional lessons memory:
|
|
119
|
-
|
|
120
|
-
```bash
|
|
121
|
-
agentsmesh init --lessons # adds a shared memory: recall before edits, capture after failures
|
|
122
|
-
```
|
|
123
|
-
|
|
124
|
-
See [Teach your agents: lessons](#teach-your-agents-lessons) just below for how it works.
|
|
125
|
-
|
|
126
|
-
If you installed via `npm install -D agentsmesh` (also `pnpm add -D` / `yarn add -D`), prefix each command with `npx`. The CLI ships as both `agentsmesh` and the shorter alias `amsh`.
|
|
127
|
-
|
|
128
|
-
---
|
|
100
|
+
Edit canonical sources, run `agentsmesh generate`, and every native file above is (re)written for you — always in sync. Alongside the directory, `agentsmesh.yaml` selects which targets and features are enabled, `agentsmesh.local.yaml` holds per-developer overrides (gitignored), and `.agentsmesh/.lock` records the checksums that `agentsmesh check` enforces.
|
|
129
101
|
|
|
130
102
|
## Teach your agents: lessons
|
|
131
103
|
|
|
132
|
-
Lessons give your AI
|
|
133
|
-
|
|
134
|
-
The memory is one git-tracked file: `.agentsmesh/lessons/lessons.json`. Every agent — Claude Code, Cursor, Codex CLI, Copilot, and the rest — reads and writes the *same* file through two commands:
|
|
104
|
+
Lessons give your AI agents a **memory of past mistakes** — read *before* they touch anything, written *after* something goes wrong, so the same mistake doesn't happen twice in any tool.
|
|
135
105
|
|
|
136
|
-
|
|
137
|
-
- **Capture** — right after a failure (a red test, a lint error, a review comment, a wrong assumption), the agent saves the rule with `agentsmesh lessons add "<rule>" --topic <id> --trigger-file <glob>`.
|
|
106
|
+
The memory is one git-tracked file, `.agentsmesh/lessons/lessons.json`, and every agent talks to it through two commands:
|
|
138
107
|
|
|
139
|
-
|
|
108
|
+
- **Recall** — before an edit or a state-changing command, the agent runs `agentsmesh lessons query --file <path> --cmd <command>` and follows the rules that match.
|
|
109
|
+
- **Capture** — right after a failure (red test, lint error, review comment, wrong assumption), it saves the rule with `agentsmesh lessons add "<rule>" --topic <id> --trigger-file <glob>`.
|
|
140
110
|
|
|
141
111
|
```bash
|
|
142
|
-
#
|
|
143
|
-
agentsmesh init --lessons && agentsmesh generate
|
|
144
|
-
|
|
145
|
-
# 2. You hit a bug: a Windows path broke because of a backslash.
|
|
146
|
-
# Capture the lesson so it never bites again:
|
|
147
|
-
agentsmesh lessons add "Normalize CLI display paths to forward slashes" \
|
|
148
|
-
--topic windows-paths \
|
|
149
|
-
--new-topic --topic-summary "Cross-platform path handling" \
|
|
150
|
-
--trigger-file "src/cli/**/*.ts"
|
|
151
|
-
|
|
152
|
-
# 3. Later, before editing a CLI file, the agent recalls it automatically:
|
|
153
|
-
agentsmesh lessons query --file src/cli/foo.ts
|
|
154
|
-
# -> Normalize CLI display paths to forward slashes
|
|
112
|
+
agentsmesh init --lessons && agentsmesh generate # wire the recall/capture loop once
|
|
155
113
|
```
|
|
156
114
|
|
|
157
|
-
|
|
115
|
+
`init --lessons` drops a small always-on rule into `.agentsmesh/rules/_root.md` (so every target gets the habit), seeds the full operating manual as a `lessons` skill where supported, and wires a `PostToolUse` recall hook on hook-capable tools; agents without shell access use the matching MCP tools (`lessons_query` / `lessons_add`). Because the graph is a normal git-tracked file, a lesson one agent learns today helps every teammate's agent tomorrow, and every change is reviewable like any other diff.
|
|
158
116
|
|
|
159
|
-
|
|
117
|
+
Full walkthrough: [Teach your AI agents with lessons](https://samplexbro.github.io/agentsmesh/guides/lessons/) · [`agentsmesh lessons` reference](https://samplexbro.github.io/agentsmesh/cli/lessons/).
|
|
160
118
|
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
**Upgrading from the legacy store?** Run `agentsmesh lessons import-md` once to migrate `index.yaml` + `topics/*.md` + `journal.md` into the graph; the CLI deletes the legacy files after a successful migration.
|
|
164
|
-
|
|
165
|
-
Full walkthrough: [Teach your AI agents with lessons](https://samplexbro.github.io/agentsmesh/guides/lessons/) · every subcommand and flag: [`agentsmesh lessons` CLI reference](https://samplexbro.github.io/agentsmesh/cli/lessons/).
|
|
166
|
-
|
|
167
|
-
---
|
|
168
|
-
|
|
169
|
-
## Safe adoption in an existing repository
|
|
170
|
-
|
|
171
|
-
If your repo already has `.cursor/`, `.claude/`, `.github/copilot-instructions.md`, or other native files, you don't have to delete them. The recommended flow imports them into `.agentsmesh/` first, lets you preview the projection, and only then trusts `generate`.
|
|
172
|
-
|
|
173
|
-
```bash
|
|
174
|
-
agentsmesh import --from cursor # or claude-code, copilot, codex-cli, gemini-cli, windsurf, amp, zed, warp, ...
|
|
175
|
-
agentsmesh diff # patch-style preview of what generate would change
|
|
176
|
-
agentsmesh generate # write native configs (back) from canonical
|
|
177
|
-
agentsmesh check # add to CI to detect drift
|
|
178
|
-
```
|
|
179
|
-
|
|
180
|
-
What this gets you:
|
|
181
|
-
|
|
182
|
-
- `import` reads existing tool configs and writes equivalent canonical files into `.agentsmesh/` — round-trip metadata is preserved so re-import doesn't lose information.
|
|
183
|
-
- `diff` shows the unified patch every output file would receive, so you can review before any write.
|
|
184
|
-
- `check` reads `.agentsmesh/.lock` and fails the build if the canonical sources and the generated files disagree.
|
|
185
|
-
|
|
186
|
-
`import --from` accepts any built-in target ID listed in the [Supported Tools matrix](#supported-tools--feature-matrix). Plugin targets are valid too.
|
|
187
|
-
|
|
188
|
-
---
|
|
189
|
-
|
|
190
|
-
## Demo
|
|
191
|
-
|
|
192
|
-
<!-- TODO: Add terminal demo GIF showing init → generate → diff → check. -->
|
|
193
|
-
|
|
194
|
-
A quick sample of the canonical → native projection:
|
|
119
|
+
## Why developers use AgentsMesh
|
|
195
120
|
|
|
196
|
-
|
|
197
|
-
agentsmesh
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
agentsmesh
|
|
202
|
-
|
|
121
|
+
- **Bidirectional and loss-free** — `import` reads existing tool configs into `.agentsmesh/`; `generate` projects them back out. When a tool has no native slot for a feature, AgentsMesh embeds it with round-trip metadata instead of dropping it, so re-import restores the original canonical files. [Managed embedding →](https://samplexbro.github.io/agentsmesh/reference/managed-embedding/)
|
|
122
|
+
- **Automatic link rebasing** — canonical references like `.agentsmesh/skills/api-gen/template.hbs` are rewritten to each tool's native path (`.claude/skills/api-gen/template.hbs`, `.cursor/skills/api-gen/template.hbs`, …) in every generated file, so cross-file links stay valid; literal prose and embedded payloads are left untouched. [Generation pipeline →](https://samplexbro.github.io/agentsmesh/reference/generation-pipeline/)
|
|
123
|
+
- **Agents that learn** — the optional [lessons memory](#teach-your-agents-lessons) recalls past-mistake rules before each edit and captures new ones after each failure, shared across every tool and teammate.
|
|
124
|
+
- **Safe adoption** — already have `.cursor/`, `.claude/`, or `.github/copilot-instructions.md`? Run `import` → `diff` → `generate` → `check`; nothing is overwritten blind. [Existing-project guide →](https://samplexbro.github.io/agentsmesh/guides/existing-project/)
|
|
125
|
+
- **Migrate between tools** — `convert --from <a> --to <b>` rewrites one tool's config directly into another's native format. [convert →](https://samplexbro.github.io/agentsmesh/cli/convert/)
|
|
126
|
+
- **Global mode** — `~/.agentsmesh/` syncs your personal config to `~/.claude/`, `~/.cursor/`, `~/.codex/`, and more. Every command accepts `--global`. [Global paths →](https://samplexbro.github.io/agentsmesh/reference/supported-tools/#global-mode)
|
|
127
|
+
- **Team-safe and CI-ready** — `check` is a drift gate against `.agentsmesh/.lock`, `diff` previews changes, `merge` rebuilds the lock after a 3-way Git conflict, and `lock_features` + per-feature `strategy` prevent accidental overrides. `lint` adds cross-target warnings (`silent-drop-guard`, `hook-script-references`, `rule-scope-inversion`) for content a tool would silently mishandle. [check →](https://samplexbro.github.io/agentsmesh/cli/check/) · [lint →](https://samplexbro.github.io/agentsmesh/cli/lint/)
|
|
128
|
+
- **Community packs and `extends`** — install shared rules, skills, agents, and commands from any git repo (`install`, `--sync`, `refresh`, remote `extends`); a multi-signal classifier auto-detects Anthropic-style skill packs. Elevated artifacts (hooks, permissions, MCP) from remote sources are stripped unless you opt in with `--accept-*`. [Install reference →](https://samplexbro.github.io/agentsmesh/cli/install/)
|
|
129
|
+
- **Plugins** — ship support for a new tool as a standalone npm package, with full parity to built-in targets (project + global, conversions, lint hooks, hook post-processing). [Build a plugin →](https://samplexbro.github.io/agentsmesh/guides/building-plugins/)
|
|
130
|
+
- **Schema-validated configs** — each config ships a JSON Schema, so editors give you autocomplete and validation out of the box. [JSON schemas →](https://samplexbro.github.io/agentsmesh/reference/json-schemas/)
|
|
131
|
+
- **Typed programmatic API** — drive `generate` / `import` / `lint` / `diff` / `check` from scripts or CI via `agentsmesh`, `/engine`, `/canonical`, `/targets`, `/lessons`. [API reference →](https://samplexbro.github.io/agentsmesh/reference/programmatic-api/)
|
|
132
|
+
- **Self-serve MCP server** — `agentsmesh mcp` (seeded by `init`) exposes canonical config as MCP tools so agents can introspect rules, commands, and skills and trigger `generate` in-conversation. [MCP server →](https://samplexbro.github.io/agentsmesh/reference/mcp-server/)
|
|
133
|
+
- **Scriptable everywhere** — every command speaks `--json`, emitting a single `{ success, command, data?, error? }` envelope for CI and tooling.
|
|
134
|
+
|
|
135
|
+
> [!TIP]
|
|
136
|
+
> Commit **both** `.agentsmesh/` and the generated tool files, the same way you commit `package-lock.json`: they're deterministic build output that the AI tools read directly, and `agentsmesh check` guards the two from drifting.
|
|
203
137
|
|
|
204
|
-
|
|
138
|
+
## Why not just `AGENTS.md`?
|
|
205
139
|
|
|
206
|
-
|
|
140
|
+
[`AGENTS.md`](https://agents.md) is a great shared instruction file, and AgentsMesh emits it natively wherever a tool supports it. But a single markdown file isn't enough on its own: most assistants expose configuration *beyond* it — Cursor's `.cursor/rules/*.mdc` and MCP config, Claude Code's agents/skills/commands/hooks/permissions, Copilot's `.github/instructions/`, Gemini's `.gemini/settings.json`, and so on — and those surfaces don't overlap. AgentsMesh canonicalizes all of them so you never have to pick one tool's surface as the lowest common denominator.
|
|
207
141
|
|
|
208
|
-
##
|
|
142
|
+
## Commands
|
|
209
143
|
|
|
210
|
-
|
|
144
|
+
| Command | What it does |
|
|
145
|
+
|---|---|
|
|
146
|
+
| `init` | Scaffold `.agentsmesh/` + config (interactive wizard on a TTY) |
|
|
147
|
+
| `generate` | Write native config for every enabled tool |
|
|
148
|
+
| `check` | Fail when generated files drift from `.agentsmesh/.lock` (CI gate) |
|
|
149
|
+
| `diff` | Preview what the next `generate` would change |
|
|
150
|
+
| `import` | Pull an existing tool's config into `.agentsmesh/` |
|
|
151
|
+
| `convert` | Convert one tool's config directly into another's |
|
|
152
|
+
| `lint` | Validate canonical config against target constraints |
|
|
153
|
+
| `watch` | Regenerate target files on save |
|
|
154
|
+
| `merge` | Rebuild `.agentsmesh/.lock` after a Git merge conflict |
|
|
155
|
+
| `matrix` | Print the feature/target support matrix |
|
|
156
|
+
| `install` · `uninstall` · `installs` | Add, remove, and list community packs |
|
|
157
|
+
| `refresh` | Re-fetch installed packs from their sources |
|
|
158
|
+
| `plugin` | Add, list, or remove plugin-provided targets |
|
|
159
|
+
| `target` | Scaffold a new target's source skeleton (for contributors) |
|
|
160
|
+
| `lessons` | Query and capture agent memory (recall / capture) |
|
|
161
|
+
| `mcp` | Start the AgentsMesh MCP server (stdio) |
|
|
162
|
+
|
|
163
|
+
Every command accepts `--global` (operate on `~/.agentsmesh/`) and `--json` (machine-readable output). Run `agentsmesh <command> --help` for flags, or see the [CLI reference](https://samplexbro.github.io/agentsmesh/cli/).
|
|
164
|
+
|
|
165
|
+
## Supported tools
|
|
166
|
+
|
|
167
|
+
AgentsMesh generates native config for every major AI coding assistant — plus plugin targets you can ship as standalone npm packages. Native vs. embedded support per feature is tracked in the [supported-tools matrix](https://samplexbro.github.io/agentsmesh/reference/supported-tools/).
|
|
211
168
|
|
|
212
169
|
<!-- agentsmesh:tool-list -->
|
|
213
170
|
- **CLI agents:** [Aider](https://aider.chat), [Amp](https://ampcode.com), [Claude Code](https://www.anthropic.com/claude-code), [Codex CLI](https://github.com/openai/codex), [Crush](https://github.com/charmbracelet/crush), [Deep Agents CLI](https://github.com/langchain-ai/deepagents), [Gemini CLI](https://github.com/google-gemini/gemini-cli), [Goose](https://block.github.io/goose), [OpenCode](https://opencode.ai), [Pi Agent](https://github.com/pi-labs/pi-agent), [Qwen Code](https://github.com/QwenLM/qwen-code), [Rovo Dev](https://www.atlassian.com/solutions/devops/rovo-dev), [Warp](https://www.warp.dev).
|
|
@@ -215,301 +172,6 @@ AgentsMesh generates native config for every major AI coding assistant — plus
|
|
|
215
172
|
- **Cloud agent platforms:** [Factory Droid](https://www.factory.ai), [Jules](https://jules.google), [Replit Agent](https://replit.com).
|
|
216
173
|
<!-- /agentsmesh:tool-list -->
|
|
217
174
|
|
|
218
|
-
---
|
|
219
|
-
|
|
220
|
-
## Why developers use AgentsMesh
|
|
221
|
-
|
|
222
|
-
- **Bidirectional sync** — `import` reads existing tool configs into `.agentsmesh/`; `generate` projects them back out. Round-trips are loss-free, so adopting AgentsMesh in an existing repo never throws away data.
|
|
223
|
-
- **Agents that learn** — the optional [lessons memory](#teach-your-agents-lessons) recalls past-mistake rules before each edit and captures new ones after each failure, shared across every tool and every teammate.
|
|
224
|
-
- **Automatic link rebasing** — references like `.agentsmesh/skills/foo/SKILL.md` are rewritten to target-relative paths in every generated artifact, so cross-file links stay valid from `.claude/`, `.cursor/`, `.github/`, `.codex/`, and the rest.
|
|
225
|
-
- **Managed embedding with round-trip metadata** — when a target has no native slot for a feature (e.g. commands in Codex CLI), AgentsMesh embeds it with frontmatter that survives the next `import`. No silent data loss; the full feature-by-feature breakdown lives in the [supported tools matrix](https://samplexbro.github.io/agentsmesh/reference/supported-tools/).
|
|
226
|
-
- **Team-safe collaboration** — `agentsmesh check` is a CI drift gate against `.agentsmesh/.lock`, `agentsmesh diff` previews changes, `agentsmesh merge` rebuilds the lock after three-way Git conflicts, and `lock_features` + per-feature `strategy` prevent accidental overrides.
|
|
227
|
-
- **Global mode** — `~/.agentsmesh/` syncs personal AI config to `~/.claude/`, `~/.cursor/`, `~/.codex/`, `~/.windsurf/`, and other user-level folders. Every CLI command accepts `--global`.
|
|
228
|
-
- **Extensible** — community packs (`agentsmesh install ...`), remote `extends`, runtime plugins (`agentsmesh plugin add`), schema-validated config files, and a typed programmatic API for scripts, IDE extensions, and CI.
|
|
229
|
-
- **Self-serve MCP server** — `agentsmesh mcp` exposes canonical configuration as an MCP tool so AI agents can introspect rules, commands, agents, and skills, and trigger `generate` — all within the conversation. Seeded automatically by `agentsmesh init`.
|
|
230
|
-
|
|
231
|
-
---
|
|
232
|
-
|
|
233
|
-
## Why not just `AGENTS.md`?
|
|
234
|
-
|
|
235
|
-
[`AGENTS.md`](https://agents.md) is great as a shared, human-readable instruction file. AgentsMesh uses `AGENTS.md` natively where the target supports it (Codex CLI, Cursor, Copilot, Junie, Windsurf, …) and treats it as a first-class output, not a competitor.
|
|
236
|
-
|
|
237
|
-
The reason `AGENTS.md` alone is not enough: most AI coding assistants expose configuration surfaces beyond a single instruction markdown file, and those surfaces don't all overlap.
|
|
238
|
-
|
|
239
|
-
- **Cursor** has `.cursor/rules/*.mdc` (with frontmatter scopes), `.cursorignore`, MCP config, and hooks.
|
|
240
|
-
- **Claude Code** has `CLAUDE.md`, `.claude/agents/`, `.claude/skills/`, `.claude/commands/`, `.claude/settings.json`, hooks, and permissions.
|
|
241
|
-
- **GitHub Copilot** has `.github/copilot-instructions.md`, `.github/instructions/*.instructions.md`, agents, prompts, and (partial) hooks.
|
|
242
|
-
- **Gemini CLI** has `GEMINI.md`, `.gemini/settings.json` (MCP + hooks), `.gemini/commands/*.toml`, and agents.
|
|
243
|
-
- **Codex CLI** has `AGENTS.md` plus `.codex/config.toml`, `.codex/agents/*.toml`, `.codex/hooks.json`, and `.codex/rules/`.
|
|
244
|
-
- **Windsurf**, **Continue**, **Cline**, **Kiro**, **Junie**, **Roo Code**, **Antigravity**, **Amp**, **Zed**, **Warp** each have their own native rules, workflows, MCP servers, skills, and ignore files.
|
|
245
|
-
|
|
246
|
-
AgentsMesh canonicalizes all of these — rules, commands, agents, skills, MCP servers, hooks, ignore patterns, permissions — so you don't pick one tool's surface as the lowest common denominator. When a tool has no native slot for a feature, AgentsMesh embeds it with round-trip metadata instead of dropping it.
|
|
247
|
-
|
|
248
|
-
---
|
|
249
|
-
|
|
250
|
-
## Core concepts
|
|
251
|
-
|
|
252
|
-
`.agentsmesh/` is the canonical source of truth. Generated tool files are artifacts. The directory contains:
|
|
253
|
-
|
|
254
|
-
- `rules/_root.md` — the root rule every target projects (typically becomes `CLAUDE.md`, `AGENTS.md`, `.cursor/rules/_root.mdc`, etc.).
|
|
255
|
-
- `rules/*.md` — additional scoped rules.
|
|
256
|
-
- `commands/*.md` — reusable slash-style prompts/commands.
|
|
257
|
-
- `agents/*.md` — agent definitions (where the target supports them).
|
|
258
|
-
- `skills/<name>/SKILL.md` (+ supporting files) — composable skills.
|
|
259
|
-
- `mcp.json` — MCP server definitions.
|
|
260
|
-
- `hooks.yaml` — pre/post tool hooks.
|
|
261
|
-
- `permissions.yaml` — allow/deny rules where the target supports them.
|
|
262
|
-
- `ignore` — paths the assistant should not read or modify.
|
|
263
|
-
- `lessons/` — optional recall/capture memory: a single JSON graph (`lessons.json`) of lessons + topics + triggers. Agents talk to it via `agentsmesh lessons query` / `agentsmesh lessons add` rather than hand-editing files.
|
|
264
|
-
|
|
265
|
-
Configuration:
|
|
266
|
-
|
|
267
|
-
- `agentsmesh.yaml` — selects which targets and features are enabled.
|
|
268
|
-
- `agentsmesh.local.yaml` — per-developer overrides (gitignored by default).
|
|
269
|
-
- `.agentsmesh/.lock` — drift-detection lock file consumed by `agentsmesh check`.
|
|
270
|
-
|
|
271
|
-
Detailed contracts: [Canonical Config](https://samplexbro.github.io/agentsmesh/canonical-config/) · [Generation pipeline](https://samplexbro.github.io/agentsmesh/reference/generation-pipeline/).
|
|
272
|
-
|
|
273
|
-
---
|
|
274
|
-
|
|
275
|
-
## CLI usage
|
|
276
|
-
|
|
277
|
-
```bash
|
|
278
|
-
agentsmesh init [--global | --lessons] [--yes] # --lessons is project-mode only (rejected with --global)
|
|
279
|
-
agentsmesh generate [--global] [--targets <csv>] [--check] [--dry-run] [--force] [--refresh-cache]
|
|
280
|
-
agentsmesh import --from <target> [--global]
|
|
281
|
-
agentsmesh convert --from <target> --to <target> [--global] [--dry-run]
|
|
282
|
-
agentsmesh diff [--global] [--targets <csv>]
|
|
283
|
-
agentsmesh lint [--global] [--targets <csv>]
|
|
284
|
-
agentsmesh watch [--global] [--targets <csv>]
|
|
285
|
-
agentsmesh check [--global]
|
|
286
|
-
agentsmesh merge [--global]
|
|
287
|
-
agentsmesh matrix [--global] [--targets <csv>] [--verbose]
|
|
288
|
-
agentsmesh install <source> [--sync] [--path <dir>] [--target <id>] [--as <kind>] [--name <id>] [--extends] [--all] [--dry-run] [--global] [--force]
|
|
289
|
-
[--accept-hooks|--accept-permissions|--accept-mcp|--accept-elevated]
|
|
290
|
-
agentsmesh uninstall <name>[,<name>...] [--all] [--keep-pack] [--keep-generated] [--dry-run] [--global] [--force]
|
|
291
|
-
agentsmesh installs list [--global]
|
|
292
|
-
agentsmesh refresh [<name>[,<name>...]] [--dry-run] [--force] [--json] [--global]
|
|
293
|
-
agentsmesh plugin add|list|remove|info [--version <v>] [--id <id>]
|
|
294
|
-
agentsmesh target scaffold <id> [--name <displayName>] [--force]
|
|
295
|
-
agentsmesh lessons query [--file <p>] [--cmd <c>] [--keyword <k>] [--format plain|md|json] [--top <n>] [--max-tokens <n>] [--all] [--session <id>] [--no-dedup] [--ids]
|
|
296
|
-
agentsmesh lessons add "<rule>" --topic <id> --trigger-file <glob> [--trigger-cmd <regex>] [--trigger-kw <text>] [--evidence <ref>] [--rationale <text>] [--new-topic --topic-summary "<one line>"]
|
|
297
|
-
agentsmesh lessons topics | show <topic|id> | deprecate <id> | merge <loser> <keeper> | untrigger <lesson> <trigger> | strip-markers | journal | validate | stats | prune [--apply] | import-md
|
|
298
|
-
```
|
|
299
|
-
|
|
300
|
-
`agentsmesh --help` prints the same surface; `agentsmesh <cmd> --help` is also supported.
|
|
301
|
-
|
|
302
|
-
Lessons recall (`query`) is relevance-ranked and lean by default (top 10 results, ~400-token budget); capture (`add`) requires at least one trigger that can actually fire and rejects rules over 2000 characters. Every flag, warning, and maintenance subcommand is documented in the [`agentsmesh lessons` CLI reference](https://samplexbro.github.io/agentsmesh/cli/lessons/).
|
|
303
|
-
|
|
304
|
-
Per-project recall tuning lives in `.agentsmesh/lessons/config.json`, written by `init --lessons` with every field at its default: `{ "recallLimit": 10, "recallMaxTokens": 400, "autoPrune": false }`. Lower the caps to keep recall lean on a large graph; set `"autoPrune": true` to garbage-collect dead triggers and orphan topics automatically after each capture (safe and fully git-reversible). `--top`/`--max-tokens`/`--all` override the caps per call.
|
|
305
|
-
|
|
306
|
-
### Machine-readable output
|
|
307
|
-
|
|
308
|
-
All commands support `--json` for CI pipelines and scripting:
|
|
309
|
-
|
|
310
|
-
```bash
|
|
311
|
-
agentsmesh lint --json
|
|
312
|
-
# {"success":true,"command":"lint","data":{"diagnostics":[],"summary":{"errors":0,"warnings":0}}}
|
|
313
|
-
|
|
314
|
-
agentsmesh generate --check --json
|
|
315
|
-
# {"success":false,"command":"generate","error":"Command 'generate' failed","data":{"scope":"project","mode":"check","files":[...],...}}
|
|
316
|
-
```
|
|
317
|
-
|
|
318
|
-
Every command emits a single JSON envelope to stdout: `{ success, command, data?, error? }`. Human output is fully suppressed. Exit codes are preserved. `--json` is not supported with `watch`.
|
|
319
|
-
|
|
320
|
-
### Global mode (personal AI assistant config)
|
|
321
|
-
|
|
322
|
-
`.agentsmesh/` at the project level is for teams. `~/.agentsmesh/` at the home level is for personal setup across every repo you touch:
|
|
323
|
-
|
|
324
|
-
```bash
|
|
325
|
-
agentsmesh init --global
|
|
326
|
-
agentsmesh import --global --from claude-code
|
|
327
|
-
agentsmesh generate --global # writes ~/.claude/CLAUDE.md, ~/.cursor/, ~/.codex/, ~/.windsurf/, etc.
|
|
328
|
-
```
|
|
329
|
-
|
|
330
|
-
Every built-in target with a global layout supports global mode. Every CLI command (`diff`, `lint`, `watch`, `check`, `merge`, `matrix`) accepts `--global`. [Global mode paths per tool →](https://samplexbro.github.io/agentsmesh/reference/supported-tools/#global-mode)
|
|
331
|
-
|
|
332
|
-
### Plugins for new AI coding tools
|
|
333
|
-
|
|
334
|
-
Ship new target support as a standalone npm package — no fork, no core PR:
|
|
335
|
-
|
|
336
|
-
```bash
|
|
337
|
-
agentsmesh plugin add agentsmesh-target-my-tool
|
|
338
|
-
agentsmesh generate # plugin targets run alongside built-ins
|
|
339
|
-
agentsmesh generate --global # global mode works for plugins too
|
|
340
|
-
```
|
|
341
|
-
|
|
342
|
-
Plugins have full parity with built-in targets: project + global layouts, feature conversions, scoped settings, per-feature lint hooks, and hook post-processing. By default a failed plugin import logs a warning and is skipped; set `strict: true` on the plugin entry or run `AGENTSMESH_STRICT_PLUGINS=1 agentsmesh generate` to fail the build instead — useful in CI where a missing target is a real regression. [Build a plugin →](https://samplexbro.github.io/agentsmesh/guides/building-plugins/)
|
|
343
|
-
|
|
344
|
-
### Team-safe collaboration & CI drift detection
|
|
345
|
-
|
|
346
|
-
- **`agentsmesh check`** — CI gate that exits 1 if generated files drifted from the lock.
|
|
347
|
-
- **`agentsmesh diff`** — preview what the next `generate` would change.
|
|
348
|
-
- **`agentsmesh lint`** — validate canonical config against target-specific constraints; also surfaces cross-target warnings (`silent-drop-guard`, `hook-script-references`, `rule-scope-inversion`) for content a target would silently drop or mishandle. [Lint reference →](https://samplexbro.github.io/agentsmesh/cli/lint/)
|
|
349
|
-
- **`agentsmesh watch`** — regenerate target files on save during local editing.
|
|
350
|
-
- **`agentsmesh merge`** — recover from three-way `.lock` conflicts after `git merge`.
|
|
351
|
-
- **Collaboration config** — `lock_features` and `strategy` prevent accidental overrides.
|
|
352
|
-
|
|
353
|
-
### Community packs and shared config
|
|
354
|
-
|
|
355
|
-
Install shared skills, rules, agents, and commands from any git repo:
|
|
356
|
-
|
|
357
|
-
```bash
|
|
358
|
-
agentsmesh install github:org/shared-config@v1.0.0
|
|
359
|
-
agentsmesh install --path rules --as rules github:team/standards
|
|
360
|
-
agentsmesh install github:team/prompts --path workflows --as commands --extends
|
|
361
|
-
agentsmesh install --sync # restore all packs after clone
|
|
362
|
-
```
|
|
363
|
-
|
|
364
|
-
Packs live in `.agentsmesh/packs/`, track in `installs.yaml`, and merge into canonical config on every `generate`. `install --extends` records a linked `extends:` entry instead of materializing a pack; when paired with `--as`, the forced kind is persisted as `extends[].as` so flat markdown directories continue to load as commands, agents, rules, or skills during later `generate` runs. Anthropic-style skill packs (root `skills/`, `agents/`, `references/`, `.claude/commands/`, …) are auto-detected by a multi-signal classifier and imported as a bulk set in a single command — no `--as` needed. The discriminator is strict enough that legacy tool-native and canonical-agentsmesh repos still take their original code paths (verified by 5 backcompat fixtures).
|
|
365
|
-
|
|
366
|
-
List and remove installed packs:
|
|
367
|
-
|
|
368
|
-
```bash
|
|
369
|
-
agentsmesh installs list # NAME / SOURCE / FEATURES / INSTALLED table
|
|
370
|
-
agentsmesh uninstall <name> # rm pack dir, drop installs.yaml/extends entry, clean generated outputs
|
|
371
|
-
agentsmesh uninstall --all # sweep every install in this scope
|
|
372
|
-
agentsmesh uninstall <name> --keep-pack # only drop yaml entries; leave .agentsmesh/packs/<name>/ on disk
|
|
373
|
-
agentsmesh uninstall <name> --keep-generated # skip the final generate; emit a warning about stale target files
|
|
374
|
-
agentsmesh uninstall <name> --dry-run # preview; no writes
|
|
375
|
-
```
|
|
376
|
-
|
|
377
|
-
Each install writes `.agentsmesh-install-manifest.json` next to the pack with per-file sha256 hashes; uninstall compares current contents against that manifest and prompts before deleting locally-modified files. `--force` accepts the documented defaults (bulk = accept all, broken-link = leave-with-warnings, modified = delete-anyway). `.agentsmesh/.install.lock` serialises install/uninstall so concurrent runs on the same project fail fast rather than racing on disk.
|
|
378
|
-
|
|
379
|
-
### Refreshing packs
|
|
380
|
-
|
|
381
|
-
`agentsmesh refresh` re-fetches every installed pack from its recorded source/ref
|
|
382
|
-
and re-applies it. Branch pins (`@main`) advance to the current tip; tag pins
|
|
383
|
-
re-resolve in case the tag moved; SHA pins stay put (re-fetch with the same content).
|
|
384
|
-
|
|
385
|
-
```bash
|
|
386
|
-
agentsmesh refresh # refresh every installed pack
|
|
387
|
-
agentsmesh refresh my-pack,other-pack # refresh just these
|
|
388
|
-
agentsmesh refresh --dry-run # preview without writing
|
|
389
|
-
agentsmesh refresh --force # skip the drift prompt
|
|
390
|
-
```
|
|
391
|
-
|
|
392
|
-
Each pack is refreshed atomically — a failure or interruption leaves the
|
|
393
|
-
affected pack at its pre-refresh state. Local edits to pack files trigger
|
|
394
|
-
a consolidated consent prompt (5-minute timeout) unless `--force` is set.
|
|
395
|
-
|
|
396
|
-
**refresh does NOT switch refs.** To move a pack to a different ref, just install
|
|
397
|
-
with the new ref — install silently overwrites an existing pack of the same name:
|
|
398
|
-
|
|
399
|
-
```bash
|
|
400
|
-
agentsmesh install github:org/repo@v2.0.0
|
|
401
|
-
```
|
|
402
|
-
|
|
403
|
-
**refresh vs `install --sync`.** `--sync` replays missing installs from
|
|
404
|
-
`installs.yaml` (e.g. after a fresh clone). `refresh` updates existing
|
|
405
|
-
installs against their declared sources. They are orthogonal.
|
|
406
|
-
|
|
407
|
-
### What to commit and what to gitignore
|
|
408
|
-
|
|
409
|
-
`agentsmesh init` writes a `.gitignore` that follows the recommended convention. The defaults are deliberate:
|
|
410
|
-
|
|
411
|
-
| Path | In git? | Why |
|
|
412
|
-
|---|---|---|
|
|
413
|
-
| `.agentsmesh/` (canonical) | **commit** | The source of truth — must be in git. |
|
|
414
|
-
| `.agentsmesh/.lock` | **commit** | Drift detection contract. `agentsmesh check` compares against this. |
|
|
415
|
-
| `.agentsmesh/packs/` | **gitignore** | Materialized from `installs.yaml`. Same model as `node_modules` — `agentsmesh install --sync` reproduces them deterministically post-clone. |
|
|
416
|
-
| `agentsmesh.local.yaml` | **gitignore** | Per-developer overrides. |
|
|
417
|
-
| `.agentsmesh/.lock.tmp` | **gitignore** | Transient. |
|
|
418
|
-
| `.agentsmeshcache` | **gitignore** | Remote-extends cache. |
|
|
419
|
-
| `.agentsmesh/lessons/recall-log.jsonl` | **gitignore** | Opt-in recall telemetry (`AGENTSMESH_LESSONS_TELEMETRY=1`) — a runtime artifact, not the canonical graph. Added by `init --lessons`. |
|
|
420
|
-
| Generated tool folders (`.claude/`, `.cursor/`, `.github/`, `.gemini/`, `CLAUDE.md`, `AGENTS.md`, etc.) | **commit** | AI tools read these at runtime. Committing means a fresh clone has working AI configs without a build step. `agentsmesh check` in CI catches drift between canonical and generated. |
|
|
421
|
-
|
|
422
|
-
Why generated configs stay committed: the same reason `package-lock.json` does. They're deterministic build output that downstream consumers (in this case, the AI tool itself) read directly. Gitignoring them breaks fresh-clone UX and makes `agentsmesh check` meaningless. PR reviewers also benefit from seeing the projected diff in the format Claude/Cursor/Copilot will actually consume.
|
|
423
|
-
|
|
424
|
-
If your team has a strong reason to gitignore generated configs (e.g., monorepo size concerns, regenerate-on-checkout hooks), add the target-specific entries manually — but expect to wire `agentsmesh generate` into your post-checkout flow.
|
|
425
|
-
|
|
426
|
-
### Schema-validated configs (IDE autocomplete)
|
|
427
|
-
|
|
428
|
-
Every config file ships with a generated JSON Schema, so VS Code, JetBrains, and other editors give you autocomplete and validation out of the box:
|
|
429
|
-
|
|
430
|
-
| Config file | JSON Schema |
|
|
431
|
-
|---|---|
|
|
432
|
-
| `agentsmesh.yaml` / `.local.yaml` | `node_modules/agentsmesh/schemas/agentsmesh.json` |
|
|
433
|
-
| `.agentsmesh/hooks.yaml` | `schemas/hooks.json` |
|
|
434
|
-
| `.agentsmesh/permissions.yaml` | `schemas/permissions.json` |
|
|
435
|
-
| `.agentsmesh/mcp.json` | `schemas/mcp.json` |
|
|
436
|
-
| `.agentsmesh/packs/*/pack.json` | `schemas/pack.json` |
|
|
437
|
-
|
|
438
|
-
`agentsmesh init` writes the appropriate `# yaml-language-server: $schema=...` directive (or `$schema` field for JSON) into each canonical file, so editors pick up validation immediately.
|
|
439
|
-
|
|
440
|
-
### Environment variables
|
|
441
|
-
|
|
442
|
-
| Variable | Default | Description |
|
|
443
|
-
|---|---|---|
|
|
444
|
-
| `AGENTSMESH_GITHUB_TOKEN` | — | GitHub personal access token for private repo installs and `extends`. |
|
|
445
|
-
| `AGENTSMESH_CACHE` | `~/.agentsmesh/cache` | Override the remote-extends / tarball cache directory (the gitignored `.agentsmeshcache` in the project is a symlink to it). Must be an absolute path. |
|
|
446
|
-
| `AGENTSMESH_MAX_TARBALL_MB` | `500` | Maximum GitHub tarball size in MiB the install command will accept. Allowed range: `1`–`4096`. Increase this when installing from large monorepos. |
|
|
447
|
-
| `AGENTSMESH_STRICT_PLUGINS` | `0` | When set to `1`, a failed plugin descriptor import fails the build instead of warning-and-skip. Useful in CI where a missing plugin target is a regression. |
|
|
448
|
-
| `AGENTSMESH_ALLOW_INSECURE_GIT` | `0` | When set to `1`, enables insecure `git+http://` transports in `extends` and `install`. Disabled by default because `http` strips transport security (a MITM can swap cloned bytes before the SHA is pinned). The transport allowlist (`https`/`ssh` only, plus opt-ins) is enforced before any `git ls-remote`/clone. |
|
|
449
|
-
| `AGENTSMESH_ALLOW_LOCAL_GIT` | `0` | When set to `1`, enables `git+file://` sources in `extends` and `install`. Disabled by default because on shared hosts a world-writable repo could be planted by another user and combined with elevated-artifact emission for local privilege escalation. |
|
|
450
|
-
|
|
451
|
-
---
|
|
452
|
-
|
|
453
|
-
## TypeScript / Programmatic API
|
|
454
|
-
|
|
455
|
-
AgentsMesh is also importable as a typed ESM library, so you can drive every CLI capability — `generate`, `import`, `lint`, `diff`, `check` — from scripts, IDE extensions, MCP servers, or CI without spawning the CLI. Public entrypoints: `agentsmesh` (full surface), `agentsmesh/engine`, `agentsmesh/canonical`, `agentsmesh/targets`.
|
|
456
|
-
|
|
457
|
-
`loadProjectContext()` mirrors what the CLI does on startup: resolves config, applies local overrides, loads plugins, materializes `extends` and installed packs, and reads the canonical directory. The result is a single context value you can pass to `generate`, `lint`, or `diff` — the same surface the CLI uses.
|
|
458
|
-
|
|
459
|
-
```ts
|
|
460
|
-
import {
|
|
461
|
-
loadProjectContext,
|
|
462
|
-
generate,
|
|
463
|
-
lint,
|
|
464
|
-
diff,
|
|
465
|
-
check,
|
|
466
|
-
importFrom,
|
|
467
|
-
registerTargetDescriptor,
|
|
468
|
-
type GenerateResult,
|
|
469
|
-
type LintResult,
|
|
470
|
-
type LockSyncReport,
|
|
471
|
-
type TargetDescriptor,
|
|
472
|
-
} from 'agentsmesh';
|
|
473
|
-
|
|
474
|
-
// CLI-parity generate pattern: config, plugins, extends, packs, then generation.
|
|
475
|
-
const project = await loadProjectContext(process.cwd());
|
|
476
|
-
const results: GenerateResult[] = await generate(project);
|
|
477
|
-
|
|
478
|
-
// Lint — pure, returns structured diagnostics + hasErrors.
|
|
479
|
-
const lintResult: LintResult = await lint(project);
|
|
480
|
-
|
|
481
|
-
// Diff — runs generate internally, returns unified diffs + summary.
|
|
482
|
-
const { diffs, summary } = await diff(project);
|
|
483
|
-
|
|
484
|
-
// Check — lock-file vs current canonical drift report.
|
|
485
|
-
const drift: LockSyncReport = await check({
|
|
486
|
-
config: project.config,
|
|
487
|
-
configDir: project.configDir,
|
|
488
|
-
canonicalDir: project.canonicalDir,
|
|
489
|
-
});
|
|
490
|
-
|
|
491
|
-
// Import a built-in or registered plugin target back into canonical form.
|
|
492
|
-
await importFrom('claude-code', { root: process.cwd() });
|
|
493
|
-
|
|
494
|
-
// Register a custom target descriptor at runtime (same shape plugins ship).
|
|
495
|
-
const myDescriptor: TargetDescriptor = /* ... */;
|
|
496
|
-
registerTargetDescriptor(myDescriptor);
|
|
497
|
-
```
|
|
498
|
-
|
|
499
|
-
Subpath imports are available when you want narrower bundles:
|
|
500
|
-
|
|
501
|
-
```ts
|
|
502
|
-
import { generate, lint, diff, check, loadProjectContext } from 'agentsmesh/engine';
|
|
503
|
-
import { loadCanonical, loadCanonicalFiles } from 'agentsmesh/canonical';
|
|
504
|
-
import { getAllDescriptors } from 'agentsmesh/targets';
|
|
505
|
-
```
|
|
506
|
-
|
|
507
|
-
Every public symbol resolves to a real `.d.ts` under strict TypeScript. Full reference in the [programmatic API docs](https://samplexbro.github.io/agentsmesh/reference/programmatic-api/) — entrypoint table, every function signature, the typed error taxonomy, and the canonical/target type lists. ESM-only; requires Node.js 20+.
|
|
508
|
-
|
|
509
|
-
---
|
|
510
|
-
|
|
511
|
-
## Supported tools — feature matrix
|
|
512
|
-
|
|
513
175
|
### Project scope (`agentsmesh generate`)
|
|
514
176
|
|
|
515
177
|
<!-- agentsmesh:support-matrix:project -->
|
|
@@ -542,34 +204,19 @@ Every public symbol resolves to a real `.d.ts` under strict TypeScript. Full ref
|
|
|
542
204
|
| Permissions | — | — | Native | Partial | — | Native | — | — | — | — | — | — | — | — | — | — | — | Native | Native | — | Native | — | Native | — | Partial | Native | — | Partial | — | — |
|
|
543
205
|
<!-- /agentsmesh:support-matrix:global -->
|
|
544
206
|
|
|
545
|
-
See the [full feature matrix
|
|
546
|
-
|
|
547
|
-
---
|
|
207
|
+
See the [full feature matrix](https://samplexbro.github.io/agentsmesh/reference/supported-tools/) for native vs. embedded details and per-tool global paths.
|
|
548
208
|
|
|
549
209
|
## Documentation
|
|
550
210
|
|
|
551
|
-
- **[Getting Started](https://samplexbro.github.io/agentsmesh/getting-started/installation/)** —
|
|
552
|
-
- **[Canonical
|
|
553
|
-
- **[CLI
|
|
554
|
-
- **[
|
|
555
|
-
- **[
|
|
556
|
-
- **[Reference](https://samplexbro.github.io/agentsmesh/reference/generation-pipeline/)** — supported tools matrix · generation pipeline · managed embedding
|
|
557
|
-
|
|
558
|
-
---
|
|
211
|
+
- **[Getting Started](https://samplexbro.github.io/agentsmesh/getting-started/installation/)** — install and first run
|
|
212
|
+
- **[Canonical config](https://samplexbro.github.io/agentsmesh/canonical-config/)** — rules, commands, agents, skills, MCP, hooks, ignore, permissions
|
|
213
|
+
- **[CLI reference](https://samplexbro.github.io/agentsmesh/cli/)** — every command and flag
|
|
214
|
+
- **[Guides](https://samplexbro.github.io/agentsmesh/guides/existing-project/)** — adopting in an existing repo · teaching agents with lessons · sharing config · building plugins
|
|
215
|
+
- **[Reference](https://samplexbro.github.io/agentsmesh/reference/supported-tools/)** — supported tools · generation pipeline · managed embedding · programmatic API
|
|
559
216
|
|
|
560
217
|
## Contributing
|
|
561
218
|
|
|
562
|
-
Contributions welcome
|
|
563
|
-
|
|
564
|
-
```bash
|
|
565
|
-
pnpm install
|
|
566
|
-
pnpm build
|
|
567
|
-
pnpm test
|
|
568
|
-
pnpm lint
|
|
569
|
-
pnpm typecheck
|
|
570
|
-
```
|
|
571
|
-
|
|
572
|
-
---
|
|
219
|
+
Contributions welcome — edit canonical `.agentsmesh/` sources, never the generated files. See **[CONTRIBUTING.md](CONTRIBUTING.md)** to get set up.
|
|
573
220
|
|
|
574
221
|
## License
|
|
575
222
|
|