@codewizard-dt/bootstrap 2.17.0 → 2.18.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.
Files changed (39) hide show
  1. package/lib/hooks/README.md +94 -3
  2. package/lib/hooks/absolute-path-guard.js +5 -0
  3. package/lib/hooks/claude-settings-guard.js +5 -0
  4. package/lib/hooks/env-content-read-guard.js +13 -3
  5. package/lib/hooks/env-file-guard.js +42 -0
  6. package/lib/hooks/interpreter-indirection-guard.js +7 -0
  7. package/lib/hooks/lib/command-parse.js +8 -0
  8. package/lib/hooks/lib/serena-languages.js +94 -1
  9. package/lib/hooks/lib/serena.js +228 -0
  10. package/lib/hooks/mv-absolute-path-block.js +84 -3
  11. package/lib/hooks/package-install-consent.js +11 -0
  12. package/lib/hooks/protected-write-guard.js +7 -0
  13. package/lib/hooks/serena-bash-grep-block.js +507 -44
  14. package/lib/hooks/serena-first-glob-guard.js +65 -20
  15. package/lib/hooks/serena-first-guard.js +98 -2
  16. package/lib/hooks/serena-first-read-guard.js +92 -2
  17. package/lib/hooks/serena-pre-delegation.js +123 -0
  18. package/lib/hooks/serena-write-guard.js +56 -3
  19. package/lib/scripts/README.md +296 -1
  20. package/lib/scripts/bootstrap-prefs.js +734 -0
  21. package/lib/scripts/install-global.sh +147 -18
  22. package/lib/scripts/install-mcps.sh +102 -14
  23. package/lib/scripts/lib.sh +581 -11
  24. package/lib/scripts/merge-gitignore.sh +201 -15
  25. package/lib/scripts/sync-wiki-scaffold.sh +33 -4
  26. package/lib/scripts/templates/CLAUDE-wiki.md +1 -1
  27. package/lib/scripts/templates/bootstrap-prefs-schema.json +175 -0
  28. package/lib/scripts/update-project.sh +42 -9
  29. package/lib/skills/README.md +2 -1
  30. package/lib/skills/bootstrap-config/SKILL.md +154 -0
  31. package/lib/skills/git-commit/SKILL.md +54 -1
  32. package/lib/skills/research/SKILL.md +34 -3
  33. package/lib/skills/simplify/SKILL.md +1 -1
  34. package/lib/skills/uat-auto/SKILL.md +9 -4
  35. package/lib/skills/uat-auto-plus/SKILL.md +6 -6
  36. package/lib/skills/uat-generate/SKILL.md +30 -3
  37. package/lib/skills/uat-walk/UAT-CORE.md +41 -6
  38. package/lib/skills/wiki-query/SKILL.md +48 -8
  39. package/package.json +1 -1
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: wiki-query
3
- description: Answer a question from the wiki — locate pages via the index, synthesize a cited answer, and offer to file valuable answers back as new wiki pages
3
+ description: Answer a question from the wiki — locate pages via the index, synthesize a cited answer, auto-ingest relevant un-ingested raw sources when the wiki has no coverage, and offer to file valuable answers back as new wiki pages
4
4
  category: researching
5
5
  model: claude-sonnet-5
6
6
  argument-hint: <question>
@@ -11,7 +11,7 @@ user-invocable: true
11
11
 
12
12
  # Wiki Query
13
13
 
14
- Answer a question using the wiki as the primary source of truth. If the wiki lacks coverage, say so and suggest `/wiki-ingest` for relevant raw sources. **Never answer from general knowledge alone when a wiki page exists — cite it.**
14
+ Answer a question using the wiki as the primary source of truth. If the wiki lacks coverage, fall back to ingesting relevant un-ingested `raw/` sources (Step 4), then answer from the enlarged wiki. **Never answer from general knowledge alone when a wiki page exists — cite it.**
15
15
 
16
16
  ---
17
17
 
@@ -37,13 +37,51 @@ Answer the question in 2–5 paragraphs. For each claim, cite the wiki page: `([
37
37
 
38
38
  If you found contradictions between pages, surface them explicitly with a `> **Contradiction:**` callout and note which source is more recent.
39
39
 
40
- If the wiki has no coverage at all: say so clearly and suggest:
40
+ If the wiki has no coverage at all — no page matched, or the pages that matched do not actually contain what was asked — **do not stop here**. Go to Step 4.
41
+
42
+ ## Step 4: Fallback — Ingest Relevant Raw Sources
43
+
44
+ Run this step **only** when Step 3 produced no answer. Partial-but-sufficient coverage is not a trigger; neither is an answer you merely wish were more detailed.
45
+
46
+ ### 4.1 Find un-ingested sources
47
+
48
+ 1. `mcp__serena__list_dir` on `raw/` (recursive) for the full candidate list; skip `.gitkeep`.
49
+ 2. `mcp__serena__list_dir` on `wiki/knowledge/sources/` and read the `sources:` frontmatter of each summary page.
50
+ 3. A raw file is **un-ingested** when no summary page's `sources:` list resolves to it. The `sources:` back-link is authoritative — a matching filename slug is a hint, not proof.
51
+ 4. Treat each `raw/research/<slug>/` and `raw/companies/<slug>/` directory as a **single candidate** represented by its main report file, not as one candidate per supporting file.
52
+
53
+ ### 4.2 Rank by relevance — cheaply
54
+
55
+ Do not read candidate files in full at this stage. Triage with:
56
+
57
+ - filename and directory slugs against the question's keywords;
58
+ - `mcp__serena__search_for_pattern` for question keywords restricted to `raw/`;
59
+ - frontmatter and headings only, for the surviving few.
60
+
61
+ Keep only sources that plausibly answer *this* question. If none survive, say so and stop:
41
62
  ```
42
- This question isn't covered in the wiki yet.
43
- To add coverage: /wiki-ingest raw/<relevant-source>
63
+ This question isn't covered in the wiki, and no un-ingested raw source looks relevant.
64
+ To add coverage: add a source to raw/ then run /wiki-ingest raw/<file>
44
65
  ```
45
66
 
46
- ## Step 4: Offer to File the Answer Back
67
+ ### 4.3 Ingest the relevant sources
68
+
69
+ Announce before writing anything:
70
+ ```
71
+ No wiki coverage for this question. Un-ingested raw sources that look relevant:
72
+ 1. raw/<file> — <one line on why>
73
+ Ingesting these now, then re-answering.
74
+ ```
75
+
76
+ For each selected source, run the `/wiki-ingest` procedure (`lib/skills/wiki-ingest/SKILL.md`) in full against that path. One deviation only: its **Step 2 checkpoint becomes a non-blocking announcement** — print the takeaways and continue instead of waiting for the user. Every other step (summary page, entity pages, concept pages, index, log, hot cache) runs exactly as written there.
77
+
78
+ **Cap: at most 3 sources per invocation.** If more look relevant, ingest the 3 strongest and list the remainder for the user to run manually.
79
+
80
+ ### 4.4 Re-answer once
81
+
82
+ Redo Steps 1–3 against the now-updated wiki and cite the newly created pages like any other. **Re-enter Step 4 at most once per invocation** — if the answer is still not there, report the gap plainly and list what was ingested. Never loop.
83
+
84
+ ## Step 5: Offer to File the Answer Back
47
85
 
48
86
  If the synthesized answer represents **durable, timeless knowledge** (a pattern, a design decision rationale, an entity summary) that doesn't currently exist as its own wiki page, offer:
49
87
 
@@ -59,13 +97,15 @@ If the user says yes:
59
97
  2. Add a typed link `derived_from::[[source-slug]]` if the answer came from an ingested source.
60
98
  3. Add the new page to the **Concepts** section of `wiki/index.md`.
61
99
  4. Append to `wiki/log.md`: `## [YYYY-MM-DD] query | <question summary>\nFiled answer as wiki/knowledge/concepts/<slug>.md.`
62
- 5. **Only on this filing path** (never on the read-only answer path): run the **Hot Cache Refresh** procedure — defined in `/wiki-ingest` Step 8 (`lib/skills/wiki-ingest/SKILL.md`) — to regenerate `wiki/hot.md` in full, surfacing the newly filed page under Recent Changes. Do not restate the procedure here; follow it as written.
100
+ 5. **Only on this filing path** (never on the read-only answer path): run the **Hot Cache Refresh** procedure — defined in `/wiki-ingest` Step 8 (`lib/skills/wiki-ingest/SKILL.md`) — to regenerate `wiki/hot.md` in full, surfacing the newly filed page under Recent Changes. Do not restate the procedure here; follow it as written. Step 4's ingests refresh the hot cache on their own as part of the `/wiki-ingest` procedure — that is a write path, not the read-only answer path.
63
101
 
64
102
  ---
65
103
 
66
104
  ## CRITICAL RULES
67
105
 
68
- 1. **Answer from the wiki, not general knowledge** — if the wiki lacks coverage, say so.
106
+ 1. **Answer from the wiki, not general knowledge** — if the wiki still lacks coverage after Step 4, say so.
69
107
  2. **The two-domain rule** — filed answers (durable synthesis) go to `wiki/knowledge/`; never file under `wiki/work/`.
70
108
  3. All citations use relative markdown links to the wiki page, not raw file paths.
71
109
  4. Do not modify any `wiki/work/` files — this skill is read-only for work artifacts.
110
+ 5. `raw/` is **immutable** — Step 4 reads and ingests raw sources; it never creates, edits, moves, or deletes anything under `raw/`.
111
+ 6. **Step 4 runs at most once per invocation and ingests at most 3 sources.** A query must never trigger an ingest cascade or a re-query loop.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codewizard-dt/bootstrap",
3
- "version": "2.17.0",
3
+ "version": "2.18.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": {