@frontmcp/skills 0.0.1 → 1.0.0-beta.11

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 (104) hide show
  1. package/README.md +2 -2
  2. package/catalog/TEMPLATE.md +58 -13
  3. package/catalog/frontmcp-config/SKILL.md +156 -0
  4. package/catalog/{auth/configure-auth/references/auth-modes.md → frontmcp-config/references/configure-auth-modes.md} +5 -0
  5. package/catalog/frontmcp-config/references/configure-auth.md +243 -0
  6. package/catalog/frontmcp-config/references/configure-elicitation.md +183 -0
  7. package/catalog/frontmcp-config/references/configure-http.md +210 -0
  8. package/catalog/frontmcp-config/references/configure-session.md +210 -0
  9. package/catalog/{config/configure-throttle/references/guard-config.md → frontmcp-config/references/configure-throttle-guard-config.md} +5 -0
  10. package/catalog/frontmcp-config/references/configure-throttle.md +234 -0
  11. package/catalog/{config/configure-transport/references/protocol-presets.md → frontmcp-config/references/configure-transport-protocol-presets.md} +5 -0
  12. package/catalog/frontmcp-config/references/configure-transport.md +200 -0
  13. package/catalog/frontmcp-config/references/setup-redis.md +9 -0
  14. package/catalog/frontmcp-config/references/setup-sqlite.md +9 -0
  15. package/catalog/frontmcp-deployment/SKILL.md +152 -0
  16. package/catalog/frontmcp-deployment/references/build-for-browser.md +143 -0
  17. package/catalog/frontmcp-deployment/references/build-for-cli.md +191 -0
  18. package/catalog/{deployment/build-for-sdk/SKILL.md → frontmcp-deployment/references/build-for-sdk.md} +66 -20
  19. package/catalog/frontmcp-deployment/references/deploy-to-cloudflare.md +218 -0
  20. package/catalog/{deployment/deploy-to-lambda/SKILL.md → frontmcp-deployment/references/deploy-to-lambda.md} +77 -59
  21. package/catalog/{deployment/deploy-to-node/references/Dockerfile.example → frontmcp-deployment/references/deploy-to-node-dockerfile.md} +18 -4
  22. package/catalog/{deployment/deploy-to-node/SKILL.md → frontmcp-deployment/references/deploy-to-node.md} +69 -36
  23. package/catalog/frontmcp-deployment/references/deploy-to-vercel-config.md +65 -0
  24. package/catalog/frontmcp-deployment/references/deploy-to-vercel.md +229 -0
  25. package/catalog/frontmcp-development/SKILL.md +126 -0
  26. package/catalog/frontmcp-development/references/create-adapter.md +170 -0
  27. package/catalog/{development/create-agent/references/llm-config.md → frontmcp-development/references/create-agent-llm-config.md} +10 -5
  28. package/catalog/{development/create-agent/SKILL.md → frontmcp-development/references/create-agent.md} +83 -40
  29. package/catalog/{development/create-job/SKILL.md → frontmcp-development/references/create-job.md} +62 -15
  30. package/catalog/{plugins/create-plugin-hooks/SKILL.md → frontmcp-development/references/create-plugin-hooks.md} +100 -7
  31. package/catalog/frontmcp-development/references/create-plugin.md +506 -0
  32. package/catalog/{development/create-prompt/SKILL.md → frontmcp-development/references/create-prompt.md} +65 -22
  33. package/catalog/{development/create-provider/SKILL.md → frontmcp-development/references/create-provider.md} +63 -23
  34. package/catalog/{development/create-resource/SKILL.md → frontmcp-development/references/create-resource.md} +148 -26
  35. package/catalog/{development/create-skill-with-tools/SKILL.md → frontmcp-development/references/create-skill-with-tools.md} +174 -20
  36. package/catalog/{development/create-skill/SKILL.md → frontmcp-development/references/create-skill.md} +114 -28
  37. package/catalog/{development/create-tool/references/tool-annotations.md → frontmcp-development/references/create-tool-annotations.md} +5 -0
  38. package/catalog/{development/create-tool/references/output-schema-types.md → frontmcp-development/references/create-tool-output-schema-types.md} +5 -0
  39. package/catalog/{development/create-tool/SKILL.md → frontmcp-development/references/create-tool.md} +172 -23
  40. package/catalog/{development/create-workflow/SKILL.md → frontmcp-development/references/create-workflow.md} +61 -14
  41. package/catalog/frontmcp-development/references/decorators-guide.md +754 -0
  42. package/catalog/frontmcp-development/references/official-adapters.md +199 -0
  43. package/catalog/{plugins/official-plugins/SKILL.md → frontmcp-development/references/official-plugins.md} +97 -27
  44. package/catalog/frontmcp-extensibility/SKILL.md +103 -0
  45. package/catalog/frontmcp-extensibility/references/vectoriadb.md +289 -0
  46. package/catalog/frontmcp-guides/SKILL.md +420 -0
  47. package/catalog/frontmcp-guides/references/example-knowledge-base.md +641 -0
  48. package/catalog/frontmcp-guides/references/example-task-manager.md +517 -0
  49. package/catalog/frontmcp-guides/references/example-weather-api.md +297 -0
  50. package/catalog/frontmcp-production-readiness/SKILL.md +98 -0
  51. package/catalog/frontmcp-production-readiness/references/common-checklist.md +156 -0
  52. package/catalog/frontmcp-production-readiness/references/production-browser.md +46 -0
  53. package/catalog/frontmcp-production-readiness/references/production-cli-binary.md +62 -0
  54. package/catalog/frontmcp-production-readiness/references/production-cli-daemon.md +61 -0
  55. package/catalog/frontmcp-production-readiness/references/production-cloudflare.md +52 -0
  56. package/catalog/frontmcp-production-readiness/references/production-lambda.md +53 -0
  57. package/catalog/frontmcp-production-readiness/references/production-node-sdk.md +66 -0
  58. package/catalog/frontmcp-production-readiness/references/production-node-server.md +61 -0
  59. package/catalog/frontmcp-production-readiness/references/production-vercel.md +52 -0
  60. package/catalog/frontmcp-setup/SKILL.md +132 -0
  61. package/catalog/frontmcp-setup/references/frontmcp-skills-usage.md +280 -0
  62. package/catalog/{setup/multi-app-composition/SKILL.md → frontmcp-setup/references/multi-app-composition.md} +66 -19
  63. package/catalog/{setup/nx-workflow/SKILL.md → frontmcp-setup/references/nx-workflow.md} +79 -17
  64. package/catalog/frontmcp-setup/references/project-structure-nx.md +251 -0
  65. package/catalog/frontmcp-setup/references/project-structure-standalone.md +217 -0
  66. package/catalog/frontmcp-setup/references/readme-guide.md +226 -0
  67. package/catalog/{setup/setup-project/SKILL.md → frontmcp-setup/references/setup-project.md} +63 -58
  68. package/catalog/{setup/setup-redis/SKILL.md → frontmcp-setup/references/setup-redis.md} +60 -82
  69. package/catalog/{setup/setup-sqlite/SKILL.md → frontmcp-setup/references/setup-sqlite.md} +65 -72
  70. package/catalog/frontmcp-testing/SKILL.md +135 -0
  71. package/catalog/{testing/setup-testing/SKILL.md → frontmcp-testing/references/setup-testing.md} +79 -63
  72. package/catalog/{testing/setup-testing → frontmcp-testing}/references/test-auth.md +5 -0
  73. package/catalog/{testing/setup-testing → frontmcp-testing}/references/test-browser-build.md +5 -0
  74. package/catalog/{testing/setup-testing → frontmcp-testing}/references/test-cli-binary.md +5 -0
  75. package/catalog/{testing/setup-testing → frontmcp-testing}/references/test-direct-client.md +5 -0
  76. package/catalog/{testing/setup-testing → frontmcp-testing}/references/test-e2e-handler.md +5 -0
  77. package/catalog/{testing/setup-testing → frontmcp-testing}/references/test-tool-unit.md +6 -0
  78. package/catalog/skills-manifest.json +337 -382
  79. package/package.json +2 -2
  80. package/src/index.d.ts +1 -1
  81. package/src/index.js.map +1 -1
  82. package/src/loader.js +0 -1
  83. package/src/loader.js.map +1 -1
  84. package/src/manifest.d.ts +15 -3
  85. package/src/manifest.js +3 -3
  86. package/src/manifest.js.map +1 -1
  87. package/catalog/adapters/create-adapter/SKILL.md +0 -127
  88. package/catalog/adapters/official-adapters/SKILL.md +0 -136
  89. package/catalog/auth/configure-auth/SKILL.md +0 -250
  90. package/catalog/auth/configure-session/SKILL.md +0 -201
  91. package/catalog/config/configure-elicitation/SKILL.md +0 -136
  92. package/catalog/config/configure-http/SKILL.md +0 -167
  93. package/catalog/config/configure-throttle/SKILL.md +0 -189
  94. package/catalog/config/configure-transport/SKILL.md +0 -151
  95. package/catalog/deployment/build-for-browser/SKILL.md +0 -95
  96. package/catalog/deployment/build-for-cli/SKILL.md +0 -100
  97. package/catalog/deployment/deploy-to-cloudflare/SKILL.md +0 -192
  98. package/catalog/deployment/deploy-to-vercel/SKILL.md +0 -196
  99. package/catalog/deployment/deploy-to-vercel/references/vercel.json.example +0 -60
  100. package/catalog/development/decorators-guide/SKILL.md +0 -598
  101. package/catalog/plugins/create-plugin/SKILL.md +0 -336
  102. package/catalog/setup/frontmcp-skills-usage/SKILL.md +0 -200
  103. package/catalog/setup/project-structure-nx/SKILL.md +0 -186
  104. package/catalog/setup/project-structure-standalone/SKILL.md +0 -153
@@ -1,29 +1,33 @@
1
1
  ---
2
2
  name: create-job
3
- description: Create long-running jobs with retry policies, progress tracking, and permission controls. Use when building background tasks, data processing pipelines, or scheduled operations.
4
- tags: [job, background, retry, progress, long-running]
5
- priority: 6
6
- visibility: both
7
- license: Apache-2.0
8
- metadata:
9
- docs: https://docs.agentfront.dev/frontmcp/servers/jobs
3
+ description: Create long-running background jobs with retry policies, progress tracking, and permissions
10
4
  ---
11
5
 
12
6
  # Creating Jobs
13
7
 
14
8
  Jobs are long-running background tasks with built-in retry policies, progress tracking, and permission controls. Unlike tools (which execute synchronously within a request), jobs run asynchronously and persist their state across retries and restarts.
15
9
 
16
- ## When to Use @Job
10
+ ## When to Use This Skill
17
11
 
18
- Use `@Job` when you need to run work that may take longer than a request cycle, needs retry guarantees, or should track progress over time. Examples include:
12
+ ### Must Use
19
13
 
20
- - Data processing and ETL pipelines
21
- - File imports and exports
22
- - Report generation
23
- - Scheduled maintenance tasks
24
- - External API synchronization
14
+ - Running work that takes longer than a request cycle (ETL pipelines, large imports)
15
+ - Tasks that need automatic retry with exponential backoff on failure
16
+ - Background operations that must track and report progress over time
25
17
 
26
- If the work completes in under a few seconds and does not need retry or progress tracking, use a `@Tool` instead.
18
+ ### Recommended
19
+
20
+ - Scheduled maintenance tasks or periodic data synchronization
21
+ - Operations requiring permission controls (role-based, scope-based access)
22
+ - Work that must persist state across retries and server restarts
23
+
24
+ ### Skip When
25
+
26
+ - The work completes in a few seconds and needs no retry or progress tracking (see `create-tool`)
27
+ - You need to expose read-only data at a URI (see `create-resource`)
28
+ - The task requires autonomous LLM reasoning rather than a deterministic pipeline (see `create-agent`)
29
+
30
+ > **Decision:** Use this skill when you need a long-running background task with retry policies, progress tracking, or permission controls.
27
31
 
28
32
  ## Class-Based Pattern
29
33
 
@@ -564,3 +568,46 @@ class DataApp {}
564
568
  })
565
569
  class DataServer {}
566
570
  ```
571
+
572
+ ## Common Patterns
573
+
574
+ | Pattern | Correct | Incorrect | Why |
575
+ | ----------------- | ------------------------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------------------------------------ |
576
+ | Progress tracking | `this.progress(50, 100, 'Processing batch 5')` | Not reporting progress | Progress is persisted and queryable; essential for long-running visibility |
577
+ | Retry config | `retry: { maxAttempts: 3, backoffMs: 2000, backoffMultiplier: 2 }` | Implementing retry logic manually in `execute()` | Framework handles retry with exponential backoff and attempt tracking |
578
+ | Attempt awareness | Check `this.attempt` for retry-specific logic | Ignoring attempt number | `this.attempt` is 1-based; use it to log retry context or adjust behavior |
579
+ | Job logging | `this.log('message')` for persistent, queryable logs | Using `console.log()` | `this.log()` persists with job state; `console.log` is ephemeral |
580
+ | Permissions | Use `permissions: { roles: [...], scopes: [...] }` declaratively | Checking roles manually inside `execute()` | Declarative permissions are enforced before execution and are self-documenting |
581
+
582
+ ## Verification Checklist
583
+
584
+ ### Configuration
585
+
586
+ - [ ] Job class extends `JobContext` and implements `execute(input)`
587
+ - [ ] `@Job` decorator has `name`, `inputSchema`, and `outputSchema`
588
+ - [ ] `retry` policy is configured if the job may fail transiently
589
+ - [ ] `timeout` is set appropriately for the expected execution duration
590
+ - [ ] Job is registered in `jobs` array of `@App`
591
+
592
+ ### Runtime
593
+
594
+ - [ ] `jobs.enabled: true` is set in `@FrontMcp` configuration with a store
595
+ - [ ] Job executes and returns output matching `outputSchema`
596
+ - [ ] Progress is reported and queryable during execution
597
+ - [ ] Retry fires with correct backoff delays on transient failures
598
+ - [ ] Permissions block unauthorized users before execution starts
599
+
600
+ ## Troubleshooting
601
+
602
+ | Problem | Cause | Solution |
603
+ | -------------------------- | ----------------------------------------------- | ---------------------------------------------------------------------------- |
604
+ | Job not activated | `jobs.enabled` not set to `true` in `@FrontMcp` | Add `jobs: { enabled: true, store: { ... } }` to `@FrontMcp` config |
605
+ | Job fails without retrying | No `retry` policy configured | Add `retry: { maxAttempts: 3, backoffMs: 2000 }` to `@Job` options |
606
+ | Progress not visible | Not calling `this.progress()` during execution | Add `this.progress(pct, total, message)` calls at each stage |
607
+ | Job times out unexpectedly | Default 5-minute timeout too short | Set `timeout` in `@Job` to a higher value (e.g., `600000` for 10 minutes) |
608
+ | Permission denied error | User lacks required roles or scopes | Verify user has one of the `roles` and all `scopes` defined in `permissions` |
609
+
610
+ ## Reference
611
+
612
+ - [Jobs Documentation](https://docs.agentfront.dev/frontmcp/servers/jobs)
613
+ - Related skills: `create-tool`, `create-provider`, `create-agent`, `create-workflow`
@@ -1,18 +1,34 @@
1
1
  ---
2
2
  name: create-plugin-hooks
3
- description: Create plugins with flow lifecycle hooks using @Will, @Did, @Stage, and @Around decorators. Use when intercepting tool calls, adding logging, modifying request/response, or implementing cross-cutting middleware.
4
- tags: [plugin, hooks, will, did, stage, around, flow, middleware]
5
- priority: 7
6
- visibility: both
7
- license: Apache-2.0
8
- metadata:
9
- docs: https://docs.agentfront.dev/frontmcp/plugins/creating-plugins
3
+ description: Intercept and extend FrontMCP flows using before, after, around, and stage hook decorators
10
4
  ---
11
5
 
12
6
  # Creating Plugins with Flow Lifecycle Hooks
13
7
 
14
8
  Plugins intercept and extend FrontMCP flows using lifecycle hook decorators. Every flow (tool calls, resource reads, prompt gets, etc.) is composed of **stages**, and hooks let you run logic before, after, around, or instead of any stage.
15
9
 
10
+ ## When to Use This Skill
11
+
12
+ ### Must Use
13
+
14
+ - Adding before/after logic to tool execution (logging, metrics, input enrichment)
15
+ - Implementing authorization checks that intercept flows before they reach the tool
16
+ - Wrapping stage execution with caching, retry, or timing logic via `@Around`
17
+
18
+ ### Recommended
19
+
20
+ - Replacing a built-in stage entirely with custom logic using `@Stage`
21
+ - Adding hooks directly on a `@Tool` class for tool-specific pre/post processing
22
+ - Filtering hook execution by tool name or context properties using `filter` predicates
23
+
24
+ ### Skip When
25
+
26
+ - You need providers, context extensions, or contributed tools (see `create-plugin`)
27
+ - You want to use an existing official plugin that already provides hooks (see `official-plugins`)
28
+ - You are building a simple tool with no cross-cutting concerns (see `create-tool`)
29
+
30
+ > **Decision:** Use this skill when you need to intercept or wrap flow stages with `@Will`, `@Did`, `@Around`, or `@Stage` decorators.
31
+
16
32
  ## Hook Decorator Types
17
33
 
18
34
  FrontMCP provides four hook decorators obtained via `FlowHooksOf(flowName)`:
@@ -47,6 +63,42 @@ const { Stage, Will, Did, Around } = FlowHooksOf('tools:call-tool');
47
63
  | `http:request` | HTTP request handling |
48
64
  | `agents:call-agent` | Agent invocation |
49
65
 
66
+ ## Server Lifecycle Hooks
67
+
68
+ In addition to flow-based hooks, plugins can register callbacks for server lifecycle events. These are not decorator-based — they use the `scope.onServerStarted()` API.
69
+
70
+ ### `onServerStarted()`
71
+
72
+ Runs after the HTTP server is fully initialized and listening. Use for warming caches, starting background indexing, or logging readiness.
73
+
74
+ ```typescript
75
+ import { Plugin, DynamicPlugin } from '@frontmcp/sdk';
76
+
77
+ @Plugin({
78
+ name: 'cache-warmer',
79
+ description: 'Warms caches when the server starts',
80
+ providers: [CacheService],
81
+ })
82
+ class CacheWarmerPlugin extends DynamicPlugin<{}> {
83
+ constructor(scope: ScopeEntry) {
84
+ super();
85
+ // Register lifecycle callback
86
+ scope.onServerStarted(async () => {
87
+ const cache = this.get(CacheService);
88
+ await cache.warmAll();
89
+ console.log('Cache warmed successfully');
90
+ });
91
+ }
92
+ }
93
+ ```
94
+
95
+ **Signature:** `scope.onServerStarted(callback: () => void | Promise<void>): void`
96
+
97
+ - Callbacks are stored and executed after `server.start()` completes
98
+ - Supports both sync and async callbacks
99
+ - Multiple callbacks are executed in registration order with `await`
100
+ - Typically used in plugin constructors or provider `onInit()` methods
101
+
50
102
  ## Pre-Built Hook Type Exports
51
103
 
52
104
  For convenience, FrontMCP exports typed aliases so you do not need to call `FlowHooksOf` directly:
@@ -280,3 +332,44 @@ parseInput → findTool → checkToolAuthorization → createToolCallContext
280
332
  ```
281
333
 
282
334
  Any stage can have `@Will`, `@Did`, `@Stage`, or `@Around` hooks.
335
+
336
+ ## Common Patterns
337
+
338
+ | Pattern | Correct | Incorrect | Why |
339
+ | --------------------- | --------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------------------- |
340
+ | Hook decorator source | `const { Will, Did } = ToolHook;` or `FlowHooksOf('tools:call-tool')` | Importing `Will` directly from `@frontmcp/sdk` | Decorators must be bound to a specific flow via `FlowHooksOf` or pre-built exports |
341
+ | Hook priority | `@Will('execute', { priority: 100 })` for early hooks | Relying on array order without priority | Multiple hooks on the same stage need explicit priority; higher runs first |
342
+ | Around next() | `const result = await next(); return result;` | Forgetting to call `next()` in `@Around` | Omitting `next()` silently skips the wrapped stage and all downstream hooks |
343
+ | Filter predicate | `filter: (ctx) => ctx.toolName !== 'health_check'` | Checking tool name inside the hook body and returning early | Filters skip the hook cleanly; returning early may leave state inconsistent |
344
+ | Tool-level hooks | `@Will('execute')` on a `@Tool` class (scoped to that tool) | `@Will('execute')` on a `@Plugin` class expecting tool-scoped behavior | Plugin hooks fire for all tools; tool-level hooks fire only for that tool |
345
+
346
+ ## Verification Checklist
347
+
348
+ ### Configuration
349
+
350
+ - [ ] Hook decorator is obtained from `FlowHooksOf(flowName)` or a pre-built export (e.g., `ToolHook`)
351
+ - [ ] Stage name matches an actual stage in the targeted flow (e.g., `execute`, `validateInput`)
352
+ - [ ] Plugin with hooks is registered in `plugins` array of `@App` or `@FrontMcp`
353
+
354
+ ### Runtime
355
+
356
+ - [ ] `@Will` hook fires before the targeted stage
357
+ - [ ] `@Did` hook fires after the targeted stage completes
358
+ - [ ] `@Around` hook calls `next()` and the wrapped stage executes
359
+ - [ ] `@Stage` replacement returns a valid response for the flow
360
+ - [ ] Hook `filter` correctly skips invocations for excluded tools
361
+
362
+ ## Troubleshooting
363
+
364
+ | Problem | Cause | Solution |
365
+ | --------------------------------------------- | ------------------------------------------------ | --------------------------------------------------------------------------------- |
366
+ | Hook never fires | Plugin not registered in `plugins` array | Add plugin class to `@App` or `@FrontMcp` `plugins` array |
367
+ | Hook fires for wrong flow | Used wrong flow name in `FlowHooksOf` | Verify flow name matches (e.g., `'tools:call-tool'` not `'tool:call'`) |
368
+ | `@Around` skips the stage entirely | `next()` not called inside the around handler | Always `await next()` to execute the wrapped stage |
369
+ | Multiple hooks execute in wrong order | Priorities not set or conflicting | Set explicit `priority` values; higher numbers execute first |
370
+ | `@Stage` replacement causes downstream errors | Return value shape does not match stage contract | Ensure the return matches what the next stage expects (e.g., MCP response format) |
371
+
372
+ ## Reference
373
+
374
+ - [Plugin Hooks Documentation](https://docs.agentfront.dev/frontmcp/plugins/creating-plugins)
375
+ - Related skills: `create-plugin`, `official-plugins`, `create-tool`