fa-mcp-sdk 0.4.51 → 0.4.53

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 (47) hide show
  1. package/README.md +1 -1
  2. package/cli-template/.claude/settings.json +3 -1
  3. package/cli-template/.claude/skills/edit-claude-files/SKILL.md +46 -0
  4. package/cli-template/.claude/skills/feature-generator/SKILL.md +364 -0
  5. package/cli-template/.claude/skills/readme-generator/README.md +1 -0
  6. package/cli-template/.claude/skills/readme-generator/SKILL.md +237 -0
  7. package/cli-template/.claude/skills/readme-generator/reference/best-practices.md +218 -0
  8. package/cli-template/.claude/skills/readme-generator/reference/satellite-templates.md +534 -0
  9. package/cli-template/.claude/skills/readme-generator/reference/templates.md +385 -0
  10. package/cli-template/CLAUDE.md +5 -19
  11. package/cli-template/FA-MCP-SDK-DOC/00-FA-MCP-SDK-index.md +1 -1
  12. package/cli-template/FA-MCP-SDK-DOC/02-1-tools-and-api.md +60 -0
  13. package/cli-template/FA-MCP-SDK-DOC/04-authentication.md +10 -8
  14. package/cli-template/README.md +72 -22
  15. package/cli-template/SKILL_README.md +139 -0
  16. package/cli-template/package.json +1 -1
  17. package/cli-template/prompt-example-new-MCP.md +3 -2
  18. package/config/custom-environment-variables.yaml +4 -3
  19. package/config/default.yaml +20 -18
  20. package/config/local-test.yaml +44 -0
  21. package/dist/core/_types_/config.d.ts +8 -5
  22. package/dist/core/_types_/config.d.ts.map +1 -1
  23. package/dist/core/auth/admin-auth.d.ts +12 -5
  24. package/dist/core/auth/admin-auth.d.ts.map +1 -1
  25. package/dist/core/auth/admin-auth.js +37 -25
  26. package/dist/core/auth/admin-auth.js.map +1 -1
  27. package/dist/core/bootstrap/startup-info.d.ts.map +1 -1
  28. package/dist/core/bootstrap/startup-info.js +13 -5
  29. package/dist/core/bootstrap/startup-info.js.map +1 -1
  30. package/dist/core/mcp/readme-assembler.d.ts +20 -0
  31. package/dist/core/mcp/readme-assembler.d.ts.map +1 -0
  32. package/dist/core/mcp/readme-assembler.js +88 -0
  33. package/dist/core/mcp/readme-assembler.js.map +1 -0
  34. package/dist/core/mcp/resources.d.ts.map +1 -1
  35. package/dist/core/mcp/resources.js +2 -1
  36. package/dist/core/mcp/resources.js.map +1 -1
  37. package/dist/core/web/admin-router.js +2 -2
  38. package/dist/core/web/admin-router.js.map +1 -1
  39. package/dist/core/web/home-api.d.ts.map +1 -1
  40. package/dist/core/web/home-api.js +13 -5
  41. package/dist/core/web/home-api.js.map +1 -1
  42. package/dist/core/web/server-http.d.ts.map +1 -1
  43. package/dist/core/web/server-http.js +1 -2
  44. package/dist/core/web/server-http.js.map +1 -1
  45. package/dist/core/web/static/home/index.html +2 -2
  46. package/dist/core/web/static/home/script.js +2 -2
  47. package/package.json +1 -1
package/README.md CHANGED
@@ -219,7 +219,7 @@ Note: The `dist/` directory (compiled JavaScript) is created after running `npm
219
219
  `http://localhost:3000` with:
220
220
  - MCP endpoints at `/mcp/*`
221
221
  - Admin panel for generating access tokens at `/admin`
222
- - When `adminAuth.type` includes `jwtToken`, the JWT **must** carry `allow: 'gen-token'`
222
+ - When `adminPanel.authType` includes `jwtToken`, the JWT **must** carry `allow: 'gen-token'`
223
223
  in its payload to be accepted. Tokens without this claim (e.g. the short-lived JWT
224
224
  auto-generated for the Agent Tester page) are rejected — this prevents them from
225
225
  being replayed to mint arbitrary long-lived tokens. `permanentServerTokens` and
@@ -16,7 +16,9 @@
16
16
  "Read(./**/_tmp/**)",
17
17
  "Read(./**/*.private.*)",
18
18
  "Read(./**/*.local.*)",
19
- "Read(./**/*local-*)"
19
+ "Read(./**/*local-*)",
20
+ "Write(.claude/**)",
21
+ "Edit(.claude/**)"
20
22
  ]
21
23
  },
22
24
  "env": {
@@ -0,0 +1,46 @@
1
+ ---
2
+ name: edit-claude-files
3
+ description: "Protocol for editing or creating any file under .claude/ (SKILL.md, scripts, hooks, agents, settings.json, etc.). Use whenever a file path starts with .claude/ — direct Write/Edit is blocked by settings.json, so changes MUST go through the scripts/fcp.js temp-copy workflow."
4
+ allowed-tools: Read, Write, Edit, MultiEdit, Bash(node scripts/fcp.js *), Bash(rm:*)
5
+ ---
6
+
7
+ # Editing files in `.claude/`
8
+
9
+ **Scope of this rule — read carefully.** It applies to **every file under `.claude/`** — not only
10
+ `SKILL.md`. This includes scripts in `.claude/skills/<skill>/scripts/`, hooks in `.claude/hooks/`,
11
+ agent configs in `.claude/agents/`, supporting reference files, `settings.json`, and anything else
12
+ inside the directory. Claude Code watches the whole tree and reloads on change; direct writes risk
13
+ partial reads and inconsistent state during multi-edit sessions.
14
+
15
+ To enforce this, `settings.json` denies the `Write` and `Edit` tools on `.claude/**` outright.
16
+ Attempting a direct edit will fail the permission check — that is intentional, not a bug.
17
+
18
+ **Protocol — every file, every time:**
19
+
20
+ 1. **Copy** the target file to a temp location outside `.claude/` (works for any file type: md, js,
21
+ json, cjs, …):
22
+ ```bash
23
+ node scripts/fcp.js tmp-edit.md .claude/skills/<skill-name>/SKILL.md
24
+ node scripts/fcp.js tmp-helper.js .claude/skills/<skill-name>/scripts/helper.js
25
+ ```
26
+ 2. **Edit** the temp file — make ALL changes there (multiple Edit calls are fine).
27
+ 3. **Save** atomically via the helper script (same command, reversed argument order):
28
+ ```bash
29
+ node scripts/fcp.js .claude/skills/<skill-name>/SKILL.md tmp-edit.md
30
+ node scripts/fcp.js .claude/skills/<skill-name>/scripts/helper.js tmp-helper.js
31
+ ```
32
+ 4. **Remove** the temp file:
33
+ ```bash
34
+ rm tmp-edit.md
35
+ ```
36
+
37
+ **Creating a new file in `.claude/`** — same protocol, just start from an empty temp file:
38
+
39
+ ```bash
40
+ # Write the new file somewhere OUTSIDE .claude/, then fcp.js it in:
41
+ node scripts/fcp.js .claude/skills/<skill-name>/scripts/new-script.js tmp-new-script.js
42
+ rm tmp-new-script.js
43
+ ```
44
+
45
+ CRITICAL: Never use `Edit` or `Write` directly on files inside `.claude/` — always go through the
46
+ temp-copy workflow above. This covers SKILL.md, scripts, hooks, agents, settings — everything.
@@ -0,0 +1,364 @@
1
+ ---
2
+ name: feature-generator
3
+ description: >-
4
+ Command-only META-SKILL (invoked explicitly, no auto-trigger). Produces an exhaustive,
5
+ self-sufficient prompt for an AI CLI (Claude Code) to implement a feature turnkey.
6
+ Thinks first (Karpathy-style), inspects real code via Read/Grep/Glob, finds reusable
7
+ functions and packages, designs the minimal sufficient solution, drafts a plan, code
8
+ examples, and testing scenario. Universal for any fa-mcp-sdk project.
9
+ disable-model-invocation: true
10
+ argument-hint: "[feature description | path to task file]"
11
+ allowed-tools: Read, Grep, Glob, Bash(git *), Bash(yarn *), Bash(npm *), Bash(node *), Bash(ls *), Bash(cat *)
12
+ ---
13
+
14
+ # feature-generator — META-SKILL for generating prompts for an AI CLI
15
+
16
+ ## Essence
17
+
18
+ You **do NOT write code**. You generate a **self-sufficient prompt for an AI CLI**, which will then:
19
+
20
+ - study the code itself,
21
+ - design the solution itself,
22
+ - implement it itself,
23
+ - test it itself.
24
+
25
+ This is a **META-skill** (agent-building agent). Your output is a clean prompt, not an
26
+ implementation. You do not touch any code in the target repository.
27
+
28
+ ## How to invoke
29
+
30
+ **Command-only.** The skill is **never auto-invoked by the model** — `disable-model-invocation`
31
+ is set to `true`. Runs solely when the operator explicitly calls it (e.g. `/feature-generator`
32
+ or the equivalent UI invocation). Ignore any implicit triggers from phrasing in user messages.
33
+
34
+ ## When to use
35
+
36
+ - The operator describes a feature/functionality but does not write code themselves.
37
+ - A production-ready prompt is needed to hand off to Claude Code / another AI agent.
38
+
39
+ ## Core principles (Karpathy-style, think-before-code)
40
+
41
+ 1. **Think before code.** Architecture first, implementation second. Do not rush to code.
42
+ 2. **Simplicity first.** KISS / YAGNI / DRY — the minimal sufficient solution. No speculative features.
43
+ 3. **Surgical changes.** Touch only what is required. Do not "improve" adjacent code.
44
+ 4. **Goal-driven.** Every step has a verifiable success criterion.
45
+ 5. **Anti-hallucination.** Do not invent files, functions, or APIs. Only what actually exists in
46
+ the code (verified via Read/Grep/Glob).
47
+ 6. **Surface assumptions.** Explicitly mark anything inferred on behalf of the operator as
48
+ `ASSUMPTION:`.
49
+ 7. **Ask, don't guess.** If anything is ambiguous — stop, name the ambiguity, ask.
50
+
51
+ ## Input
52
+
53
+ The operator passes via `$ARGUMENTS`:
54
+
55
+ - a free-form feature description, OR
56
+ - a path to a file with the description (`task.md`, issue dump from a tracker, dialog excerpt).
57
+
58
+ If `$ARGUMENTS` is empty — request a feature description. Do not infer requirements on the
59
+ operator's behalf. If the project uses an issue tracker (Jira/Linear/GitHub Issues) — ask for
60
+ the task ID and reference it in the final prompt.
61
+
62
+ ## Pipeline
63
+
64
+ ### STEP 1 — Understanding
65
+
66
+ Extract from the input:
67
+
68
+ - **Goal** — one sentence: what the user gets in the end.
69
+ - **SDK components** — which layers are affected: `tool`, `prompt`, `resource`, `config`, `auth`,
70
+ `transport` (STDIO/HTTP/SSE), REST endpoint, CLI script, tests, documentation.
71
+ - **Input / expected output** — for features with an API or MCP tool: request format → response
72
+ format.
73
+ - **Constraints** — performance, security, compatibility, deadline, dependencies.
74
+ - **Ambiguities** — enumerate them explicitly.
75
+
76
+ If ambiguities exist — ask the operator clarifying questions **before** analyzing the code.
77
+ If the operator says "decide yourself" — record the decision as `ASSUMPTION:`.
78
+
79
+ ### STEP 2 — Codebase Discovery
80
+
81
+ **Real Read/Grep/Glob only. No guesses.**
82
+
83
+ Baseline input reads (universal for fa-mcp-sdk projects):
84
+
85
+ - `CLAUDE.md` — project rules, commands, protocols.
86
+ - `package.json` — dependencies, scripts, `fa-mcp-sdk` version, package manager in use.
87
+ - `README.md` — general context.
88
+ - `tsconfig.json` — TypeScript settings (`strict`, `moduleResolution`, `paths`).
89
+ - `FA-MCP-SDK-DOC/` (if present) — framework documentation; entry point
90
+ `00-FA-MCP-SDK-index.md`, then by topic: `02-1-tools-and-api.md`,
91
+ `02-2-prompts-and-resources.md`, `03-configuration.md`, `04-authentication.md`,
92
+ `06-utilities.md`, `07-testing-and-operations.md`.
93
+ - `config/default.yaml` (+ `config/local.yaml` if present) — current configuration.
94
+ - `src/start.ts` (or equivalent) — entry point; how `McpServerData` is assembled and
95
+ `initMcpServer()` is called.
96
+
97
+ Then — targeted by the feature's topic:
98
+
99
+ - `src/tools/` — if the feature adds/changes an MCP tool: find similar tools, learn the pattern
100
+ (`ToolWithHandler`, `inputSchema`, `annotations`, `handler`).
101
+ - `src/prompts/`, `src/resources/` — if the feature concerns prompts/resources.
102
+ - `src/lib/` — common utilities: HTTP client, logger, errors, cache, concurrency.
103
+ - `src/_types_/` (or `src/types/`) — domain types, `CustomAppConfig`.
104
+ - `tests/` — test layout (STDIO/HTTP), existing helpers, emulators.
105
+ - `scripts/` — auxiliary scripts that might be reused.
106
+
107
+ Identify and document:
108
+
109
+ 1. **Reusable artifacts** — functions/classes/types that already solve adjacent problems.
110
+ For each, cite `path/to/file.ts:<line>` and describe what it does.
111
+ 2. **Similar features/tools** — the implementation pattern to be replicated (do not reinvent).
112
+ 3. **Dependencies in `package.json`** — what is already installed and solves adjacent tasks.
113
+ Do not pull new npm packages without necessity.
114
+ 4. **SDK extension points** — which `fa-mcp-sdk` exports to use: `initMcpServer`, `appConfig`,
115
+ `formatToolResult`, `ToolExecutionError`, types `ToolWithHandler`, `IToolHandlerParams`,
116
+ `ITransportContext`, etc.
117
+ 5. **Configuration** — which new fields are needed in `config/default.yaml`, whether mapping in
118
+ `config/custom-environment-variables.yaml` is required, how to type them in `CustomAppConfig`.
119
+ 6. **Authentication / authorization** — if the feature introduces an endpoint or tool requiring
120
+ permissions, cross-check with `webServer.auth` and `jiraHeadersAuthValidator`-style patterns.
121
+ 7. **Duplication risks** — where logic might get duplicated; how to avoid it.
122
+
123
+ The step's output is a "Reusable Artifacts" section, e.g.
124
+ `src/lib/http-client.ts:42 — createHttpClient(): use for all requests with per-request auth`.
125
+
126
+ ### STEP 3 — Architecture Design
127
+
128
+ Apply **multi-role thinking**:
129
+
130
+ - **Architect**: system integrity, module boundaries, how the feature fits the SDK architecture
131
+ (tool vs prompt vs resource vs REST endpoint vs lib). Abstraction selection.
132
+ - **Senior dev**: correctness, typing, error handling, idempotency, concurrency, performance,
133
+ transport compatibility (STDIO/HTTP/SSE).
134
+ - **QA**: edge cases, failure modes, regressions, observability (logs, metrics).
135
+
136
+ Describe:
137
+
138
+ - The minimal sufficient solution (KISS).
139
+ - Which **existing** abstractions are reused, which **new** ones are introduced — and why.
140
+ - If alternatives exist — briefly list them with a justification for the chosen variant.
141
+ - Data flow: `input → validation → action → formatting → output`.
142
+ - SDK patterns: tool handler via `ToolWithHandler`, per-request context (`httpClient`, `logger`,
143
+ `mcpRequestHeaders`), response via `formatToolResult`, errors via `ToolExecutionError`.
144
+
145
+ Explicit prohibitions:
146
+
147
+ - Do not invent SDK methods/exports that do not exist. Cross-check with `FA-MCP-SDK-DOC/`.
148
+ - Do not add "for the future" (YAGNI). Only what is required now.
149
+ - Do not introduce a new npm dependency if the same task is solved by an existing one.
150
+
151
+ ### STEP 4 — Implementation Plan
152
+
153
+ Table: each row is one file, one action.
154
+
155
+ ```
156
+ <path/to/file> — <create | modify | delete> — <what exactly we do, one line>
157
+ ```
158
+
159
+ Under each row — 2–5 specific bullets: which function, where exactly, with what signature.
160
+
161
+ Group by layers in dependency order:
162
+
163
+ 1. Types (`src/_types_/*.ts`)
164
+ 2. Configuration (`config/*.yaml`, `src/bootstrap/*.ts`)
165
+ 3. Utilities / lib (`src/lib/*.ts`)
166
+ 4. Tool / prompt / resource / REST handler (`src/tools/**/*.ts` or `src/rest/*.ts`)
167
+ 5. Registration in `src/start.ts` (if needed)
168
+ 6. Tests (`tests/**`)
169
+ 7. Documentation (`CLAUDE.md`, `README.md`, `FA-MCP-SDK-DOC/*` — only if the feature genuinely
170
+ requires it)
171
+
172
+ For each "create", reference an **existing template file** (file:line) whose pattern must be
173
+ replicated. For each "modify" and "delete", verify via Read/Glob that the file actually exists.
174
+
175
+ ### STEP 5 — Code Examples
176
+
177
+ Concrete TypeScript snippets:
178
+
179
+ - Strict typing, no `any`, no stubs, no `TODO`/`FIXME`.
180
+ - Signatures of new functions/classes.
181
+ - Interfaces/DTOs with TSDoc on every field.
182
+ - Tool-handler skeleton following the project pattern:
183
+
184
+ ```ts
185
+ import type { ToolWithHandler, ToolContext } from '../../_types_/tool.js';
186
+
187
+ export const <tool_name>: ToolWithHandler = {
188
+ name: '<tool_name>',
189
+ description: '...',
190
+ inputSchema: { type: 'object', properties: { /* ... */ }, required: [/* ... */] },
191
+ annotations: { title: '...', readOnlyHint: <bool>, destructiveHint: <bool> },
192
+ handler: async (args, ctx: ToolContext) => { /* ... */ },
193
+ };
194
+ ```
195
+
196
+ - YAML config fragment and matching typing in `CustomAppConfig`.
197
+ - SQL / migrations — only if the project actually uses a DB and the feature requires it.
198
+
199
+ File names, imports (`.js` extensions for ESM), comment style — as used in the project
200
+ (cross-check existing files and `CLAUDE.md`).
201
+
202
+ ### STEP 6 — Testing Strategy
203
+
204
+ Describe:
205
+
206
+ - **Unit tests** — which functions to cover; cases happy + edge + error.
207
+ - **Integration tests** — if the project provides an MCP test runner
208
+ (`tests/mcp/<project>.js`, STDIO/HTTP transports) — describe scenarios for those mechanisms.
209
+ - **Agent Tester / Headless API** — if the feature changes a tool and the project has an Agent
210
+ Tester (`/agent-tester/api/chat/test`): describe expected LLM behavior (which tool it picks,
211
+ with what arguments, how it formulates the answer).
212
+ - **Manual checks** — `yarn build && yarn start`, then HTTP (curl/PowerShell) or an MCP client;
213
+ command + expected output.
214
+ - **Edge cases** — empty input, invalid values, missing external service, concurrent calls,
215
+ limit overflow, network failure, 401/403/5xx.
216
+ - **Response format** — structure of the success and error responses of the tool/API.
217
+
218
+ Each test case: "action → expected result". Numbered.
219
+
220
+ ### STEP 7 — Execution Instructions
221
+
222
+ Commands with expected output. **Check `package.json`** to use the correct package manager
223
+ (`yarn` vs `npm`) and correct script names. Typical set:
224
+
225
+ ```bash
226
+ <yarn|npm run> lint # expect: 0 errors
227
+ <yarn|npm run> typecheck # expect: 0 errors
228
+ <yarn|npm run> build # expect: dist/ compiled
229
+ <yarn|npm> test # expect: all tests pass
230
+ <yarn|npm> start # expect: server boots, tools registered
231
+ ```
232
+
233
+ Plus a smoke test of the feature itself: a concrete curl / MCP request / STDIO call with
234
+ expected response.
235
+
236
+ ### STEP 8 — Success Criteria
237
+
238
+ Binary checklist:
239
+
240
+ - [ ] Tool `<name>` (or endpoint/prompt/resource) is registered and visible in the tools list.
241
+ - [ ] Unit and integration tests are added and passing.
242
+ - [ ] Lint + typecheck green.
243
+ - [ ] New config fields are documented (`config/default.yaml` + `CLAUDE.md`, where appropriate).
244
+ - [ ] No duplication with existing code (explicitly list what was reused).
245
+ - [ ] All enumerated edge cases are covered by tests.
246
+ - [ ] Observability: logs/errors are informative, no secrets leaked.
247
+
248
+ ## Multi-agent review (internal check before release)
249
+
250
+ Run the result through three roles:
251
+
252
+ **🏗️ Architect check**
253
+ - Does the feature fit the SDK architecture without distortions?
254
+ - Are existing abstractions reused?
255
+ - Are there any extra layers / premature abstractions?
256
+
257
+ **👨‍💻 Senior dev check**
258
+ - Is the code strictly typed; are errors handled via `ToolExecutionError` / typed classes?
259
+ - Any race conditions, leaks, unhandled rejections?
260
+ - ESM imports with `.js` extensions? Project style followed?
261
+
262
+ **🧪 QA check**
263
+ - Are all edge cases covered by tests?
264
+ - Are there tests for errors, not just the happy path?
265
+ - How does the feature behave when external dependencies are missing (network, DB, auth service)?
266
+
267
+ If any check fails — rework the prompt and only then release it.
268
+
269
+ ## Skill output
270
+
271
+ The operator's response consists of two parts + mandatory saving to a file.
272
+
273
+ ### Mandatory saving of the result to a file
274
+
275
+ **ALWAYS** after generation, save the result (Part A + Part B in full, exactly as it goes to the
276
+ operator) into a **markdown file in the repository root**.
277
+
278
+ - File name: `prop-<short-descriptive-name>.md`
279
+ - `<short-descriptive-name>` — kebab-case, 2–6 English words capturing the feature's essence.
280
+ Examples: `prop-oauth2-token-refresh.md`, `prop-config-env-override.md`,
281
+ `prop-bulk-comment-tool.md`.
282
+ - If a file with that name already exists — append a numeric suffix `-2`, `-3`, … **without
283
+ overwriting**.
284
+ - File content — identical to what is printed in chat: Part A → separator → Part B
285
+ (including the heading `# === PROMPT FOR AI CLI — …`).
286
+ - In the operator reply, explicitly state the path to the saved file.
287
+
288
+ ### Part A — brief summary for the operator
289
+
290
+ - **Goal** (one sentence)
291
+ - **Expanded problem statement** (2–5 lines)
292
+ - **SDK components and affected layers** (tool/prompt/config/auth/...)
293
+ - **3–5 key architectural decisions** (with justification)
294
+ - **Reusable artifacts** (list with `file:line` paths)
295
+ - **Explicit assumptions** (if any)
296
+ - **Open questions** (if any remain)
297
+
298
+ ### Part B — self-sufficient prompt for the AI CLI
299
+
300
+ Separate with an explicit heading:
301
+
302
+ ```
303
+ # === PROMPT FOR AI CLI — <TICKET-ID | FEATURE-SLUG>: <title> ===
304
+ ```
305
+
306
+ The prompt contains exactly 15 sections:
307
+
308
+ 1. **Context** — goal, components, affected layers.
309
+ 2. **Mandatory input reads** — list of files "read before starting":
310
+ `CLAUDE.md`, `package.json`, `FA-MCP-SDK-DOC/*.md` (if present), `config/default.yaml`,
311
+ `src/start.ts`, + targeted files by topic.
312
+ 3. **Preconditions** — system state, access, dependencies, environment variables.
313
+ 4. **Functional requirements** — numbered list of "what must work".
314
+ 5. **Non-functional requirements** — performance, security, logging, compatibility
315
+ (if critical — different transports / API versions), concurrency.
316
+ 6. **Workflow** — step-by-step "who → to whom → what → result".
317
+ 7. **Branches and errors** — explicit deviation cases and how they are handled
318
+ (via `ToolExecutionError`, HTTP codes, structured logs).
319
+ 8. **Interfaces** — tool `inputSchema` / REST signature / DTOs with sample payloads.
320
+ 9. **Data changes** — migrations/DDL, if the feature uses a DB; otherwise
321
+ "not required — feature without DB".
322
+ 10. **Change plan** — table "file → action → what we do" (from STEP 4).
323
+ 11. **Code examples** — concrete snippets (from STEP 5), with file headers and TSDoc.
324
+ 12. **Code standard** — short extract of project rules from `CLAUDE.md` + key SDK rules:
325
+ ESM imports with `.js` extension, use `appConfig` instead of reading config directly,
326
+ response via `formatToolResult`, strict typing.
327
+ 13. **Test cases** — numbered "action → expected result" (from STEP 6).
328
+ 14. **Execution instructions** — commands with expected outcomes (from STEP 7).
329
+ 15. **Success criteria** — checklist (from STEP 8).
330
+
331
+ Hard rules for the prompt:
332
+
333
+ - The prompt **does not reference** this skill. No phrases like "as said in the skill" or
334
+ "per the instructions above".
335
+ - Do not leave `TODO`/`FIXME`, stubs, "code example omitted", `any`, empty sections.
336
+ - If a section is not applicable — state it explicitly: "not required — <one-line reason>".
337
+ - All paths — relative to the repository root, POSIX separators (`/`).
338
+ - The prompt must read as a standalone spec — without knowledge that it was produced by a skill.
339
+
340
+ ## Anti-bullshit mode (hard prohibitions)
341
+
342
+ - ❌ Inventing files, functions, exports, SDK methods. Only what is verified via Read/Grep/Glob
343
+ and/or documented in `FA-MCP-SDK-DOC/`.
344
+ - ❌ Vague wording like "implement correctly", "handle properly". Specifics only: what, where, how.
345
+ - ❌ "Bonus features" — do not add what was not asked for (YAGNI).
346
+ - ❌ `any`, stubs, `throw new Error('Not implemented')`, `// TODO: ...`.
347
+ - ❌ Suggesting to rewrite adjacent modules if not asked (Surgical changes).
348
+ - ❌ Hardcoding secrets, URLs, credentials — only via `appConfig` / ENV.
349
+ - ✅ All disputable decisions — EXPLICITLY as `ASSUMPTION:` with rollback possibility.
350
+
351
+ ## Quality gate before release (mandatory checklist)
352
+
353
+ - [ ] Part B contains all 15 sections, or an explicit "not required — …" with justification.
354
+ - [ ] Every cited source file actually exists (verified via Read/Glob).
355
+ - [ ] Every reusable function is cited with a `file:line` path.
356
+ - [ ] No references to "see the skill" / "as agreed earlier" / "per our conversation".
357
+ - [ ] Code examples are compilable: types imported, no `any`, TSDoc present, correct
358
+ `.js` extensions in ESM imports.
359
+ - [ ] Execution commands match `package.json` (correct package manager and script names).
360
+ - [ ] Tests cover edge cases and errors, not just the happy path.
361
+ - [ ] All three reviews passed: Architect, Senior dev, QA.
362
+ - [ ] Result saved to `prop-<kebab-name>.md` in the repository root; path reported to the operator.
363
+
364
+ If at least one item fails — improve the prompt, then release.
@@ -0,0 +1 @@
1
+ https://www.skillsdirectory.com/skills/armanzeroeight-readme-generator?utm_source=chatgpt.com
@@ -0,0 +1,237 @@
1
+ ---
2
+ name: readme-generator
3
+ description: Generates structured, user-friendly README.md for MCP servers built with fa-mcp-sdk. Detects which SDK subsystems are enabled (Consul, AD, DB, Admin Panel, Agent Tester, Webhooks, etc.) and which project-specific features exist, then decides which sections to inline vs. move to satellite readme-docs/*.md files. Use when creating or refreshing README for an fa-mcp-sdk-based MCP server project.
4
+ ---
5
+
6
+ # MCP Server README Generator
7
+
8
+ Generates a `README.md` tailored to MCP servers built on `fa-mcp-sdk`. The README answers three
9
+ progressive questions — *what is this?*, *how do I use it?*, *how do I operate it?* — without
10
+ drowning casual readers in operational detail.
11
+
12
+ ## Philosophy
13
+
14
+ Three-level information hierarchy:
15
+
16
+ **Level 1 — What & how to use it (first 30 seconds for the consumer)**
17
+
18
+ - What this MCP server is for
19
+ - What tools it exposes
20
+ - How to connect from Claude Code / Claude Desktop / Qwen Code (the simplest path)
21
+
22
+ **Level 2 — Features & basics (interested reader)**
23
+
24
+ - Enabled fa-mcp-sdk subsystems, project-specific capabilities, transports, essential config
25
+
26
+ **Level 3 — Operations (deployer / maintainer)**
27
+
28
+ - Build & run, full configuration, deep technical topics
29
+
30
+ Level 1 and 2 live in the main README. Level 3 content longer than ~15 lines moves to satellite
31
+ Markdown files under `readme-docs/`. The main README stays scannable; deep detail is one click away.
32
+
33
+ ## The `readme-docs/` folder is load-bearing
34
+
35
+ Satellite Markdown files **must** live in `readme-docs/` at the project root. The fa-mcp-sdk
36
+ `doc://readme` MCP resource looks for exactly that folder name: on server start it reads
37
+ `README.md`, finds every link pointing into `readme-docs/`, appends those satellite files (each
38
+ separated by `\n\n---\n\n`) and rewrites the in-text links to `See "<heading>" below` so the
39
+ assembled document reads naturally.
40
+
41
+ This means:
42
+
43
+ - The entire documentation is delivered through `doc://readme` as one searchable markdown
44
+ document — essential for the MCP registry's RAG indexing.
45
+ - Any satellite file *not* linked from `README.md` is **not** included in the resource. If you
46
+ add a new `readme-docs/*.md` file, link to it from the main README.
47
+ - Do not rename the folder. Any other name (`docs/`, `doc/`, `readme-parts/` etc.) will be
48
+ ignored by the SDK and the satellite content will not reach RAG.
49
+
50
+ ## Dynamic detection is mandatory
51
+
52
+ The set of satellite files is **not fixed**. The skill inventories the project, decides per feature
53
+ whether it is enabled, and only then produces the matching README sections and `readme-docs/*.md` files.
54
+ **Do not create a satellite file for a disabled feature.** Do not emit empty sections.
55
+
56
+ ## Workflow
57
+
58
+ ### Step 1 — Inventory the project
59
+
60
+ Collect, from the actual repository:
61
+
62
+ **Metadata**
63
+
64
+ - `package.json` → `name`, `version`, `description`, `dependencies`
65
+ - Git remote URL, license file
66
+
67
+ **Configuration** (merge `config/default.yaml` with `config/local.yaml` if present)
68
+
69
+ - `webServer.port` — default port for Quick Start commands
70
+ - Custom per-request header names (grep `x-<prefix>-` in `src/`)
71
+ - Enabled/disabled status for each optional subsystem (see table below)
72
+
73
+ **Code surface**
74
+
75
+ - `src/tools/` — tool list + each tool's domain group
76
+ - `src/start.ts` — transports registered, custom auth validators
77
+ - `src/api/` — existence + routes (custom REST API)
78
+ - `src/prompts/` — existence + prompt list
79
+ - `src/custom-resources.ts` — existence
80
+ - `.claude/skills/*/SKILL.md` — catalog of in-project skills
81
+
82
+ **Optional fa-mcp-sdk subsystems — detect each**
83
+
84
+ | Subsystem | Detect via | Enabled marker |
85
+ |----------------------------------|------------------------------------------------------|-------------------------|
86
+ | Consul (service discovery) | `consul.service.enable` | `true` |
87
+ | Active Directory (group checks) | `ad.domains.*` | non-empty |
88
+ | PostgreSQL (with pgvector) | `db.*` + imports from `pg-db.js` | both present |
89
+ | Custom REST API | `src/api/` + `webServer.customApi.*` | folder non-empty |
90
+ | Prompts | `src/prompts/` | folder non-empty |
91
+ | Custom Resources | `src/custom-resources.ts` | file exists |
92
+ | Admin Panel (token UI) | `adminPanel.enabled` | `true` |
93
+ | Agent Tester + Headless API | `agentTester.enabled` | `true` |
94
+ | Swagger UI | `swagger.enabled` | `true` |
95
+ | Cache (node-cache) | `cache.*` referenced in `src/` | used |
96
+ | Webhook callback (`x-web-hook`) | `x-web-hook` in `src/` OR tool handler returns `hook` | used |
97
+ | Impersonation (`x-on-behalf-of-user`) | `impersonalizationPlugin.*` in config | present |
98
+ | JWT auth | `webServer.auth.jwt.*` or `webServer.genJwtApiEnable` | present/true |
99
+ | Configurable tool set | `<upstream>.usedInstruments` | present |
100
+
101
+ **Project-specific capabilities** — anything non-trivial not covered above:
102
+
103
+ - Fuzzy entity resolution, batch-operation limits, per-endpoint caching strategy,
104
+ API-version auto-detection (Cloud vs Server), automatic labeling of created entities,
105
+ required-fields pre-flight validation, content-format conversion (Markdown ↔ ADF / Storage
106
+ Format), etc.
107
+ - Any tool-group-specific quirks worth highlighting.
108
+
109
+ Record all findings in a working note — they drive the decisions in the next step.
110
+
111
+ ### Step 2 — Classify findings: drop / inline / satellite
112
+
113
+ For each finding, pick placement:
114
+
115
+ - **Drop** — feature not used; no section, no satellite file.
116
+ - **Inline** — description ≤ ~15 lines. Put a short subsection in the main README.
117
+ - **Satellite** — description > ~15 lines, OR the topic contains reference tables, priority rules,
118
+ request/response schemas, long examples. Create `readme-docs/<kebab-name>.md` and link to it from the
119
+ main README with a 2–3 sentence summary.
120
+
121
+ **Always satellite** (do not inline even if short):
122
+
123
+ - Authentication resolution order / priority tables
124
+ - Webhook body schema + per-tool hook priority rules
125
+ - Headless Agent Tester full argument list and scenario matrix
126
+ - Full configuration reference tables (> 15 parameters)
127
+ - Consul / AD / Database detailed setup
128
+
129
+ **Always inline in the main README** (never moved out):
130
+
131
+ - Tool list (grouped table) — users need to see the API surface
132
+ - Quick Start commands
133
+ - **MCP Client Integration** JSON snippets (Claude Code / Desktop / Qwen Code) — adapted to this
134
+ server's actual custom header names
135
+ - Key Features bullet list
136
+
137
+ ### Step 3 — Build main README section list
138
+
139
+ Canonical section order. Include only sections backed by actual findings; omit anything empty.
140
+
141
+ 1. **Title + one-line description** (from `package.json`)
142
+ 2. **Badges** — build, license, language, key stack badges via shields.io
143
+ 3. **Overview** — 2–4 sentences. Answers: what is this, for whom, core value
144
+ 4. **Tools** — grouped table, `## Tools (<count>)` with per-domain `###` subsections
145
+ 5. **Quick Start** — install, run, minimal verification (3 short steps)
146
+ 6. **MCP Client Integration** — Claude Code (HTTP), Claude Desktop (STDIO + `mcp-remote` /
147
+ direct STDIO), Qwen Code. Use the server's actual custom header names
148
+ (e.g. `x-jira-token`, `x-wiki-username`)
149
+ 7. **Key Features** — 5–8 bullets. Include enabled SDK subsystems and project-specific capabilities
150
+ 8. **Transports** — short bulleted list with endpoints (`/mcp`, `/api/*`, `/docs`, `/health`,
151
+ `/admin`, `/agent-tester`, STDIO for Claude Desktop)
152
+ 9. **Configuration Basics** — 5–10 most important keys in a compact table; link to
153
+ `readme-docs/configuration.md` when the full reference is long
154
+ 10. **Build & Run / Deployment** — minimal commands, environment variables
155
+ 11. **Authentication** — 2–4 sentences + link to `readme-docs/authentication.md` (satellite is mandatory
156
+ when non-trivial auth is present)
157
+ 12. **Feature sections (dynamic)** — one short subsection per enabled optional subsystem and per
158
+ notable project-specific capability. Each: 2–3 sentences + link to its `readme-docs/*.md` when a
159
+ satellite is warranted. Typical candidates:
160
+ - Consul service discovery → `readme-docs/consul.md`
161
+ - Active Directory integration → `readme-docs/active-directory.md`
162
+ - PostgreSQL / pgvector → `readme-docs/database.md`
163
+ - Custom REST API → link to Swagger UI (`/docs`) and/or `readme-docs/api.md`
164
+ - Admin panel → inline or `readme-docs/admin-panel.md`
165
+ - Agent Tester + Headless API → `readme-docs/testing.md`
166
+ - Webhook callback → `readme-docs/webhooks.md`
167
+ - Impersonation → `readme-docs/impersonation.md`
168
+ - Project-specific: fuzzy resolution, caching strategy, API version detection, batch limits,
169
+ content-format conversion, etc. → `readme-docs/<topic>.md` as appropriate
170
+ 13. **Skills** — short paragraph linking to `SKILL_README.md` in repo root (kept at root by
171
+ convention established in existing fa-mcp-sdk projects)
172
+ 14. **Stack** — 4–7 bullets: framework (`fa-mcp-sdk`), transport, language, key libs
173
+ 15. **License**
174
+
175
+ ### Step 4 — Generate `README.md`
176
+
177
+ Apply the canonical section order from Step 3. Respect these rules:
178
+
179
+ - H1 is the project name only — no duplicate title in the next line.
180
+ - Tool table column widths consistent within the file. Tool names as inline code.
181
+ - Every code fence has a language specifier (` ```bash `, ` ```json `, ` ```yaml `, ` ```typescript `).
182
+ - `webServer.port` in commands matches the actual value from `config/default.yaml`.
183
+ - Custom header names in Client Integration snippets match what the server actually reads.
184
+ - Relative links for internal references: `[…](./readme-docs/authentication.md)`.
185
+ - Line length ≤ 120 chars where practical. Exceptions: URLs, code blocks, tables.
186
+ - No marketing superlatives. Active voice. Short paragraphs (2–4 sentences).
187
+
188
+ See `reference/templates.md` for canonical blocks.
189
+
190
+ ### Step 5 — Generate satellite `readme-docs/*.md` files
191
+
192
+ For each finding classified as *satellite* in Step 2, create a Markdown file under `readme-docs/` (create
193
+ the folder if missing). Use `reference/satellite-templates.md` as a starting point — skeletons are
194
+ provided for common topics (authentication, testing, webhooks, consul, active-directory, database,
195
+ configuration). **Adapt every skeleton to actual values from the project.**
196
+
197
+ For project-specific capabilities (fuzzy resolution, custom endpoints, etc.) compose a new
198
+ `readme-docs/<kebab-name>.md` with sections: *Overview*, *How it works*, *Configuration*, *Examples*.
199
+
200
+ Every satellite MD begins with a 1-sentence summary so it stands alone when opened directly.
201
+
202
+ ### Step 6 — Update `SKILL_README.md`
203
+
204
+ If `.claude/skills/` is non-empty, regenerate `SKILL_README.md` in the repository root. Keep the
205
+ existing format (seen in mcp-jira / mcp-wiki): per-skill sections with command, launch mode,
206
+ arguments table, examples. **Do not move this file into `readme-docs/`** — the projects' convention keeps
207
+ it at the root.
208
+
209
+ ### Step 7 — Validate
210
+
211
+ Run through this checklist before declaring done:
212
+
213
+ - [ ] Canonical section order followed; no empty headings
214
+ - [ ] Every section in the main README is ≤ ~40 lines, or split into a satellite
215
+ - [ ] Tool count in the `## Tools (<count>)` heading matches the table
216
+ - [ ] Every satellite link resolves to an existing file in `readme-docs/`
217
+ - [ ] No satellite file for a disabled feature
218
+ - [ ] `webServer.port` in all commands matches `config/default.yaml`
219
+ - [ ] Custom header names in Client Integration match those the server parses
220
+ - [ ] JSON snippets are valid JSON; YAML snippets are valid YAML
221
+ - [ ] Every code fence has a language tag
222
+ - [ ] Relative links use `./readme-docs/...` form
223
+ - [ ] Line length ≤ 120 chars outside URLs / code / tables
224
+ - [ ] Previous README backed up to `README.backup.md` when rewriting
225
+
226
+ ## Output
227
+
228
+ 1. `README.md` — restructured per canonical order
229
+ 2. `readme-docs/<topic>.md` — one per satellite topic, only those the project needs
230
+ 3. `SKILL_README.md` — regenerated if `.claude/skills/` is present
231
+ 4. `README.backup.md` — backup of previous README when rewriting
232
+
233
+ ## References
234
+
235
+ - `reference/templates.md` — canonical section blocks for the main README
236
+ - `reference/satellite-templates.md` — skeletons for common `readme-docs/*.md` files
237
+ - `reference/best-practices.md` — writing style and formatting guidelines