skillwiki 0.8.1-beta.3 → 0.8.1-beta.4

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
@@ -4986,6 +4986,55 @@ function findSkillNames(dir) {
4986
4986
  }
4987
4987
  return results;
4988
4988
  }
4989
+ var METRIC_TYPES = ["entities", "concepts", "comparisons", "queries", "meta"];
4990
+ async function vaultMetrics(resolvedPath) {
4991
+ const ids = [
4992
+ ["vault_metric_pages", "Vault pages by type"],
4993
+ ["vault_metric_orphans", "Vault orphan rate"],
4994
+ ["vault_metric_bridges", "Vault bridge count"],
4995
+ ["vault_metric_cohesion", "Mean community cohesion"],
4996
+ ["vault_metric_log_size", "Vault log size"]
4997
+ ];
4998
+ const noVault = () => ids.map(([id, label]) => check("info", id, label, "no vault configured"));
4999
+ if (!resolvedPath) return noVault();
5000
+ const scan = await scanVault(resolvedPath);
5001
+ if (!scan.ok) return noVault();
5002
+ const tk = scan.data.typedKnowledge;
5003
+ const perType = METRIC_TYPES.map((d) => `${d} ${tk.filter((p) => p.relPath.startsWith(d + "/")).length}`).join(", ");
5004
+ const adj = await buildWikilinkAdjacency(tk);
5005
+ const g = toUndirectedWeighted(adj);
5006
+ const nodes = [...g.keys()];
5007
+ const total = nodes.length;
5008
+ const orphanCount = nodes.filter((n) => g.get(n).size === 0).length;
5009
+ const orphanRate = total > 0 ? Math.round(orphanCount / total * 1e3) / 10 : 0;
5010
+ const comm = louvain(g);
5011
+ const groups = /* @__PURE__ */ new Map();
5012
+ for (const [node, c] of comm) {
5013
+ const arr = groups.get(c);
5014
+ if (arr) arr.push(node);
5015
+ else groups.set(c, [node]);
5016
+ }
5017
+ const cohesions = [...groups.values()].filter((m) => m.length >= 2).map((m) => communityCohesion(m, g));
5018
+ const meanCohesion = cohesions.length > 0 ? Math.round(cohesions.reduce((a, b) => a + b, 0) / cohesions.length * 1e3) / 1e3 : 0;
5019
+ let bridges = 0;
5020
+ for (const n of nodes) {
5021
+ const nbrComms = /* @__PURE__ */ new Set();
5022
+ for (const nb of g.get(n).keys()) nbrComms.add(comm.get(nb));
5023
+ if (nbrComms.size >= 3) bridges++;
5024
+ }
5025
+ let logLines = 0;
5026
+ try {
5027
+ logLines = readFileSync7(join26(resolvedPath, "log.md"), "utf8").split("\n").length;
5028
+ } catch {
5029
+ }
5030
+ return [
5031
+ check("info", "vault_metric_pages", "Vault pages by type", `${total} typed (${perType})`),
5032
+ check("info", "vault_metric_orphans", "Vault orphan rate", `${orphanRate}% (${orphanCount}/${total} degree-0)`),
5033
+ check("info", "vault_metric_bridges", "Vault bridge count", `${bridges} page(s) link >= 3 communities`),
5034
+ check("info", "vault_metric_cohesion", "Mean community cohesion", `${meanCohesion} across ${cohesions.length} communities (size >= 2)`),
5035
+ check("info", "vault_metric_log_size", "Vault log size", `${logLines} lines`)
5036
+ ];
5037
+ }
4989
5038
  async function runDoctor(input) {
4990
5039
  const checks = [];
4991
5040
  const vsConfig = readVaultSyncConfig(input.home);
@@ -5021,6 +5070,7 @@ async function runDoctor(input) {
5021
5070
  vaultSyncInstalled: vsConfig.installed,
5022
5071
  vaultSyncRole: vsConfig.role
5023
5072
  }));
5073
+ checks.push(...await vaultMetrics(resolvedPath));
5024
5074
  const summary = {
5025
5075
  pass: checks.filter((c) => c.status === "pass").length,
5026
5076
  info: checks.filter((c) => c.status === "info").length,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "skillwiki",
3
- "version": "0.8.1-beta.3",
3
+ "version": "0.8.1-beta.4",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "skillwiki": "dist/cli.js"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "skillwiki",
3
- "version": "0.8.1-beta.3",
3
+ "version": "0.8.1-beta.4",
4
4
  "skills": "./",
5
5
  "description": "Project-aware Karpathy-style knowledge base for Claude Code: 18 prompt-only skills (wiki-*, proj-*, using-skillwiki) backed by the deterministic `skillwiki` CLI.",
6
6
  "author": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "skillwiki",
3
- "version": "0.8.1-beta.3",
3
+ "version": "0.8.1-beta.4",
4
4
  "description": "Project-aware Karpathy-style knowledge base for Codex with 18 prompt-only skills backed by the deterministic skillwiki CLI.",
5
5
  "author": {
6
6
  "name": "karlorz",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skillwiki/skills",
3
- "version": "0.8.1-beta.3",
3
+ "version": "0.8.1-beta.4",
4
4
  "private": true,
5
5
  "files": [
6
6
  "wiki-*",