@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
@@ -0,0 +1,292 @@
1
+ # Example: Weather API (Beginner)
2
+
3
+ > Skills used: setup-project, create-tool, create-resource, setup-testing, deploy-to-node
4
+
5
+ A complete beginner MCP server that exposes a weather lookup tool and a static resource listing supported cities. Demonstrates server setup, Zod input/output schemas, `this.fetch()` for HTTP calls, `this.fail()` for error handling, and both unit and E2E tests.
6
+
7
+ ---
8
+
9
+ ## Project Setup
10
+
11
+ ```jsonc
12
+ // package.json
13
+ {
14
+ "name": "weather-api",
15
+ "version": "1.0.0",
16
+ "private": true,
17
+ "scripts": {
18
+ "build": "frontmcp build",
19
+ "start": "frontmcp start",
20
+ "test": "jest --coverage",
21
+ },
22
+ "dependencies": {
23
+ "@frontmcp/sdk": "^1.0.0",
24
+ "zod": "^3.23.0",
25
+ },
26
+ "devDependencies": {
27
+ "@frontmcp/testing": "^1.0.0",
28
+ "jest": "^29.0.0",
29
+ "ts-jest": "^29.0.0",
30
+ "typescript": "^5.4.0",
31
+ },
32
+ }
33
+ ```
34
+
35
+ ---
36
+
37
+ ## Server Entry Point
38
+
39
+ ```typescript
40
+ // src/main.ts
41
+ import { FrontMcp } from '@frontmcp/sdk';
42
+ import { WeatherApp } from './weather.app';
43
+
44
+ @FrontMcp({
45
+ info: { name: 'weather-api', version: '1.0.0' },
46
+ apps: [WeatherApp],
47
+ })
48
+ export default class WeatherServer {}
49
+ ```
50
+
51
+ ---
52
+
53
+ ## App Registration
54
+
55
+ ```typescript
56
+ // src/weather.app.ts
57
+ import { App } from '@frontmcp/sdk';
58
+ import { GetWeatherTool } from './tools/get-weather.tool';
59
+ import { CitiesResource } from './resources/cities.resource';
60
+
61
+ @App({
62
+ name: 'Weather',
63
+ description: 'Weather lookup tools and city data',
64
+ tools: [GetWeatherTool],
65
+ resources: [CitiesResource],
66
+ })
67
+ export class WeatherApp {}
68
+ ```
69
+
70
+ ---
71
+
72
+ ## Tool: Get Weather
73
+
74
+ ```typescript
75
+ // src/tools/get-weather.tool.ts
76
+ import { Tool, ToolContext } from '@frontmcp/sdk';
77
+ import { z } from 'zod';
78
+
79
+ @Tool({
80
+ name: 'get_weather',
81
+ description: 'Get current weather for a city',
82
+ inputSchema: {
83
+ city: z.string().min(1).describe('City name'),
84
+ units: z.enum(['celsius', 'fahrenheit']).default('celsius').describe('Temperature units'),
85
+ },
86
+ outputSchema: {
87
+ temperature: z.number(),
88
+ condition: z.string(),
89
+ humidity: z.number(),
90
+ city: z.string(),
91
+ },
92
+ })
93
+ export class GetWeatherTool extends ToolContext {
94
+ async execute(input: { city: string; units: 'celsius' | 'fahrenheit' }) {
95
+ const url = `https://api.weather.example.com/v1/current?city=${encodeURIComponent(input.city)}&units=${input.units}`;
96
+
97
+ let response: Response;
98
+ try {
99
+ response = await this.fetch(url);
100
+ } catch (err) {
101
+ this.fail(new Error(`Weather API unreachable: ${String(err)}`));
102
+ }
103
+
104
+ if (!response.ok) {
105
+ this.fail(new Error(`Weather API error: ${response.status} ${response.statusText}`));
106
+ }
107
+
108
+ const data = await response.json();
109
+
110
+ return {
111
+ temperature: data.temp,
112
+ condition: data.condition,
113
+ humidity: data.humidity,
114
+ city: input.city,
115
+ };
116
+ }
117
+ }
118
+ ```
119
+
120
+ ---
121
+
122
+ ## Resource: Supported Cities
123
+
124
+ ```typescript
125
+ // src/resources/cities.resource.ts
126
+ import { Resource, ResourceContext } from '@frontmcp/sdk';
127
+
128
+ const SUPPORTED_CITIES = ['London', 'Tokyo', 'New York', 'Paris', 'Sydney', 'Berlin', 'Toronto', 'Mumbai'];
129
+
130
+ @Resource({
131
+ uri: 'weather://cities',
132
+ name: 'Supported Cities',
133
+ description: 'List of cities with available weather data',
134
+ mimeType: 'application/json',
135
+ })
136
+ export class CitiesResource extends ResourceContext {
137
+ async read() {
138
+ return JSON.stringify(SUPPORTED_CITIES);
139
+ }
140
+ }
141
+ ```
142
+
143
+ ---
144
+
145
+ ## Unit Test: GetWeatherTool
146
+
147
+ ```typescript
148
+ // test/get-weather.tool.spec.ts
149
+ import { ToolContext } from '@frontmcp/sdk';
150
+ import { GetWeatherTool } from '../src/tools/get-weather.tool';
151
+
152
+ describe('GetWeatherTool', () => {
153
+ let tool: GetWeatherTool;
154
+
155
+ beforeEach(() => {
156
+ tool = new GetWeatherTool();
157
+ });
158
+
159
+ it('should return weather data for a valid city', async () => {
160
+ const mockResponse = {
161
+ ok: true,
162
+ json: async () => ({
163
+ temp: 22,
164
+ condition: 'Sunny',
165
+ humidity: 45,
166
+ }),
167
+ } as unknown as Response;
168
+
169
+ const ctx = {
170
+ fetch: jest.fn().mockResolvedValue(mockResponse),
171
+ fail: jest.fn((err: Error) => {
172
+ throw err;
173
+ }),
174
+ mark: jest.fn(),
175
+ get: jest.fn(),
176
+ tryGet: jest.fn(),
177
+ notify: jest.fn(),
178
+ respondProgress: jest.fn(),
179
+ } as unknown as ToolContext;
180
+ Object.assign(tool, ctx);
181
+
182
+ const result = await tool.execute({ city: 'London', units: 'celsius' });
183
+
184
+ expect(result).toEqual({
185
+ temperature: 22,
186
+ condition: 'Sunny',
187
+ humidity: 45,
188
+ city: 'London',
189
+ });
190
+ expect(ctx.fetch).toHaveBeenCalledWith(expect.stringContaining('city=London'));
191
+ });
192
+
193
+ it('should fail when city is empty (Zod validation)', () => {
194
+ const { z } = require('zod');
195
+ const schema = z.object({
196
+ city: z.string().min(1),
197
+ units: z.enum(['celsius', 'fahrenheit']).default('celsius'),
198
+ });
199
+
200
+ expect(() => schema.parse({ city: '' })).toThrow();
201
+ });
202
+
203
+ it('should fail when the weather API returns an error', async () => {
204
+ const mockResponse = {
205
+ ok: false,
206
+ status: 404,
207
+ statusText: 'Not Found',
208
+ } as unknown as Response;
209
+
210
+ const failFn = jest.fn((err: Error) => {
211
+ throw err;
212
+ });
213
+ const ctx = {
214
+ fetch: jest.fn().mockResolvedValue(mockResponse),
215
+ fail: failFn,
216
+ mark: jest.fn(),
217
+ get: jest.fn(),
218
+ tryGet: jest.fn(),
219
+ notify: jest.fn(),
220
+ respondProgress: jest.fn(),
221
+ } as unknown as ToolContext;
222
+ Object.assign(tool, ctx);
223
+
224
+ await expect(tool.execute({ city: 'Atlantis', units: 'celsius' })).rejects.toThrow(
225
+ 'Weather API error: 404 Not Found',
226
+ );
227
+
228
+ expect(failFn).toHaveBeenCalled();
229
+ });
230
+ });
231
+ ```
232
+
233
+ ---
234
+
235
+ ## E2E Test: Weather Server
236
+
237
+ ```typescript
238
+ // test/weather.e2e.spec.ts
239
+ import { McpTestClient, TestServer } from '@frontmcp/testing';
240
+ import Server from '../src/main';
241
+
242
+ describe('Weather Server E2E', () => {
243
+ let client: McpTestClient;
244
+ let server: TestServer;
245
+
246
+ beforeAll(async () => {
247
+ server = await TestServer.start({ command: 'npx tsx src/main.ts' });
248
+ client = await McpTestClient.create({ baseUrl: server.info.baseUrl }).buildAndConnect();
249
+ });
250
+
251
+ afterAll(async () => {
252
+ await client.disconnect();
253
+ await server.stop();
254
+ });
255
+
256
+ it('should list tools including get_weather', async () => {
257
+ const { tools } = await client.listTools();
258
+
259
+ expect(tools.length).toBeGreaterThan(0);
260
+ expect(tools).toContainTool('get_weather');
261
+ });
262
+
263
+ it('should call get_weather with a valid city', async () => {
264
+ const result = await client.callTool('get_weather', {
265
+ city: 'London',
266
+ units: 'celsius',
267
+ });
268
+
269
+ expect(result).toBeSuccessful();
270
+ expect(result.content[0].text).toBeDefined();
271
+
272
+ const parsed = JSON.parse(result.content[0].text);
273
+ expect(parsed).toHaveProperty('temperature');
274
+ expect(parsed).toHaveProperty('condition');
275
+ expect(parsed).toHaveProperty('humidity');
276
+ expect(parsed).toHaveProperty('city', 'London');
277
+ });
278
+
279
+ it('should read the cities resource', async () => {
280
+ const { resources } = await client.listResources();
281
+ const citiesResource = resources.find((r) => r.uri === 'weather://cities');
282
+ expect(citiesResource).toBeDefined();
283
+
284
+ const result = await client.readResource('weather://cities');
285
+ const cities = JSON.parse(result.contents[0].text);
286
+
287
+ expect(Array.isArray(cities)).toBe(true);
288
+ expect(cities).toContain('London');
289
+ expect(cities).toContain('Tokyo');
290
+ });
291
+ });
292
+ ```
@@ -0,0 +1,253 @@
1
+ ---
2
+ name: frontmcp-production-readiness
3
+ description: 'Pre-production audit and checklist for FrontMCP servers. Use before go-live to verify security hardening, performance checks, observability, monitoring, and health checks. Triggers: production ready, security audit, performance check, production checklist, hardening, go live.'
4
+ tags: [production, security, performance, reliability, observability, audit, best-practices]
5
+ category: production
6
+ targets: [all]
7
+ bundle: [recommended, full]
8
+ priority: 10
9
+ visibility: both
10
+ license: Apache-2.0
11
+ metadata:
12
+ docs: https://docs.agentfront.dev/frontmcp/production/overview
13
+ ---
14
+
15
+ # FrontMCP Production Readiness Audit
16
+
17
+ Comprehensive audit skill for preparing FrontMCP servers for production deployment. Reviews security, performance, reliability, observability, and deployment configuration.
18
+
19
+ ## When to Use This Skill
20
+
21
+ ### Must Use
22
+
23
+ - Before deploying a FrontMCP server to production for the first time
24
+ - After major feature additions or architectural changes
25
+ - During security reviews or compliance audits
26
+ - When troubleshooting production issues (performance, crashes, security incidents)
27
+
28
+ ### Recommended
29
+
30
+ - As part of PR reviews for infrastructure-touching changes
31
+ - Quarterly health checks on production deployments
32
+ - When onboarding new team members to understand production requirements
33
+
34
+ ### Skip When
35
+
36
+ - Building a prototype or proof-of-concept (focus on functionality first)
37
+ - Running in development/local mode only
38
+ - The server has no external exposure (purely internal MCP client)
39
+
40
+ > **Decision:** Use this skill when preparing for or auditing a production deployment. Reference `security-checklist` or `performance-checklist` for deep dives into specific areas.
41
+
42
+ ## Scenario Routing Table
43
+
44
+ | Scenario | Section / Reference | Description |
45
+ | ------------------------------------ | --------------------------- | ---------------------------------------------------------------- |
46
+ | Full production audit before go-live | All sections below | Walk through every checklist |
47
+ | Security-focused audit | `security-checklist` | Auth, CORS, input validation, secrets, rate limiting |
48
+ | Performance optimization | `performance-checklist` | Caching, connection pooling, response optimization, memory leaks |
49
+ | Reliability and error handling | Reliability section below | Error handling, graceful shutdown, health checks, retries |
50
+ | Observability setup | Observability section below | Structured logging, metrics, error tracking |
51
+ | Deployment configuration review | Deployment section below | Docker, env vars, CI/CD, scaling |
52
+
53
+ ## Security Checklist
54
+
55
+ ### Authentication & Authorization
56
+
57
+ - [ ] JWT_SECRET is set to a strong random value (not the default)
58
+ - [ ] Authentication is enabled (`auth` config in `@FrontMcp` or `@frontmcp/auth`)
59
+ - [ ] API keys/tokens are loaded from environment variables, never hardcoded
60
+ - [ ] Session storage uses Redis (not in-memory) for multi-instance deployments
61
+ - [ ] Session TTL is configured appropriately (not infinite)
62
+ - [ ] Tool-level authorization is enforced where needed (ApprovalPlugin or custom)
63
+ - [ ] OAuth redirect URIs are restricted to known domains
64
+
65
+ ### CORS Configuration
66
+
67
+ - [ ] CORS is NOT permissive (don't allow all origins in production)
68
+ - [ ] Specific allowed origins are listed: `cors: { origin: ['https://your-app.com'] }`
69
+ - [ ] Credentials mode is only enabled if cookies/sessions are needed
70
+ - [ ] Preflight cache (`maxAge`) is set to reduce OPTIONS requests
71
+
72
+ ### Input Validation
73
+
74
+ - [ ] All tool inputs use Zod schemas (never trust raw input)
75
+ - [ ] All tool outputs use `outputSchema` to prevent data leaks
76
+ - [ ] Path parameters and query params are validated
77
+ - [ ] File paths are sanitized to prevent directory traversal
78
+ - [ ] SQL queries use parameterized statements (never string interpolation)
79
+
80
+ ### Secrets Management
81
+
82
+ - [ ] No secrets in source code or git history
83
+ - [ ] `.env` files are in `.gitignore`
84
+ - [ ] Production secrets are managed via secret manager (AWS SSM, Vault, etc.)
85
+ - [ ] API keys have minimum required permissions
86
+ - [ ] Secrets are rotated on a schedule
87
+
88
+ ### Rate Limiting & Abuse Prevention
89
+
90
+ - [ ] Rate limiting is configured for public-facing endpoints
91
+ - [ ] Per-client/per-IP limits are set
92
+ - [ ] Throttle configuration uses `@FrontMcp({ throttle: {...} })`
93
+ - [ ] Large payload limits are set to prevent memory exhaustion
94
+
95
+ ### Dependency Security
96
+
97
+ - [ ] `npm audit` or `yarn audit` shows no high/critical vulnerabilities
98
+ - [ ] Dependencies are pinned or use tilde ranges (not `*` or `latest`)
99
+ - [ ] No unused dependencies in package.json
100
+
101
+ ## Performance Checklist
102
+
103
+ ### Caching
104
+
105
+ - [ ] CachePlugin is configured for read-heavy tools
106
+ - [ ] Cache TTL is tuned per tool (not one-size-fits-all)
107
+ - [ ] Cache uses Redis in production (not in-memory)
108
+ - [ ] Cache bypass header is configured for debugging
109
+ - [ ] Stale cache invalidation strategy is defined
110
+
111
+ ### Connection Management
112
+
113
+ - [ ] Redis connection pooling is configured (not one connection per request)
114
+ - [ ] Database connections use connection pools
115
+ - [ ] HTTP client connections use keep-alive
116
+ - [ ] Connection timeouts are set (don't hang indefinitely)
117
+
118
+ ### Response Optimization
119
+
120
+ - [ ] Large responses are paginated or streamed
121
+ - [ ] Tools return only necessary data (no over-fetching)
122
+ - [ ] OpenAPI adapter responses are not unnecessarily large
123
+ - [ ] Binary data uses proper encoding (base64 only when necessary)
124
+
125
+ ### Memory Management
126
+
127
+ - [ ] No memory leaks from event listeners or unclosed connections
128
+ - [ ] Large data processing uses streams instead of buffering
129
+ - [ ] Provider lifecycle `dispose()` is implemented for cleanup
130
+ - [ ] Session storage has TTL to prevent unbounded growth
131
+
132
+ ### Startup Performance
133
+
134
+ - [ ] Server startup time is acceptable (< 5s for most apps)
135
+ - [ ] Lazy-load expensive dependencies (ML models, large configs)
136
+ - [ ] OpenAPI spec fetching uses caching and doesn't block startup
137
+
138
+ ## Reliability Checklist
139
+
140
+ ### Error Handling
141
+
142
+ - [ ] All tools use `this.fail()` with specific MCP error classes
143
+ - [ ] Unknown errors are caught and wrapped (never expose stack traces)
144
+ - [ ] Error responses include MCP error codes for client handling
145
+ - [ ] Async errors are properly caught (no unhandled promise rejections)
146
+
147
+ ### Graceful Shutdown
148
+
149
+ - [ ] SIGTERM handler is configured for clean shutdown
150
+ - [ ] In-flight requests complete before process exit
151
+ - [ ] Redis/database connections are closed on shutdown
152
+ - [ ] Health check returns unhealthy during shutdown drain
153
+
154
+ ### Health Checks
155
+
156
+ - [ ] `/health` endpoint is implemented and monitored
157
+ - [ ] Health check verifies downstream dependencies (Redis, databases)
158
+ - [ ] Readiness probe is separate from liveness probe (K8s)
159
+ - [ ] Health check doesn't perform expensive operations
160
+
161
+ ### Retry & Circuit Breaking
162
+
163
+ - [ ] External API calls have retry logic with exponential backoff
164
+ - [ ] Circuit breaker pattern for unreliable downstream services
165
+ - [ ] Timeouts are set for all external calls
166
+ - [ ] Job retries have maximum attempt limits
167
+
168
+ ## Observability Checklist
169
+
170
+ ### Structured Logging
171
+
172
+ - [ ] Logs use structured format (JSON in production)
173
+ - [ ] Log levels are appropriate (info for normal, error for failures)
174
+ - [ ] Sensitive data is redacted from logs (tokens, passwords, PII)
175
+ - [ ] Request/response logging includes correlation IDs
176
+ - [ ] Log volume is manageable (not logging every request body)
177
+
178
+ ### Metrics
179
+
180
+ - [ ] Request count and latency metrics are exposed
181
+ - [ ] Error rate metrics are tracked
182
+ - [ ] Tool execution duration is measured
183
+ - [ ] Resource utilization (memory, CPU) is monitored
184
+
185
+ ### Error Tracking
186
+
187
+ - [ ] Unhandled errors are captured and reported
188
+ - [ ] Error tracking service is integrated (Sentry, Datadog, etc.)
189
+ - [ ] Error alerts are configured for critical failures
190
+ - [ ] Error context includes tool name, input summary, and user context
191
+
192
+ ## Deployment Checklist
193
+
194
+ ### Docker & Containers
195
+
196
+ - [ ] Dockerfile uses multi-stage build (separate build and runtime stages)
197
+ - [ ] Base image is minimal (node:slim, not full node image)
198
+ - [ ] Non-root user is configured in the container
199
+ - [ ] `.dockerignore` excludes dev files, node_modules, .git
200
+ - [ ] Container health check is defined
201
+ - [ ] Resource limits (memory, CPU) are set in deployment config
202
+
203
+ ### Environment Configuration
204
+
205
+ - [ ] `NODE_ENV=production` is set
206
+ - [ ] All required env vars are documented in `.env.example`
207
+ - [ ] Env vars are validated at startup (fail fast on missing config)
208
+ - [ ] Port binding uses `process.env.PORT` for platform compatibility
209
+ - [ ] No dev dependencies are installed in production (`npm install --production`)
210
+
211
+ ### CI/CD Pipeline
212
+
213
+ - [ ] Tests run on every PR (unit + E2E)
214
+ - [ ] Build step produces optimized output (`frontmcp build`)
215
+ - [ ] Docker image is built and pushed automatically
216
+ - [ ] Deployment is automated with rollback capability
217
+ - [ ] Database migrations run as separate step (not in server startup)
218
+
219
+ ### Scaling
220
+
221
+ - [ ] Server is stateless (session state in Redis, not memory)
222
+ - [ ] Multiple instances can run behind a load balancer
223
+ - [ ] WebSocket/SSE connections are handled by sticky sessions or Redis pub/sub
224
+ - [ ] Auto-scaling is configured based on CPU/memory/request metrics
225
+
226
+ ## Common Anti-Patterns
227
+
228
+ | Anti-Pattern | Why It's Bad | Fix |
229
+ | ------------------------- | -------------------------------------------- | ------------------------------------------- |
230
+ | Default JWT_SECRET | Anyone can forge tokens | Set a strong random secret |
231
+ | In-memory session store | Lost on restart, not shared across instances | Use Redis |
232
+ | `cors: { origin: '*' }` | Any website can call your server | Restrict to known origins |
233
+ | No output schema on tools | May leak internal data | Always define `outputSchema` |
234
+ | Synchronous file I/O | Blocks event loop | Use async operations from `@frontmcp/utils` |
235
+ | Hardcoded secrets | Committed to git, visible in source | Use environment variables |
236
+ | No health check | Can't detect unhealthy instances | Implement `/health` endpoint |
237
+ | Unbounded caching | Memory grows forever | Set TTL on all caches |
238
+
239
+ ## Verification Checklist
240
+
241
+ After completing this audit:
242
+
243
+ 1. Run `frontmcp doctor` to check project configuration
244
+ 2. Run `frontmcp test` to ensure all tests pass
245
+ 3. Run `frontmcp build` to verify production build succeeds
246
+ 4. Deploy to staging and run E2E tests against it
247
+ 5. Review logs for any warnings or errors during startup
248
+ 6. Load test with expected production traffic patterns
249
+
250
+ ## Reference
251
+
252
+ - [FrontMCP Production Guide](https://docs.agentfront.dev/frontmcp/production)
253
+ - Related skills: `frontmcp-config`, `frontmcp-deployment`, `frontmcp-testing`
@@ -0,0 +1,130 @@
1
+ ---
2
+ name: frontmcp-setup
3
+ description: "Domain router for project setup, scaffolding, and organization. Use this skill whenever someone asks to create a new FrontMCP project, set up an Nx monorepo, configure Redis or SQLite storage, organize project structure, compose multiple apps into one server, or manage the skills system. Also triggers for questions like 'how do I start', 'project layout', 'folder structure', 'add redis', 'set up database', or 'create a new app'."
4
+ tags: [router, setup, scaffold, project, nx, redis, sqlite, structure, guide]
5
+ category: setup
6
+ targets: [all]
7
+ bundle: [recommended, minimal, full]
8
+ priority: 10
9
+ visibility: both
10
+ license: Apache-2.0
11
+ metadata:
12
+ docs: https://docs.agentfront.dev/frontmcp/getting-started/quickstart
13
+ ---
14
+
15
+ # FrontMCP Setup Router
16
+
17
+ Entry point for project setup and scaffolding. This skill helps you find the right setup guide based on your project needs — from initial scaffolding to storage backends, project structure, and multi-app composition.
18
+
19
+ ## When to Use This Skill
20
+
21
+ ### Must Use
22
+
23
+ - Starting a new FrontMCP project from scratch and need to choose between standalone vs Nx monorepo
24
+ - Setting up storage backends (Redis, SQLite) for session or state management
25
+ - Organizing an existing project and need canonical directory layout guidance
26
+
27
+ ### Recommended
28
+
29
+ - Onboarding to the FrontMCP project structure and naming conventions
30
+ - Setting up multi-app composition within a single server
31
+ - Understanding the skills system and how to browse, install, and manage skills
32
+
33
+ ### Skip When
34
+
35
+ - You need to build specific components like tools or resources (see `frontmcp-development`)
36
+ - You need to configure transport, auth, or throttling (see `frontmcp-config`)
37
+ - You need to deploy or build for a target platform (see `frontmcp-deployment`)
38
+
39
+ > **Decision:** Use this skill when you need to CREATE or ORGANIZE a project. Use other routers when you need to build, configure, deploy, or test.
40
+
41
+ ## Prerequisites
42
+
43
+ - Node.js 24+ and npm/yarn installed
44
+ - `frontmcp` CLI available globally (`npm install -g frontmcp`)
45
+
46
+ ## Steps
47
+
48
+ 1. Use the Scenario Routing Table below to find the right setup guide for your task
49
+ 2. Scaffold your project with `frontmcp create` (standalone) or `frontmcp create --nx` (monorepo)
50
+ 3. Configure storage and project structure per the relevant reference files
51
+ 4. Follow the Recommended Reading Order for a complete setup walkthrough
52
+
53
+ ## Scenario Routing Table
54
+
55
+ | Scenario | Reference | Description |
56
+ | --------------------------------------------- | -------------------------------------------- | ---------------------------------------------------------------------- |
57
+ | Scaffold a new project with `frontmcp create` | `references/setup-project.md` | CLI scaffolder, manual setup, deployment-specific config |
58
+ | Organize a standalone (non-Nx) project | `references/project-structure-standalone.md` | File layout, naming conventions (`<name>.<type>.ts`), folder hierarchy |
59
+ | Organize an Nx monorepo | `references/project-structure-nx.md` | apps/, libs/, servers/ layout, generators, dependency rules |
60
+ | Set up Redis for production storage | `references/setup-redis.md` | Docker Redis, Vercel KV, pub/sub for subscriptions |
61
+ | Set up SQLite for local development | `references/setup-sqlite.md` | WAL mode, migration helpers, encryption |
62
+ | Compose multiple apps into one server | `references/multi-app-composition.md` | `@FrontMcp` with multiple `@App` classes, cross-app providers |
63
+ | Use Nx build, test, and CI commands | `references/nx-workflow.md` | `nx build`, `nx test`, `nx run-many`, caching, affected commands |
64
+ | Browse, install, and manage skills | `references/frontmcp-skills-usage.md` | CLI commands, bundles, categories, search |
65
+
66
+ ## Recommended Reading Order
67
+
68
+ 1. **`references/setup-project.md`** — Start here for any new project
69
+ 2. **`references/project-structure-standalone.md`** or **`references/project-structure-nx.md`** — Choose your layout
70
+ 3. **`references/setup-redis.md`** or **`references/setup-sqlite.md`** — Add storage if needed
71
+ 4. **`references/multi-app-composition.md`** — Scale to multiple apps (when needed)
72
+ 5. **`references/nx-workflow.md`** — Nx-specific build and CI commands (if using Nx)
73
+ 6. **`references/frontmcp-skills-usage.md`** — Learn the skills system
74
+
75
+ ## Cross-Cutting Patterns
76
+
77
+ | Pattern | Rule |
78
+ | -------------- | -------------------------------------------------------------------------------- |
79
+ | Project type | Standalone for single-app projects; Nx for multi-app or team projects |
80
+ | File naming | `<name>.<type>.ts` (e.g., `fetch-weather.tool.ts`) everywhere |
81
+ | Test naming | `.spec.ts` extension (not `.test.ts`) |
82
+ | Entry point | `main.ts` must `export default` the `@FrontMcp` class |
83
+ | Storage choice | Redis for production/serverless; SQLite for local dev/CLI; memory for tests only |
84
+ | App boundaries | Each `@App` is a self-contained module; shared logic goes in providers |
85
+
86
+ ## Common Patterns
87
+
88
+ | Pattern | Correct | Incorrect | Why |
89
+ | --------------------- | ----------------------------------------------- | -------------------------------------------- | ----------------------------------------------------------------- |
90
+ | Project scaffolding | `frontmcp create` or `frontmcp create --nx` | Manual setup from scratch | CLI sets up correct structure, dependencies, and config files |
91
+ | Entry point | `export default class MyServer` in `main.ts` | Named export or no default export | FrontMCP loads the default export at startup |
92
+ | Storage in production | Redis or platform-native (Vercel KV, DynamoDB) | Memory store or SQLite | Memory is lost on restart; SQLite doesn't work on serverless |
93
+ | Multi-app composition | Separate `@App` classes composed in `@FrontMcp` | One giant `@App` with all components | Separate apps enable independent testing and modular architecture |
94
+ | File organization | Feature folders for 10+ components | Flat `tools/` directory with dozens of files | Feature folders make domain boundaries visible |
95
+
96
+ ## Verification Checklist
97
+
98
+ ### Project Structure
99
+
100
+ - [ ] `main.ts` exists with `export default` of `@FrontMcp` class
101
+ - [ ] At least one `@App` class registered in the server
102
+ - [ ] Files follow `<name>.<type>.ts` naming convention
103
+ - [ ] Test files use `.spec.ts` extension
104
+
105
+ ### Storage
106
+
107
+ - [ ] Storage backend chosen and configured (Redis/SQLite/memory)
108
+ - [ ] Connection string in environment variables, not hardcoded
109
+ - [ ] Storage accessible from the server process
110
+
111
+ ### Build and Dev
112
+
113
+ - [ ] `frontmcp dev` starts successfully with file watching
114
+ - [ ] `frontmcp build --target <target>` completes without errors
115
+ - [ ] Tests pass with `frontmcp test` or `nx test`
116
+
117
+ ## Troubleshooting
118
+
119
+ | Problem | Cause | Solution |
120
+ | ------------------------ | -------------------------------- | --------------------------------------------------------------------- |
121
+ | `frontmcp create` fails | Missing Node.js 24+ or npm/yarn | Install Node.js 24+ and ensure npm/yarn is available |
122
+ | Server fails to start | `main.ts` missing default export | Add `export default MyServerClass` to `main.ts` |
123
+ | Redis connection refused | Redis not running or wrong URL | Start Redis (`docker compose up redis`) or fix `REDIS_URL` env var |
124
+ | Nx generator not found | `@frontmcp/nx` not installed | Run `npm install -D @frontmcp/nx` |
125
+ | Skills not loading | Skills placed in wrong directory | Catalog skills go in top-level `skills/`, app skills in `src/skills/` |
126
+
127
+ ## Reference
128
+
129
+ - [Getting Started](https://docs.agentfront.dev/frontmcp/getting-started/quickstart)
130
+ - Domain routers: `frontmcp-development`, `frontmcp-deployment`, `frontmcp-testing`, `frontmcp-config`, `frontmcp-guides`