@frontmcp/skills 0.0.1 → 1.0.0-beta.10

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 (88) hide show
  1. package/README.md +2 -2
  2. package/catalog/TEMPLATE.md +58 -13
  3. package/catalog/frontmcp-config/SKILL.md +143 -0
  4. package/catalog/frontmcp-config/references/configure-auth.md +238 -0
  5. package/catalog/frontmcp-config/references/configure-elicitation.md +178 -0
  6. package/catalog/frontmcp-config/references/configure-http.md +205 -0
  7. package/catalog/frontmcp-config/references/configure-session.md +205 -0
  8. package/catalog/frontmcp-config/references/configure-throttle.md +229 -0
  9. package/catalog/frontmcp-config/references/configure-transport.md +195 -0
  10. package/catalog/frontmcp-config/references/setup-redis.md +4 -0
  11. package/catalog/frontmcp-config/references/setup-sqlite.md +4 -0
  12. package/catalog/frontmcp-deployment/SKILL.md +127 -0
  13. package/catalog/frontmcp-deployment/references/build-for-browser.md +138 -0
  14. package/catalog/frontmcp-deployment/references/build-for-cli.md +138 -0
  15. package/catalog/{deployment/build-for-sdk/SKILL.md → frontmcp-deployment/references/build-for-sdk.md} +65 -24
  16. package/catalog/frontmcp-deployment/references/deploy-to-cloudflare.md +213 -0
  17. package/catalog/{deployment/deploy-to-lambda/SKILL.md → frontmcp-deployment/references/deploy-to-lambda.md} +76 -63
  18. package/catalog/{deployment/deploy-to-node/references/Dockerfile.example → frontmcp-deployment/references/deploy-to-node-dockerfile.md} +13 -4
  19. package/catalog/{deployment/deploy-to-node/SKILL.md → frontmcp-deployment/references/deploy-to-node.md} +68 -40
  20. package/catalog/frontmcp-deployment/references/deploy-to-vercel-config.md +60 -0
  21. package/catalog/frontmcp-deployment/references/deploy-to-vercel.md +224 -0
  22. package/catalog/frontmcp-development/SKILL.md +121 -0
  23. package/catalog/frontmcp-development/references/create-adapter.md +165 -0
  24. package/catalog/{development/create-agent/references/llm-config.md → frontmcp-development/references/create-agent-llm-config.md} +5 -5
  25. package/catalog/{development/create-agent/SKILL.md → frontmcp-development/references/create-agent.md} +82 -44
  26. package/catalog/{development/create-job/SKILL.md → frontmcp-development/references/create-job.md} +61 -19
  27. package/catalog/{plugins/create-plugin-hooks/SKILL.md → frontmcp-development/references/create-plugin-hooks.md} +63 -11
  28. package/catalog/{plugins/create-plugin/SKILL.md → frontmcp-development/references/create-plugin.md} +65 -60
  29. package/catalog/{development/create-prompt/SKILL.md → frontmcp-development/references/create-prompt.md} +62 -26
  30. package/catalog/{development/create-provider/SKILL.md → frontmcp-development/references/create-provider.md} +62 -27
  31. package/catalog/{development/create-resource/SKILL.md → frontmcp-development/references/create-resource.md} +62 -30
  32. package/catalog/{development/create-skill-with-tools/SKILL.md → frontmcp-development/references/create-skill-with-tools.md} +69 -24
  33. package/catalog/{development/create-skill/SKILL.md → frontmcp-development/references/create-skill.md} +96 -22
  34. package/catalog/{development/create-tool/SKILL.md → frontmcp-development/references/create-tool.md} +62 -26
  35. package/catalog/{development/create-workflow/SKILL.md → frontmcp-development/references/create-workflow.md} +60 -18
  36. package/catalog/{development/decorators-guide/SKILL.md → frontmcp-development/references/decorators-guide.md} +123 -34
  37. package/catalog/frontmcp-development/references/official-adapters.md +194 -0
  38. package/catalog/{plugins/official-plugins/SKILL.md → frontmcp-development/references/official-plugins.md} +96 -31
  39. package/catalog/frontmcp-guides/SKILL.md +420 -0
  40. package/catalog/frontmcp-guides/references/example-knowledge-base.md +636 -0
  41. package/catalog/frontmcp-guides/references/example-task-manager.md +512 -0
  42. package/catalog/frontmcp-guides/references/example-weather-api.md +292 -0
  43. package/catalog/frontmcp-production-readiness/SKILL.md +253 -0
  44. package/catalog/frontmcp-setup/SKILL.md +130 -0
  45. package/catalog/frontmcp-setup/references/frontmcp-skills-usage.md +265 -0
  46. package/catalog/{setup/multi-app-composition/SKILL.md → frontmcp-setup/references/multi-app-composition.md} +65 -23
  47. package/catalog/{setup/nx-workflow/SKILL.md → frontmcp-setup/references/nx-workflow.md} +78 -21
  48. package/catalog/frontmcp-setup/references/project-structure-nx.md +246 -0
  49. package/catalog/frontmcp-setup/references/project-structure-standalone.md +212 -0
  50. package/catalog/{setup/setup-project/SKILL.md → frontmcp-setup/references/setup-project.md} +62 -62
  51. package/catalog/{setup/setup-redis/SKILL.md → frontmcp-setup/references/setup-redis.md} +59 -86
  52. package/catalog/{setup/setup-sqlite/SKILL.md → frontmcp-setup/references/setup-sqlite.md} +64 -76
  53. package/catalog/frontmcp-testing/SKILL.md +127 -0
  54. package/catalog/{testing/setup-testing/SKILL.md → frontmcp-testing/references/setup-testing.md} +78 -67
  55. package/catalog/{testing/setup-testing → frontmcp-testing}/references/test-tool-unit.md +1 -0
  56. package/catalog/skills-manifest.json +39 -378
  57. package/package.json +2 -2
  58. package/src/loader.js +0 -1
  59. package/src/loader.js.map +1 -1
  60. package/src/manifest.d.ts +3 -3
  61. package/src/manifest.js +2 -3
  62. package/src/manifest.js.map +1 -1
  63. package/catalog/adapters/create-adapter/SKILL.md +0 -127
  64. package/catalog/adapters/official-adapters/SKILL.md +0 -136
  65. package/catalog/auth/configure-auth/SKILL.md +0 -250
  66. package/catalog/auth/configure-session/SKILL.md +0 -201
  67. package/catalog/config/configure-elicitation/SKILL.md +0 -136
  68. package/catalog/config/configure-http/SKILL.md +0 -167
  69. package/catalog/config/configure-throttle/SKILL.md +0 -189
  70. package/catalog/config/configure-transport/SKILL.md +0 -151
  71. package/catalog/deployment/build-for-browser/SKILL.md +0 -95
  72. package/catalog/deployment/build-for-cli/SKILL.md +0 -100
  73. package/catalog/deployment/deploy-to-cloudflare/SKILL.md +0 -192
  74. package/catalog/deployment/deploy-to-vercel/SKILL.md +0 -196
  75. package/catalog/deployment/deploy-to-vercel/references/vercel.json.example +0 -60
  76. package/catalog/setup/frontmcp-skills-usage/SKILL.md +0 -200
  77. package/catalog/setup/project-structure-nx/SKILL.md +0 -186
  78. package/catalog/setup/project-structure-standalone/SKILL.md +0 -153
  79. /package/catalog/{auth/configure-auth/references/auth-modes.md → frontmcp-config/references/configure-auth-modes.md} +0 -0
  80. /package/catalog/{config/configure-throttle/references/guard-config.md → frontmcp-config/references/configure-throttle-guard-config.md} +0 -0
  81. /package/catalog/{config/configure-transport/references/protocol-presets.md → frontmcp-config/references/configure-transport-protocol-presets.md} +0 -0
  82. /package/catalog/{development/create-tool/references/tool-annotations.md → frontmcp-development/references/create-tool-annotations.md} +0 -0
  83. /package/catalog/{development/create-tool/references/output-schema-types.md → frontmcp-development/references/create-tool-output-schema-types.md} +0 -0
  84. /package/catalog/{testing/setup-testing → frontmcp-testing}/references/test-auth.md +0 -0
  85. /package/catalog/{testing/setup-testing → frontmcp-testing}/references/test-browser-build.md +0 -0
  86. /package/catalog/{testing/setup-testing → frontmcp-testing}/references/test-cli-binary.md +0 -0
  87. /package/catalog/{testing/setup-testing → frontmcp-testing}/references/test-direct-client.md +0 -0
  88. /package/catalog/{testing/setup-testing → frontmcp-testing}/references/test-e2e-handler.md +0 -0
@@ -1,29 +1,28 @@
1
- ---
2
- name: create-skill
3
- description: Create instruction-only skills that guide AI through workflows without tool references. Use when building knowledge packages, coding guidelines, or workflow templates.
4
- tags: [skill, instructions, knowledge, workflow, guide]
5
- priority: 7
6
- visibility: both
7
- license: Apache-2.0
8
- metadata:
9
- docs: https://docs.agentfront.dev/frontmcp/servers/skills
10
- ---
11
-
12
1
  # Creating Instruction-Only Skills
13
2
 
14
3
  Skills are knowledge and workflow packages that teach AI clients how to accomplish tasks. Unlike tools (which execute actions) or agents (which run autonomous LLM loops), a skill provides structured instructions that the AI follows on its own. An instruction-only skill contains no tool references -- it is purely a guide.
15
4
 
16
- ## When to Use Instruction-Only Skills
5
+ ## When to Use This Skill
6
+
7
+ ### Must Use
8
+
9
+ - You need to package knowledge, conventions, or workflow steps as a reusable skill that AI clients can follow
10
+ - You are creating a SKILL.md catalog entry or a class/function-based skill with no tool dependencies
11
+ - You want to enforce coding standards, onboarding steps, or review criteria through structured AI guidance
17
12
 
18
- Use instruction-only skills when the goal is to transfer knowledge, enforce conventions, or define a workflow that the AI should follow using its own reasoning. Examples include:
13
+ ### Recommended
19
14
 
20
- - Coding style guides and conventions
21
- - Architecture decision records
22
- - Onboarding checklists
23
- - Deployment runbooks without automated steps
24
- - Review criteria and quality gates
15
+ - You are building a deployment runbook, architecture decision record, or quality gate checklist
16
+ - You want to share workflow templates across teams via MCP or HTTP discovery endpoints
17
+ - You need parameterized instructions that callers can customize per invocation
25
18
 
26
- If the skill needs to reference specific MCP tools, see the `create-skill-with-tools` skill instead.
19
+ ### Skip When
20
+
21
+ - The skill must invoke MCP tools during execution -- use `create-skill-with-tools` instead
22
+ - You need an autonomous agent loop rather than static instructions -- use an agent pattern instead
23
+ - The content is a one-off prompt with no reuse value -- a plain prompt template is simpler
24
+
25
+ > **Decision:** Pick this skill when you need a reusable, instruction-only knowledge package that guides AI through a workflow without requiring tool calls.
27
26
 
28
27
  ## Class-Based Pattern
29
28
 
@@ -111,17 +110,27 @@ class GitCommitGuideSkill extends SkillContext {}
111
110
 
112
111
  ### File Reference
113
112
 
114
- Load instructions from a Markdown file. The path is relative to the skill file location.
113
+ Load instructions from a Markdown file. The path is resolved relative to the file that defines the skill (for both `@Skill` class decorators and `skill()` function calls).
115
114
 
116
115
  ```typescript
116
+ // Class-based: path resolves relative to this file's directory
117
117
  @Skill({
118
118
  name: 'architecture-guide',
119
119
  description: 'System architecture overview and patterns',
120
120
  instructions: { file: './docs/architecture.md' },
121
121
  })
122
122
  class ArchitectureGuideSkill extends SkillContext {}
123
+
124
+ // Function-based: same behavior — path resolves relative to this file's directory
125
+ export default skill({
126
+ name: 'architecture-guide',
127
+ description: 'System architecture overview and patterns',
128
+ instructions: { file: './docs/architecture.md' },
129
+ });
123
130
  ```
124
131
 
132
+ > **Directory structure example:** If this file is at `src/skills/arch.skill.ts`, the instruction file should be at `src/skills/docs/architecture.md`.
133
+
125
134
  ### URL Reference
126
135
 
127
136
  Load instructions from a remote URL. Fetched at build time when the skill is loaded.
@@ -211,13 +220,26 @@ const CodeReviewChecklist = skill({
211
220
 
212
221
  Register it the same way as a class skill: `skills: [CodeReviewChecklist]`.
213
222
 
223
+ The function builder also supports file-based instructions. Relative paths resolve from the file that calls `skill()`:
224
+
225
+ ```typescript
226
+ // src/skills/deploy-guide.skill.ts
227
+ import { skill } from '@frontmcp/sdk';
228
+
229
+ export default skill({
230
+ name: 'deploy-guide',
231
+ description: 'Step-by-step deployment checklist',
232
+ instructions: { file: './docs/deploy-guide.md' }, // resolves to src/skills/docs/deploy-guide.md
233
+ });
234
+ ```
235
+
214
236
  ## Directory-Based Skills with skillDir()
215
237
 
216
238
  Use `skillDir()` to load a skill from a directory containing a `SKILL.md` file with YAML frontmatter, plus optional subdirectories for scripts, references, and assets.
217
239
 
218
240
  ### Directory Structure
219
241
 
220
- ```
242
+ ```text
221
243
  skills/
222
244
  coding-standards/
223
245
  SKILL.md # Instructions with YAML frontmatter
@@ -448,7 +470,7 @@ import { Skill, SkillContext, FrontMcp, App, skill, skillDir } from '@frontmcp/s
448
470
 
449
471
  ## Step 1: Environment Setup
450
472
  1. Clone the repository
451
- 2. Install Node.js 22+ and Yarn
473
+ 2. Install Node.js 24+ and Yarn
452
474
  3. Run \`yarn install\` to install dependencies
453
475
  4. Copy \`.env.example\` to \`.env\` and fill in values
454
476
 
@@ -524,3 +546,55 @@ class OnboardingApp {}
524
546
  })
525
547
  class DevServer {}
526
548
  ```
549
+
550
+ ## Common Patterns
551
+
552
+ | Pattern | Correct | Incorrect | Why |
553
+ | ----------------------------------- | ------------------------------------------------------ | -------------------------------------------------------- | ------------------------------------------------------------------------------------ |
554
+ | Instruction source for short guides | `instructions: 'Use PascalCase for classes...'` | Loading a one-paragraph guide from a separate file | Inline strings keep short skills self-contained and easier to review |
555
+ | Instruction source for long content | `instructions: { file: './docs/guide.md' }` | Pasting 200+ lines as a template literal | File references keep the class readable and the content editable in Markdown tooling |
556
+ | Skill naming | `name: 'api-design-guide'` (kebab-case) | `name: 'ApiDesignGuide'` or `name: 'api design guide'` | The `name` field must be kebab-case to match registry lookup and URL conventions |
557
+ | Visibility for internal runbooks | `visibility: 'mcp'` | `visibility: 'both'` for sensitive content | Internal procedures should not be exposed on public HTTP endpoints like `/llm.txt` |
558
+ | Function builder for simple skills | `const s = skill({ name, description, instructions })` | Creating a class with an empty body just to use `@Skill` | The function builder avoids boilerplate when no custom `build()` override is needed |
559
+
560
+ ## Verification Checklist
561
+
562
+ ### Structure
563
+
564
+ - [ ] Skill has a unique kebab-case `name`
565
+ - [ ] `description` is a single sentence explaining what the skill teaches
566
+ - [ ] `instructions` field is set (inline string, file reference, or URL reference)
567
+ - [ ] No tool references appear in the instructions (instruction-only skill)
568
+
569
+ ### Metadata
570
+
571
+ - [ ] `tags` array includes relevant categorization keywords
572
+ - [ ] `visibility` is set appropriately (`'mcp'`, `'http'`, or `'both'`)
573
+ - [ ] `parameters` have `name`, `description`, and `type` defined if present
574
+ - [ ] `examples` include `scenario` and `expectedOutcome` if present
575
+
576
+ ### Registration
577
+
578
+ - [ ] Skill class or function is added to the `skills` array in `@App` or `@FrontMcp`
579
+ - [ ] Barrel export (`index.ts`) is updated if the skill is part of a publishable library
580
+ - [ ] Test file (`*.spec.ts`) exists and covers metadata and build output
581
+
582
+ ### Discovery
583
+
584
+ - [ ] Skill appears in `GET /skills` or MCP tool listing based on visibility setting
585
+ - [ ] `hideFromDiscovery` is only set to `true` when the skill must be invoked by name only
586
+
587
+ ## Troubleshooting
588
+
589
+ | Problem | Cause | Fix |
590
+ | ------------------------------------------------ | ----------------------------------------------------------------------- | -------------------------------------------------------------------------------------- |
591
+ | Skill does not appear in `/llm.txt` or `/skills` | `visibility` is set to `'mcp'` or `hideFromDiscovery` is `true` | Set `visibility: 'both'` and `hideFromDiscovery: false` |
592
+ | `loadInstructions()` returns empty string | File reference path is wrong or the file is empty | Verify the path is relative to the skill file location and the target file has content |
593
+ | `build()` throws "instructions required" | The `instructions` field is missing or `undefined` in `@Skill` metadata | Provide an inline string, `{ file: '...' }`, or `{ url: '...' }` |
594
+ | Skill parameters are ignored by the AI | Parameters are declared but not referenced in the instruction text | Mention each parameter by name in the instructions so the AI knows how to apply them |
595
+ | Directory-based skill missing bundled files | Subdirectories are not named `scripts/`, `references/`, or `assets/` | Use the exact conventional directory names; other names are not auto-bundled |
596
+
597
+ ## Reference
598
+
599
+ - **Docs:** <https://docs.agentfront.dev/frontmcp/servers/skills>
600
+ - **Related skills:** `create-skill-with-tools` (skills that reference MCP tools), `setup-project` (project scaffolding workflows)
@@ -1,34 +1,28 @@
1
- ---
2
- name: create-tool
3
- description: Create and register an MCP tool with Zod input validation and typed output. Use when building tools, defining input schemas, adding output validation, or registering tools in an app.
4
- tags: [tools, mcp, zod, schema, decorator]
5
- tools:
6
- - name: create_tool
7
- purpose: Scaffold a new tool class
8
- parameters:
9
- - name: name
10
- description: Tool name in snake_case
11
- type: string
12
- required: true
13
- examples:
14
- - scenario: Create a calculator tool with add operation
15
- expected-outcome: Tool registered and callable via MCP
16
- - scenario: Create a tool with DI and error handling
17
- expected-outcome: Tool using providers and proper error classes
18
- priority: 10
19
- visibility: both
20
- license: Apache-2.0
21
- metadata:
22
- docs: https://docs.agentfront.dev/frontmcp/servers/tools
23
- ---
24
-
25
1
  # Creating an MCP Tool
26
2
 
27
3
  Tools are the primary way to expose executable actions to AI clients in the MCP protocol. In FrontMCP, tools are TypeScript classes that extend `ToolContext`, decorated with `@Tool`, and registered on a `@FrontMcp` server or inside an `@App`.
28
4
 
29
- ## When to Use @Tool
5
+ ## When to Use This Skill
6
+
7
+ ### Must Use
8
+
9
+ - Building a new executable action that AI clients can invoke via MCP
10
+ - Defining typed input schemas with Zod validation for tool parameters
11
+ - Adding output schema validation to prevent data leaks from tool responses
12
+
13
+ ### Recommended
14
+
15
+ - Adding rate limiting, concurrency control, or timeouts to existing tools
16
+ - Integrating dependency injection into tool execution
17
+ - Converting raw function handlers into class-based `ToolContext` patterns
30
18
 
31
- Use `@Tool` when you need to expose an action that an AI client can invoke. Tools accept validated input, perform work (database queries, API calls, computations), and return structured results. Every tool goes through Zod-based input validation before `execute()` runs.
19
+ ### Skip When
20
+
21
+ - Exposing read-only data that does not require execution logic (see `create-resource`)
22
+ - Building conversational templates or system prompts (see `create-prompt`)
23
+ - Orchestrating multi-tool workflows with conditional logic (see `create-agent`)
24
+
25
+ > **Decision:** Use this skill when you need an AI-callable action that accepts validated input, performs work, and returns structured output.
32
26
 
33
27
  ## Class-Based Pattern
34
28
 
@@ -416,3 +410,45 @@ class ExpensiveOperationTool extends ToolContext {
416
410
  }
417
411
  }
418
412
  ```
413
+
414
+ ## Common Patterns
415
+
416
+ | Pattern | Correct | Incorrect | Why |
417
+ | -------------- | ----------------------------------------------- | --------------------------------------------- | ------------------------------------------------------------- |
418
+ | Input schema | `inputSchema: { name: z.string() }` (raw shape) | `inputSchema: z.object({ name: z.string() })` | Framework wraps in `z.object()` internally |
419
+ | Output schema | Always define `outputSchema` | Omit `outputSchema` | Prevents data leaks and enables CodeCall chaining |
420
+ | DI resolution | `this.get(TOKEN)` with proper error handling | `this.tryGet(TOKEN)!` with non-null assertion | `get` throws a clear error; non-null assertions mask failures |
421
+ | Error handling | `this.fail(new ResourceNotFoundError(...))` | `throw new Error(...)` | `this.fail` triggers the error flow with MCP error codes |
422
+ | Tool naming | `snake_case` names: `get_weather` | `camelCase` or `PascalCase`: `getWeather` | MCP protocol convention for tool names |
423
+
424
+ ## Verification Checklist
425
+
426
+ ### Configuration
427
+
428
+ - [ ] Tool class extends `ToolContext` and implements `execute()`
429
+ - [ ] `@Tool` decorator has `name`, `description`, and `inputSchema`
430
+ - [ ] `outputSchema` is defined to validate and restrict output fields
431
+ - [ ] Tool is registered in `tools` array of `@App` or `@FrontMcp`
432
+
433
+ ### Runtime
434
+
435
+ - [ ] Tool appears in `tools/list` MCP response
436
+ - [ ] Valid input returns expected output
437
+ - [ ] Invalid input returns Zod validation error (not a crash)
438
+ - [ ] `this.fail()` triggers proper MCP error response
439
+ - [ ] DI dependencies resolve correctly via `this.get()`
440
+
441
+ ## Troubleshooting
442
+
443
+ | Problem | Cause | Solution |
444
+ | ------------------------------------------------ | ------------------------------------------- | ---------------------------------------------------------------------------- |
445
+ | Tool not appearing in `tools/list` | Not registered in `tools` array | Add tool class to `@App` or `@FrontMcp` `tools` array |
446
+ | Zod validation error on valid input | Using `z.object()` wrapper in `inputSchema` | Use raw shape: `{ field: z.string() }` not `z.object({ field: z.string() })` |
447
+ | `this.get(TOKEN)` throws DependencyNotFoundError | Provider not registered in scope | Register provider in `providers` array of `@App` or `@FrontMcp` |
448
+ | Output contains unexpected fields | No `outputSchema` defined | Add `outputSchema` to strip unvalidated fields from response |
449
+ | Tool times out | No timeout configured for long operation | Add `timeout: { executeMs: 30_000 }` to `@Tool` options |
450
+
451
+ ## Reference
452
+
453
+ - [Tools Documentation](https://docs.agentfront.dev/frontmcp/servers/tools)
454
+ - Related skills: `create-resource`, `create-prompt`, `configure-throttle`, `create-agent`
@@ -1,28 +1,28 @@
1
- ---
2
- name: create-workflow
3
- description: Create multi-step workflows that connect jobs into managed execution pipelines with dependencies and conditions. Use when orchestrating sequential or parallel job execution.
4
- tags: [workflow, pipeline, orchestration, steps, jobs]
5
- priority: 6
6
- visibility: both
7
- license: Apache-2.0
8
- metadata:
9
- docs: https://docs.agentfront.dev/frontmcp/servers/workflows
10
- ---
11
-
12
1
  # Creating Workflows
13
2
 
14
3
  Workflows connect multiple jobs into managed execution pipelines with step dependencies, conditions, and triggers. A workflow defines a directed acyclic graph (DAG) of steps where each step runs a named job, and the framework handles ordering, parallelism, error propagation, and trigger management.
15
4
 
16
- ## When to Use @Workflow
5
+ ## When to Use This Skill
6
+
7
+ ### Must Use
8
+
9
+ - Orchestrating multiple jobs in a defined order with explicit step dependencies (e.g., build then test then deploy)
10
+ - Building execution pipelines that require conditional branching, parallel fan-out, or diamond dependency patterns
11
+ - Defining webhook- or event-triggered multi-step automation that the framework manages end to end
12
+
13
+ ### Recommended
17
14
 
18
- Use `@Workflow` when you need to orchestrate multiple jobs in a defined order with dependencies between them. Examples include:
15
+ - CI/CD pipelines, data-processing ETL flows, or approval chains that combine three or more jobs
16
+ - Multi-stage provisioning sequences where steps need `continueOnError` or per-step retry policies
17
+ - Replacing hand-rolled orchestration code with a declarative DAG of job steps
19
18
 
20
- - CI/CD pipelines (build, test, deploy)
21
- - Data processing pipelines (extract, transform, load, verify)
22
- - Approval workflows (submit, review, approve, execute)
23
- - Multi-stage provisioning (create resources, configure, validate, notify)
19
+ ### Skip When
24
20
 
25
- If you only need a single background task, use a `@Job` instead. If you need real-time sequential tool calls guided by an AI, use a `@Skill`.
21
+ - You only need a single background task with no inter-step dependencies (see `create-job`)
22
+ - You need real-time, AI-guided sequential tool calls rather than pre-declared steps (see `create-skill-with-tools`)
23
+ - You are building a conversational prompt template with no execution logic (see `create-prompt`)
24
+
25
+ > **Decision:** Use this skill when you need a declarative, multi-step pipeline of jobs with dependency ordering, conditions, and managed error propagation.
26
26
 
27
27
  ## Class-Based Pattern
28
28
 
@@ -707,3 +707,45 @@ class CiApp {}
707
707
  })
708
708
  class CiServer {}
709
709
  ```
710
+
711
+ ## Common Patterns
712
+
713
+ | Pattern | Correct | Incorrect | Why |
714
+ | ----------------- | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------------------- |
715
+ | Step dependencies | `dependsOn: ['build', 'test']` (array of step IDs) | `dependsOn: 'build'` (plain string) | `dependsOn` expects a `string[]`, not a single string |
716
+ | Dynamic input | `input: (steps) => ({ artifact: steps.get('build').outputs.url })` | `input: { artifact: buildResult.url }` (captured closure variable) | Static objects cannot reference previous step outputs; use the callback form |
717
+ | Conditional steps | `condition: (steps) => steps.get('test').state === 'completed'` | `condition: (steps) => steps.get('test').outputs` (truthy check) | Always check `.state` explicitly; outputs can be truthy even on partial failure |
718
+ | Job registration | Register all referenced jobs in the `jobs` array of `@App` | Declare `jobName` in steps without registering the job class | Steps reference jobs by name; unregistered jobs cause runtime lookup failures |
719
+ | Workflow trigger | Set `trigger: 'webhook'` and provide `webhook: { path, secret }` | Set `trigger: 'webhook'` without a `webhook` config object | Webhook trigger requires the `webhook` configuration block for path and secret |
720
+
721
+ ## Verification Checklist
722
+
723
+ ### Configuration
724
+
725
+ - [ ] `@Workflow` decorator has `name` and at least one step in `steps`
726
+ - [ ] Every `jobName` in steps matches a registered `@Job` name
727
+ - [ ] `dependsOn` arrays reference valid step `id` values within the same workflow
728
+ - [ ] No circular dependencies exist in the step DAG
729
+
730
+ ### Runtime
731
+
732
+ - [ ] Workflow appears in the server's workflow registry after startup
733
+ - [ ] Steps with no dependencies execute in parallel (up to `maxConcurrency`)
734
+ - [ ] Conditional steps are correctly skipped or executed based on prior step results
735
+ - [ ] `continueOnError: true` steps allow downstream steps to proceed on failure
736
+ - [ ] Webhook-triggered workflows respond to incoming HTTP requests
737
+
738
+ ## Troubleshooting
739
+
740
+ | Problem | Cause | Solution |
741
+ | --------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- |
742
+ | Step never executes | `dependsOn` references a step ID that does not exist | Verify all `dependsOn` entries match actual step `id` values in the workflow |
743
+ | Workflow fails at startup with "job not found" | `jobName` references an unregistered job | Add the job class to the `jobs` array in `@App` before registering the workflow |
744
+ | Dynamic `input` callback receives undefined outputs | Dependent step was skipped or failed without `continueOnError` | Add a `condition` guard that checks `steps.get(id).state === 'completed'` before accessing outputs |
745
+ | Webhook trigger does not fire | Missing or mismatched `webhook.secret` | Ensure `webhook.secret` matches the sender's HMAC secret and `webhook.path` is correct |
746
+ | Workflow exceeds timeout | Total step execution time exceeds the default 600000 ms | Increase `timeout` at the workflow level or add per-step `timeout` overrides |
747
+
748
+ ## Reference
749
+
750
+ - [Workflows Documentation](https://docs.agentfront.dev/frontmcp/servers/workflows)
751
+ - Related skills: `create-job`, `create-skill-with-tools`, `create-tool`, `multi-app-composition`
@@ -1,21 +1,10 @@
1
- ---
2
- name: decorators-guide
3
- description: Complete reference for all FrontMCP decorators and when to use each one. Use when choosing between decorators, understanding the architecture, or looking up decorator signatures.
4
- tags: [decorators, reference, architecture, guide]
5
- priority: 10
6
- visibility: both
7
- license: Apache-2.0
8
- metadata:
9
- docs: https://docs.agentfront.dev/frontmcp/sdk-reference/decorators/overview
10
- ---
11
-
12
1
  # FrontMCP Decorators - Complete Reference
13
2
 
14
3
  ## Architecture Overview
15
4
 
16
5
  FrontMCP uses a hierarchical decorator system. The nesting order is:
17
6
 
18
- ```
7
+ ```text
19
8
  @FrontMcp (server root)
20
9
  +-- @App (application module)
21
10
  +-- @Tool (MCP tool)
@@ -35,6 +24,30 @@ FrontMCP uses a hierarchical decorator system. The nesting order is:
35
24
 
36
25
  ---
37
26
 
27
+ ## When to Use This Skill
28
+
29
+ ### Must Use
30
+
31
+ - You are building a new FrontMCP server and need to choose the correct decorator for each component
32
+ - You are reviewing or debugging decorator configuration and need to verify field names, types, or nesting hierarchy
33
+ - You are onboarding to the FrontMCP codebase and need a single reference for the full decorator architecture
34
+
35
+ ### Recommended
36
+
37
+ - You are adding a new capability (tool, resource, prompt, agent, skill) to an existing server and want to confirm the correct decorator signature
38
+ - You are designing a plugin or adapter and need to understand how it integrates with the decorator hierarchy
39
+ - You are refactoring an app's module structure and need to verify which decorators belong in `@App` vs `@FrontMcp`
40
+
41
+ ### Skip When
42
+
43
+ - You only need to write business logic inside an existing tool or resource (see `create-tool` reference)
44
+ - You are configuring authentication or session management without changing decorators (see `configure-auth` reference)
45
+ - You are working on CI/CD, deployment, or infrastructure that does not involve decorator choices
46
+
47
+ > **Decision:** Use this skill whenever you need to look up, choose, or validate a FrontMCP decorator -- skip it when the decorator is already chosen and you are only implementing internal logic.
48
+
49
+ ---
50
+
38
51
  ## 1. @FrontMcp
39
52
 
40
53
  **Purpose:** Declares the root MCP server and its global configuration.
@@ -43,27 +56,28 @@ FrontMCP uses a hierarchical decorator system. The nesting order is:
43
56
 
44
57
  **Key fields:**
45
58
 
46
- | Field | Description |
47
- | --------------- | --------------------------------------------------- |
48
- | `info` | Server name, version, and description |
49
- | `apps` | Array of `@App` classes to mount |
50
- | `redis?` | Redis connection options |
51
- | `plugins?` | Global plugins |
52
- | `providers?` | Global DI providers |
53
- | `tools?` | Standalone tools (outside apps) |
54
- | `resources?` | Standalone resources |
55
- | `skills?` | Standalone skills |
56
- | `skillsConfig?` | Skills feature configuration (enabled, cache, auth) |
57
- | `transport?` | Transport type (stdio, sse, streamable-http) |
58
- | `http?` | HTTP server options (port, host, cors) |
59
- | `logging?` | Logging configuration |
60
- | `elicitation?` | Elicitation store config |
61
- | `sqlite?` | SQLite storage config |
62
- | `pubsub?` | Pub/sub configuration |
63
- | `jobs?` | Job scheduler config |
64
- | `throttle?` | Rate limiting config |
65
- | `pagination?` | Pagination defaults |
66
- | `ui?` | UI configuration |
59
+ | Field | Description |
60
+ | --------------- | ------------------------------------------------------------------------------- |
61
+ | `info` | Server name, version, and description |
62
+ | `apps` | Array of `@App` classes to mount |
63
+ | `redis?` | Redis connection options |
64
+ | `plugins?` | Global plugins |
65
+ | `providers?` | Global DI providers |
66
+ | `tools?` | Standalone tools (outside apps) |
67
+ | `resources?` | Standalone resources |
68
+ | `skills?` | Standalone skills |
69
+ | `skillsConfig?` | Skills feature configuration (enabled, cache, auth) |
70
+ | `transport?` | Transport preset ('modern', 'legacy', 'stateless-api', 'full') or config object |
71
+ | `auth?` | Authentication mode and OAuth configuration (AuthOptionsInput) |
72
+ | `http?` | HTTP server options (port, host, cors) |
73
+ | `logging?` | Logging configuration |
74
+ | `elicitation?` | Elicitation store config |
75
+ | `sqlite?` | SQLite storage config |
76
+ | `pubsub?` | Pub/sub configuration |
77
+ | `jobs?` | Job scheduler config |
78
+ | `throttle?` | Rate limiting config |
79
+ | `pagination?` | Pagination defaults |
80
+ | `ui?` | UI configuration |
67
81
 
68
82
  ```typescript
69
83
  import { FrontMcp } from '@frontmcp/sdk';
@@ -71,7 +85,7 @@ import { FrontMcp } from '@frontmcp/sdk';
71
85
  @FrontMcp({
72
86
  info: { name: 'my-server', version: '1.0.0' },
73
87
  apps: [MainApp],
74
- transport: 'streamable-http',
88
+ transport: 'modern', // Valid presets: 'modern', 'legacy', 'stateless-api', 'full'
75
89
  http: { port: 3000 },
76
90
  plugins: [RememberPlugin],
77
91
  skillsConfig: { enabled: true },
@@ -596,3 +610,78 @@ class AuditHooks {
596
610
  | `@Job` | `JobContext` | `@App.jobs` | Background task |
597
611
  | `@Workflow` | - | `@App.workflows` | Multi-step orchestration |
598
612
  | `@Will/@Did/@Stage/@Around` | - | Entry class | Lifecycle hooks |
613
+
614
+ ---
615
+
616
+ ## Common Patterns
617
+
618
+ | Pattern | Correct | Incorrect | Why |
619
+ | --------------------------- | ----------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |
620
+ | Grouping tools into modules | Place tools inside `@App({ tools: [...] })` | Register tools directly in `@FrontMcp({ tools: [...] })` for large servers | Apps provide logical grouping, scoped providers, and isolation; standalone tools in `@FrontMcp` are only appropriate for small servers or global utilities |
621
+ | Exposing data to the LLM | Use `@Resource` for fixed URIs, `@ResourceTemplate` for parameterized URIs | Using `@Tool` to return static data that never changes | Resources are the MCP-standard way to expose readable data; tools are for actions with side effects or dynamic computation |
622
+ | Cross-cutting concerns | Create a `@Plugin` with providers and context extensions | Adding logging/caching logic directly inside every tool's `execute()` method | Plugins centralize shared behavior, reduce duplication, and can be reused across servers |
623
+ | Background processing | Use `@Job` with a cron schedule for recurring work | Using `setTimeout` or manual polling inside a tool | Jobs integrate with the scheduler, support persistence, and are visible in server diagnostics |
624
+ | Multi-step orchestration | Use `@Workflow` with ordered steps referencing `@Job` classes | Chaining multiple tool calls manually from the LLM | Workflows provide built-in ordering, error handling, and rollback semantics |
625
+ | Injecting services | Use `@Provider` with `useFactory`/`useClass` and access via `this.get(Token)` | Importing singletons directly or using global state | DI providers support testability, lifecycle management, and per-scope isolation |
626
+
627
+ ---
628
+
629
+ ## Verification Checklist
630
+
631
+ ### Structure
632
+
633
+ - [ ] Server has exactly one `@FrontMcp` decorated class
634
+ - [ ] Every `@App` is listed in the `@FrontMcp({ apps: [...] })` array
635
+ - [ ] Each tool, resource, prompt, agent, and skill is registered in an `@App` (or in `@FrontMcp` for standalone use)
636
+
637
+ ### Decorator Fields
638
+
639
+ - [ ] Every `@Tool` has `name`, `description`, and `inputSchema` defined
640
+ - [ ] Every `@Resource` has `name` and `uri` with a valid scheme (e.g., `config://`, `file://`)
641
+ - [ ] Every `@ResourceTemplate` has `uriTemplate` with `{param}` placeholders matching the `read()` params argument
642
+ - [ ] Every `@Prompt` has `name` and at least one argument when it accepts input
643
+ - [ ] Every `@Agent` has `name`, `description`, and `llm` configuration
644
+
645
+ ### Inheritance
646
+
647
+ - [ ] Tool classes extend `ToolContext` and implement `execute()`
648
+ - [ ] Prompt classes extend `PromptContext` and implement `execute()`
649
+ - [ ] Resource classes extend `ResourceContext` and implement `read()`
650
+ - [ ] Agent classes extend `AgentContext` and implement `execute()`
651
+ - [ ] Job classes extend `JobContext` and implement `execute()`
652
+
653
+ ### Hooks
654
+
655
+ - [ ] Hook flow strings match valid flows (e.g., `tools:call-tool`, `resources:read-resource`)
656
+ - [ ] `@Around` hooks call `await next()` to continue the chain (unless intentionally short-circuiting)
657
+ - [ ] Hooks do not mutate `rawInput` -- use `ctx.state.set()` for flow state
658
+
659
+ ### DI and Plugins
660
+
661
+ - [ ] All `@Provider` entries specify exactly one of `useClass`, `useValue`, or `useFactory`
662
+ - [ ] Plugins are registered in `@App({ plugins: [...] })` or `@FrontMcp({ plugins: [...] })`
663
+ - [ ] Context extensions installed by plugins match the module augmentation declarations
664
+
665
+ ---
666
+
667
+ ## Troubleshooting
668
+
669
+ | Problem | Cause | Solution |
670
+ | -------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
671
+ | Tool does not appear in `tools/list` MCP response | Tool class is not registered in any `@App({ tools: [...] })` or `@FrontMcp({ tools: [...] })` | Add the tool class to the `tools` array of the appropriate `@App` or `@FrontMcp` decorator |
672
+ | `this.get(Token)` throws `DependencyNotFoundError` | The provider for that token is not registered or is registered in a different app scope | Add a `@Provider` for the token in the same `@App` or in `@FrontMcp({ providers: [...] })` for global access |
673
+ | Resource returns 404 / `ResourceNotFoundError` | The `uri` in `@Resource` does not match the requested URI, or `uriTemplate` parameters are misaligned | Verify the URI string exactly matches what the client requests; for templates, confirm `{param}` names match |
674
+ | Hook never fires | The `flow` string in `@Will`/`@Did`/`@Around`/`@Stage` does not match any registered flow | Check the flow string against valid flows (e.g., `tools:call-tool`, `resources:read-resource`, `resources:list-resources`) |
675
+ | Plugin context extension is `undefined` at runtime | The plugin's `installContextExtension` function was not called, or module augmentation is missing | Ensure the plugin is registered and its context extension function runs at startup; verify the `declare module` augmentation exists |
676
+ | Agent `execute()` returns empty result | LLM configuration is missing or invalid (wrong model name, missing API key) | Verify `llm.model` and `llm.provider` in `@Agent`, and ensure the provider API key is set in environment variables |
677
+
678
+ ---
679
+
680
+ ## Reference
681
+
682
+ - **Official docs:** [FrontMCP Decorators Overview](https://docs.agentfront.dev/frontmcp/sdk-reference/decorators/overview)
683
+ - **Related skills:**
684
+ - `create-tool` -- step-by-step guide for building tools with `@Tool` and `ToolContext`
685
+ - `create-resource` -- patterns for `@Resource` and `@ResourceTemplate` usage
686
+ - `create-plugin` -- creating plugins with `@Plugin`, providers, and context extensions
687
+ - `configure-auth` -- authentication and session configuration (not decorator-focused)