Skip to content

Commit 720f77e

Browse files
feat(schemas): add JSON Schema generation for all config files and bump to 0.4.1
- Add Zod-derived JSON Schemas for agentsmesh.yaml, permissions.yaml, hooks.yaml, mcp.json, and pack.yaml - Publish schemas to schemas/ in npm package, accessible via unpkg CDN - Write yaml-language-server $schema comment in agentsmesh init output for zero-config IDE validation - Add pnpm schemas:generate script and freshness guard tests to prevent schema drift - Update CHANGELOG.md with comprehensive 0.4.1 release notes
1 parent 602224f commit 720f77e

13 files changed

Lines changed: 962 additions & 196 deletions

File tree

CHANGELOG.md

Lines changed: 33 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,45 @@
11
# Changelog
22

3-
## 0.4.0 - 2026-04-17
4-
5-
### Changed
6-
7-
- **Init scaffold:** example files created by `agentsmesh init` are now prefixed with `_` (`_example.md`, `skills/_example/SKILL.md`). Files and directories with a `_` prefix are excluded from generation, so the starter templates serve as visible reference only and do not produce tool-specific output. `_root.md` remains the sole `_`-prefixed file that is always included in generation.
3+
## 0.4.1 - 2026-04-23
84

95
### Added
106

11-
- **Global mode** (`--global`, canonical `~/.agentsmesh/`) for **all** built-in targets — Claude Code, Cursor, Copilot, Continue, Junie, Kiro, Gemini CLI, Cline, Codex CLI, Windsurf, Antigravity, and Roo Code. Each target has a `descriptor.global` layout with project→user path rewriting, import/generate alignment where applicable, optional `~/.agents/skills/` mirroring when Codex CLI is not a global target, reference/link rewriting, and tests (including `generate-reference-rewrite` and global path rebase coverage).
12-
- Contributor skill **`add-global-mode-target`** (`.agents/skills/` and mirrored agent skill dirs) for scoped work when extending or validating **one** target’s global-mode behavior at a time.
13-
- Comprehensive structure validation test coverage for all 12 targets in both project and global modes (24 test suites, 39 global mode tests, 100% pass rate).
7+
- **JSON Schema for all config files**`agentsmesh.yaml`, `agentsmesh.local.yaml`, `.agentsmesh/permissions.yaml`, `.agentsmesh/hooks.yaml`, `.agentsmesh/mcp.json`, and `.agentsmesh/packs/*/pack.yaml` now ship with JSON Schemas derived directly from Zod source schemas. Enables full IDE autocomplete, enum validation, and hover docs in VS Code, JetBrains, and any YAML/JSON Language Server with zero user configuration. Schemas are published to `schemas/` in the npm package and accessible at `https://unpkg.com/agentsmesh/schemas/*.json`. Run `pnpm schemas:generate` to regenerate after schema changes.
8+
- **`$schema` comment in generated config files**`agentsmesh init` now writes a `# yaml-language-server: $schema=...` comment as the first line of both `agentsmesh.yaml` and `agentsmesh.local.yaml`, activating IDE validation without any manual setup.
9+
- **Global mode** (`--global`, canonical `~/.agentsmesh/`) for **all** built-in targets — Claude Code, Cursor, Copilot, Continue, Junie, Kiro, Gemini CLI, Cline, Codex CLI, Windsurf, Antigravity, and Roo Code. Each target has a `descriptor.global` layout with project→user path rewriting, import/generate alignment, optional `~/.agents/skills/` mirroring when Codex CLI is not a global target, reference/link rewriting, and comprehensive test coverage.
10+
- **Roo Code agents → custom modes**: canonical agents now generate `.roomodes` (project) and `settings/custom_modes.yaml` (global) with a `customModes` YAML structure. Roo Code agents capability upgraded from `` to `partial`.
11+
- **Copilot global extras**: `~/.copilot/AGENTS.md` is now generated in global mode as a root-instructions compat file.
12+
- **Continue global config**: global mode generates `~/.continue/config.yaml` (aggregating rules as `rules:`, commands as `prompts:`, MCP as `mcpServers:`) and `~/.continue/AGENTS.md`.
13+
- **Copilot global skill mirror**: skills are now mirrored to both `~/.agents/skills/` and `~/.claude/skills/` in global mode.
14+
- **Cline global hooks round-trip**: `agentsmesh import --from cline` now reads hook scripts from `~/Documents/Cline/Hooks/` (global mode) and `.clinerules/hooks/` (project mode). Hook scripts embed a `# agentsmesh-event: <event>` metadata comment for lossless round-trip; the generator also includes this comment going forward.
15+
- `sharedArtifacts` field added to target descriptor — enables collision-free generation when multiple targets share an output path (e.g. `.agents/skills/`).
16+
- Lint hooks wired to all target descriptors.
17+
- Contributor skill **`add-global-mode-target`** for scoped work when extending or validating one target’s global-mode behavior.
18+
- Comprehensive structure validation test coverage for all 12 targets in both project and global modes.
1419
- Shared validation helpers library (`tests/unit/targets/validation-helpers.ts`) with reusable helpers for JSON, Markdown, YAML, frontmatter, and file structure validation.
15-
- Global mode test coverage for all targets verifying correct path transformations and feature support in user-level configurations.
20+
21+
### Fixed
22+
23+
- **Claude Code output-styles**: generated output-style files no longer carry `agent-` / `command-` filename prefixes — now `{name}.md` as documented.
24+
- **Windsurf**: `src/AGENTS.md` removed from `managedOutputs` (was incorrectly tracked as a managed file).
25+
- **Cline**: `.clinerules/` directory added to `managedOutputs.dirs` for correct stale-artifact cleanup after `generate`.
26+
- **Copilot global instructions**: path-specific instructions now aggregate into `~/.copilot/copilot-instructions.md` in global mode (previously suppressed).
27+
- **Windsurf MCP capability**: both project and global scopes now consistently `partial` (global was incorrectly `native`).
28+
- **Codex CLI detection**: detection paths expanded to include `AGENTS.md`, `AGENTS.override.md`, `.codex/config.toml`, `.codex/agents`, and `.codex/rules`.
29+
- **Link rebaser**: `.agentsmesh/` anchor preserved correctly in generated prose.
1630

1731
### Changed
1832

19-
- **Documentation:** README quick start adds a **personal global config** section; CLI reference pages (`init`, `import`, `generate`, `install`, `diff`, `lint`, `watch`, `check`, `merge`, `matrix`, overview) document `--global` behavior and link to the [supported tools matrix](https://samplexbro.github.io/agentsmesh/reference/supported-tools/#global-mode). Antigravity global paths are documented as `~/.gemini/antigravity/GEMINI.md` (distinct from Gemini CLI’s `~/.gemini/GEMINI.md`).
33+
- **Init scaffold:** example files created by `agentsmesh init` are now prefixed with `_` (`_example.md`, `skills/_example/SKILL.md`). Files and directories with a `_` prefix are excluded from generation, so the starter templates serve as visible reference only and do not produce tool-specific output. `_root.md` remains the sole `_`-prefixed file that is always included in generation.
34+
- **Documentation:** README and website updated to reflect Roo Code agents support, Copilot and Continue global extras, and the new `schemas/` package contents. `generate.mdx` documents global mode path resolution (how `--global` maps to `homedir()` as `projectRoot`).
35+
36+
### Refactored
37+
38+
- Extracted `mirrorSkillsToAgents()` shared helper (`src/targets/catalog/skill-mirror.ts`) — replaces repeated `!activeTargets.includes(‘codex-cli’)` guards inline across 8 target files.
39+
- Consolidated import map builders; removed duplicate validation tests.
40+
- Extracted shared skill-import pipeline; deleted obsolete `skills-helpers` files.
41+
- Improved link rebaser resolution and managed embedding.
42+
- Removed unused `COPILOT_GLOBAL_MCP` / `COPILOT_GLOBAL_CONFIG` constants.
2043

2144
## 0.3.1 - 2026-04-12
2245

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "agentsmesh",
3-
"version": "0.4.0",
3+
"version": "0.4.1",
44
"description": "One canonical source for AI coding agent rules, commands, skills, MCP, hooks, and permissions — synced across Claude Code, Cursor, Copilot, Continue, Junie, Gemini CLI, Cline, Codex CLI, Windsurf, Antigravity, and Roo Code.",
55
"type": "module",
66
"main": "./dist/cli.js",
@@ -53,6 +53,7 @@
5353
"format:check": "prettier --check src/",
5454
"prepare": "husky",
5555
"typecheck": "tsc --noEmit",
56+
"schemas:generate": "tsx scripts/generate-schemas.ts",
5657
"matrix:generate": "tsx scripts/render-support-matrix.ts",
5758
"matrix:verify": "tsx scripts/render-support-matrix.ts --verify",
5859
"changeset": "changeset",
@@ -97,6 +98,7 @@
9798
},
9899
"files": [
99100
"dist",
101+
"schemas",
100102
"README.md",
101103
"CHANGELOG.md",
102104
"LICENSE"

schemas/agentsmesh.json

Lines changed: 248 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,248 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/2020-12/schema",
3+
"type": "object",
4+
"properties": {
5+
"version": {
6+
"type": "number",
7+
"const": 1
8+
},
9+
"targets": {
10+
"default": [
11+
"claude-code",
12+
"cursor",
13+
"copilot",
14+
"continue",
15+
"junie",
16+
"kiro",
17+
"gemini-cli",
18+
"cline",
19+
"codex-cli",
20+
"windsurf",
21+
"antigravity",
22+
"roo-code"
23+
],
24+
"type": "array",
25+
"items": {
26+
"type": "string",
27+
"enum": [
28+
"claude-code",
29+
"cursor",
30+
"copilot",
31+
"continue",
32+
"junie",
33+
"kiro",
34+
"gemini-cli",
35+
"cline",
36+
"codex-cli",
37+
"windsurf",
38+
"antigravity",
39+
"roo-code"
40+
]
41+
}
42+
},
43+
"features": {
44+
"default": [
45+
"rules",
46+
"commands",
47+
"agents",
48+
"skills",
49+
"mcp",
50+
"hooks",
51+
"ignore",
52+
"permissions"
53+
],
54+
"type": "array",
55+
"items": {
56+
"type": "string",
57+
"enum": [
58+
"rules",
59+
"commands",
60+
"agents",
61+
"skills",
62+
"mcp",
63+
"hooks",
64+
"ignore",
65+
"permissions"
66+
]
67+
}
68+
},
69+
"extends": {
70+
"default": [],
71+
"type": "array",
72+
"items": {
73+
"type": "object",
74+
"properties": {
75+
"name": {
76+
"type": "string"
77+
},
78+
"source": {
79+
"type": "string"
80+
},
81+
"version": {
82+
"type": "string"
83+
},
84+
"target": {
85+
"type": "string",
86+
"enum": [
87+
"claude-code",
88+
"cursor",
89+
"copilot",
90+
"continue",
91+
"junie",
92+
"kiro",
93+
"gemini-cli",
94+
"cline",
95+
"codex-cli",
96+
"windsurf",
97+
"antigravity",
98+
"roo-code"
99+
]
100+
},
101+
"features": {
102+
"type": "array",
103+
"items": {
104+
"type": "string",
105+
"enum": [
106+
"rules",
107+
"commands",
108+
"agents",
109+
"skills",
110+
"mcp",
111+
"hooks",
112+
"ignore",
113+
"permissions"
114+
]
115+
}
116+
},
117+
"path": {
118+
"type": "string"
119+
},
120+
"pick": {
121+
"type": "object",
122+
"properties": {
123+
"skills": {
124+
"type": "array",
125+
"items": {
126+
"type": "string"
127+
}
128+
},
129+
"commands": {
130+
"type": "array",
131+
"items": {
132+
"type": "string"
133+
}
134+
},
135+
"rules": {
136+
"type": "array",
137+
"items": {
138+
"type": "string"
139+
}
140+
},
141+
"agents": {
142+
"type": "array",
143+
"items": {
144+
"type": "string"
145+
}
146+
}
147+
},
148+
"additionalProperties": false
149+
}
150+
},
151+
"required": [
152+
"name",
153+
"source",
154+
"features"
155+
],
156+
"additionalProperties": false
157+
}
158+
},
159+
"overrides": {
160+
"default": {},
161+
"type": "object",
162+
"propertyNames": {
163+
"type": "string"
164+
},
165+
"additionalProperties": {
166+
"type": "object",
167+
"propertyNames": {
168+
"type": "string"
169+
},
170+
"additionalProperties": {}
171+
}
172+
},
173+
"collaboration": {
174+
"default": {
175+
"strategy": "merge",
176+
"lock_features": []
177+
},
178+
"type": "object",
179+
"properties": {
180+
"strategy": {
181+
"default": "merge",
182+
"type": "string",
183+
"enum": [
184+
"merge",
185+
"lock",
186+
"last-wins"
187+
]
188+
},
189+
"lock_features": {
190+
"default": [],
191+
"type": "array",
192+
"items": {
193+
"type": "string"
194+
}
195+
}
196+
},
197+
"required": [
198+
"strategy",
199+
"lock_features"
200+
],
201+
"additionalProperties": false
202+
},
203+
"conversions": {
204+
"type": "object",
205+
"properties": {
206+
"commands_to_skills": {
207+
"type": "object",
208+
"properties": {
209+
"codex-cli": {
210+
"type": "boolean"
211+
}
212+
},
213+
"additionalProperties": false
214+
},
215+
"agents_to_skills": {
216+
"type": "object",
217+
"properties": {
218+
"gemini-cli": {
219+
"type": "boolean"
220+
},
221+
"cline": {
222+
"type": "boolean"
223+
},
224+
"codex-cli": {
225+
"type": "boolean"
226+
},
227+
"windsurf": {
228+
"type": "boolean"
229+
}
230+
},
231+
"additionalProperties": false
232+
}
233+
},
234+
"additionalProperties": false
235+
}
236+
},
237+
"required": [
238+
"version",
239+
"targets",
240+
"features",
241+
"extends",
242+
"overrides",
243+
"collaboration"
244+
],
245+
"additionalProperties": false,
246+
"title": "agentsmesh.yaml",
247+
"description": "AgentsMesh configuration file (agentsmesh.yaml / agentsmesh.local.yaml)"
248+
}

schemas/hooks.json

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/2020-12/schema",
3+
"type": "object",
4+
"propertyNames": {
5+
"type": "string"
6+
},
7+
"additionalProperties": {
8+
"type": "array",
9+
"items": {
10+
"type": "object",
11+
"properties": {
12+
"matcher": {
13+
"type": "string",
14+
"description": "Tool name pattern to match (e.g. \"Edit|Write\", \"Bash\", \"*\")"
15+
},
16+
"command": {
17+
"type": "string",
18+
"description": "Shell command to run"
19+
},
20+
"type": {
21+
"description": "Hook entry type",
22+
"type": "string",
23+
"enum": [
24+
"command",
25+
"prompt"
26+
]
27+
},
28+
"timeout": {
29+
"description": "Timeout in milliseconds",
30+
"type": "number"
31+
},
32+
"prompt": {
33+
"description": "Prompt text (when type is prompt)",
34+
"type": "string"
35+
}
36+
},
37+
"required": [
38+
"matcher",
39+
"command"
40+
],
41+
"additionalProperties": false,
42+
"description": "A single lifecycle hook entry"
43+
}
44+
},
45+
"description": "AgentsMesh lifecycle hooks (.agentsmesh/hooks.yaml)",
46+
"title": "agentsmesh-hooks.yaml"
47+
}

0 commit comments

Comments
 (0)