skillwiki 0.9.51 → 0.9.52

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.
@@ -1823,9 +1823,9 @@ async function runStale(input) {
1823
1823
  if (input.project && !project.includes(input.project)) return null;
1824
1824
  let inferred = false;
1825
1825
  if (input.forceScan && !kind) {
1826
- const basename3 = t.relPath.split("/").pop();
1827
- if (!LOOP_CYCLE_PATTERN.test(basename3)) {
1828
- const m = basename3.match(KIND_FROM_FILENAME);
1826
+ const basename4 = t.relPath.split("/").pop();
1827
+ if (!LOOP_CYCLE_PATTERN.test(basename4)) {
1828
+ const m = basename4.match(KIND_FROM_FILENAME);
1829
1829
  if (m) {
1830
1830
  kind = m[1];
1831
1831
  inferred = true;
@@ -6757,8 +6757,46 @@ function readCliPackageJson(baseUrl = import.meta.url) {
6757
6757
 
6758
6758
  // src/commands/project-index.ts
6759
6759
  import { readdir as readdir4, readFile as readFile16, writeFile as writeFile6, mkdir as mkdir5 } from "fs/promises";
6760
- import { join as join23, dirname as dirname8 } from "path";
6760
+ import { join as join23, dirname as dirname8, basename as basename2 } from "path";
6761
6761
  var LAYER2_DIRS = ["entities", "concepts", "comparisons", "queries", "meta"];
6762
+ var PROJECT_LOCAL_DIRS = ["requirements", "work", "architecture", "history"];
6763
+ async function scanMarkdownTree(rootAbs, rootRel) {
6764
+ const found = [];
6765
+ let entries;
6766
+ try {
6767
+ entries = await readdir4(rootAbs, { withFileTypes: true });
6768
+ } catch {
6769
+ return found;
6770
+ }
6771
+ for (const entry of entries) {
6772
+ const abs = join23(rootAbs, entry.name);
6773
+ const rel = `${rootRel}/${entry.name}`;
6774
+ if (entry.isDirectory()) {
6775
+ found.push(...await scanMarkdownTree(abs, rel));
6776
+ } else if (entry.isFile() && entry.name.endsWith(".md")) {
6777
+ found.push(rel);
6778
+ }
6779
+ }
6780
+ return found;
6781
+ }
6782
+ function projectLocalType(slug, page, data) {
6783
+ if (page.startsWith(`projects/${slug}/requirements/`)) return "requirement";
6784
+ if (page.startsWith(`projects/${slug}/work/`)) {
6785
+ if (typeof data.kind === "string") return data.kind;
6786
+ const name = basename2(page, ".md");
6787
+ if (name === "spec" || name === "plan" || name === "retro") return name;
6788
+ return "work";
6789
+ }
6790
+ if (page.startsWith(`projects/${slug}/architecture/`)) {
6791
+ return typeof data.type === "string" ? data.type : "architecture";
6792
+ }
6793
+ if (page.startsWith(`projects/${slug}/history/`)) {
6794
+ if (typeof data.kind === "string") return data.kind;
6795
+ if (typeof data.type === "string") return data.type;
6796
+ return "history";
6797
+ }
6798
+ return typeof data.type === "string" ? data.type : "project";
6799
+ }
6762
6800
  async function runProjectIndex(input) {
6763
6801
  const slug = input.slug;
6764
6802
  const projectDir = join23(input.vault, "projects", slug);
@@ -6821,7 +6859,28 @@ async function runProjectIndex(input) {
6821
6859
  });
6822
6860
  }
6823
6861
  }
6824
- const typeOrder = { entity: 0, concept: 1, comparison: 2, query: 3, summary: 4, meta: 5, pattern: 6, gotcha: 7, lesson: 8, antipattern: 9, compound: 10 };
6862
+ for (const dir of PROJECT_LOCAL_DIRS) {
6863
+ const rootAbs = join23(projectDir, dir);
6864
+ const rootRel = `projects/${slug}/${dir}`;
6865
+ const pages = await scanMarkdownTree(rootAbs, rootRel);
6866
+ for (const page of pages) {
6867
+ const filePath = join23(input.vault, page);
6868
+ let text;
6869
+ try {
6870
+ text = await readFile16(filePath, "utf8");
6871
+ } catch {
6872
+ continue;
6873
+ }
6874
+ const fm = extractFrontmatter(text);
6875
+ if (!fm.ok) continue;
6876
+ entries.push({
6877
+ page,
6878
+ type: projectLocalType(slug, page, fm.data),
6879
+ title: typeof fm.data.title === "string" ? fm.data.title : basename2(page, ".md")
6880
+ });
6881
+ }
6882
+ }
6883
+ const typeOrder = { entity: 0, concept: 1, comparison: 2, query: 3, summary: 4, meta: 5, requirement: 6, spec: 7, plan: 8, retro: 9, architecture: 10, pattern: 11, gotcha: 12, lesson: 13, antipattern: 14, compound: 15, work: 16, history: 17 };
6825
6884
  entries.sort((a, b) => {
6826
6885
  const ta = typeOrder[a.type] ?? 99;
6827
6886
  const tb = typeOrder[b.type] ?? 99;
@@ -6985,7 +7044,7 @@ ${input.text.trim()}
6985
7044
  // src/commands/memory.ts
6986
7045
  import { createHash as createHash6 } from "crypto";
6987
7046
  import { mkdir as mkdir7, readFile as readFile17, readdir as readdir5, stat as stat5, writeFile as writeFile8 } from "fs/promises";
6988
- import { basename as basename2, extname, join as join25, relative as relative4, sep as sep4 } from "path";
7047
+ import { basename as basename3, extname, join as join25, relative as relative4, sep as sep4 } from "path";
6989
7048
  async function runMemoryTopics(input) {
6990
7049
  const scan = await scanVault(input.vault);
6991
7050
  if (!scan.ok) return { exitCode: ExitCode.VAULT_PATH_INVALID, result: scan };
@@ -7700,7 +7759,7 @@ async function buildImportEntry(file, sourceRoot, project, today, maxBytes) {
7700
7759
  }
7701
7760
  const redacted = redactSensitiveContent(extracted, { file });
7702
7761
  const privacy = redacted.findings.length > 0 ? "sensitive" : "local";
7703
- const sourceSlug = slugify2(basename2(file, extname(file)));
7762
+ const sourceSlug = slugify2(basename3(file, extname(file)));
7704
7763
  const relSource = relative4(sourceRoot, file).split(sep4).join("/");
7705
7764
  const entry = {
7706
7765
  ...baseEntry,
@@ -7759,7 +7818,7 @@ function renderImportCapture(entry, content, project, today) {
7759
7818
  `source_paths: ["${entry.source_path.replaceAll('"', '\\"')}"]`,
7760
7819
  "---",
7761
7820
  "",
7762
- `# Imported Memory: ${basename2(entry.source_path, extname(entry.source_path))}`,
7821
+ `# Imported Memory: ${basename3(entry.source_path, extname(entry.source_path))}`,
7763
7822
  "",
7764
7823
  `Source kind: ${entry.source_kind}`,
7765
7824
  "",
@@ -7774,7 +7833,7 @@ function hiddenString(entry, key) {
7774
7833
  }
7775
7834
  function classifyImportSource(file) {
7776
7835
  const rel = file.split(sep4).join("/");
7777
- const name = basename2(file);
7836
+ const name = basename3(file);
7778
7837
  if (rel.includes("/.codex/memories/")) return "codex-memory";
7779
7838
  if (rel.includes("/.codex/rules/")) return "codex-rule";
7780
7839
  if (rel.includes("/.claude/") && name === "napkin.md") return "napkin";
package/dist/cli.js CHANGED
@@ -75,7 +75,7 @@ import {
75
75
  triggerAutoUpdate,
76
76
  writeCache,
77
77
  writeDotenv
78
- } from "./chunk-O3WK7GBV.js";
78
+ } from "./chunk-D6T7GSHK.js";
79
79
  import {
80
80
  normalizeDistTag
81
81
  } from "./chunk-E6UWZ3S3.js";
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  runSkillwikiMcpStdio
4
- } from "./chunk-O3WK7GBV.js";
4
+ } from "./chunk-D6T7GSHK.js";
5
5
  import "./chunk-E6UWZ3S3.js";
6
6
 
7
7
  // src/mcp-entry.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "skillwiki",
3
- "version": "0.9.51",
3
+ "version": "0.9.52",
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.9.51",
3
+ "version": "0.9.52",
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.9.51",
3
+ "version": "0.9.52",
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.9.51",
3
+ "version": "0.9.52",
4
4
  "private": true,
5
5
  "files": [
6
6
  "wiki-*",
@@ -15,6 +15,6 @@
15
15
 
16
16
  ## Knowledge Pages
17
17
 
18
- > Auto-populated: concept and entity pages with `provenance_projects: [[{{slug}}]]` are listed here.
18
+ > Auto-populated: Layer 2 pages with `provenance_projects: [[{{slug}}]]` plus project-local lifecycle pages are listed here.
19
19
 
20
- Run `skillwiki project-index {{slug}} --apply` to generate `knowledge.md` listing all Layer 2 pages that reference `[[{{slug}}]]` in their provenance_projects.
20
+ Run `skillwiki project-index {{slug}} --apply` to regenerate `knowledge.md`. Do not hand-edit `knowledge.md`; update source page frontmatter or project-local lifecycle pages, then regenerate.