@frontmcp/skills 0.0.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.
- package/LICENSE +201 -0
- package/README.md +135 -0
- package/catalog/TEMPLATE.md +49 -0
- package/catalog/adapters/create-adapter/SKILL.md +127 -0
- package/catalog/adapters/official-adapters/SKILL.md +136 -0
- package/catalog/auth/configure-auth/SKILL.md +250 -0
- package/catalog/auth/configure-auth/references/auth-modes.md +77 -0
- package/catalog/auth/configure-session/SKILL.md +201 -0
- package/catalog/config/configure-elicitation/SKILL.md +136 -0
- package/catalog/config/configure-http/SKILL.md +167 -0
- package/catalog/config/configure-throttle/SKILL.md +189 -0
- package/catalog/config/configure-throttle/references/guard-config.md +68 -0
- package/catalog/config/configure-transport/SKILL.md +151 -0
- package/catalog/config/configure-transport/references/protocol-presets.md +57 -0
- package/catalog/deployment/build-for-browser/SKILL.md +95 -0
- package/catalog/deployment/build-for-cli/SKILL.md +100 -0
- package/catalog/deployment/build-for-sdk/SKILL.md +218 -0
- package/catalog/deployment/deploy-to-cloudflare/SKILL.md +192 -0
- package/catalog/deployment/deploy-to-lambda/SKILL.md +304 -0
- package/catalog/deployment/deploy-to-node/SKILL.md +229 -0
- package/catalog/deployment/deploy-to-node/references/Dockerfile.example +45 -0
- package/catalog/deployment/deploy-to-vercel/SKILL.md +196 -0
- package/catalog/deployment/deploy-to-vercel/references/vercel.json.example +60 -0
- package/catalog/development/create-agent/SKILL.md +563 -0
- package/catalog/development/create-agent/references/llm-config.md +46 -0
- package/catalog/development/create-job/SKILL.md +566 -0
- package/catalog/development/create-prompt/SKILL.md +400 -0
- package/catalog/development/create-provider/SKILL.md +233 -0
- package/catalog/development/create-resource/SKILL.md +437 -0
- package/catalog/development/create-skill/SKILL.md +526 -0
- package/catalog/development/create-skill-with-tools/SKILL.md +579 -0
- package/catalog/development/create-tool/SKILL.md +418 -0
- package/catalog/development/create-tool/references/output-schema-types.md +56 -0
- package/catalog/development/create-tool/references/tool-annotations.md +34 -0
- package/catalog/development/create-workflow/SKILL.md +709 -0
- package/catalog/development/decorators-guide/SKILL.md +598 -0
- package/catalog/plugins/create-plugin/SKILL.md +336 -0
- package/catalog/plugins/create-plugin-hooks/SKILL.md +282 -0
- package/catalog/plugins/official-plugins/SKILL.md +667 -0
- package/catalog/setup/frontmcp-skills-usage/SKILL.md +200 -0
- package/catalog/setup/multi-app-composition/SKILL.md +358 -0
- package/catalog/setup/nx-workflow/SKILL.md +357 -0
- package/catalog/setup/project-structure-nx/SKILL.md +186 -0
- package/catalog/setup/project-structure-standalone/SKILL.md +153 -0
- package/catalog/setup/setup-project/SKILL.md +493 -0
- package/catalog/setup/setup-redis/SKILL.md +385 -0
- package/catalog/setup/setup-sqlite/SKILL.md +359 -0
- package/catalog/skills-manifest.json +414 -0
- package/catalog/testing/setup-testing/SKILL.md +539 -0
- package/catalog/testing/setup-testing/references/test-auth.md +88 -0
- package/catalog/testing/setup-testing/references/test-browser-build.md +57 -0
- package/catalog/testing/setup-testing/references/test-cli-binary.md +48 -0
- package/catalog/testing/setup-testing/references/test-direct-client.md +62 -0
- package/catalog/testing/setup-testing/references/test-e2e-handler.md +51 -0
- package/catalog/testing/setup-testing/references/test-tool-unit.md +41 -0
- package/package.json +34 -0
- package/src/index.d.ts +3 -0
- package/src/index.js +16 -0
- package/src/index.js.map +1 -0
- package/src/loader.d.ts +46 -0
- package/src/loader.js +75 -0
- package/src/loader.js.map +1 -0
- package/src/manifest.d.ts +81 -0
- package/src/manifest.js +26 -0
- package/src/manifest.js.map +1 -0
|
@@ -0,0 +1,579 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: create-skill-with-tools
|
|
3
|
+
description: Create skills that reference and orchestrate MCP tools for multi-step workflows. Use when building skills with tool references, SKILL.md directories, or workflow instructions.
|
|
4
|
+
tags: [skill, tools, workflow, instructions]
|
|
5
|
+
parameters:
|
|
6
|
+
- name: name
|
|
7
|
+
description: Skill name in kebab-case
|
|
8
|
+
type: string
|
|
9
|
+
required: true
|
|
10
|
+
examples:
|
|
11
|
+
- scenario: Create a deploy skill that uses build and test tools
|
|
12
|
+
expected-outcome: Skill guides AI through build, test, deploy workflow
|
|
13
|
+
- scenario: Create a skill from a SKILL.md file directory
|
|
14
|
+
expected-outcome: Skill loaded with instructions, scripts, references, assets
|
|
15
|
+
priority: 8
|
|
16
|
+
visibility: both
|
|
17
|
+
license: Apache-2.0
|
|
18
|
+
metadata:
|
|
19
|
+
docs: https://docs.agentfront.dev/frontmcp/servers/skills
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
# Creating a Skill with Tools
|
|
23
|
+
|
|
24
|
+
Skills are knowledge and workflow guides that help LLMs accomplish multi-step tasks using available MCP tools. Unlike tools (which execute actions directly) or agents (which run autonomous LLM loops), skills provide structured instructions, tool references, and context that the AI client uses to orchestrate tool calls on its own.
|
|
25
|
+
|
|
26
|
+
## When to Use @Skill
|
|
27
|
+
|
|
28
|
+
Use `@Skill` when you want to teach an AI client HOW to accomplish a complex task by combining multiple tools in sequence. A skill does not execute anything itself -- it provides the instructions, tool references, and examples that guide the AI through a workflow.
|
|
29
|
+
|
|
30
|
+
| Aspect | @Skill | @Tool | @Agent |
|
|
31
|
+
| ---------- | ------------------------ | -------------------- | -------------------- |
|
|
32
|
+
| Execution | None (instructions only) | Direct function call | Autonomous LLM loop |
|
|
33
|
+
| Purpose | Workflow guide for AI | Single action | Multi-step reasoning |
|
|
34
|
+
| Tool usage | References tools by name | Is a tool | Has inner tools |
|
|
35
|
+
| Output | Instructions + tool refs | Computed result | LLM-generated result |
|
|
36
|
+
|
|
37
|
+
## Class-Based Pattern
|
|
38
|
+
|
|
39
|
+
Create a class extending `SkillContext` and implement the `build(): Promise<SkillContent>` method. The `@Skill` decorator requires at minimum a `name` and `description`.
|
|
40
|
+
|
|
41
|
+
```typescript
|
|
42
|
+
import { Skill, SkillContext } from '@frontmcp/sdk';
|
|
43
|
+
|
|
44
|
+
@Skill({
|
|
45
|
+
name: 'deploy-service',
|
|
46
|
+
description: 'Deploy a service through the build, test, and release pipeline',
|
|
47
|
+
instructions: `# Deploy Service Workflow
|
|
48
|
+
|
|
49
|
+
## Step 1: Build
|
|
50
|
+
Use the \`build_project\` tool to compile the service.
|
|
51
|
+
Pass the service name and target environment.
|
|
52
|
+
|
|
53
|
+
## Step 2: Run Tests
|
|
54
|
+
Use the \`run_tests\` tool to execute the test suite.
|
|
55
|
+
If tests fail, stop and report the failures.
|
|
56
|
+
|
|
57
|
+
## Step 3: Deploy
|
|
58
|
+
Use the \`deploy_to_env\` tool to push the build to the target environment.
|
|
59
|
+
Verify the deployment using \`health_check\` tool.
|
|
60
|
+
|
|
61
|
+
## Step 4: Notify
|
|
62
|
+
Use the \`send_notification\` tool to notify the team of the deployment status.`,
|
|
63
|
+
tools: [BuildProjectTool, RunTestsTool, DeployToEnvTool, HealthCheckTool, SendNotificationTool],
|
|
64
|
+
})
|
|
65
|
+
class DeployServiceSkill extends SkillContext {}
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
### Available Context Methods
|
|
69
|
+
|
|
70
|
+
`SkillContext` provides:
|
|
71
|
+
|
|
72
|
+
- `loadInstructions(): Promise<string>` -- load and return the skill's instructions content
|
|
73
|
+
- `build(): Promise<SkillContent>` -- build the full skill content (instructions + tool refs + metadata)
|
|
74
|
+
- `getToolRefs(): SkillToolRef[]` -- get the list of tool references
|
|
75
|
+
- `getToolNames(): string[]` -- get the list of tool names
|
|
76
|
+
|
|
77
|
+
## Tool References: Three Ways to Specify Tools
|
|
78
|
+
|
|
79
|
+
The `tools` array in `@Skill` metadata supports three ways to reference tools that the skill uses in its instructions.
|
|
80
|
+
|
|
81
|
+
### 1. Class Reference
|
|
82
|
+
|
|
83
|
+
Pass the tool class directly. The framework resolves the tool name and validates it exists in the registry.
|
|
84
|
+
|
|
85
|
+
```typescript
|
|
86
|
+
@Skill({
|
|
87
|
+
name: 'data-pipeline',
|
|
88
|
+
description: 'Run a data processing pipeline',
|
|
89
|
+
instructions: 'Use extract_data, transform_data, and load_data in sequence.',
|
|
90
|
+
tools: [ExtractDataTool, TransformDataTool, LoadDataTool],
|
|
91
|
+
})
|
|
92
|
+
class DataPipelineSkill extends SkillContext {}
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### 2. String Name
|
|
96
|
+
|
|
97
|
+
Reference a tool by its registered name. Useful for tools registered elsewhere or external tools.
|
|
98
|
+
|
|
99
|
+
```typescript
|
|
100
|
+
@Skill({
|
|
101
|
+
name: 'code-review',
|
|
102
|
+
description: 'Review code changes',
|
|
103
|
+
instructions: 'Use git_diff to get changes, then use analyze_code to review them.',
|
|
104
|
+
tools: ['git_diff', 'analyze_code', 'post_comment'],
|
|
105
|
+
})
|
|
106
|
+
class CodeReviewSkill extends SkillContext {}
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### 3. Object with Metadata
|
|
110
|
+
|
|
111
|
+
Provide a detailed reference with name, purpose description, and required flag.
|
|
112
|
+
|
|
113
|
+
```typescript
|
|
114
|
+
@Skill({
|
|
115
|
+
name: 'incident-response',
|
|
116
|
+
description: 'Respond to production incidents',
|
|
117
|
+
instructions: `# Incident Response
|
|
118
|
+
|
|
119
|
+
## Step 1: Gather Information
|
|
120
|
+
Use check_service_health to determine which services are affected.
|
|
121
|
+
Use query_logs to find error patterns.
|
|
122
|
+
|
|
123
|
+
## Step 2: Mitigate
|
|
124
|
+
Use rollback_deployment if a recent deploy caused the issue.
|
|
125
|
+
Use scale_service if the issue is load-related.
|
|
126
|
+
|
|
127
|
+
## Step 3: Communicate
|
|
128
|
+
Use send_notification to update the incident channel.`,
|
|
129
|
+
tools: [
|
|
130
|
+
{ name: 'check_service_health', purpose: 'Check health status of services', required: true },
|
|
131
|
+
{ name: 'query_logs', purpose: 'Search application logs for errors', required: true },
|
|
132
|
+
{ name: 'rollback_deployment', purpose: 'Rollback to previous deployment', required: false },
|
|
133
|
+
{ name: 'scale_service', purpose: 'Scale service replicas up or down', required: false },
|
|
134
|
+
{ name: 'send_notification', purpose: 'Send notification to Slack channel', required: true },
|
|
135
|
+
],
|
|
136
|
+
})
|
|
137
|
+
class IncidentResponseSkill extends SkillContext {}
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
You can mix all three styles in a single `tools` array:
|
|
141
|
+
|
|
142
|
+
```typescript
|
|
143
|
+
tools: [
|
|
144
|
+
BuildProjectTool, // class reference
|
|
145
|
+
'run_tests', // string name
|
|
146
|
+
{ name: 'deploy', purpose: 'Deploy to environment', required: true }, // object
|
|
147
|
+
],
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
## Tool Validation Modes
|
|
151
|
+
|
|
152
|
+
The `toolValidation` field controls what happens when referenced tools are not found in the registry at startup.
|
|
153
|
+
|
|
154
|
+
```typescript
|
|
155
|
+
@Skill({
|
|
156
|
+
name: 'strict-workflow',
|
|
157
|
+
description: 'Workflow that requires all tools to exist',
|
|
158
|
+
instructions: '...',
|
|
159
|
+
tools: [RequiredToolA, RequiredToolB],
|
|
160
|
+
toolValidation: 'strict', // fail if any tool is missing
|
|
161
|
+
})
|
|
162
|
+
class StrictWorkflowSkill extends SkillContext {}
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
| Mode | Behavior |
|
|
166
|
+
| ---------- | -------------------------------------------------------------------------------------------------------------------------------- |
|
|
167
|
+
| `'strict'` | Throws an error if any referenced tool is not registered. Use for production workflows where missing tools would cause failures. |
|
|
168
|
+
| `'warn'` | Logs a warning for missing tools but continues. Use during development when tools may not all be available yet. |
|
|
169
|
+
| `'ignore'` | Silently ignores missing tools. Use for optional tool references or cross-server skills. |
|
|
170
|
+
|
|
171
|
+
## Instruction Sources
|
|
172
|
+
|
|
173
|
+
Skills support three ways to provide instructions.
|
|
174
|
+
|
|
175
|
+
### Inline String
|
|
176
|
+
|
|
177
|
+
```typescript
|
|
178
|
+
@Skill({
|
|
179
|
+
name: 'quick-task',
|
|
180
|
+
description: 'A simple task',
|
|
181
|
+
instructions: 'Step 1: Use tool_a. Step 2: Use tool_b.',
|
|
182
|
+
})
|
|
183
|
+
class QuickTaskSkill extends SkillContext {}
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
### File Reference
|
|
187
|
+
|
|
188
|
+
Load instructions from a Markdown file relative to the skill file:
|
|
189
|
+
|
|
190
|
+
```typescript
|
|
191
|
+
@Skill({
|
|
192
|
+
name: 'complex-workflow',
|
|
193
|
+
description: 'A complex multi-step workflow',
|
|
194
|
+
instructions: { file: './skills/complex-workflow.md' },
|
|
195
|
+
tools: [ToolA, ToolB, ToolC],
|
|
196
|
+
})
|
|
197
|
+
class ComplexWorkflowSkill extends SkillContext {}
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
### URL Reference
|
|
201
|
+
|
|
202
|
+
Load instructions from a remote URL:
|
|
203
|
+
|
|
204
|
+
```typescript
|
|
205
|
+
@Skill({
|
|
206
|
+
name: 'remote-workflow',
|
|
207
|
+
description: 'Workflow with remote instructions',
|
|
208
|
+
instructions: { url: 'https://docs.example.com/workflows/deploy.md' },
|
|
209
|
+
tools: ['build', 'test', 'deploy'],
|
|
210
|
+
})
|
|
211
|
+
class RemoteWorkflowSkill extends SkillContext {}
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
## Directory-Based Skills with skillDir()
|
|
215
|
+
|
|
216
|
+
Use `skillDir()` to load a skill from a directory structure. The directory is expected to contain a `SKILL.md` file with frontmatter and instructions, plus optional subdirectories for scripts, references, and assets.
|
|
217
|
+
|
|
218
|
+
```
|
|
219
|
+
skills/
|
|
220
|
+
deploy-service/
|
|
221
|
+
SKILL.md # Instructions with YAML frontmatter
|
|
222
|
+
scripts/
|
|
223
|
+
validate.sh # Helper scripts
|
|
224
|
+
smoke-test.sh
|
|
225
|
+
references/
|
|
226
|
+
architecture.md # Reference documentation
|
|
227
|
+
runbook.md
|
|
228
|
+
assets/
|
|
229
|
+
topology.png # Visual assets
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
```typescript
|
|
233
|
+
import { skillDir } from '@frontmcp/sdk';
|
|
234
|
+
|
|
235
|
+
const DeployServiceSkill = await skillDir('./skills/deploy-service');
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
The `SKILL.md` file uses YAML frontmatter for metadata, followed by the instructions body:
|
|
239
|
+
|
|
240
|
+
```markdown
|
|
241
|
+
---
|
|
242
|
+
name: deploy-service
|
|
243
|
+
description: Deploy a service through the full pipeline
|
|
244
|
+
tags: [deploy, ci-cd, production]
|
|
245
|
+
tools:
|
|
246
|
+
- name: build_project
|
|
247
|
+
purpose: Compile the service
|
|
248
|
+
required: true
|
|
249
|
+
- name: run_tests
|
|
250
|
+
purpose: Execute test suite
|
|
251
|
+
required: true
|
|
252
|
+
- name: deploy_to_env
|
|
253
|
+
purpose: Push build to target environment
|
|
254
|
+
required: true
|
|
255
|
+
parameters:
|
|
256
|
+
- name: environment
|
|
257
|
+
description: Target deployment environment
|
|
258
|
+
type: string
|
|
259
|
+
required: true
|
|
260
|
+
examples:
|
|
261
|
+
- scenario: Deploy to staging
|
|
262
|
+
expected-outcome: Service deployed and health check passes
|
|
263
|
+
---
|
|
264
|
+
|
|
265
|
+
# Deploy Service
|
|
266
|
+
|
|
267
|
+
Follow these steps to deploy the service...
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
## Skill Parameters
|
|
271
|
+
|
|
272
|
+
Parameters let callers customize skill behavior. They appear in the skill's metadata and can be used in instructions.
|
|
273
|
+
|
|
274
|
+
```typescript
|
|
275
|
+
@Skill({
|
|
276
|
+
name: 'setup-project',
|
|
277
|
+
description: 'Set up a new project from a template',
|
|
278
|
+
instructions: 'Use create_project tool with the specified template and language.',
|
|
279
|
+
tools: ['create_project', 'install_dependencies', 'init_git'],
|
|
280
|
+
parameters: [
|
|
281
|
+
{ name: 'template', description: 'Project template to use', type: 'string', required: true },
|
|
282
|
+
{ name: 'language', description: 'Programming language', type: 'string', default: 'typescript' },
|
|
283
|
+
{ name: 'include-ci', description: 'Include CI configuration', type: 'boolean', default: true },
|
|
284
|
+
],
|
|
285
|
+
})
|
|
286
|
+
class SetupProjectSkill extends SkillContext {}
|
|
287
|
+
```
|
|
288
|
+
|
|
289
|
+
## Skill Examples
|
|
290
|
+
|
|
291
|
+
Examples show the AI how the skill should be used and what outcomes to expect:
|
|
292
|
+
|
|
293
|
+
```typescript
|
|
294
|
+
@Skill({
|
|
295
|
+
name: 'database-migration',
|
|
296
|
+
description: 'Run database migrations safely',
|
|
297
|
+
instructions: '...',
|
|
298
|
+
tools: ['generate_migration', 'run_migration', 'rollback_migration', 'backup_database'],
|
|
299
|
+
examples: [
|
|
300
|
+
{
|
|
301
|
+
scenario: 'Add a new column to the users table',
|
|
302
|
+
expectedOutcome: 'Migration generated, backup created, migration applied, verified',
|
|
303
|
+
},
|
|
304
|
+
{
|
|
305
|
+
scenario: 'Rollback a failed migration',
|
|
306
|
+
expectedOutcome: 'Failed migration identified, rolled back, database restored to previous state',
|
|
307
|
+
},
|
|
308
|
+
],
|
|
309
|
+
})
|
|
310
|
+
class DatabaseMigrationSkill extends SkillContext {}
|
|
311
|
+
```
|
|
312
|
+
|
|
313
|
+
## Skill Visibility
|
|
314
|
+
|
|
315
|
+
Control where the skill is discoverable using the `visibility` field:
|
|
316
|
+
|
|
317
|
+
```typescript
|
|
318
|
+
@Skill({
|
|
319
|
+
name: 'internal-deploy',
|
|
320
|
+
description: 'Internal deployment workflow',
|
|
321
|
+
instructions: '...',
|
|
322
|
+
visibility: 'mcp', // Only visible via MCP protocol
|
|
323
|
+
})
|
|
324
|
+
class InternalDeploySkill extends SkillContext {}
|
|
325
|
+
```
|
|
326
|
+
|
|
327
|
+
| Value | Description |
|
|
328
|
+
| -------- | ------------------------------------------------------- |
|
|
329
|
+
| `'mcp'` | Visible only via MCP protocol (tool listing) |
|
|
330
|
+
| `'http'` | Visible only via HTTP endpoints (`/llm.txt`, `/skills`) |
|
|
331
|
+
| `'both'` | Visible via both MCP and HTTP (default) |
|
|
332
|
+
|
|
333
|
+
## Hiding Skills from Discovery
|
|
334
|
+
|
|
335
|
+
Use `hideFromDiscovery: true` to register a skill that is not listed in discovery endpoints but can still be invoked directly:
|
|
336
|
+
|
|
337
|
+
```typescript
|
|
338
|
+
@Skill({
|
|
339
|
+
name: 'admin-maintenance',
|
|
340
|
+
description: 'Internal maintenance procedures',
|
|
341
|
+
instructions: '...',
|
|
342
|
+
hideFromDiscovery: true,
|
|
343
|
+
})
|
|
344
|
+
class AdminMaintenanceSkill extends SkillContext {}
|
|
345
|
+
```
|
|
346
|
+
|
|
347
|
+
## Function-Style Builder
|
|
348
|
+
|
|
349
|
+
For skills that do not need a class, use the `skill()` function builder:
|
|
350
|
+
|
|
351
|
+
```typescript
|
|
352
|
+
import { skill } from '@frontmcp/sdk';
|
|
353
|
+
|
|
354
|
+
const QuickDeploySkill = skill({
|
|
355
|
+
name: 'quick-deploy',
|
|
356
|
+
description: 'Quick deployment to staging',
|
|
357
|
+
instructions: `# Quick Deploy
|
|
358
|
+
1. Use build_project to compile.
|
|
359
|
+
2. Use deploy_to_env with environment=staging.
|
|
360
|
+
3. Use health_check to verify.`,
|
|
361
|
+
tools: ['build_project', 'deploy_to_env', 'health_check'],
|
|
362
|
+
});
|
|
363
|
+
```
|
|
364
|
+
|
|
365
|
+
Register it the same way as a class skill: `skills: [QuickDeploySkill]`.
|
|
366
|
+
|
|
367
|
+
## Remote and ESM Loading
|
|
368
|
+
|
|
369
|
+
Load skills from external modules or remote URLs without importing them directly.
|
|
370
|
+
|
|
371
|
+
**ESM loading** -- load a skill from an ES module:
|
|
372
|
+
|
|
373
|
+
```typescript
|
|
374
|
+
const ExternalSkill = Skill.esm('@my-org/skills@^1.0.0', 'ExternalSkill', {
|
|
375
|
+
description: 'A skill loaded from an ES module',
|
|
376
|
+
});
|
|
377
|
+
```
|
|
378
|
+
|
|
379
|
+
**Remote loading** -- load a skill from a remote URL:
|
|
380
|
+
|
|
381
|
+
```typescript
|
|
382
|
+
const CloudSkill = Skill.remote('https://example.com/skills/cloud-skill', 'CloudSkill', {
|
|
383
|
+
description: 'A skill loaded from a remote server',
|
|
384
|
+
});
|
|
385
|
+
```
|
|
386
|
+
|
|
387
|
+
Both return values that can be registered in `skills: [ExternalSkill, CloudSkill]`.
|
|
388
|
+
|
|
389
|
+
## Registration
|
|
390
|
+
|
|
391
|
+
Add skill classes (or function-style skills) to the `skills` array in `@FrontMcp` or `@App`.
|
|
392
|
+
|
|
393
|
+
```typescript
|
|
394
|
+
import { FrontMcp, App } from '@frontmcp/sdk';
|
|
395
|
+
|
|
396
|
+
@App({
|
|
397
|
+
name: 'devops-app',
|
|
398
|
+
skills: [DeployServiceSkill, IncidentResponseSkill],
|
|
399
|
+
tools: [BuildProjectTool, RunTestsTool, DeployToEnvTool],
|
|
400
|
+
})
|
|
401
|
+
class DevOpsApp {}
|
|
402
|
+
|
|
403
|
+
@FrontMcp({
|
|
404
|
+
info: { name: 'my-server', version: '1.0.0' },
|
|
405
|
+
apps: [DevOpsApp],
|
|
406
|
+
skills: [QuickDeploySkill], // can also register skills directly on the server
|
|
407
|
+
})
|
|
408
|
+
class MyServer {}
|
|
409
|
+
```
|
|
410
|
+
|
|
411
|
+
## Nx Generators
|
|
412
|
+
|
|
413
|
+
Scaffold a new skill using the Nx generators:
|
|
414
|
+
|
|
415
|
+
```bash
|
|
416
|
+
# Create a skill class file
|
|
417
|
+
nx generate @frontmcp/nx:skill
|
|
418
|
+
|
|
419
|
+
# Create a directory-based skill with SKILL.md, scripts/, references/, assets/
|
|
420
|
+
nx generate @frontmcp/nx:skill-dir
|
|
421
|
+
```
|
|
422
|
+
|
|
423
|
+
The class generator creates the skill file, spec file, and updates barrel exports. The directory generator creates the full directory structure ready for `skillDir()`.
|
|
424
|
+
|
|
425
|
+
## HTTP Endpoints for Skill Discovery
|
|
426
|
+
|
|
427
|
+
When skills have `visibility` set to `'http'` or `'both'`, they are discoverable via HTTP endpoints:
|
|
428
|
+
|
|
429
|
+
### /llm.txt
|
|
430
|
+
|
|
431
|
+
Returns a plain-text document listing all HTTP-visible skills with their descriptions and instructions. This endpoint follows the `llm.txt` convention for AI-readable site documentation.
|
|
432
|
+
|
|
433
|
+
```
|
|
434
|
+
GET /llm.txt
|
|
435
|
+
|
|
436
|
+
# Skills
|
|
437
|
+
|
|
438
|
+
## deploy-service
|
|
439
|
+
Deploy a service through the build, test, and release pipeline
|
|
440
|
+
Tools: build_project, run_tests, deploy_to_env, health_check, send_notification
|
|
441
|
+
...
|
|
442
|
+
```
|
|
443
|
+
|
|
444
|
+
### /skills
|
|
445
|
+
|
|
446
|
+
Returns a JSON array of all HTTP-visible skills with full metadata:
|
|
447
|
+
|
|
448
|
+
```
|
|
449
|
+
GET /skills
|
|
450
|
+
|
|
451
|
+
[
|
|
452
|
+
{
|
|
453
|
+
"name": "deploy-service",
|
|
454
|
+
"description": "Deploy a service through the build, test, and release pipeline",
|
|
455
|
+
"instructions": "...",
|
|
456
|
+
"tools": ["build_project", "run_tests", "deploy_to_env"],
|
|
457
|
+
"parameters": [...],
|
|
458
|
+
"examples": [...],
|
|
459
|
+
"tags": ["deploy", "ci-cd"],
|
|
460
|
+
"visibility": "both"
|
|
461
|
+
}
|
|
462
|
+
]
|
|
463
|
+
```
|
|
464
|
+
|
|
465
|
+
## Complete Example: Multi-Tool Orchestration Skill
|
|
466
|
+
|
|
467
|
+
```typescript
|
|
468
|
+
import { Skill, SkillContext, Tool, ToolContext, FrontMcp, App } from '@frontmcp/sdk';
|
|
469
|
+
import { z } from 'zod';
|
|
470
|
+
|
|
471
|
+
// Define the tools that the skill references
|
|
472
|
+
|
|
473
|
+
@Tool({
|
|
474
|
+
name: 'analyze_codebase',
|
|
475
|
+
description: 'Analyze a codebase for patterns and issues',
|
|
476
|
+
inputSchema: {
|
|
477
|
+
path: z.string().describe('Path to the codebase'),
|
|
478
|
+
checks: z.array(z.string()).describe('Checks to run'),
|
|
479
|
+
},
|
|
480
|
+
})
|
|
481
|
+
class AnalyzeCodebaseTool extends ToolContext {
|
|
482
|
+
async execute(input: { path: string; checks: string[] }) {
|
|
483
|
+
return { issues: [], score: 95 };
|
|
484
|
+
}
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
@Tool({
|
|
488
|
+
name: 'generate_report',
|
|
489
|
+
description: 'Generate a Markdown report from analysis results',
|
|
490
|
+
inputSchema: {
|
|
491
|
+
title: z.string(),
|
|
492
|
+
sections: z.array(z.object({ heading: z.string(), content: z.string() })),
|
|
493
|
+
},
|
|
494
|
+
})
|
|
495
|
+
class GenerateReportTool extends ToolContext {
|
|
496
|
+
async execute(input: { title: string; sections: { heading: string; content: string }[] }) {
|
|
497
|
+
return `# ${input.title}\n${input.sections.map((s) => `## ${s.heading}\n${s.content}`).join('\n')}`;
|
|
498
|
+
}
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
@Tool({
|
|
502
|
+
name: 'create_issue',
|
|
503
|
+
description: 'Create a GitHub issue for a found problem',
|
|
504
|
+
inputSchema: {
|
|
505
|
+
title: z.string(),
|
|
506
|
+
body: z.string(),
|
|
507
|
+
labels: z.array(z.string()).optional(),
|
|
508
|
+
},
|
|
509
|
+
})
|
|
510
|
+
class CreateIssueTool extends ToolContext {
|
|
511
|
+
async execute(input: { title: string; body: string; labels?: string[] }) {
|
|
512
|
+
return { issueNumber: 42, url: 'https://github.com/org/repo/issues/42' };
|
|
513
|
+
}
|
|
514
|
+
}
|
|
515
|
+
|
|
516
|
+
// Define the skill that orchestrates these tools
|
|
517
|
+
|
|
518
|
+
@Skill({
|
|
519
|
+
name: 'codebase-audit',
|
|
520
|
+
description: 'Perform a comprehensive codebase audit with reporting and issue creation',
|
|
521
|
+
instructions: `# Codebase Audit Workflow
|
|
522
|
+
|
|
523
|
+
## Step 1: Analyze
|
|
524
|
+
Use the \`analyze_codebase\` tool to scan the codebase.
|
|
525
|
+
Run these checks: ["security", "performance", "maintainability", "testing"].
|
|
526
|
+
|
|
527
|
+
## Step 2: Review Results
|
|
528
|
+
Examine the analysis output. Group issues by severity (critical, warning, info).
|
|
529
|
+
|
|
530
|
+
## Step 3: Generate Report
|
|
531
|
+
Use \`generate_report\` to create a Markdown report with sections for each check category.
|
|
532
|
+
Include the overall score and a summary of findings.
|
|
533
|
+
|
|
534
|
+
## Step 4: Create Issues
|
|
535
|
+
For each critical issue found, use \`create_issue\` to file a GitHub issue.
|
|
536
|
+
Label critical issues with "priority:high" and "audit".
|
|
537
|
+
Label warnings with "priority:medium" and "audit".
|
|
538
|
+
|
|
539
|
+
## Step 5: Summary
|
|
540
|
+
Provide a final summary with:
|
|
541
|
+
- Total issues found by severity
|
|
542
|
+
- Overall codebase score
|
|
543
|
+
- Links to created GitHub issues`,
|
|
544
|
+
tools: [
|
|
545
|
+
AnalyzeCodebaseTool,
|
|
546
|
+
GenerateReportTool,
|
|
547
|
+
{ name: 'create_issue', purpose: 'File GitHub issues for critical findings', required: false },
|
|
548
|
+
],
|
|
549
|
+
toolValidation: 'strict',
|
|
550
|
+
parameters: [
|
|
551
|
+
{ name: 'path', description: 'Path to the codebase to audit', type: 'string', required: true },
|
|
552
|
+
{ name: 'create-issues', description: 'Whether to create GitHub issues', type: 'boolean', default: true },
|
|
553
|
+
],
|
|
554
|
+
examples: [
|
|
555
|
+
{
|
|
556
|
+
scenario: 'Audit a Node.js API project',
|
|
557
|
+
expectedOutcome: 'Analysis complete, report generated, critical issues filed on GitHub',
|
|
558
|
+
},
|
|
559
|
+
],
|
|
560
|
+
tags: ['audit', 'code-quality', 'github'],
|
|
561
|
+
visibility: 'both',
|
|
562
|
+
})
|
|
563
|
+
class CodebaseAuditSkill extends SkillContext {}
|
|
564
|
+
|
|
565
|
+
// Register everything
|
|
566
|
+
|
|
567
|
+
@App({
|
|
568
|
+
name: 'audit-app',
|
|
569
|
+
skills: [CodebaseAuditSkill],
|
|
570
|
+
tools: [AnalyzeCodebaseTool, GenerateReportTool, CreateIssueTool],
|
|
571
|
+
})
|
|
572
|
+
class AuditApp {}
|
|
573
|
+
|
|
574
|
+
@FrontMcp({
|
|
575
|
+
info: { name: 'audit-server', version: '1.0.0' },
|
|
576
|
+
apps: [AuditApp],
|
|
577
|
+
})
|
|
578
|
+
class AuditServer {}
|
|
579
|
+
```
|