Skip to content

A self-organizing Obsidian vault that gives AI coding agents persistent memory.

refactor: move scripts/ to .scripts/ (#149)

Brenno Ferrari34937c5ad99a
diff --git a/.claude/scripts/lib/qmd-bootstrap.ts b/.claude/scripts/lib/qmd-bootstrap.ts
index a39c466..a6ec1f7 100644
--- a/.claude/scripts/lib/qmd-bootstrap.ts
+++ b/.claude/scripts/lib/qmd-bootstrap.ts
@@ -1,5 +1,5 @@
/**
- * Pure helpers for `scripts/qmd-bootstrap.ts`, factored out for unit-testing
+ * Pure helpers for `.scripts/qmd-bootstrap.ts`, factored out for unit-testing
* without spawning qmd.
*
* Two qmd-2.x quirks drive the shape here. Its CLI runs `util.parseArgs` with
diff --git a/.claude/scripts/session-start.ts b/.claude/scripts/session-start.ts
index 196ed76..22f450b 100644
--- a/.claude/scripts/session-start.ts
+++ b/.claude/scripts/session-start.ts
@@ -226,7 +226,7 @@ const bootstrapNeeded = qmdEntry !== null && qmdStoreLooksEmpty(qmdIndex);
const qmdUpdate = bootstrapNeeded
? {
cmd: process.execPath,
- args: ["--experimental-strip-types", "scripts/qmd-bootstrap.ts"],
+ args: ["--experimental-strip-types", ".scripts/qmd-bootstrap.ts"],
shell: false,
}
: buildQmdCommand(qmdEntry, qmdArgsWithIndex(qmdIndex, ["update"]));
diff --git a/.claude/skills/qmd/SKILL.md b/.claude/skills/qmd/SKILL.md
index 6ac4865..f20adbf 100644
--- a/.claude/skills/qmd/SKILL.md
+++ b/.claude/skills/qmd/SKILL.md
@@ -59,7 +59,7 @@ Each operation lists the MCP call first, then the CLI equivalent. Prefer MCP whe
The QMD SQLite store lives outside the repo (`~/.cache/qmd/<index>.sqlite`), so a fresh clone starts with no index. Run the bootstrap once:
```bash
-node --experimental-strip-types scripts/qmd-bootstrap.ts
+node --experimental-strip-types .scripts/qmd-bootstrap.ts
```
It reads `qmd_index` and `qmd_context` from `vault-manifest.json`, registers the collection, attaches the vault context, walks the vault, and generates embeddings. Idempotent — safe to re-run.
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index 38086a6..30be6b6 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -5,13 +5,13 @@ on:
branches: [main]
paths:
- '.claude/scripts/**'
- - 'scripts/**'
+ - '.scripts/**'
- '.shardmind/**'
- '.github/workflows/test.yml'
pull_request:
paths:
- '.claude/scripts/**'
- - 'scripts/**'
+ - '.scripts/**'
- '.shardmind/**'
- '.github/workflows/test.yml'
diff --git a/.obsidian/app.json b/.obsidian/app.json
index 5c9c2fc..de2b324 100644
--- a/.obsidian/app.json
+++ b/.obsidian/app.json
@@ -8,6 +8,7 @@
"CHANGELOG.md",
"CONTRIBUTING.md",
".claude/",
+ ".scripts/",
".claude-plugin/",
".codex/",
".gemini/",
diff --git a/scripts/package.json b/.scripts/package.json
similarity index 100%
rename from scripts/package.json
rename to .scripts/package.json
diff --git a/scripts/qmd-bootstrap.ts b/.scripts/qmd-bootstrap.ts
similarity index 99%
rename from scripts/qmd-bootstrap.ts
rename to .scripts/qmd-bootstrap.ts
index f5fa8b4..cbd7868 100644
--- a/scripts/qmd-bootstrap.ts
+++ b/.scripts/qmd-bootstrap.ts
@@ -25,7 +25,7 @@
* and Linux.
*
* Usage:
- * node --experimental-strip-types scripts/qmd-bootstrap.ts
+ * node --experimental-strip-types .scripts/qmd-bootstrap.ts
*/
import { spawnSync } from "node:child_process";
diff --git a/.shardmind/hooks/bootstrap.ts b/.shardmind/hooks/bootstrap.ts
index 98bd9da..88804d1 100644
--- a/.shardmind/hooks/bootstrap.ts
+++ b/.shardmind/hooks/bootstrap.ts
@@ -29,12 +29,12 @@ import { access } from 'node:fs/promises';
import { join } from 'node:path';
// Vault-relative path to the QMD bootstrap script. Centralized so a future
-// rename is a one-line change. Lives at vault root under `scripts/`, not
+// rename is a one-line change. Lives at vault root under `.scripts/`, not
// `.claude/scripts/` — the README's QMD setup section invokes the same path
-// (`node --experimental-strip-types scripts/qmd-bootstrap.ts`), and changing
+// (`node --experimental-strip-types .scripts/qmd-bootstrap.ts`), and changing
// it would silently desync the manual setup path from the hook's automated
// one.
-const QMD_BOOTSTRAP_RELATIVE = 'scripts/qmd-bootstrap.ts';
+const QMD_BOOTSTRAP_RELATIVE = '.scripts/qmd-bootstrap.ts';
// Local mirror of ShardMind's BootstrapContext shape. Inlined (rather than
// imported from `shardmind/runtime`) so obsidian-mind has no shardmind
diff --git a/CLAUDE.md b/CLAUDE.md
index 0ff1229..e878db2 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -16,7 +16,7 @@ This vault has [obsidian-skills](https://github.com/kepano/obsidian-skills) inst
2. **`qmd --index <name> query|search|vsearch|get|multi-get`** — CLI fallback for one-off shell checks or when the MCP server is unavailable. Always pass `--index <name>` where `<name>` is the `qmd_index` field from `vault-manifest.json` so the SQLite store stays isolated from other vaults on the machine.
3. **Grep / Glob / Read** — last resort, only when QMD is not installed at all.
- The MCP server (`.mcp.json` → `.claude/scripts/qmd-mcp.mjs`), the CLI, and the SessionStart hook all read the same manifest field, so every surface scopes to the same store. On a fresh clone, run `node --experimental-strip-types scripts/qmd-bootstrap.ts` once to build the index. Note: the MCP connect-time banner can read "0 documents" when the server registers before the SessionStart reindex finishes — a stale snapshot, not the dead-search state the self-heal guards; don't diagnose it.
+ The MCP server (`.mcp.json` → `.claude/scripts/qmd-mcp.mjs`), the CLI, and the SessionStart hook all read the same manifest field, so every surface scopes to the same store. On a fresh clone, run `node --experimental-strip-types .scripts/qmd-bootstrap.ts` once to build the index. Note: the MCP connect-time banner can read "0 documents" when the server registers before the SessionStart reindex finishes — a stale snapshot, not the dead-search state the self-heal guards; don't diagnose it.
### Custom Slash Commands
diff --git a/README.ja.md b/README.ja.md
index a3279dc..976de3d 100644
--- a/README.ja.md
+++ b/README.ja.md
@@ -129,7 +129,7 @@ git clone https://github.com/breferrari/obsidian-mind.git
```bash
npm install -g @tobilu/qmd
-node --experimental-strip-types scripts/qmd-bootstrap.ts
+node --experimental-strip-types .scripts/qmd-bootstrap.ts
```
ブートストラップは冪等で、再実行しても安全です。`vault-manifest.json` の `qmd_index` と `qmd_context` フィールドを読み取り、名前付きインデックスを登録してエンベディングを生成します(デフォルトのインデックス名は `obsidian-mind`)。SessionStart フック、`.mcp.json` のラッパー、CLI コマンドはすべて同じマニフェストフィールドを参照するため、同一マシン上の他のボールトと QMD データが混ざりません。CLI 実行時は常に `--index <名前>` を渡してください:
@@ -367,6 +367,8 @@ templates/ YAMLフロントマター付きObsidianテンプレー
skills/ Obsidian + QMDスキル
settings.json 5つのフック設定
+.scripts/ ボールトレベルのツール — QMDブートストラップ(新規クローン時に一度実行)
+
.shardmind/ ShardMindサイドカー — `shardmind install`でインストールした場合のみ使用
shard.yaml マニフェスト(名前、バージョン、モジュール、フック)
shard-schema.yaml ウィザードの値 + モジュールゲーティング
diff --git a/README.ko.md b/README.ko.md
index a183a75..c771860 100644
--- a/README.ko.md
+++ b/README.ko.md
@@ -129,7 +129,7 @@ git clone https://github.com/breferrari/obsidian-mind.git
```bash
npm install -g @tobilu/qmd
-node --experimental-strip-types scripts/qmd-bootstrap.ts
+node --experimental-strip-types .scripts/qmd-bootstrap.ts
```
부트스트랩은 멱등성이 있어 재실행해도 안전합니다. `vault-manifest.json` 의 `qmd_index` 와 `qmd_context` 필드를 읽어 명명된 인덱스를 등록하고 임베딩을 생성합니다 (기본 인덱스 이름: `obsidian-mind`). SessionStart 훅, `.mcp.json` 래퍼, CLI 명령은 모두 동일한 매니페스트 필드를 참조하므로, 같은 머신의 다른 볼트와 QMD 데이터가 섞이지 않습니다. CLI 명령에는 항상 `--index <이름>` 을 전달하세요:
@@ -367,6 +367,8 @@ templates/ YAML 프론트매터가 포함된 Obsidian 템플릿
skills/ Obsidian + QMD 스킬
settings.json 5개 훅 설정
+.scripts/ 볼트 수준 도구 — QMD 부트스트랩 (새 클론에서 한 번 실행)
+
.shardmind/ ShardMind 사이드카 — `shardmind install`로 설치한 경우에만 사용
shard.yaml 매니페스트 (이름, 버전, 모듈, 훅)
shard-schema.yaml 마법사 값 + 모듈 게이팅
diff --git a/README.md b/README.md
index 0901634..90c775b 100644
--- a/README.md
+++ b/README.md
@@ -133,7 +133,7 @@ QMD is where most of the agent's retrieval intelligence comes from. Optional in
```bash
npm install -g @tobilu/qmd
-node --experimental-strip-types scripts/qmd-bootstrap.ts
+node --experimental-strip-types .scripts/qmd-bootstrap.ts
```
The bootstrap is idempotent — safe to re-run. It reads the `qmd_index` and `qmd_context` fields from `vault-manifest.json` (default index name: `obsidian-mind`), registers the collection, attaches the context, and builds the index + embeddings. The SessionStart hook and `.mcp.json` wrapper both read the same manifest field, so CLI queries, the MCP server, and the re-index all scope to the same named SQLite store. This isolates the vault from any other QMD-using vault on the same machine.
@@ -374,6 +374,8 @@ templates/ Obsidian templates with YAML frontmatter
skills/ Obsidian + QMD skills
settings.json 5 hooks configuration
+.scripts/ Vault-level tooling — QMD bootstrap (run once on a fresh clone)
+
.shardmind/ ShardMind sidecar — only used if installed via `shardmind install`
shard.yaml Manifest (name, version, modules, hooks)
shard-schema.yaml Wizard values + module gating
diff --git a/README.zh-CN.md b/README.zh-CN.md
index 9f8abbc..9310198 100644
--- a/README.zh-CN.md
+++ b/README.zh-CN.md
@@ -129,7 +129,7 @@ git clone https://github.com/breferrari/obsidian-mind.git
```bash
npm install -g @tobilu/qmd
-node --experimental-strip-types scripts/qmd-bootstrap.ts
+node --experimental-strip-types .scripts/qmd-bootstrap.ts
```
引导脚本是幂等的,可以安全地重复运行。它读取 `vault-manifest.json` 中的 `qmd_index` 和 `qmd_context` 字段,注册命名索引并生成嵌入向量(默认索引名:`obsidian-mind`)。SessionStart 钩子、`.mcp.json` 封装脚本和 CLI 命令都读取同一个清单字段,因此同一台机器上的其他 vault 不会与本 vault 的 QMD 数据混淆。CLI 命令始终需要传递 `--index <名称>`:
@@ -367,6 +367,8 @@ templates/ 带有 YAML frontmatter 的 Obsidian 模板
skills/ Obsidian + QMD 技能
settings.json 5 个钩子配置
+.scripts/ 仓库级工具 — QMD 引导脚本(新克隆时运行一次)
+
.shardmind/ ShardMind 旁挂目录——仅在通过 `shardmind install` 安装时使用
shard.yaml 清单文件(名称、版本、模块、钩子)
shard-schema.yaml 向导值 + 模块门控
diff --git a/brain/Skills.md b/brain/Skills.md
index 4084603..a802d8f 100644
--- a/brain/Skills.md
+++ b/brain/Skills.md
@@ -116,7 +116,7 @@ If QMD is installed (`npm install -g @tobilu/qmd`), the vault has semantic searc
- `qmd --index <name> vsearch "..."` — semantic vector search (exploratory)
- `qmd --index <name> update && qmd --index <name> embed` — refresh index after bulk changes
-SessionStart hook runs `qmd --index <name> update` automatically, reading the index name from the manifest. First-time setup on a fresh clone: `node --experimental-strip-types scripts/qmd-bootstrap.ts`. See `.claude/skills/qmd/SKILL.md` for full reference, and [[Memories]] for the topics QMD is most often asked to find across the vault.
+SessionStart hook runs `qmd --index <name> update` automatically, reading the index name from the manifest. First-time setup on a fresh clone: `node --experimental-strip-types .scripts/qmd-bootstrap.ts`. See `.claude/skills/qmd/SKILL.md` for full reference, and [[Memories]] for the topics QMD is most often asked to find across the vault.
## Workflow: Weekly Review
diff --git a/vault-manifest.json b/vault-manifest.json
index f06acc5..f171c55 100644
--- a/vault-manifest.json
+++ b/vault-manifest.json
@@ -35,7 +35,7 @@
".gemini/**",
"templates/**",
"bases/**",
- "scripts/**",
+ ".scripts/**",
"vault-manifest.json",
"obsidian-mind-logo.png",
"obsidian-mind-demo.gif",