agentsmesh 0.5.0 → 0.6.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 +65 -6
- package/README.md +167 -78
- package/dist/{canonical-types-gdrUi3bD.d.ts → canonical-types-CZwrJoBX.d.ts} +1 -1
- package/dist/canonical.d.ts +3 -2
- package/dist/canonical.js +59 -70
- package/dist/canonical.js.map +1 -1
- package/dist/cli.js +453 -17020
- package/dist/engine.d.ts +186 -5
- package/dist/engine.js +1673 -882
- package/dist/engine.js.map +1 -1
- package/dist/index.d.ts +6 -0
- package/dist/index.js +12312 -0
- package/dist/index.js.map +1 -0
- package/dist/{target-descriptor-D64xD0C2.d.ts → target-descriptor-DjHhww11.d.ts} +30 -9
- package/dist/targets.d.ts +4 -3
- package/dist/targets.js +572 -775
- package/dist/targets.js.map +1 -1
- package/package.json +17 -3
- package/schemas/agentsmesh.json +122 -8
- package/dist/cli.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,16 +1,75 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
## 0.
|
|
3
|
+
## 0.6.0 - 2026-04-25
|
|
4
4
|
|
|
5
|
-
###
|
|
5
|
+
### Added
|
|
6
|
+
|
|
7
|
+
- **Full plugin parity with built-in targets** — plugin targets now have access to the same runtime capabilities as built-in targets:
|
|
8
|
+
- **Conversion support**: plugins can declare `supportsConversion: { commands: true, agents: true }` and users can configure `commands_to_skills` / `agents_to_skills` for plugin target IDs in `agentsmesh.yaml`. The conversion schema now accepts arbitrary target IDs alongside hardcoded builtins. Conversion values support per-scope control: `foo-ide: { project: true, global: false }` or the shorthand `foo-ide: true` for both scopes.
|
|
9
|
+
- **Global mode**: plugin descriptors that define `global` or `globalSupport` layouts, `globalCapabilities`, and `globalDetectionPaths` are fully resolved by the engine — `generate --global`, `import --global`, `lint --global`, and `matrix --global` all work with plugin targets.
|
|
10
|
+
- **Scoped settings emission**: `emitScopedSettings` hooks on plugin descriptors are now called during generation (previously only checked on builtins).
|
|
11
|
+
- **Hook post-processing**: `postProcessHookOutputs` hooks on plugin descriptors are now called during the hook generation pass.
|
|
12
|
+
- **Per-feature lint hooks**: `lint.commands`, `lint.mcp`, `lint.permissions`, `lint.hooks`, and `lint.ignore` on plugin descriptors receive `{ scope }` context for project vs global differentiation.
|
|
13
|
+
- **Unified generator resolution**: a single code path (`resolveTargetFeatureGenerator`) resolves generators for both builtins and plugins, removing duplicate resolution logic from the engine.
|
|
14
|
+
- **Plugin support in all CLI commands** — `diff`, `check`, `matrix`, and `import --from <plugin-id>` now bootstrap and resolve plugin targets. Previously only `generate` and `lint` supported plugins.
|
|
15
|
+
- **Richer target scaffold** — `agentsmesh target scaffold` now generates descriptors with global layout, `globalCapabilities`, `globalDetectionPaths`, `supportsConversion`, per-feature lint hook stubs, and `rewriteGeneratedPath` for global path rewriting.
|
|
16
|
+
- **Comprehensive plugin test fixture** (`tests/fixtures/plugins/rich-plugin/`) — covers 100% of `TargetDescriptor` fields including all 8 feature generators, per-feature lint hooks, project and global layouts with output families, shared artifacts, scope extras, scoped settings, hook post-processing, and conversion support.
|
|
17
|
+
- **Typed root barrel export** — `import { generate, importFrom, loadCanonical, registerTargetDescriptor } from 'agentsmesh'` now resolves to a proper `.d.ts` under strict TypeScript. The root `exports."."` is a conditional block with `types`, `import`, and `default`, pointing at a new public barrel (`src/public/index.ts`). Closes `TS7016: Could not find a declaration file for module 'agentsmesh'` that appeared for any downstream TS consumer.
|
|
18
|
+
- **Typed error taxonomy exported from the public API** — `AgentsMeshError` base class plus 8 concrete subclasses (`ConfigNotFoundError`, `ConfigValidationError`, `TargetNotFoundError`, `ImportError`, `GenerationError`, `RemoteFetchError`, `LockAcquisitionError`, `FileSystemError`), each carrying a stable `code` field (`AM_CONFIG_NOT_FOUND`, `AM_CONFIG_INVALID`, `AM_TARGET_NOT_FOUND`, `AM_IMPORT_FAILED`, `AM_GENERATION_FAILED`, `AM_REMOTE_FETCH_FAILED`, `AM_LOCK_ACQUISITION_FAILED`, `AM_FILESYSTEM`). Programmatic consumers can branch on `err instanceof ConfigNotFoundError` or `err.code === 'AM_CONFIG_INVALID'` without parsing error message strings. Error throw sites in `src/config/core/loader.ts` and `src/utils/filesystem/fs.ts` now emit typed errors; stack-trace context and `cause` chains preserved.
|
|
19
|
+
- **Canonical domain types in the public barrel** — 14 types (`CanonicalFiles`, `CanonicalRule`, `CanonicalCommand`, `CanonicalAgent`, `CanonicalSkill`, `SkillSupportingFile`, `Permissions`, `IgnorePatterns`, `McpServer`, `StdioMcpServer`, `UrlMcpServer`, `McpConfig`, `Hooks`, `HookEntry`) are now exported from `agentsmesh` and `agentsmesh/canonical`. Programmatic consumers can finally type the result of `loadCanonical()` without reaching into internal modules.
|
|
20
|
+
- **Process-level lock for concurrent `generate`** — `agentsmesh generate` acquires an atomic mkdir-based lock at `.agentsmesh/.generate.lock` before writing. Concurrent generates serialize cleanly; stale locks (dead PID on the same host, or age > 60 seconds) are evicted automatically; `SIGINT`/`SIGTERM`/normal exit release the lock idempotently. Dry-run and check-only modes skip the lock. Watch mode's lock-file ignore list was extended so self-triggered generate passes do not retrigger the watcher.
|
|
21
|
+
- **Cross-platform CI matrix** — quality gates now run on `ubuntu-latest` × Node 20/22/24, plus `windows-latest` × Node 22 and `macos-latest` × Node 22. Previously only `ubuntu-latest` × Node 22. E2E tests run on Linux and macOS; Windows runs lint/typecheck/unit/build.
|
|
22
|
+
- **Packaging guards in CI** — three new gates run on every push in a dedicated `smoke` job:
|
|
23
|
+
- `publint` — package.json metadata sanity (exports ordering, `files`, module type).
|
|
24
|
+
- `@arethetypeswrong/cli` with the `esm-only` profile — verifies every public entrypoint resolves to types under `node16 (from ESM)` and `bundler` module resolution.
|
|
25
|
+
- `tests/consumer-smoke/` — packs the tarball, installs it into a throwaway strict-mode TS project, and runs `tsc --noEmit` against every public symbol (runtime functions, canonical types, target-descriptor types, and error classes). Catches `TS7016` and type-resolution regressions that packaging-metadata checks miss.
|
|
26
|
+
- Also runnable locally via `pnpm publint`, `pnpm attw`, `pnpm consumer-smoke`.
|
|
27
|
+
- **Post-pack smoke test in CI** — the `smoke` job installs the packed tarball with `npm install -g` and verifies `agentsmesh --version`, `agentsmesh --help`, `amsh --version`, and `agentsmesh init --yes` all succeed in a clean temp project. Catches broken shebangs, missing files from the `files` array, and bin misconfiguration before publish.
|
|
28
|
+
- **`docs/add-new-target-playbook.md`** — self-contained guide for adding a new target (built-in or external plugin, project and global mode) designed to be handed to an AI coding agent. Covers research checklist, scaffold workflow, descriptor filling, realistic fixtures, strict-assertion test patterns, registration file wiring, matrix/docs updates, and a verification one-liner. Referenced by the canonical `add-agent-target` skill as the authoritative workflow document.
|
|
29
|
+
- **Boot-time guard against ambiguous shared-artifact ownership** — `BUILTIN_TARGETS` initialization now runs `assertSharedArtifactOwnersUnique()` (`src/targets/catalog/shared-artifact-owner.ts`) and throws if two descriptors claim the same or overlapping `sharedArtifacts: { '<prefix>': 'owner' }` entry. Previously the rewriter would silently pick the first match by iteration order, so a misconfigured plugin or future builtin could quietly route global skill writes to the wrong target. The error names both target IDs and both prefixes and suggests changing one role to `'consumer'` or namespacing the prefix. Covered by `tests/unit/targets/catalog/shared-artifact-owner.test.ts` (9 cases including identical-prefix conflicts, prefix-overlap conflicts, owner-vs-consumer non-conflicts, and the live builtin set).
|
|
30
|
+
- **Cross-process race coverage for the generate lock** — `tests/integration/generate-process-lock.integration.test.ts` now proves two parallel `node dist/cli.js generate` invocations against the same project serialize via the existing process lock, both exit `0`, produce deterministic output, and release `.agentsmesh/.generate.lock` after the run. Complements the existing unit tests that exercise `acquireProcessLock` directly.
|
|
31
|
+
- **End-to-end Copilot dual-mirror coverage** — `tests/unit/targets/copilot/global-layout.test.ts` adds two engine-level assertions that prove Copilot's `mirrorGlobalPath` emits the exact set `.copilot/skills/<name>/`, `.agents/skills/<name>/`, and `.claude/skills/<name>/` in global mode when codex-cli is not active, and skips the `.agents/skills/` mirror when codex-cli is generated alongside (so codex-cli's `'owner'` claim wins).
|
|
32
|
+
- **Programmatic API: complete `lint`, `diff`, `check`, and config-loader surface** — every CLI capability is now callable as a typed function. New exports from `agentsmesh` and `agentsmesh/engine`:
|
|
33
|
+
- `loadConfig(projectRoot)` and `loadConfigFromDirectory(configDir)` — load + validate `agentsmesh.yaml` (merging `agentsmesh.local.yaml`) and return `{ config: ValidatedConfig, configDir }`. Throws `ConfigNotFoundError` / `ConfigValidationError` with stable `code` fields.
|
|
34
|
+
- `lint(opts)` — runs target linters, returns `{ diagnostics, hasErrors }`. Pure: no I/O, no logging.
|
|
35
|
+
- `diff(ctx)` — runs generate internally, returns `{ results, diffs, summary }`. Plus `computeDiff(results)` and `formatDiffSummary(summary)` helpers for callers that already have generate results.
|
|
36
|
+
- `check(opts)` — pure lock-vs-current drift detection backed by the new shared `src/core/check/lock-sync.ts` module. Returns a structured `LockSyncReport` (`inSync`, `hasLock`, `modified`, `added`, `removed`, `extendsModified`, `lockedViolations`). The `agentsmesh check` CLI command was refactored to use the same helper so CLI and Programmatic API can never drift.
|
|
37
|
+
- New types: `ValidatedConfig`, `TargetLayoutScope`, `LintOptions`, `LintResult`, `LintDiagnostic`, `ComputeDiffResult`, `DiffEntry`, `DiffSummary`, `CheckLockSyncOptions`, `LockSyncReport`.
|
|
38
|
+
- **Programmatic API runtime coverage** — new `tests/integration/programmatic-api.integration.test.ts` (21 strict assertions) exercises every public function and every error class against real fixture state: shape inventory, `loadConfig` happy/missing/invalid-schema paths, `loadCanonical`, `generate` with exact-paths assertion, `targetFilter` narrowing, `registerTargetDescriptor` plugin wiring through `generate`, `importFrom` end-to-end, `lint` shape, `diff` + `computeDiff` summary parity, `check` for `hasLock=false` / `inSync=true` / modified-drift, catalog inspection, `resolveOutputCollisions`. Replaces the previous shallow `public-export-smoke.integration.test.ts` (which only checked `typeof === 'function'` and used loose `length > 0` assertions).
|
|
39
|
+
- **Programmatic API type contract coverage** — `tests/consumer-smoke/src/smoke.ts` extended to import every new symbol (`loadConfig`, `loadConfigFromDirectory`, `lint`, `diff`, `check`, `computeDiff`, `formatDiffSummary`, `ValidatedConfig`, `LintOptions`, `LintResult`, `CheckLockSyncOptions`, `LockSyncReport`, `ComputeDiffResult`, `DiffEntry`, `DiffSummary`) and exercise them with no `unknown` casts (the previous `as unknown as ValidatedConfig` hack is gone now that the type is public). `pnpm consumer-smoke` packs the tarball, installs into a strict-mode TS project, and `tsc --noEmit`s the full surface — catches `TS7016` and signature regressions before publish.
|
|
40
|
+
- **Dedicated Programmatic API reference page** at `website/src/content/docs/reference/programmatic-api.mdx` — entrypoint table, the canonical 4-line generate pattern, per-function signatures and examples for `loadConfig` / `loadCanonical` / `generate` / `importFrom` / `lint` / `diff` / `check` / `registerTargetDescriptor` / catalog inspection, full error taxonomy table, canonical types, target-descriptor types, and stability guarantees. Linked from the landing page and sidebar Reference section. README "Programmatic API" section rewritten so the example actually compiles (the previous snippet omitted the required `config` and `canonical` fields of `GenerateContext`).
|
|
6
41
|
|
|
7
|
-
|
|
42
|
+
### Changed
|
|
43
|
+
|
|
44
|
+
- **Production-grade build output** — `tsup.config.ts` reworked with a split policy that matches the two artifact families:
|
|
45
|
+
- **CLI binary (`dist/cli.js`)**: minified with `keepNames: true` so stack traces still reference real function/class names. Sourcemap no longer shipped to npm — with `keepNames` the minified stack traces remain debuggable from error text alone, and the 1.6 MB sourcemap was dead weight for the 99% of users who never debug into CLI internals (maintainers reproduce locally with sourcemap on).
|
|
46
|
+
- **Library entries (`dist/{index,engine,canonical,targets}.js`)**: unminified (consumers' bundlers minify their own output — standard convention used by React, Vue, Vitest, tsup itself), sourcemaps shipped (consumers stepping into library code from their own debugger get a usable experience).
|
|
47
|
+
- Explicit `treeshake: true` on both bundle families.
|
|
48
|
+
- Net effect: `dist/cli.js` 643 KB → 325 KB (-49%); compressed npm tarball 1.21 MB → 923 KB (-24%); unpacked install 6.0 MB → 4.75 MB (-21%). CLI cold-start parse time drops correspondingly.
|
|
49
|
+
- **Conversion config schema**: inner `commands_to_skills` and `agents_to_skills` objects changed from `.strict()` to `.passthrough()`, allowing plugin target IDs without validation errors. The outer `conversions` object remains strict. Conversion values now accept either `boolean` (both scopes) or `{ project?: boolean, global?: boolean }` for per-scope control.
|
|
50
|
+
- **Conversion helpers**: `shouldConvertCommandsToSkills` and `shouldConvertAgentsToSkills` accept optional `defaultEnabled` and `scope` parameters. Per-scope config values are resolved against the active scope, with missing scope keys falling back to builtin defaults.
|
|
51
|
+
- **Builtin-targets module**: five lookup functions (`getTargetCapabilities`, `getTargetDetectionPaths`, `getTargetLayout`, `getEffectiveTargetSupportLevel`, `resolveTargetFeatureGenerator`) now fall back to the plugin registry via `getDescriptor()` when no builtin match is found.
|
|
52
|
+
- **Registry**: `builtinDescriptors` map is now lazily initialized to avoid circular-dependency crashes between `builtin-targets.ts` and `registry.ts`.
|
|
53
|
+
- **JSON Schema**: `schemas/agentsmesh.json` updated — conversion inner objects now use `"additionalProperties": {}` (passthrough) instead of `"additionalProperties": false`.
|
|
54
|
+
- **`agentsmesh generate --global` log output** — generated file paths now display with a `~/` prefix (e.g. `✓ updated ~/.claude/settings.json`) so users cannot mistake a home-directory write for a project-local write. Applies to dry-run, check-only, and success output. Project-mode display is unchanged.
|
|
55
|
+
- **`writeFileAtomic` safety hardening** — orphaned `.tmp` sidecars are now removed on rename failure. Target paths that already exist as directories throw `FileSystemError` with `errnoCode: 'EISDIR'` instead of leaking the raw rename error. Readable error messages preserved with original errors as `cause`.
|
|
56
|
+
- **Remote tar extraction hardening** — `tar.extract` for GitHub tarballs now runs with `strict: true` (promotes warnings to errors) and explicitly rejects `Link` and `SymbolicLink` entries in addition to the existing zip-slip `..` / absolute-path filter. Defense-in-depth against malicious remote packs.
|
|
57
|
+
- **Package metadata**: `main` and `types` point at `./dist/index.{js,d.ts}`; root `exports."."` is a full conditional block. `@arethetypeswrong/cli` and `publint` added as devDependencies. New npm scripts: `publint`, `attw`, `consumer-smoke`.
|
|
58
|
+
- **README**: new **Programmatic API** section with typed import examples for the root barrel and the three subpath entrypoints (`agentsmesh/engine`, `agentsmesh/canonical`, `agentsmesh/targets`).
|
|
59
|
+
- **`--global` commands now throw a scope-aware error when `~/.agentsmesh/agentsmesh.yaml` is missing.** The message points at the exact missing path and suggests `agentsmesh init --global` to create the global canonical root, or dropping `--global` to operate on the current project. Applies uniformly to `generate`, `import`, `lint`, `check`, `diff`, `watch`, and `matrix`. Previously a generic "config not found" error left first-time global users guessing. Covered by `tests/unit/config/scope.test.ts`.
|
|
60
|
+
- **`ConfigNotFoundError` constructor accepts an optional `message` override** (`{ cause?, message? }`) so wrappers can supply scope-aware copy without losing the typed error class, `code`, or `path`. Existing callers that pass only `path` (and optional `cause`) are unchanged.
|
|
61
|
+
|
|
62
|
+
### Removed
|
|
63
|
+
|
|
64
|
+
- **Native Windows support deferred to a later release.** `package.json` now declares `"os": ["darwin", "linux"]`, the CI matrix dropped `windows-latest`, and the README's Install section calls this out with WSL2 as a workaround. The deferral path and re-enablement checklist are tracked in `docs/roadmap.md` under "Windows support (deferred)". Three POSIX-correctness fixes that landed in this release as defense-in-depth — `installs.yaml` `source` field always written as POSIX (`src/install/source/parse-install-local.ts`), plugin file-URL conversion via `fileURLToPath` instead of `URL.pathname` (`src/plugins/load-plugin.ts`), and `path.join` used in the canonical extend-load test expectations — already pave the way for the eventual re-enablement.
|
|
8
65
|
|
|
9
|
-
|
|
66
|
+
### Fixed
|
|
10
67
|
|
|
11
|
-
-
|
|
68
|
+
- **`TS7016` on root import** — `import { ... } from 'agentsmesh'` previously resolved to `./dist/cli.js`, which was built with `dts: false`. Root exports now point at the typed library barrel, and `attw` + `publint` + consumer-smoke guards prevent regression.
|
|
69
|
+
- **Stale coverage exclusion paths in `vitest.config.ts`** — 15 excluded files referenced stale paths after a folder restructure (`src/utils/fs.ts` → `src/utils/filesystem/fs.ts`, `src/config/lock.ts` → `src/config/core/lock.ts`, `src/install/git-pin.ts` → `src/install/source/git-pin.ts`, and others). Paths corrected; one entry for a deleted file (`src/install/local-source.ts`) removed.
|
|
70
|
+
- **Canonical `add-agent-target` skill** — restored mangled prose references (``` `../../` ``` back to ``` `.agentsmesh/` ```); updated stale code touchpoints (`src/config/schema.ts` → `src/config/core/schema.ts`, `src/cli/help.ts` → `src/cli/help-data.ts`, `src/core/matrix/matrix.ts` → `src/core/matrix/data.ts`); added missing registration-file pointers (`target-ids.ts`, `builtin-targets.ts`, `import-maps/index.ts`); named the `agentsmesh target scaffold <id>` scaffold command as the starting step; referenced `docs/add-new-target-playbook.md` for the step-by-step workflow; added `pnpm matrix:verify`, `pnpm publint`, `pnpm attw`, and `pnpm consumer-smoke` to the required verification list.
|
|
12
71
|
|
|
13
|
-
## 0.
|
|
72
|
+
## 0.5.0 - 2026-04-23
|
|
14
73
|
|
|
15
74
|
### Added
|
|
16
75
|
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<div align="center">
|
|
2
2
|
|
|
3
|
-
# AgentsMesh
|
|
3
|
+
# AgentsMesh — One AI Coding Config for Every Tool
|
|
4
4
|
|
|
5
5
|
[](https://github.com/sampleXbro/agentsmesh/actions/workflows/ci.yml)
|
|
6
6
|
[](https://www.npmjs.com/package/agentsmesh)
|
|
@@ -12,8 +12,11 @@
|
|
|
12
12
|
[](https://samplexbro.github.io/agentsmesh)
|
|
13
13
|
[](https://github.com/sampleXbro/agentsmesh/pulls)
|
|
14
14
|
|
|
15
|
+
**One canonical `.agentsmesh/` directory replaces scattered rules, prompts, agents, skills, MCP servers, hooks, ignore files, and permissions across every major AI coding tool.**
|
|
15
16
|
|
|
16
|
-
|
|
17
|
+
Edit once — generate `CLAUDE.md`, `AGENTS.md`, `.cursor/rules`, `.github/copilot-instructions.md`, `.gemini/settings.json`, `.windsurf/rules`, `.codex/config.toml`, `.kiro/steering`, and more from the same source. Bidirectional import so you can adopt it on existing projects with one command.
|
|
18
|
+
|
|
19
|
+
**Works with** Claude Code · Cursor · GitHub Copilot · Gemini CLI · Windsurf · Continue · Cline · Kiro · Codex CLI · Junie · Roo Code · Antigravity — and new tools as the ecosystem grows. See the [full feature matrix](https://samplexbro.github.io/agentsmesh/reference/supported-tools/).
|
|
17
20
|
|
|
18
21
|
</div>
|
|
19
22
|
|
|
@@ -23,107 +26,132 @@ AgentsMesh maintains a single canonical configuration in `.agentsmesh/` and sync
|
|
|
23
26
|
|
|
24
27
|
## Why AgentsMesh
|
|
25
28
|
|
|
26
|
-
- **One source of truth**
|
|
27
|
-
- **Bidirectional sync**
|
|
28
|
-
- **
|
|
29
|
-
- **
|
|
29
|
+
- **One source of truth** — edit `.agentsmesh/`, generate everywhere. No more copy-pasting rules between tool directories.
|
|
30
|
+
- **Bidirectional sync** — import existing configs into canonical form and generate back out. Lossless round-trip, no manual reformatting.
|
|
31
|
+
- **Project + Global modes** — sync team config via project-local `.agentsmesh/` *and* personal config via user-level `~/.agentsmesh/`.
|
|
32
|
+
- **Plugin system** — add support for any AI coding tool via an npm package. No fork, no core PR.
|
|
33
|
+
- **Team-safe collaboration** — lock files track generated state, `check` catches drift in CI, `merge` resolves conflicts after `git merge`.
|
|
34
|
+
- **Community packs** — install shared skills, rules, agents, and commands from GitHub / GitLab / git URLs.
|
|
35
|
+
- **Growing tool coverage** — new AI coding tools are added as the ecosystem evolves. See the [matrix](https://samplexbro.github.io/agentsmesh/reference/supported-tools/).
|
|
30
36
|
|
|
31
37
|
---
|
|
32
38
|
|
|
33
|
-
##
|
|
39
|
+
## Install
|
|
34
40
|
|
|
35
|
-
Requires **Node.js 20**
|
|
41
|
+
Requires **Node.js 20+**. Supported platforms: **Linux** and **macOS**. Native Windows support is deferred — track [the Windows support roadmap entry](docs/roadmap.md) for status. WSL2 works as a workaround.
|
|
36
42
|
|
|
37
43
|
```bash
|
|
38
|
-
#
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
# pnpm
|
|
42
|
-
pnpm add -D agentsmesh
|
|
43
|
-
|
|
44
|
-
# yarn
|
|
45
|
-
yarn add -D agentsmesh
|
|
46
|
-
|
|
47
|
-
# or run directly
|
|
48
|
-
npx agentsmesh --help
|
|
44
|
+
npm install -D agentsmesh # or: pnpm add -D / yarn add -D
|
|
45
|
+
npx agentsmesh --help # run without installing
|
|
49
46
|
```
|
|
50
47
|
|
|
51
|
-
|
|
48
|
+
CLI aliases: `agentsmesh` and `amsh`.
|
|
52
49
|
|
|
53
50
|
---
|
|
54
51
|
|
|
55
|
-
## Quick
|
|
52
|
+
## Quick start
|
|
56
53
|
|
|
57
54
|
### New project
|
|
58
55
|
|
|
59
56
|
```bash
|
|
60
|
-
#
|
|
61
|
-
agentsmesh
|
|
57
|
+
agentsmesh init # scaffold .agentsmesh/
|
|
58
|
+
# edit .agentsmesh/rules/_root.md
|
|
59
|
+
agentsmesh generate # produce configs for every enabled tool
|
|
60
|
+
```
|
|
62
61
|
|
|
63
|
-
|
|
64
|
-
# vi .agentsmesh/rules/_root.md
|
|
62
|
+
### Existing project — adopt with one import
|
|
65
63
|
|
|
66
|
-
|
|
64
|
+
```bash
|
|
65
|
+
agentsmesh import --from cursor # or claude-code, copilot, codex-cli, ...
|
|
67
66
|
agentsmesh generate
|
|
68
67
|
```
|
|
69
68
|
|
|
70
|
-
###
|
|
69
|
+
### Personal global config
|
|
71
70
|
|
|
72
71
|
```bash
|
|
73
|
-
|
|
74
|
-
agentsmesh import --from
|
|
75
|
-
|
|
76
|
-
# Generate output for all configured targets
|
|
77
|
-
agentsmesh generate
|
|
72
|
+
agentsmesh init --global
|
|
73
|
+
agentsmesh import --global --from claude-code
|
|
74
|
+
agentsmesh generate --global # writes to ~/.claude/, ~/.cursor/, etc.
|
|
78
75
|
```
|
|
79
76
|
|
|
80
|
-
|
|
77
|
+
---
|
|
78
|
+
|
|
79
|
+
## Features
|
|
80
|
+
|
|
81
|
+
### One config, every AI coding tool
|
|
82
|
+
|
|
83
|
+
AgentsMesh generates native configuration for every major AI coding assistant. Each tool's files are produced from a single `.agentsmesh/` directory with support for **rules, commands, agents, skills, MCP servers, hooks, ignore patterns, and permissions**:
|
|
84
|
+
|
|
85
|
+
| Tool | Main files generated |
|
|
86
|
+
|------|---------------------|
|
|
87
|
+
| **Claude Code** | `CLAUDE.md`, `.claude/agents/`, `.claude/skills/`, `.claude/commands/`, `.claude/settings.json`, `.claude/hooks.json`, MCP via `.claude.json` |
|
|
88
|
+
| **Cursor** | `.cursor/rules/*.mdc`, `AGENTS.md`, `.cursor/mcp.json`, `.cursor/hooks.json`, `.cursorignore` |
|
|
89
|
+
| **GitHub Copilot** | `.github/copilot-instructions.md`, `.github/instructions/*.instructions.md`, `.github/agents/`, `.github/prompts/` |
|
|
90
|
+
| **Gemini CLI** | `GEMINI.md`, `.gemini/settings.json` (MCP + hooks), `.gemini/commands/*.toml`, `.gemini/agents/` |
|
|
91
|
+
| **Windsurf** | `.windsurf/rules/*.md`, `.windsurf/workflows/`, `.windsurf/mcp_config.json`, `.windsurf/hooks.json` |
|
|
92
|
+
| **Continue** | `.continue/rules/`, `.continue/prompts/`, `.continue/mcpServers/`, `.continue/config.yaml` |
|
|
93
|
+
| **Cline** | `.clinerules/`, `.cline/skills/`, `.cline/cline_mcp_settings.json`, hooks |
|
|
94
|
+
| **Kiro** | `.kiro/steering/`, `.kiro/skills/`, `.kiro/hooks/*.kiro.hook`, `.kiro/settings/mcp.json` |
|
|
95
|
+
| **Codex CLI** | `AGENTS.md`, `.codex/config.toml`, `.codex/agents/*.toml`, `.codex/rules/` |
|
|
96
|
+
| **Junie** | `AGENTS.md`, `.junie/agents/`, `.junie/commands/`, `.junie/skills/`, `.junie/mcp/mcp.json` |
|
|
97
|
+
| **Roo Code** | `.roo/rules/`, `.roomodes` (agents → custom modes), `.roo/commands/`, `.roo/skills/` |
|
|
98
|
+
| **Antigravity** | `.agents/rules/general.md`, `.agents/skills/`, `.agents/workflows/`, `.agents/mcp_config.json` |
|
|
99
|
+
|
|
100
|
+
When a tool lacks native support for a feature, AgentsMesh embeds it with round-trip metadata — no data loss on re-import. See the [supported tools matrix](https://samplexbro.github.io/agentsmesh/reference/supported-tools/) for per-tool native vs. embedded breakdown.
|
|
101
|
+
|
|
102
|
+
### Global mode — personal setup, same workflow
|
|
103
|
+
|
|
104
|
+
`.agentsmesh/` at the project level is for teams. `~/.agentsmesh/` at the home level is for personal setup across every repo you touch:
|
|
81
105
|
|
|
82
106
|
```bash
|
|
83
|
-
# Initialize canonical home config
|
|
84
107
|
agentsmesh init --global
|
|
85
|
-
|
|
86
|
-
# Import a user-level tool setup into ~/.agentsmesh/
|
|
87
108
|
agentsmesh import --global --from claude-code
|
|
88
|
-
agentsmesh
|
|
89
|
-
agentsmesh import --global --from codex-cli
|
|
90
|
-
agentsmesh import --global --from cursor
|
|
91
|
-
|
|
92
|
-
# Install shared packs into ~/.agentsmesh/
|
|
93
|
-
agentsmesh install --global github:org/shared-rules
|
|
94
|
-
|
|
95
|
-
# Work against home-level canonical config
|
|
96
|
-
agentsmesh diff --global
|
|
97
|
-
agentsmesh lint --global
|
|
98
|
-
agentsmesh watch --global
|
|
99
|
-
agentsmesh check --global
|
|
100
|
-
agentsmesh merge --global
|
|
101
|
-
agentsmesh matrix --global
|
|
102
|
-
agentsmesh generate --global
|
|
109
|
+
agentsmesh generate --global # writes ~/.claude/CLAUDE.md, ~/.cursor/, ~/.codex/, ~/.windsurf/, etc.
|
|
103
110
|
```
|
|
104
111
|
|
|
105
|
-
|
|
112
|
+
Every built-in target and every plugin 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)
|
|
106
113
|
|
|
107
|
-
|
|
108
|
-
- **Cursor** — `~/.cursor/rules/*.mdc`, `~/.cursor/AGENTS.md` (aggregate), `~/.cursor/mcp.json`, `~/.cursor/hooks.json`, `~/.cursorignore`, plus skills, agents, and commands under `~/.cursor/`; legacy `~/.agentsmesh-exports/cursor/user-rules.md` is still read on import when present; `agentsmesh import --global --from cursor` maps those paths back into `~/.agentsmesh/`
|
|
109
|
-
- **Copilot** — `~/.copilot/copilot-instructions.md` (all rules merged, including glob-scoped instructions), `~/.copilot/AGENTS.md` (compat mirror), `~/.copilot/agents/*.agent.md`, `~/.copilot/skills/`, `~/.copilot/prompts/*.prompt.md`, skills mirrored to `~/.agents/skills/` and `~/.claude/skills/` when Codex is **not** also a global target
|
|
110
|
-
- **Continue** — `~/.continue/rules/`, `~/.continue/prompts/`, `~/.continue/skills/`, `~/.continue/mcpServers/agentsmesh.json`, `~/.continue/AGENTS.md` (compat mirror), `~/.continue/config.yaml` (global config)
|
|
111
|
-
- **Junie** — `~/.junie/AGENTS.md` (aggregate), `~/.junie/skills/`, `~/.junie/agents/*.md`, `~/.junie/commands/*.md`, `~/.junie/mcp/mcp.json`, optional mirror to `~/.agents/skills/` when Codex is **not** also a global target
|
|
112
|
-
- **Kiro** — `~/.kiro/steering/AGENTS.md` (aggregate), `~/.kiro/steering/*.md` (per-rule files), `~/.kiro/agents/*.md`, `~/.kiro/skills/`, `~/.kiro/settings/mcp.json`, `~/.kiro/settings/kiroignore`, optional mirror to `~/.agents/skills/` when Codex is **not** also a global target
|
|
113
|
-
- **Gemini CLI** — `~/.gemini/GEMINI.md`, `~/.gemini/AGENTS.md` (compatibility aggregate), `~/.gemini/settings.json` (includes MCP and hooks), `~/.gemini/commands/*.toml`, `~/.gemini/skills/`, `~/.gemini/agents/*.md` (experimental), optional mirror to `~/.agents/skills/` when Codex is **not** also a global target
|
|
114
|
-
- **Cline** — `~/Documents/Cline/Rules/`, `~/Documents/Cline/Workflows/`, `~/Documents/Cline/Hooks/`, `~/.cline/skills/`, `~/.cline/cline_mcp_settings.json`, `~/.clineignore`, optional mirror to `~/.agents/skills/`
|
|
115
|
-
- **Codex CLI** — `~/.codex/AGENTS.md`, `~/.codex/config.toml`, `~/.codex/agents/*.toml`, `~/.codex/rules/*.rules` when rules use execution semantics, and `~/.agents/skills/` for skills
|
|
116
|
-
- **Windsurf** — `~/.codeium/windsurf/memories/global_rules.md`, `~/.codeium/windsurf/skills/`, `~/.codeium/windsurf/global_workflows/`, `~/.codeium/windsurf/hooks.json`, `~/.codeium/windsurf/mcp_config.json`, `~/.codeium/.codeiumignore`, optional mirror to `~/.agents/skills/` when Codex is **not** also a global target
|
|
117
|
-
- **Antigravity** — `~/.gemini/antigravity/GEMINI.md`, `~/.gemini/antigravity/skills/`, `~/.gemini/antigravity/workflows/`, and `~/.gemini/antigravity/mcp_config.json`
|
|
118
|
-
- **Roo Code** — `~/.roo/AGENTS.md` (compatibility aggregate), `~/.roo/rules/*.md`, `~/.roo/commands/*.md`, `~/.roo/skills/`, `~/mcp_settings.json`, `~/.rooignore`, `~/.roo/settings/custom_modes.yaml` (agents → custom modes), optional mirror to `~/.agents/skills/` when Codex is **not** also a global target
|
|
114
|
+
### Plugins — add any AI tool
|
|
119
115
|
|
|
120
|
-
|
|
116
|
+
Ship new target support as a standalone npm package — no fork, no core PR:
|
|
121
117
|
|
|
122
|
-
|
|
118
|
+
```bash
|
|
119
|
+
agentsmesh plugin add agentsmesh-target-my-tool
|
|
120
|
+
agentsmesh generate # plugin targets run alongside built-ins
|
|
121
|
+
agentsmesh generate --global # global mode works for plugins too
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
Plugins have full parity with built-in targets: project + global layouts, feature conversions, scoped settings, per-feature lint hooks, and hook post-processing. [Build a plugin →](https://samplexbro.github.io/agentsmesh/guides/building-plugins/)
|
|
125
|
+
|
|
126
|
+
### Team-safe collaboration & CI drift detection
|
|
127
|
+
|
|
128
|
+
- **`agentsmesh check`** — CI gate that exits 1 if generated files drifted from the lock
|
|
129
|
+
- **`agentsmesh diff`** — preview what the next `generate` would change
|
|
130
|
+
- **`agentsmesh merge`** — recover from three-way `.lock` conflicts after `git merge`
|
|
131
|
+
- **Collaboration config** — `lock_features` and `strategy` prevent accidental overrides
|
|
132
|
+
|
|
133
|
+
### Community packs
|
|
134
|
+
|
|
135
|
+
Install shared skills, rules, agents, and commands from any git repo:
|
|
136
|
+
|
|
137
|
+
```bash
|
|
138
|
+
agentsmesh install github:org/shared-config@v1.0.0
|
|
139
|
+
agentsmesh install --path rules --as rules github:team/standards
|
|
140
|
+
agentsmesh install --sync # restore all packs after clone
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
Packs live in `.agentsmesh/packs/`, track in `installs.yaml`, and merge into canonical config on every `generate`.
|
|
144
|
+
|
|
145
|
+
### Extending AgentsMesh
|
|
146
|
+
|
|
147
|
+
- **`agentsmesh target scaffold foo-ide`** — generate a built-in target skeleton (10 files, ready to contribute upstream) with global mode, conversion support, and lint hooks pre-wired
|
|
148
|
+
- **`agentsmesh plugin add <pkg>`** — load third-party npm packages as runtime targets with full built-in parity
|
|
149
|
+
|
|
150
|
+
[Extending guide →](https://samplexbro.github.io/agentsmesh/guides/extending/) · [Building plugins →](https://samplexbro.github.io/agentsmesh/guides/building-plugins/)
|
|
123
151
|
|
|
124
152
|
---
|
|
125
153
|
|
|
126
|
-
## Supported
|
|
154
|
+
## Supported tools — feature matrix
|
|
127
155
|
|
|
128
156
|
### Project scope (`agentsmesh generate`)
|
|
129
157
|
|
|
@@ -141,7 +169,7 @@ That's it. Your `.agentsmesh/` directory is now the single source of truth, and
|
|
|
141
169
|
| Permissions | Native | Partial | — | — | — | — | Partial | — | — | — | — | — |
|
|
142
170
|
<!-- /agentsmesh:support-matrix:project -->
|
|
143
171
|
|
|
144
|
-
### Global scope (`agentsmesh
|
|
172
|
+
### Global scope (`agentsmesh generate --global`)
|
|
145
173
|
|
|
146
174
|
<!-- agentsmesh:support-matrix:global -->
|
|
147
175
|
| Feature | Claude Code | Cursor | Copilot | Continue | Junie | Kiro | Gemini CLI | Cline | Codex CLI | Windsurf | Antigravity | Roo Code |
|
|
@@ -157,26 +185,87 @@ That's it. Your `.agentsmesh/` directory is now the single source of truth, and
|
|
|
157
185
|
| Permissions | Native | — | — | — | — | — | — | — | — | — | — | — |
|
|
158
186
|
<!-- /agentsmesh:support-matrix:global -->
|
|
159
187
|
|
|
160
|
-
See the [full feature matrix docs](https://samplexbro.github.io/agentsmesh/reference/supported-tools/) for
|
|
188
|
+
See the [full feature matrix docs](https://samplexbro.github.io/agentsmesh/reference/supported-tools/) for native vs. embedded support details and per-tool global paths.
|
|
189
|
+
|
|
190
|
+
---
|
|
191
|
+
|
|
192
|
+
## Programmatic API
|
|
193
|
+
|
|
194
|
+
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`.
|
|
195
|
+
|
|
196
|
+
```ts
|
|
197
|
+
import {
|
|
198
|
+
loadConfig,
|
|
199
|
+
loadCanonical,
|
|
200
|
+
generate,
|
|
201
|
+
lint,
|
|
202
|
+
diff,
|
|
203
|
+
check,
|
|
204
|
+
importFrom,
|
|
205
|
+
registerTargetDescriptor,
|
|
206
|
+
type GenerateResult,
|
|
207
|
+
type LintResult,
|
|
208
|
+
type LockSyncReport,
|
|
209
|
+
type TargetDescriptor,
|
|
210
|
+
} from 'agentsmesh';
|
|
211
|
+
|
|
212
|
+
// Canonical 4-line generate pattern: load config → load canonical → call engine.
|
|
213
|
+
const { config } = await loadConfig(process.cwd());
|
|
214
|
+
const canonical = await loadCanonical(process.cwd());
|
|
215
|
+
const results: GenerateResult[] = await generate({
|
|
216
|
+
config,
|
|
217
|
+
canonical,
|
|
218
|
+
projectRoot: process.cwd(),
|
|
219
|
+
scope: 'project',
|
|
220
|
+
});
|
|
221
|
+
|
|
222
|
+
// Lint — pure, returns structured diagnostics + hasErrors.
|
|
223
|
+
const lintResult: LintResult = await lint({ config, canonical, projectRoot: process.cwd() });
|
|
224
|
+
|
|
225
|
+
// Diff — runs generate internally, returns unified diffs + summary.
|
|
226
|
+
const { diffs, summary } = await diff({ config, canonical, projectRoot: process.cwd() });
|
|
227
|
+
|
|
228
|
+
// Check — lock-file vs current canonical drift report.
|
|
229
|
+
const drift: LockSyncReport = await check({
|
|
230
|
+
config,
|
|
231
|
+
configDir: process.cwd(),
|
|
232
|
+
canonicalDir: `${process.cwd()}/.agentsmesh`,
|
|
233
|
+
});
|
|
234
|
+
|
|
235
|
+
// Import a tool's native config back into canonical form (writes to disk).
|
|
236
|
+
await importFrom('claude-code', { root: process.cwd() });
|
|
237
|
+
|
|
238
|
+
// Register a custom target descriptor at runtime (same shape plugins ship).
|
|
239
|
+
const myDescriptor: TargetDescriptor = /* ... */;
|
|
240
|
+
registerTargetDescriptor(myDescriptor);
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
Subpath imports are available when you want narrower bundles:
|
|
161
244
|
|
|
162
|
-
|
|
245
|
+
```ts
|
|
246
|
+
import { generate, lint, diff, check, loadConfig } from 'agentsmesh/engine';
|
|
247
|
+
import { loadCanonical } from 'agentsmesh/canonical';
|
|
248
|
+
import { getAllDescriptors } from 'agentsmesh/targets';
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
Every public symbol resolves to a real `.d.ts` under strict TypeScript. Full reference at [agentsmesh.dev/reference/programmatic-api](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+.
|
|
163
252
|
|
|
164
253
|
---
|
|
165
254
|
|
|
166
255
|
## Documentation
|
|
167
256
|
|
|
168
|
-
|
|
257
|
+
- **[Getting Started](https://samplexbro.github.io/agentsmesh/getting-started/installation/)** — installation, quick start
|
|
258
|
+
- **[Canonical Config](https://samplexbro.github.io/agentsmesh/canonical-config/)** — rules, commands, agents, skills, MCP, hooks, ignore, permissions
|
|
259
|
+
- **[CLI Reference](https://samplexbro.github.io/agentsmesh/cli/)** — `init`, `generate`, `import`, `install`, `diff`, `lint`, `watch`, `check`, `merge`, `matrix`, `plugin`, `target`
|
|
260
|
+
- **[Configuration](https://samplexbro.github.io/agentsmesh/configuration/agentsmesh-yaml/)** — `agentsmesh.yaml`, local overrides, extends, collaboration, conversions
|
|
261
|
+
- **[Guides](https://samplexbro.github.io/agentsmesh/guides/existing-project/)** — adopting in existing projects · multi-tool teams · sharing config · CI drift detection · community packs · **building plugins**
|
|
262
|
+
- **[Reference](https://samplexbro.github.io/agentsmesh/reference/generation-pipeline/)** — supported tools matrix · generation pipeline · managed embedding
|
|
169
263
|
|
|
170
|
-
|
|
171
|
-
- **[Canonical Config](https://samplexbro.github.io/agentsmesh/canonical-config/)** -- rules, commands, agents, skills, MCP, hooks, ignore, permissions
|
|
172
|
-
- **[CLI Reference](https://samplexbro.github.io/agentsmesh/cli/)** -- all commands: init, generate, import, install, diff, lint, watch, check, merge, matrix
|
|
173
|
-
- **[Configuration](https://samplexbro.github.io/agentsmesh/configuration/agentsmesh-yaml/)** -- agentsmesh.yaml, local overrides, extends, collaboration, conversions
|
|
174
|
-
- **[Guides](https://samplexbro.github.io/agentsmesh/guides/existing-project/)** -- adopting in existing projects, multi-tool teams, sharing config, CI drift detection, community packs
|
|
175
|
-
- **[Reference](https://samplexbro.github.io/agentsmesh/reference/generation-pipeline/)** -- how the generation pipeline works
|
|
264
|
+
---
|
|
176
265
|
|
|
177
266
|
## Contributing
|
|
178
267
|
|
|
179
|
-
Contributions
|
|
268
|
+
Contributions welcome. Keep changes small, test them, and prefer editing canonical `.agentsmesh/` sources over generated files.
|
|
180
269
|
|
|
181
270
|
```bash
|
|
182
271
|
pnpm install
|
|
@@ -143,4 +143,4 @@ interface CanonicalFiles {
|
|
|
143
143
|
ignore: IgnorePatterns;
|
|
144
144
|
}
|
|
145
145
|
|
|
146
|
-
export type {
|
|
146
|
+
export type { CanonicalAgent as C, HookEntry as H, IgnorePatterns as I, McpConfig as M, Permissions as P, SkillSupportingFile as S, UrlMcpServer as U, CanonicalCommand as a, CanonicalFiles as b, CanonicalRule as c, CanonicalSkill as d, Hooks as e, McpServer as f, StdioMcpServer as g };
|
package/dist/canonical.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { b as CanonicalFiles } from './canonical-types-CZwrJoBX.js';
|
|
2
|
+
export { C as CanonicalAgent, a as CanonicalCommand, c as CanonicalRule, d as CanonicalSkill, H as HookEntry, e as Hooks, I as IgnorePatterns, M as McpConfig, f as McpServer, P as Permissions, S as SkillSupportingFile, g as StdioMcpServer, U as UrlMcpServer } from './canonical-types-CZwrJoBX.js';
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* Load all canonical files from a canonical directory into CanonicalFiles.
|
|
@@ -20,4 +21,4 @@ declare function loadCanonicalFiles(canonicalDirOrProjectRoot: string): Promise<
|
|
|
20
21
|
/** Load `.agentsmesh/` from a project root (or an explicit canonical directory). */
|
|
21
22
|
declare function loadCanonical(projectRoot: string): Promise<CanonicalFiles>;
|
|
22
23
|
|
|
23
|
-
export { loadCanonical, loadCanonicalFiles };
|
|
24
|
+
export { CanonicalFiles, loadCanonical, loadCanonicalFiles };
|