@jayjiang/byoao 1.1.2 → 2.0.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 (136) hide show
  1. package/dist/__tests__/plugin-config.test.js +7 -10
  2. package/dist/__tests__/plugin-config.test.js.map +1 -1
  3. package/dist/assets/obsidian-skills/byoao-conventions.md +30 -54
  4. package/dist/assets/obsidian-skills/vault-thinking.md +6 -5
  5. package/dist/assets/presets/common/AGENTS.md.hbs +29 -46
  6. package/dist/assets/presets/common/SCHEMA.md.hbs +57 -0
  7. package/dist/assets/presets/common/Start Here.md.hbs +29 -40
  8. package/dist/assets/presets/minimal/preset.json +3 -3
  9. package/dist/assets/presets/pm-tpm/preset.json +2 -2
  10. package/dist/assets/skills/ask.md +28 -27
  11. package/dist/assets/skills/challenge.md +79 -121
  12. package/dist/assets/skills/connect.md +75 -163
  13. package/dist/assets/skills/cook.md +167 -0
  14. package/dist/assets/skills/diagnose.md +102 -43
  15. package/dist/assets/skills/drift.md +64 -165
  16. package/dist/assets/skills/health.md +63 -0
  17. package/dist/assets/skills/ideas.md +11 -10
  18. package/dist/assets/skills/organize.md +56 -155
  19. package/dist/assets/skills/prep.md +63 -0
  20. package/dist/assets/skills/trace.md +75 -90
  21. package/dist/assets/skills/wiki.md +77 -178
  22. package/dist/cli/cli-program.js +17 -14
  23. package/dist/cli/cli-program.js.map +1 -1
  24. package/dist/cli/installer.js +10 -4
  25. package/dist/cli/installer.js.map +1 -1
  26. package/dist/hooks/idle-suggestions.js +4 -4
  27. package/dist/hooks/idle-suggestions.js.map +1 -1
  28. package/dist/hooks/system-transform.js +35 -1
  29. package/dist/hooks/system-transform.js.map +1 -1
  30. package/dist/index.js +395 -623
  31. package/dist/index.js.map +1 -1
  32. package/dist/plugin-config.js +6 -32
  33. package/dist/plugin-config.js.map +1 -1
  34. package/dist/tools/init-vault.js +8 -38
  35. package/dist/tools/init-vault.js.map +1 -1
  36. package/dist/tools/vault-doctor.js +1 -1
  37. package/dist/tools/vault-doctor.js.map +1 -1
  38. package/dist/tools/vault-status.js +1 -1
  39. package/dist/tools/vault-status.js.map +1 -1
  40. package/dist/vault/__tests__/create.test.js +47 -115
  41. package/dist/vault/__tests__/create.test.js.map +1 -1
  42. package/dist/vault/__tests__/doctor.test.js +14 -2
  43. package/dist/vault/__tests__/doctor.test.js.map +1 -1
  44. package/dist/vault/__tests__/manifest.test.js +2 -2
  45. package/dist/vault/__tests__/manifest.test.js.map +1 -1
  46. package/dist/vault/__tests__/status.test.js +12 -0
  47. package/dist/vault/__tests__/status.test.js.map +1 -1
  48. package/dist/vault/__tests__/upgrade.test.js +3 -3
  49. package/dist/vault/__tests__/upgrade.test.js.map +1 -1
  50. package/dist/vault/create.js +75 -188
  51. package/dist/vault/create.js.map +1 -1
  52. package/dist/vault/doctor.js +49 -0
  53. package/dist/vault/doctor.js.map +1 -1
  54. package/dist/vault/manifest.js +1 -1
  55. package/dist/vault/preset.js +10 -4
  56. package/dist/vault/preset.js.map +1 -1
  57. package/dist/vault/self-update.js +1 -1
  58. package/dist/vault/status.js +24 -0
  59. package/dist/vault/status.js.map +1 -1
  60. package/dist/vault/upgrade.js +120 -16
  61. package/dist/vault/upgrade.js.map +1 -1
  62. package/package.json +1 -1
  63. package/src/assets/obsidian-skills/byoao-conventions.md +9 -6
  64. package/src/assets/obsidian-skills/vault-thinking.md +6 -5
  65. package/src/assets/presets/common/AGENTS.md.hbs +23 -19
  66. package/src/assets/presets/common/SCHEMA.md.hbs +57 -0
  67. package/src/assets/presets/common/Start Here.md.hbs +29 -40
  68. package/src/assets/presets/minimal/preset.json +3 -3
  69. package/src/assets/presets/pm-tpm/preset.json +2 -2
  70. package/src/skills/ask.md +28 -27
  71. package/src/skills/challenge.md +79 -121
  72. package/src/skills/connect.md +75 -163
  73. package/src/skills/cook.md +167 -0
  74. package/src/skills/diagnose.md +102 -43
  75. package/src/skills/drift.md +64 -165
  76. package/src/skills/health.md +63 -0
  77. package/src/skills/ideas.md +11 -10
  78. package/src/skills/organize.md +56 -155
  79. package/src/skills/prep.md +63 -0
  80. package/src/skills/trace.md +75 -90
  81. package/src/skills/wiki.md +77 -178
  82. package/dist/assets/presets/common/Glossary.md.hbs +0 -16
  83. package/dist/assets/presets/common/obsidian/daily-notes.json +0 -5
  84. package/dist/assets/presets/common/obsidian/templates.json +0 -3
  85. package/dist/assets/presets/common/templates/Daily Note.md +0 -19
  86. package/dist/assets/presets/common/templates/Decision Record.md +0 -32
  87. package/dist/assets/presets/common/templates/Investigation.md +0 -34
  88. package/dist/assets/presets/common/templates/Meeting Notes.md +0 -25
  89. package/dist/assets/skills/emerge.md +0 -168
  90. package/dist/assets/skills/weave.md +0 -287
  91. package/dist/tools/add-glossary-term.js +0 -21
  92. package/dist/tools/add-glossary-term.js.map +0 -1
  93. package/dist/tools/add-person.js +0 -21
  94. package/dist/tools/add-person.js.map +0 -1
  95. package/dist/tools/add-project.js +0 -24
  96. package/dist/tools/add-project.js.map +0 -1
  97. package/dist/tools/graph-health.js +0 -25
  98. package/dist/tools/graph-health.js.map +0 -1
  99. package/dist/tools/note-read.js +0 -19
  100. package/dist/tools/note-read.js.map +0 -1
  101. package/dist/tools/search-vault.js +0 -22
  102. package/dist/tools/search-vault.js.map +0 -1
  103. package/dist/vault/__tests__/glossary.test.js +0 -68
  104. package/dist/vault/__tests__/glossary.test.js.map +0 -1
  105. package/dist/vault/__tests__/graph-health.test.js +0 -102
  106. package/dist/vault/__tests__/graph-health.test.js.map +0 -1
  107. package/dist/vault/__tests__/member.test.js +0 -85
  108. package/dist/vault/__tests__/member.test.js.map +0 -1
  109. package/dist/vault/__tests__/note-read.test.js +0 -71
  110. package/dist/vault/__tests__/note-read.test.js.map +0 -1
  111. package/dist/vault/__tests__/obsidian-cli.test.js +0 -108
  112. package/dist/vault/__tests__/obsidian-cli.test.js.map +0 -1
  113. package/dist/vault/__tests__/search-vault.test.js +0 -93
  114. package/dist/vault/__tests__/search-vault.test.js.map +0 -1
  115. package/dist/vault/glossary.js +0 -27
  116. package/dist/vault/glossary.js.map +0 -1
  117. package/dist/vault/graph-health.js +0 -83
  118. package/dist/vault/graph-health.js.map +0 -1
  119. package/dist/vault/member.js +0 -67
  120. package/dist/vault/member.js.map +0 -1
  121. package/dist/vault/note-read.js +0 -70
  122. package/dist/vault/note-read.js.map +0 -1
  123. package/dist/vault/project.js +0 -68
  124. package/dist/vault/project.js.map +0 -1
  125. package/dist/vault/retrieval-types.js +0 -5
  126. package/dist/vault/retrieval-types.js.map +0 -1
  127. package/dist/vault/search-vault.js +0 -87
  128. package/dist/vault/search-vault.js.map +0 -1
  129. package/src/assets/presets/common/obsidian/daily-notes.json +0 -5
  130. package/src/assets/presets/common/obsidian/templates.json +0 -3
  131. package/src/assets/presets/common/templates/Daily Note.md +0 -19
  132. package/src/assets/presets/common/templates/Decision Record.md +0 -32
  133. package/src/assets/presets/common/templates/Investigation.md +0 -34
  134. package/src/assets/presets/common/templates/Meeting Notes.md +0 -25
  135. package/src/skills/emerge.md +0 -168
  136. package/src/skills/weave.md +0 -287
@@ -1,11 +1,14 @@
1
1
  ---
2
2
  name: connect
3
- description: Bridge two seemingly unrelated topics or domains using the vault's link graph. Discovers hidden paths and shared contexts. Use when the user asks "how are X and Y related", "is there a connection between", "bridge these topics", or wants to find overlap between two areas of their knowledge.
3
+ description: >
4
+ Bridges two topics using the link graph, shared people, tags, domains, and conceptual
5
+ overlap. Use when the user asks "what's the relationship between X and Y", "connect A to B",
6
+ or wants to understand how two topics relate.
4
7
  ---
5
8
 
6
- # /connect — Bridge Two Domains
9
+ # /connect — Bridge Two Topics
7
10
 
8
- You are a knowledge connector. Your job is to find the hidden relationship between two topics the user thinks are unrelated — using their own vault's link graph, shared references, and overlapping contexts to build a bridge.
11
+ You are a connector. Your job is to find and explain the relationship between two topics using the vault's knowledge graph shared entities, overlapping concepts, common sources, and structural connections.
9
12
 
10
13
  ## Prerequisites Check
11
14
 
@@ -13,201 +16,110 @@ You are a knowledge connector. Your job is to find the hidden relationship betwe
13
16
  obsidian --version
14
17
  ```
15
18
 
16
- If this fails, STOP and display the Obsidian CLI availability message (see /weave for the full error text).
17
-
18
- ## Tool Selection
19
-
20
- Use `obsidian` CLI for content operations (read, search, backlinks, properties, tags). Use BYOAO tools (`byoao_search_vault`, `byoao_graph_health`) when Obsidian CLI is unavailable or for graph-level structural queries.
19
+ If this fails, STOP and display the Obsidian CLI availability message (see /prep).
21
20
 
22
21
  ## Parameters
23
22
 
24
- - **from** (required): The first topic, concept, domain, or note.
25
- - **to** (required): The second topic, concept, domain, or note.
26
- - **output** (optional): If set, save the connection map as a note at this path.
23
+ - **from** (required): First topic or page name.
24
+ - **to** (required): Second topic or page name.
25
+ - **depth** (optional): `direct` (only direct connections) or `expanded` (include indirect paths via intermediate pages). Default: `expanded`.
27
26
 
28
27
  ## Process
29
28
 
30
- ### Step 1: Map Both Endpoints
31
-
32
- For each of the two topics (`from` and `to`):
33
-
34
- 1. **Find the anchor note** — does a vault note exist for this topic?
29
+ ### Step 1: Locate Both Topics
35
30
 
36
31
  ```bash
37
- obsidian search "<topic>"
32
+ obsidian search "<from>"
33
+ obsidian search "<to>"
38
34
  ```
39
35
 
40
- 2. **Gather the neighborhood** all notes that mention or link to this topic:
41
-
42
- ```bash
43
- obsidian backlinks "<topic>"
44
- ```
36
+ If `INDEX.base` exists, read it to spot compiled pages for either topic.
45
37
 
46
- 3. **Extract properties** what domains, tags, and references are associated?
38
+ Read any existing agent pages in `entities/`, `concepts/`, `comparisons/`, and `queries/`:
47
39
 
48
40
  ```bash
49
- obsidian read "<topic note>"
41
+ obsidian read file="entities/<from>.md" # if exists
42
+ obsidian read file="concepts/<from>.md" # if exists
43
+ obsidian read file="comparisons/<from>.md" # if exists
44
+ obsidian read file="queries/<from>.md" # if exists
45
+ obsidian read file="entities/<to>.md" # if exists
46
+ obsidian read file="concepts/<to>.md" # if exists
47
+ obsidian read file="comparisons/<to>.md" # if exists
48
+ obsidian read file="queries/<to>.md" # if exists
50
49
  ```
51
50
 
52
- Build a set for each endpoint: `{notes, tags, domains, people, concepts}`.
53
-
54
- ### Step 2: Find Intersection
55
-
56
- Compare the two neighborhoods to find overlap:
57
-
58
- **Shared notes**: Notes that mention both topics.
59
- > "[[Meeting 2026-03-15]] discusses both 'rate limiting' and 'user onboarding'."
60
-
61
- **Shared people**: People connected to both topics.
62
- > "[[Alice]] appears in notes about both domains."
63
-
64
- **Shared tags**: Tags that appear in both neighborhoods.
65
- > "Both clusters use #scalability."
66
-
67
- **Shared domains**: Notes from both topics that share a `domain` field value.
68
-
69
- **Shared references**: Notes in one neighborhood that reference notes in the other.
70
-
71
- ### Step 3: Find Graph Paths
72
-
73
- If direct overlap is sparse, look for indirect paths:
74
-
75
- 1. For each note in the `from` neighborhood, check its outgoing links
76
- 2. Do any of those linked notes appear in the `to` neighborhood?
77
- 3. If not, go one hop further — check the links of those linked notes
78
-
79
- This finds paths like:
80
- > `from` → [[Note A]] → [[Note B]] → `to`
81
-
82
- Report the shortest path(s) found, up to 3 hops.
83
-
84
- ### Step 4: Analyze the Bridge
85
-
86
- For each connection found (shared note, person, tag, or path):
87
-
88
- 1. **Read the bridging notes** to understand the context
89
- 2. **Explain why the connection matters** — what does the bridge reveal?
90
- 3. **Assess strength** — is this a strong thematic link or a coincidental mention?
91
-
92
- Classify connections:
93
- - **Strong**: Shared context, both topics discussed substantively in the same note
94
- - **Moderate**: Shared person/tag, indirect but meaningful relationship
95
- - **Weak**: Coincidental co-occurrence, shared only through generic tags
96
-
97
- ### Step 5: Synthesize
98
-
99
- Build a narrative that explains how the two topics connect:
51
+ ### Step 2: Map Each Topic's Connections
100
52
 
101
- ```markdown
102
- # Connect: {From} ↔ {To}
103
-
104
- ## The Bridge
105
-
106
- {1-2 paragraph narrative explaining the connection in plain language}
107
-
108
- ## Connection Map
109
-
110
- ### Direct Links ({N} found)
111
-
112
- - **[[Shared Note]]** — {how it connects both topics}
113
- > "{quote showing from-topic}" ... "{quote showing to-topic}"
114
-
115
- ### Through People
53
+ For each topic:
116
54
 
117
- - **[[Person]]** — involved in both {from} and {to}
118
- - {from} context: {brief description}
119
- - {to} context: {brief description}
120
-
121
- ### Through Concepts
122
-
123
- - **[[Concept]]** — shared foundation
124
- - Links to {from} via: [[note1]], [[note2]]
125
- - Links to {to} via: [[note3]], [[note4]]
126
-
127
- ### Graph Path
128
-
129
- ```
130
- [[from-note]] → [[intermediate]] → [[to-note]]
55
+ ```bash
56
+ obsidian backlinks "<from>"
57
+ obsidian backlinks "<to>"
131
58
  ```
132
59
 
133
- {Explain what this path reveals}
60
+ Read the pages that link to each topic. Build a connection map:
61
+ - Direct wikilinks (both topics link to the same page, or the same page links to both)
62
+ - Shared tags (use `SCHEMA.md` for taxonomy context when classifying)
63
+ - Shared domain
64
+ - Shared source notes (both topics were extracted from the same user note)
65
+ - Shared people/entities mentioned in both topics' pages
134
66
 
135
- ## Strength Assessment
67
+ ### Step 3: Find Direct Connections
136
68
 
137
- - **Overall**: {Strong / Moderate / Weak}
138
- - **Evidence**: {N} shared notes, {N} shared people, {N} graph paths
139
- - **Confidence**: {High solid thematic overlap / Medium — circumstantial / Low — tenuous}
69
+ Check if there's already a direct relationship:
70
+ - Does the `from` page wikilink to `to` (or vice versa)?
71
+ - Is there a `comparisons/` page that covers both?
72
+ - Do they share a `sources` entry in frontmatter?
140
73
 
141
- ## Potential Insights
74
+ ### Step 4: Find Indirect Paths (Expanded Mode)
142
75
 
143
- 1. {What the user might learn from this connection}
144
- 2. {How this could inform decisions in either domain}
145
- 3. {A question this connection raises}
76
+ If no direct connection exists, search for intermediate pages:
146
77
 
147
- ## Suggested Actions
78
+ 1. Find all pages that link to `from`
79
+ 2. For each of those, check if they link to `to`
80
+ 3. If yes: `from` → `intermediate` → `to` is a connection path
81
+ 4. Report the shortest path(s) and explain the relationship
148
82
 
149
- - Link [[Note A]] to [[Note B]] — they discuss the same problem from different angles
150
- - Add "{from}" as a reference in [[relevant to-note]]
151
- - Consider creating a hub note for the bridging concept
152
- ```
153
-
154
- ### Step 6: Handle No Connection
83
+ Also check:
84
+ - Shared tag clusters (both topics use tags that co-occur frequently)
85
+ - Shared domain context (both are about the same domain but different aspects)
86
+ - Temporal overlap (both topics emerged around the same time)
155
87
 
156
- If no meaningful connection is found after searching:
88
+ ### Step 5: Present the Connection
157
89
 
158
90
  ```markdown
159
- # Connect: {From} ↔ {To}
160
-
161
- No meaningful connection found in this vault.
162
-
163
- ## What I Checked
164
-
165
- - Searched {N} notes in the {from} neighborhood
166
- - Searched {N} notes in the {to} neighborhood
167
- - Checked up to 3-hop graph paths
168
- - Compared tags, domains, people, and references
169
-
170
- ## Possible Reasons
91
+ # Connection: [[{from}]][[{to}]]
171
92
 
172
- - These topics genuinely haven't intersected in your notes yet
173
- - The connection might exist in knowledge you haven't written down
174
- - Try narrowing the topics or running /emerge to find broader patterns
93
+ ## Direct Relationship
94
+ {Yes/No} {explain the direct connection if it exists}
175
95
 
176
- ## Want to Create a Connection?
96
+ ## Connection Paths
97
+ {If indirect paths exist, show them:}
177
98
 
178
- If you believe these topics are related, consider:
179
- 1. Writing a note that explicitly bridges them
180
- 2. Adding shared tags or domain fields
181
- 3. Running /weave after writing the bridge note
182
- ```
183
-
184
- ### Step 7: Save (Optional)
185
-
186
- At the end of your analysis, ask:
99
+ 1. [[{from}]] [[{intermediate}]] [[{to}]]
100
+ - Path explanation: {how they connect through this intermediate}
187
101
 
188
- > "Would you like me to save this as a note?"
102
+ ## Shared Context
103
+ - **Shared tags**: {tag1}, {tag2}
104
+ - **Shared domain**: {domain}
105
+ - **Shared sources**: [[source-note-1]], [[source-note-2]]
106
+ - **Shared entities**: [[entity-1]], [[entity-2]]
189
107
 
190
- If the user confirms, save with frontmatter:
108
+ ## Relationship Type
109
+ {Classify the relationship:}
110
+ - **Dependency**: {from} depends on {to} (or vice versa)
111
+ - **Sibling**: Both are aspects of a larger concept
112
+ - **Contrast**: They represent opposing approaches
113
+ - **Evolution**: {to} evolved from {from} over time
114
+ - **Parallel**: Independent topics that happen to share context
191
115
 
192
- ```yaml
193
- ---
194
- title: "Connect: {From} ↔ {To}"
195
- note_type: literature
196
- type: analysis
197
- date: <today>
198
- references:
199
- - "[[from-anchor]]"
200
- - "[[to-anchor]]"
201
- tags: [connect, bridge]
202
- ---
116
+ ## Why This Connection Matters
117
+ {2-3 sentences on what this relationship reveals and why it's worth knowing}
203
118
  ```
204
119
 
205
- Use `obsidian create` to save. Ask the user where they'd like it saved.
206
-
207
120
  ## Key Principles
208
121
 
209
- - **Evidence-based**: Every claimed connection must cite specific notes and quotes.
210
- - **Honest about weakness**: If the connection is tenuous, say so. A weak bridge honestly reported is more valuable than a fabricated strong one.
211
- - **User's vault only**: Don't bridge topics using your general knowledge. The connection must exist in the vault's own link graph and content.
212
- - **Actionable**: Always suggest concrete next steps notes to link, hub notes to create, follow-up traces to run.
213
- - **Respect the "no connection" result**: Not finding a connection is a valid and useful outcome.
122
+ - **Graph over guesswork.** Base connections on actual wikilinks, shared tags, and shared sources — not inferred relationships.
123
+ - **Multiple paths.** There may be several ways two topics connect show the most meaningful ones, not just the shortest.
124
+ - **Explain, don't just list.** The value is in the *explanation* of why the connection matters, not just the path itself.
125
+ - **Obsidian is first workbench.** All note operations go through Obsidian CLI.
@@ -0,0 +1,167 @@
1
+ ---
2
+ name: cook
3
+ description: >
4
+ The core knowledge compilation skill. Reads raw material (user notes, external sources)
5
+ and distills it into structured, cross-referenced knowledge pages in entities/, concepts/,
6
+ comparisons/, and queries/. Use when the user wants to compile notes into knowledge,
7
+ digest external material, or periodically maintain the knowledge base.
8
+ ---
9
+
10
+ # /cook — Knowledge Compilation
11
+
12
+ You are a knowledge compiler. Your job is to read raw material (user notes, external sources)
13
+ and distill it into structured, cross-referenced knowledge pages.
14
+
15
+ ## Prerequisites Check
16
+
17
+ ```bash
18
+ obsidian --version
19
+ ```
20
+
21
+ If this fails, STOP and display the Obsidian CLI availability message (see /prep).
22
+
23
+ ## Parameters
24
+
25
+ - **target** (optional): What to cook. Default: incremental (new/modified notes since last cook).
26
+ - `--all` or `full`: Read all user notes in the vault
27
+ - `"Topic Name"`: Read notes matching this keyword
28
+ - `path/to/note.md`: Read a specific note
29
+ - `<URL>`: Fetch external article and digest it
30
+
31
+ ## Input Scope
32
+
33
+ ### Incremental Mode (default)
34
+
35
+ When user runs `/cook` with no arguments:
36
+ 1. Read `log.md` for last cook timestamp
37
+ 2. Scan for `.md` files outside agent directories with `modified` date after that timestamp
38
+ 3. Include any unprocessed files
39
+
40
+ ### Full Mode
41
+
42
+ When user runs `/cook --all`:
43
+ - Read all user notes in the vault (exclude `entities/`, `concepts/`, `comparisons/`, `queries/`)
44
+ - Re-evaluate all entities and concepts
45
+
46
+ ### Targeted Mode
47
+
48
+ When user runs `/cook "Feature A"` or `/cook path/to/note.md`:
49
+ - Read only the specified notes or notes matching the keyword
50
+
51
+ ### External URL
52
+
53
+ When user provides a URL:
54
+ 1. Fetch content using WebFetch or Obsidian Web Clipper
55
+ 2. Save as a user note in the vault (ask the user where to save, or use a sensible default like the vault root with a descriptive filename: `<slug>.md`)
56
+ 3. Add frontmatter: `title`, `source_url`, `fetched` date
57
+ 4. Process normally — the saved note becomes raw material for /cook
58
+
59
+ **Note:** No dedicated `raw/` directory. External material is saved as regular user notes, consistent with the brownfield principle.
60
+
61
+ ## Processing Pipeline
62
+
63
+ ### Step 1: Read & Parse
64
+ - Read all target notes
65
+ - Extract frontmatter, content, wikilinks
66
+ - Identify entities (named things), concepts (abstract ideas), decisions, contradictions
67
+
68
+ ### Step 2: Match Against Existing Pages
69
+ - Check `INDEX.base` or scan `entities/`, `concepts/` for existing pages
70
+ - Determine: create new vs. update existing
71
+
72
+ ### Step 3: Create/Update Pages
73
+ - **New entities:** Create in `entities/<name>.md`
74
+ - **New concepts:** Create in `concepts/<name>.md`
75
+ - **Updates:** Add new information, bump `updated` date
76
+ - **Contradictions:** Follow Update Policy
77
+
78
+ **Create page thresholds:**
79
+ - Appears in 2+ notes, OR is central subject of one note
80
+ - Do NOT create for: passing mentions, minor details, out-of-domain topics
81
+
82
+ ### Step 4: Cross-Reference
83
+ - Ensure every new/updated page has at least 2 outbound wikilinks
84
+ - Check existing pages link back where relevant
85
+
86
+ ### Step 5: Update Navigation
87
+ - `INDEX.base` auto-updates via Obsidian Base query
88
+ - Append entry to `log.md`
89
+
90
+ ### Step 6: Report
91
+ Present structured summary (see Output Report Format below).
92
+
93
+ ## Contradiction Handling
94
+
95
+ ### Detection
96
+ - Compare claims across notes about the same entity/concept
97
+ - Check dates — newer claims may supersede older
98
+ - Look for explicit contradictions (e.g., "we changed from X to Y")
99
+
100
+ ### Resolution Workflow
101
+ 1. Note both positions with dates and source references
102
+ 2. Mark in frontmatter: `contradictions: [page-name]`
103
+ 3. Report to user with specific sources
104
+ 4. Offer to create a comparison page
105
+ 5. User decides
106
+
107
+ ### Update Policy
108
+ - Newer sources generally supersede older
109
+ - If both positions still valid (e.g., A/B testing), note both
110
+ - Never silently overwrite — always flag for review
111
+
112
+ ## Output Report Format
113
+
114
+ ```
115
+ Cook complete. Here's what changed:
116
+
117
+ New knowledge:
118
+ • [[feature-a]] — Response time monitoring feature
119
+ • [[response-time-metrics]] — Why median replaced avg
120
+
121
+ Updated:
122
+ • [[zhang-san]] — Added Feature A assignment
123
+
124
+ Contradiction found:
125
+ ⚠ PRD says avg(response_time) > baseline, but experiment notes say median
126
+ Sources: Projects/Feature-A-PRD.md vs Daily/2026-04-05.md
127
+ Want me to create a comparison page?
128
+
129
+ Log: 1 entry added to log.md
130
+ ```
131
+
132
+ **Design principles:**
133
+ - Natural language, no technical jargon
134
+ - Structured for quick scanning
135
+ - Actionable (asks for decisions on contradictions)
136
+ - Wikilinks for easy navigation
137
+
138
+ ## Auto-Trigger Behavior
139
+
140
+ The Agent should automatically run `/cook` after:
141
+ - Writing a note (brief report: "Cooked 1 note. Updated [[x]], created [[y]].")
142
+ - User drops new files into the vault
143
+
144
+ **When NOT to auto-trigger:**
145
+ - Rapid-fire note creation (batch and cook once at the end)
146
+ - `/cook` was already run in the last 5 minutes
147
+
148
+ ## Agent Page Identification
149
+
150
+ Agent pages are identified by directory:
151
+ | Location | Ownership |
152
+ |----------|-----------|
153
+ | `entities/**/*.md` | Agent |
154
+ | `concepts/**/*.md` | Agent |
155
+ | `comparisons/**/*.md` | Agent |
156
+ | `queries/**/*.md` | Agent |
157
+ | All other `.md` | User (read-only during /cook) |
158
+
159
+ No `owner` frontmatter field needed.
160
+
161
+ ## Key Principles
162
+
163
+ - **Evidence-based**: Every knowledge page cites its sources
164
+ - **Never modify user notes**: User notes are read-only during /cook
165
+ - **Thresholds matter**: 2+ mentions or central subject to create a page
166
+ - **Split at 200 lines**: Break large pages into sub-topics
167
+ - **Flag contradictions**: Never silently overwrite
@@ -1,72 +1,131 @@
1
1
  ---
2
2
  name: diagnose
3
- description: Diagnose knowledge graph health — find missing frontmatter, orphan notes, broken wikilinks, and AGENTS.md drift. Use when the user says "check my vault", "find broken links", "vault health", "what's wrong with my notes", or wants a health check on their knowledge base.
3
+ description: >
4
+ Vault health check at the structural level. Checks frontmatter coverage, orphan notes,
5
+ broken links, AGENTS.md and SCHEMA.md drift, v2 agent directories, and overall vault configuration.
6
+ Broader than /health which focuses on agent pages — /diagnose checks the entire vault including user notes.
4
7
  ---
5
8
 
6
- # /diagnose — Knowledge Graph Health Check
9
+ # /diagnose — Vault Diagnosis
7
10
 
8
- You are a vault health assistant. Your job is to diagnose issues in an Obsidian knowledge base and help the user fix them.
11
+ You are a vault doctor. Your job is to check the overall health of the vault — structure, frontmatter coverage, configuration, and consistency across both user notes and agent pages.
9
12
 
10
- ## Execution Flow
13
+ ## Prerequisites Check
11
14
 
12
- ### Step 1: Locate Vault
15
+ ```bash
16
+ obsidian --version
17
+ ```
18
+
19
+ If this fails, STOP and display the Obsidian CLI availability message (see /prep).
13
20
 
14
- Ask the user for their vault path, or detect it from the current working directory (look for AGENTS.md in the cwd or parent directories).
21
+ ## Parameters
15
22
 
16
- ### Step 2: Run Diagnosis
23
+ - **focus** (optional): Specific area to check — `frontmatter`, `links`, `structure`, `config`, or `all`. Default: `all`.
17
24
 
18
- Call `byoao_vault_doctor` with the vault path. This runs 5 checks:
25
+ ## Process
19
26
 
20
- 1. **Missing frontmatter** notes without any YAML frontmatter
21
- 2. **Missing note_type** — notes without `note_type` field (not yet woven)
22
- 3. **Missing type/tags** — notes with frontmatter but no `type` or `tags` field
23
- 4. **Orphan notes** — notes with no incoming or outgoing wikilinks
24
- 5. **Broken wikilinks** — links that point to non-existent notes
27
+ ### Step 1: Frontmatter Coverage
25
28
 
26
- Additionally, if `INDEX.base` exists:
27
- 6. **INDEX.base accuracy** — verify note counts match actual vault state
29
+ ```bash
30
+ obsidian properties sort=count counts
31
+ ```
28
32
 
29
- ### Step 3: Present Results
33
+ Report:
34
+ - Total notes with frontmatter vs. without
35
+ - Most common missing fields
36
+ - Notes with invalid frontmatter (bad dates, unknown types, etc.)
37
+ - Tag usage: how many unique tags, how many notes per tag
30
38
 
31
- Format the report by severity:
39
+ ### Step 2: Broken Wikilinks
32
40
 
41
+ Scan for wikilinks that point to non-existent files:
42
+
43
+ ```bash
44
+ obsidian search "\[\[.*\]\]"
33
45
  ```
34
- ! 3 notes without frontmatter
35
- - Inbox/quick-thought.md
36
- - Projects/demo-notes.md
37
- - Knowledge/api-overview.md
38
46
 
39
- ! AGENTS.md lists [[Kent]] but no People/Kent.md found
47
+ For each wikilink found, check if the target file exists. Report broken links with:
48
+ - Source file where the broken link appears
49
+ - Target link that doesn't resolve
50
+ - Suggested fix (create the missing file or remove the link)
51
+
52
+ ### Step 3: Orphan Detection
40
53
 
41
- i 2 orphan notes (no incoming or outgoing wikilinks)
42
- - Archive/old-draft.md
43
- - Inbox/random.md
54
+ Find notes with no inbound wikilinks:
44
55
 
45
- ok 0 broken wikilinks
56
+ ```bash
57
+ obsidian backlinks "note-name"
46
58
  ```
47
59
 
48
- ### Step 4: Suggest Fixes
60
+ For both user notes and agent pages, identify orphans. Note that newly created notes are expected to be orphans temporarily.
61
+
62
+ ### Step 4: AGENTS.md, SCHEMA.md, and v2 layout
63
+
64
+ Check if `AGENTS.md` accurately reflects the current vault state:
65
+ - Does it reference directories that no longer exist?
66
+ - Does it miss directories that were added?
67
+ - Are the skill references still valid?
68
+ - Is the navigation advice still accurate?
69
+
70
+ Check `SCHEMA.md`:
71
+ - Tag taxonomy and domain sections match how tags are actually used
72
+ - Agent directory table matches `entities/`, `concepts/`, `comparisons/`, `queries/`
73
+ - Frontmatter expectations align with v2 `type: entity | concept | comparison | query`
74
+
75
+ Verify the v2 agent directories exist and are usable: `entities/`, `concepts/`, `comparisons/`, `queries/` (note if any are missing or empty when the vault should have compiled knowledge).
76
+
77
+ ### Step 5: Configuration Check
49
78
 
50
- For each issue category, suggest a concrete next action:
79
+ Verify vault configuration:
80
+ - `.obsidian/` directory exists and is valid
81
+ - `.opencode/` directory has current skill definitions
82
+ - `SCHEMA.md` exists and has a defined tag taxonomy
83
+ - `log.md` exists and has recent entries
84
+ - `INDEX.base` exists for compiled knowledge discovery
51
85
 
52
- | Issue | Suggested Fix |
53
- |-------|--------------|
54
- | Missing frontmatter | "Run `/weave` on these files to add structure" |
55
- | Missing note_type | "Run `/weave` to classify and connect these notes" |
56
- | Missing type/tags | "Run `/weave` to fill in metadata" |
57
- | Orphan notes | "Consider adding `[[wikilinks]]` to connect them, or archive if unused" |
58
- | Broken wikilinks | "Create the target note, or fix the link name" |
59
- | INDEX.base stale | "Run `/wiki` to regenerate the knowledge index" |
86
+ ### Step 6: Present Diagnosis
60
87
 
61
- **Always ask for user confirmation before making changes.** Do not auto-fix.
88
+ ```markdown
89
+ # Vault Diagnosis
62
90
 
63
- ### Step 5: Update INDEX.base Timestamp
91
+ Scanned {N} notes, {M} agent pages, {K} user notes.
64
92
 
65
- If `INDEX.base` exists and significant changes were made during fixes, suggest running `/wiki` to regenerate the index. If the user confirms, run `/wiki`.
93
+ ---
94
+
95
+ ## Frontmatter Coverage
96
+ - Notes with frontmatter: X/Y (Z%)
97
+ - Most common missing: {list fields}
98
+ - Unique tags: {N} (top 5: {list})
99
+
100
+ ## Broken Wikilinks
101
+ - {N} broken links found:
102
+ - [[target]] in [[source]] → file not found
103
+
104
+ ## Orphan Notes
105
+ - {N} notes with no inbound links:
106
+ - [[note-name]] — consider linking from [[suggested-source]]
107
+
108
+ ## AGENTS.md / SCHEMA.md / layout
109
+ - AGENTS.md: {Up to date / Needs update} — {details if outdated}
110
+ - SCHEMA.md: {Up to date / Needs update / Missing} — {taxonomy vs usage}
111
+ - Agent dirs (`entities/`, `concepts/`, `comparisons/`, `queries/`): {OK / Missing / Issues}
112
+
113
+ ## Configuration
114
+ - .obsidian/: {OK / Missing / Issues}
115
+ - .opencode/: {OK / Missing / Issues}
116
+ - log.md: {OK / Missing / {N} entries, last: {date}}
117
+ - INDEX.base: {OK / Missing / Needs update}
118
+
119
+ ## Overall Health
120
+ **Score**: {Good / Fair / Needs attention}
121
+
122
+ {2-3 sentence summary of the vault's overall health and the top 2-3 issues to address}
123
+ ```
66
124
 
67
125
  ## Key Principles
68
126
 
69
- - **Diagnose + suggest, never auto-fix**
70
- - **Group by severity** warnings first, info second
71
- - **Actionable suggestions** tell the user exactly what to do
72
- - **Respect user agency** always ask before modifying files
127
+ - **Comprehensive but prioritized.** Check everything, but surface the most important issues first.
128
+ - **Actionable findings.** Every issue should come with a suggested fix.
129
+ - **Non-destructive by default.** Report issues, don't fix them automatically.
130
+ - **Whole vault, not just agent pages.** Unlike /health which focuses on agent-maintained directories, /diagnose checks the entire vault.
131
+ - **Obsidian is first workbench.** All note operations go through Obsidian CLI.