jfl 0.1.1 → 0.2.1

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 (112) hide show
  1. package/README.md +77 -7
  2. package/clawdbot-plugin/clawdbot.plugin.json +20 -0
  3. package/clawdbot-plugin/index.js +555 -0
  4. package/clawdbot-plugin/index.ts +582 -0
  5. package/clawdbot-skill/SKILL.md +33 -336
  6. package/clawdbot-skill/index.ts +516 -319
  7. package/clawdbot-skill/skill.json +4 -13
  8. package/dist/commands/clawdbot.d.ts +11 -0
  9. package/dist/commands/clawdbot.d.ts.map +1 -0
  10. package/dist/commands/clawdbot.js +215 -0
  11. package/dist/commands/clawdbot.js.map +1 -0
  12. package/dist/commands/gtm-process-update.d.ts +10 -0
  13. package/dist/commands/gtm-process-update.d.ts.map +1 -0
  14. package/dist/commands/gtm-process-update.js +101 -0
  15. package/dist/commands/gtm-process-update.js.map +1 -0
  16. package/dist/commands/onboard.d.ts.map +1 -1
  17. package/dist/commands/onboard.js +203 -15
  18. package/dist/commands/onboard.js.map +1 -1
  19. package/dist/commands/openclaw.d.ts +56 -0
  20. package/dist/commands/openclaw.d.ts.map +1 -0
  21. package/dist/commands/openclaw.js +700 -0
  22. package/dist/commands/openclaw.js.map +1 -0
  23. package/dist/commands/service-validate.d.ts +12 -0
  24. package/dist/commands/service-validate.d.ts.map +1 -0
  25. package/dist/commands/service-validate.js +611 -0
  26. package/dist/commands/service-validate.js.map +1 -0
  27. package/dist/commands/services-create.d.ts +15 -0
  28. package/dist/commands/services-create.d.ts.map +1 -0
  29. package/dist/commands/services-create.js +1452 -0
  30. package/dist/commands/services-create.js.map +1 -0
  31. package/dist/commands/services-sync-agents.d.ts +23 -0
  32. package/dist/commands/services-sync-agents.d.ts.map +1 -0
  33. package/dist/commands/services-sync-agents.js +207 -0
  34. package/dist/commands/services-sync-agents.js.map +1 -0
  35. package/dist/commands/services.d.ts +7 -1
  36. package/dist/commands/services.d.ts.map +1 -1
  37. package/dist/commands/services.js +347 -22
  38. package/dist/commands/services.js.map +1 -1
  39. package/dist/commands/update.js +0 -0
  40. package/dist/commands/validate-settings.d.ts +37 -0
  41. package/dist/commands/validate-settings.d.ts.map +1 -0
  42. package/dist/commands/validate-settings.js +197 -0
  43. package/dist/commands/validate-settings.js.map +1 -0
  44. package/dist/index.js +155 -60
  45. package/dist/index.js.map +1 -1
  46. package/dist/lib/agent-generator.d.ts.map +1 -1
  47. package/dist/lib/agent-generator.js +94 -1
  48. package/dist/lib/agent-generator.js.map +1 -1
  49. package/dist/lib/openclaw-registry.d.ts +48 -0
  50. package/dist/lib/openclaw-registry.d.ts.map +1 -0
  51. package/dist/lib/openclaw-registry.js +181 -0
  52. package/dist/lib/openclaw-registry.js.map +1 -0
  53. package/dist/lib/openclaw-sdk.d.ts +107 -0
  54. package/dist/lib/openclaw-sdk.d.ts.map +1 -0
  55. package/dist/lib/openclaw-sdk.js +208 -0
  56. package/dist/lib/openclaw-sdk.js.map +1 -0
  57. package/dist/lib/peer-agent-generator.d.ts +44 -0
  58. package/dist/lib/peer-agent-generator.d.ts.map +1 -0
  59. package/dist/lib/peer-agent-generator.js +286 -0
  60. package/dist/lib/peer-agent-generator.js.map +1 -0
  61. package/dist/lib/service-detector.d.ts +1 -1
  62. package/dist/lib/service-detector.d.ts.map +1 -1
  63. package/dist/lib/service-detector.js +118 -5
  64. package/dist/lib/service-detector.js.map +1 -1
  65. package/dist/lib/service-gtm.d.ts +157 -0
  66. package/dist/lib/service-gtm.d.ts.map +1 -0
  67. package/dist/lib/service-gtm.js +786 -0
  68. package/dist/lib/service-gtm.js.map +1 -0
  69. package/dist/lib/service-mcp-base.d.ts +10 -1
  70. package/dist/lib/service-mcp-base.d.ts.map +1 -1
  71. package/dist/lib/service-mcp-base.js +20 -1
  72. package/dist/lib/service-mcp-base.js.map +1 -1
  73. package/dist/mcp/service-peer-mcp.d.ts +36 -0
  74. package/dist/mcp/service-peer-mcp.d.ts.map +1 -0
  75. package/dist/mcp/service-peer-mcp.js +220 -0
  76. package/dist/mcp/service-peer-mcp.js.map +1 -0
  77. package/dist/mcp/service-registry-mcp.js +0 -0
  78. package/dist/utils/settings-validator.d.ts +4 -1
  79. package/dist/utils/settings-validator.d.ts.map +1 -1
  80. package/dist/utils/settings-validator.js +25 -1
  81. package/dist/utils/settings-validator.js.map +1 -1
  82. package/package.json +2 -1
  83. package/template/.claude/service-settings.json +32 -0
  84. package/template/.claude/settings.json +10 -0
  85. package/template/.claude/skills/end/SKILL.md +1780 -0
  86. package/template/.jfl/config.json +2 -1
  87. package/template/.mcp.json +1 -7
  88. package/template/CLAUDE.md +1042 -248
  89. package/template/CLAUDE.md.bak +1187 -0
  90. package/template/scripts/commit-gtm.sh +56 -0
  91. package/template/scripts/commit-product.sh +68 -0
  92. package/template/scripts/migrate-to-branch-sessions.sh +201 -0
  93. package/template/scripts/session/auto-commit.sh +4 -3
  94. package/template/scripts/session/jfl-doctor.sh +222 -83
  95. package/template/scripts/session/session-cleanup.sh +109 -21
  96. package/template/scripts/session/session-end.sh +26 -13
  97. package/template/scripts/session/session-init.sh +280 -98
  98. package/template/scripts/session/test-critical-infrastructure.sh +293 -0
  99. package/template/scripts/session/test-experience-level.sh +336 -0
  100. package/template/scripts/session/test-session-cleanup.sh +268 -0
  101. package/template/scripts/session/test-session-sync.sh +320 -0
  102. package/template/scripts/where-am-i.sh +78 -0
  103. package/template/templates/service-agent/.claude/settings.json +32 -0
  104. package/template/templates/service-agent/CLAUDE.md +334 -0
  105. package/template/templates/service-agent/knowledge/ARCHITECTURE.md +115 -0
  106. package/template/templates/service-agent/knowledge/DEPLOYMENT.md +199 -0
  107. package/template/templates/service-agent/knowledge/RUNBOOK.md +412 -0
  108. package/template/templates/service-agent/knowledge/SERVICE_SPEC.md +77 -0
  109. package/dist/commands/session-mgmt.d.ts +0 -33
  110. package/dist/commands/session-mgmt.d.ts.map +0 -1
  111. package/dist/commands/session-mgmt.js +0 -404
  112. package/dist/commands/session-mgmt.js.map +0 -1
@@ -0,0 +1,412 @@
1
+ # {SERVICE_NAME} - Operations Runbook
2
+
3
+ ## Common Tasks
4
+
5
+ ### Task: Update Content/Copy
6
+
7
+ **When:** Content or messaging needs to change
8
+
9
+ **Steps:**
10
+ 1. Locate the component: `{typical location}`
11
+ 2. Update the content
12
+ 3. Test locally: `{dev command}`
13
+ 4. Commit: `git add . && git commit -m "content: update {what}"`
14
+ 5. Deploy: `{deploy command}`
15
+ 6. Verify on production
16
+
17
+ **Example files:**
18
+ - Homepage: `{file path}`
19
+ - About page: `{file path}`
20
+
21
+ ---
22
+
23
+ ### Task: Add New Feature
24
+
25
+ **When:** New functionality needed
26
+
27
+ **Steps:**
28
+ 1. Review SERVICE_SPEC.md and ARCHITECTURE.md
29
+ 2. Plan the change (which components affected)
30
+ 3. Implement the feature
31
+ 4. Add tests: `{test file location}`
32
+ 5. Test locally: `{test command}`
33
+ 6. Update documentation if needed
34
+ 7. Commit with appropriate type: `feat: {description}`
35
+ 8. Deploy
36
+ 9. Write journal entry documenting the feature
37
+
38
+ ---
39
+
40
+ ### Task: Fix Bug
41
+
42
+ **When:** Something broken
43
+
44
+ **Steps:**
45
+ 1. Reproduce the issue locally
46
+ 2. Check logs for errors: `{log command}`
47
+ 3. Identify root cause
48
+ 4. Write test that fails (reproduces bug)
49
+ 5. Fix the bug
50
+ 6. Verify test now passes
51
+ 7. Commit: `fix: {description}`
52
+ 8. Deploy
53
+ 9. Journal entry with root cause analysis
54
+
55
+ ---
56
+
57
+ ### Task: Update Dependencies
58
+
59
+ **When:** Security updates or new features needed
60
+
61
+ **Steps:**
62
+ ```bash
63
+ # Check for updates
64
+ {check updates command}
65
+
66
+ # Update dependencies
67
+ {update command}
68
+
69
+ # Test everything still works
70
+ {test command}
71
+
72
+ # Check for breaking changes
73
+ git diff package.json
74
+
75
+ # Commit
76
+ git commit -m "chore: update dependencies"
77
+
78
+ # Deploy and monitor
79
+ ```
80
+
81
+ ---
82
+
83
+ ### Task: Performance Investigation
84
+
85
+ **When:** Service is slow
86
+
87
+ **Steps:**
88
+ 1. Check resource usage: `{resource check command}`
89
+ 2. Review recent changes: `git log --oneline -10`
90
+ 3. Check dependency services status
91
+ 4. Review logs for slow queries/operations
92
+ 5. Profile if needed: `{profiling command}`
93
+ 6. Implement fix
94
+ 7. Verify improvement
95
+ 8. Document findings in journal
96
+
97
+ ---
98
+
99
+ ## Troubleshooting
100
+
101
+ ### Symptom: Service Won't Start
102
+
103
+ **Possible Causes:**
104
+ - Port already in use
105
+ - Missing environment variables
106
+ - Dependency service down
107
+ - Database connection failed
108
+
109
+ **Investigation:**
110
+ ```bash
111
+ # Check if port is in use
112
+ lsof -i :{PORT}
113
+
114
+ # Verify environment variables
115
+ {env check command}
116
+
117
+ # Check logs
118
+ {log command}
119
+
120
+ # Verify dependencies
121
+ {dependency check}
122
+ ```
123
+
124
+ **Resolution:**
125
+ 1. Kill process using port (if appropriate)
126
+ 2. Set missing environment variables
127
+ 3. Restart dependency services
128
+ 4. Fix configuration issues
129
+
130
+ ---
131
+
132
+ ### Symptom: 500 Errors
133
+
134
+ **Possible Causes:**
135
+ - Uncaught exception
136
+ - Database query failed
137
+ - External API down
138
+ - Invalid configuration
139
+
140
+ **Investigation:**
141
+ ```bash
142
+ # Check error logs
143
+ {error log command}
144
+
145
+ # Check external service status
146
+ curl {dependency-health-check}
147
+
148
+ # Review recent changes
149
+ git log --oneline -5
150
+ ```
151
+
152
+ **Resolution:**
153
+ 1. Fix code issue causing exception
154
+ 2. Handle database errors gracefully
155
+ 3. Add fallback for external API
156
+ 4. Correct configuration
157
+
158
+ ---
159
+
160
+ ### Symptom: Slow Performance
161
+
162
+ **Possible Causes:**
163
+ - Inefficient database queries
164
+ - Large payload sizes
165
+ - External API latency
166
+ - Memory leak
167
+
168
+ **Investigation:**
169
+ ```bash
170
+ # Check resource usage
171
+ {resource command}
172
+
173
+ # Profile performance
174
+ {profile command}
175
+
176
+ # Check database query times
177
+ {db query log}
178
+
179
+ # Monitor external API calls
180
+ {api monitoring}
181
+ ```
182
+
183
+ **Resolution:**
184
+ 1. Optimize database queries (add indexes, reduce joins)
185
+ 2. Implement caching
186
+ 3. Reduce payload sizes
187
+ 4. Add timeouts to external calls
188
+ 5. Fix memory leaks
189
+
190
+ ---
191
+
192
+ ## Health Checks
193
+
194
+ ### Manual Health Check
195
+
196
+ ```bash
197
+ # Check service is responding
198
+ curl {health-check-url}
199
+
200
+ # Expected response:
201
+ {expected response}
202
+ ```
203
+
204
+ ### Automated Monitoring
205
+
206
+ - **Uptime:** {where uptime is monitored}
207
+ - **Error Rate:** {where errors are tracked}
208
+ - **Response Time:** {where latency is tracked}
209
+
210
+ **Alert Thresholds:**
211
+ - Error rate > {threshold}%
212
+ - Response time > {threshold}ms
213
+ - Availability < {threshold}%
214
+
215
+ ---
216
+
217
+ ## Data Operations
218
+
219
+ ### Backup (if applicable)
220
+
221
+ ```bash
222
+ {backup command}
223
+ ```
224
+
225
+ **Backup schedule:** {schedule}
226
+ **Backup location:** {location}
227
+
228
+ ### Restore (if applicable)
229
+
230
+ ```bash
231
+ {restore command}
232
+ ```
233
+
234
+ ### Data Migration
235
+
236
+ ```bash
237
+ {migration command}
238
+ ```
239
+
240
+ **Migration history:** `{migrations location}`
241
+
242
+ ---
243
+
244
+ ## Security Operations
245
+
246
+ ### Rotate Secrets
247
+
248
+ ```bash
249
+ # Update secret in platform
250
+ {secret update command}
251
+
252
+ # Restart service to pick up new secret
253
+ {restart command}
254
+
255
+ # Verify service still works
256
+ {health check}
257
+ ```
258
+
259
+ ### Audit Access
260
+
261
+ ```bash
262
+ {access audit command}
263
+ ```
264
+
265
+ **Who has access:** {list or command}
266
+
267
+ ### Security Scan
268
+
269
+ ```bash
270
+ # Scan dependencies
271
+ npm audit # or equivalent
272
+
273
+ # Fix vulnerabilities
274
+ npm audit fix
275
+ ```
276
+
277
+ ---
278
+
279
+ ## Scaling (if applicable)
280
+
281
+ ### Scale Up
282
+
283
+ ```bash
284
+ {scale up command}
285
+ ```
286
+
287
+ ### Scale Down
288
+
289
+ ```bash
290
+ {scale down command}
291
+ ```
292
+
293
+ ### Check Current Scale
294
+
295
+ ```bash
296
+ {check scale command}
297
+ ```
298
+
299
+ ---
300
+
301
+ ## Integration Points
302
+
303
+ ### With {Service A}
304
+
305
+ **Purpose:** {why we integrate}
306
+ **Health Check:** `{command to verify integration}`
307
+ **Common Issues:**
308
+ - {Issue 1}: {fix}
309
+ - {Issue 2}: {fix}
310
+
311
+ ### With {Service B}
312
+
313
+ **Purpose:** {why we integrate}
314
+ **Health Check:** `{command to verify integration}`
315
+ **Common Issues:**
316
+ - {Issue 1}: {fix}
317
+ - {Issue 2}: {fix}
318
+
319
+ ---
320
+
321
+ ## Emergency Procedures
322
+
323
+ ### Service Down
324
+
325
+ 1. Check health: `{health check command}`
326
+ 2. Check logs: `{log command}`
327
+ 3. Restart: `{restart command}`
328
+ 4. If still down, rollback: `{rollback command}`
329
+ 5. Investigate root cause
330
+ 6. Emit error event to GTM
331
+ 7. Update status.json to error state
332
+
333
+ ### Data Loss
334
+
335
+ 1. Stop service immediately
336
+ 2. Assess scope of loss
337
+ 3. Restore from backup: `{restore command}`
338
+ 4. Verify data integrity
339
+ 5. Restart service
340
+ 6. Document incident in journal
341
+
342
+ ### Security Incident
343
+
344
+ 1. Isolate affected systems
345
+ 2. Review access logs
346
+ 3. Rotate credentials: `{rotate command}`
347
+ 4. Patch vulnerability
348
+ 5. Deploy fix
349
+ 6. Monitor for further issues
350
+ 7. Document incident
351
+
352
+ ---
353
+
354
+ ## Regular Maintenance
355
+
356
+ ### Daily
357
+ - [ ] Check error logs: `{log command}`
358
+ - [ ] Verify health check passing
359
+ - [ ] Review resource usage
360
+
361
+ ### Weekly
362
+ - [ ] Review performance metrics
363
+ - [ ] Check for dependency updates
364
+ - [ ] Review and clear old logs
365
+
366
+ ### Monthly
367
+ - [ ] Security audit: `npm audit`
368
+ - [ ] Review and update documentation
369
+ - [ ] Review and optimize database (if applicable)
370
+ - [ ] Test backup/restore procedure
371
+
372
+ ---
373
+
374
+ ## Useful Commands Reference
375
+
376
+ ```bash
377
+ # Development
378
+ {dev command}
379
+
380
+ # Build
381
+ {build command}
382
+
383
+ # Test
384
+ {test command}
385
+
386
+ # Deploy
387
+ {deploy command}
388
+
389
+ # Logs
390
+ {log command}
391
+
392
+ # Status
393
+ {status command}
394
+
395
+ # Restart
396
+ {restart command}
397
+ ```
398
+
399
+ ---
400
+
401
+ ## Contact Information
402
+
403
+ **Service Owner:** {owner}
404
+ **Team:** {team name}
405
+ **Slack Channel:** {slack channel}
406
+ **Documentation:** {doc links}
407
+
408
+ ---
409
+
410
+ ## Last Updated
411
+
412
+ {date}
@@ -0,0 +1,77 @@
1
+ # {SERVICE_NAME} - Service Specification
2
+
3
+ **Type:** {SERVICE_TYPE}
4
+ **Status:** EMERGENT (update as service evolves)
5
+
6
+ ## Purpose
7
+
8
+ {1-2 sentence description of what this service does}
9
+
10
+ ## Core Responsibilities
11
+
12
+ - {Responsibility 1}
13
+ - {Responsibility 2}
14
+ - {Responsibility 3}
15
+
16
+ ## Public Interface
17
+
18
+ ### Endpoints (if API)
19
+ | Method | Path | Purpose |
20
+ |--------|------|---------|
21
+ | GET | /api/... | ... |
22
+
23
+ ### Pages (if Web)
24
+ | Route | Purpose |
25
+ |-------|---------|
26
+ | / | ... |
27
+
28
+ ### Commands (if CLI)
29
+ | Command | Purpose |
30
+ |---------|---------|
31
+ | service command | ... |
32
+
33
+ ## Dependencies
34
+
35
+ ### Upstream Services
36
+ | Service | Purpose | Status Check |
37
+ |---------|---------|--------------|
38
+ | {service-name} | Why we need it | How to verify it's available |
39
+
40
+ ### External APIs
41
+ | API | Purpose | Credentials |
42
+ |-----|---------|-------------|
43
+ | {api-name} | Why we need it | Where creds are stored |
44
+
45
+ ## Data Owned
46
+
47
+ - {Data type 1}: Where stored, schema
48
+ - {Data type 2}: Where stored, schema
49
+
50
+ ## Performance Requirements
51
+
52
+ - Response time: {target}
53
+ - Availability: {target}
54
+ - Throughput: {target}
55
+
56
+ ## Security
57
+
58
+ - Authentication: {method}
59
+ - Authorization: {method}
60
+ - Secrets: {where stored}
61
+
62
+ ## Monitoring
63
+
64
+ - Health check: {endpoint or method}
65
+ - Key metrics: {list metrics to track}
66
+ - Logs: {where logs go}
67
+
68
+ ## Status
69
+
70
+ **Last Updated:** {date}
71
+ **Current Version:** {version}
72
+ **Stability:** experimental|stable|production
73
+
74
+ ## Open Questions
75
+
76
+ - {Question 1}
77
+ - {Question 2}
@@ -1,33 +0,0 @@
1
- /**
2
- * Session Management Commands
3
- *
4
- * Manages isolated GTM sessions across platforms (CLI, Telegram, Slack, Web)
5
- * Each session = git worktree + auto-commit daemon + journal
6
- */
7
- /**
8
- * Create or get existing session
9
- */
10
- export declare function sessionCreate(opts: {
11
- platform: string;
12
- thread?: string;
13
- user?: string;
14
- }): Promise<string>;
15
- /**
16
- * Execute command in session context
17
- */
18
- export declare function sessionExec(sessionId: string, command: string): Promise<any>;
19
- /**
20
- * List all sessions
21
- */
22
- export declare function sessionList(): Promise<void>;
23
- /**
24
- * Destroy session
25
- */
26
- export declare function sessionDestroy(sessionId: string, opts?: {
27
- force?: boolean;
28
- }): Promise<void>;
29
- /**
30
- * Get session info
31
- */
32
- export declare function sessionInfo(sessionId: string): Promise<void>;
33
- //# sourceMappingURL=session-mgmt.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"session-mgmt.d.ts","sourceRoot":"","sources":["../../src/commands/session-mgmt.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAsDH;;GAEG;AACH,wBAAsB,aAAa,CAAC,IAAI,EAAE;IACxC,QAAQ,EAAE,MAAM,CAAA;IAChB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,IAAI,CAAC,EAAE,MAAM,CAAA;CACd,mBA2FA;AAED;;GAEG;AACH,wBAAsB,WAAW,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,gBA8CnE;AAED;;GAEG;AACH,wBAAsB,WAAW,kBAmGhC;AAED;;GAEG;AACH,wBAAsB,cAAc,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE;IAAE,KAAK,CAAC,EAAE,OAAO,CAAA;CAAE,iBA+HjF;AAED;;GAEG;AACH,wBAAsB,WAAW,CAAC,SAAS,EAAE,MAAM,iBAuBlD"}