fix: remove invalid $schema/extensions from plugin manifest; this was why the installed plugin exposed zero agents/skills

Root-caused live: declaring the agent-plugins.org $schema in plugin.json
opts Copilot CLI into Open Plugin Spec mode, under which the flat
agents/skills fields are silently ignored (0 loaded, no error). Combined
with the pre-existing nested extensions.com.github.copilot.* structure
(also not a real field), the installed plugin contributed zero agents and
zero skills to any consuming project — only this repo's own working copy
worked, because Copilot CLI separately auto-loads .github/agents and
.github/skills for the current git root regardless of any plugin.

Fix: drop $schema entirely, use flat top-level agents/skills/mcpServers
fields (matches the documented, non-spec plugin.json schema). Updated
validate.mjs to error on $schema/extensions instead of recommending them,
and to check the real agents/skills path fields.
This commit is contained in:
2026-09-10 01:26:38 +02:00
parent 721b06cee7
commit 0e0e7d6bd4
3 changed files with 19 additions and 8 deletions
-1
View File
@@ -1,5 +1,4 @@
{
"$schema": "https://agent-plugins.org/schemas/1.0.0/marketplace.schema.json",
"name": "redsen",
"owner": {
"name": "Redsen",
-1
View File
@@ -1,5 +1,4 @@
{
"$schema": "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json",
"name": "redsen-lean-harness",
"description": "Imperative, token-lean, self-documenting agent harness. Spec-driven pipeline with a Ralph implement/verify loop, dynamic parallel worktree lanes, file-based memory, tree-sitter repo index, and zero-server telemetry. Works in GitHub Copilot CLI and VS Code Copilot.",
"version": "0.1.0",
+19 -6
View File
@@ -110,14 +110,27 @@ function validatePlugin() {
if (manifest.version && !/^\d+\.\d+\.\d+(-[\w.]+)?(\+[\w.]+)?$/.test(manifest.version)) {
error(file, `version "${manifest.version}" is not semver`);
}
if (!manifest.$schema?.includes('agent-plugins.org')) {
warn(file, 'missing the agent-plugins.org $schema reference');
// NOTE: do NOT set $schema to the agent-plugins.org Open Plugin Spec URL.
// Verified against a real Copilot CLI 1.0.83 install: declaring $schema
// opts the manifest into Open Plugin Spec mode, which silently drops the
// plugin's agents/skills (0 loaded) instead of reading the flat fields
// below. Component paths must be flat top-level fields, not nested under
// an "extensions" object (that key means something unrelated in the
// non-spec schema and is also silently ignored when present as an object).
if (manifest.$schema) {
error(file, '"$schema" must not be set \u2014 it silently disables agent/skill loading in Copilot CLI');
}
if (manifest.extensions) {
error(file, '"extensions" is not a valid location for agents/skills \u2014 use top-level "agents"/"skills" fields');
}
const ext = manifest.extensions?.['com.github.copilot'] ?? {};
for (const [key, target] of Object.entries(ext)) {
const abs = path.resolve(ROOT, target);
if (!fs.existsSync(abs)) error(file, `extensions.com.github.copilot.${key} points at missing path "${target}"`);
for (const key of ['agents', 'skills']) {
const target = manifest[key];
if (!target) continue;
for (const rel of Array.isArray(target) ? target : [target]) {
const abs = path.resolve(ROOT, rel);
if (!fs.existsSync(abs)) error(file, `${key} points at missing path "${rel}"`);
}
}
return manifest;
}