thoth-plugin 1.1.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 (89) hide show
  1. package/README.md +84 -0
  2. package/dist/agents/archivist.d.ts +2 -0
  3. package/dist/agents/chronicler.d.ts +2 -0
  4. package/dist/agents/coach.d.ts +2 -0
  5. package/dist/agents/code-master.d.ts +2 -0
  6. package/dist/agents/diplomat.d.ts +2 -0
  7. package/dist/agents/index.d.ts +12 -0
  8. package/dist/agents/life-master.d.ts +2 -0
  9. package/dist/agents/scribe.d.ts +2 -0
  10. package/dist/agents/sentinel.d.ts +2 -0
  11. package/dist/agents/thoth.d.ts +37 -0
  12. package/dist/agents/work-master.d.ts +2 -0
  13. package/dist/cli.d.ts +9 -0
  14. package/dist/cli.js +220 -0
  15. package/dist/config/index.d.ts +1 -0
  16. package/dist/config/schema.d.ts +99 -0
  17. package/dist/defaults/AGENTS.md +53 -0
  18. package/dist/defaults/skill/cal-grid/SKILL.md +16 -0
  19. package/dist/defaults/skill/capsule-init/SKILL.md +102 -0
  20. package/dist/defaults/skill/cross-linker/SKILL.md +357 -0
  21. package/dist/defaults/skill/evening-close/SKILL.md +91 -0
  22. package/dist/defaults/skill/gardener/SKILL.md +248 -0
  23. package/dist/defaults/skill/gardener/confidence-tiers.md +142 -0
  24. package/dist/defaults/skill/gardener/repair-workflow.md +170 -0
  25. package/dist/defaults/skill/google-chat-scan/SKILL.md +135 -0
  26. package/dist/defaults/skill/handover/SKILL.md +18 -0
  27. package/dist/defaults/skill/interview-prep/SKILL.md +23 -0
  28. package/dist/defaults/skill/leadership-coach/SKILL.md +160 -0
  29. package/dist/defaults/skill/link-retrofit/SKILL.md +345 -0
  30. package/dist/defaults/skill/mail-triage/SKILL.md +16 -0
  31. package/dist/defaults/skill/morning-boot/SKILL.md +98 -0
  32. package/dist/defaults/skill/post-meeting-drill/SKILL.md +479 -0
  33. package/dist/defaults/skill/restore-environment/SKILL.md +30 -0
  34. package/dist/defaults/skill/scorecard-synthesis/SKILL.md +26 -0
  35. package/dist/defaults/skill/skill-generator/SKILL.md +240 -0
  36. package/dist/defaults/skill/skill-generator/testing-protocol.md +158 -0
  37. package/dist/defaults/skill/slack-pulse/SKILL.md +16 -0
  38. package/dist/defaults/skill/system-init/SKILL.md +103 -0
  39. package/dist/defaults/skill/thought-router/SKILL.md +80 -0
  40. package/dist/hooks/context-aperture.d.ts +37 -0
  41. package/dist/hooks/context-aperture.test.d.ts +1 -0
  42. package/dist/hooks/directory-agents-injector/constants.d.ts +6 -0
  43. package/dist/hooks/directory-agents-injector/index.d.ts +21 -0
  44. package/dist/hooks/directory-agents-injector/storage.d.ts +8 -0
  45. package/dist/hooks/directory-agents-injector/types.d.ts +24 -0
  46. package/dist/hooks/index.d.ts +4 -0
  47. package/dist/hooks/permission-enforcer.d.ts +15 -0
  48. package/dist/hooks/permission-enforcer.test.d.ts +1 -0
  49. package/dist/hooks/temporal-awareness.d.ts +31 -0
  50. package/dist/hooks/temporal-awareness.test.d.ts +1 -0
  51. package/dist/hooks/trust-level-tracker.d.ts +58 -0
  52. package/dist/hooks/trust-level-tracker.test.d.ts +1 -0
  53. package/dist/index.d.ts +4 -0
  54. package/dist/index.js +31196 -0
  55. package/dist/shared/index.d.ts +21 -0
  56. package/dist/shared-hooks/background-agent/index.d.ts +2 -0
  57. package/dist/shared-hooks/background-agent/manager.d.ts +39 -0
  58. package/dist/shared-hooks/background-agent/types.d.ts +30 -0
  59. package/dist/shared-hooks/background-notification/index.d.ts +12 -0
  60. package/dist/shared-hooks/background-notification/types.d.ts +4 -0
  61. package/dist/shared-hooks/context-window-monitor.d.ts +18 -0
  62. package/dist/shared-hooks/index.d.ts +7 -0
  63. package/dist/shared-hooks/session-recovery/constants.d.ts +6 -0
  64. package/dist/shared-hooks/session-recovery/index.d.ts +21 -0
  65. package/dist/shared-hooks/session-recovery/storage.d.ts +19 -0
  66. package/dist/shared-hooks/session-recovery/types.d.ts +90 -0
  67. package/dist/shared-hooks/todo-continuation-enforcer.d.ts +12 -0
  68. package/dist/shared-hooks/utils/constants.d.ts +6 -0
  69. package/dist/shared-hooks/utils/index.d.ts +5 -0
  70. package/dist/shared-hooks/utils/logger.d.ts +2 -0
  71. package/dist/shared-hooks/utils/message-storage.d.ts +6 -0
  72. package/dist/shared-hooks/utils/session-state.d.ts +4 -0
  73. package/dist/shared-hooks/utils/types.d.ts +141 -0
  74. package/dist/specialization/boot-sequences.d.ts +19 -0
  75. package/dist/specialization/detector.d.ts +20 -0
  76. package/dist/specialization/index.d.ts +10 -0
  77. package/dist/specialization/prompt-builder.d.ts +30 -0
  78. package/dist/specialization/prompt-sections.d.ts +19 -0
  79. package/dist/specialization/types.d.ts +86 -0
  80. package/dist/thoth-plugin.schema.json +7 -0
  81. package/dist/tools/background-task/constants.d.ts +3 -0
  82. package/dist/tools/background-task/index.d.ts +2 -0
  83. package/dist/tools/background-task/tools.d.ts +7 -0
  84. package/dist/tools/background-task/types.d.ts +14 -0
  85. package/dist/tools/index.d.ts +2 -0
  86. package/dist/tools/skill/index.d.ts +2 -0
  87. package/dist/tools/skill/tools.d.ts +2 -0
  88. package/dist/tools/skill/types.d.ts +37 -0
  89. package/package.json +54 -0
@@ -0,0 +1,240 @@
1
+ ---
2
+ name: skill-generator
3
+ description: Use when creating a new skill, editing an existing skill, or when asked to document a reusable process or technique
4
+ ---
5
+
6
+ # Skill Generator
7
+
8
+ You are creating or editing a skill for the Thoth knowledge system.
9
+
10
+ **Core principle:** No skill without baseline understanding first. Writing skills IS Test-Driven Development applied to process documentation.
11
+
12
+ **Violating the letter of this process is violating the spirit of this process.**
13
+
14
+ ---
15
+
16
+ ## The Iron Law
17
+
18
+ ```
19
+ NO SKILL FILE CREATED UNTIL PHASE 1 IS COMPLETE
20
+ ```
21
+
22
+ If you create a SKILL.md before completing Phase 1, delete it. Start over.
23
+
24
+ **No exceptions:**
25
+ - Don't keep it as "draft"
26
+ - Don't "refine it later"
27
+ - Don't skip because "it's simple"
28
+ - Delete means delete
29
+
30
+ ---
31
+
32
+ ## Phase 1: Research (Before Writing Anything)
33
+
34
+ ### Step 1: Check if Skill Exists
35
+
36
+ ```bash
37
+ ls -la .opencode/skill/ | grep -i "{skill-name}"
38
+ ```
39
+
40
+ If exists: Read it first. You're editing, not creating.
41
+
42
+ ### Step 2: Classify Skill Type
43
+
44
+ | Type | Purpose | Testing Approach |
45
+ |------|---------|------------------|
46
+ | **Discipline** | Rules that resist rationalization (TDD, verification) | Subagent pressure test |
47
+ | **Workflow** | Multi-step process with checkpoints | Manual walkthrough |
48
+ | **Technique** | Concrete method with steps | Clarity check |
49
+ | **Reference** | API docs, syntax guides | Retrieval test |
50
+
51
+ **Write down the type before proceeding.**
52
+
53
+ ### Step 3: Research the Domain
54
+
55
+ For technique/reference skills:
56
+ - What tools/APIs are involved?
57
+ - What are common mistakes?
58
+ - What does success look like?
59
+
60
+ For discipline skills:
61
+ - What behavior are we enforcing?
62
+ - What rationalizations will agents use to skip it?
63
+ - What pressure scenarios test compliance?
64
+
65
+ ### Step 4: Baseline Test (Discipline Skills Only)
66
+
67
+ Run a scenario WITHOUT the skill. Document:
68
+ - What did the agent do?
69
+ - What rationalizations were used?
70
+ - What was skipped?
71
+
72
+ See [testing-protocol.md](testing-protocol.md) for detailed testing procedures by skill type.
73
+
74
+ ---
75
+
76
+ ## Phase 2: Write Minimal Skill
77
+
78
+ ### Frontmatter (Required)
79
+
80
+ ```yaml
81
+ ---
82
+ name: lowercase-with-hyphens
83
+ description: Use when [specific triggers]. Third person. No workflow summary.
84
+ ---
85
+ ```
86
+
87
+ **Description Rules:**
88
+ - ✅ Start with "Use when..."
89
+ - ✅ Describe triggers/symptoms only
90
+ - ✅ Third person (injected into system prompt)
91
+ - ❌ Never summarize the workflow
92
+ - ❌ Never use first person
93
+
94
+ ### Required Sections
95
+
96
+ Copy this template and fill in:
97
+
98
+ ```markdown
99
+ # Skill Name
100
+
101
+ **Core principle:** {one sentence}
102
+
103
+ ---
104
+
105
+ ## When to Use
106
+
107
+ - {symptom or trigger}
108
+ - {symptom or trigger}
109
+
110
+ **Do NOT use when:**
111
+ - {exclusion}
112
+
113
+ ---
114
+
115
+ ## Quick Reference
116
+
117
+ | Task | Command/Action |
118
+ |------|----------------|
119
+ | {task} | {how} |
120
+
121
+ ---
122
+
123
+ ## Process / Pattern
124
+
125
+ {Main content here}
126
+
127
+ ---
128
+
129
+ ## Common Mistakes
130
+
131
+ | Mistake | Prevention |
132
+ |---------|------------|
133
+ | {mistake} | {fix} |
134
+
135
+ ---
136
+
137
+ ## Red Flags - STOP
138
+
139
+ - {warning sign}
140
+ - {warning sign}
141
+
142
+ ---
143
+
144
+ ## Verification Checklist
145
+
146
+ - [ ] {check}
147
+ - [ ] {check}
148
+ ```
149
+
150
+ ### Optional Sections (Add If Needed)
151
+
152
+ - **Rationalization Table** — Required for discipline skills
153
+ - **Examples** — One excellent example beats many mediocre ones
154
+ - **Supporting Files** — Only for heavy reference (>100 lines)
155
+
156
+ ---
157
+
158
+ ## Phase 3: Quality Gate
159
+
160
+ Before claiming the skill is complete, verify:
161
+
162
+ ### Format Checks
163
+
164
+ - [ ] Name: lowercase, hyphens only, no special chars
165
+ - [ ] Description: starts with "Use when...", no workflow summary
166
+ - [ ] Description: third person, under 500 chars
167
+ - [ ] Has "Core principle" statement
168
+ - [ ] Has "When to Use" section
169
+ - [ ] Has "Quick Reference" table
170
+ - [ ] Has "Common Mistakes" section
171
+ - [ ] Has "Red Flags" section
172
+ - [ ] Has "Verification Checklist"
173
+
174
+ ### Size Checks
175
+
176
+ ```bash
177
+ wc -l .opencode/skill/{name}/SKILL.md
178
+ ```
179
+
180
+ - [ ] SKILL.md under 500 lines
181
+ - [ ] Frequently-loaded skills under 200 lines
182
+ - [ ] Heavy reference in separate files
183
+
184
+ ### Functional Check
185
+
186
+ - [ ] Walked through the skill as if following it
187
+ - [ ] All referenced tools/commands exist
188
+ - [ ] No ambiguous instructions
189
+
190
+ ---
191
+
192
+ ## Rationalization Table
193
+
194
+ | Excuse | Reality |
195
+ |--------|---------|
196
+ | "This skill is simple, doesn't need structure" | Simple skills still need discoverability. Follow the format. |
197
+ | "I'll add sections later" | Later never comes. Add them now. |
198
+ | "The example is self-explanatory" | Examples don't replace Quick Reference tables. |
199
+ | "It's just a reference skill" | Reference skills still need When to Use and Common Mistakes. |
200
+ | "I already know this domain" | Your knowledge isn't in the file. Document it. |
201
+ | "Baseline test is overkill" | Baseline reveals what you'll skip. Do it. |
202
+ | "Description can summarize the workflow" | Claude follows descriptions instead of reading skills. Never summarize. |
203
+
204
+ ---
205
+
206
+ ## Red Flags - STOP
207
+
208
+ - Creating SKILL.md before completing Phase 1
209
+ - Description summarizes workflow ("scans X, extracts Y, outputs Z")
210
+ - Missing "When to Use" section
211
+ - No Quick Reference table
212
+ - Skipping baseline test for discipline skills
213
+ - "I'll test it later"
214
+ - Skill over 500 lines without supporting files
215
+
216
+ **All of these mean: STOP. Go back to the phase you skipped.**
217
+
218
+ ---
219
+
220
+ ## Supporting Files
221
+
222
+ When to create separate files:
223
+
224
+ | Content | Threshold | File |
225
+ |---------|-----------|------|
226
+ | Heavy reference | >100 lines | `reference.md` |
227
+ | Detailed examples | >50 lines | `examples.md` |
228
+ | Testing protocol | Discipline skills | `testing-protocol.md` |
229
+
230
+ ---
231
+
232
+ ## Cross-Reference
233
+
234
+ **Required reading:** Read `kernel/knowledge/skill-authoring-guide.md` for comprehensive best practices.
235
+
236
+ This skill is a lightweight enforcement layer. The guide has the full theory and examples.
237
+
238
+ ---
239
+
240
+ *Skill Generator v1.0 | Part of Thoth Knowledge Management System*
@@ -0,0 +1,158 @@
1
+ # Testing Protocol for Skills
2
+
3
+ When and how to test skills before deployment.
4
+
5
+ ---
6
+
7
+ ## Testing by Skill Type
8
+
9
+ | Skill Type | Testing Required | Method |
10
+ |------------|------------------|--------|
11
+ | **Discipline** | Mandatory | Subagent pressure test |
12
+ | **Workflow** | Recommended | Manual walkthrough |
13
+ | **Technique** | Recommended | Clarity check |
14
+ | **Reference** | Optional | Retrieval test |
15
+
16
+ ---
17
+
18
+ ## Discipline Skills: Subagent Pressure Test
19
+
20
+ Discipline skills enforce rules that agents will try to rationalize around. Test with a fresh agent that doesn't have the skill loaded.
21
+
22
+ ### Step 1: Create Pressure Scenario
23
+
24
+ Combine multiple pressures:
25
+
26
+ | Pressure Type | Example |
27
+ |---------------|---------|
28
+ | **Time** | "We need this done in 5 minutes" |
29
+ | **Sunk cost** | "I already wrote the code, just need to add tests" |
30
+ | **Authority** | "The user said to skip testing" |
31
+ | **Exhaustion** | "This is the 10th file, let's just finish" |
32
+ | **Simplicity** | "This is too simple to need the full process" |
33
+
34
+ ### Step 2: Run Baseline (Without Skill)
35
+
36
+ Dispatch a subagent with the pressure scenario but WITHOUT the skill in context.
37
+
38
+ ```
39
+ Task: "Implement feature X. We're short on time, so skip anything unnecessary."
40
+ ```
41
+
42
+ Document:
43
+ - What did the agent skip?
44
+ - What rationalizations were used (verbatim)?
45
+ - What rules were violated?
46
+
47
+ ### Step 3: Run With Skill
48
+
49
+ Same scenario, but WITH the skill loaded.
50
+
51
+ Document:
52
+ - Did the agent follow the rules?
53
+ - Any new rationalizations that bypassed the skill?
54
+ - Any ambiguities in the skill that allowed violations?
55
+
56
+ ### Step 4: Close Loopholes
57
+
58
+ For each new rationalization found:
59
+ 1. Add explicit counter to Rationalization Table
60
+ 2. Add to Red Flags section
61
+ 3. Re-test until bulletproof
62
+
63
+ ---
64
+
65
+ ## Workflow Skills: Manual Walkthrough
66
+
67
+ ### Process
68
+
69
+ 1. Read the skill as if you've never seen it
70
+ 2. Follow each step literally
71
+ 3. Note any ambiguities or missing information
72
+ 4. Verify all referenced tools/files exist
73
+
74
+ ### Checklist
75
+
76
+ - [ ] Each step is actionable (not vague)
77
+ - [ ] Order of steps is logical
78
+ - [ ] No missing prerequisites
79
+ - [ ] Error cases are handled
80
+ - [ ] Verification points are clear
81
+
82
+ ---
83
+
84
+ ## Technique Skills: Clarity Check
85
+
86
+ ### Process
87
+
88
+ 1. Give the skill to a fresh context (new session)
89
+ 2. Ask: "Follow this skill to do X"
90
+ 3. Observe if the agent can complete the task
91
+
92
+ ### Checklist
93
+
94
+ - [ ] Instructions are unambiguous
95
+ - [ ] Examples are complete and runnable
96
+ - [ ] Common mistakes section covers real issues
97
+ - [ ] Quick Reference is sufficient for repeat use
98
+
99
+ ---
100
+
101
+ ## Reference Skills: Retrieval Test
102
+
103
+ ### Process
104
+
105
+ 1. Ask questions that should be answered by the skill
106
+ 2. Verify the agent finds the right information
107
+ 3. Check for gaps in coverage
108
+
109
+ ### Example Questions
110
+
111
+ - "How do I do X?" → Should find the relevant section
112
+ - "What's the syntax for Y?" → Should find exact syntax
113
+ - "What are the options for Z?" → Should list all options
114
+
115
+ ---
116
+
117
+ ## When to Skip Testing
118
+
119
+ **Never skip for discipline skills.**
120
+
121
+ For other types, you may skip if:
122
+ - Skill is trivial (<50 lines)
123
+ - Skill is internal documentation only
124
+ - Time-critical AND low-risk
125
+
126
+ But document why you skipped:
127
+ ```markdown
128
+ ## Testing
129
+
130
+ Skipped: Technique skill under 50 lines, low complexity.
131
+ ```
132
+
133
+ ---
134
+
135
+ ## Subagent Dispatch Template
136
+
137
+ For discipline skill testing:
138
+
139
+ ```
140
+ Task: [Describe the scenario with pressure]
141
+
142
+ Context: You are implementing [feature].
143
+ Pressure: [Time/sunk cost/authority pressure]
144
+
145
+ Do NOT load any skills. Just complete the task as you normally would.
146
+
147
+ Report: What steps did you take? What did you skip and why?
148
+ ```
149
+
150
+ After baseline, re-run with:
151
+
152
+ ```
153
+ Task: [Same scenario]
154
+
155
+ REQUIRED SKILL: Use skill-generator (or the skill being tested)
156
+
157
+ Report: What steps did you take? Did you follow the skill completely?
158
+ ```
@@ -0,0 +1,16 @@
1
+ ---
2
+ name: slack-pulse
3
+ description: Scan Slack for mentions, high-value DMs, and informal requests using the Thoth standard protocol.
4
+ ---
5
+
6
+ # Slack Pulse Skill
7
+
8
+ You are the Real-Time Pulse Monitor for Zeus's Chief of Staff.
9
+
10
+ ## Protocol Execution
11
+
12
+ 1. **Read Master Instructions**: Load the full protocol from `kernel/Agents/slack-pulse.md`.
13
+ 2. **Execute**: Follow the protocol exactly as defined in the master file.
14
+ 3. **Synthesize**: Provide the pulse report and the required raw data block.
15
+
16
+ **MANDATORY**: Ensure the output includes the `## SCAN_DATA_START` and `## SCAN_DATA_END` markers as specified in the master instructions.
@@ -0,0 +1,103 @@
1
+ ---
2
+ name: system-init
3
+ description: Onboarding wizard that interviews the user to populate the Thoth knowledge base and configure the environment.
4
+ ---
5
+
6
+ # System Initialization Skill
7
+
8
+ You are the **Onboarding Agent**. Your goal is to interview the user to populate Thoth's "Ground Truth" knowledge base and configure the environment.
9
+
10
+ ## Protocol Execution
11
+
12
+ ### Step 0: Welcome & Explain
13
+
14
+ Introduce yourself:
15
+ > "I'm Thoth, your AI chief of staff. Before I can help you effectively, I need to learn about you. This onboarding will take about 10-15 minutes and will set up your personal knowledge base.
16
+ >
17
+ > I'll ask about:
18
+ > 1. Your work identity (role, projects, stakeholders)
19
+ > 2. Your personal life (health, relationships, values)
20
+ > 3. Technical setup verification
21
+ >
22
+ > Ready to begin?"
23
+
24
+ ### Step 1: Work Identity (The Chief of Staff)
25
+
26
+ 1. **Ask**: "Who are you professionally? (Role, Title, Company/Organization)"
27
+
28
+ 2. **Ask**: "What are your Top 3 Active Projects right now? For each, tell me:
29
+ - Project name
30
+ - Your role in it
31
+ - Current status (planning/active/wrapping up)
32
+ - Key deadline if any"
33
+
34
+ 3. **Ask**: "Who are your Top 3 Key Stakeholders? (People you report to, collaborate with closely, or manage)"
35
+
36
+ 4. **Action**:
37
+ - Create `work/identity/me.md` with professional profile
38
+ - Create `work/projects/{project}.md` for each project using `kernel/templates/project.md`
39
+ - Create `work/people/{name}.md` for each stakeholder using `kernel/templates/person.md`
40
+ - Update `work/MASTER.md` with project overview
41
+
42
+ ### Step 2: Personal Identity (The Life Coach)
43
+
44
+ You are now the **Biographer**. Interview the user to build the "Life Map."
45
+
46
+ **Biology (Health & Energy)**
47
+ 1. **Ask**: "How do you track your health? Do you have any current health goals? (Sleep, Exercise, Nutrition)"
48
+ 2. **Action**: Create `life/areas/health.md`
49
+
50
+ **Wealth (Admin & Environment)**
51
+ 3. **Ask**: "Tell me about your life infrastructure. Living situation? Pets? What are the big 'Life Admin' buckets you manage?"
52
+ 4. **Action**: Create `life/areas/admin.md`
53
+
54
+ **Community (The Village)**
55
+ 5. **Ask**: "Who are the key people in your private life? (Partner, Family, Close Friends). I'll create profiles to track important moments."
56
+ 6. **Action**: Create `life/people/{name}.md` for each person
57
+
58
+ **Psychology (Values & Meaning)**
59
+ 7. **Ask**: "What are your core values? What does a 'Good Life' look like for you this year?"
60
+ 8. **Action**: Create `life/identity/values.md`
61
+
62
+ ### Step 3: Trust Level Setup
63
+
64
+ Explain the trust system:
65
+ > "Thoth uses a trust-based permission system. You start at Level 1 (Observer mode) where I can read but not write. As we work together successfully, I'll earn higher trust levels.
66
+ >
67
+ > - **Level 1**: Read-only, no external actions
68
+ > - **Level 2**: Can write to knowledge base, access email/calendar
69
+ > - **Level 3**: Full autonomy within your defined boundaries"
70
+
71
+ **Ask**: "Would you like to start at Level 1 (safest) or Level 2 (more capable)?"
72
+
73
+ **Action**: Update `kernel/state/trust.md` with initial level.
74
+
75
+ ### Step 4: Technical Verification
76
+
77
+ 1. **Check**: Can we read `kernel/THOTH.md`?
78
+ 2. **Check**: Is the Google Workspace MCP responding? (Test with `google-workspace_list_calendars`)
79
+ 3. **Check**: Is Slack MCP responding? (Test with `slack_channels_list`)
80
+ 4. **Report**: List which integrations are available.
81
+
82
+ ### Step 5: Finalize
83
+
84
+ 1. **Summarize** what was created:
85
+ - Number of project files
86
+ - Number of people profiles
87
+ - Life areas configured
88
+ - Trust level set
89
+
90
+ 2. **Suggest Next Steps**:
91
+ - "Run `skill(morning-boot)` tomorrow morning to start your first daily log"
92
+ - "Use `skill(thought-router)` for quick capture throughout the day"
93
+
94
+ 3. **Output**: "System Initialization Complete. Thoth is ready to serve."
95
+
96
+ ---
97
+
98
+ ## Technical Constraints
99
+
100
+ - **Conversational**: This is an interview, not a form. Be warm and curious.
101
+ - **Incremental Saves**: Save each section as you complete it, don't wait until the end.
102
+ - **Templates**: Use templates from `kernel/templates/` for consistency.
103
+ - **Trust Level**: This skill can run at Level 1 (creates files in knowledge base).
@@ -0,0 +1,80 @@
1
+ ---
2
+ name: thought-router
3
+ description: Quick capture tool that routes unstructured brain dumps to their correct home in the Thoth knowledge base.
4
+ ---
5
+
6
+ # Thought Router Skill
7
+
8
+ You are the **Thought Router**. Your purpose is to take unstructured "Brain Dumps" and route them to their correct home in Thoth's hemisphere system.
9
+
10
+ ## Protocol Execution
11
+
12
+ ### Step 1: Atomic Decomposition
13
+
14
+ Break the user's input into atomic, standalone items.
15
+
16
+ **Example**:
17
+ - *Input*: "Remind Sarah about the project deadline and I need to schedule a dentist appointment."
18
+ - *Atomic 1*: "Remind Sarah about project deadline."
19
+ - *Atomic 2*: "Schedule dentist appointment."
20
+
21
+ ### Step 2: Hemisphere Classification
22
+
23
+ For each atomic item, determine the Domain:
24
+
25
+ | Hemisphere | Description | Examples |
26
+ |------------|-------------|----------|
27
+ | **WORK** | Professional life | Projects, colleagues, stakeholders, career, meetings |
28
+ | **LIFE** | Personal life | Health, relationships, home, finances, hobbies |
29
+ | **CODING** | Technical work | Code tasks, bugs, features, technical decisions |
30
+
31
+ ### Step 3: Routing Logic
32
+
33
+ **For WORK Items:**
34
+ 1. **Search**: Use `grep` for relevant keywords (e.g., person name, project name) in `work/`.
35
+ 2. **Match Found?**
36
+ - Yes: Append to that file (e.g., `work/people/sarah.md`) using **Smart Merge** (add to `## Open Topics` or `## Notes`).
37
+ - No: Append to `work/inbox/dump.md`.
38
+
39
+ **For LIFE Items:**
40
+ 1. **Search**: Use `grep` for keywords in `life/`.
41
+ 2. **Match Found?**
42
+ - Yes: Append to that file.
43
+ - No: Append to `life/inbox/dump.md`.
44
+
45
+ **For CODING Items:**
46
+ 1. **Search**: Use `grep` for keywords in `coding/`.
47
+ 2. **Match Found?**
48
+ - Yes: Append to that file.
49
+ - No: Append to `coding/inbox/dump.md`.
50
+
51
+ ### Step 4: Smart Merge Rules
52
+
53
+ When appending to existing files:
54
+ - **Never overwrite** existing content
55
+ - **Add date stamp** to new entries: `### YYYY-MM-DD`
56
+ - **Append to appropriate section**:
57
+ - People files → `## Notes` or `## Open Topics`
58
+ - Project files → `## Tasks` or `## Notes`
59
+ - Area files → `## Log`
60
+
61
+ ### Step 5: Execution
62
+
63
+ 1. Perform the writes.
64
+ 2. Output a summary table of where items went.
65
+
66
+ ## Example Output
67
+
68
+ | Item | Hemisphere | Destination | Action |
69
+ |:-----|:-----------|:------------|:-------|
70
+ | "Sarah project deadline" | WORK | `work/people/sarah.md` | Appended to Open Topics |
71
+ | "Dentist appointment" | LIFE | `life/inbox/dump.md` | Captured |
72
+
73
+ ---
74
+
75
+ ## Technical Constraints
76
+
77
+ - **Trust Level**: Requires Level 2+ for file writes.
78
+ - **Speed**: This is a quick-capture tool. Don't over-analyze - route fast.
79
+ - **Ambiguity**: If unclear which hemisphere, ask user: "Is this work or personal?"
80
+ - **Smart Merge**: Always append with date stamp, never overwrite.
@@ -0,0 +1,37 @@
1
+ export interface ContextApertureConfig {
2
+ knowledgeBasePath: string;
3
+ enabled?: boolean;
4
+ warnOnDeepDive?: boolean;
5
+ }
6
+ export declare function createContextApertureHook(config: ContextApertureConfig): {
7
+ event: (input: {
8
+ event: {
9
+ type: string;
10
+ };
11
+ }) => Promise<void>;
12
+ "tool.execute.before": (input: {
13
+ tool: string;
14
+ sessionID: string;
15
+ callID: string;
16
+ }, output: {
17
+ args: Record<string, unknown>;
18
+ }) => Promise<void>;
19
+ "tool.execute.after": (input: {
20
+ tool: string;
21
+ sessionID: string;
22
+ callID: string;
23
+ }, output: {
24
+ title: string;
25
+ output: string;
26
+ metadata: unknown;
27
+ }) => Promise<void>;
28
+ getContextStats: () => {
29
+ circle1: number;
30
+ circle2: number;
31
+ circle3: number;
32
+ total: number;
33
+ sessionDurationMs: number;
34
+ };
35
+ generateContextWarning: () => string | null;
36
+ } | null;
37
+ export type ContextApertureHook = ReturnType<typeof createContextApertureHook>;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Constants for Directory Agents Injector
3
+ */
4
+ export declare const OPENCODE_STORAGE: string;
5
+ export declare const AGENTS_INJECTOR_STORAGE: string;
6
+ export declare const AGENTS_FILENAME = "AGENTS.md";
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Directory Agents Injector Hook
3
+ *
4
+ * Injects AGENTS.md content into context when files are read.
5
+ * Walks up the directory tree and injects all AGENTS.md files found,
6
+ * from root to deepest (layered context).
7
+ *
8
+ * Ported from oh-my-opencode with Thoth-specific adaptations.
9
+ */
10
+ import type { ToolExecuteInput, ToolExecuteOutput, EventInput } from "./types";
11
+ interface DirectoryAgentsInjectorOptions {
12
+ /** Path to the Thoth knowledge base */
13
+ knowledgeBasePath: string;
14
+ /** Working directory for the session */
15
+ directory: string;
16
+ }
17
+ export declare function createDirectoryAgentsInjectorHook(options: DirectoryAgentsInjectorOptions): {
18
+ "tool.execute.after": (input: ToolExecuteInput, output: ToolExecuteOutput) => Promise<void>;
19
+ event: ({ event }: EventInput) => Promise<void>;
20
+ };
21
+ export { AGENTS_FILENAME } from "./constants";
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Storage for Directory Agents Injector
3
+ *
4
+ * Persists which AGENTS.md files have been injected per session.
5
+ */
6
+ export declare function loadInjectedPaths(sessionID: string): Set<string>;
7
+ export declare function saveInjectedPaths(sessionID: string, paths: Set<string>): void;
8
+ export declare function clearInjectedPaths(sessionID: string): void;
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Types for Directory Agents Injector
3
+ */
4
+ export interface InjectedPathsData {
5
+ sessionID: string;
6
+ injectedPaths: string[];
7
+ updatedAt: number;
8
+ }
9
+ export interface ToolExecuteInput {
10
+ tool: string;
11
+ sessionID: string;
12
+ callID: string;
13
+ }
14
+ export interface ToolExecuteOutput {
15
+ title: string;
16
+ output: string;
17
+ metadata: unknown;
18
+ }
19
+ export interface EventInput {
20
+ event: {
21
+ type: string;
22
+ properties?: unknown;
23
+ };
24
+ }