@frontmcp/skills 0.0.1 → 1.0.0-beta.9

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 (84) hide show
  1. package/catalog/TEMPLATE.md +58 -13
  2. package/catalog/frontmcp-config/SKILL.md +140 -0
  3. package/catalog/frontmcp-config/references/configure-auth.md +238 -0
  4. package/catalog/frontmcp-config/references/configure-elicitation.md +178 -0
  5. package/catalog/frontmcp-config/references/configure-http.md +205 -0
  6. package/catalog/frontmcp-config/references/configure-session.md +205 -0
  7. package/catalog/frontmcp-config/references/configure-throttle.md +229 -0
  8. package/catalog/frontmcp-config/references/configure-transport.md +195 -0
  9. package/catalog/frontmcp-config/references/setup-redis.md +4 -0
  10. package/catalog/frontmcp-config/references/setup-sqlite.md +4 -0
  11. package/catalog/frontmcp-deployment/SKILL.md +124 -0
  12. package/catalog/frontmcp-deployment/references/build-for-browser.md +138 -0
  13. package/catalog/frontmcp-deployment/references/build-for-cli.md +138 -0
  14. package/catalog/{deployment/build-for-sdk/SKILL.md → frontmcp-deployment/references/build-for-sdk.md} +65 -24
  15. package/catalog/frontmcp-deployment/references/deploy-to-cloudflare.md +213 -0
  16. package/catalog/{deployment/deploy-to-lambda/SKILL.md → frontmcp-deployment/references/deploy-to-lambda.md} +73 -60
  17. package/catalog/{deployment/deploy-to-node/references/Dockerfile.example → frontmcp-deployment/references/deploy-to-node-dockerfile.md} +11 -2
  18. package/catalog/{deployment/deploy-to-node/SKILL.md → frontmcp-deployment/references/deploy-to-node.md} +65 -37
  19. package/catalog/frontmcp-deployment/references/deploy-to-vercel-config.md +60 -0
  20. package/catalog/frontmcp-deployment/references/deploy-to-vercel.md +224 -0
  21. package/catalog/frontmcp-development/SKILL.md +118 -0
  22. package/catalog/frontmcp-development/references/create-adapter.md +165 -0
  23. package/catalog/{development/create-agent/references/llm-config.md → frontmcp-development/references/create-agent-llm-config.md} +5 -5
  24. package/catalog/{development/create-agent/SKILL.md → frontmcp-development/references/create-agent.md} +82 -44
  25. package/catalog/{development/create-job/SKILL.md → frontmcp-development/references/create-job.md} +61 -19
  26. package/catalog/{plugins/create-plugin-hooks/SKILL.md → frontmcp-development/references/create-plugin-hooks.md} +63 -11
  27. package/catalog/{plugins/create-plugin/SKILL.md → frontmcp-development/references/create-plugin.md} +65 -60
  28. package/catalog/{development/create-prompt/SKILL.md → frontmcp-development/references/create-prompt.md} +62 -26
  29. package/catalog/{development/create-provider/SKILL.md → frontmcp-development/references/create-provider.md} +62 -27
  30. package/catalog/{development/create-resource/SKILL.md → frontmcp-development/references/create-resource.md} +62 -30
  31. package/catalog/{development/create-skill-with-tools/SKILL.md → frontmcp-development/references/create-skill-with-tools.md} +69 -24
  32. package/catalog/{development/create-skill/SKILL.md → frontmcp-development/references/create-skill.md} +71 -20
  33. package/catalog/{development/create-tool/SKILL.md → frontmcp-development/references/create-tool.md} +62 -26
  34. package/catalog/{development/create-workflow/SKILL.md → frontmcp-development/references/create-workflow.md} +60 -18
  35. package/catalog/{development/decorators-guide/SKILL.md → frontmcp-development/references/decorators-guide.md} +123 -34
  36. package/catalog/frontmcp-development/references/official-adapters.md +194 -0
  37. package/catalog/{plugins/official-plugins/SKILL.md → frontmcp-development/references/official-plugins.md} +68 -22
  38. package/catalog/frontmcp-guides/SKILL.md +417 -0
  39. package/catalog/frontmcp-guides/references/example-knowledge-base.md +636 -0
  40. package/catalog/frontmcp-guides/references/example-task-manager.md +512 -0
  41. package/catalog/frontmcp-guides/references/example-weather-api.md +292 -0
  42. package/catalog/frontmcp-setup/SKILL.md +127 -0
  43. package/catalog/frontmcp-setup/references/frontmcp-skills-usage.md +265 -0
  44. package/catalog/{setup/multi-app-composition/SKILL.md → frontmcp-setup/references/multi-app-composition.md} +65 -23
  45. package/catalog/{setup/nx-workflow/SKILL.md → frontmcp-setup/references/nx-workflow.md} +78 -21
  46. package/catalog/frontmcp-setup/references/project-structure-nx.md +246 -0
  47. package/catalog/frontmcp-setup/references/project-structure-standalone.md +212 -0
  48. package/catalog/{setup/setup-project/SKILL.md → frontmcp-setup/references/setup-project.md} +62 -62
  49. package/catalog/{setup/setup-redis/SKILL.md → frontmcp-setup/references/setup-redis.md} +59 -86
  50. package/catalog/{setup/setup-sqlite/SKILL.md → frontmcp-setup/references/setup-sqlite.md} +64 -76
  51. package/catalog/frontmcp-testing/SKILL.md +121 -0
  52. package/catalog/{testing/setup-testing/SKILL.md → frontmcp-testing/references/setup-testing.md} +78 -67
  53. package/catalog/{testing/setup-testing → frontmcp-testing}/references/test-tool-unit.md +1 -0
  54. package/catalog/skills-manifest.json +34 -383
  55. package/package.json +1 -1
  56. package/src/manifest.d.ts +3 -3
  57. package/src/manifest.js +1 -3
  58. package/src/manifest.js.map +1 -1
  59. package/catalog/adapters/create-adapter/SKILL.md +0 -127
  60. package/catalog/adapters/official-adapters/SKILL.md +0 -136
  61. package/catalog/auth/configure-auth/SKILL.md +0 -250
  62. package/catalog/auth/configure-session/SKILL.md +0 -201
  63. package/catalog/config/configure-elicitation/SKILL.md +0 -136
  64. package/catalog/config/configure-http/SKILL.md +0 -167
  65. package/catalog/config/configure-throttle/SKILL.md +0 -189
  66. package/catalog/config/configure-transport/SKILL.md +0 -151
  67. package/catalog/deployment/build-for-browser/SKILL.md +0 -95
  68. package/catalog/deployment/build-for-cli/SKILL.md +0 -100
  69. package/catalog/deployment/deploy-to-cloudflare/SKILL.md +0 -192
  70. package/catalog/deployment/deploy-to-vercel/SKILL.md +0 -196
  71. package/catalog/deployment/deploy-to-vercel/references/vercel.json.example +0 -60
  72. package/catalog/setup/frontmcp-skills-usage/SKILL.md +0 -200
  73. package/catalog/setup/project-structure-nx/SKILL.md +0 -186
  74. package/catalog/setup/project-structure-standalone/SKILL.md +0 -153
  75. /package/catalog/{auth/configure-auth/references/auth-modes.md → frontmcp-config/references/configure-auth-modes.md} +0 -0
  76. /package/catalog/{config/configure-throttle/references/guard-config.md → frontmcp-config/references/configure-throttle-guard-config.md} +0 -0
  77. /package/catalog/{config/configure-transport/references/protocol-presets.md → frontmcp-config/references/configure-transport-protocol-presets.md} +0 -0
  78. /package/catalog/{development/create-tool/references/tool-annotations.md → frontmcp-development/references/create-tool-annotations.md} +0 -0
  79. /package/catalog/{development/create-tool/references/output-schema-types.md → frontmcp-development/references/create-tool-output-schema-types.md} +0 -0
  80. /package/catalog/{testing/setup-testing → frontmcp-testing}/references/test-auth.md +0 -0
  81. /package/catalog/{testing/setup-testing → frontmcp-testing}/references/test-browser-build.md +0 -0
  82. /package/catalog/{testing/setup-testing → frontmcp-testing}/references/test-cli-binary.md +0 -0
  83. /package/catalog/{testing/setup-testing → frontmcp-testing}/references/test-direct-client.md +0 -0
  84. /package/catalog/{testing/setup-testing → frontmcp-testing}/references/test-e2e-handler.md +0 -0
@@ -0,0 +1,417 @@
1
+ ---
2
+ name: frontmcp-guides
3
+ description: 'End-to-end examples and best practices for building FrontMCP MCP servers. Use when starting a new project from scratch, learning architectural patterns, or following a complete build walkthrough.'
4
+ tags: [guides, examples, best-practices, architecture, walkthrough, end-to-end]
5
+ priority: 10
6
+ visibility: both
7
+ license: Apache-2.0
8
+ metadata:
9
+ docs: https://docs.agentfront.dev/frontmcp/guides/overview
10
+ examples:
11
+ - scenario: Build a simple weather API MCP server from scratch
12
+ expected-outcome: Working server with tools, resources, and tests deployed to Node
13
+ - scenario: Build a task manager with auth, Redis, and multi-tool patterns
14
+ expected-outcome: Authenticated server with CRUD tools, session storage, and E2E tests
15
+ - scenario: Build a multi-app knowledge base with agents and plugins
16
+ expected-outcome: Composed server with multiple apps, AI agents, caching, and Vercel deployment
17
+ ---
18
+
19
+ # FrontMCP End-to-End Guides
20
+
21
+ Complete build walkthroughs and best practices for FrontMCP servers. Each example starts from an empty directory and ends with a deployed, tested server. Every pattern references the specific skill that teaches it.
22
+
23
+ ## When to Use This Skill
24
+
25
+ ### Must Use
26
+
27
+ - Starting a new FrontMCP project from scratch and want a complete walkthrough to follow
28
+ - Learning FrontMCP architecture by building progressively complex real examples
29
+ - Need to see how multiple skills work together in a complete application
30
+
31
+ ### Recommended
32
+
33
+ - Planning a new project and want to see how similar architectures are structured
34
+ - Onboarding a team member who learns best from complete working examples
35
+ - Reviewing best practices for file organization, naming, and code patterns
36
+
37
+ ### Skip When
38
+
39
+ - You need to learn one specific component type (use the specific skill, e.g., `create-tool`)
40
+ - Looking for the right skill for a task (use domain routers: `frontmcp-development`, `frontmcp-deployment`, etc.)
41
+ - You need CLI/install instructions for the skills system (see `frontmcp-skills-usage`)
42
+
43
+ > **Decision:** Use this skill when you want to see how everything fits together. Use individual skills when you need focused instruction.
44
+
45
+ ## Prerequisites
46
+
47
+ - Node.js 22+ and npm/yarn installed
48
+ - Familiarity with TypeScript and decorators
49
+ - `frontmcp` CLI available globally (`npm install -g frontmcp`)
50
+
51
+ ## Steps
52
+
53
+ 1. Choose an example that matches your project's complexity level (Beginner, Intermediate, Advanced)
54
+ 2. Work through the Planning Checklist to define your project's scope
55
+ 3. Follow the example code and architecture, referencing individual skills for deeper guidance
56
+ 4. Verify your implementation using the Verification Checklist at the end of this skill
57
+
58
+ ## Planning Checklist
59
+
60
+ Before writing any code, answer these questions:
61
+
62
+ ### 1. What does the server do?
63
+
64
+ - What tools does it expose? (actions AI clients can call)
65
+ - What resources does it expose? (data AI clients can read)
66
+ - What prompts does it expose? (conversation templates)
67
+
68
+ ### 2. How is it organized?
69
+
70
+ - Single app or multiple apps? (see `multi-app-composition`)
71
+ - Standalone project or Nx monorepo? (see `project-structure-standalone`, `project-structure-nx`)
72
+
73
+ ### 3. How is it secured?
74
+
75
+ - Public (no auth), transparent (passthrough), local (self-contained), or remote (OAuth)? (see `configure-auth`)
76
+ - What session storage? Memory (dev), Redis (prod), Vercel KV (serverless)? (see `configure-session`)
77
+
78
+ ### 4. Where does it deploy?
79
+
80
+ - Node, Vercel, Lambda, Cloudflare, CLI, browser, or SDK? (see `frontmcp-deployment`)
81
+ - What transport? stdio (local), SSE (streaming), Streamable HTTP (stateless)? (see `configure-transport`)
82
+
83
+ ### 5. How is it tested?
84
+
85
+ - Unit tests for each component (see `setup-testing`)
86
+ - E2E tests for protocol-level flows
87
+ - Coverage target: 95%+
88
+
89
+ ---
90
+
91
+ ## Example 1: Weather API (Beginner)
92
+
93
+ **Skills used:** `setup-project`, `create-tool`, `create-resource`, `setup-testing`, `deploy-to-node`
94
+
95
+ A simple MCP server that exposes a weather lookup tool and a resource for supported cities.
96
+
97
+ ### Architecture
98
+
99
+ ```text
100
+ weather-api/
101
+ ├── src/
102
+ │ ├── main.ts # @FrontMcp server (deploy-to-node)
103
+ │ ├── weather.app.ts # @App with tools and resources
104
+ │ ├── tools/
105
+ │ │ └── get-weather.tool.ts # @Tool: fetch weather by city (create-tool)
106
+ │ └── resources/
107
+ │ └── cities.resource.ts # @Resource: list supported cities (create-resource)
108
+ ├── test/
109
+ │ ├── get-weather.tool.spec.ts # Unit tests (setup-testing)
110
+ │ └── weather.e2e.spec.ts # E2E protocol test (setup-testing)
111
+ └── package.json
112
+ ```
113
+
114
+ ### Key Code
115
+
116
+ **Server entry point** (`setup-project`):
117
+
118
+ ```typescript
119
+ import { FrontMcp } from '@frontmcp/sdk';
120
+ import { WeatherApp } from './weather.app';
121
+
122
+ @FrontMcp({
123
+ info: { name: 'weather-api', version: '1.0.0' },
124
+ apps: [WeatherApp],
125
+ })
126
+ export default class WeatherServer {}
127
+ ```
128
+
129
+ **Tool** (`create-tool`):
130
+
131
+ ```typescript
132
+ import { Tool, ToolContext } from '@frontmcp/sdk';
133
+ import { z } from 'zod';
134
+
135
+ @Tool({
136
+ name: 'get_weather',
137
+ description: 'Get current weather for a city',
138
+ inputSchema: {
139
+ city: z.string().min(1).describe('City name'),
140
+ },
141
+ outputSchema: {
142
+ temperature: z.number(),
143
+ condition: z.string(),
144
+ humidity: z.number(),
145
+ },
146
+ })
147
+ export class GetWeatherTool extends ToolContext {
148
+ async execute(input: { city: string }) {
149
+ const city = encodeURIComponent(input.city);
150
+ const data = await this.fetch(`https://api.weather.example.com/v1?city=${city}`);
151
+ const json = await data.json();
152
+ return { temperature: json.temp, condition: json.condition, humidity: json.humidity };
153
+ }
154
+ }
155
+ ```
156
+
157
+ **Resource** (`create-resource`):
158
+
159
+ ```typescript
160
+ import { Resource, ResourceContext } from '@frontmcp/sdk';
161
+
162
+ @Resource({
163
+ uri: 'weather://cities',
164
+ name: 'Supported Cities',
165
+ description: 'List of cities with weather data',
166
+ mimeType: 'application/json',
167
+ })
168
+ export class CitiesResource extends ResourceContext {
169
+ async read() {
170
+ return JSON.stringify(['London', 'Tokyo', 'New York', 'Paris', 'Sydney']);
171
+ }
172
+ }
173
+ ```
174
+
175
+ > **Full working code:** See `references/example-weather-api.md`
176
+
177
+ ---
178
+
179
+ ## Example 2: Task Manager (Intermediate)
180
+
181
+ **Skills used:** `setup-project`, `create-tool`, `create-provider`, `configure-auth`, `configure-session`, `setup-redis`, `setup-testing`, `deploy-to-vercel`
182
+
183
+ An authenticated task management server with CRUD tools, Redis storage, and OAuth.
184
+
185
+ ### Architecture
186
+
187
+ ```text
188
+ task-manager/
189
+ ├── src/
190
+ │ ├── main.ts # @FrontMcp with auth: { mode: 'remote' }
191
+ │ ├── tasks.app.ts # @App with CRUD tools + provider
192
+ │ ├── providers/
193
+ │ │ └── task-store.provider.ts # @Provider: Redis-backed task storage (create-provider)
194
+ │ ├── tools/
195
+ │ │ ├── create-task.tool.ts # @Tool: create a task (create-tool)
196
+ │ │ ├── list-tasks.tool.ts # @Tool: list tasks (create-tool)
197
+ │ │ ├── update-task.tool.ts # @Tool: update task status (create-tool)
198
+ │ │ └── delete-task.tool.ts # @Tool: delete a task (create-tool)
199
+ │ └── types/
200
+ │ └── task.ts # Shared task interface
201
+ ├── test/
202
+ │ ├── *.spec.ts # Unit tests per tool
203
+ │ └── tasks.e2e.spec.ts # E2E with auth flow
204
+ ├── vercel.json # Vercel config (deploy-to-vercel)
205
+ └── package.json
206
+ ```
207
+
208
+ ### Key Code
209
+
210
+ **Server with auth** (`configure-auth`, `configure-session`, `setup-redis`):
211
+
212
+ ```typescript
213
+ @FrontMcp({
214
+ info: { name: 'task-manager', version: '1.0.0' },
215
+ apps: [TasksApp],
216
+ auth: { mode: 'remote', provider: 'https://auth.example.com', clientId: 'my-client-id' },
217
+ redis: { provider: 'redis', host: process.env.REDIS_URL ?? 'localhost' },
218
+ })
219
+ export default class TaskManagerServer {}
220
+ ```
221
+
222
+ **Provider for shared storage** (`create-provider`):
223
+
224
+ ```typescript
225
+ import { Provider } from '@frontmcp/sdk';
226
+ import type { Token } from '@frontmcp/di';
227
+
228
+ export interface TaskStore {
229
+ create(task: Task): Promise<Task>;
230
+ list(userId: string): Promise<Task[]>;
231
+ update(id: string, data: Partial<Task>): Promise<Task>;
232
+ delete(id: string): Promise<void>;
233
+ }
234
+
235
+ export const TASK_STORE: Token<TaskStore> = Symbol('TaskStore');
236
+
237
+ @Provider({ token: TASK_STORE })
238
+ export class RedisTaskStoreProvider implements TaskStore {
239
+ // Redis-backed implementation
240
+ }
241
+ ```
242
+
243
+ **Tool with DI** (`create-tool` + `create-provider`):
244
+
245
+ ```typescript
246
+ @Tool({
247
+ name: 'create_task',
248
+ description: 'Create a new task',
249
+ inputSchema: {
250
+ title: z.string().min(1).describe('Task title'),
251
+ priority: z.enum(['low', 'medium', 'high']).default('medium'),
252
+ },
253
+ outputSchema: { id: z.string(), title: z.string(), priority: z.string(), status: z.string() },
254
+ })
255
+ export class CreateTaskTool extends ToolContext {
256
+ async execute(input: { title: string; priority: string }) {
257
+ const store = this.get(TASK_STORE);
258
+ return store.create({ title: input.title, priority: input.priority, status: 'pending' });
259
+ }
260
+ }
261
+ ```
262
+
263
+ > **Full working code:** See `references/example-task-manager.md`
264
+
265
+ ---
266
+
267
+ ## Example 3: Knowledge Base (Advanced)
268
+
269
+ **Skills used:** `setup-project`, `multi-app-composition`, `create-tool`, `create-resource`, `create-agent`, `create-skill-with-tools`, `create-plugin`, `official-plugins`, `configure-auth`, `deploy-to-vercel`
270
+
271
+ A multi-app knowledge base with AI-powered search, document ingestion, and an autonomous research agent.
272
+
273
+ ### Architecture
274
+
275
+ ```text
276
+ knowledge-base/
277
+ ├── src/
278
+ │ ├── main.ts # @FrontMcp composing 3 apps
279
+ │ ├── ingestion/
280
+ │ │ ├── ingestion.app.ts # @App: document ingestion
281
+ │ │ ├── tools/ingest-document.tool.ts
282
+ │ │ └── providers/vector-store.provider.ts
283
+ │ ├── search/
284
+ │ │ ├── search.app.ts # @App: search and retrieval
285
+ │ │ ├── tools/search-docs.tool.ts
286
+ │ │ └── resources/doc.resource.ts
287
+ │ ├── research/
288
+ │ │ ├── research.app.ts # @App: AI research agent
289
+ │ │ └── agents/researcher.agent.ts # @Agent: autonomous research loop
290
+ │ └── plugins/
291
+ │ └── audit-log.plugin.ts # @Plugin: audit logging
292
+ ├── test/
293
+ │ └── *.spec.ts
294
+ ├── vercel.json
295
+ └── package.json
296
+ ```
297
+
298
+ ### Key Code
299
+
300
+ **Multi-app composition** (`multi-app-composition`):
301
+
302
+ ```typescript
303
+ @FrontMcp({
304
+ info: { name: 'knowledge-base', version: '1.0.0' },
305
+ apps: [IngestionApp, SearchApp, ResearchApp],
306
+ plugins: [AuditLogPlugin],
307
+ auth: { mode: 'remote', provider: 'https://auth.example.com', clientId: 'my-client-id' },
308
+ redis: { provider: 'redis', host: process.env.REDIS_URL ?? 'localhost' },
309
+ })
310
+ export default class KnowledgeBaseServer {}
311
+ ```
312
+
313
+ **AI Research Agent** (`create-agent`):
314
+
315
+ ```typescript
316
+ @Agent({
317
+ name: 'research_topic',
318
+ description: 'Research a topic across the knowledge base and synthesize findings',
319
+ inputSchema: {
320
+ topic: z.string().describe('Research topic'),
321
+ depth: z.enum(['shallow', 'deep']).default('shallow'),
322
+ },
323
+ llm: {
324
+ provider: 'anthropic',
325
+ model: 'claude-sonnet-4-5',
326
+ apiKey: { env: 'ANTHROPIC_API_KEY' },
327
+ maxTokens: 4096,
328
+ }, // provider and model are client-configurable
329
+ tools: [SearchDocsTool, IngestDocumentTool],
330
+ })
331
+ export class ResearcherAgent extends AgentContext {
332
+ async execute(input: { topic: string; depth: string }) {
333
+ return this.run(
334
+ `Research "${input.topic}" at ${input.depth} depth. Search for relevant documents, synthesize findings, and provide a structured summary.`,
335
+ );
336
+ }
337
+ }
338
+ ```
339
+
340
+ > **Full working code:** See `references/example-knowledge-base.md`
341
+
342
+ ---
343
+
344
+ ## Best Practices
345
+
346
+ ### Planning
347
+
348
+ | Practice | Why | Skill Reference |
349
+ | ------------------------------------------------------ | ----------------------------------------------------------------- | ------------------------------------- |
350
+ | Start with the `@App` boundaries, not individual tools | Apps define module boundaries; tools are implementation details | `multi-app-composition` |
351
+ | Choose auth mode and storage before writing tools | Auth affects session handling, which affects storage requirements | `configure-auth`, `configure-session` |
352
+ | Pick your deployment target early | Target determines transport, storage, and build constraints | `frontmcp-deployment` |
353
+
354
+ ### Organizing Code
355
+
356
+ | Practice | Why | Skill Reference |
357
+ | ------------------------------------------------- | ----------------------------------------------------------- | ------------------------------ |
358
+ | One class per file with `<name>.<type>.ts` naming | Consistency, generator compatibility, clear imports | `project-structure-standalone` |
359
+ | Group by feature, not by type, for 10+ components | Feature folders scale better than flat `tools/` directories | `project-structure-standalone` |
360
+ | Extract shared logic into `@Provider` classes | Testable, lifecycle-managed, injected via DI | `create-provider` |
361
+
362
+ ### Writing Code
363
+
364
+ | Practice | Why | Skill Reference |
365
+ | ----------------------------------------------- | ------------------------------------------------------------- | ----------------- |
366
+ | Always define `outputSchema` on tools | Prevents data leaks, enables CodeCall chaining | `create-tool` |
367
+ | Use `this.fail()` with MCP error classes | Proper error codes in protocol responses | `create-tool` |
368
+ | Use `this.get(TOKEN)` not `this.tryGet(TOKEN)!` | Clear error on missing dependency vs silent null | `create-provider` |
369
+ | Use Zod raw shapes, not `z.object()` | Framework wraps internally; double-wrapping breaks validation | `create-tool` |
370
+
371
+ ## Common Patterns
372
+
373
+ | Pattern | Correct | Incorrect | Why |
374
+ | ----------------- | ------------------------------------------- | ----------------------------------------- | --------------------------------------------------------- |
375
+ | Project start | Plan apps and auth first, then build tools | Jump straight into writing tools | Architecture decisions are expensive to change later |
376
+ | Code organization | Feature folders with `<name>.<type>.ts` | Flat directory with generic names | Scales to large projects and matches generator output |
377
+ | Shared state | `@Provider` with DI token | Module-level singleton or global variable | DI is testable, lifecycle-managed, and scoped per request |
378
+ | Error handling | `this.fail(new ResourceNotFoundError(...))` | `throw new Error('not found')` | MCP error codes enable proper client error handling |
379
+ | Testing | Unit tests per component + E2E for protocol | Only E2E tests or only unit tests | Both layers catch different types of bugs |
380
+
381
+ ## Verification Checklist
382
+
383
+ ### Architecture
384
+
385
+ - [ ] Apps define clear module boundaries with no circular imports
386
+ - [ ] Shared logic extracted into providers, not duplicated across tools
387
+ - [ ] Auth mode and storage chosen before writing tools
388
+
389
+ ### Code Quality
390
+
391
+ - [ ] All tools have `outputSchema` defined
392
+ - [ ] All files follow `<name>.<type>.ts` naming convention
393
+ - [ ] All test files use `.spec.ts` extension
394
+ - [ ] Coverage at 95%+ across all metrics
395
+
396
+ ### Production Readiness
397
+
398
+ - [ ] Secrets stored in environment variables, not source code
399
+ - [ ] Session storage uses Redis/KV in production (not memory)
400
+ - [ ] Rate limiting configured for public-facing tools
401
+ - [ ] E2E tests exercise the full protocol flow
402
+
403
+ ## Troubleshooting
404
+
405
+ | Problem | Cause | Solution |
406
+ | ---------------------------------------- | ------------------------------------------------------ | ------------------------------------------------------------ |
407
+ | Unsure where to start | No project plan | Run through the Planning Checklist above before writing code |
408
+ | Architecture feels wrong | Wrong app boundaries or component types | Review the Scenario Routing Table in `frontmcp-development` |
409
+ | Feature works locally but fails deployed | Environment-specific config (storage, auth, transport) | Check the Target Comparison in `frontmcp-deployment` |
410
+ | Tests pass but coverage below 95% | Missing error path or branch tests | Run `jest --coverage` and add tests for uncovered lines |
411
+ | Provider state leaking between requests | Using module-level state instead of DI | Move state into a `@Provider` scoped per request |
412
+
413
+ ## Reference
414
+
415
+ - [Guides Documentation](https://docs.agentfront.dev/frontmcp/guides/overview)
416
+ - Domain routers: `frontmcp-development`, `frontmcp-deployment`, `frontmcp-testing`, `frontmcp-config`
417
+ - Core skills: `setup-project`, `create-tool`, `create-resource`, `create-provider`, `create-agent`, `configure-auth`, `setup-testing`