skillwiki 0.2.0 → 0.2.1-beta.1

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/dist/cli.js CHANGED
@@ -1888,8 +1888,8 @@ async function runConfigPath(input) {
1888
1888
  }
1889
1889
 
1890
1890
  // src/commands/doctor.ts
1891
- import { existsSync as existsSync3, readdirSync, readFileSync as readFileSync3, statSync } from "fs";
1892
- import { join as join16 } from "path";
1891
+ import { existsSync as existsSync3, readdirSync, statSync } from "fs";
1892
+ import { join as join17 } from "path";
1893
1893
  import { execSync } from "child_process";
1894
1894
 
1895
1895
  // src/utils/auto-update.ts
@@ -1953,6 +1953,27 @@ function triggerAutoUpdate(home, currentVersion) {
1953
1953
  child.unref();
1954
1954
  }
1955
1955
 
1956
+ // src/utils/plugin-registry.ts
1957
+ import { readFileSync as readFileSync3 } from "fs";
1958
+ import { join as join16 } from "path";
1959
+ var REGISTRY_PATH = join16(".claude", "plugins", "installed_plugins.json");
1960
+ var PLUGIN_KEY = "skillwiki@llm-wiki";
1961
+ function readInstalledPlugins(home) {
1962
+ try {
1963
+ const raw = readFileSync3(join16(home, REGISTRY_PATH), "utf8");
1964
+ return JSON.parse(raw);
1965
+ } catch {
1966
+ return null;
1967
+ }
1968
+ }
1969
+ function findPlugin(home, key = PLUGIN_KEY) {
1970
+ const registry = readInstalledPlugins(home);
1971
+ if (!registry?.plugins) return null;
1972
+ const entries = registry.plugins[key];
1973
+ if (!entries || entries.length === 0) return null;
1974
+ return entries[0];
1975
+ }
1976
+
1956
1977
  // src/commands/doctor.ts
1957
1978
  function check(status, id, label, detail) {
1958
1979
  return { id, label, status, detail };
@@ -2008,9 +2029,9 @@ function checkVaultStructure(resolvedPath) {
2008
2029
  return check("error", "vault_structure", "Vault structure valid", "Cannot check \u2014 vault directory does not exist");
2009
2030
  }
2010
2031
  const missing = [];
2011
- if (!existsSync3(join16(resolvedPath, "SCHEMA.md"))) missing.push("SCHEMA.md");
2032
+ if (!existsSync3(join17(resolvedPath, "SCHEMA.md"))) missing.push("SCHEMA.md");
2012
2033
  for (const dir of ["raw", "entities", "concepts", "meta"]) {
2013
- if (!existsSync3(join16(resolvedPath, dir))) missing.push(dir + "/");
2034
+ if (!existsSync3(join17(resolvedPath, dir))) missing.push(dir + "/");
2014
2035
  }
2015
2036
  if (missing.length === 0) {
2016
2037
  return check("pass", "vault_structure", "Vault structure valid", "All required files and directories present");
@@ -2018,15 +2039,21 @@ function checkVaultStructure(resolvedPath) {
2018
2039
  return check("warn", "vault_structure", "Vault structure valid", `Missing: ${missing.join(", ")} \u2014 run \`skillwiki init\` to add CodeWiki structure`);
2019
2040
  }
2020
2041
  function checkSkillsInstalled(home) {
2021
- const skillsDir = join16(home, ".claude", "skills");
2022
- if (!existsSync3(skillsDir)) {
2023
- return check("warn", "skills_installed", "Skills installed", `${skillsDir} not found`);
2042
+ const plugin = findPlugin(home);
2043
+ if (plugin) {
2044
+ const found = findSkillMd(plugin.installPath);
2045
+ if (found.length > 0) {
2046
+ return check("pass", "skills_installed", "Skills installed", `${found.length} SKILL.md file(s) found (plugin v${plugin.version})`);
2047
+ }
2024
2048
  }
2025
- const found = findSkillMd(skillsDir);
2026
- if (found.length > 0) {
2027
- return check("pass", "skills_installed", "Skills installed", `${found.length} SKILL.md file(s) found`);
2049
+ const skillsDir = join17(home, ".claude", "skills");
2050
+ if (existsSync3(skillsDir)) {
2051
+ const found = findSkillMd(skillsDir);
2052
+ if (found.length > 0) {
2053
+ return check("pass", "skills_installed", "Skills installed", `${found.length} SKILL.md file(s) found (CLI install)`);
2054
+ }
2028
2055
  }
2029
- return check("warn", "skills_installed", "Skills installed", "No SKILL.md files found in ~/.claude/skills/");
2056
+ return check("warn", "skills_installed", "Skills installed", "No SKILL.md files found");
2030
2057
  }
2031
2058
  function checkNpmUpdate(home, currentVersion) {
2032
2059
  const { hasUpdate, latest } = latestFromCache(home, currentVersion);
@@ -2039,30 +2066,21 @@ function checkNpmUpdate(home, currentVersion) {
2039
2066
  return check("pass", "npm_update", "npm CLI version", `v${currentVersion} (latest: v${latest})`);
2040
2067
  }
2041
2068
  function checkPluginVersionDrift(home, currentVersion) {
2042
- const pluginJsonPath = join16(home, ".claude", "plugins", "cache", "llm-wiki", "plugin.json");
2043
- if (!existsSync3(pluginJsonPath)) {
2044
- return check("pass", "plugin_version_drift", "Plugin/CLI version", "Plugin cache not found \u2014 plugin not installed");
2069
+ const plugin = findPlugin(home);
2070
+ if (!plugin) {
2071
+ return check("pass", "plugin_version_drift", "Plugin/CLI version", "Plugin not installed \u2014 CLI only");
2045
2072
  }
2046
- try {
2047
- const content = readFileSync3(pluginJsonPath, { encoding: "utf8" });
2048
- const pluginData = JSON.parse(content);
2049
- const pluginVersion = pluginData.version;
2050
- if (!pluginVersion) {
2051
- return check("pass", "plugin_version_drift", "Plugin/CLI version", "Plugin version not found in cache");
2052
- }
2053
- if (pluginVersion === currentVersion) {
2054
- return check("pass", "plugin_version_drift", "Plugin/CLI version", `Both at v${currentVersion}`);
2055
- }
2056
- const updateCmd = semverGt(pluginVersion, currentVersion) ? "npm install -g skillwiki@beta" : "claude plugin update skillwiki@llm-wiki";
2057
- return check(
2058
- "warn",
2059
- "plugin_version_drift",
2060
- "Plugin/CLI version",
2061
- `Plugin v${pluginVersion} \u2260 CLI v${currentVersion} \u2014 run \`${updateCmd}\``
2062
- );
2063
- } catch {
2064
- return check("pass", "plugin_version_drift", "Plugin/CLI version", "Could not read plugin cache");
2073
+ const pluginVersion = plugin.version;
2074
+ if (pluginVersion === currentVersion) {
2075
+ return check("pass", "plugin_version_drift", "Plugin/CLI version", `Both at v${currentVersion}`);
2065
2076
  }
2077
+ const updateCmd = semverGt(pluginVersion, currentVersion) ? "npm install -g skillwiki@beta" : "claude plugin update skillwiki@llm-wiki";
2078
+ return check(
2079
+ "warn",
2080
+ "plugin_version_drift",
2081
+ "Plugin/CLI version",
2082
+ `Plugin v${pluginVersion} \u2260 CLI v${currentVersion} \u2014 run \`${updateCmd}\``
2083
+ );
2066
2084
  }
2067
2085
  async function checkProfiles(home) {
2068
2086
  const map = await parseDotenvFile(configPath(home));
@@ -2086,7 +2104,7 @@ async function checkProfiles(home) {
2086
2104
  }
2087
2105
  async function checkProjectLocalOverride(cwd) {
2088
2106
  const dir = cwd ?? process.cwd();
2089
- const envPath = join16(dir, ".skillwiki", ".env");
2107
+ const envPath = join17(dir, ".skillwiki", ".env");
2090
2108
  if (existsSync3(envPath)) {
2091
2109
  return check("pass", "project_local", "Project-local config", `Found: ${envPath}`);
2092
2110
  }
@@ -2102,9 +2120,9 @@ function findSkillMd(dir) {
2102
2120
  }
2103
2121
  for (const entry of entries) {
2104
2122
  if (entry.isFile() && entry.name === "SKILL.md") {
2105
- results.push(join16(dir, entry.name));
2123
+ results.push(join17(dir, entry.name));
2106
2124
  } else if (entry.isDirectory()) {
2107
- results.push(...findSkillMd(join16(dir, entry.name)));
2125
+ results.push(...findSkillMd(join17(dir, entry.name)));
2108
2126
  }
2109
2127
  }
2110
2128
  return results;
@@ -2148,7 +2166,7 @@ async function runDoctor(input) {
2148
2166
 
2149
2167
  // src/commands/archive.ts
2150
2168
  import { rename as rename3, mkdir as mkdir5, readFile as readFile13, writeFile as writeFile6 } from "fs/promises";
2151
- import { join as join17, dirname as dirname7 } from "path";
2169
+ import { join as join18, dirname as dirname7 } from "path";
2152
2170
  async function runArchive(input) {
2153
2171
  const scan = await scanVault(input.vault);
2154
2172
  if (!scan.ok) return { exitCode: ExitCode.VAULT_PATH_INVALID, result: scan };
@@ -2160,10 +2178,10 @@ async function runArchive(input) {
2160
2178
  }
2161
2179
  if (!relPath) return { exitCode: ExitCode.ARCHIVE_TARGET_NOT_FOUND, result: err("ARCHIVE_TARGET_NOT_FOUND", { page: input.page }) };
2162
2180
  if (relPath.startsWith("_archive/")) return { exitCode: ExitCode.ARCHIVE_ALREADY_ARCHIVED, result: err("ARCHIVE_ALREADY_ARCHIVED", { page: relPath }) };
2163
- const archivePath = join17("_archive", relPath);
2164
- await mkdir5(dirname7(join17(input.vault, archivePath)), { recursive: true });
2181
+ const archivePath = join18("_archive", relPath);
2182
+ await mkdir5(dirname7(join18(input.vault, archivePath)), { recursive: true });
2165
2183
  let indexUpdated = false;
2166
- const indexPath = join17(input.vault, "index.md");
2184
+ const indexPath = join18(input.vault, "index.md");
2167
2185
  try {
2168
2186
  const idx = await readFile13(indexPath, "utf8");
2169
2187
  const slug = relPath.replace(/\.md$/, "").split("/").pop();
@@ -2176,7 +2194,7 @@ async function runArchive(input) {
2176
2194
  } catch (e) {
2177
2195
  if (e?.code !== "ENOENT") throw e;
2178
2196
  }
2179
- await rename3(join17(input.vault, relPath), join17(input.vault, archivePath));
2197
+ await rename3(join18(input.vault, relPath), join18(input.vault, archivePath));
2180
2198
  return { exitCode: ExitCode.OK, result: ok({ archived_from: relPath, archived_to: archivePath, index_updated: indexUpdated, humanHint: `${relPath} -> ${archivePath}${indexUpdated ? " (index updated)" : ""}` }) };
2181
2199
  }
2182
2200
 
package/package.json CHANGED
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "name": "skillwiki",
3
- "version": "0.2.0",
3
+ "version": "0.2.1-beta.1",
4
+ "version": "0.2.1-beta.1",
4
5
  "type": "module",
5
6
  "bin": {
6
7
  "skillwiki": "dist/cli.js"
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "name": "skillwiki",
3
- "version": "0.2.0",
3
+ "version": "0.2.1-beta.1",
4
+ "version": "0.2.1-beta.1",
4
5
  "skills": "./",
5
6
  "description": "Project-aware Karpathy-style knowledge base for Claude Code: 11 prompt-only skills (wiki-*, proj-*, using-skillwiki) backed by the deterministic `skillwiki` CLI (8 subcommands, JSON-by-default).",
6
7
  "author": {
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "name": "@skillwiki/skills",
3
- "version": "0.2.0",
3
+ "version": "0.2.1-beta.1",
4
+ "version": "0.2.1-beta.1",
4
5
  "private": true,
5
6
  "files": [
6
7
  "wiki-*",