From f06dc6f39d2c008eb78a7371f6e0bd225460100f Mon Sep 17 00:00:00 2001 From: Fatih Guner Date: Sat, 5 Sep 2026 14:08:16 +0300 Subject: [PATCH] Report the installed release version from generated catalogs --- .claude/catalog.json | 6 ++++++ .claude/commands/meta-commands.md | 10 ++++++---- lib/distribution.js | 5 ++++- plugins/foreman/content/catalog.json | 6 ++++++ plugins/foreman/content/commands/meta-commands.md | 10 ++++++---- scripts/check-release.mjs | 3 +++ 6 files changed, 31 insertions(+), 9 deletions(-) diff --git a/.claude/catalog.json b/.claude/catalog.json index ec875f5..5c3502f 100644 --- a/.claude/catalog.json +++ b/.claude/catalog.json @@ -1,4 +1,10 @@ { + "release": { + "version": "1.1.0-rc.1", + "license": "MIT", + "repository": "git+https://github.com/fatihguner/foreman.git", + "homepage": "https://foreman.sh" + }, "entries": [ { "id": "diagnostic-agent", diff --git a/.claude/commands/meta-commands.md b/.claude/commands/meta-commands.md index 11c2fb5..e92df1f 100644 --- a/.claude/commands/meta-commands.md +++ b/.claude/commands/meta-commands.md @@ -45,7 +45,7 @@ Foreman — AI-Powered Strategic Advisor for Entrepreneurs Open-source, framework-driven guidance via skills, agents, hooks, and memory. Input --> Diagnostics --> Hooks --> Agent --> Skills --> Template --> Memory Adapts to stage (idea through scale). Context accumulates across sessions. -foreman.sh | github.com/anthropics/foreman | License: TBD +foreman.sh | github.com/fatihguner/foreman | License: MIT > /about --verbose Unknown flag: "--verbose". /about takes no parameters. ``` @@ -57,14 +57,16 @@ Unknown flag: "--verbose". /about takes no parameters. Show system version and component counts. +Read the installed `catalog.json`: use `release.version` for the version, `release.license` for the license, and count `entries` by kind. Do not copy the illustrative values below or infer the installed version from an online release. If release metadata is missing, report that the installed version is unknown. + **Syntax:** `/version` | **Parameters:** None. **Examples:** ``` > /version -Foreman v0.1.0 -Skills: 158 Templates: 48 Diagnostics: 20 Playbooks: 20 -Hooks: 16 Agents: 6 Memory layers: 5 +Foreman v +Skills: 158 Templates: 58 (48 core + 10 support) Diagnostics: 24 Playbooks: 21 +Hooks: 17 Agents: 6 > /version skills Unknown argument: "skills". /version takes no parameters. Try /help skill. ``` diff --git a/lib/distribution.js b/lib/distribution.js index 31c6edb..0fa6438 100644 --- a/lib/distribution.js +++ b/lib/distribution.js @@ -44,7 +44,10 @@ export function buildPlugins(root) { for (const [name,spec] of commands) write(path.join(root,'.claude/plugin-commands',`${name}.md`),commandText(name,spec,'${CLAUDE_PLUGIN_ROOT}/.claude',true)); // Read-only distribution metadata; user state is never stored here. const cat = catalog(root); - const index = { entries: cat.entries.map(({ id, kind, relative, category }) => ({ id, kind, path: relative, category })), aliases: cat.aliases, commands: Object.fromEntries([...commands].map(([k,v]) => [v.id,k])) }; + const manifest = path.join(root, 'package.json'); + const pkg = fs.existsSync(manifest) ? JSON.parse(fs.readFileSync(manifest, 'utf8')) : null; + const release = pkg ? { version: pkg.version, license: pkg.license, repository: pkg.repository?.url, homepage: pkg.homepage } : undefined; + const index = { release, entries: cat.entries.map(({ id, kind, relative, category }) => ({ id, kind, path: relative, category })), aliases: cat.aliases, commands: Object.fromEntries([...commands].map(([k,v]) => [v.id,k])) }; write(path.join(root, '.claude/catalog.json'), JSON.stringify(index, null, 2) + '\n'); const target = path.join(root, 'plugins/foreman'); for (const dir of ['content','skills','commands']) fs.rmSync(path.join(target, dir), { recursive: true, force: true }); diff --git a/plugins/foreman/content/catalog.json b/plugins/foreman/content/catalog.json index ec875f5..5c3502f 100644 --- a/plugins/foreman/content/catalog.json +++ b/plugins/foreman/content/catalog.json @@ -1,4 +1,10 @@ { + "release": { + "version": "1.1.0-rc.1", + "license": "MIT", + "repository": "git+https://github.com/fatihguner/foreman.git", + "homepage": "https://foreman.sh" + }, "entries": [ { "id": "diagnostic-agent", diff --git a/plugins/foreman/content/commands/meta-commands.md b/plugins/foreman/content/commands/meta-commands.md index 11c2fb5..e92df1f 100644 --- a/plugins/foreman/content/commands/meta-commands.md +++ b/plugins/foreman/content/commands/meta-commands.md @@ -45,7 +45,7 @@ Foreman — AI-Powered Strategic Advisor for Entrepreneurs Open-source, framework-driven guidance via skills, agents, hooks, and memory. Input --> Diagnostics --> Hooks --> Agent --> Skills --> Template --> Memory Adapts to stage (idea through scale). Context accumulates across sessions. -foreman.sh | github.com/anthropics/foreman | License: TBD +foreman.sh | github.com/fatihguner/foreman | License: MIT > /about --verbose Unknown flag: "--verbose". /about takes no parameters. ``` @@ -57,14 +57,16 @@ Unknown flag: "--verbose". /about takes no parameters. Show system version and component counts. +Read the installed `catalog.json`: use `release.version` for the version, `release.license` for the license, and count `entries` by kind. Do not copy the illustrative values below or infer the installed version from an online release. If release metadata is missing, report that the installed version is unknown. + **Syntax:** `/version` | **Parameters:** None. **Examples:** ``` > /version -Foreman v0.1.0 -Skills: 158 Templates: 48 Diagnostics: 20 Playbooks: 20 -Hooks: 16 Agents: 6 Memory layers: 5 +Foreman v +Skills: 158 Templates: 58 (48 core + 10 support) Diagnostics: 24 Playbooks: 21 +Hooks: 17 Agents: 6 > /version skills Unknown argument: "skills". /version takes no parameters. Try /help skill. ``` diff --git a/scripts/check-release.mjs b/scripts/check-release.mjs index 2ff3b24..927dc54 100644 --- a/scripts/check-release.mjs +++ b/scripts/check-release.mjs @@ -14,6 +14,9 @@ for (const file of ['.claude-plugin/plugin.json', '.codex-plugin/plugin.json', ' assert.equal(json(file).version, pkg.version, `Version mismatch: ${file}`); } assert.equal(json('package-lock.json').packages[''].version, pkg.version); +for (const file of ['.claude/catalog.json', 'plugins/foreman/content/catalog.json']) { + assert.equal(json(file).release.version, pkg.version, `Installed version metadata mismatch: ${file}`); +} const marketplace = json('.claude-plugin/marketplace.json'); assert.equal(marketplace.metadata.version, pkg.version); assert.equal(marketplace.plugins.find(p => p.name === 'foreman').version, pkg.version);