@redpanda-data/docs-extensions-and-macros 4.13.6 → 4.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/doc-tools-mcp.js +84 -131
- package/bin/doc-tools.js +105 -192
- package/bin/mcp-tools/generated-docs-review.js +11 -158
- package/bin/mcp-tools/index.js +0 -4
- package/bin/mcp-tools/mcp-validation.js +44 -149
- package/mcp/COSTS.adoc +7 -17
- package/mcp/DEVELOPMENT.adoc +2 -175
- package/mcp/README.adoc +27 -61
- package/mcp/WRITER_EXTENSION_GUIDE.adoc +128 -738
- package/package.json +1 -1
- package/bin/mcp-tools/content-review.js +0 -196
- package/bin/mcp-tools/frontmatter.js +0 -138
- package/bin/mcp-tools/prompt-discovery.js +0 -283
- package/mcp/prompts/README.adoc +0 -183
- package/mcp/prompts/property-docs-guide.md +0 -283
- package/mcp/prompts/review-for-style.md +0 -128
- package/mcp/prompts/rpcn-connector-docs-guide.md +0 -126
- package/mcp/prompts/write-new-guide.md +0 -222
- package/mcp/team-standards/style-guide.md +0 -321
- package/mcp/templates/README.adoc +0 -212
- package/mcp/templates/prompt-review-template.md +0 -80
- package/mcp/templates/prompt-write-template.md +0 -110
- package/mcp/templates/resource-template.md +0 -76
|
@@ -1,814 +1,204 @@
|
|
|
1
|
-
=
|
|
1
|
+
= Extending MCP Tools
|
|
2
2
|
:toc:
|
|
3
3
|
:toc-title: Contents
|
|
4
4
|
|
|
5
5
|
== Overview
|
|
6
6
|
|
|
7
|
-
This guide
|
|
7
|
+
This guide covers extending the MCP server in `docs-extensions-and-macros`. For creating skills, agents, and other Claude Code extensions, see the https://github.com/redpanda-data/docs-team-standards[docs-team-standards] repository.
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
[cols="1,2,1"]
|
|
9
|
+
[cols="1,2,2"]
|
|
12
10
|
|===
|
|
13
|
-
|
|
|
14
|
-
|
|
15
|
-
|Prompts
|
|
16
|
-
|Pre-configured instructions for common tasks (review, write, check, etc.)
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|Resources
|
|
20
|
-
|Reference materials (style guides, templates, terminology) that AI can read
|
|
21
|
-
|
|
11
|
+
|Repository |Purpose |What to add there
|
|
22
12
|
|
|
23
|
-
|
|
24
|
-
|
|
|
13
|
+
|**docs-team-standards**
|
|
14
|
+
|Knowledge, guidance, orchestration
|
|
15
|
+
|Skills, agents, commands, rules, hooks
|
|
25
16
|
|
|
17
|
+
|**docs-extensions-and-macros**
|
|
18
|
+
|Execution tools
|
|
19
|
+
|MCP tools that need CLI/web access
|
|
26
20
|
|===
|
|
27
21
|
|
|
28
|
-
==
|
|
29
|
-
|
|
30
|
-
=== When to add a new prompt
|
|
31
|
-
|
|
32
|
-
Create a new prompt when you have a repeated task that would benefit from standardized instructions:
|
|
33
|
-
|
|
34
|
-
* Review content for a specific doc type (API reference, tutorial, troubleshooting)
|
|
35
|
-
* Generate content following a specific template
|
|
36
|
-
* Check for specific quality issues
|
|
37
|
-
* Refactor content in a consistent way
|
|
38
|
-
|
|
39
|
-
=== How auto-discovery works
|
|
40
|
-
|
|
41
|
-
The MCP server uses automatic prompt discovery, no code editing required.
|
|
42
|
-
|
|
43
|
-
* Save a `.md` file with YAML frontmatter in `mcp/prompts/`.
|
|
44
|
-
* The server automatically loads it at startup.
|
|
45
|
-
* No need to edit `bin/doc-tools-mcp.js` or any JavaScript files.
|
|
46
|
-
* Just validate, restart Claude Code, and use it!
|
|
47
|
-
|
|
48
|
-
=== Add a new prompt
|
|
49
|
-
|
|
50
|
-
==== Create the prompt file
|
|
51
|
-
|
|
52
|
-
Create a new `.md` file in `mcp/prompts/`:
|
|
53
|
-
|
|
54
|
-
[source,bash]
|
|
55
|
-
----
|
|
56
|
-
cd mcp/prompts
|
|
57
|
-
touch review-api-docs.md
|
|
58
|
-
----
|
|
59
|
-
|
|
60
|
-
==== Add YAML frontmatter
|
|
61
|
-
|
|
62
|
-
At the very top of your file, add metadata using YAML frontmatter:
|
|
63
|
-
|
|
64
|
-
[source,markdown]
|
|
65
|
-
----
|
|
66
|
-
---
|
|
67
|
-
description: "Review API documentation for completeness, clarity, and consistency with team standards"
|
|
68
|
-
version: "1.0.0"
|
|
69
|
-
arguments:
|
|
70
|
-
content:
|
|
71
|
-
description: "The API documentation content to review"
|
|
72
|
-
required: true
|
|
73
|
-
---
|
|
74
|
-
|
|
75
|
-
# Review API Documentation
|
|
76
|
-
|
|
77
|
-
You are reviewing API documentation for the Redpanda documentation team.
|
|
78
|
-
|
|
79
|
-
## Your Task
|
|
80
|
-
|
|
81
|
-
Review API documentation and check for:
|
|
82
|
-
1. [Specific thing to check]
|
|
83
|
-
2. [Another thing to check]
|
|
84
|
-
3. [etc.]
|
|
85
|
-
|
|
86
|
-
## Resources Available
|
|
87
|
-
|
|
88
|
-
Read these resources first:
|
|
89
|
-
- `redpanda://style-guide` - Complete style guide
|
|
90
|
-
- `redpanda://terminology` - Approved terminology
|
|
91
|
-
|
|
92
|
-
## API Documentation Standards
|
|
93
|
-
|
|
94
|
-
[Explain what makes good API docs for your team]
|
|
95
|
-
|
|
96
|
-
### Required Sections
|
|
97
|
-
|
|
98
|
-
All API documentation must include:
|
|
99
|
-
- Overview (what the API does)
|
|
100
|
-
- Authentication requirements
|
|
101
|
-
- Request format (with example)
|
|
102
|
-
- Response format (with example)
|
|
103
|
-
- Error responses
|
|
104
|
-
- Code examples
|
|
105
|
-
|
|
106
|
-
### Format Requirements
|
|
107
|
-
|
|
108
|
-
[Your specific formatting rules]
|
|
109
|
-
|
|
110
|
-
## Output Format
|
|
111
|
-
|
|
112
|
-
Provide feedback in this structure:
|
|
113
|
-
|
|
114
|
-
### Critical Issues
|
|
115
|
-
[Format for issues]
|
|
116
|
-
|
|
117
|
-
### Suggestions
|
|
118
|
-
[Format for suggestions]
|
|
119
|
-
|
|
120
|
-
---
|
|
121
|
-
|
|
122
|
-
Please provide the API documentation you'd like me to review.
|
|
123
|
-
----
|
|
124
|
-
|
|
125
|
-
==== Validate your prompt
|
|
126
|
-
|
|
127
|
-
Run the validation command to check for errors:
|
|
128
|
-
|
|
129
|
-
[source,bash]
|
|
130
|
-
----
|
|
131
|
-
doc-tools validate-mcp
|
|
132
|
-
----
|
|
133
|
-
|
|
134
|
-
If validation passes, you're ready to use it!
|
|
135
|
-
|
|
136
|
-
==== Test it
|
|
137
|
-
|
|
138
|
-
Restart Claude Code and test your prompt:
|
|
139
|
-
|
|
140
|
-
[source,text]
|
|
141
|
-
----
|
|
142
|
-
Use the review-api-docs prompt with this content:
|
|
143
|
-
[paste some API docs]
|
|
144
|
-
----
|
|
145
|
-
|
|
146
|
-
=== Prompt template library
|
|
147
|
-
|
|
148
|
-
Copy and customize these templates for common prompt types:
|
|
149
|
-
|
|
150
|
-
==== Review prompt template
|
|
151
|
-
|
|
152
|
-
[source,markdown]
|
|
153
|
-
----
|
|
154
|
-
---
|
|
155
|
-
description: "Review [content type] for [specific aspects]"
|
|
156
|
-
version: "1.0.0"
|
|
157
|
-
arguments:
|
|
158
|
-
content:
|
|
159
|
-
description: "The content to review"
|
|
160
|
-
required: true
|
|
161
|
-
---
|
|
162
|
-
|
|
163
|
-
# [Type] Review Prompt
|
|
164
|
-
|
|
165
|
-
You are reviewing [content type] for the Redpanda documentation team.
|
|
166
|
-
|
|
167
|
-
## Your Task
|
|
168
|
-
|
|
169
|
-
Review the provided content and check for:
|
|
170
|
-
1. [Check 1]
|
|
171
|
-
2. [Check 2]
|
|
172
|
-
3. [Check 3]
|
|
173
|
-
|
|
174
|
-
## Resources
|
|
175
|
-
|
|
176
|
-
- `redpanda://style-guide`
|
|
177
|
-
- `redpanda://terminology`
|
|
178
|
-
|
|
179
|
-
## Standards for [Content Type]
|
|
180
|
-
|
|
181
|
-
[Specific standards]
|
|
182
|
-
|
|
183
|
-
## Output Format
|
|
184
|
-
|
|
185
|
-
### Critical Issues
|
|
186
|
-
[Format]
|
|
187
|
-
|
|
188
|
-
### Suggestions
|
|
189
|
-
[Format]
|
|
190
|
-
|
|
191
|
-
---
|
|
192
|
-
|
|
193
|
-
Please provide the content to review.
|
|
194
|
-
----
|
|
195
|
-
|
|
196
|
-
==== Writing prompt template
|
|
197
|
-
|
|
198
|
-
[source,markdown]
|
|
199
|
-
----
|
|
200
|
-
---
|
|
201
|
-
description: "Generate [content type] following team standards"
|
|
202
|
-
version: "1.0.0"
|
|
203
|
-
arguments:
|
|
204
|
-
topic:
|
|
205
|
-
description: "The topic to write about"
|
|
206
|
-
required: true
|
|
207
|
-
context:
|
|
208
|
-
description: "Additional context or requirements"
|
|
209
|
-
required: false
|
|
210
|
-
---
|
|
211
|
-
|
|
212
|
-
# Write [Content Type] Prompt
|
|
213
|
-
|
|
214
|
-
You are writing [content type] for the Redpanda documentation team.
|
|
215
|
-
|
|
216
|
-
## Your Task
|
|
217
|
-
|
|
218
|
-
Create [content type] that follows our standards.
|
|
219
|
-
|
|
220
|
-
## Resources
|
|
221
|
-
|
|
222
|
-
- `redpanda://style-guide`
|
|
223
|
-
- `redpanda://terminology`
|
|
224
|
-
- `redpanda://[content-type]-template` (if you have one)
|
|
225
|
-
|
|
226
|
-
## Standards
|
|
227
|
-
|
|
228
|
-
[Specific standards for this content type]
|
|
229
|
-
|
|
230
|
-
## Structure
|
|
231
|
-
|
|
232
|
-
[Required sections and format]
|
|
233
|
-
|
|
234
|
-
## Quality Checklist
|
|
235
|
-
|
|
236
|
-
- [Requirement 1]
|
|
237
|
-
- [Requirement 2]
|
|
238
|
-
- [Requirement 3]
|
|
239
|
-
|
|
240
|
-
---
|
|
241
|
-
|
|
242
|
-
Please provide:
|
|
243
|
-
1. **Topic**: [What to write about]
|
|
244
|
-
2. **[Other context]**: [Additional info needed]
|
|
245
|
-
----
|
|
246
|
-
|
|
247
|
-
== Adding new resources
|
|
248
|
-
|
|
249
|
-
=== When to add a new resource
|
|
250
|
-
|
|
251
|
-
Add a resource when you have reference material that AI should access:
|
|
252
|
-
|
|
253
|
-
* Templates for specific doc types
|
|
254
|
-
* Checklists for quality reviews
|
|
255
|
-
* Reference tables or lists
|
|
256
|
-
* Code style guides
|
|
257
|
-
* Workflow documentation
|
|
258
|
-
|
|
259
|
-
=== How auto-discovery works for resources
|
|
260
|
-
|
|
261
|
-
Resources are automatically discovered too!
|
|
262
|
-
|
|
263
|
-
* Add `.md` or `.json` files to `mcp/team-standards/`
|
|
264
|
-
* The server automatically makes them available
|
|
265
|
-
* No code editing required
|
|
266
|
-
* The filename becomes the resource URI (e.g., `api-template.md` → `redpanda://api-template`)
|
|
267
|
-
|
|
268
|
-
=== Step-by-step: add a new resource
|
|
269
|
-
|
|
270
|
-
Step 1: Create the resource file**
|
|
271
|
-
|
|
272
|
-
Add your file to `mcp/team-standards/`:
|
|
273
|
-
|
|
274
|
-
[source,bash]
|
|
275
|
-
----
|
|
276
|
-
cd mcp/team-standards
|
|
277
|
-
touch api-template.md
|
|
278
|
-
----
|
|
279
|
-
|
|
280
|
-
Step 2: Write the content**
|
|
281
|
-
|
|
282
|
-
Use Markdown or JSON format:
|
|
283
|
-
|
|
284
|
-
[source,markdown]
|
|
285
|
-
----
|
|
286
|
-
# API Documentation Template
|
|
287
|
-
|
|
288
|
-
Use this template when documenting API endpoints.
|
|
289
|
-
|
|
290
|
-
## Structure
|
|
291
|
-
|
|
292
|
-
= API Endpoint Name
|
|
293
|
-
:description: Brief description
|
|
294
|
-
|
|
295
|
-
Overview paragraph explaining what this endpoint does.
|
|
296
|
-
|
|
297
|
-
== Authentication
|
|
298
|
-
|
|
299
|
-
[Authentication requirements]
|
|
300
|
-
|
|
301
|
-
== Request
|
|
302
|
-
|
|
303
|
-
[Request format with example]
|
|
304
|
-
|
|
305
|
-
== Response
|
|
306
|
-
|
|
307
|
-
[Response format with example]
|
|
308
|
-
|
|
309
|
-
== Examples
|
|
310
|
-
|
|
311
|
-
[Code examples]
|
|
312
|
-
|
|
313
|
-
== Error responses
|
|
314
|
-
|
|
315
|
-
[Common errors]
|
|
316
|
-
----
|
|
317
|
-
|
|
318
|
-
Step 3: Validate the resource**
|
|
319
|
-
|
|
320
|
-
Run validation to ensure the file is accessible:
|
|
321
|
-
|
|
322
|
-
[source,bash]
|
|
323
|
-
----
|
|
324
|
-
npx doc-tools validate-mcp
|
|
325
|
-
----
|
|
326
|
-
|
|
327
|
-
Step 4: Reference it in prompts**
|
|
22
|
+
== Decision guide
|
|
328
23
|
|
|
329
|
-
|
|
24
|
+
=== Add to docs-team-standards when:
|
|
330
25
|
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
26
|
+
* You have **knowledge or guidance** to share (style rules, best practices)
|
|
27
|
+
* You want to create a **reusable workflow** (review process, content planning)
|
|
28
|
+
* The extension is **text-based** and doesn't need code execution
|
|
334
29
|
|
|
335
|
-
|
|
336
|
-
- `redpanda://terminology`
|
|
337
|
-
- `redpanda://api-template` - Use this template for structure
|
|
338
|
-
----
|
|
30
|
+
See the `skill-authoring` skill in docs-team-standards for detailed guidance on creating skills, agents, commands, and rules.
|
|
339
31
|
|
|
340
|
-
|
|
32
|
+
=== Add to docs-extensions-and-macros when:
|
|
341
33
|
|
|
342
|
-
|
|
34
|
+
* You need to **execute CLI commands** (doc-tools, git, npm)
|
|
35
|
+
* You need to **fetch data from the web** (GitHub API, version info)
|
|
36
|
+
* You need to **parse files programmatically** (JSON validation)
|
|
37
|
+
* The extension requires **Node.js code**
|
|
343
38
|
|
|
344
|
-
|
|
345
|
-
----
|
|
346
|
-
List available resources
|
|
347
|
-
----
|
|
39
|
+
== Adding MCP tools
|
|
348
40
|
|
|
349
|
-
|
|
41
|
+
Only add MCP tools when you need code execution. Most extensions should go in docs-team-standards.
|
|
350
42
|
|
|
351
|
-
===
|
|
43
|
+
=== When to add an MCP tool
|
|
352
44
|
|
|
353
|
-
|
|
45
|
+
Add an MCP tool when you need to:
|
|
354
46
|
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
- Examples
|
|
47
|
+
* Execute `doc-tools` CLI commands
|
|
48
|
+
* Make HTTP requests to external APIs
|
|
49
|
+
* Parse or validate files programmatically
|
|
50
|
+
* Run background jobs with progress tracking
|
|
360
51
|
|
|
361
|
-
|
|
362
|
-
----
|
|
363
|
-
# Resource Title
|
|
52
|
+
=== Tool implementation
|
|
364
53
|
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
Content here with examples.
|
|
368
|
-
|
|
369
|
-
## Another Section
|
|
370
|
-
|
|
371
|
-
More content.
|
|
372
|
-
----
|
|
54
|
+
See link:DEVELOPMENT.adoc[DEVELOPMENT.adoc] for detailed implementation guidance.
|
|
373
55
|
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
Best for:
|
|
377
|
-
- Structured data
|
|
378
|
-
- Terminology lists
|
|
379
|
-
- Configuration examples
|
|
380
|
-
- Reference tables
|
|
381
|
-
|
|
382
|
-
[source,json]
|
|
383
|
-
----
|
|
384
|
-
{
|
|
385
|
-
"category": {
|
|
386
|
-
"item1": {
|
|
387
|
-
"description": "Description here",
|
|
388
|
-
"example": "Example here"
|
|
389
|
-
},
|
|
390
|
-
"item2": {
|
|
391
|
-
"description": "Description here",
|
|
392
|
-
"example": "Example here"
|
|
393
|
-
}
|
|
394
|
-
}
|
|
395
|
-
}
|
|
396
|
-
----
|
|
56
|
+
**Location**: `bin/mcp-tools/<tool-name>.js`
|
|
397
57
|
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
=== Update style guide
|
|
401
|
-
|
|
402
|
-
Edit `mcp/team-standards/style-guide.md`:
|
|
403
|
-
|
|
404
|
-
[source,bash]
|
|
405
|
-
----
|
|
406
|
-
# Add new section or update existing content
|
|
407
|
-
vi mcp/team-standards/style-guide.md
|
|
408
|
-
----
|
|
409
|
-
|
|
410
|
-
Changes take effect immediately - just restart Claude Code.
|
|
411
|
-
|
|
412
|
-
=== Update terminology
|
|
413
|
-
|
|
414
|
-
Terminology is maintained in the official glossary sources:
|
|
415
|
-
|
|
416
|
-
- GitHub: https://github.com/redpanda-data/docs/tree/shared/modules/terms/partials (each term is a separate file)
|
|
417
|
-
- Published glossary: https://docs.redpanda.com/current/reference/glossary/
|
|
418
|
-
|
|
419
|
-
The style guide (`mcp/team-standards/style-guide.md`) includes a quick reference to common terms that points to the official glossary.
|
|
420
|
-
|
|
421
|
-
To add or update terms, update the glossary source files in the docs repository.
|
|
422
|
-
|
|
423
|
-
=== Update templates
|
|
424
|
-
|
|
425
|
-
Edit template files in `mcp/team-standards/`:
|
|
426
|
-
|
|
427
|
-
[source,bash]
|
|
428
|
-
----
|
|
429
|
-
# Example: Update a template resource
|
|
430
|
-
vi mcp/team-standards/api-template.md
|
|
431
|
-
----
|
|
432
|
-
|
|
433
|
-
Changes are immediately available to AI after restarting Claude Code.
|
|
434
|
-
|
|
435
|
-
== Adding new tools
|
|
436
|
-
|
|
437
|
-
Tools require JavaScript knowledge, but the pattern is straightforward.
|
|
438
|
-
|
|
439
|
-
=== When to add a new tool
|
|
440
|
-
|
|
441
|
-
Add a tool when you need to:
|
|
442
|
-
- Execute a doc-tools command that isn't covered
|
|
443
|
-
- Automate a multi-step process
|
|
444
|
-
- Integrate with external systems
|
|
445
|
-
- Perform custom validation
|
|
446
|
-
|
|
447
|
-
=== Tool template
|
|
448
|
-
|
|
449
|
-
Create a new file in `bin/mcp-tools/my-new-tool.js`:
|
|
58
|
+
**Basic structure**:
|
|
450
59
|
|
|
451
60
|
[source,javascript]
|
|
452
61
|
----
|
|
453
|
-
|
|
62
|
+
/**
|
|
63
|
+
* My Tool
|
|
64
|
+
*
|
|
65
|
+
* Brief description of what this tool does.
|
|
66
|
+
*/
|
|
67
|
+
|
|
68
|
+
const { findRepoRoot, executeCommand } = require('./utils');
|
|
454
69
|
|
|
455
70
|
/**
|
|
456
|
-
* Execute
|
|
71
|
+
* Execute the tool
|
|
457
72
|
* @param {Object} args - Tool arguments
|
|
458
|
-
* @returns {Object} Result
|
|
73
|
+
* @returns {Object} Result object
|
|
459
74
|
*/
|
|
460
|
-
function
|
|
75
|
+
function myTool(args) {
|
|
76
|
+
const repoRoot = findRepoRoot();
|
|
77
|
+
|
|
461
78
|
try {
|
|
462
|
-
//
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
}
|
|
469
|
-
|
|
470
|
-
// Build command
|
|
471
|
-
const command = ['my-command', args.required_param];
|
|
472
|
-
|
|
473
|
-
if (args.optional_param) {
|
|
474
|
-
command.push('--flag', args.optional_param);
|
|
475
|
-
}
|
|
476
|
-
|
|
477
|
-
// Execute
|
|
478
|
-
const result = executeCommand(command);
|
|
479
|
-
|
|
480
|
-
if (result.code === 0) {
|
|
481
|
-
return {
|
|
482
|
-
success: true,
|
|
483
|
-
message: 'Operation completed successfully',
|
|
484
|
-
output: result.stdout
|
|
485
|
-
};
|
|
486
|
-
} else {
|
|
487
|
-
return {
|
|
488
|
-
success: false,
|
|
489
|
-
error: result.stderr,
|
|
490
|
-
suggestion: 'Check the parameters and try again'
|
|
491
|
-
};
|
|
492
|
-
}
|
|
493
|
-
} catch (error) {
|
|
79
|
+
// Tool implementation
|
|
80
|
+
return {
|
|
81
|
+
success: true,
|
|
82
|
+
result: 'output'
|
|
83
|
+
};
|
|
84
|
+
} catch (err) {
|
|
494
85
|
return {
|
|
495
86
|
success: false,
|
|
496
|
-
error:
|
|
87
|
+
error: err.message
|
|
497
88
|
};
|
|
498
89
|
}
|
|
499
90
|
}
|
|
500
91
|
|
|
501
|
-
module.exports = {
|
|
502
|
-
----
|
|
503
|
-
|
|
504
|
-
Then register it in `bin/mcp-tools/index.js` and `bin/doc-tools-mcp.js`.
|
|
505
|
-
|
|
506
|
-
For tools, consider asking a developer for help or use this guide as a starting point.
|
|
507
|
-
|
|
508
|
-
== Testing your changes
|
|
509
|
-
|
|
510
|
-
=== Validation command
|
|
511
|
-
|
|
512
|
-
Before committing changes, **always run validation**:
|
|
513
|
-
|
|
514
|
-
[source,bash]
|
|
515
|
-
----
|
|
516
|
-
npx doc-tools validate-mcp
|
|
517
|
-
----
|
|
518
|
-
|
|
519
|
-
This command checks:
|
|
520
|
-
|
|
521
|
-
* All prompts load correctly and have valid frontmatter
|
|
522
|
-
* All resources are accessible
|
|
523
|
-
* Metadata is complete (descriptions, versions)
|
|
524
|
-
* No syntax errors in YAML or JSON
|
|
525
|
-
* No naming conflicts
|
|
526
|
-
|
|
527
|
-
Expected output:
|
|
528
|
-
|
|
529
|
-
[source,text]
|
|
530
|
-
----
|
|
531
|
-
Loading prompts...
|
|
532
|
-
Found 6 prompts
|
|
533
|
-
|
|
534
|
-
Validating configuration...
|
|
535
|
-
|
|
536
|
-
MCP Configuration Validation
|
|
537
|
-
============================================================
|
|
538
|
-
|
|
539
|
-
Prompts found: 6
|
|
540
|
-
Resources found: 1
|
|
541
|
-
|
|
542
|
-
✓ Validation passed
|
|
543
|
-
----
|
|
544
|
-
|
|
545
|
-
If validation fails, fix the errors before proceeding.
|
|
546
|
-
|
|
547
|
-
=== Preview command
|
|
548
|
-
|
|
549
|
-
Test a prompt without Claude Code:
|
|
550
|
-
|
|
551
|
-
[source,bash]
|
|
552
|
-
----
|
|
553
|
-
# Preview a review prompt
|
|
554
|
-
npx doc-tools preview-prompt review-for-style --content "Test content"
|
|
555
|
-
|
|
556
|
-
# Preview a write prompt
|
|
557
|
-
npx doc-tools preview-prompt write-new-guide --topic "Deploy cluster"
|
|
558
|
-
----
|
|
559
|
-
|
|
560
|
-
This shows exactly how your prompt will appear with arguments.
|
|
561
|
-
|
|
562
|
-
=== Test checklist
|
|
563
|
-
|
|
564
|
-
After adding or updating anything:
|
|
565
|
-
|
|
566
|
-
. Run validation:
|
|
567
|
-
+
|
|
568
|
-
[source,bash]
|
|
569
|
-
----
|
|
570
|
-
npx doc-tools validate-mcp
|
|
92
|
+
module.exports = { myTool };
|
|
571
93
|
----
|
|
572
94
|
|
|
573
|
-
|
|
574
|
-
+
|
|
575
|
-
[source,bash]
|
|
576
|
-
----
|
|
577
|
-
npx doc-tools preview-prompt [prompt-name] --content "Sample text"
|
|
578
|
-
----
|
|
579
|
-
|
|
580
|
-
. Restart Claude Code to load changes
|
|
581
|
-
|
|
582
|
-
. List available items in Claude Code:
|
|
583
|
-
+
|
|
584
|
-
[source,text]
|
|
585
|
-
----
|
|
586
|
-
List available prompts
|
|
587
|
-
List available resources
|
|
588
|
-
List available tools
|
|
589
|
-
----
|
|
590
|
-
|
|
591
|
-
. Test the new item:
|
|
592
|
-
+
|
|
593
|
-
[source,text]
|
|
594
|
-
----
|
|
595
|
-
Use the [prompt-name] prompt
|
|
596
|
-
Read resource redpanda://[resource-name]
|
|
597
|
-
Use the [tool-name] tool
|
|
598
|
-
----
|
|
599
|
-
|
|
600
|
-
. Verify output is what you expected
|
|
601
|
-
. Check for errors in Claude Code console
|
|
602
|
-
|
|
603
|
-
=== Common issues
|
|
604
|
-
|
|
605
|
-
Validation fails with "Invalid frontmatter":
|
|
606
|
-
- Check YAML syntax in the frontmatter block
|
|
607
|
-
- Ensure required fields are present (description)
|
|
608
|
-
- Verify argument names use only lowercase and underscores
|
|
609
|
-
- Check that version follows semantic versioning (for example, "1.0.0")
|
|
610
|
-
|
|
611
|
-
Prompt not appearing:
|
|
612
|
-
- Run `npx doc-tools validate-mcp` to check for errors
|
|
613
|
-
- Verify file is in `mcp/prompts/` directory and ends with `.md`
|
|
614
|
-
- Check that frontmatter is valid YAML
|
|
615
|
-
- Restart Claude Code
|
|
616
|
-
|
|
617
|
-
Resource not loading:
|
|
618
|
-
- Run `npx doc-tools validate-mcp` to check for errors
|
|
619
|
-
- Verify file is in `mcp/team-standards/` directory
|
|
620
|
-
- Check for JSON syntax errors (if JSON file)
|
|
621
|
-
- Restart Claude Code
|
|
622
|
-
|
|
623
|
-
Prompt content not updating:
|
|
624
|
-
- Files are cached - restart Claude Code
|
|
625
|
-
- Check for syntax errors in Markdown or frontmatter
|
|
626
|
-
- Run validation to catch issues
|
|
95
|
+
**Registration steps**:
|
|
627
96
|
|
|
628
|
-
|
|
97
|
+
1. Create tool module in `bin/mcp-tools/`
|
|
98
|
+
2. Export from `bin/mcp-tools/index.js`
|
|
99
|
+
3. Add tool definition to `bin/doc-tools-mcp.js`
|
|
629
100
|
|
|
630
|
-
===
|
|
101
|
+
=== Tool definition format
|
|
631
102
|
|
|
632
|
-
|
|
633
|
-
. Provide examples - Show good vs bad
|
|
634
|
-
. Reference resources - Point to style guide and terminology
|
|
635
|
-
. Define output format - Specify structure for consistency
|
|
636
|
-
. Include context - Explain why rules matter
|
|
103
|
+
Add to the `tools` array in `bin/doc-tools-mcp.js`:
|
|
637
104
|
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
. Keep them current - Update when standards change
|
|
641
|
-
. Make them scannable - Use clear headings and examples
|
|
642
|
-
. Show, don't just tell - Include examples
|
|
643
|
-
. Link to sources - Reference official docs when relevant
|
|
644
|
-
. Version control - Commit changes with clear descriptions
|
|
645
|
-
|
|
646
|
-
=== For the team
|
|
647
|
-
|
|
648
|
-
. Document changes - Update this guide when you learn something
|
|
649
|
-
. Share examples - Add good prompts to examples gallery
|
|
650
|
-
. Test thoroughly - Don't skip the testing checklist
|
|
651
|
-
. Ask for help - Reach out when you need developer support
|
|
652
|
-
. Iterate - Improve prompts based on usage and feedback
|
|
653
|
-
|
|
654
|
-
== Quick reference
|
|
655
|
-
|
|
656
|
-
=== File locations
|
|
657
|
-
|
|
658
|
-
[source,text]
|
|
105
|
+
[source,javascript]
|
|
659
106
|
----
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
107
|
+
{
|
|
108
|
+
name: 'my_tool',
|
|
109
|
+
description: 'What this tool does. Include when writers should use it.',
|
|
110
|
+
inputSchema: {
|
|
111
|
+
type: 'object',
|
|
112
|
+
properties: {
|
|
113
|
+
required_arg: {
|
|
114
|
+
type: 'string',
|
|
115
|
+
description: 'Description of this argument'
|
|
116
|
+
},
|
|
117
|
+
optional_arg: {
|
|
118
|
+
type: 'boolean',
|
|
119
|
+
description: 'Optional argument (default: false)'
|
|
120
|
+
}
|
|
121
|
+
},
|
|
122
|
+
required: ['required_arg']
|
|
123
|
+
}
|
|
124
|
+
}
|
|
673
125
|
----
|
|
674
126
|
|
|
675
|
-
===
|
|
676
|
-
|
|
677
|
-
Add a prompt:
|
|
678
|
-
. Create `mcp/prompts/my-prompt.md` with YAML frontmatter
|
|
679
|
-
. Run `npx doc-tools validate-mcp` to check for errors
|
|
680
|
-
. Restart Claude Code
|
|
681
|
-
. Test it!
|
|
682
|
-
|
|
683
|
-
Add a resource:
|
|
684
|
-
. Create `mcp/team-standards/my-resource.md`
|
|
685
|
-
. Run `npx doc-tools validate-mcp` to verify it's accessible
|
|
686
|
-
. Restart Claude Code
|
|
687
|
-
. Reference it in prompts using `redpanda://my-resource`
|
|
688
|
-
|
|
689
|
-
Update content:
|
|
690
|
-
. Edit the file in `mcp/prompts/` or `mcp/team-standards/`
|
|
691
|
-
. Run `npx doc-tools validate-mcp` to catch any errors
|
|
692
|
-
. Restart Claude Code
|
|
693
|
-
. Test the changes
|
|
694
|
-
|
|
695
|
-
=== Getting help
|
|
696
|
-
|
|
697
|
-
For writers:
|
|
698
|
-
- Review examples in existing prompts
|
|
699
|
-
- Check the showcase document for patterns
|
|
700
|
-
- Ask team lead for guidance
|
|
127
|
+
=== What NOT to add as MCP tools
|
|
701
128
|
|
|
702
|
-
|
|
703
|
-
- See `mcp/DEVELOPMENT.adoc` for technical details
|
|
704
|
-
- Check MCP SDK documentation
|
|
705
|
-
- Review tool implementation examples
|
|
129
|
+
Do NOT add MCP tools for:
|
|
706
130
|
|
|
707
|
-
|
|
131
|
+
* Style guidelines → use a skill in docs-team-standards
|
|
132
|
+
* Style/content review → use an agent (applies guidelines, no code needed)
|
|
133
|
+
* Decision criteria → use a skill or rule in docs-team-standards
|
|
134
|
+
* Templates → use templates in docs-team-standards
|
|
708
135
|
|
|
709
|
-
|
|
136
|
+
NOTE: Structural validation that requires code (JSON parsing, file analysis) belongs in MCP. Style review that applies guidelines belongs in an agent.
|
|
710
137
|
|
|
711
|
-
|
|
138
|
+
== Current MCP tools
|
|
712
139
|
|
|
713
|
-
|
|
714
|
-
----
|
|
715
|
-
---
|
|
716
|
-
description: "Review troubleshooting guides for required elements and clarity"
|
|
717
|
-
version: "1.0.0"
|
|
718
|
-
arguments:
|
|
719
|
-
content:
|
|
720
|
-
description: "Troubleshooting content to review"
|
|
721
|
-
required: true
|
|
722
|
-
---
|
|
723
|
-
|
|
724
|
-
# Review Troubleshooting Guide
|
|
140
|
+
=== Generation tools
|
|
725
141
|
|
|
726
|
-
|
|
142
|
+
* `generate_property_docs` - Configuration property documentation
|
|
143
|
+
* `generate_metrics_docs` - Metrics reference documentation
|
|
144
|
+
* `generate_rpk_docs` - RPK CLI documentation
|
|
145
|
+
* `generate_rpcn_connector_docs` - Connector reference documentation
|
|
146
|
+
* `generate_helm_docs` - Helm chart documentation
|
|
147
|
+
* `generate_crd_docs` - Kubernetes CRD documentation
|
|
148
|
+
* `generate_cloud_regions` - Cloud regions documentation
|
|
149
|
+
* `generate_bundle_openapi` - OpenAPI specification bundling
|
|
727
150
|
|
|
728
|
-
|
|
151
|
+
=== Utility tools
|
|
729
152
|
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
153
|
+
* `get_redpanda_version` - Latest Redpanda version info
|
|
154
|
+
* `get_console_version` - Latest Console version info
|
|
155
|
+
* `get_antora_structure` - Repository structure analysis
|
|
156
|
+
* `review_generated_docs` - Structural validation (JSON parsing, $ref checking, quality scores). For style review, use the content-reviewer agent.
|
|
157
|
+
* `run_doc_tools_command` - Raw doc-tools CLI execution
|
|
158
|
+
* `get_job_status` / `list_jobs` - Background job management
|
|
736
159
|
|
|
737
|
-
|
|
160
|
+
=== Resources
|
|
738
161
|
|
|
739
|
-
|
|
740
|
-
- Symptoms are observable by users
|
|
741
|
-
- Solution steps are sequential and complete
|
|
742
|
-
- Commands include expected output
|
|
743
|
-
- Uses glossterm macro for technical terms
|
|
162
|
+
Only one resource remains in MCP:
|
|
744
163
|
|
|
745
|
-
|
|
164
|
+
* `redpanda://personas` - Loaded from the current repository's `docs-data/personas.yaml`
|
|
746
165
|
|
|
747
|
-
|
|
166
|
+
This stays in MCP because it's repository-specific and loaded at runtime.
|
|
748
167
|
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
Provide the troubleshooting content to review.
|
|
752
|
-
----
|
|
168
|
+
== Migration reference
|
|
753
169
|
|
|
754
|
-
|
|
170
|
+
The following were migrated to docs-team-standards in January 2026:
|
|
755
171
|
|
|
756
|
-
|
|
172
|
+
[cols="2,2"]
|
|
173
|
+
|===
|
|
174
|
+
|Was (MCP) |Is now (docs-team-standards)
|
|
757
175
|
|
|
758
|
-
|
|
176
|
+
|`mcp/prompts/*`
|
|
177
|
+
|`agents/` directory
|
|
759
178
|
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
# Code Examples Guide
|
|
179
|
+
|`team-standards/*`
|
|
180
|
+
|`skills/` directory
|
|
763
181
|
|
|
764
|
-
|
|
182
|
+
|`review_content` tool
|
|
183
|
+
|`content-reviewer` agent
|
|
765
184
|
|
|
766
|
-
|
|
767
|
-
-
|
|
768
|
-
|
|
769
|
-
- Test all code before publishing
|
|
185
|
+
|`mcp/templates/*`
|
|
186
|
+
|`skill-authoring` skill
|
|
187
|
+
|===
|
|
770
188
|
|
|
771
|
-
|
|
189
|
+
== Testing
|
|
772
190
|
|
|
773
|
-
|
|
191
|
+
Run MCP tests:
|
|
774
192
|
|
|
775
193
|
[source,bash]
|
|
776
194
|
----
|
|
777
|
-
|
|
778
|
-
----
|
|
779
|
-
|
|
780
|
-
[source,bash,role=no-copy]
|
|
781
|
-
----
|
|
782
|
-
TOPIC STATUS
|
|
783
|
-
orders OK
|
|
784
|
-
----
|
|
785
|
-
|
|
786
|
-
## Language-Specific Rules
|
|
787
|
-
|
|
788
|
-
### Bash
|
|
789
|
-
- Include comments for non-obvious commands
|
|
790
|
-
- Show full command with all flags
|
|
791
|
-
- Use long-form flags when clearer
|
|
792
|
-
|
|
793
|
-
### Python
|
|
794
|
-
- Follow PEP 8 style
|
|
795
|
-
- Include import statements
|
|
796
|
-
- Show complete, runnable examples
|
|
797
|
-
|
|
798
|
-
### YAML
|
|
799
|
-
- Use 2-space indentation
|
|
800
|
-
- Include comments for complex sections
|
|
801
|
-
- Validate syntax before publishing
|
|
195
|
+
npm test -- --testPathPattern=mcp
|
|
802
196
|
----
|
|
803
197
|
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
== What's next?
|
|
198
|
+
See link:../__tests__/mcp/README.adoc[Test documentation] for details.
|
|
807
199
|
|
|
808
|
-
|
|
809
|
-
. Update existing resources to match your current standards
|
|
810
|
-
. Share your additions with the team
|
|
811
|
-
. Document new patterns you discover
|
|
812
|
-
. Iterate and improve based on team feedback
|
|
200
|
+
== Getting help
|
|
813
201
|
|
|
814
|
-
|
|
202
|
+
* **MCP tools**: See link:DEVELOPMENT.adoc[DEVELOPMENT.adoc]
|
|
203
|
+
* **Skills/agents**: See https://github.com/redpanda-data/docs-team-standards[docs-team-standards]
|
|
204
|
+
* **Questions**: Ask in the docs team channel
|