@frontmcp/skills 0.0.1 → 1.0.0-beta.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (104) hide show
  1. package/README.md +2 -2
  2. package/catalog/TEMPLATE.md +58 -13
  3. package/catalog/frontmcp-config/SKILL.md +156 -0
  4. package/catalog/{auth/configure-auth/references/auth-modes.md → frontmcp-config/references/configure-auth-modes.md} +5 -0
  5. package/catalog/frontmcp-config/references/configure-auth.md +243 -0
  6. package/catalog/frontmcp-config/references/configure-elicitation.md +183 -0
  7. package/catalog/frontmcp-config/references/configure-http.md +210 -0
  8. package/catalog/frontmcp-config/references/configure-session.md +210 -0
  9. package/catalog/{config/configure-throttle/references/guard-config.md → frontmcp-config/references/configure-throttle-guard-config.md} +5 -0
  10. package/catalog/frontmcp-config/references/configure-throttle.md +234 -0
  11. package/catalog/{config/configure-transport/references/protocol-presets.md → frontmcp-config/references/configure-transport-protocol-presets.md} +5 -0
  12. package/catalog/frontmcp-config/references/configure-transport.md +200 -0
  13. package/catalog/frontmcp-config/references/setup-redis.md +9 -0
  14. package/catalog/frontmcp-config/references/setup-sqlite.md +9 -0
  15. package/catalog/frontmcp-deployment/SKILL.md +152 -0
  16. package/catalog/frontmcp-deployment/references/build-for-browser.md +143 -0
  17. package/catalog/frontmcp-deployment/references/build-for-cli.md +191 -0
  18. package/catalog/{deployment/build-for-sdk/SKILL.md → frontmcp-deployment/references/build-for-sdk.md} +66 -20
  19. package/catalog/frontmcp-deployment/references/deploy-to-cloudflare.md +218 -0
  20. package/catalog/{deployment/deploy-to-lambda/SKILL.md → frontmcp-deployment/references/deploy-to-lambda.md} +77 -59
  21. package/catalog/{deployment/deploy-to-node/references/Dockerfile.example → frontmcp-deployment/references/deploy-to-node-dockerfile.md} +18 -4
  22. package/catalog/{deployment/deploy-to-node/SKILL.md → frontmcp-deployment/references/deploy-to-node.md} +69 -36
  23. package/catalog/frontmcp-deployment/references/deploy-to-vercel-config.md +65 -0
  24. package/catalog/frontmcp-deployment/references/deploy-to-vercel.md +229 -0
  25. package/catalog/frontmcp-development/SKILL.md +126 -0
  26. package/catalog/frontmcp-development/references/create-adapter.md +170 -0
  27. package/catalog/{development/create-agent/references/llm-config.md → frontmcp-development/references/create-agent-llm-config.md} +10 -5
  28. package/catalog/{development/create-agent/SKILL.md → frontmcp-development/references/create-agent.md} +83 -40
  29. package/catalog/{development/create-job/SKILL.md → frontmcp-development/references/create-job.md} +62 -15
  30. package/catalog/{plugins/create-plugin-hooks/SKILL.md → frontmcp-development/references/create-plugin-hooks.md} +100 -7
  31. package/catalog/frontmcp-development/references/create-plugin.md +506 -0
  32. package/catalog/{development/create-prompt/SKILL.md → frontmcp-development/references/create-prompt.md} +65 -22
  33. package/catalog/{development/create-provider/SKILL.md → frontmcp-development/references/create-provider.md} +63 -23
  34. package/catalog/{development/create-resource/SKILL.md → frontmcp-development/references/create-resource.md} +148 -26
  35. package/catalog/{development/create-skill-with-tools/SKILL.md → frontmcp-development/references/create-skill-with-tools.md} +174 -20
  36. package/catalog/{development/create-skill/SKILL.md → frontmcp-development/references/create-skill.md} +114 -28
  37. package/catalog/{development/create-tool/references/tool-annotations.md → frontmcp-development/references/create-tool-annotations.md} +5 -0
  38. package/catalog/{development/create-tool/references/output-schema-types.md → frontmcp-development/references/create-tool-output-schema-types.md} +5 -0
  39. package/catalog/{development/create-tool/SKILL.md → frontmcp-development/references/create-tool.md} +172 -23
  40. package/catalog/{development/create-workflow/SKILL.md → frontmcp-development/references/create-workflow.md} +61 -14
  41. package/catalog/frontmcp-development/references/decorators-guide.md +754 -0
  42. package/catalog/frontmcp-development/references/official-adapters.md +199 -0
  43. package/catalog/{plugins/official-plugins/SKILL.md → frontmcp-development/references/official-plugins.md} +97 -27
  44. package/catalog/frontmcp-extensibility/SKILL.md +103 -0
  45. package/catalog/frontmcp-extensibility/references/vectoriadb.md +289 -0
  46. package/catalog/frontmcp-guides/SKILL.md +420 -0
  47. package/catalog/frontmcp-guides/references/example-knowledge-base.md +641 -0
  48. package/catalog/frontmcp-guides/references/example-task-manager.md +517 -0
  49. package/catalog/frontmcp-guides/references/example-weather-api.md +297 -0
  50. package/catalog/frontmcp-production-readiness/SKILL.md +98 -0
  51. package/catalog/frontmcp-production-readiness/references/common-checklist.md +156 -0
  52. package/catalog/frontmcp-production-readiness/references/production-browser.md +46 -0
  53. package/catalog/frontmcp-production-readiness/references/production-cli-binary.md +62 -0
  54. package/catalog/frontmcp-production-readiness/references/production-cli-daemon.md +61 -0
  55. package/catalog/frontmcp-production-readiness/references/production-cloudflare.md +52 -0
  56. package/catalog/frontmcp-production-readiness/references/production-lambda.md +53 -0
  57. package/catalog/frontmcp-production-readiness/references/production-node-sdk.md +66 -0
  58. package/catalog/frontmcp-production-readiness/references/production-node-server.md +61 -0
  59. package/catalog/frontmcp-production-readiness/references/production-vercel.md +52 -0
  60. package/catalog/frontmcp-setup/SKILL.md +132 -0
  61. package/catalog/frontmcp-setup/references/frontmcp-skills-usage.md +280 -0
  62. package/catalog/{setup/multi-app-composition/SKILL.md → frontmcp-setup/references/multi-app-composition.md} +66 -19
  63. package/catalog/{setup/nx-workflow/SKILL.md → frontmcp-setup/references/nx-workflow.md} +79 -17
  64. package/catalog/frontmcp-setup/references/project-structure-nx.md +251 -0
  65. package/catalog/frontmcp-setup/references/project-structure-standalone.md +217 -0
  66. package/catalog/frontmcp-setup/references/readme-guide.md +226 -0
  67. package/catalog/{setup/setup-project/SKILL.md → frontmcp-setup/references/setup-project.md} +63 -58
  68. package/catalog/{setup/setup-redis/SKILL.md → frontmcp-setup/references/setup-redis.md} +60 -82
  69. package/catalog/{setup/setup-sqlite/SKILL.md → frontmcp-setup/references/setup-sqlite.md} +65 -72
  70. package/catalog/frontmcp-testing/SKILL.md +135 -0
  71. package/catalog/{testing/setup-testing/SKILL.md → frontmcp-testing/references/setup-testing.md} +79 -63
  72. package/catalog/{testing/setup-testing → frontmcp-testing}/references/test-auth.md +5 -0
  73. package/catalog/{testing/setup-testing → frontmcp-testing}/references/test-browser-build.md +5 -0
  74. package/catalog/{testing/setup-testing → frontmcp-testing}/references/test-cli-binary.md +5 -0
  75. package/catalog/{testing/setup-testing → frontmcp-testing}/references/test-direct-client.md +5 -0
  76. package/catalog/{testing/setup-testing → frontmcp-testing}/references/test-e2e-handler.md +5 -0
  77. package/catalog/{testing/setup-testing → frontmcp-testing}/references/test-tool-unit.md +6 -0
  78. package/catalog/skills-manifest.json +337 -382
  79. package/package.json +2 -2
  80. package/src/index.d.ts +1 -1
  81. package/src/index.js.map +1 -1
  82. package/src/loader.js +0 -1
  83. package/src/loader.js.map +1 -1
  84. package/src/manifest.d.ts +15 -3
  85. package/src/manifest.js +3 -3
  86. package/src/manifest.js.map +1 -1
  87. package/catalog/adapters/create-adapter/SKILL.md +0 -127
  88. package/catalog/adapters/official-adapters/SKILL.md +0 -136
  89. package/catalog/auth/configure-auth/SKILL.md +0 -250
  90. package/catalog/auth/configure-session/SKILL.md +0 -201
  91. package/catalog/config/configure-elicitation/SKILL.md +0 -136
  92. package/catalog/config/configure-http/SKILL.md +0 -167
  93. package/catalog/config/configure-throttle/SKILL.md +0 -189
  94. package/catalog/config/configure-transport/SKILL.md +0 -151
  95. package/catalog/deployment/build-for-browser/SKILL.md +0 -95
  96. package/catalog/deployment/build-for-cli/SKILL.md +0 -100
  97. package/catalog/deployment/deploy-to-cloudflare/SKILL.md +0 -192
  98. package/catalog/deployment/deploy-to-vercel/SKILL.md +0 -196
  99. package/catalog/deployment/deploy-to-vercel/references/vercel.json.example +0 -60
  100. package/catalog/development/decorators-guide/SKILL.md +0 -598
  101. package/catalog/plugins/create-plugin/SKILL.md +0 -336
  102. package/catalog/setup/frontmcp-skills-usage/SKILL.md +0 -200
  103. package/catalog/setup/project-structure-nx/SKILL.md +0 -186
  104. package/catalog/setup/project-structure-standalone/SKILL.md +0 -153
@@ -0,0 +1,251 @@
1
+ ---
2
+ name: project-structure-nx
3
+ description: Canonical directory layout, generators, and dependency rules for FrontMCP Nx monorepos
4
+ ---
5
+
6
+ # Nx Monorepo Project Structure
7
+
8
+ ## When to Use This Skill
9
+
10
+ ### Must Use
11
+
12
+ - Scaffolding a new FrontMCP project with `frontmcp create --nx` or adding FrontMCP to an existing Nx workspace
13
+ - Organizing multiple `@App` modules, shared libraries, and `@FrontMcp` server entry points in a monorepo
14
+ - Understanding the `apps/`, `libs/`, `servers/` directory hierarchy and Nx dependency rules
15
+
16
+ ### Recommended
17
+
18
+ - Setting up Nx generators to scaffold tools, resources, providers, and other entities within apps
19
+ - Configuring multiple servers that compose different combinations of apps (e.g., public gateway and internal admin)
20
+ - Leveraging Nx caching, dependency graph, and `run-many` commands for efficient builds and tests
21
+
22
+ ### Skip When
23
+
24
+ - You are building a single standalone project without Nx (see `project-structure-standalone`)
25
+ - You need to compose multiple apps within a single server and already have the Nx structure (see `multi-app-composition`)
26
+ - You are looking for a specific Nx build or CI workflow (see `nx-workflow`)
27
+
28
+ > **Decision:** Use this skill when setting up or organizing a FrontMCP Nx monorepo and you need the canonical directory layout, generator commands, and dependency rules.
29
+
30
+ When you scaffold with `frontmcp create --nx` or add FrontMCP to an existing Nx workspace, the recommended layout separates apps, shared libraries, and server entry points:
31
+
32
+ ```text
33
+ my-workspace/
34
+ ├── apps/ # @App classes (one app per directory)
35
+ │ ├── billing/
36
+ │ │ ├── src/
37
+ │ │ │ ├── billing.app.ts
38
+ │ │ │ ├── tools/
39
+ │ │ │ ├── resources/
40
+ │ │ │ └── providers/
41
+ │ │ ├── project.json
42
+ │ │ └── tsconfig.json
43
+ │ └── crm/
44
+ │ ├── src/
45
+ │ │ ├── crm.app.ts
46
+ │ │ ├── tools/
47
+ │ │ └── resources/
48
+ │ ├── project.json
49
+ │ └── tsconfig.json
50
+ ├── libs/ # Shared libraries
51
+ │ └── shared-utils/
52
+ │ ├── src/
53
+ │ │ └── index.ts
54
+ │ ├── project.json
55
+ │ └── tsconfig.json
56
+ ├── servers/ # @FrontMcp servers composing apps
57
+ │ └── gateway/
58
+ │ ├── src/
59
+ │ │ └── main.ts # @FrontMcp default export
60
+ │ ├── project.json
61
+ │ └── tsconfig.json
62
+ ├── nx.json
63
+ ├── tsconfig.base.json
64
+ ├── CLAUDE.md # AI config (auto-generated)
65
+ ├── AGENTS.md
66
+ ├── .mcp.json
67
+ └── .cursorrules
68
+ ```
69
+
70
+ ## Directory Roles
71
+
72
+ ### apps/ -- Application Modules
73
+
74
+ Each directory under `apps/` contains a single `@App` class with its tools, resources, prompts, providers, and plugins:
75
+
76
+ ```typescript
77
+ // apps/billing/src/billing.app.ts
78
+ import { App } from '@frontmcp/sdk';
79
+ import { CreateInvoiceTool } from './tools/create-invoice.tool';
80
+ import { InvoiceResource } from './resources/invoice.resource';
81
+ import { StripeProvider } from './providers/stripe.provider';
82
+
83
+ @App({
84
+ name: 'billing',
85
+ tools: [CreateInvoiceTool],
86
+ resources: [InvoiceResource],
87
+ providers: [StripeProvider],
88
+ })
89
+ export class BillingApp {}
90
+ ```
91
+
92
+ Apps are self-contained and independently testable. They do not import from other apps -- shared code goes in `libs/`.
93
+
94
+ ### libs/ -- Shared Libraries
95
+
96
+ Shared providers, utilities, types, and common logic live under `libs/`:
97
+
98
+ ```typescript
99
+ // libs/shared-utils/src/index.ts
100
+ export { formatCurrency } from './format-currency';
101
+ export { DatabaseProvider } from './database.provider';
102
+ export type { AppConfig } from './app-config.interface';
103
+ ```
104
+
105
+ Apps and servers import from libs using Nx path aliases configured in `tsconfig.base.json`:
106
+
107
+ ```typescript
108
+ import { DatabaseProvider } from '@my-workspace/shared-utils';
109
+ ```
110
+
111
+ ### servers/ -- FrontMcp Entry Points
112
+
113
+ A server composes multiple apps into a single `@FrontMcp` entry point:
114
+
115
+ ```typescript
116
+ // servers/gateway/src/main.ts
117
+ import { FrontMcp } from '@frontmcp/sdk';
118
+ import { BillingApp } from '@my-workspace/billing';
119
+ import { CrmApp } from '@my-workspace/crm';
120
+
121
+ @FrontMcp({
122
+ info: { name: 'gateway', version: '1.0.0' },
123
+ apps: [BillingApp, CrmApp],
124
+ })
125
+ class GatewayServer {}
126
+
127
+ export default GatewayServer;
128
+ ```
129
+
130
+ You can have multiple servers composing different combinations of apps (e.g., a public-facing server and an internal admin server).
131
+
132
+ ## Nx Generators
133
+
134
+ The `@frontmcp/nx` package provides generators for common entity types:
135
+
136
+ ```bash
137
+ # Generate a new app
138
+ nx g @frontmcp/nx:app crm
139
+
140
+ # Generate entities within an app
141
+ nx g @frontmcp/nx:tool lookup-user --project=crm
142
+ nx g @frontmcp/nx:resource user-profile --project=crm
143
+ nx g @frontmcp/nx:prompt summarize --project=crm
144
+ nx g @frontmcp/nx:provider database --project=crm
145
+ nx g @frontmcp/nx:plugin logging --project=crm
146
+ nx g @frontmcp/nx:agent research --project=crm
147
+ nx g @frontmcp/nx:job cleanup --project=crm
148
+ nx g @frontmcp/nx:skill my-skill --project=crm
149
+ nx g @frontmcp/nx:skill-dir my-skill-dir --project=crm
150
+
151
+ # Generate a new server
152
+ nx g @frontmcp/nx:server gateway
153
+
154
+ # Generate a shared library
155
+ nx g @frontmcp/nx:lib shared-utils
156
+ ```
157
+
158
+ ## Build and Test Commands
159
+
160
+ ```bash
161
+ # Build a specific server
162
+ nx build gateway
163
+
164
+ # Test a specific app
165
+ nx test billing
166
+
167
+ # Run all tests
168
+ nx run-many -t test
169
+
170
+ # Build all projects
171
+ nx run-many -t build
172
+
173
+ # Lint everything
174
+ nx run-many -t lint
175
+ ```
176
+
177
+ Nx caches build and test results. Subsequent runs for unchanged projects are instant.
178
+
179
+ ## AI Configuration Files
180
+
181
+ FrontMCP auto-generates AI configuration files at the workspace root:
182
+
183
+ | File | Purpose |
184
+ | -------------- | ---------------------------------------- |
185
+ | `CLAUDE.md` | Instructions for Claude Code / Claude AI |
186
+ | `AGENTS.md` | Instructions for agent-based AI tools |
187
+ | `.mcp.json` | MCP server configuration for AI IDEs |
188
+ | `.cursorrules` | Rules for Cursor AI editor |
189
+
190
+ These files are regenerated when you run generators or modify your workspace structure. They help AI tools understand your project layout and coding conventions.
191
+
192
+ ## Dependency Graph
193
+
194
+ Nx enforces a clear dependency hierarchy:
195
+
196
+ ```text
197
+ servers/ --> apps/ --> libs/
198
+ ```
199
+
200
+ - **servers** can import from **apps** and **libs**
201
+ - **apps** can import from **libs** only (never from other apps or servers)
202
+ - **libs** can import from other **libs** only
203
+
204
+ Use `nx graph` to visualize the dependency graph and ensure no circular imports exist.
205
+
206
+ ## Common Patterns
207
+
208
+ | Pattern | Correct | Incorrect | Why |
209
+ | ------------------ | ---------------------------------------------------------------- | ----------------------------------------------------------------- | ------------------------------------------------------------------------------ |
210
+ | App isolation | Apps import from `libs/` only, never from other apps | `apps/billing` imports from `apps/crm` directly | Cross-app imports create circular dependencies; shared code belongs in `libs/` |
211
+ | Server composition | `servers/gateway/src/main.ts` imports apps via Nx path aliases | Server file inlines tool classes instead of importing from apps | Servers compose `@App` classes; inlining defeats the monorepo separation |
212
+ | Path aliases | `import { BillingApp } from '@my-workspace/billing'` | `import { BillingApp } from '../../apps/billing/src/billing.app'` | Nx path aliases in `tsconfig.base.json` keep imports clean and refactorable |
213
+ | Generator usage | `nx g @frontmcp/nx:tool lookup-user --project=crm` | Manually creating tool files without updating barrel exports | Generators handle file creation, spec scaffolding, and barrel export updates |
214
+ | AI config files | Let FrontMCP auto-generate `CLAUDE.md`, `AGENTS.md`, `.mcp.json` | Hand-editing auto-generated AI config files | These files are regenerated by generators; manual edits will be overwritten |
215
+
216
+ ## Verification Checklist
217
+
218
+ ### Workspace Structure
219
+
220
+ - [ ] `nx.json` and `tsconfig.base.json` exist at the workspace root
221
+ - [ ] Each app under `apps/` has its own `project.json` and `tsconfig.json`
222
+ - [ ] Shared libraries under `libs/` have `project.json` and barrel `index.ts`
223
+ - [ ] Server entry points under `servers/` default-export the `@FrontMcp` class
224
+
225
+ ### Build and Test
226
+
227
+ - [ ] `nx build gateway` (or server name) succeeds without errors
228
+ - [ ] `nx test billing` (or app name) passes all tests
229
+ - [ ] `nx run-many -t test` runs all tests across the workspace
230
+ - [ ] `nx graph` shows no circular dependencies between apps
231
+
232
+ ### Generators
233
+
234
+ - [ ] `nx g @frontmcp/nx:app <name>` creates a valid app scaffold
235
+ - [ ] `nx g @frontmcp/nx:tool <name> --project=<app>` creates tool with spec and barrel update
236
+ - [ ] `nx g @frontmcp/nx:server <name>` creates a server entry point
237
+
238
+ ## Troubleshooting
239
+
240
+ | Problem | Cause | Solution |
241
+ | ---------------------------------------- | ------------------------------------------------------- | -------------------------------------------------------------------------- |
242
+ | Import path not resolving | Missing or incorrect path alias in `tsconfig.base.json` | Add the correct `@my-workspace/<lib>` path mapping to `tsconfig.base.json` |
243
+ | `nx graph` shows circular dependency | App imports from another app instead of a shared lib | Move shared code to `libs/` and import from there in both apps |
244
+ | Generator fails with "project not found" | Incorrect `--project` name passed to the generator | Use the project name from `project.json`, not the directory name |
245
+ | Nx cache returns stale results | Source files changed but Nx hash did not detect it | Run `nx reset` to clear the cache, then rebuild |
246
+ | Server cannot find app export | App barrel `index.ts` does not export the `@App` class | Add the app class to the barrel export in `apps/<name>/src/index.ts` |
247
+
248
+ ## Reference
249
+
250
+ - [Nx Plugin Documentation](https://docs.agentfront.dev/frontmcp/nx-plugin/overview)
251
+ - Related skills: `project-structure-standalone`, `multi-app-composition`, `nx-workflow`, `setup-project`
@@ -0,0 +1,217 @@
1
+ ---
2
+ name: project-structure-standalone
3
+ description: File layout, naming conventions, and dev workflow for standalone FrontMCP projects
4
+ ---
5
+
6
+ # Standalone Project Structure
7
+
8
+ ## When to Use This Skill
9
+
10
+ ### Must Use
11
+
12
+ - Scaffolding a new FrontMCP project with `frontmcp create` and need to understand the generated layout
13
+ - Organizing tools, resources, prompts, and providers in a standalone (non-Nx) project
14
+ - Setting up the `main.ts` entry point with the `@FrontMcp` server default export
15
+
16
+ ### Recommended
17
+
18
+ - Adopting consistent `<name>.<type>.ts` file naming conventions across the project
19
+ - Restructuring an existing standalone project to follow FrontMCP best practices
20
+ - Organizing a growing project into feature folders with grouped domain entities
21
+
22
+ ### Skip When
23
+
24
+ - You are working in an Nx monorepo with multiple apps and shared libraries (see `project-structure-nx`)
25
+ - You need to compose multiple apps into a single server (see `multi-app-composition`)
26
+ - You are creating a specific entity (tool, resource, etc.) and need its decorator API (see `create-tool`, `create-resource`)
27
+
28
+ > **Decision:** Use this skill when scaffolding or organizing a standalone FrontMCP project and you need the canonical file layout, naming conventions, and development workflow.
29
+
30
+ When you run `frontmcp create`, the CLI scaffolds a standalone project with the following layout:
31
+
32
+ ```text
33
+ my-project/
34
+ ├── src/
35
+ │ ├── main.ts # @FrontMcp server entry (default export)
36
+ │ ├── my-app.app.ts # @App class
37
+ │ ├── tools/ # @Tool classes (*.tool.ts)
38
+ │ ├── resources/ # @Resource classes (*.resource.ts)
39
+ │ ├── prompts/ # @Prompt classes (*.prompt.ts)
40
+ │ ├── agents/ # @Agent classes (*.agent.ts)
41
+ │ ├── skills/ # @Skill classes or SKILL.md dirs
42
+ │ ├── providers/ # @Provider classes (*.provider.ts)
43
+ │ ├── plugins/ # @Plugin classes (*.plugin.ts)
44
+ │ └── jobs/ # @Job classes (*.job.ts)
45
+ ├── e2e/ # E2E tests (*.e2e.spec.ts)
46
+ ├── skills/ # Catalog skills (from --skills flag)
47
+ ├── package.json
48
+ ├── tsconfig.json
49
+ └── .env.example
50
+ ```
51
+
52
+ ## File Naming Conventions
53
+
54
+ Every entity type uses a consistent `<name>.<type>.ts` pattern:
55
+
56
+ | Entity | File Pattern | Example |
57
+ | -------- | --------------- | ---------------------------- |
58
+ | Tool | `*.tool.ts` | `fetch-weather.tool.ts` |
59
+ | Resource | `*.resource.ts` | `user-profile.resource.ts` |
60
+ | Prompt | `*.prompt.ts` | `summarize.prompt.ts` |
61
+ | Agent | `*.agent.ts` | `research.agent.ts` |
62
+ | Skill | `*.skill.ts` | `calendar.skill.ts` |
63
+ | Provider | `*.provider.ts` | `database.provider.ts` |
64
+ | Plugin | `*.plugin.ts` | `logging.plugin.ts` |
65
+ | Job | `*.job.ts` | `cleanup.job.ts` |
66
+ | Test | `*.spec.ts` | `fetch-weather.tool.spec.ts` |
67
+ | E2E Test | `*.e2e.spec.ts` | `api.e2e.spec.ts` |
68
+
69
+ **One class per file.** Keep each tool, resource, prompt, etc. in its own file.
70
+
71
+ ## Entry Point: main.ts
72
+
73
+ `main.ts` default-exports the `@FrontMcp` server class. This is the file FrontMCP loads at startup:
74
+
75
+ ```typescript
76
+ import { FrontMcp } from '@frontmcp/sdk';
77
+ import { MyApp } from './my-app.app';
78
+
79
+ @FrontMcp({
80
+ info: { name: 'my-project', version: '1.0.0' },
81
+ apps: [MyApp],
82
+ })
83
+ class MyServer {}
84
+
85
+ export default MyServer;
86
+ ```
87
+
88
+ ## App Class
89
+
90
+ The `@App` class groups tools, resources, prompts, plugins, and providers together:
91
+
92
+ ```typescript
93
+ import { App } from '@frontmcp/sdk';
94
+ import { FetchWeatherTool } from './tools/fetch-weather.tool';
95
+ import { DatabaseProvider } from './providers/database.provider';
96
+
97
+ @App({
98
+ name: 'my-app',
99
+ tools: [FetchWeatherTool],
100
+ providers: [DatabaseProvider],
101
+ })
102
+ export class MyApp {}
103
+ ```
104
+
105
+ ## Development Workflow
106
+
107
+ ### Start development server
108
+
109
+ ```bash
110
+ frontmcp dev
111
+ ```
112
+
113
+ Watches for file changes and restarts automatically.
114
+
115
+ ### Build for production
116
+
117
+ ```bash
118
+ frontmcp build --target node
119
+ frontmcp build --target cloudflare
120
+ frontmcp build --target vercel
121
+ frontmcp build --target lambda
122
+ ```
123
+
124
+ Valid targets: `cli`, `node`, `sdk`, `browser`, `cloudflare`, `vercel`, `lambda`. The `--target` flag determines the output format and runtime optimizations.
125
+
126
+ ### Run tests
127
+
128
+ ```bash
129
+ # Unit tests
130
+ jest
131
+
132
+ # E2E tests
133
+ jest --config e2e/jest.config.ts
134
+ ```
135
+
136
+ ## Organizing by Feature
137
+
138
+ For larger standalone projects, group related entities into feature folders:
139
+
140
+ ```text
141
+ src/
142
+ ├── main.ts
143
+ ├── my-app.app.ts
144
+ ├── billing/
145
+ │ ├── create-invoice.tool.ts
146
+ │ ├── invoice.resource.ts
147
+ │ └── billing.provider.ts
148
+ ├── users/
149
+ │ ├── lookup-user.tool.ts
150
+ │ ├── user-profile.resource.ts
151
+ │ └── users.provider.ts
152
+ └── plugins/
153
+ └── logging.plugin.ts
154
+ ```
155
+
156
+ Feature folders work well when your project has multiple related tools and resources that share a domain.
157
+
158
+ ## Skills Directory
159
+
160
+ The top-level `skills/` directory (outside `src/`) holds catalog skills added via the `--skills` flag during `frontmcp create`. Each skill is a folder containing a `SKILL.md` file:
161
+
162
+ ```text
163
+ skills/
164
+ ├── create-tool/
165
+ │ └── SKILL.md
166
+ └── setup-project/
167
+ └── SKILL.md
168
+ ```
169
+
170
+ Skills inside `src/skills/` are `@Skill` classes that are part of your application code.
171
+
172
+ ## Common Patterns
173
+
174
+ | Pattern | Correct | Incorrect | Why |
175
+ | ------------------ | --------------------------------------------------------- | --------------------------------------------------- | ------------------------------------------------------------------------------------- |
176
+ | File naming | `fetch-weather.tool.ts` (kebab-case with type suffix) | `FetchWeather.ts` or `fetchWeatherTool.ts` | The `<name>.<type>.ts` convention enables tooling, generators, and consistent imports |
177
+ | Entry point | `main.ts` with `export default MyServer` | Named export or no default export in `main.ts` | FrontMCP loads the default export from the entry point at startup |
178
+ | One class per file | Each tool, resource, or provider in its own file | Multiple tool classes in a single file | Keeps files focused, simplifies imports, and aligns with generator output |
179
+ | Feature folders | Group related entities under `src/billing/`, `src/users/` | Flat structure with dozens of files in `src/tools/` | Feature folders scale better and make domain boundaries visible |
180
+ | Test files | `fetch-weather.tool.spec.ts` (`.spec.ts` extension) | `fetch-weather.tool.test.ts` (`.test.ts` extension) | FrontMCP convention requires `.spec.ts`; generators and CI expect this pattern |
181
+
182
+ ## Verification Checklist
183
+
184
+ ### Project Structure
185
+
186
+ - [ ] `src/main.ts` exists and default-exports the `@FrontMcp` server class
187
+ - [ ] At least one `@App` class exists (e.g., `src/my-app.app.ts`)
188
+ - [ ] Entity files follow the `<name>.<type>.ts` naming convention
189
+ - [ ] Test files use the `.spec.ts` extension
190
+
191
+ ### Development Workflow
192
+
193
+ - [ ] `frontmcp dev` starts the development server with file watching
194
+ - [ ] `frontmcp build --target node` produces a valid production build
195
+ - [ ] Unit tests pass with `jest`
196
+ - [ ] E2E tests (if any) are in the `e2e/` directory with `*.e2e.spec.ts` naming
197
+
198
+ ### Organization
199
+
200
+ - [ ] Each entity type has its own directory (`tools/`, `resources/`, etc.) or feature folder
201
+ - [ ] Catalog skills (from `--skills` flag) are in the top-level `skills/` directory
202
+ - [ ] Application `@Skill` classes are in `src/skills/`
203
+
204
+ ## Troubleshooting
205
+
206
+ | Problem | Cause | Solution |
207
+ | ------------------------------ | ------------------------------------------------------------- | ------------------------------------------------------------------------ |
208
+ | `frontmcp dev` fails to start | `main.ts` does not default-export the `@FrontMcp` class | Add `export default MyServer` to `main.ts` |
209
+ | Tool not discovered at runtime | Tool class not added to the `tools` array in `@App` | Register the tool in the `@App` decorator's `tools` array |
210
+ | Tests not found by Jest | Test file uses `.test.ts` instead of `.spec.ts` | Rename to `.spec.ts` to match the FrontMCP test file convention |
211
+ | Build target error | Invalid `--target` flag value | Use `node`, `vercel`, `lambda`, or `cloudflare` as the target value |
212
+ | Catalog skills not loaded | Skills placed in `src/skills/` instead of top-level `skills/` | Move catalog `SKILL.md` directories to the top-level `skills/` directory |
213
+
214
+ ## Reference
215
+
216
+ - [Quickstart Documentation](https://docs.agentfront.dev/frontmcp/getting-started/quickstart)
217
+ - Related skills: `project-structure-nx`, `multi-app-composition`, `setup-project`, `create-tool`
@@ -0,0 +1,226 @@
1
+ ---
2
+ name: readme-guide
3
+ description: Generate deployment-target-aware README.md files for FrontMCP MCP servers
4
+ ---
5
+
6
+ # FrontMCP README Generator
7
+
8
+ Generate deployment-target-aware README.md files for FrontMCP MCP servers. The README adapts its content based on how the project is intended to be consumed — as an npm package, CLI tool, browser SDK, or serverless deployment.
9
+
10
+ ## When to Use This Skill
11
+
12
+ ### Must Use
13
+
14
+ - Creating a new FrontMCP project that will be published or shared
15
+ - Preparing an open-source release of an MCP server
16
+ - Updating README after adding tools, prompts, resources, or changing deployment targets
17
+
18
+ ### Recommended
19
+
20
+ - After significant changes to tools, resources, or server configuration
21
+ - When switching deployment targets (e.g., from Node to Vercel)
22
+ - Before publishing a new version to npm
23
+
24
+ ### Skip When
25
+
26
+ - Internal project with no external users
27
+ - The README is already comprehensive and manually maintained
28
+
29
+ > **Decision:** Use this skill whenever the project's README needs to reflect its current tools, capabilities, and deployment instructions. Always ask the user which deployment target they're publishing for.
30
+
31
+ ## Step 1: Determine the Deployment Target
32
+
33
+ Ask the user how the project will be consumed. This determines the README structure:
34
+
35
+ | Target | README Focus |
36
+ | ------------------------------- | -------------------------------------------------------------- |
37
+ | **npm package** (direct client) | Installation via npm, SDK usage, `create()` API examples |
38
+ | **CLI binary** | Global install, CLI commands, configuration, usage examples |
39
+ | **Browser SDK** | CDN/bundler import, browser-compatible API, framework examples |
40
+ | **Node server** (Docker) | Docker setup, environment variables, health checks, deployment |
41
+ | **Vercel** | One-click deploy, `vercel.json` config, environment setup |
42
+ | **Lambda** | SAM template, deployment commands, API Gateway config |
43
+ | **Cloudflare Workers** | `wrangler.toml` config, deploy commands, edge runtime notes |
44
+
45
+ ## Step 2: Gather Project Information
46
+
47
+ Read these files to understand the project:
48
+
49
+ 1. **`src/main.ts`** — Server name, version, registered apps
50
+ 2. **`src/**/\*.app.ts`\*\* — App names and their tools/resources/prompts
51
+ 3. **`src/tools/*.tool.ts`** — Tool names, descriptions, input/output schemas
52
+ 4. **`src/resources/*.resource.ts`** — Resource URIs and descriptions
53
+ 5. **`package.json`** — Name, version, scripts, dependencies
54
+ 6. **`.env.example`** — Required environment variables
55
+ 7. **`ci/`** — Dockerfile, docker-compose.yml if present
56
+
57
+ ## Step 3: Generate README Sections
58
+
59
+ ### Common Sections (all targets)
60
+
61
+ ```markdown
62
+ # {Project Name}
63
+
64
+ {One-line description from @FrontMcp info}
65
+
66
+ ## Features
67
+
68
+ - {Tool 1 name} — {description}
69
+ - {Tool 2 name} — {description}
70
+ - {Resource 1} — {description}
71
+
72
+ ## Quick Start
73
+
74
+ {Target-specific install + run instructions}
75
+
76
+ ## Tools
77
+
78
+ | Tool | Description | Input |
79
+ | -------- | ------------- | ------------------------ |
80
+ | `{name}` | {description} | `{input schema summary}` |
81
+
82
+ ## Resources
83
+
84
+ | URI | Description |
85
+ | ------------------- | ------------- |
86
+ | `{uri or template}` | {description} |
87
+
88
+ ## Environment Variables
89
+
90
+ | Variable | Required | Description |
91
+ | -------- | -------- | ------------- |
92
+ | `{VAR}` | {yes/no} | {description} |
93
+
94
+ ## Development
95
+
96
+ {How to run locally, test, inspect}
97
+
98
+ ## License
99
+
100
+ {License from package.json}
101
+ ```
102
+
103
+ ### Target-Specific Sections
104
+
105
+ **npm package (direct client):**
106
+
107
+ ```markdown
108
+ ## Installation
109
+
110
+ npm install {package-name}
111
+
112
+ ## Usage
113
+
114
+ import { create } from '{package-name}';
115
+
116
+ const server = await create({
117
+ // configuration
118
+ });
119
+ const client = await server.connect();
120
+ const tools = await client.listTools();
121
+ ```
122
+
123
+ **CLI binary:**
124
+
125
+ ```markdown
126
+ ## Installation
127
+
128
+ npm install -g {package-name}
129
+
130
+ ## Usage
131
+
132
+ {package-name} --help
133
+ {package-name} [command] [options]
134
+
135
+ ## Commands
136
+
137
+ | Command | Description |
138
+ | ------- | ------------- |
139
+ | `{cmd}` | {description} |
140
+ ```
141
+
142
+ **Docker / Node server:**
143
+
144
+ ```markdown
145
+ ## Docker
146
+
147
+ docker compose up
148
+
149
+ ## Manual Deployment
150
+
151
+ docker build -f ci/Dockerfile -t {name}:latest .
152
+ docker run -p 3000:3000 {name}:latest
153
+ ```
154
+
155
+ **Vercel:**
156
+
157
+ ```markdown
158
+ ## Deploy to Vercel
159
+
160
+ npm i -g vercel
161
+ frontmcp build --target vercel
162
+ vercel deploy --prebuilt
163
+
164
+ ## Configuration
165
+
166
+ See `vercel.json` for route configuration and environment variables.
167
+ Set secrets via: `vercel env add REDIS_URL`
168
+ ```
169
+
170
+ **AWS Lambda:**
171
+
172
+ ```markdown
173
+ ## Deploy to AWS Lambda
174
+
175
+ frontmcp build --target lambda
176
+ cd dist && sam build && sam deploy --guided
177
+
178
+ ## Configuration
179
+
180
+ - SAM template: `template.yaml` defines the Lambda function, API Gateway, and DynamoDB table
181
+ - Environment variables: Set via `sam deploy` parameters or AWS Console
182
+ - API Gateway: Streamable HTTP endpoint at `https://{api-id}.execute-api.{region}.amazonaws.com/mcp`
183
+ ```
184
+
185
+ **Cloudflare Workers:**
186
+
187
+ ```markdown
188
+ ## Deploy to Cloudflare Workers
189
+
190
+ frontmcp build --target cloudflare
191
+ npx wrangler deploy
192
+
193
+ ## Configuration
194
+
195
+ - Workers config: `wrangler.toml` defines the worker name, routes, and KV bindings
196
+ - Secrets: `npx wrangler secret put REDIS_URL`
197
+ - KV namespace: Create via `npx wrangler kv:namespace create SESSION_STORE`
198
+ ```
199
+
200
+ ## Step 4: Update Existing README
201
+
202
+ When updating (not creating), preserve:
203
+
204
+ - Custom sections the user added manually
205
+ - Badges, logos, and branding
206
+ - Contributing guidelines, code of conduct links
207
+
208
+ Only update:
209
+
210
+ - Tool/resource tables (regenerate from source)
211
+ - Quick start instructions (if deployment target changed)
212
+ - Environment variables (if .env.example changed)
213
+
214
+ ## Verification Checklist
215
+
216
+ - [ ] README includes all tools with descriptions from source code
217
+ - [ ] README includes all resources and their URIs
218
+ - [ ] Installation instructions match the deployment target
219
+ - [ ] Environment variables match `.env.example`
220
+ - [ ] Development section includes `frontmcp dev`, `frontmcp test`, `frontmcp inspect`
221
+ - [ ] License matches `package.json`
222
+
223
+ ## Reference
224
+
225
+ - Related skills: `frontmcp-deployment` (for target-specific deployment details)
226
+ - Related skills: `frontmcp-setup` (for project structure)