- Node.js 20 or later (CI verifies 22 and 24)
- pnpm 10 — CI pins this version; newer pnpm majors can trip
--frozen-lockfileon the committed lockfile
git clone https://github.com/sampleXbro/agentsmesh.git
cd agentsmesh
pnpm installpnpm build # compile src/ → dist/
pnpm test # unit + integration tests
pnpm test:e2e # end-to-end tests (self-builds first)
pnpm test:coverage # coverage report (thresholds enforced in CI)
pnpm lint # ESLint
pnpm lint:dead # knip — unused files / exports / deps
pnpm typecheck # tsc --noEmit
pnpm format # prettier --write
pnpm changeset # record a user-facing change (see Changesets)git commit runs the husky pre-commit gate (pnpm precommit = typecheck → dead-code → coverage → lint-staged → build), so a commit takes a couple of minutes and fails on any red gate. Always run pnpm build before pnpm test:e2e — e2e tests execute dist/cli.js directly.
- TDD mandatory: write a failing test first, then implement.
- Max file size: 200 lines. Split by responsibility if larger.
- No
any: useunknown+ narrowing. Explicit return types on public functions; preferinterfaceovertypefor object shapes. - No classes unless stateful: prefer pure functions + types.
- Never edit generated files.
.agentsmesh/is the source of truth;.claude/,.cursor/,AGENTS.md,.github/copilot-instructions.md, and the other per-tool outputs are produced byagentsmesh generateand will be overwritten. Change.agentsmesh/and regenerate —agentsmesh generate --checkmust report in sync before you commit. - Docs stay current. Any change to CLI commands, flags, config schema, or supported targets must update
README.mdand the website docs (website/src/content/docs/). Per-target support lives only inreference/supported-tools.mdx; other pages link to it. - Strict artifact tests. Generated-output tests assert exact paths and counts — no
some(...), prefix, or "at least one" checks. - Commits must follow Conventional Commits:
feat|fix|test|refactor|docs|chore(scope): message.
Use the add-agent-target skill documented in .claude/skills/add-agent-target/. It requires:
- Current official documentation research for the target format
- Full importer and generator implementation
- Realistic fixtures
- Complete unit, integration, and e2e coverage
- Matrix and docs updates
For global mode (--global / .agentsmesh) on an existing target, use the add-global-mode-target skill instead.
Releases are changesets-driven — every user-facing change ships a changeset.
- Add a changeset when you touch the published surface:
src/,schemas/,package.json(deps/exports), orREADME.md. Changes confined totests/,website/,docs/, or.agentsmesh/ship nothing and need no changeset. - Run
pnpm changeset, choose the bump (patchfix /minoradditive /majorbreaking), and write a one-paragraph, user-facing summary — it becomes theCHANGELOG.mdentry, so describe the capability, not the commit. - Commit the changeset alongside the code it describes (no orphan changesets, no orphan code).
- Never hand-edit
package.jsonversionorCHANGELOG.md— the automated "chore: version packages" PR generates both on merge tomaster.
- Keep PRs small and focused on one change.
- All CI gates must pass:
pnpm lint,pnpm typecheck,pnpm test,pnpm test:e2e,pnpm test:contract,pnpm matrix:verify,pnpm test:coverage, andpnpm audit --prod. - Include a changeset for any published-surface change (see Changesets).
Open a GitHub issue with a minimal reproduction case. See SECURITY.md for security vulnerabilities.
Capability provenance lives in src/targets/catalog/capability-ledger.json — an oracle that validates descriptors; it never generates. Current capability levels always come from each target's capabilities.ts (the matrix derives from there); the ledger records where the tool's own docs say each file/shape is, so generated output can be validated against it.
Maintainer commands:
pnpm capabilities:audit— join descriptors × ledger and print three buckets: GAPS (descriptor below the researched ceiling — raise-opportunities), STALE (provenance null/expired, or descriptor over-declares), MISSING (a native/embedded cell with no ledger provenance yet).pnpm capabilities:audit --json/--stale <days>— machine-readable output / override the staleness window (default 180).pnpm capabilities:merge— rebuild the ledger from all builtin target descriptors while preserving existing provenance. For confirmed/rejected cells the researchedmaxAchievableceiling is kept even when the descriptor level is lower; for unverified cells the higher of the descriptor and existing level is used. Existing fingerprints (topLevelKeys, requiredFrontmatter, keyChecks) are preserved when any array is non-empty. Run this after adding a new target or changing capability levels en-masse; commit the resulting diff tosrc/targets/catalog/capability-ledger.json. The merge logic lives insrc/core/capabilities/merge.ts(pure, unit-tested).pnpm capabilities:seed— regenerate fingerprint skeletons from current generator output (run after adding or changing a native/embedded feature). Seeds only project-scope, single-structured-file cells; directory/projection features (commands/agents/skills) and extensionless ignore files are left for manual research.pnpm capabilities:verify— reports native/embedded cells that still lack ledger provenance. This is a backlog tracker, not a CI gate: many cells are intentionally un-researched, so it currently exits non-zero.
The enforced gate is the conformance test in tests/contract/capability-ledger-conformance.test.ts (runs under pnpm test, hence in CI): every seeded native/embedded cell is generated and its output must match the recorded extension, serialization, and structural fingerprint. A declared-native cell whose output drifts (wrong path/key/shape/extension) fails CI.
Use the update-target-capabilities skill to drive research on the flagged STALE/MISSING cells and to flip GAPS.