@karmaniverous/jeeves-meta-openclaw 0.12.2 → 0.12.4

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.
@@ -0,0 +1,149 @@
1
+ ---
2
+ name: coding
3
+ description: Engineering standards for all code work. Use when writing code, reviewing PRs, spawning coding sub-agents, or making architectural decisions in any project (not just Jeeves). Covers design-first development, schema-first patterns, testing, STAN workflow, dependency management, and pre-PR checklist.
4
+ ---
5
+
6
+ # Engineering Standards
7
+
8
+ These standards apply to ALL code work — whether done directly or via sub-agents.
9
+ When spawning sub-agents for coding tasks, include the relevant rules in the task prompt.
10
+ Sub-agents don't inherit your context — if you don't pass the rules, they don't exist.
11
+
12
+ ---
13
+
14
+ ## Design-First Development
15
+
16
+ 1. **Iterate on design until convergence** — Summarize requirements, propose approach, raise questions BEFORE writing code.
17
+ 2. **Services-first architecture** — Core logic in services behind ports; adapters thin; side effects at boundaries.
18
+ 3. **Schema-first** — Runtime schema (Zod) is source of truth; TypeScript types derived via `z.infer<>`; validation centralized. Plain TypeScript `interface` declarations for config surfaces are not acceptable.
19
+ 4. **300 LOC hard limit** — If a file would exceed 300 lines, stop and decompose first. No exceptions.
20
+ 5. **Avoid `any`** — Prefer `unknown` + narrowing; if unavoidable, narrowest scope + rationale.
21
+ 6. **Test pairing** — Every non-trivial module gets a `*.test.ts`.
22
+ 7. **Open-source first** — Prefer established deps over home-grown solutions. Search npm/GitHub before building anything non-trivial.
23
+
24
+ ## Module Design
25
+
26
+ - **Single Responsibility** applies to modules as well as functions.
27
+ - Prefer many small modules over a few large ones.
28
+ - Keep module boundaries explicit and cohesive; avoid "kitchen-sink" files.
29
+ - Co-locate tests with modules for discoverability.
30
+
31
+ ## Config Surfaces
32
+
33
+ - Define config with **Zod schemas** — never bare TypeScript interfaces.
34
+ - Derive types: `type MyConfig = z.infer<typeof myConfigSchema>`
35
+ - Generate **JSON Schema** from Zod for IDE DX (`$schema` pointer in config files).
36
+ - Validate at load time — fail fast with clear error messages.
37
+ - `init` commands generate config with `$schema` pointer already in place.
38
+
39
+ ## Testing
40
+
41
+ - **Unit tests** for pure services (no fs/process/network).
42
+ - **Integration tests** for adapters/seams (minimal end-to-end slices).
43
+ - Exercise happy paths AND representative error paths.
44
+ - Table-driven cases encouraged for exhaustive coverage.
45
+ - Keep coverage meaningful — prefer covering branches/decisions over chasing 100% lines.
46
+
47
+ ## STAN-Enabled Repos
48
+
49
+ When working in a repo with `.stan/`:
50
+ - Run `stan run --sequential --no-archive` **before** each commit. Scripts must pass before you commit. Sequential runs are preferred to limit side effects. Archives are not needed (you won't use them).
51
+ - **Push after every commit.** Don't accumulate unpushed local commits. Jason needs to be able to see your work at any time.
52
+ - All scripts must pass before claiming work is complete.
53
+ - Read `.stan/output/<script>.txt` for evidence on failures.
54
+ - When creating stan scripts, eliminate colorized output where possible (e.g. `--no-color`, `NO_COLOR=1`) to reduce noise in script output files.
55
+
56
+ ## Cross-Package Verification
57
+
58
+ When changes affect exports consumed by another repo:
59
+ - Standalone scripts passing ≠ "ready for review."
60
+ - Use `npm link` or equivalent to verify the consumer builds against your changes.
61
+ - Only claim completion when BOTH repos pass.
62
+
63
+ ## Dependencies: Latest Versions Required (HARD GATE)
64
+
65
+ **NEVER use a superseded version of ANY dependency without direct human authorization.** When adding a new dependency — or creating a new project — ALWAYS check the latest stable version and use it. This applies to runtime deps, dev deps, and peer deps alike.
66
+
67
+ - Before `npm install <package>`: run `npm view <package> version` (or check npmjs.com) to confirm you're installing the current major.
68
+ - Before spawning sub-agents that install packages: include the latest version in the task prompt, or instruct the sub-agent to verify latest before installing.
69
+ - If the latest major has known breaking issues that block adoption, flag it to the human — don't silently pin an old major.
70
+
71
+ LLMs are trained on stale data. Your training cutoff means you will default to old versions of everything. **Assume your version knowledge is wrong** and verify before every install.
72
+
73
+ *Earned: 2026-05-12, created the jeeves-tools repo with Zod 3 despite Zod 4 being available since mid-2025. Shipped 84 commits on the old major before catching it.*
74
+
75
+ ## Dependencies: Local Over Global
76
+
77
+ - **Dev dependencies belong in the project, not the global environment.** Install with `npm install --save-dev`, not `npm install -g`.
78
+ - This guarantees reproducibility across machines and CI. Global installs mask environment differences that cause "works on my machine" failures.
79
+ - **Rare exceptions:** Tools that are genuinely machine-level utilities (e.g. `stan-cli`). If in doubt, install locally.
80
+ ## Dependency Failures
81
+
82
+ When a third-party dependency is broken:
83
+ 1. Summarize the failure concisely.
84
+ 2. Enumerate options: switch dependency → fix upstream → temporary pin → shim (last resort).
85
+ 3. Recommend with rationale.
86
+ 4. Do NOT immediately code around the problem.
87
+
88
+ ## CHANGELOG
89
+
90
+ - **Do not manually update CHANGELOG.md** — it is generated as part of the release process (e.g. via `standard-version`, `changesets`, or equivalent). Conventional commit messages are the input; the tooling produces the output.
91
+
92
+ ## Pre-PR Checklist (HARD GATE)
93
+
94
+ **Before creating ANY PR, run the full verification sequence. No exceptions.**
95
+
96
+ 1. `stan run --sequential --no-archive` if `.stan/` exists — this is the canonical check suite
97
+ 2. In monorepos: run checks **from each package directory**, not just the root. Root-level runs may mask package-level failures due to config resolution differences.
98
+ 3. Exercise the release path: check `release-it` hooks (or equivalent) in each releasable package — run the same commands (`lint`, `typecheck`, `test`, `build`) from the same cwd the release process uses.
99
+
100
+ If any step fails, fix it before committing. Do NOT create the PR and "note" the failures. Do NOT claim pre-existing failures without having actually run the commands first. Skipping this sequence is how we ship broken code and fabricate diagnoses.
101
+
102
+ - **Compare against canonical template** (`karmaniverous/npm-package-template-ts`) before any npm package PR. If the project is behind the template, update it to conform. If the template is behind the project, raise the issue with Jason for template upkeep.
103
+ - **Run `ncu --peer`** before any PR. Review the output. Update safe patches/minors. **Flag major version bumps for discussion** — never auto-apply `ncu -u` without reading what changed. Peer dep conflicts must be resolved, not ignored.
104
+ - When spawning sub-agents, include `ncu --peer` in the quality gate commands: `ncu --peer && npm run lint && npm run typecheck && npm run build && npm test`. The sub-agent should report `ncu` output and only apply updates that don't involve major bumps or peer conflicts.
105
+ - **Resolve ALL script warnings.** It is NOT acceptable to release code with outstanding warnings. They exist for a reason — fix them.
106
+ - **Typecheck/lint rules apply to ALL authored code**, including configs at project root (`eslint.config.ts`, `rollup.config.ts`, `vitest.config.ts`, etc.). Only generated code (e.g. typedoc output) should be excepted from code quality checks.
107
+ - **Never disable lint/typecheck rules** without surfacing it for discussion first. Disabled rules are a major code smell. If a rule must be disabled, document the rationale inline at the point of suppression.
108
+ - **Multiple tsconfigs are a code smell.** Sometimes needed, but often they paper over poor configuration choices. Fix root causes rather than adding tsconfig variants.
109
+ - **In a TS repo, all scripts should be authored in TS** (not JS). Prefer execution with `tsx`.
110
+ - **Clean-room verify before claiming "all green."** Run `rimraf node_modules && npm install && npm run build` (or equivalent) to catch issues masked by cached state. If someone reports an error you can't reproduce, assume your cache is lying — not that they're wrong.
111
+ - Verify build, test, and lint pass after updates.
112
+
113
+ ## Dev Workspace
114
+
115
+ - **Clone location:** `D:\repos\{org-or-userid}\{repo}` (e.g. `D:\repos\karmaniverous\jeeves-watcher`)
116
+ - D drive is the dev workspace. Do not clone repos elsewhere.
117
+ - Fresh clones are preferred over copying existing checkouts — `npm install` from registry is faster than disk-copying `node_modules`.
118
+ - D drive is NOT indexed by jeeves-watcher. Dev work stays off the archive.
119
+
120
+ ## GitHub Auth (HARD GATE)
121
+
122
+ - **ALL GitHub operations use `jgs-jeeves` auth.** Set `GH_TOKEN` before any `gh` CLI command:
123
+ ```powershell
124
+ $env:GH_TOKEN = (Get-Content "J:\config\credentials\github\jgs-jeeves.token" -Raw).Trim()
125
+ ```
126
+ - Never write to GitHub as `karmaniverous` — that's Jason's account.
127
+ - If `jgs-jeeves` lacks permissions, **escalate to Jason** rather than falling back to `karmaniverous`.
128
+
129
+ ## Issue Hygiene
130
+
131
+ - **Always comment rationale when closing an issue without resolution** (duplicate, won't-fix, obsolete). The close action alone doesn't explain why.
132
+ - Reference the replacement issue/PR when closing as duplicate.
133
+
134
+ ## Code Style
135
+
136
+ - Prettier is source of truth for formatting.
137
+ - Keep imports sorted per repo tooling.
138
+ - Avoid dead code.
139
+ - TSDoc `@module` or `@packageDocumentation` on every non-test module.
140
+ - First 160 chars of module doc should be high-signal: what it does, IO/side effects, traversal hints.
141
+
142
+ ## eslint-disable is a HARD GATE
143
+
144
+ Never disable lint/typecheck rules without surfacing it for discussion first. Fix the code, don't suppress the warning. For test mocks, use properly typed partial objects (`Partial<RealType>`, typed `MockReply` interfaces) instead of `any`. Tests are code.
145
+
146
+ ## Git Merge Policy
147
+
148
+ - **No squash merges.** Preserve commit history.
149
+ - **PR reviewer:** When creating a PR under `jgs-jeeves` auth, always add `karmaniverous` (Jason) as a reviewer.
@@ -0,0 +1,122 @@
1
+ ---
2
+ name: jeeves
3
+ description: Jeeves platform architecture, data flow, component interaction, scripts repo, and coordination knowledge. Use when making architectural decisions, coordinating across components, checking platform health, managing service lifecycle, or working with the scripts repo.
4
+ ---
5
+
6
+ # Jeeves Platform Skill
7
+
8
+ ## Platform Architecture
9
+
10
+ Jeeves is a four-component platform coordinated by a shared library (`@karmaniverous/jeeves`):
11
+
12
+ | Component | Role | Port |
13
+ |-----------|------|------|
14
+ | **jeeves-runner** | Execute: scheduled jobs, SQLite state, HTTP API | 1937 |
15
+ | **jeeves-watcher** | Index: file→Qdrant semantic indexing, inference rules | 1936 |
16
+ | **jeeves-server** | Present: web UI, file browser, doc render, export | 1934 |
17
+ | **jeeves-meta** | Distill: LLM synthesis, .meta/ directories, scheduling | 1938 |
18
+
19
+ Core (`@karmaniverous/jeeves`) is a **library + CLI**, not a service. No port.
20
+
21
+ ## Data Flow
22
+
23
+ ```
24
+ Files → Watcher (index) → Qdrant → Meta (synthesize) → .meta/ → Watcher (re-index)
25
+
26
+ Runner (schedule) → Scripts → Services ← Server (present) ← Browser
27
+ ```
28
+
29
+ ## Component Interaction
30
+
31
+ - **Watcher** indexes files into Qdrant with inference rules and enrichments.
32
+ - **Meta** reads from Qdrant, synthesizes `.meta/` directories, which watcher re-indexes.
33
+ - **Runner** executes scheduled scripts that may call any service's HTTP API.
34
+ - **Server** presents files, renders documents, and provides the event gateway.
35
+ - **Core** provides shared content management (TOOLS.md, SOUL.md, AGENTS.md), service discovery, config resolution, and the component SDK.
36
+
37
+ ## Service Discovery
38
+
39
+ Services find each other via config resolution:
40
+ 1. Component's own config file (`{configRoot}/jeeves-{name}/config.json`)
41
+ 2. Core config file (`{configRoot}/jeeves-core/config.json`)
42
+ 3. Default port constants
43
+
44
+ ## Scripts Repo
45
+
46
+ Location: `{configRoot}/jeeves-core/scripts/`
47
+ Template: `@karmaniverous/jeeves-scripts-template`
48
+
49
+ Scripts use utilities from `@karmaniverous/jeeves` (general) and `@karmaniverous/jeeves-runner` (runner-specific). Any script that could be useful outside runner scheduling belongs in core.
50
+
51
+ ## Managed Content System
52
+
53
+ Core maintains managed sections in workspace files using comment markers:
54
+ - **TOOLS.md** — Component sections (section mode) + Platform section
55
+ - **SOUL.md** — Professional discipline and behavioral foundations (block mode)
56
+ - **AGENTS.md** — Operational protocols and memory architecture (block mode)
57
+ - **HEARTBEAT.md** — Platform health status (heading-based)
58
+
59
+ Managed blocks are stationary after initial insertion. Cleanup detection uses Jaccard similarity on 3-word shingles. Cleanup escalation spawns a gateway session when orphaned content is detected.
60
+
61
+ ## Workspace Configuration
62
+
63
+ `jeeves.config.json` at workspace root provides shared defaults:
64
+ - Precedence: CLI flags → env vars → file → defaults
65
+ - Namespaced: `core.*` (workspace, configRoot, gatewayUrl, devRepos) and `memory.*` (budget, warningThreshold)
66
+ - Inspect with `jeeves config [jsonpath]`
67
+
68
+ ## HEARTBEAT Protocol
69
+
70
+ The HEARTBEAT system uses a state machine per component:
71
+ `not_installed → deps_missing → config_missing → service_not_installed → service_stopped → healthy`
72
+
73
+ Dependency-aware: hard deps block alerts, soft deps add informational notes. Declined components are tracked via heading suffix.
74
+
75
+ ## Plugin Lifecycle
76
+
77
+ ```bash
78
+ # Core install (seed workspace content)
79
+ npx @karmaniverous/jeeves install
80
+
81
+ # Component plugin install
82
+ npx @karmaniverous/jeeves-{component}-openclaw install
83
+
84
+ # Component plugin uninstall
85
+ npx @karmaniverous/jeeves-{component}-openclaw uninstall
86
+
87
+ # Core uninstall (remove managed sections)
88
+ npx @karmaniverous/jeeves uninstall
89
+ ```
90
+
91
+ ## Memory Hygiene
92
+
93
+ MEMORY.md has a character budget (default 20,000). Core tracks:
94
+ - Character count and usage percentage
95
+ - Warning at 80% of budget
96
+ - Stale section candidates (H2 sections whose most recent ISO date exceeds the staleness threshold)
97
+ - Evergreen sections (no dates) are never flagged
98
+
99
+ Review is human/agent-mediated — core does not auto-delete.
100
+
101
+ ### HEARTBEAT Integration
102
+
103
+ Memory hygiene is checked on every `ComponentWriter` cycle alongside component health. When budget or staleness thresholds are breached, a `## MEMORY.md` alert appears in HEARTBEAT.md under `# Jeeves Platform Status`. The alert includes character count, budget usage percentage, and any stale section names. When memory is healthy, the heading is absent — no alert content, no LLM cost on heartbeat polls.
104
+
105
+ The `## MEMORY.md` heading follows the same declined/active lifecycle as component headings (`## jeeves-{name}`). Users can decline memory alerts by changing the heading to `## MEMORY.md: declined`.
106
+
107
+ ## Workspace File Size Monitoring
108
+
109
+ OpenClaw applies a ~20,000-char injection limit to all workspace bootstrap files (AGENTS.md, SOUL.md, TOOLS.md, USER.md, MEMORY.md). Files exceeding the limit are silently truncated.
110
+
111
+ Core monitors all five files on every `ComponentWriter` cycle:
112
+ - Warning at 80% of budget (fixed threshold; not configurable via `jeeves.config.json`)
113
+ - Over-budget alert when charCount exceeds the budget
114
+ - Missing files are silently skipped
115
+
116
+ ### HEARTBEAT Integration
117
+
118
+ When a workspace file exceeds the warning threshold, a `## {filename}` alert appears in HEARTBEAT.md (e.g., `## AGENTS.md`). The alert includes:
119
+ - Character count, budget, and usage percentage
120
+ - Trimming guidance in priority order: (1) move domain-specific content to a local skill, (2) extract reference material to companion files with a pointer, (3) summarize verbose instructions, (4) remove stale content
121
+
122
+ Each file heading follows the same declined/active lifecycle as component headings. Users can decline alerts by changing the heading to `## {filename}: declined` (e.g., `## AGENTS.md: declined`).
@@ -0,0 +1,125 @@
1
+ ---
2
+ name: operations
3
+ description: Operational knowledge for a Jeeves installation. Covers date formatting utilities, email pipeline architecture, curation signal protocol, label taxonomy, and data flow patterns. Use when working with date formatting, email scripts, debugging email pipeline issues, or understanding how human email actions are interpreted.
4
+ ---
5
+
6
+ # Operations
7
+
8
+ Operational knowledge for the Jeeves platform. Covers email pipeline architecture, curation protocols, and operational conventions.
9
+
10
+ ## Date Formatting
11
+
12
+ A `date-fns` wrapper lives at `{configRoot}/jeeves-core/scripts/src/lib/dates.ts`. It provides:
13
+
14
+ | Export | Purpose |
15
+ |--------|---------|
16
+ | `dayOfWeek(dateStr)` | Full weekday name for an ISO date string (e.g. `'Monday'`) |
17
+ | `formatDate(dateStr, fmt)` | Format with any date-fns pattern |
18
+ | `relativeDays(dateStr, refStr?)` | Human-friendly relative description (`'today'`, `'tomorrow'`, `'3 days ago'`) |
19
+ | `parseISO` / `format` | Re-exported from date-fns for direct use |
20
+
21
+ ### Gateway session usage
22
+
23
+ From a gateway session, call via `exec`:
24
+
25
+ ```
26
+ node -e "import { dayOfWeek } from './src/lib/dates.js'; console.log(dayOfWeek('2026-05-11'));"
27
+ ```
28
+
29
+ with `workdir: {configRoot}/jeeves-core/scripts`.
30
+
31
+ Or use the simpler inline form when the full wrapper isn't needed:
32
+
33
+ ```
34
+ node -e "import { format, parseISO } from 'date-fns'; console.log(format(parseISO('2026-05-11'), 'EEEE'));"
35
+ ```
36
+
37
+ with `workdir: {configRoot}/jeeves-core/scripts` (so date-fns resolves from `node_modules`).
38
+
39
+ ### Hard gate
40
+
41
+ NEVER state a day of the week without computing it first. LLMs cannot do day-of-week arithmetic reliably.
42
+
43
+ ## Email Curation Signal Protocol
44
+
45
+ Defines how human email actions in Gmail are interpreted by Jeeves email processes.
46
+
47
+ ### Human Signals
48
+
49
+ | Signal | Meaning | Action |
50
+ |--------|---------|--------|
51
+ | Label added | Human is adjusting Jeeves classification | Update domain process inputs to reflect new classification |
52
+ | Label removed | Human is adjusting Jeeves classification (removal) | Update domain process inputs to reflect removed classification |
53
+ | Archived → Inbox | Human wants to keep this email in sight | Add `watch` label via update queue |
54
+ | Starred / Flagged | Elevated attention — email is important in context | Domain processes should weight higher |
55
+ | Moved to Spam | Confirmed spam — human classified as junk | Learn from classification for future triage |
56
+ | Removed from Spam | False positive — human rescued from spam | Process as normal email, learn from false positive |
57
+
58
+ ### Watch Label
59
+
60
+ The `watch` label has special semantics:
61
+ - When present, never auto-archive the email
62
+ - When a watched email lands in archive (by anyone), remove the watch label
63
+ - Added automatically when a human moves an archived email back to inbox
64
+
65
+ ### Label Taxonomy
66
+
67
+ Labels applied by Jeeves processes fall into two categories:
68
+
69
+ **Mechanical labels** (applied by domain extractors with high confidence):
70
+ - `meeting` — meeting-related email (invite, notes, transcript)
71
+ - `finance` — financial email (receipt, invoice, billing, statement)
72
+
73
+ **Reasoning labels** (applied by Update Email Meta, requiring cross-domain context):
74
+ - `project/<name>` — associated with a known project
75
+ - `todo` — requires action or work from the user
76
+ - `reply` — someone is waiting on a response
77
+ - `alert` — automated notification from a service
78
+ - `readme` — newsletter or subscribed informational content
79
+
80
+ ### Labeling Principles
81
+
82
+ 1. Label at the earliest point where confidence is high enough
83
+ 2. Domain extractors label what they know with certainty
84
+ 3. Update Email Meta labels what requires cross-domain context
85
+ 4. A thread can have multiple labels
86
+ 5. Do not re-label threads that already have the label
87
+ 6. **Prefer false negatives over false positives**
88
+
89
+ ### Poll Scope
90
+
91
+ Query: `newer_than:1d in:anywhere`
92
+
93
+ Must include spam and trash to detect human curation signals (e.g., moving to/from spam).
94
+
95
+ ## Email Pipeline Architecture
96
+
97
+ ### Directory Layout
98
+
99
+ ```
100
+ {configRoot}/jeeves-core/email-config.json — pipeline configuration (accounts, buckets)
101
+ {workspace}/../email/threads/{account}/ — canonical email archive (thread.json + per-message JSONs)
102
+ ```
103
+
104
+ ### Data Flow
105
+
106
+ 1. **Poll** (`email/poll.ts`) — searches Gmail for recent threads, classifies, enqueues important ones for metadata fetch
107
+ 2. **Fetch** (`email/email-fetch.ts`) — fetches full thread metadata from Gmail, creates/updates `thread.json` cache, enqueues for body download
108
+ 3. **Download** (`email/download.ts`) — downloads full message bodies, writes per-message JSONs to `threads/{account}/{threadId}/`
109
+ 4. **Drain Updates** (`email/drain-updates.ts`) — applies label changes and other queued updates back to Gmail
110
+ 5. **Meta synthesis** — jeeves-meta synthesizes email archives into searchable summaries
111
+
112
+ ### thread.json (Cache Format)
113
+
114
+ Each `threads/{account}/{threadId}/thread.json` contains:
115
+ - `threadId`, `account`, `subject`, `participants`
116
+ - `messages` — record of `{ messageId → { from, to, cc, date, internalDateMs, labels, snippet, attachments } }`
117
+ - `provenance` — label change history
118
+ - `cachedAt`, `updatedAt`
119
+
120
+ ### Per-Message JSONs
121
+
122
+ Each `threads/{account}/{threadId}/{messageId}.json` contains full message data:
123
+ - `messageId`, `threadId`, `account`, `subject`, `from`, `to`, `cc`
124
+ - `date` (RFC 2822), `internalDateMs` (epoch ms)
125
+ - `labels`, `body`, `attachments`, `downloadedAt`
@@ -0,0 +1,75 @@
1
+ ---
2
+ name: playbooks
3
+ description: >
4
+ Reusable operational workflow patterns for the Jeeves platform. Use when asked to
5
+ set up a daily briefing for a person or team, create standing meeting ops (notes +
6
+ agenda generation), replicate an existing workflow pattern for a new context, or
7
+ understand how recurring intelligence/ops workflows are structured. Covers the
8
+ full stack: content directory, TASK files, standing orders, runner jobs, dispatcher
9
+ scripts, Slack channel integration, and meta synthesis.
10
+ ---
11
+
12
+ # Playbooks
13
+
14
+ Proven, replicable operational patterns. Each playbook describes what it does, what
15
+ infrastructure it needs, and how to instantiate a new instance.
16
+
17
+ ## Common Infrastructure
18
+
19
+ All playbooks share these building blocks:
20
+
21
+ | Component | Purpose |
22
+ |-----------|---------|
23
+ | **Content directory** | `{workspace}/../<silo>/<domain>/` — stores output files, `.meta/`, standing orders |
24
+ | **TASK file** | Markdown prompt that defines the LLM session's entire job |
25
+ | **Standing orders** | `standing-orders.md` — append-only file for persistent stakeholder preferences |
26
+ | **Dispatcher script** | TypeScript in `{configRoot}/jeeves-core/scripts/src/` — reads TASK, spawns worker |
27
+ | **Runner job** | jeeves-runner job with cron schedule, timezone, and rrstack |
28
+ | **Slack channel** | Delivery surface — summary posts, quick-link pins, feedback loop |
29
+ | **Meta entity** | `.meta/` directory seeded so jeeves-meta synthesizes context over time |
30
+
31
+ ### Dispatcher Pattern
32
+
33
+ All dispatchers use `taskFileDispatcher` from `dispatchers/lib/task-file-dispatcher.ts`:
34
+
35
+ ```typescript
36
+ import { taskFileDispatcher } from '../dispatchers/lib/task-file-dispatcher.js';
37
+
38
+ taskFileDispatcher({
39
+ scriptName: '<silo>/<job-name>',
40
+ jobId: '<runner-job-id>',
41
+ taskFile: '<path-to-TASK.md>',
42
+ timeout: 600,
43
+ injectDateContext: true,
44
+ dateTimezone: '<IANA timezone>',
45
+ });
46
+ ```
47
+
48
+ `injectDateContext: true` prepends an authoritative date line so the LLM knows today's date.
49
+
50
+ ### Standing Orders Convention
51
+
52
+ - Append-only — never modify existing entries
53
+ - TASK files instruct the LLM to read standing orders at Step 0
54
+ - TASK files instruct the LLM to append new persistent preferences from channel feedback
55
+ - Include initial configuration section with participants, timezones, channel rules
56
+
57
+ ## Available Playbook Patterns
58
+
59
+ | Pattern | Description |
60
+ |---------|-------------|
61
+ | **Daily Briefing** | Recurring intelligence or action-item report for a stakeholder |
62
+ | **Standing Meeting Ops** | Post-meeting notes + next-day agenda generation for a recurring meeting |
63
+
64
+ ## Instantiation Checklist
65
+
66
+ When creating a new playbook instance:
67
+
68
+ 1. Choose the appropriate pattern from the table above
69
+ 2. Create the content directory with `.meta/` and `standing-orders.md`
70
+ 3. Write the TASK file(s) — adapt from an existing instance. Ensure Step 0 reads feedback from the *delivery channel* (where output is posted), not only a DM
71
+ 4. Write the dispatcher script(s) in `{configRoot}/jeeves-core/scripts/src/<silo>/`
72
+ 5. Register the runner job(s) with appropriate cron, timezone, rrstack
73
+ 6. Set up the Slack channel — pin a quick-links message if the pattern calls for it
74
+ 7. Seed `.meta/` so meta synthesis begins
75
+ 8. Test with `--dry-run` before going live
@@ -0,0 +1,57 @@
1
+ ---
2
+ name: slack-bot-provisioner
3
+ description: Provision a new Slack bot identity for Clawdbot on a fresh server. Guides through Slack App creation steps, collects tokens, writes local config/env, and verifies connectivity.
4
+ ---
5
+
6
+ # Slack bot provisioner (per-bot server)
7
+
8
+ Use this when you are setting up **a new Clawdbot instance** that should have **its own Slack bot identity** (one Slack App per bot), and you want a repeatable guided setup.
9
+
10
+ This skill assumes:
11
+ - The user is a Slack workspace admin.
12
+ - Each bot runs on its own server with its own Gateway config.
13
+
14
+ ## What can be automated vs not
15
+
16
+ **Automated (this skill):**
17
+ - Create local folders.
18
+ - Write a `slack.env` (bot token, signing secret).
19
+ - Patch the Clawdbot gateway config to enable Slack for this instance (user approves).
20
+ - Run a connectivity test (send a message to a channel).
21
+
22
+ **Not fully automatable (Slack-side):**
23
+ - Creating/installing the Slack App and granting scopes (UI/OAuth).
24
+ - Verifying event subscription URLs (requires public HTTPS endpoint).
25
+
26
+ ## Recommended mode
27
+ Start with **outbound-only** (post messages) and expand to event subscriptions later.
28
+
29
+ ## Quick start
30
+
31
+ 1) Have the user do the Slack UI steps in `references/slack-app-checklist.md`.
32
+ 2) Run the provisioning script:
33
+
34
+ - PowerShell:
35
+ - `powershell -NoProfile -ExecutionPolicy Bypass -File scripts/provision.ps1`
36
+
37
+ The script will prompt for:
38
+ - bot name
39
+ - Slack bot token (`xoxb-...`)
40
+ - Slack signing secret
41
+ - (optional) test channel id
42
+
43
+ ## Files
44
+ - Script: `scripts/provision.ps1`
45
+ - Reference checklist: `references/slack-app-checklist.md`
46
+ - Reference scopes: `references/scopes.md`
47
+
48
+ ## Secrets (best practices)
49
+ - **Do not** store secrets inside the skill folder (skills are meant to be shareable/publishable).
50
+ - Store secrets **per-instance** in the Clawdbot runtime directory (recommended):
51
+ - `C:\Users\Administrator\.clawdbot\credentials\...`
52
+ - Prefer environment variables / local credential files loaded by the Gateway/service manager.
53
+ - Never paste Slack secrets into public chats.
54
+
55
+ ## Safety notes
56
+ - Store secrets per-instance. Do not reuse tokens across bot identities.
57
+ - Avoid bot-to-bot loops: bots should ignore messages from other bots by default.