@codewizard-dt/bootstrap 2.21.0 → 2.23.0
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/lib/scripts/README.md +6 -4
- package/lib/scripts/backfill-wiki-aliases.js +161 -0
- package/lib/scripts/install-obsidian.sh +69 -2
- package/lib/scripts/lib.sh +10 -4
- package/lib/scripts/templates/bootstrap-prefs-schema.json +12 -3
- package/lib/scripts/templates/obsidian/graph.json +23 -0
- package/lib/scripts/templates/wiki/work/bugs/archive/index.md +4 -0
- package/lib/scripts/templates/wiki/work/decisions/archive/index.md +4 -0
- package/lib/scripts/templates/wiki/work/requirements/archive/index.md +4 -0
- package/lib/scripts/templates/wiki/work/roadmaps/archive/index.md +4 -0
- package/lib/scripts/templates/wiki/work/tasks/archive/index.md +4 -0
- package/lib/scripts/templates/wiki/work/uat/archive/index.md +4 -0
- package/lib/skills/bug-file/SKILL.md +1 -0
- package/lib/skills/decision-create/SKILL.md +5 -0
- package/lib/skills/req-create/SKILL.md +1 -0
- package/lib/skills/roadmap-create/SKILL.md +1 -0
- package/lib/skills/task-add/SKILL.md +1 -0
- package/lib/skills/uat-generate/SKILL.md +1 -0
- package/package.json +1 -1
package/lib/scripts/README.md
CHANGED
|
@@ -20,11 +20,12 @@ All scripts use `set -euo pipefail`. Every script that touches a target project
|
|
|
20
20
|
|
|
21
21
|
| Script | Used by | Purpose |
|
|
22
22
|
|--------|---------|---------|
|
|
23
|
-
| `lib.sh` | Every script above | Shared bash library: `resolve_project_dir` (path resolution + validation), `mcp_installed`/`serena_installed`/`detect_installed_mcps` (MCP state checks), `run_project_sync` (the common setup/update sequence: `install-global.sh --skip-mcps` first — hooks/skills/deny-list/hooks-wiring/fileSuggestion, offline-safe — then the guarded interactive MCP install, wiki scaffold, gitignore, MCP-tools guide, Serena bootstrap), and `prompt_yn`/`prompt_scope` (interactive prompt helpers). |
|
|
23
|
+
| `lib.sh` | Every script above | Shared bash library: `resolve_project_dir` (path resolution + validation), `mcp_installed`/`serena_installed`/`detect_installed_mcps` (MCP state checks), `run_project_sync` (the common setup/update sequence: `install-global.sh --skip-mcps` first — hooks/skills/deny-list/hooks-wiring/fileSuggestion, offline-safe — then the guarded interactive MCP install, wiki scaffold, gitignore, the wiki-alias backfill, Obsidian, MCP-tools guide, Serena bootstrap), and `prompt_yn`/`prompt_scope` (interactive prompt helpers). |
|
|
24
24
|
| `install-mcps.sh` | `install-global.sh`, `setup-project.sh`, `update-project.sh` | Installs Brave Search, Context7, Playwright, and (when a project dir is given) Serena. Two modes: non-interactive (`install-global.sh`'s default — installs everything missing at user scope) and `--interactive --project-dir <dir>` (prompts per-MCP and asks for scope, used by `setup`/`update`). Playwright has a dedicated conflict flow: registered as `playwright` (user scope) by default; when a project ships its own `playwright`, a git-tracked `.mcp.json` is never modified (interactive options: register ours as `playwright-shared` + disable the project entry machine-locally via `disabledMcpjsonServers` in `.claude/settings.local.json` / register alongside / skip), while a machine-local registration can be replaced or kept (ours then uses the alternate name). Non-interactive conflicts are left untouched with a hint. |
|
|
25
25
|
| `sync-wiki-scaffold.sh` | `setup-project.sh`, `update-project.sh`, `migrate-project.sh` | Scaffolds an **empty** wiki into the target project from `templates/wiki/`: creates `raw/` + all `wiki/` family directories, lifecycle docs, per-family `index.md`, and stub `index.md`/`log.md`. Copy-once for project-owned files; always-refreshes `conventions.md` and `lifecycle.md`. Delivers guides from `raw/guides/` tier-wise into `wiki/guides/`: `command-anti-patterns.md` required (always refreshed); `evals-framework.md` + `type-checking-templates/` optional (`--interactive` prompts on first delivery, sticky refresh once present — legacy `.docs/guides/` presence counts, opt out by deleting); migrates legacy `.docs/guides/` (template-owned files removed or relocated, deprecated `task-spec.md` deleted, empty dirs pruned). Also delivers the `## LLM Wiki` section and `.env` safety policy (copy-once, sentinel-guarded, from `templates/CLAUDE-wiki.md` / `templates/CLAUDE-env-safety.md`) into the target's `CLAUDE.md` — when a `CLAUDE.md` already exists without the schema, prompts whether to modify it or write `CLAUDE.local.md` instead (non-interactive default: `CLAUDE.local.md`). |
|
|
26
26
|
| `build-mcp-guide.sh` | `setup-project.sh`, `update-project.sh`, `migrate-project.sh` | Assembles `wiki/guides/mcp-tools.md` in the target project from the per-server stub files in `templates/guides/stubs/`, including only the sections for MCPs actually installed. |
|
|
27
27
|
| `bootstrap-serena.sh` | `setup-project.sh`, `update-project.sh` | Headlessly triggers `.serena/project.yml` creation via `claude --print` and enables the optional Serena tools needed by this template's workflow. Preflights `claude` and `python3`. |
|
|
28
|
+
| `backfill-wiki-aliases.js` | `lib.sh` (`run_project_sync`, unguarded — invoked via `node`, not direct exec) | Zero-dependency Node script that re-runs TASK-064's one-time sweep on every `setup`/`update`: scans every `wiki/work/<family>/` file (active + `archive/`, all 6 families) for one that carries `id:` but no `aliases:` yet, and inserts `aliases: [<id>]` immediately after the `id:` line. Idempotent and additive-only — a file that already has `aliases:` (inline or block-list form) is left completely untouched, never corrected or overwritten. Fixes drift (a hand-authored file, an older bootstrap checkout, a merge) that would otherwise leave a bare `[[TASK-NNN]]`-style wikilink dead in Obsidian — see `wiki/knowledge/sources/obsidian-alias-link-resolution.md` for why. Deliberately **out of scope: `wiki/knowledge/`** — a knowledge page's filename already equals its `id:` slug, so its wikilinks already resolve on Obsidian's plain filename match with no alias needed, and existing knowledge-page aliases are curated alternate names a script has no safe way to invent. Always exits 0 (same contract as `merge-settings-deny.js`/`merge-settings-hooks.js`) — warns and skips on anything unexpected rather than aborting the caller. |
|
|
28
29
|
| `merge-gitignore.sh` | `setup-project.sh`, `update-project.sh` | Fully interactive `.gitignore` merge — **nothing is ever added without asking**. The packaged template's titled sections are offered one by one (`Add/update .gitignore section '<title>' (N new line(s))? [y/N]`); sections with nothing new are skipped silently. Non-interactive runs (or no tty) change nothing at all. Never touches existing project content. Also offers (git repos only) to keep `.serena/`/`raw/`/`wiki/` out of git via **`.git/info/exclude`** — never `.gitignore`, which would blind Serena on the wiki (see `wiki/knowledge/concepts/git-ignore-tool-visibility.md`); per-machine and idempotent. `info/exclude` *is* honored by ripgrep-class walkers and the `@` file picker, so every machine-local exclusion this script manages — the wiki/agent-state dirs AND the `.claude/bootstrap-prefs.*` files, whichever of its prompts get answered and in whichever order — is written under **one shared, generic sentinel** (`# bootstrap machine-local (autocomplete-visible)`) that the `fileSuggestion` picker installed by `install-global.sh` reads back to restore `@`-autocomplete. The sentinel line itself is written proactively on every interactive run against a git repo, even if every exclude-affecting prompt is declined, so the anchor is always there regardless of which preferences got set; a project still carrying the old, separately-named pre-unification header is repaired onto the shared sentinel automatically. |
|
|
29
30
|
| `merge-settings-deny.js` | `install-global.sh` | Zero-dependency Node script that merges the canonical permission deny list (`templates/settings-deny.json` — `Bash(...)` command patterns plus `Edit(...)`/`Read(...)` file-tool patterns) into `~/.claude/settings.json` `permissions.deny`. Entries are opaque strings, so any rule form the permission system accepts merges unchanged. Additive union only: missing entries are appended, user entries are never removed or reordered, all other settings keys pass through untouched. Atomic write, preserves existing indentation, and always exits 0 (warns + skips on unparseable or unexpected file shapes so an install never aborts over a settings merge). `--target`/`--source` flags exist as test seams. A second mode, `--set-key <name> --set-value <json>`, merges a single top-level settings key instead of the deny list (used to register `fileSuggestion`): absent → set; already deep-equal → no-op; present but different → one-line warning and skip, never a clobber. Supplying `--set-key` skips the deny merge entirely; a malformed `--set-value` exits 1, since that is a call-site bug rather than a user's file. |
|
|
30
31
|
| `merge-settings-hooks.js` | `install-global.sh` | Zero-dependency Node sibling of `merge-settings-deny.js` (deliberately not a new mode of it — different, block-and-entry-aware semantics) that merges the canonical hook wiring (`templates/settings-hooks.json`) into the `hooks` key of `~/.claude/settings.json` with a "template owns its blocks" model: repo-owned entries (a `command` under `~/.claude/hooks/` whose basename appears in the template) are created or updated in place; matcher drift on a pure-owned block is adopted (a matcher rename ships without duplicating the block); user/foreign blocks and entries are never modified, reordered, or removed; a repo hook found relocated into a mixed block is warned about but not duplicated; no empty placeholder blocks are ever written. Always exits 0 (warns + skips on unparseable or unexpected file shapes so an install never aborts over a settings merge). `--target`/`--source` flags exist as test seams. |
|
|
@@ -367,7 +368,7 @@ real `lib/scripts/` file or one real `lib/skills/<name>/SKILL.md`, so
|
|
|
367
368
|
`"install-global.sh, /git-commit"` fails the suite by construction. Where a
|
|
368
369
|
run-time prompt exists, it is documented in the key's `detail`.
|
|
369
370
|
|
|
370
|
-
### The key registry — all
|
|
371
|
+
### The key registry — all 23 entries
|
|
371
372
|
|
|
372
373
|
Every key in `templates/bootstrap-prefs-schema.json`, grouped by `consumer` —
|
|
373
374
|
`installer` first, then `skill` — which is the same grouping and the same order
|
|
@@ -376,7 +377,7 @@ schema's `default` field; `unset` in that column means `default: null`, i.e. the
|
|
|
376
377
|
key resolves to `unset` until it is answered. This table is transcribed from the
|
|
377
378
|
JSON; if the two ever disagree, the JSON is right and this table is a bug.
|
|
378
379
|
|
|
379
|
-
#### `consumer: installer` —
|
|
380
|
+
#### `consumer: installer` — 17 entries, read by the setup/update scripts
|
|
380
381
|
|
|
381
382
|
| Key | Scope | Consumer | Values | Default | Asked by | What it does |
|
|
382
383
|
|-----|-------|----------|--------|---------|----------|--------------|
|
|
@@ -394,7 +395,8 @@ JSON; if the two ever disagree, the JSON is right and this table is a bug.
|
|
|
394
395
|
| `mcp.context7Scope` | global | installer | `user \| project` | `unset` | `lib.sh` | Registration scope for the Context7 MCP |
|
|
395
396
|
| `mcp.playwright` | global | installer | `true \| false` | `unset` | `install-mcps.sh` | Install the Playwright MCP for browser automation and UI testing |
|
|
396
397
|
| `obsidian.installApp` | global | installer | `true \| false` | `unset` | `install-obsidian.sh` | Install the Obsidian desktop app via the native package manager |
|
|
397
|
-
| `obsidian.plugins` | project | installer | `true \| false` | `unset` | `install-obsidian.sh` | Install the bundled Obsidian plugin set (Dataview, Graph Link Types, Breadcrumbs) |
|
|
398
|
+
| `obsidian.plugins` | project | installer | `true \| false` | `unset` | `install-obsidian.sh` | Install the bundled Obsidian plugin set (Dataview, Graph Link Types, Breadcrumbs, Front Matter Title, Alias Linker) |
|
|
399
|
+
| `obsidian.graphDefaults` | project | installer | `true \| false` | `unset` | `install-obsidian.sh` | Install default graph-view styling (`.obsidian/graph.json`) |
|
|
398
400
|
| `skills.pruneOrphans` | global | installer | `true \| false` | `unset` | `install-global.sh` | Delete stale skill folders in `~/.claude/skills/` left by the wiki rename |
|
|
399
401
|
|
|
400
402
|
The two **(pattern)** rows carry `"dynamic": true` and are key *families*, not
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Backfill `aliases: [<id>]` onto every wiki/work/ work-item file that has an
|
|
3
|
+
// id: field but no aliases: field yet — a repeatable version of TASK-064's
|
|
4
|
+
// one-time sweep (see
|
|
5
|
+
// wiki/work/tasks/archive/TASK-064-backfill-work-item-aliases.md), run on
|
|
6
|
+
// every setup/update so drift (a hand-authored file, an older bootstrap
|
|
7
|
+
// checkout, a merge) gets corrected automatically instead of silently
|
|
8
|
+
// reintroducing dead Obsidian wikilinks. Root cause is documented in
|
|
9
|
+
// wiki/knowledge/sources/obsidian-alias-link-resolution.md: Obsidian's
|
|
10
|
+
// wikilink click-resolver matches only real filenames, never frontmatter, so
|
|
11
|
+
// a work-item file named "<ID>-slug.md" never resolves a bare "[[<ID>]]"
|
|
12
|
+
// link unless its frontmatter carries a matching alias (the Alias Linker
|
|
13
|
+
// plugin, bundled by install-obsidian.sh, is what makes that fallback work).
|
|
14
|
+
//
|
|
15
|
+
// SCOPE: wiki/work/<family>/ only (requirements, decisions, roadmaps, tasks,
|
|
16
|
+
// uat, bugs), both the active directory and archive/. Knowledge pages
|
|
17
|
+
// (wiki/knowledge/) are deliberately NOT covered — a knowledge page's
|
|
18
|
+
// filename already equals its id: slug (e.g. serena-mcp-scope.md has
|
|
19
|
+
// id: serena-mcp-scope), so every existing `[[serena-mcp-scope]]`-style link
|
|
20
|
+
// already resolves on Obsidian's plain filename match, the very first step
|
|
21
|
+
// of resolution, before aliases: is ever consulted. Knowledge-page aliases
|
|
22
|
+
// are curated alternate names (e.g. id: andrej-karpathy -> aliases:
|
|
23
|
+
// [Karpathy]) added at ingest time by human/LLM judgment, not a mechanical
|
|
24
|
+
// function of id: or title: — a script has no safe value to invent there.
|
|
25
|
+
//
|
|
26
|
+
// IDEMPOTENT AND ADDITIVE-ONLY: a file that already has an aliases: field
|
|
27
|
+
// (any value) is left untouched — this only fills a gap, it never corrects
|
|
28
|
+
// or overwrites an existing alias.
|
|
29
|
+
//
|
|
30
|
+
// Always exits 0 — the caller (lib.sh's run_project_sync) must never abort a
|
|
31
|
+
// setup/update over a wiki content backfill. Warns to stderr and skips on
|
|
32
|
+
// anything unexpected (a project with no wiki/work/ yet, an unreadable or
|
|
33
|
+
// unwritable file, a malformed id: line) rather than failing.
|
|
34
|
+
//
|
|
35
|
+
// Usage: backfill-wiki-aliases.js <path-to-project>
|
|
36
|
+
|
|
37
|
+
'use strict';
|
|
38
|
+
|
|
39
|
+
const fs = require('fs');
|
|
40
|
+
const path = require('path');
|
|
41
|
+
|
|
42
|
+
const FAMILIES = ['requirements', 'decisions', 'roadmaps', 'tasks', 'uat', 'bugs'];
|
|
43
|
+
const EXCLUDED_BASENAMES = new Set(['index.md', 'lifecycle.md', '.gitkeep']);
|
|
44
|
+
|
|
45
|
+
/** Recursively collect every .md file under `dir` (active + archive/, since
|
|
46
|
+
* archive/ lives inside each family dir), skipping excluded meta filenames
|
|
47
|
+
* and the wiki/work/uat/screenshots/ directory (not a work-item directory). */
|
|
48
|
+
function collectMarkdownFiles(dir) {
|
|
49
|
+
if (!fs.existsSync(dir)) return [];
|
|
50
|
+
const out = [];
|
|
51
|
+
for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {
|
|
52
|
+
if (entry.name === 'screenshots') continue; // wiki/work/uat/screenshots/
|
|
53
|
+
const full = path.join(dir, entry.name);
|
|
54
|
+
if (entry.isDirectory()) {
|
|
55
|
+
out.push(...collectMarkdownFiles(full));
|
|
56
|
+
} else if (entry.isFile() && entry.name.endsWith('.md') && !EXCLUDED_BASENAMES.has(entry.name)) {
|
|
57
|
+
out.push(full);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
return out;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/** Extract the frontmatter block from a file's text as
|
|
64
|
+
* { open, block, close, index }, where `index` is the offset of `open` in
|
|
65
|
+
* `text` and `open + block + close` is the exact original frontmatter
|
|
66
|
+
* substring (delimiters included) — enough to splice a change back in
|
|
67
|
+
* without disturbing anything before or after it. Returns null if the file
|
|
68
|
+
* has no `---`-delimited frontmatter at all. */
|
|
69
|
+
function extractFrontmatter(text) {
|
|
70
|
+
const match = text.match(/^(---\r?\n)([\s\S]*?\r?\n)(---\r?\n)/);
|
|
71
|
+
if (!match) return null;
|
|
72
|
+
return { open: match[1], block: match[2], close: match[3], index: match.index };
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
function parseId(block) {
|
|
76
|
+
const match = block.match(/^id:\s*(\S+)\s*$/m);
|
|
77
|
+
return match ? match[1] : null;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
function hasAliases(block) {
|
|
81
|
+
return /^aliases:/m.test(block);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/** Insert `aliases: [<id>]` as a new line immediately after the id: line
|
|
85
|
+
* inside the frontmatter block, preserving the file's own line-ending style.
|
|
86
|
+
* Returns the whole updated file text, or null if the id: line could not be
|
|
87
|
+
* located inside the block (should not happen once parseId succeeded, but
|
|
88
|
+
* guarded rather than assumed). */
|
|
89
|
+
function insertAliases(text, fm, id) {
|
|
90
|
+
const eol = fm.open.includes('\r\n') ? '\r\n' : '\n';
|
|
91
|
+
const newBlock = fm.block.replace(/^(id:\s*\S+\s*)$/m, (line) => `${line}${eol}aliases: [${id}]`);
|
|
92
|
+
if (newBlock === fm.block) return null;
|
|
93
|
+
const before = text.slice(0, fm.index);
|
|
94
|
+
const after = text.slice(fm.index + fm.open.length + fm.block.length + fm.close.length);
|
|
95
|
+
return `${before}${fm.open}${newBlock}${fm.close}${after}`;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
function backfillProject(projectDir) {
|
|
99
|
+
const workRoot = path.join(projectDir, 'wiki', 'work');
|
|
100
|
+
if (!fs.existsSync(workRoot)) {
|
|
101
|
+
console.log(' wiki/work/ not found — nothing to backfill.');
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
let totalUpdated = 0;
|
|
106
|
+
for (const family of FAMILIES) {
|
|
107
|
+
const files = collectMarkdownFiles(path.join(workRoot, family));
|
|
108
|
+
|
|
109
|
+
for (const file of files) {
|
|
110
|
+
let text;
|
|
111
|
+
try {
|
|
112
|
+
text = fs.readFileSync(file, 'utf8');
|
|
113
|
+
} catch (err) {
|
|
114
|
+
console.error(` Warning: could not read ${path.relative(projectDir, file)} (${err.message})`);
|
|
115
|
+
continue;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
const fm = extractFrontmatter(text);
|
|
119
|
+
if (!fm) continue; // no frontmatter — not a work-item file
|
|
120
|
+
const id = parseId(fm.block);
|
|
121
|
+
if (id === null) continue; // meta-like file with no id: — nothing to backfill
|
|
122
|
+
if (hasAliases(fm.block)) continue; // already has aliases: — idempotent skip
|
|
123
|
+
|
|
124
|
+
const next = insertAliases(text, fm, id);
|
|
125
|
+
if (next === null) {
|
|
126
|
+
console.error(` Warning: could not locate an id: line to backfill in ${path.relative(projectDir, file)}`);
|
|
127
|
+
continue;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
try {
|
|
131
|
+
fs.writeFileSync(file, next);
|
|
132
|
+
} catch (err) {
|
|
133
|
+
console.error(` Warning: could not write ${path.relative(projectDir, file)} (${err.message})`);
|
|
134
|
+
continue;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
console.log(` + aliases: [${id}] -> ${path.relative(projectDir, file)}`);
|
|
138
|
+
totalUpdated++;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
if (totalUpdated === 0) {
|
|
143
|
+
console.log(' wiki/work/ aliases: all work-item files already up to date.');
|
|
144
|
+
} else {
|
|
145
|
+
console.log(` wiki/work/ aliases: backfilled ${totalUpdated} file${totalUpdated === 1 ? '' : 's'}.`);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
const projectDir = process.argv[2];
|
|
150
|
+
if (!projectDir) {
|
|
151
|
+
console.error('Usage: backfill-wiki-aliases.js <path-to-project>');
|
|
152
|
+
process.exit(0); // never abort the caller over a usage slip either
|
|
153
|
+
} else {
|
|
154
|
+
try {
|
|
155
|
+
backfillProject(projectDir);
|
|
156
|
+
} catch (err) {
|
|
157
|
+
console.error(` Warning: wiki alias backfill failed unexpectedly (${err.message}) — skipping.`);
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
process.exit(0);
|
|
@@ -26,6 +26,24 @@ PLUGIN_GRAPH_LINK_TYPES="natefrisch01/Graph-Link-Types"
|
|
|
26
26
|
# Breadcrumbs — verify SkepticMystic/breadcrumbs is still the maintained fork
|
|
27
27
|
# at install time (vs. a community fork) before relying on this constant.
|
|
28
28
|
PLUGIN_BREADCRUMBS="SkepticMystic/breadcrumbs"
|
|
29
|
+
# Displays a note's frontmatter `title` (matching this repo's own convention
|
|
30
|
+
# on every index.md and knowledge page) in place of the bare filename across
|
|
31
|
+
# the file explorer, tabs, search, and — the reason it's bundled here — the
|
|
32
|
+
# graph view. Installed/enabled like the other three, but
|
|
33
|
+
# its own per-surface toggles (Explorer, Graph, etc.) default OFF inside the
|
|
34
|
+
# plugin's own settings and are NOT scripted here: its internal data.json
|
|
35
|
+
# settings schema is undocumented/unversioned, so hardcoding it would be the
|
|
36
|
+
# same class of silent-failure risk BUG-0011 already taught this file to
|
|
37
|
+
# avoid. See the one-time manual step noted alongside the install below.
|
|
38
|
+
PLUGIN_FRONT_MATTER_TITLE="snezhig/obsidian-front-matter-title"
|
|
39
|
+
# Patches Obsidian's link-lookup step with an alias fallback (tries real
|
|
40
|
+
# filename resolution first, then a note's `aliases:` frontmatter) — the
|
|
41
|
+
# plugin half of ROADMAP-008's wikilink-resolution fix; the `aliases:`
|
|
42
|
+
# frontmatter half is scripted elsewhere. Self-described "experimental" in
|
|
43
|
+
# its own manifest.json and less widely used than the other four bundled
|
|
44
|
+
# plugins — verify johannrichard/alias-linker is still maintained at
|
|
45
|
+
# install time before relying on this constant.
|
|
46
|
+
PLUGIN_ALIAS_LINKER="johannrichard/alias-linker"
|
|
29
47
|
|
|
30
48
|
_install_obsidian_app() {
|
|
31
49
|
local os
|
|
@@ -227,6 +245,25 @@ _enable_obsidian_plugin() {
|
|
|
227
245
|
' "$vault_dir" "$id" || true
|
|
228
246
|
}
|
|
229
247
|
|
|
248
|
+
_install_obsidian_graph_defaults() {
|
|
249
|
+
local vault_dir="$1"
|
|
250
|
+
|
|
251
|
+
if ! mkdir -p "$vault_dir/.obsidian"; then
|
|
252
|
+
echo " WARNING: failed to create $vault_dir/.obsidian — skipping graph defaults." >&2
|
|
253
|
+
return
|
|
254
|
+
fi
|
|
255
|
+
|
|
256
|
+
if [ -f "$vault_dir/.obsidian/graph.json" ]; then
|
|
257
|
+
echo " .obsidian/graph.json already present — leaving your customization in place, skipping."
|
|
258
|
+
return 0
|
|
259
|
+
fi
|
|
260
|
+
|
|
261
|
+
if ! cp "$SCRIPT_DIR/templates/obsidian/graph.json" "$vault_dir/.obsidian/graph.json"; then
|
|
262
|
+
echo " WARNING: failed to install graph defaults — skipping." >&2
|
|
263
|
+
return
|
|
264
|
+
fi
|
|
265
|
+
}
|
|
266
|
+
|
|
230
267
|
# ---------------------------------------------------------------------------
|
|
231
268
|
# App install gate
|
|
232
269
|
#
|
|
@@ -266,7 +303,7 @@ if [ -z "$PROJECT_DIR" ]; then
|
|
|
266
303
|
else
|
|
267
304
|
install_plugins=false
|
|
268
305
|
if [ "$INTERACTIVE" = true ]; then
|
|
269
|
-
if prompt_yn_sticky obsidian.plugins "$PROJECT_DIR" "Install recommended Obsidian plugins (Dataview, Graph Link Types, Breadcrumbs) into this project's vault config? [Y/n]: "; then
|
|
306
|
+
if prompt_yn_sticky obsidian.plugins "$PROJECT_DIR" "Install recommended Obsidian plugins (Dataview, Graph Link Types, Breadcrumbs, Front Matter Title, Alias Linker) into this project's vault config? [Y/n]: "; then
|
|
270
307
|
install_plugins=true
|
|
271
308
|
fi
|
|
272
309
|
else
|
|
@@ -280,7 +317,7 @@ else
|
|
|
280
317
|
fi
|
|
281
318
|
|
|
282
319
|
if [ "$install_plugins" = true ]; then
|
|
283
|
-
for plugin_repo in "$PLUGIN_DATAVIEW" "$PLUGIN_GRAPH_LINK_TYPES" "$PLUGIN_BREADCRUMBS"; do
|
|
320
|
+
for plugin_repo in "$PLUGIN_DATAVIEW" "$PLUGIN_GRAPH_LINK_TYPES" "$PLUGIN_BREADCRUMBS" "$PLUGIN_FRONT_MATTER_TITLE" "$PLUGIN_ALIAS_LINKER"; do
|
|
284
321
|
plugin_id="$(_install_obsidian_plugin "$PROJECT_DIR" "$plugin_repo")" || plugin_id=""
|
|
285
322
|
if [ -n "$plugin_id" ]; then
|
|
286
323
|
_enable_obsidian_plugin "$PROJECT_DIR" "$plugin_id" || true
|
|
@@ -288,7 +325,37 @@ else
|
|
|
288
325
|
# Empty $plugin_id means _install_obsidian_plugin already warned
|
|
289
326
|
# internally — just move on to the next plugin.
|
|
290
327
|
done
|
|
328
|
+
echo " NOTE: Front Matter Title is installed and enabled, but its per-surface display toggles default OFF inside its own settings — open Settings -> Front Matter Title in Obsidian and enable 'Graph' (and 'Explorer' if wanted) once to see frontmatter titles instead of filenames."
|
|
291
329
|
else
|
|
292
330
|
echo " Skipping Obsidian plugin install."
|
|
293
331
|
fi
|
|
294
332
|
fi
|
|
333
|
+
|
|
334
|
+
# ---------------------------------------------------------------------------
|
|
335
|
+
# Graph defaults install gate
|
|
336
|
+
#
|
|
337
|
+
# obsidian.graphDefaults is a project-scoped key — the vault root is $PROJECT_DIR,
|
|
338
|
+
# so its prompt_yn_sticky/prefs_get selector is "$PROJECT_DIR" itself (never
|
|
339
|
+
# --global), per the selector-consistency rule documented on prompt_yn_sticky
|
|
340
|
+
# in lib.sh. No $PROJECT_DIR means no vault to install into, so skip outright
|
|
341
|
+
# rather than guessing a location.
|
|
342
|
+
# ---------------------------------------------------------------------------
|
|
343
|
+
if [ -z "$PROJECT_DIR" ]; then
|
|
344
|
+
echo " WARNING: no --project-dir given — skipping Obsidian graph defaults install."
|
|
345
|
+
else
|
|
346
|
+
if [ "$INTERACTIVE" = true ]; then
|
|
347
|
+
if prompt_yn_sticky obsidian.graphDefaults "$PROJECT_DIR" "Install default graph-view styling (.obsidian/graph.json — colors wiki/knowledge and wiki/work/* by family, scopes the graph to wiki/knowledge and wiki/work only)? [Y/n]: "; then
|
|
348
|
+
_install_obsidian_graph_defaults "$PROJECT_DIR"
|
|
349
|
+
else
|
|
350
|
+
echo " Skipping Obsidian graph defaults install."
|
|
351
|
+
fi
|
|
352
|
+
else
|
|
353
|
+
# Same non-interactive mirroring as the app-install gate above, applied
|
|
354
|
+
# to the project-scoped key: only a stored `false` skips.
|
|
355
|
+
if [ "$(prefs_get obsidian.graphDefaults "$PROJECT_DIR")" = "false" ]; then
|
|
356
|
+
echo " obsidian.graphDefaults: skipped (remembered decline — change with /bootstrap-config)"
|
|
357
|
+
else
|
|
358
|
+
_install_obsidian_graph_defaults "$PROJECT_DIR"
|
|
359
|
+
fi
|
|
360
|
+
fi
|
|
361
|
+
fi
|
package/lib/scripts/lib.sh
CHANGED
|
@@ -142,10 +142,12 @@ detect_installed_mcps() {
|
|
|
142
142
|
# install-global.sh --skip-mcps), then attempt the interactive MCP install
|
|
143
143
|
# (guarded — a failure only warns and continues, it does not abort the rest
|
|
144
144
|
# of the sync), sync the wiki scaffold (tiered guide delivery — --interactive
|
|
145
|
-
# enables the optional-guide prompts), merge the .gitignore,
|
|
146
|
-
#
|
|
147
|
-
#
|
|
148
|
-
#
|
|
145
|
+
# enables the optional-guide prompts), merge the .gitignore, backfill
|
|
146
|
+
# aliases: onto any wiki/work/ file that has drifted without one (unguarded —
|
|
147
|
+
# backfill-wiki-aliases.js always exits 0 on its own, same contract as
|
|
148
|
+
# merge-settings-deny.js/merge-settings-hooks.js), build the MCP-tools guide
|
|
149
|
+
# for the detected MCPs, then bootstrap Serena's project.yml. Prints the same
|
|
150
|
+
# section headers and blank-line separators the two scripts printed inline.
|
|
149
151
|
# ---------------------------------------------------------------------------
|
|
150
152
|
run_project_sync() {
|
|
151
153
|
local project_dir script_dir installed_mcps
|
|
@@ -167,6 +169,10 @@ run_project_sync() {
|
|
|
167
169
|
"$script_dir/merge-gitignore.sh" --interactive "$project_dir"
|
|
168
170
|
echo ""
|
|
169
171
|
|
|
172
|
+
echo "Backfilling wiki work-item aliases..."
|
|
173
|
+
node "$script_dir/backfill-wiki-aliases.js" "$project_dir"
|
|
174
|
+
echo ""
|
|
175
|
+
|
|
170
176
|
echo "Checking Obsidian setup..."
|
|
171
177
|
if ! "$script_dir/install-obsidian.sh" --interactive --project-dir "$project_dir"; then
|
|
172
178
|
echo "Warning: Obsidian install failed — continuing; re-run update to retry." >&2
|
|
@@ -104,7 +104,7 @@
|
|
|
104
104
|
"scope": "global",
|
|
105
105
|
"consumer": "installer",
|
|
106
106
|
"summary": "Registration scope for the Context7 MCP",
|
|
107
|
-
"detail": "Asked by prompt_scope in lib.sh:
|
|
107
|
+
"detail": "Asked by prompt_scope in lib.sh:410 ('Scope for context7 — [u]ser (default) or [p]roject?'). prompt_scope emits exactly two answers, 'user' and 'project' — it has no local-scope branch, and any reply that does not begin with p or P falls through to user. 'user' registers Context7 once for every project on this machine; 'project' writes the registration into the current project's shareable .mcp.json.",
|
|
108
108
|
"values": "user | project",
|
|
109
109
|
"default": null,
|
|
110
110
|
"askedBy": "lib.sh"
|
|
@@ -130,8 +130,17 @@
|
|
|
130
130
|
"obsidian.plugins": {
|
|
131
131
|
"scope": "project",
|
|
132
132
|
"consumer": "installer",
|
|
133
|
-
"summary": "Install the bundled Obsidian plugin set (Dataview, Graph Link Types, Breadcrumbs)",
|
|
134
|
-
"detail": "Asked by install-obsidian.sh. This is a single bundled prompt covering all
|
|
133
|
+
"summary": "Install the bundled Obsidian plugin set (Dataview, Graph Link Types, Breadcrumbs, Front Matter Title, Alias Linker)",
|
|
134
|
+
"detail": "Asked by install-obsidian.sh. This is a single bundled prompt covering all five recommended community plugins together rather than one key per plugin. Dataview is a hard prerequisite for Graph Link Types and Breadcrumbs specifically — both read fields that Dataview indexes, so installing them separately would let a user accept one without Dataview and end up with a plugin that silently doesn't work. Front Matter Title has no such dependency (it reads frontmatter directly); it is bundled here purely for prompt-count simplicity, not because it needs Dataview. Alias Linker likewise has no Dataview dependency — it patches Obsidian's core link resolver directly rather than reading Dataview-indexed fields — but it is self-described 'experimental' upstream, and that experimental status is the reason it stays bundled under this same single consent gate rather than being broken out into its own key, consistent with Front Matter Title's 'bundled here purely for prompt-count simplicity' framing above. true installs and refreshes all five plugin folders into .obsidian/plugins/ and enables them in .obsidian/community-plugins.json on every run. false means the installer stops offering the bundle again until the key is changed or removed via /bootstrap-config. Plugin files live inside this project's own .obsidian/ directory, which is why this key is project scope, matching guides.*'s scope choice. Note: Front Matter Title's own per-surface display toggles (Graph, Explorer, etc.) default OFF inside its own settings and are not scripted by this installer — see install-obsidian.sh's printed note for the one-time manual step.",
|
|
135
|
+
"values": "true | false",
|
|
136
|
+
"default": null,
|
|
137
|
+
"askedBy": "install-obsidian.sh"
|
|
138
|
+
},
|
|
139
|
+
"obsidian.graphDefaults": {
|
|
140
|
+
"scope": "project",
|
|
141
|
+
"consumer": "installer",
|
|
142
|
+
"summary": "Install default graph-view styling (.obsidian/graph.json)",
|
|
143
|
+
"detail": "Asked by install-obsidian.sh. true installs and refreshes .obsidian/graph.json with default graph-view styling if the file is absent; false means the installer stops offering it until the key is changed or removed via /bootstrap-config. This preference is independent of obsidian.plugins — accepting or declining one has no effect on the other. The file lives inside this project's own .obsidian/ directory, which is why this key is project scope, matching obsidian.plugins's scope choice.",
|
|
135
144
|
"values": "true | false",
|
|
136
145
|
"default": null,
|
|
137
146
|
"askedBy": "install-obsidian.sh"
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"search": "(path:wiki/knowledge OR path:wiki/work) -path:lifecycle.md",
|
|
3
|
+
"colorGroups": [
|
|
4
|
+
{"query": "path:wiki/knowledge/sources", "color": {"a": 1, "rgb": 9484520}},
|
|
5
|
+
{"query": "path:wiki/knowledge/concepts", "color": {"a": 1, "rgb": 5935062}},
|
|
6
|
+
{"query": "path:wiki/knowledge/entities", "color": {"a": 1, "rgb": 3104680}},
|
|
7
|
+
{"query": "path:wiki/work/tasks", "color": {"a": 1, "rgb": 15906891}},
|
|
8
|
+
{"query": "path:wiki/work/bugs", "color": {"a": 1, "rgb": 14839866}},
|
|
9
|
+
{"query": "path:wiki/work/decisions", "color": {"a": 1, "rgb": 13930827}},
|
|
10
|
+
{"query": "path:wiki/work/roadmaps", "color": {"a": 1, "rgb": 13202990}},
|
|
11
|
+
{"query": "path:wiki/work/requirements", "color": {"a": 1, "rgb": 15243100}},
|
|
12
|
+
{"query": "path:wiki/work/uat", "color": {"a": 1, "rgb": 12082238}}
|
|
13
|
+
],
|
|
14
|
+
"collapse-filter": false,
|
|
15
|
+
"showTags": true,
|
|
16
|
+
"showAttachments": false,
|
|
17
|
+
"hideUnresolved": false,
|
|
18
|
+
"showOrphans": true,
|
|
19
|
+
"collapse-color-groups": false,
|
|
20
|
+
"collapse-display": false,
|
|
21
|
+
"showArrow": false,
|
|
22
|
+
"collapse-forces": false
|
|
23
|
+
}
|
|
@@ -87,6 +87,7 @@ Use `Write` to create `wiki/work/bugs/NNNN-<slug>.md`, following the frontmatter
|
|
|
87
87
|
- `linked_task:` — `"[[TASK-NNN]]"` if a task was mentioned (normalized from either `TASK-NNN` or `[[TASK-NNN]]` input); `"—"` otherwise
|
|
88
88
|
- `Reported`: today's date (`YYYY-MM-DD`)
|
|
89
89
|
- `Last updated`: today's date
|
|
90
|
+
- `aliases: [BUG-NNNN]` — mirrors this file's own id: field so Obsidian's wikilink resolver can find it by short ID (ROADMAP-008)
|
|
90
91
|
- Leave `Root Cause Analysis`, `Resolution`, and `Related` sections present but empty (the templated placeholder line under each `>` quote is fine)
|
|
91
92
|
|
|
92
93
|
### Step 7: Update the Bug Index
|
|
@@ -81,6 +81,11 @@ Group members may share evidence sources (Shared Context), but each block needs
|
|
|
81
81
|
Write to `wiki/work/decisions/DEC-NNNN-<group-slug>.md` using this template. **Tables only, mermaid for flows** — mandatory in every block.
|
|
82
82
|
|
|
83
83
|
````markdown
|
|
84
|
+
---
|
|
85
|
+
id: DEC-NNNN
|
|
86
|
+
aliases: [DEC-NNNN]
|
|
87
|
+
---
|
|
88
|
+
|
|
84
89
|
# DEC-NNNN: <Decision-Group Title>
|
|
85
90
|
|
|
86
91
|
> Decision Group covering <area-1>, <area-2>, <area-3>.
|
|
@@ -133,6 +133,7 @@ Use `Write` to create `wiki/work/roadmaps/NNN-slug.md` following the field table
|
|
|
133
133
|
| Field | Value at creation time |
|
|
134
134
|
|-------|------------------------|
|
|
135
135
|
| `Status` | `active` |
|
|
136
|
+
| `aliases` | `[ROADMAP-NNN]` — mirrors the file's own `id:` value |
|
|
136
137
|
| `Created` | Today's date (derive at runtime — use the conversation environment's `currentDate`, otherwise `date +%Y-%m-%d`) |
|
|
137
138
|
| `Last updated` | Same as `Created` |
|
|
138
139
|
| `Owner` | From Step 3 #3 |
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codewizard-dt/bootstrap",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.23.0",
|
|
4
4
|
"description": "Bootstrap Claude Code projects with an LLM Wiki, reusable skills, hooks, and MCP setup",
|
|
5
5
|
"homepage": "https://github.com/codewizard-dt/bootstrap-wiki#readme",
|
|
6
6
|
"bugs": {
|