@poolzin/pool-bot 2026.3.6 → 2026.3.9

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 (68) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/.buildstamp +1 -1
  3. package/dist/agents/error-classifier.js +302 -0
  4. package/dist/agents/pi-tools.js +32 -2
  5. package/dist/agents/skills/security.js +217 -0
  6. package/dist/auto-reply/reply/get-reply.js +6 -0
  7. package/dist/auto-reply/reply/message-preprocess-hooks.js +17 -0
  8. package/dist/build-info.json +3 -3
  9. package/dist/cli/banner.js +20 -1
  10. package/dist/cli/lazy-commands.example.js +113 -0
  11. package/dist/cli/lazy-commands.js +329 -0
  12. package/dist/cli/program/command-registry.js +13 -0
  13. package/dist/cli/program/register.skills.js +4 -0
  14. package/dist/cli/security-cli.js +211 -2
  15. package/dist/cli/tagline.js +7 -0
  16. package/dist/config/config.js +1 -0
  17. package/dist/config/secrets-integration.js +88 -0
  18. package/dist/config/types.cli.js +1 -0
  19. package/dist/config/types.security.js +33 -0
  20. package/dist/config/zod-schema.js +15 -0
  21. package/dist/config/zod-schema.providers-core.js +1 -0
  22. package/dist/config/zod-schema.security.js +113 -0
  23. package/dist/context-engine/index.js +33 -0
  24. package/dist/context-engine/legacy.js +181 -0
  25. package/dist/context-engine/registry.js +86 -0
  26. package/dist/context-engine/summarizing.js +293 -0
  27. package/dist/context-engine/types.js +7 -0
  28. package/dist/discord/monitor/message-handler.preflight.js +11 -2
  29. package/dist/gateway/http-common.js +6 -1
  30. package/dist/hooks/fire-and-forget.js +6 -0
  31. package/dist/hooks/internal-hooks.js +64 -19
  32. package/dist/hooks/message-hook-mappers.js +179 -0
  33. package/dist/infra/abort-pattern.js +106 -0
  34. package/dist/infra/retry.js +94 -0
  35. package/dist/secrets/index.js +28 -0
  36. package/dist/secrets/resolver.js +185 -0
  37. package/dist/secrets/runtime.js +142 -0
  38. package/dist/secrets/types.js +11 -0
  39. package/dist/security/capability-guards.js +89 -0
  40. package/dist/security/capability-manager.js +76 -0
  41. package/dist/security/capability.js +147 -0
  42. package/dist/security/dangerous-tools.js +80 -0
  43. package/dist/security/index.js +7 -0
  44. package/dist/security/middleware.js +105 -0
  45. package/dist/security/types.js +12 -0
  46. package/dist/skills/commands.js +351 -0
  47. package/dist/skills/index.js +167 -0
  48. package/dist/skills/loader.js +282 -0
  49. package/dist/skills/parser.js +461 -0
  50. package/dist/skills/registry.js +397 -0
  51. package/dist/skills/security.js +318 -0
  52. package/dist/skills/types.js +21 -0
  53. package/dist/slack/monitor/context.js +1 -0
  54. package/dist/slack/monitor/message-handler/dispatch.js +14 -1
  55. package/dist/slack/monitor/provider.js +2 -0
  56. package/dist/test-utils/index.js +219 -0
  57. package/dist/tui/index.js +595 -0
  58. package/docs/INTEGRATION_PLAN.md +475 -0
  59. package/docs/INTEGRATION_SUMMARY.md +215 -0
  60. package/docs/integrations/HEXSTRIKE_PLAN.md +796 -0
  61. package/docs/integrations/INTEGRATION_PLAN.md +424 -0
  62. package/docs/integrations/PAGE_AGENT_PLAN.md +370 -0
  63. package/docs/integrations/XYOPS_PLAN.md +978 -0
  64. package/docs/skills/IMPLEMENTATION_SUMMARY.md +145 -0
  65. package/docs/skills/SKILL.md +524 -0
  66. package/docs/skills.md +405 -0
  67. package/package.json +1 -1
  68. package/skills/example-skill/SKILL.md +195 -0
package/docs/skills.md ADDED
@@ -0,0 +1,405 @@
1
+ # PoolBot Skills System
2
+
3
+ The PoolBot Skills System provides modular, discoverable capabilities defined in SKILL.md files. Skills follow the [agentskills.io](https://agentskills.io) specification and support progressive disclosure, security scanning, and context integration.
4
+
5
+ ## Overview
6
+
7
+ Skills are self-contained capability modules that:
8
+
9
+ - **Define when to use** them with clear criteria
10
+ - **Provide practical examples** and templates
11
+ - **Support progressive loading** (metadata → summary → full content)
12
+ - **Are automatically security scanned** for common vulnerabilities
13
+ - **Can be enabled/disabled** per session or globally
14
+ - **Integrate with the context engine** for LLM prompt injection
15
+
16
+ ## Quick Start
17
+
18
+ ### Listing Skills
19
+
20
+ ```bash
21
+ # List all skills
22
+ poolbot skills list
23
+
24
+ # Filter by category
25
+ poolbot skills list --category=productivity
26
+
27
+ # Show only enabled/disabled
28
+ poolbot skills list --enabled
29
+ poolbot skills list --disabled
30
+ ```
31
+
32
+ ### Viewing Skills
33
+
34
+ ```bash
35
+ # View skill details (full content)
36
+ poolbot skills view github
37
+
38
+ # View with specific disclosure level
39
+ poolbot skills view github --level=summary
40
+ poolbot skills view github --level=metadata
41
+ ```
42
+
43
+ ### Searching Skills
44
+
45
+ ```bash
46
+ # Search by text
47
+ poolbot skills search git
48
+
49
+ # Search with filters
50
+ poolbot skills search deploy --tag=devops
51
+ ```
52
+
53
+ ### Managing Skills
54
+
55
+ ```bash
56
+ # Enable/disable skills
57
+ poolbot skills enable github
58
+ poolbot skills disable github
59
+
60
+ # Security scan
61
+ poolbot skills scan
62
+ poolbot skills scan ./skills/my-skill
63
+
64
+ # Statistics
65
+ poolbot skills stats
66
+ ```
67
+
68
+ ## Creating Skills
69
+
70
+ ### File Structure
71
+
72
+ ```
73
+ skills/
74
+ └── my-skill/
75
+ └── SKILL.md # Main skill definition
76
+ ```
77
+
78
+ ### SKILL.md Format
79
+
80
+ ```markdown
81
+ ---
82
+ id: my-skill # Unique kebab-case identifier
83
+ name: My Skill # Human-readable name
84
+ description: | # Multi-line description
85
+ What this skill does and
86
+ when to use it.
87
+ version: 1.0.0 # Semver version
88
+ author: Your Name # Author attribution
89
+ categories: # Classification
90
+ - productivity
91
+ - automation
92
+ tags: # Searchable tags
93
+ - git
94
+ - github
95
+ - devops
96
+ metadata:
97
+ poolbot: # PoolBot-specific settings
98
+ emoji: 🚀
99
+ always: false # Load on every session?
100
+ requires: # Dependencies
101
+ bins: [gh, jq]
102
+ env: [GITHUB_TOKEN]
103
+ install: # Auto-install specs
104
+ - kind: brew
105
+ formula: gh
106
+ bins: [gh]
107
+ ---
108
+
109
+ # My Skill
110
+
111
+ ## When to Use
112
+
113
+ ✅ **USE this skill when:**
114
+ - Condition 1
115
+ - Condition 2
116
+
117
+ ❌ **DON'T use this skill when:**
118
+ - Condition 3
119
+ - Condition 4
120
+
121
+ ## Common Commands
122
+
123
+ ```bash
124
+ # Example command
125
+ poolbot command --option
126
+ ```
127
+
128
+ ## Templates
129
+
130
+ ```bash
131
+ # Reusable template
132
+ echo "Template content"
133
+ ```
134
+ ```
135
+
136
+ ### Frontmatter Fields
137
+
138
+ | Field | Type | Required | Description |
139
+ |-------|------|----------|-------------|
140
+ | `id` | string | Yes | Unique kebab-case identifier |
141
+ | `name` | string | Yes | Human-readable name |
142
+ | `description` | string | Yes | What the skill does |
143
+ | `version` | string | Yes | Semver version |
144
+ | `author` | string | No | Author attribution |
145
+ | `categories` | string[] | No | Classification tags |
146
+ | `tags` | string[] | No | Searchable keywords |
147
+ | `metadata.poolbot.emoji` | string | No | Emoji icon |
148
+ | `metadata.poolbot.always` | boolean | No | Load on every session |
149
+ | `metadata.poolbot.requires.bins` | string[] | No | Required binaries |
150
+ | `metadata.poolbot.requires.env` | string[] | No | Required env vars |
151
+ | `metadata.poolbot.install` | array | No | Auto-install specs |
152
+
153
+ ### Categories
154
+
155
+ Choose from these standard categories:
156
+
157
+ - `communication` - Messaging, email, notifications
158
+ - `productivity` - Task management, notes, calendar
159
+ - `development` - Coding, git, CI/CD
160
+ - `devops` - Infrastructure, deployment, monitoring
161
+ - `data` - Databases, analytics, processing
162
+ - `media` - Images, video, audio
163
+ - `automation` - Workflows, scripting
164
+ - `integration` - APIs, webhooks, services
165
+ - `utility` - General-purpose tools
166
+
167
+ ## Security
168
+
169
+ All skills are automatically scanned for:
170
+
171
+ - **Prompt injection** - Attempts to override system instructions
172
+ - **Command injection** - Dangerous shell command patterns
173
+ - **Path traversal** - File system escape attempts
174
+ - **Hardcoded credentials** - Passwords, tokens, keys
175
+ - **Suspicious encoding** - Base64 obfuscation
176
+ - **Data exfiltration** - Unauthorized data transmission
177
+
178
+ ### Security Levels
179
+
180
+ | Severity | Description | Action |
181
+ |----------|-------------|--------|
182
+ | Critical | Immediate security risk | Block loading |
183
+ | High | Significant risk | Warn user |
184
+ | Medium | Moderate concern | Log only |
185
+ | Low | Minor issue | Silent |
186
+ | Info | FYI | Silent |
187
+
188
+ ### Strict Mode
189
+
190
+ Enable strict mode to block skills with any high/critical findings:
191
+
192
+ ```typescript
193
+ import { initSkills } from "./skills/index.js";
194
+
195
+ await initSkills({
196
+ security: {
197
+ strictMode: true, // Block on high/critical findings
198
+ autoScan: true, // Scan on load
199
+ },
200
+ });
201
+ ```
202
+
203
+ ## Context Integration
204
+
205
+ Skills can be automatically injected into LLM prompts based on the conversation context.
206
+
207
+ ### Progressive Disclosure
208
+
209
+ Content loads incrementally to manage token usage:
210
+
211
+ 1. **Metadata** (~50 tokens) - ID, name, description
212
+ 2. **Summary** (~200 tokens) - Metadata + first section
213
+ 3. **Full** (all tokens) - Complete content
214
+
215
+ ### Query-Based Loading
216
+
217
+ ```typescript
218
+ import { loadSkillForQuery } from "./skills/index.js";
219
+
220
+ // Load skills relevant to a query
221
+ const skills = await loadSkillForQuery("deploy to production", {
222
+ maxTokens: 2000,
223
+ disclosure: "summary",
224
+ });
225
+ ```
226
+
227
+ ### Context Preparation
228
+
229
+ ```typescript
230
+ import { prepareSkillsForContext } from "./skills/index.js";
231
+
232
+ // Prepare skills for LLM context
233
+ const context = await prepareSkillsForContext({
234
+ skillIds: ["github", "docker"],
235
+ maxTokens: 4000,
236
+ disclosure: "full",
237
+ });
238
+ ```
239
+
240
+ ## Programmatic API
241
+
242
+ ### Registry
243
+
244
+ ```typescript
245
+ import { getRegistry } from "./skills/index.js";
246
+
247
+ const registry = getRegistry();
248
+
249
+ // Add a skill
250
+ await registry.addSkill("/path/to/skill");
251
+
252
+ // Search
253
+ const results = registry.searchSkills({
254
+ query: "git",
255
+ category: "development",
256
+ });
257
+
258
+ // Enable/disable
259
+ registry.enableSkill("github");
260
+ registry.disableSkill("github");
261
+
262
+ // Listen for events
263
+ registry.on("skillLoaded", (skill) => {
264
+ console.log(`Loaded: ${skill.name}`);
265
+ });
266
+ ```
267
+
268
+ ### Parser
269
+
270
+ ```typescript
271
+ import { parseSkillFile } from "./skills/index.js";
272
+
273
+ const skill = parseSkillFile("/path/to/SKILL.md");
274
+ console.log(skill.metadata.name);
275
+ ```
276
+
277
+ ### Security
278
+
279
+ ```typescript
280
+ import { scanSkill, quickSecurityCheck } from "./skills/index.js";
281
+
282
+ // Full scan
283
+ const report = scanSkill("my-skill", skillContent);
284
+ console.log(report.findings);
285
+
286
+ // Quick check
287
+ const isSafe = quickSecurityCheck("my-skill", skillContent);
288
+ ```
289
+
290
+ ## Examples
291
+
292
+ See the `skills/example-skill/SKILL.md` file for a comprehensive template.
293
+
294
+ ### Simple Skill
295
+
296
+ ```markdown
297
+ ---
298
+ id: hello
299
+ name: Hello World
300
+ description: A simple greeting skill
301
+ version: 1.0.0
302
+ categories: [utility]
303
+ tags: [demo, example]
304
+ ---
305
+
306
+ # Hello World
307
+
308
+ Says hello to the user.
309
+
310
+ ## When to Use
311
+
312
+ Use when you want to greet someone.
313
+
314
+ ## Commands
315
+
316
+ ```bash
317
+ echo "Hello, World!"
318
+ ```
319
+ ```
320
+
321
+ ### Complex Skill
322
+
323
+ ```markdown
324
+ ---
325
+ id: kubernetes-deploy
326
+ name: Kubernetes Deployment
327
+ description: Deploy applications to Kubernetes clusters
328
+ version: 2.1.0
329
+ author: DevOps Team
330
+ categories: [devops, automation]
331
+ tags: [k8s, kubernetes, deploy, helm]
332
+ metadata:
333
+ poolbot:
334
+ emoji: ☸️
335
+ requires:
336
+ bins: [kubectl, helm]
337
+ env: [KUBECONFIG]
338
+ ---
339
+
340
+ # Kubernetes Deployment
341
+
342
+ Deploy and manage applications on Kubernetes clusters.
343
+
344
+ ## When to Use
345
+
346
+ ✅ **USE when:**
347
+ - Deploying to Kubernetes
348
+ - Managing Helm releases
349
+ - Checking pod status
350
+
351
+ ❌ **DON'T use when:**
352
+ - Working with Docker Compose
353
+ - Managing bare-metal servers
354
+
355
+ ## Common Commands
356
+
357
+ ```bash
358
+ # Apply manifests
359
+ kubectl apply -f deployment.yaml
360
+
361
+ # Check status
362
+ kubectl get pods -n production
363
+
364
+ # Deploy with Helm
365
+ helm upgrade --install myapp ./chart
366
+ ```
367
+ ```
368
+
369
+ ## Best Practices
370
+
371
+ 1. **Clear descriptions** - Make the purpose obvious
372
+ 2. **Specific criteria** - Define when to use (and when not to)
373
+ 3. **Practical examples** - Include real, tested commands
374
+ 4. **Security first** - Never include credentials
375
+ 5. **Version properly** - Use semantic versioning
376
+ 6. **Categorize well** - Choose appropriate categories
377
+ 7. **Tag thoroughly** - Include relevant keywords
378
+ 8. **Test examples** - Ensure commands actually work
379
+
380
+ ## Troubleshooting
381
+
382
+ ### Skill not appearing
383
+
384
+ - Check file is named exactly `SKILL.md`
385
+ - Verify YAML frontmatter is valid
386
+ - Ensure file is in a subdirectory of `skills/`
387
+
388
+ ### Security scan failures
389
+
390
+ - Review findings with `poolbot skills scan`
391
+ - Remove hardcoded credentials
392
+ - Avoid suspicious patterns
393
+ - Use environment variables for secrets
394
+
395
+ ### Context not loading
396
+
397
+ - Check skill is enabled: `poolbot skills list --enabled`
398
+ - Verify token limits aren't exceeded
399
+ - Try lower disclosure level
400
+
401
+ ## See Also
402
+
403
+ - [agentskills.io specification](https://agentskills.io)
404
+ - [Example Skill](../skills/example-skill/SKILL.md)
405
+ - [CLI Reference](./cli/skills.md)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@poolzin/pool-bot",
3
- "version": "2026.3.6",
3
+ "version": "2026.3.9",
4
4
  "description": "🎱 Pool Bot - AI assistant with PLCODE integrations",
5
5
  "keywords": [],
6
6
  "license": "MIT",
@@ -0,0 +1,195 @@
1
+ ---
2
+ id: example-skill
3
+ name: Example Skill
4
+ description: |
5
+ A comprehensive example demonstrating the SKILL.md format for PoolBot.
6
+ Use this as a template when creating new skills.
7
+ version: 1.0.0
8
+ author: PoolBot Team
9
+ categories:
10
+ - examples
11
+ - documentation
12
+ tags:
13
+ - template
14
+ - reference
15
+ - tutorial
16
+ metadata:
17
+ poolbot:
18
+ emoji: 📚
19
+ always: false
20
+ requires:
21
+ bins: []
22
+ env: []
23
+ install: []
24
+ ---
25
+
26
+ # Example Skill
27
+
28
+ This is a comprehensive example of a SKILL.md file that demonstrates all the features of the PoolBot skills system.
29
+
30
+ ## When to Use
31
+
32
+ ✅ **USE this skill when:**
33
+
34
+ - You want to learn about the SKILL.md format
35
+ - You need a template for creating new skills
36
+ - You're exploring PoolBot's capabilities
37
+
38
+ ❌ **DON'T use this skill when:**
39
+
40
+ - You need to perform actual work (this is just documentation)
41
+ - You're looking for production-ready automation
42
+
43
+ ## Overview
44
+
45
+ Skills in PoolBot are modular capabilities defined in SKILL.md files. They follow the agentskills.io specification and support:
46
+
47
+ - **Progressive disclosure**: Content loads incrementally (metadata → summary → full)
48
+ - **Security scanning**: Automatic detection of prompt injection, command injection, etc.
49
+ - **Context integration**: Skills can be injected into LLM prompts
50
+ - **CLI management**: List, search, enable/disable skills via `poolbot skills`
51
+
52
+ ## File Structure
53
+
54
+ ```
55
+ skills/
56
+ └── my-skill/
57
+ └── SKILL.md # Main skill definition
58
+ ```
59
+
60
+ ## Frontmatter Format
61
+
62
+ The frontmatter (YAML between `---` markers) contains metadata:
63
+
64
+ ```yaml
65
+ ---
66
+ id: my-skill # Unique kebab-case identifier
67
+ name: My Skill # Human-readable name
68
+ description: | # Multi-line description
69
+ What this skill does.
70
+ Can span multiple lines.
71
+ version: 1.0.0 # Semver version
72
+ author: Your Name # Author attribution
73
+ categories: # Classification
74
+ - category1
75
+ - category2
76
+ tags: # Searchable tags
77
+ - tag1
78
+ - tag2
79
+ metadata:
80
+ poolbot: # PoolBot-specific settings
81
+ emoji: 🚀
82
+ always: false # Load on every session?
83
+ requires: # Dependencies
84
+ bins: [gh, jq]
85
+ env: [GITHUB_TOKEN]
86
+ install: # Auto-install specs
87
+ - kind: brew
88
+ formula: gh
89
+ bins: [gh]
90
+ ---
91
+ ```
92
+
93
+ ## Content Sections
94
+
95
+ ### When to Use
96
+
97
+ Clearly define when this skill should and shouldn't be used. This helps the LLM make better decisions.
98
+
99
+ ### Common Commands
100
+
101
+ Include practical examples:
102
+
103
+ ```bash
104
+ # Example command
105
+ poolbot skills list
106
+
107
+ # Example with options
108
+ poolbot skills search --category=examples
109
+ ```
110
+
111
+ ### Templates
112
+
113
+ Provide reusable templates:
114
+
115
+ ```bash
116
+ # Template for skill creation
117
+ mkdir skills/my-skill
118
+ cat > skills/my-skill/SKILL.md << 'EOF'
119
+ ---
120
+ id: my-skill
121
+ name: My Skill
122
+ description: Description here
123
+ version: 1.0.0
124
+ ---
125
+
126
+ # My Skill
127
+
128
+ Content here...
129
+ EOF
130
+ ```
131
+
132
+ ## Best Practices
133
+
134
+ 1. **Clear descriptions**: Make it obvious what the skill does
135
+ 2. **Specific use cases**: Define when to use (and when NOT to use)
136
+ 3. **Practical examples**: Include real commands users can run
137
+ 4. **Security awareness**: Don't include hardcoded credentials
138
+ 5. **Versioning**: Use semantic versioning
139
+ 6. **Categories**: Choose appropriate categories for discoverability
140
+
141
+ ## Security Considerations
142
+
143
+ Skills are automatically scanned for:
144
+
145
+ - **Prompt injection** attempts
146
+ - **Command injection** patterns
147
+ - **Path traversal** attacks
148
+ - **Hardcoded credentials**
149
+ - **Suspicious encoding**
150
+ - **Data exfiltration** endpoints
151
+
152
+ Always review skills before enabling them, especially if they:
153
+ - Execute shell commands
154
+ - Access sensitive data
155
+ - Make network requests
156
+
157
+ ## CLI Commands
158
+
159
+ ```bash
160
+ # List all skills
161
+ poolbot skills list
162
+
163
+ # Search skills
164
+ poolbot skills search github
165
+
166
+ # View skill details
167
+ poolbot skills view github
168
+
169
+ # Enable/disable skills
170
+ poolbot skills enable my-skill
171
+ poolbot skills disable my-skill
172
+
173
+ # Security scan
174
+ poolbot skills scan
175
+
176
+ # Statistics
177
+ poolbot skills stats
178
+ ```
179
+
180
+ ## Linked Files
181
+
182
+ You can reference additional files that will be loaded with the skill:
183
+
184
+ ```markdown
185
+ See also: [Advanced Usage](./advanced.md)
186
+ Related: [API Reference](./api.md)
187
+ ```
188
+
189
+ ## Notes
190
+
191
+ - Skills are loaded from `skills/` directory
192
+ - Subdirectories are scanned recursively
193
+ - Files must be named `SKILL.md` (case-sensitive)
194
+ - Frontmatter is required
195
+ - Content supports full Markdown