thoth-plugin 1.2.0 → 1.2.2
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/README.md +16 -0
- package/defaults/AGENTS.md +53 -0
- package/{dist/defaults/skill → defaults/skill/_legacy}/gardener/SKILL.md +243 -17
- package/defaults/skill/_legacy/onboarding/SKILL.md +207 -0
- package/defaults/skill/evening-close/SKILL.md +97 -0
- package/defaults/skill/mail-triage/SKILL.md +26 -0
- package/defaults/skill/morning-boot/SKILL.md +45 -0
- package/defaults/skill/slack-pulse/SKILL.md +26 -0
- package/defaults/skill/thought-router/SKILL.md +89 -0
- package/dist/cli.d.ts +0 -8
- package/dist/cli.js +70 -436
- package/dist/config/index.d.ts +1 -1
- package/dist/config/schema.d.ts +17 -0
- package/dist/defaults/skill/_legacy/cal-grid/SKILL.md +16 -0
- package/dist/defaults/skill/_legacy/capsule-init/SKILL.md +102 -0
- package/dist/defaults/skill/_legacy/cross-linker/SKILL.md +357 -0
- package/dist/defaults/skill/_legacy/email-draft/skill.md +134 -0
- package/dist/defaults/skill/_legacy/gardener/SKILL.md +509 -0
- package/dist/defaults/skill/_legacy/gardener/confidence-tiers.md +142 -0
- package/dist/defaults/skill/_legacy/gardener/repair-workflow.md +170 -0
- package/dist/defaults/skill/_legacy/google-chat-scan/SKILL.md +135 -0
- package/dist/defaults/skill/_legacy/handover/SKILL.md +18 -0
- package/dist/defaults/skill/_legacy/interview-prep/SKILL.md +23 -0
- package/dist/defaults/skill/_legacy/leadership-coach/SKILL.md +167 -0
- package/dist/defaults/skill/_legacy/link-retrofit/SKILL.md +345 -0
- package/dist/defaults/skill/_legacy/onboarding/SKILL.md +207 -0
- package/dist/defaults/skill/_legacy/post-meeting-drill/SKILL.md +485 -0
- package/dist/defaults/skill/_legacy/restore-environment/SKILL.md +30 -0
- package/dist/defaults/skill/_legacy/scorecard-synthesis/SKILL.md +26 -0
- package/dist/defaults/skill/_legacy/skill-generator/SKILL.md +362 -0
- package/dist/defaults/skill/_legacy/skill-generator/testing-protocol.md +158 -0
- package/dist/defaults/skill/_legacy/system-init/SKILL.md +103 -0
- package/dist/defaults/skill/evening-close/SKILL.md +6 -7
- package/dist/defaults/skill/mail-triage/SKILL.md +11 -8
- package/dist/defaults/skill/morning-boot/SKILL.md +26 -87
- package/dist/defaults/skill/slack-pulse/SKILL.md +11 -7
- package/dist/defaults/skill/thought-router/SKILL.md +10 -8
- package/dist/index.js +11316 -2308
- package/dist/schemas/skill.d.ts +96 -0
- package/dist/sdk/index.d.ts +4 -0
- package/dist/sdk/sentinel-service.d.ts +71 -0
- package/dist/sdk/skill-runner.d.ts +21 -0
- package/dist/sdk/thoth-client.d.ts +51 -0
- package/dist/sdk/workflows/calendar-watcher.d.ts +2 -0
- package/dist/sdk/workflows/inbox-watcher.d.ts +2 -0
- package/dist/sdk/workflows/index.d.ts +4 -0
- package/dist/sdk/workflows/system-watcher.d.ts +2 -0
- package/dist/sdk/workflows/task-watcher.d.ts +2 -0
- package/dist/services/index.d.ts +1 -0
- package/dist/services/skill-registry.d.ts +23 -0
- package/dist/tools/skill/tools.d.ts +2 -1
- package/package.json +8 -3
- /package/{dist/defaults/skill → defaults/skill/_legacy}/cal-grid/SKILL.md +0 -0
- /package/{dist/defaults/skill → defaults/skill/_legacy}/capsule-init/SKILL.md +0 -0
- /package/{dist/defaults/skill → defaults/skill/_legacy}/cross-linker/SKILL.md +0 -0
- /package/{dist/defaults/skill → defaults/skill/_legacy}/email-draft/skill.md +0 -0
- /package/{dist/defaults/skill → defaults/skill/_legacy}/gardener/confidence-tiers.md +0 -0
- /package/{dist/defaults/skill → defaults/skill/_legacy}/gardener/repair-workflow.md +0 -0
- /package/{dist/defaults/skill → defaults/skill/_legacy}/google-chat-scan/SKILL.md +0 -0
- /package/{dist/defaults/skill → defaults/skill/_legacy}/handover/SKILL.md +0 -0
- /package/{dist/defaults/skill → defaults/skill/_legacy}/interview-prep/SKILL.md +0 -0
- /package/{dist/defaults/skill → defaults/skill/_legacy}/leadership-coach/SKILL.md +0 -0
- /package/{dist/defaults/skill → defaults/skill/_legacy}/link-retrofit/SKILL.md +0 -0
- /package/{dist/defaults/skill → defaults/skill/_legacy}/post-meeting-drill/SKILL.md +0 -0
- /package/{dist/defaults/skill → defaults/skill/_legacy}/restore-environment/SKILL.md +0 -0
- /package/{dist/defaults/skill → defaults/skill/_legacy}/scorecard-synthesis/SKILL.md +0 -0
- /package/{dist/defaults/skill → defaults/skill/_legacy}/skill-generator/SKILL.md +0 -0
- /package/{dist/defaults/skill → defaults/skill/_legacy}/skill-generator/testing-protocol.md +0 -0
- /package/{dist/defaults/skill → defaults/skill/_legacy}/system-init/SKILL.md +0 -0
|
@@ -0,0 +1,509 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: gardener
|
|
3
|
+
description: Use when knowledge base health needs checking, broken links need fixing, orphan files need registering, or cross-references between related files are missing
|
|
4
|
+
triggers:
|
|
5
|
+
- "Check knowledge base"
|
|
6
|
+
- "Run gardener"
|
|
7
|
+
- "KB health"
|
|
8
|
+
- "Fix broken links"
|
|
9
|
+
- "Check for orphan files"
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# Gardener Skill
|
|
13
|
+
|
|
14
|
+
You are the **Knowledge Base Gardener**. Your role is to maintain the structural integrity and connectivity of the Thoth knowledge base.
|
|
15
|
+
|
|
16
|
+
**Core principle:** A healthy knowledge base has no broken links, no orphan files, consistent frontmatter, and rich cross-references between related content.
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## Frontmatter Schema Reference
|
|
21
|
+
|
|
22
|
+
The canonical frontmatter schema is defined in `kernel/config/frontmatter-schemas.yaml`. Key points:
|
|
23
|
+
|
|
24
|
+
### Base Fields (ALL files)
|
|
25
|
+
|
|
26
|
+
| Field | Required | Auto-managed |
|
|
27
|
+
|-------|----------|--------------|
|
|
28
|
+
| `type` | Yes | No - agent sets |
|
|
29
|
+
| `hemisphere` | Yes | Inferred from path |
|
|
30
|
+
| `created` | Yes | **Hook auto-sets** |
|
|
31
|
+
| `updated` | Yes | **Hook auto-updates** |
|
|
32
|
+
| `tags` | No | Agent sets |
|
|
33
|
+
| `summary` | No | Agent sets |
|
|
34
|
+
|
|
35
|
+
### Type-Specific Fields
|
|
36
|
+
|
|
37
|
+
| Type | Extra Required | Extra Optional |
|
|
38
|
+
|------|----------------|----------------|
|
|
39
|
+
| `person` | `relationship` | `email`, `slack` |
|
|
40
|
+
| `project` | `status` | `priority`, `health`, `due`, `stakeholders` |
|
|
41
|
+
| `task` | `status`, `priority` | `due`, `project` |
|
|
42
|
+
| All others | (none) | (none) |
|
|
43
|
+
|
|
44
|
+
### Valid Values
|
|
45
|
+
|
|
46
|
+
- **hemisphere**: `kernel`, `work`, `life`, `coding`
|
|
47
|
+
- **relationship**: `manager`, `peer`, `report`, `stakeholder`, `friend`, `family`
|
|
48
|
+
- **status** (project): `planning`, `active`, `on-hold`, `completed`, `cancelled`
|
|
49
|
+
- **status** (task): `pending`, `in-progress`, `done`, `cancelled`, `blocked`
|
|
50
|
+
- **priority**: `P0`, `P1`, `P2`, `P3`
|
|
51
|
+
- **health**: `green`, `yellow`, `red`
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
## Operating Modes
|
|
56
|
+
|
|
57
|
+
| Mode | Command | Action | Writes |
|
|
58
|
+
|------|---------|--------|--------|
|
|
59
|
+
| **Health Check** | `/gardener` or `/gardener check` | Scan and report | No |
|
|
60
|
+
| **Repair Plan** | `/gardener plan` | Generate repair-plan.md | Plan only |
|
|
61
|
+
| **Execute Repairs** | `/gardener fix` | Apply fixes with approval | Yes |
|
|
62
|
+
| **Cross-Reference** | `/gardener link [path]` | Suggest missing links | No (suggest only) |
|
|
63
|
+
| **Cross-Reference Apply** | `/gardener link [path] --apply` | Add approved links | Yes |
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
|
|
67
|
+
## Severity Levels
|
|
68
|
+
|
|
69
|
+
All issues are classified by severity to prioritize repair work:
|
|
70
|
+
|
|
71
|
+
| Severity | Symbol | Meaning | Action |
|
|
72
|
+
|----------|--------|---------|--------|
|
|
73
|
+
| **CRITICAL** | `[C]` | Data integrity at risk, navigation broken | Fix immediately |
|
|
74
|
+
| **ERROR** | `[E]` | Functionality impaired, links broken | Fix soon |
|
|
75
|
+
| **WARNING** | `[W]` | Best practices violated, maintenance debt | Fix when convenient |
|
|
76
|
+
| **INFO** | `[I]` | Suggestions for improvement | Optional |
|
|
77
|
+
|
|
78
|
+
### Severity by Issue Type
|
|
79
|
+
|
|
80
|
+
| Issue | Default Severity | Escalation Condition |
|
|
81
|
+
|-------|------------------|----------------------|
|
|
82
|
+
| Missing required frontmatter field | ERROR | CRITICAL if `type` missing |
|
|
83
|
+
| Invalid frontmatter value | WARNING | ERROR if `status` or `priority` |
|
|
84
|
+
| Broken internal link | ERROR | CRITICAL if in registry/index |
|
|
85
|
+
| Missing bidirectional link | WARNING | — |
|
|
86
|
+
| Orphan file (not indexed) | WARNING | ERROR if in people/ or projects/ |
|
|
87
|
+
| Registry ghost (indexed but missing) | CRITICAL | — |
|
|
88
|
+
| Stale _index.md (files not listed) | WARNING | ERROR if >5 files missing |
|
|
89
|
+
| Frontmatter schema violation | ERROR | — |
|
|
90
|
+
|
|
91
|
+
---
|
|
92
|
+
|
|
93
|
+
## Mode 1: Health Check
|
|
94
|
+
|
|
95
|
+
### Step 1: Scan All Categories
|
|
96
|
+
|
|
97
|
+
Perform these checks systematically:
|
|
98
|
+
|
|
99
|
+
#### 1.1 Frontmatter Validation
|
|
100
|
+
|
|
101
|
+
For each `.md` file in the knowledge base:
|
|
102
|
+
|
|
103
|
+
```
|
|
104
|
+
CHECK: Has frontmatter block (--- ... ---)
|
|
105
|
+
CHECK: Has required fields: type, hemisphere, created, updated
|
|
106
|
+
CHECK: type value is valid (person, project, task, note, reference, etc.)
|
|
107
|
+
CHECK: hemisphere value matches path (work/, life/, coding/, kernel/)
|
|
108
|
+
CHECK: Type-specific required fields present:
|
|
109
|
+
- person: relationship
|
|
110
|
+
- project: status
|
|
111
|
+
- task: status, priority
|
|
112
|
+
CHECK: Values are valid per schema:
|
|
113
|
+
- status (project): planning|active|on-hold|completed|cancelled
|
|
114
|
+
- status (task): pending|in-progress|done|cancelled|blocked
|
|
115
|
+
- priority: P0|P1|P2|P3
|
|
116
|
+
- health: green|yellow|red
|
|
117
|
+
- relationship: manager|peer|report|stakeholder|friend|family
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
#### 1.2 Link Integrity
|
|
121
|
+
|
|
122
|
+
For each `[[wikilink]]` and `[markdown](link)`:
|
|
123
|
+
|
|
124
|
+
```
|
|
125
|
+
CHECK: Target file exists
|
|
126
|
+
CHECK: Target path is correct (not moved/renamed)
|
|
127
|
+
CHECK: Bidirectional: if A links to B, does B link to A?
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
#### 1.3 Index Coverage
|
|
131
|
+
|
|
132
|
+
For each `_index.md` file:
|
|
133
|
+
|
|
134
|
+
```
|
|
135
|
+
CHECK: All files in same directory are listed
|
|
136
|
+
CHECK: All listed files actually exist (no ghosts)
|
|
137
|
+
CHECK: File summaries are present and accurate
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
For `registry.md`:
|
|
141
|
+
|
|
142
|
+
```
|
|
143
|
+
CHECK: All hemispheres represented
|
|
144
|
+
CHECK: Key entity counts are accurate
|
|
145
|
+
CHECK: Last updated date is recent
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
#### 1.4 Orphan Detection
|
|
149
|
+
|
|
150
|
+
```
|
|
151
|
+
CHECK: Every .md file (except _index.md, registry.md) is listed in its _index.md
|
|
152
|
+
CHECK: Every entity file has at least one incoming link
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
### Step 2: Synthesize Report
|
|
156
|
+
|
|
157
|
+
```markdown
|
|
158
|
+
## Knowledge Base Health Report
|
|
159
|
+
|
|
160
|
+
**Scanned**: {timestamp}
|
|
161
|
+
**Total Files**: {count}
|
|
162
|
+
**Overall Health**: {HEALTHY|NEEDS-ATTENTION|CRITICAL}
|
|
163
|
+
|
|
164
|
+
### Summary by Severity
|
|
165
|
+
| Severity | Count | Categories |
|
|
166
|
+
|----------|-------|------------|
|
|
167
|
+
| CRITICAL | X | {list} |
|
|
168
|
+
| ERROR | X | {list} |
|
|
169
|
+
| WARNING | X | {list} |
|
|
170
|
+
| INFO | X | {list} |
|
|
171
|
+
|
|
172
|
+
### Issue Breakdown
|
|
173
|
+
| Category | [C] | [E] | [W] | [I] |
|
|
174
|
+
|----------|-----|-----|-----|-----|
|
|
175
|
+
| Frontmatter Issues | X | X | X | X |
|
|
176
|
+
| Broken Links | X | X | X | X |
|
|
177
|
+
| Missing Bidirectional | — | — | X | X |
|
|
178
|
+
| Orphan Files | — | X | X | — |
|
|
179
|
+
| Index Staleness | — | X | X | — |
|
|
180
|
+
| Registry Ghosts | X | — | — | — |
|
|
181
|
+
|
|
182
|
+
### Critical Issues (Must Fix)
|
|
183
|
+
{List all CRITICAL items with file path and specific issue}
|
|
184
|
+
|
|
185
|
+
### Errors (Should Fix)
|
|
186
|
+
{List top 10 ERROR items}
|
|
187
|
+
|
|
188
|
+
### Recommendations
|
|
189
|
+
{3-5 prioritized actions based on findings}
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
---
|
|
193
|
+
|
|
194
|
+
## Mode 2: Repair Plan
|
|
195
|
+
|
|
196
|
+
See [repair-workflow.md](repair-workflow.md) for detailed repair plan generation and execution protocol.
|
|
197
|
+
|
|
198
|
+
---
|
|
199
|
+
|
|
200
|
+
## Mode 3: Execute Repairs
|
|
201
|
+
|
|
202
|
+
**CRITICAL: Require explicit approval for each phase.**
|
|
203
|
+
|
|
204
|
+
See [repair-workflow.md](repair-workflow.md) for execution protocol.
|
|
205
|
+
|
|
206
|
+
---
|
|
207
|
+
|
|
208
|
+
## Mode 4: Cross-Reference Analysis
|
|
209
|
+
|
|
210
|
+
This mode finds missing links between related files.
|
|
211
|
+
|
|
212
|
+
### Step 1: Build Entity Index
|
|
213
|
+
|
|
214
|
+
For the target scope (single file or directory), extract:
|
|
215
|
+
|
|
216
|
+
```
|
|
217
|
+
For each .md file:
|
|
218
|
+
- filename (normalized: haardik-tarneja.md → "haardik tarneja")
|
|
219
|
+
- H1 title
|
|
220
|
+
- summary from frontmatter
|
|
221
|
+
- tags from frontmatter
|
|
222
|
+
- related from frontmatter
|
|
223
|
+
- existing [[wikilinks]]
|
|
224
|
+
- parent folder (context: work/projects/, work/Stakeholders/)
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
### Step 2: Find Candidates
|
|
228
|
+
|
|
229
|
+
For each file, search for mentions of OTHER files' entities:
|
|
230
|
+
|
|
231
|
+
| Signal | Detection | Confidence Tier |
|
|
232
|
+
|--------|-----------|-----------------|
|
|
233
|
+
| Exact name match | "Tom Jansson" in text, `tom-jansson.md` exists | CERTAIN |
|
|
234
|
+
| Title match | "Golden Ticket" in text, file titled "Golden Ticket" exists | CERTAIN |
|
|
235
|
+
| Filename stem match | "haardik" in text, `haardik-tarneja.md` exists | STRONG |
|
|
236
|
+
| In `related:` but no link | `related: [golden-ticket.md]` but no `[[golden-ticket]]` in body | CERTAIN |
|
|
237
|
+
| Same project folder | Both in `work/projects/golden-ticket/` | MEDIUM |
|
|
238
|
+
| Shared tags (2+) | Both have `tags: [iam, automation]` | MEDIUM |
|
|
239
|
+
| Missing bidirectional | A→B exists, B→A missing | STRONG |
|
|
240
|
+
|
|
241
|
+
### Step 3: Apply Confidence Tiers
|
|
242
|
+
|
|
243
|
+
See [confidence-tiers.md](confidence-tiers.md) for detailed tier definitions.
|
|
244
|
+
|
|
245
|
+
**Quick Reference:**
|
|
246
|
+
|
|
247
|
+
| Tier | Evidence Required | Action |
|
|
248
|
+
|------|-------------------|--------|
|
|
249
|
+
| **CERTAIN** | Exact name/title match OR in `related:` without link | Auto-suggest, recommend apply |
|
|
250
|
+
| **STRONG** | 2+ signals OR missing bidirectional | Suggest with explanation |
|
|
251
|
+
| **MEDIUM** | 1 signal (shared tags, same folder) | List for review |
|
|
252
|
+
| **WEAK** | Semantic similarity only | Ignore |
|
|
253
|
+
|
|
254
|
+
### Step 4: Output Suggestions
|
|
255
|
+
|
|
256
|
+
```markdown
|
|
257
|
+
## Cross-Reference Suggestions for {file}
|
|
258
|
+
|
|
259
|
+
### CERTAIN (auto-apply recommended)
|
|
260
|
+
| Target | Evidence | Suggested Link |
|
|
261
|
+
|--------|----------|----------------|
|
|
262
|
+
| tom-jansson.md | "Tom Jansson" mentioned line 45 | `[[work/Stakeholders/tom-jansson.md|Tom Jansson]]` |
|
|
263
|
+
|
|
264
|
+
### STRONG (review recommended)
|
|
265
|
+
| Target | Evidence | Suggested Link |
|
|
266
|
+
|--------|----------|----------------|
|
|
267
|
+
| golden-ticket.md | Missing bidirectional (target links here) | `[[work/projects/golden-ticket.md|Golden Ticket]]` |
|
|
268
|
+
|
|
269
|
+
### MEDIUM (optional)
|
|
270
|
+
| Target | Evidence |
|
|
271
|
+
|--------|----------|
|
|
272
|
+
| meteor.md | Shared tags: [iam] |
|
|
273
|
+
|
|
274
|
+
**Apply CERTAIN links?** (yes/no/review-each)
|
|
275
|
+
```
|
|
276
|
+
|
|
277
|
+
### Step 5: Apply Links (if approved)
|
|
278
|
+
|
|
279
|
+
For each approved link:
|
|
280
|
+
1. Find appropriate location in file (near first mention, or in Related section)
|
|
281
|
+
2. Insert `[[path|Display Name]]` format
|
|
282
|
+
3. If bidirectional, also add reverse link to target file
|
|
283
|
+
4. Update `related:` frontmatter if not already present
|
|
284
|
+
|
|
285
|
+
---
|
|
286
|
+
|
|
287
|
+
## Technical Constraints
|
|
288
|
+
|
|
289
|
+
### File Safety Rules
|
|
290
|
+
|
|
291
|
+
1. **NEVER** delete files without explicit confirmation
|
|
292
|
+
2. **NEVER** modify content sections - only frontmatter and links
|
|
293
|
+
3. **ALWAYS** preserve existing frontmatter fields
|
|
294
|
+
4. **ALWAYS** log changes to `kernel/memory/repairs.md`
|
|
295
|
+
|
|
296
|
+
### Link Format Standards
|
|
297
|
+
|
|
298
|
+
```markdown
|
|
299
|
+
# Preferred formats:
|
|
300
|
+
[[work/Stakeholders/tom-jansson.md|Tom Jansson]] # Full path with alias
|
|
301
|
+
[[tom-jansson]] # Short form (same folder)
|
|
302
|
+
|
|
303
|
+
# Avoid:
|
|
304
|
+
[[../Stakeholders/tom-jansson|Tom]] # Relative paths
|
|
305
|
+
[Tom Jansson](../Stakeholders/tom-jansson.md) # Markdown links for internal
|
|
306
|
+
```
|
|
307
|
+
|
|
308
|
+
### Entity Matching Rules
|
|
309
|
+
|
|
310
|
+
1. **Case-insensitive** matching for names
|
|
311
|
+
2. **Normalize** filenames: `haardik-tarneja.md` → "haardik tarneja"
|
|
312
|
+
3. **Handle aliases**: `@haardik.tarneja` should match `haardik-tarneja.md`
|
|
313
|
+
4. **Ignore common words**: "the", "a", "project", "team"
|
|
314
|
+
5. **Match partial names carefully**: "Tom" alone is MEDIUM, "Tom Jansson" is CERTAIN
|
|
315
|
+
|
|
316
|
+
---
|
|
317
|
+
|
|
318
|
+
## Common Mistakes
|
|
319
|
+
|
|
320
|
+
| Mistake | Prevention |
|
|
321
|
+
|---------|------------|
|
|
322
|
+
| Linking every name mention | Only link first meaningful mention per section |
|
|
323
|
+
| Creating circular link spam | Check if link already exists before suggesting |
|
|
324
|
+
| Linking to self | Never suggest `[[file]]` within `file.md` |
|
|
325
|
+
| Over-linking common terms | "IT", "HR", "Q1" are not entities |
|
|
326
|
+
| Ignoring context | "Tom" in "Tom's idea" ≠ "Tom" as standalone reference |
|
|
327
|
+
|
|
328
|
+
---
|
|
329
|
+
|
|
330
|
+
## Bidirectional Link Verification
|
|
331
|
+
|
|
332
|
+
A healthy knowledge base has bidirectional links: if A references B, B should reference A.
|
|
333
|
+
|
|
334
|
+
### Detection Algorithm
|
|
335
|
+
|
|
336
|
+
```
|
|
337
|
+
For each file A:
|
|
338
|
+
For each outgoing link to file B:
|
|
339
|
+
Check if B has any link back to A
|
|
340
|
+
If not: flag as "Missing bidirectional: B should link to A"
|
|
341
|
+
```
|
|
342
|
+
|
|
343
|
+
### Severity Classification
|
|
344
|
+
|
|
345
|
+
| Situation | Severity |
|
|
346
|
+
|-----------|----------|
|
|
347
|
+
| Person A mentions Person B, B doesn't mention A | WARNING |
|
|
348
|
+
| Project links to stakeholder, stakeholder doesn't link to project | WARNING |
|
|
349
|
+
| Registry/index links to file, file doesn't link back | INFO (one-way is OK) |
|
|
350
|
+
| Two files in `related:` frontmatter but no body links | WARNING |
|
|
351
|
+
|
|
352
|
+
### Repair Suggestion Format
|
|
353
|
+
|
|
354
|
+
```markdown
|
|
355
|
+
### Missing Bidirectional Links
|
|
356
|
+
|
|
357
|
+
| Source | Target | Evidence | Suggested Fix |
|
|
358
|
+
|--------|--------|----------|---------------|
|
|
359
|
+
| work/people/alice.md | work/people/bob.md | Alice mentions Bob (line 23) | Add `[[alice]]` to bob.md Related section |
|
|
360
|
+
```
|
|
361
|
+
|
|
362
|
+
---
|
|
363
|
+
|
|
364
|
+
## Index Staleness Detection
|
|
365
|
+
|
|
366
|
+
Every directory with content files should have an `_index.md` that lists all files.
|
|
367
|
+
|
|
368
|
+
### Detection Algorithm
|
|
369
|
+
|
|
370
|
+
```
|
|
371
|
+
For each directory with _index.md:
|
|
372
|
+
List all .md files in directory (excluding _index.md)
|
|
373
|
+
Parse _index.md for file references
|
|
374
|
+
|
|
375
|
+
STALE if:
|
|
376
|
+
- File exists but not in _index.md (orphan)
|
|
377
|
+
- File in _index.md but doesn't exist (ghost)
|
|
378
|
+
- File count mismatch > 0
|
|
379
|
+
```
|
|
380
|
+
|
|
381
|
+
### Severity Classification
|
|
382
|
+
|
|
383
|
+
| Situation | Severity |
|
|
384
|
+
|-----------|----------|
|
|
385
|
+
| 1-2 files missing from _index.md | WARNING |
|
|
386
|
+
| 3-5 files missing from _index.md | WARNING |
|
|
387
|
+
| >5 files missing from _index.md | ERROR |
|
|
388
|
+
| Ghost entry (listed but doesn't exist) | ERROR |
|
|
389
|
+
| _index.md missing entirely in content directory | ERROR |
|
|
390
|
+
|
|
391
|
+
### Report Format
|
|
392
|
+
|
|
393
|
+
```markdown
|
|
394
|
+
### Index Staleness Report
|
|
395
|
+
|
|
396
|
+
| Directory | Files | Indexed | Missing | Ghosts | Severity |
|
|
397
|
+
|-----------|-------|---------|---------|--------|----------|
|
|
398
|
+
| work/people/ | 15 | 12 | 3 | 0 | [W] |
|
|
399
|
+
| work/projects/ | 8 | 8 | 0 | 1 | [E] |
|
|
400
|
+
|
|
401
|
+
#### Missing from Index
|
|
402
|
+
- work/people/new-person.md (created 2026-01-09)
|
|
403
|
+
- work/people/another.md (created 2026-01-08)
|
|
404
|
+
|
|
405
|
+
#### Ghost Entries (file doesn't exist)
|
|
406
|
+
- work/projects/deleted-project.md (remove from _index.md)
|
|
407
|
+
```
|
|
408
|
+
|
|
409
|
+
---
|
|
410
|
+
|
|
411
|
+
## Red Flags - STOP
|
|
412
|
+
|
|
413
|
+
- About to add 50+ links without review
|
|
414
|
+
- Confidence tier unclear for a suggestion
|
|
415
|
+
- Target file doesn't exist (that's a broken link, not cross-ref)
|
|
416
|
+
- Modifying files outside the knowledge base
|
|
417
|
+
- Bulk applying without user seeing the list first
|
|
418
|
+
|
|
419
|
+
---
|
|
420
|
+
|
|
421
|
+
## Rationalization Table
|
|
422
|
+
|
|
423
|
+
| Excuse | Reality |
|
|
424
|
+
|--------|---------|
|
|
425
|
+
| "I'll check cross-references later" | Later never comes. Check during file creation. |
|
|
426
|
+
| "Just a few files, I'll do it manually" | Manual = inconsistent. Use the systematic process. |
|
|
427
|
+
| "This name is too common to link" | If a file exists for them, link it. Let confidence tiers decide. |
|
|
428
|
+
| "I already know these are related" | Your knowledge isn't in the file. Make it explicit. |
|
|
429
|
+
| "Linking everything is overkill" | Link CERTAIN matches. That's not overkill, that's hygiene. |
|
|
430
|
+
| "The file is already long enough" | Links don't add length. They add navigability. |
|
|
431
|
+
| "I'll batch this with other cleanup" | Batching = forgetting. Do it now. |
|
|
432
|
+
| "First names are ambiguous" | That's why they're MEDIUM tier, not ignored. Surface them. |
|
|
433
|
+
|
|
434
|
+
---
|
|
435
|
+
|
|
436
|
+
## Verification Checklist
|
|
437
|
+
|
|
438
|
+
Before completing cross-reference mode:
|
|
439
|
+
|
|
440
|
+
- [ ] Entity index built for scope
|
|
441
|
+
- [ ] All CERTAIN matches have exact evidence
|
|
442
|
+
- [ ] No self-links suggested
|
|
443
|
+
- [ ] No duplicate links suggested (already exists)
|
|
444
|
+
- [ ] Bidirectional links checked
|
|
445
|
+
- [ ] User approved before any writes
|
|
446
|
+
- [ ] Changes logged to repairs.md
|
|
447
|
+
|
|
448
|
+
---
|
|
449
|
+
|
|
450
|
+
## Quick Reference
|
|
451
|
+
|
|
452
|
+
| Task | Command |
|
|
453
|
+
|------|---------|
|
|
454
|
+
| Full health check | `/gardener check` |
|
|
455
|
+
| Generate repair plan | `/gardener plan` |
|
|
456
|
+
| Execute repairs | `/gardener fix` |
|
|
457
|
+
| Analyze one file's links | `/gardener link work/projects/golden-ticket.md` |
|
|
458
|
+
| Analyze a folder | `/gardener link work/Stakeholders/` |
|
|
459
|
+
| Full KB cross-reference audit | `/gardener link --all` |
|
|
460
|
+
|
|
461
|
+
---
|
|
462
|
+
|
|
463
|
+
## Frontmatter Validation Details
|
|
464
|
+
|
|
465
|
+
### Required Fields by Type
|
|
466
|
+
|
|
467
|
+
| File Type | Required Fields | Optional Fields |
|
|
468
|
+
|-----------|-----------------|-----------------|
|
|
469
|
+
| **All files** | `type`, `hemisphere`, `created`, `updated` | `tags`, `summary`, `related` |
|
|
470
|
+
| **person** | + `relationship` | `email`, `slack`, `role`, `company` |
|
|
471
|
+
| **project** | + `status` | `priority`, `health`, `due`, `stakeholders` |
|
|
472
|
+
| **task** | + `status`, `priority` | `due`, `project`, `assignee` |
|
|
473
|
+
|
|
474
|
+
### Validation Error Examples
|
|
475
|
+
|
|
476
|
+
```markdown
|
|
477
|
+
### Frontmatter Validation Errors
|
|
478
|
+
|
|
479
|
+
| File | Issue | Severity | Fix |
|
|
480
|
+
|------|-------|----------|-----|
|
|
481
|
+
| work/people/alice.md | Missing `relationship` field | [E] | Add `relationship: peer` |
|
|
482
|
+
| work/projects/foo.md | Invalid status: "wip" | [E] | Change to `status: active` |
|
|
483
|
+
| life/notes/random.md | Missing `type` field | [C] | Add `type: note` |
|
|
484
|
+
| work/people/bob.md | hemisphere: "work" but path is life/ | [W] | Update to `hemisphere: life` |
|
|
485
|
+
```
|
|
486
|
+
|
|
487
|
+
### Auto-Fixable Issues
|
|
488
|
+
|
|
489
|
+
The following can be auto-fixed with `/gardener fix`:
|
|
490
|
+
|
|
491
|
+
| Issue | Auto-Fix Action |
|
|
492
|
+
|-------|-----------------|
|
|
493
|
+
| Missing `created` | Set to file creation date |
|
|
494
|
+
| Missing `updated` | Set to file modification date |
|
|
495
|
+
| Missing `hemisphere` | Infer from file path |
|
|
496
|
+
| Incorrect `hemisphere` | Correct to match path |
|
|
497
|
+
|
|
498
|
+
### Manual-Fix Required
|
|
499
|
+
|
|
500
|
+
| Issue | Why Manual |
|
|
501
|
+
|-------|------------|
|
|
502
|
+
| Missing `type` | Cannot infer content type |
|
|
503
|
+
| Missing `relationship` | Cannot guess relationship |
|
|
504
|
+
| Missing `status` | Cannot guess project/task state |
|
|
505
|
+
| Invalid enum value | Need user to choose correct value |
|
|
506
|
+
|
|
507
|
+
---
|
|
508
|
+
|
|
509
|
+
*Gardener v4.0 | Part of Thoth Knowledge Management System*
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
# Confidence Tiers for Cross-Reference Suggestions
|
|
2
|
+
|
|
3
|
+
This document defines the evidence requirements for each confidence tier. The gardener uses rule-based confidence, not LLM-estimated percentages.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Tier Definitions
|
|
8
|
+
|
|
9
|
+
### CERTAIN (Auto-apply recommended)
|
|
10
|
+
|
|
11
|
+
**Evidence required:** ONE of the following:
|
|
12
|
+
|
|
13
|
+
| Signal | Example | Why Certain |
|
|
14
|
+
|--------|---------|-------------|
|
|
15
|
+
| Exact full name match | "Tom Jansson" in text, `tom-jansson.md` exists | Unambiguous identity |
|
|
16
|
+
| Exact title match | "Golden Ticket" in text, file H1 is "Golden Ticket" | Unambiguous reference |
|
|
17
|
+
| In `related:` without body link | `related: [golden-ticket.md]` but no `[[golden-ticket]]` | Explicit intent, missing execution |
|
|
18
|
+
| Explicit @mention | `@haardik.tarneja` matches `haardik-tarneja.md` | Direct reference syntax |
|
|
19
|
+
|
|
20
|
+
**Action:** Suggest with "auto-apply recommended" flag. User can batch-approve.
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
### STRONG (Review recommended)
|
|
25
|
+
|
|
26
|
+
**Evidence required:** TWO OR MORE of the following, OR one high-signal match:
|
|
27
|
+
|
|
28
|
+
| Signal | Example | Notes |
|
|
29
|
+
|--------|---------|-------|
|
|
30
|
+
| Missing bidirectional | A links to B, B doesn't link to A | High-value connection |
|
|
31
|
+
| Filename stem + context | "Haardik" in Golden Ticket file, both in work/ | Context strengthens match |
|
|
32
|
+
| First name + same project | "Tom" in file, both tagged `golden-ticket` | Project context disambiguates |
|
|
33
|
+
| Shared tags (2+) | Both have `tags: [iam, automation]` | Topical relationship |
|
|
34
|
+
|
|
35
|
+
**Action:** Suggest with explanation. User reviews individually or by batch.
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
### MEDIUM (Optional, list only)
|
|
40
|
+
|
|
41
|
+
**Evidence required:** ONE weak signal:
|
|
42
|
+
|
|
43
|
+
| Signal | Example | Notes |
|
|
44
|
+
|--------|---------|-------|
|
|
45
|
+
| Shared tags (1) | Both have `tags: [iam]` | Weak topical link |
|
|
46
|
+
| Same parent folder | Both in `work/projects/` | Structural proximity |
|
|
47
|
+
| Partial name match | "James" in text, `james-brooks.md` exists | Ambiguous without context |
|
|
48
|
+
| Summary keyword overlap | Both summaries mention "automation" | Semantic similarity |
|
|
49
|
+
|
|
50
|
+
**Action:** List for awareness. Do not suggest applying unless user requests.
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
### WEAK (Ignore)
|
|
55
|
+
|
|
56
|
+
**Evidence:** Semantic similarity only, no structural signals.
|
|
57
|
+
|
|
58
|
+
| Signal | Example | Why Ignore |
|
|
59
|
+
|--------|---------|------------|
|
|
60
|
+
| Common word overlap | Both mention "project" | Too generic |
|
|
61
|
+
| Single shared tag (generic) | Both have `tags: [work]` | Not meaningful |
|
|
62
|
+
| Same hemisphere only | Both in `work/` | Too broad |
|
|
63
|
+
|
|
64
|
+
**Action:** Do not surface. These create noise, not value.
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
## Evidence Accumulation
|
|
69
|
+
|
|
70
|
+
Signals stack. More signals = higher tier.
|
|
71
|
+
|
|
72
|
+
```
|
|
73
|
+
1 weak signal → MEDIUM
|
|
74
|
+
2 weak signals → STRONG
|
|
75
|
+
1 strong signal → STRONG
|
|
76
|
+
1 certain signal → CERTAIN
|
|
77
|
+
Any certain + anything → CERTAIN
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
---
|
|
81
|
+
|
|
82
|
+
## Disambiguation Rules
|
|
83
|
+
|
|
84
|
+
When a name could match multiple files:
|
|
85
|
+
|
|
86
|
+
| Situation | Resolution |
|
|
87
|
+
|-----------|------------|
|
|
88
|
+
| "Tom" matches `tom-jansson.md` and `tom-smith.md` | Downgrade to MEDIUM, note ambiguity |
|
|
89
|
+
| "Tom Jansson" matches exactly one file | CERTAIN |
|
|
90
|
+
| "Tom" + context "People Team" matches one file | STRONG (context disambiguates) |
|
|
91
|
+
| "Tom" with no context | MEDIUM at best, likely ignore |
|
|
92
|
+
|
|
93
|
+
---
|
|
94
|
+
|
|
95
|
+
## False Positive Prevention
|
|
96
|
+
|
|
97
|
+
Do NOT suggest links when:
|
|
98
|
+
|
|
99
|
+
1. **Already linked** - Check existing `[[wikilinks]]` first
|
|
100
|
+
2. **Self-reference** - Never link a file to itself
|
|
101
|
+
3. **Common terms** - "IT", "HR", "Q1", "2026" are not entities
|
|
102
|
+
4. **Possessive context** - "Tom's idea" may not warrant a link
|
|
103
|
+
5. **Quoted/example text** - Code blocks, quotes may mention names without intent
|
|
104
|
+
6. **Negative context** - "Not Tom" or "unlike Golden Ticket" may not warrant links
|
|
105
|
+
|
|
106
|
+
---
|
|
107
|
+
|
|
108
|
+
## Output Format by Tier
|
|
109
|
+
|
|
110
|
+
### CERTAIN
|
|
111
|
+
```markdown
|
|
112
|
+
| Target | Evidence | Suggested Link |
|
|
113
|
+
|--------|----------|----------------|
|
|
114
|
+
| tom-jansson.md | Exact: "Tom Jansson" at line 45 | `[[work/Stakeholders/tom-jansson.md\|Tom Jansson]]` |
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
### STRONG
|
|
118
|
+
```markdown
|
|
119
|
+
| Target | Evidence | Suggested Link |
|
|
120
|
+
|--------|----------|----------------|
|
|
121
|
+
| golden-ticket.md | Bidirectional missing + shared tag [iam] | `[[work/projects/golden-ticket.md\|Golden Ticket]]` |
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
### MEDIUM
|
|
125
|
+
```markdown
|
|
126
|
+
| Target | Evidence |
|
|
127
|
+
|--------|----------|
|
|
128
|
+
| meteor.md | Shared tag: [iam] |
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
---
|
|
132
|
+
|
|
133
|
+
## Verification Questions
|
|
134
|
+
|
|
135
|
+
Before finalizing a suggestion, ask:
|
|
136
|
+
|
|
137
|
+
1. Would a reader benefit from this link?
|
|
138
|
+
2. Is the connection meaningful or coincidental?
|
|
139
|
+
3. Does the context support the reference?
|
|
140
|
+
4. Is this the right place to add the link (first mention, related section)?
|
|
141
|
+
|
|
142
|
+
If uncertain on any question, downgrade one tier.
|