@redpanda-data/docs-extensions-and-macros 4.12.6 → 4.13.1
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/README.adoc +33 -1064
- package/bin/doc-tools-mcp.js +720 -0
- package/bin/doc-tools.js +1050 -50
- package/bin/mcp-tools/antora.js +153 -0
- package/bin/mcp-tools/cache.js +89 -0
- package/bin/mcp-tools/cloud-regions.js +127 -0
- package/bin/mcp-tools/content-review.js +196 -0
- package/bin/mcp-tools/crd-docs.js +153 -0
- package/bin/mcp-tools/frontmatter.js +138 -0
- package/bin/mcp-tools/generated-docs-review.js +887 -0
- package/bin/mcp-tools/helm-docs.js +152 -0
- package/bin/mcp-tools/index.js +245 -0
- package/bin/mcp-tools/job-queue.js +468 -0
- package/bin/mcp-tools/mcp-validation.js +266 -0
- package/bin/mcp-tools/metrics-docs.js +146 -0
- package/bin/mcp-tools/openapi.js +174 -0
- package/bin/mcp-tools/prompt-discovery.js +283 -0
- package/bin/mcp-tools/property-docs.js +157 -0
- package/bin/mcp-tools/rpcn-docs.js +113 -0
- package/bin/mcp-tools/rpk-docs.js +141 -0
- package/bin/mcp-tools/telemetry.js +211 -0
- package/bin/mcp-tools/utils.js +131 -0
- package/bin/mcp-tools/versions.js +168 -0
- package/cli-utils/convert-doc-links.js +1 -1
- package/cli-utils/github-token.js +58 -0
- package/cli-utils/self-managed-docs-branch.js +2 -2
- package/cli-utils/setup-mcp.js +313 -0
- package/docker-compose/25.1/transactions.md +1 -1
- package/docker-compose/transactions.md +1 -1
- package/extensions/DEVELOPMENT.adoc +464 -0
- package/extensions/README.adoc +124 -0
- package/extensions/REFERENCE.adoc +768 -0
- package/extensions/USER_GUIDE.adoc +339 -0
- package/extensions/generate-rp-connect-info.js +3 -4
- package/extensions/version-fetcher/get-latest-console-version.js +38 -27
- package/extensions/version-fetcher/get-latest-redpanda-version.js +65 -54
- package/extensions/version-fetcher/retry-util.js +88 -0
- package/extensions/version-fetcher/set-latest-version.js +6 -3
- package/macros/DEVELOPMENT.adoc +377 -0
- package/macros/README.adoc +105 -0
- package/macros/REFERENCE.adoc +222 -0
- package/macros/USER_GUIDE.adoc +220 -0
- package/macros/rp-connect-components.js +6 -6
- package/mcp/CLI_INTERFACE.adoc +384 -0
- package/mcp/COSTS.adoc +167 -0
- package/mcp/DEVELOPMENT.adoc +726 -0
- package/mcp/README.adoc +172 -0
- package/mcp/USER_GUIDE.adoc +1392 -0
- package/mcp/WRITER_EXTENSION_GUIDE.adoc +814 -0
- package/mcp/prompts/README.adoc +183 -0
- package/mcp/prompts/property-docs-guide.md +283 -0
- package/mcp/prompts/review-for-style.md +128 -0
- package/mcp/prompts/rpcn-connector-docs-guide.md +126 -0
- package/mcp/prompts/write-new-guide.md +222 -0
- package/mcp/team-standards/style-guide.md +321 -0
- package/mcp/templates/README.adoc +212 -0
- package/mcp/templates/prompt-review-template.md +80 -0
- package/mcp/templates/prompt-write-template.md +110 -0
- package/mcp/templates/resource-template.md +76 -0
- package/package.json +16 -5
- package/tools/bundle-openapi.js +20 -10
- package/tools/cloud-regions/generate-cloud-regions.js +1 -1
- package/tools/fetch-from-github.js +18 -4
- package/tools/gen-rpk-ascii.py +3 -1
- package/tools/generate-cli-docs.js +325 -0
- package/tools/get-console-version.js +4 -2
- package/tools/get-redpanda-version.js +4 -2
- package/tools/metrics/metrics.py +19 -7
- package/tools/property-extractor/Makefile +7 -1
- package/tools/property-extractor/cloud_config.py +4 -4
- package/tools/property-extractor/constant_resolver.py +11 -11
- package/tools/property-extractor/property_extractor.py +18 -16
- package/tools/property-extractor/topic_property_extractor.py +2 -2
- package/tools/property-extractor/transformers.py +7 -7
- package/tools/property-extractor/type_definition_extractor.py +4 -4
- package/tools/redpanda-connect/README.adoc +1 -1
- package/tools/redpanda-connect/generate-rpcn-connector-docs.js +5 -3
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
= MCP Extension Templates
|
|
2
|
+
:toc:
|
|
3
|
+
|
|
4
|
+
== Overview
|
|
5
|
+
|
|
6
|
+
This directory contains ready-to-use templates for extending the MCP server. Copy these templates and customize them for your needs.
|
|
7
|
+
|
|
8
|
+
== Available templates
|
|
9
|
+
|
|
10
|
+
[cols="1,3"]
|
|
11
|
+
|===
|
|
12
|
+
|Template |Use For
|
|
13
|
+
|
|
14
|
+
|`prompt-review-template.md`
|
|
15
|
+
|Creating review prompts for specific content types
|
|
16
|
+
|
|
17
|
+
|`prompt-write-template.md`
|
|
18
|
+
|Creating writing prompts that generate new content
|
|
19
|
+
|
|
20
|
+
|`resource-template.md`
|
|
21
|
+
|Creating reference resources (guides, checklists, templates)
|
|
22
|
+
|===
|
|
23
|
+
|
|
24
|
+
== How to use these templates
|
|
25
|
+
|
|
26
|
+
=== Quick start
|
|
27
|
+
|
|
28
|
+
. Copy the template you need
|
|
29
|
+
. Replace `[PLACEHOLDERS]` with your content
|
|
30
|
+
. Add YAML frontmatter (for prompts)
|
|
31
|
+
. Validate with `npx doc-tools validate-mcp`
|
|
32
|
+
. Restart Claude Code and test
|
|
33
|
+
|
|
34
|
+
=== Detailed steps
|
|
35
|
+
|
|
36
|
+
**Step 1: Choose a template**
|
|
37
|
+
|
|
38
|
+
Pick the template that matches what you're creating:
|
|
39
|
+
- Review prompts → `prompt-review-template.md`
|
|
40
|
+
- Writing prompts → `prompt-write-template.md`
|
|
41
|
+
- Resources → `resource-template.md`
|
|
42
|
+
|
|
43
|
+
**Step 2: Copy and rename**
|
|
44
|
+
|
|
45
|
+
[source,bash]
|
|
46
|
+
----
|
|
47
|
+
# For a prompt
|
|
48
|
+
cp mcp/templates/prompt-review-template.md mcp/prompts/review-api-docs.md
|
|
49
|
+
|
|
50
|
+
# For a resource
|
|
51
|
+
cp mcp/templates/resource-template.md mcp/team-standards/api-guide.md
|
|
52
|
+
----
|
|
53
|
+
|
|
54
|
+
**Step 3: Add frontmatter (prompts only)**
|
|
55
|
+
|
|
56
|
+
Prompts need YAML frontmatter at the top. The templates include placeholder frontmatter - customize it:
|
|
57
|
+
|
|
58
|
+
[source,yaml]
|
|
59
|
+
----
|
|
60
|
+
---
|
|
61
|
+
description: "Your prompt description"
|
|
62
|
+
version: "1.0.0"
|
|
63
|
+
arguments:
|
|
64
|
+
content:
|
|
65
|
+
description: "The content to process"
|
|
66
|
+
required: true
|
|
67
|
+
---
|
|
68
|
+
----
|
|
69
|
+
|
|
70
|
+
**Step 4: Customize the content**
|
|
71
|
+
|
|
72
|
+
Replace all `[PLACEHOLDERS]` with your specific content:
|
|
73
|
+
|
|
74
|
+
- `[CONTENT-TYPE]` → "API documentation", "troubleshooting guide", etc.
|
|
75
|
+
- `[First thing to check]` → Specific checks for your use case
|
|
76
|
+
- `[Section names]` → Appropriate section names
|
|
77
|
+
|
|
78
|
+
**Step 5: Validate**
|
|
79
|
+
|
|
80
|
+
Check your prompt or resource for errors:
|
|
81
|
+
|
|
82
|
+
[source,bash]
|
|
83
|
+
----
|
|
84
|
+
npx doc-tools validate-mcp
|
|
85
|
+
----
|
|
86
|
+
|
|
87
|
+
**Step 6: Test**
|
|
88
|
+
|
|
89
|
+
Restart Claude Code and test your new prompt or resource.
|
|
90
|
+
|
|
91
|
+
No code editing required - the MCP server auto-discovers files in `mcp/prompts/` and `mcp/team-standards/`!
|
|
92
|
+
|
|
93
|
+
== Customization tips
|
|
94
|
+
|
|
95
|
+
=== For review prompts
|
|
96
|
+
|
|
97
|
+
Focus on:
|
|
98
|
+
- **Specific checks** relevant to the content type
|
|
99
|
+
- **Common mistakes** you see in reviews
|
|
100
|
+
- **Required elements** that must be present
|
|
101
|
+
- **Output format** that's easy to act on
|
|
102
|
+
|
|
103
|
+
Good checklist items:
|
|
104
|
+
- Concrete and testable
|
|
105
|
+
- Focused on one aspect
|
|
106
|
+
- Clear about what success looks like
|
|
107
|
+
|
|
108
|
+
=== For writing prompts
|
|
109
|
+
|
|
110
|
+
Focus on:
|
|
111
|
+
- **Clear structure** that matches your templates
|
|
112
|
+
- **Specific requirements** for the content type
|
|
113
|
+
- **Quality standards** that must be met
|
|
114
|
+
- **Examples** showing what good looks like
|
|
115
|
+
|
|
116
|
+
Good requirements:
|
|
117
|
+
- Specific and actionable
|
|
118
|
+
- Based on real patterns
|
|
119
|
+
- Include rationale
|
|
120
|
+
|
|
121
|
+
=== For resources
|
|
122
|
+
|
|
123
|
+
Focus on:
|
|
124
|
+
- **Practical examples** showing how to apply rules
|
|
125
|
+
- **Good vs bad** comparisons
|
|
126
|
+
- **Checklists** for quick verification
|
|
127
|
+
- **Clear organization** that's easy to scan
|
|
128
|
+
|
|
129
|
+
Good resources:
|
|
130
|
+
- Scannable with clear headings
|
|
131
|
+
- More examples than rules
|
|
132
|
+
- Actionable guidance
|
|
133
|
+
|
|
134
|
+
== Examples
|
|
135
|
+
|
|
136
|
+
=== Example: Review prompt for API docs
|
|
137
|
+
|
|
138
|
+
[source,bash]
|
|
139
|
+
----
|
|
140
|
+
# Copy template
|
|
141
|
+
cp mcp/templates/prompt-review-template.md mcp/prompts/review-api-docs.md
|
|
142
|
+
|
|
143
|
+
# Edit and customize
|
|
144
|
+
vi mcp/prompts/review-api-docs.md
|
|
145
|
+
----
|
|
146
|
+
|
|
147
|
+
Key customizations:
|
|
148
|
+
- Replace `[CONTENT-TYPE]` with "API documentation"
|
|
149
|
+
- Add checks for: authentication section, request/response examples, error codes
|
|
150
|
+
- Add common issues: missing status codes, unclear parameter descriptions
|
|
151
|
+
- Define output format for API-specific feedback
|
|
152
|
+
|
|
153
|
+
=== Example: Resource for code examples
|
|
154
|
+
|
|
155
|
+
[source,bash]
|
|
156
|
+
----
|
|
157
|
+
# Copy template
|
|
158
|
+
cp mcp/templates/resource-template.md mcp/team-standards/code-examples-guide.md
|
|
159
|
+
|
|
160
|
+
# Edit and customize
|
|
161
|
+
vi mcp/team-standards/code-examples-guide.md
|
|
162
|
+
----
|
|
163
|
+
|
|
164
|
+
Key customizations:
|
|
165
|
+
- Add language-specific guidelines (bash, Python, YAML)
|
|
166
|
+
- Include examples of good vs bad code formatting
|
|
167
|
+
- Add checklist for code review
|
|
168
|
+
- Show proper use of code block roles
|
|
169
|
+
|
|
170
|
+
== Template placeholders reference
|
|
171
|
+
|
|
172
|
+
Common placeholders you'll find in templates:
|
|
173
|
+
|
|
174
|
+
[cols="1,2"]
|
|
175
|
+
|===
|
|
176
|
+
|Placeholder |Replace With
|
|
177
|
+
|
|
178
|
+
|`[CONTENT-TYPE]`
|
|
179
|
+
|Specific type: "API docs", "tutorials", "troubleshooting guides"
|
|
180
|
+
|
|
181
|
+
|`[First thing to check]`
|
|
182
|
+
|Specific checks relevant to your use case
|
|
183
|
+
|
|
184
|
+
|`[Required section X]`
|
|
185
|
+
|Sections that must be present
|
|
186
|
+
|
|
187
|
+
|`[Resource Name]`
|
|
188
|
+
|Name of your resource
|
|
189
|
+
|
|
190
|
+
|`[Main Section X]`
|
|
191
|
+
|Appropriate section names for your content
|
|
192
|
+
|
|
193
|
+
|`[Check item X]`
|
|
194
|
+
|Specific checklist items
|
|
195
|
+
|===
|
|
196
|
+
|
|
197
|
+
== Getting help
|
|
198
|
+
|
|
199
|
+
- See link:../WRITER_EXTENSION_GUIDE.adoc[Writer Extension Guide] for complete instructions
|
|
200
|
+
- Check existing prompts in `mcp/prompts/` for examples
|
|
201
|
+
- Review existing resources in `mcp/team-standards/` for patterns
|
|
202
|
+
- Ask your team lead for guidance
|
|
203
|
+
|
|
204
|
+
== Contributing
|
|
205
|
+
|
|
206
|
+
When you create a great prompt or resource:
|
|
207
|
+
|
|
208
|
+
. Add it to the examples in link:../WRITER_EXTENSION_GUIDE.adoc[Writer Extension Guide]
|
|
209
|
+
. Share it with the team
|
|
210
|
+
. Consider if it should become a new template
|
|
211
|
+
|
|
212
|
+
The more prompts and resources we build, the more consistent and efficient our docs team becomes!
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Review [CONTENT-TYPE] for [specific aspects you're checking]"
|
|
3
|
+
version: "1.0.0"
|
|
4
|
+
arguments:
|
|
5
|
+
content:
|
|
6
|
+
description: "The [CONTENT-TYPE] content to review"
|
|
7
|
+
required: true
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Review [CONTENT-TYPE]
|
|
11
|
+
|
|
12
|
+
You are reviewing [CONTENT-TYPE] for the Redpanda documentation team.
|
|
13
|
+
|
|
14
|
+
## Your Task
|
|
15
|
+
|
|
16
|
+
Review the provided content and check for:
|
|
17
|
+
|
|
18
|
+
1. [First thing to check]
|
|
19
|
+
2. [Second thing to check]
|
|
20
|
+
3. [Third thing to check]
|
|
21
|
+
4. [Additional checks...]
|
|
22
|
+
|
|
23
|
+
## Resources to Reference
|
|
24
|
+
|
|
25
|
+
Read these resources before reviewing:
|
|
26
|
+
- `redpanda://style-guide` - Complete style guide
|
|
27
|
+
- Official glossary for terminology:
|
|
28
|
+
- GitHub: https://github.com/redpanda-data/docs/tree/shared/modules/terms/partials
|
|
29
|
+
- Published: https://docs.redpanda.com/current/reference/glossary/
|
|
30
|
+
- [Add other relevant resources]
|
|
31
|
+
|
|
32
|
+
## Standards for [CONTENT-TYPE]
|
|
33
|
+
|
|
34
|
+
[Describe what makes good content of this type]
|
|
35
|
+
|
|
36
|
+
### Required Sections
|
|
37
|
+
|
|
38
|
+
All [CONTENT-TYPE] documentation must include:
|
|
39
|
+
- [Required section 1]
|
|
40
|
+
- [Required section 2]
|
|
41
|
+
- [Required section 3]
|
|
42
|
+
|
|
43
|
+
### Format Requirements
|
|
44
|
+
|
|
45
|
+
[Specific formatting rules for this content type]
|
|
46
|
+
|
|
47
|
+
### Common Issues to Check
|
|
48
|
+
|
|
49
|
+
- [Common mistake 1]
|
|
50
|
+
- [Common mistake 2]
|
|
51
|
+
- [Common mistake 3]
|
|
52
|
+
|
|
53
|
+
## Output Format
|
|
54
|
+
|
|
55
|
+
Provide a structured review:
|
|
56
|
+
|
|
57
|
+
### Critical Issues (must fix)
|
|
58
|
+
|
|
59
|
+
For each critical issue:
|
|
60
|
+
- **Location**: [Section/paragraph reference]
|
|
61
|
+
- **Issue**: [What's wrong]
|
|
62
|
+
- **Fix**: [Specific correction]
|
|
63
|
+
- **Reason**: [Why it matters]
|
|
64
|
+
|
|
65
|
+
### Suggestions (should consider)
|
|
66
|
+
|
|
67
|
+
For each suggestion:
|
|
68
|
+
- **Location**: [Where it appears]
|
|
69
|
+
- **Current**: [What it says now]
|
|
70
|
+
- **Suggested**: [Better alternative]
|
|
71
|
+
- **Reason**: [Why the suggestion helps]
|
|
72
|
+
|
|
73
|
+
### Positive Elements
|
|
74
|
+
|
|
75
|
+
What works well:
|
|
76
|
+
- [Good thing 1]
|
|
77
|
+
- [Good thing 2]
|
|
78
|
+
- [Good thing 3]
|
|
79
|
+
|
|
80
|
+
---
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Generate [CONTENT-TYPE] following team standards"
|
|
3
|
+
version: "1.0.0"
|
|
4
|
+
arguments:
|
|
5
|
+
topic:
|
|
6
|
+
description: "The topic to write about"
|
|
7
|
+
required: true
|
|
8
|
+
target_module:
|
|
9
|
+
description: "Where in Antora structure this belongs (optional)"
|
|
10
|
+
required: false
|
|
11
|
+
context:
|
|
12
|
+
description: "Additional context or requirements"
|
|
13
|
+
required: false
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
# Write [CONTENT-TYPE]
|
|
17
|
+
|
|
18
|
+
You are writing [CONTENT-TYPE] for the Redpanda documentation team.
|
|
19
|
+
|
|
20
|
+
## Your Task
|
|
21
|
+
|
|
22
|
+
Create [CONTENT-TYPE] that follows our team standards.
|
|
23
|
+
|
|
24
|
+
## Resources to Read First
|
|
25
|
+
|
|
26
|
+
- `redpanda://style-guide` - Complete style guide
|
|
27
|
+
- Official glossary for terminology:
|
|
28
|
+
- GitHub: https://github.com/redpanda-data/docs/tree/shared/modules/terms/partials
|
|
29
|
+
- Published: https://docs.redpanda.com/current/reference/glossary/
|
|
30
|
+
- `redpanda://[content-type]-template` - Template for this content type (if available)
|
|
31
|
+
- [Add other relevant resources]
|
|
32
|
+
|
|
33
|
+
Use `get_antora_structure` tool to understand the documentation organization.
|
|
34
|
+
|
|
35
|
+
## Standards for [CONTENT-TYPE]
|
|
36
|
+
|
|
37
|
+
### Structure
|
|
38
|
+
|
|
39
|
+
[CONTENT-TYPE] should follow this structure:
|
|
40
|
+
|
|
41
|
+
1. [Section 1]
|
|
42
|
+
- [What goes here]
|
|
43
|
+
2. [Section 2]
|
|
44
|
+
- [What goes here]
|
|
45
|
+
3. [Section 3]
|
|
46
|
+
- [What goes here]
|
|
47
|
+
|
|
48
|
+
### Content Requirements
|
|
49
|
+
|
|
50
|
+
[What must be included:]
|
|
51
|
+
- [Requirement 1]
|
|
52
|
+
- [Requirement 2]
|
|
53
|
+
- [Requirement 3]
|
|
54
|
+
|
|
55
|
+
### Writing Style
|
|
56
|
+
|
|
57
|
+
Follow these style guidelines:
|
|
58
|
+
- Present tense
|
|
59
|
+
- Active voice
|
|
60
|
+
- Second person ("you")
|
|
61
|
+
- Sentence case for all headings except title
|
|
62
|
+
- Imperative form for instructions (no gerunds)
|
|
63
|
+
- Avoid overuse of bold or em dashes
|
|
64
|
+
|
|
65
|
+
### AsciiDoc Format
|
|
66
|
+
|
|
67
|
+
- All xrefs must include module name
|
|
68
|
+
- Use `glossterm` macro for glossary terms on first mention
|
|
69
|
+
- Code blocks use appropriate roles (`.no-copy` for outputs)
|
|
70
|
+
- Custom macros used correctly
|
|
71
|
+
|
|
72
|
+
## Quality Checklist
|
|
73
|
+
|
|
74
|
+
Before finalizing, verify:
|
|
75
|
+
- [ ] Structure follows template
|
|
76
|
+
- [ ] All required sections included
|
|
77
|
+
- [ ] Code examples are realistic and tested
|
|
78
|
+
- [ ] Terminology uses approved terms
|
|
79
|
+
- [ ] Glossary terms use `glossterm` macro
|
|
80
|
+
- [ ] All xrefs include module names
|
|
81
|
+
- [ ] Voice is clear and conversational
|
|
82
|
+
- [ ] Headings use sentence case
|
|
83
|
+
|
|
84
|
+
## Output Format
|
|
85
|
+
|
|
86
|
+
Provide complete [CONTENT-TYPE] in AsciiDoc format:
|
|
87
|
+
|
|
88
|
+
```asciidoc
|
|
89
|
+
= Page Title
|
|
90
|
+
:description: Brief description
|
|
91
|
+
|
|
92
|
+
Opening content explaining what this covers.
|
|
93
|
+
|
|
94
|
+
== First section
|
|
95
|
+
|
|
96
|
+
Content here.
|
|
97
|
+
|
|
98
|
+
== Second section
|
|
99
|
+
|
|
100
|
+
More content.
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
---
|
|
104
|
+
|
|
105
|
+
Please provide:
|
|
106
|
+
1. **Topic**: What this [CONTENT-TYPE] should cover
|
|
107
|
+
2. **Target module** (optional): Where in Antora structure this belongs
|
|
108
|
+
3. **[Other context]**: [Additional information needed]
|
|
109
|
+
|
|
110
|
+
I'll create complete [CONTENT-TYPE] following all team standards.
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
# [Resource Name]
|
|
2
|
+
|
|
3
|
+
[Brief description of what this resource provides]
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
[1-2 paragraphs explaining when and how to use this resource]
|
|
8
|
+
|
|
9
|
+
## [Main Section 1]
|
|
10
|
+
|
|
11
|
+
[Content for this section]
|
|
12
|
+
|
|
13
|
+
### Subsection
|
|
14
|
+
|
|
15
|
+
[Details with examples]
|
|
16
|
+
|
|
17
|
+
Example:
|
|
18
|
+
|
|
19
|
+
```asciidoc
|
|
20
|
+
[Example code or content here]
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## [Main Section 2]
|
|
24
|
+
|
|
25
|
+
[Content for this section]
|
|
26
|
+
|
|
27
|
+
### Key Points
|
|
28
|
+
|
|
29
|
+
- [Important point 1]
|
|
30
|
+
- [Important point 2]
|
|
31
|
+
- [Important point 3]
|
|
32
|
+
|
|
33
|
+
### Examples
|
|
34
|
+
|
|
35
|
+
Good:
|
|
36
|
+
```
|
|
37
|
+
[Good example]
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Bad:
|
|
41
|
+
```
|
|
42
|
+
[Bad example - what to avoid]
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## [Main Section 3]
|
|
46
|
+
|
|
47
|
+
[Additional content]
|
|
48
|
+
|
|
49
|
+
## Checklist
|
|
50
|
+
|
|
51
|
+
Use this checklist to verify compliance:
|
|
52
|
+
|
|
53
|
+
- [ ] [Check item 1]
|
|
54
|
+
- [ ] [Check item 2]
|
|
55
|
+
- [ ] [Check item 3]
|
|
56
|
+
- [ ] [Check item 4]
|
|
57
|
+
|
|
58
|
+
## Common Mistakes
|
|
59
|
+
|
|
60
|
+
[List common mistakes and how to avoid them]
|
|
61
|
+
|
|
62
|
+
### Mistake 1
|
|
63
|
+
|
|
64
|
+
Problem: [What people do wrong]
|
|
65
|
+
Solution: [How to do it right]
|
|
66
|
+
|
|
67
|
+
### Mistake 2
|
|
68
|
+
|
|
69
|
+
Problem: [What people do wrong]
|
|
70
|
+
Solution: [How to do it right]
|
|
71
|
+
|
|
72
|
+
## References
|
|
73
|
+
|
|
74
|
+
- [Link to related resource 1]
|
|
75
|
+
- [Link to related resource 2]
|
|
76
|
+
- [Link to external documentation]
|
package/package.json
CHANGED
|
@@ -1,19 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@redpanda-data/docs-extensions-and-macros",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.13.1",
|
|
4
4
|
"description": "Antora extensions and macros developed for Redpanda documentation.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"antora",
|
|
7
7
|
"extension",
|
|
8
8
|
"macro",
|
|
9
9
|
"documentation",
|
|
10
|
-
"redpanda"
|
|
10
|
+
"redpanda",
|
|
11
|
+
"mcp"
|
|
11
12
|
],
|
|
12
13
|
"author": {
|
|
13
14
|
"name": "Redpanda Docs Team"
|
|
14
15
|
},
|
|
15
16
|
"bin": {
|
|
16
|
-
"doc-tools": "./bin/doc-tools.js"
|
|
17
|
+
"doc-tools": "./bin/doc-tools.js",
|
|
18
|
+
"doc-tools-mcp": "./bin/doc-tools-mcp.js"
|
|
17
19
|
},
|
|
18
20
|
"scripts": {
|
|
19
21
|
"install-test-dependencies": "doc-tools install-test-dependencies",
|
|
@@ -22,8 +24,12 @@
|
|
|
22
24
|
"build": "antora --to-dir docs --fetch local-antora-playbook.yml",
|
|
23
25
|
"serve": "wds --node-resolve --open preview/test/ --watch --root-dir docs",
|
|
24
26
|
"test": "jest",
|
|
27
|
+
"test:mcp": "jest __tests__/mcp/",
|
|
28
|
+
"test:mcp:integration": "jest __tests__/mcp/integration.test.js",
|
|
29
|
+
"test:mcp:contract": "jest __tests__/mcp/cli-contract.test.js",
|
|
25
30
|
"test:python": "./__tests__/tools/property-extractor/setup-and-test.sh",
|
|
26
31
|
"test:all": "npm run test && npm run test:python",
|
|
32
|
+
"generate:cli-docs": "node tools/generate-cli-docs.js",
|
|
27
33
|
"bundle:admin": "doc-tools generate bundle-openapi --surface admin",
|
|
28
34
|
"bundle:connect": "doc-tools generate bundle-openapi --surface connect",
|
|
29
35
|
"bundle:both": "doc-tools generate bundle-openapi --surface both"
|
|
@@ -75,7 +81,8 @@
|
|
|
75
81
|
"bin",
|
|
76
82
|
"cli-utils",
|
|
77
83
|
"tools",
|
|
78
|
-
"docker-compose"
|
|
84
|
+
"docker-compose",
|
|
85
|
+
"mcp"
|
|
79
86
|
],
|
|
80
87
|
"license": "ISC",
|
|
81
88
|
"repository": {
|
|
@@ -85,14 +92,17 @@
|
|
|
85
92
|
"dependencies": {
|
|
86
93
|
"@asciidoctor/tabs": "^1.0.0-beta.6",
|
|
87
94
|
"@bufbuild/buf": "^1.28.1",
|
|
95
|
+
"@modelcontextprotocol/sdk": "^1.0.4",
|
|
88
96
|
"@octokit/core": "^6.1.2",
|
|
89
97
|
"@octokit/plugin-retry": "^7.1.1",
|
|
90
98
|
"@octokit/rest": "^21.0.1",
|
|
91
99
|
"@redocly/cli": "^2.2.0",
|
|
100
|
+
"ajv": "^8.12.0",
|
|
92
101
|
"algoliasearch": "^4.17.0",
|
|
93
102
|
"chalk": "4.1.2",
|
|
94
103
|
"cheerio": "^1.1.2",
|
|
95
104
|
"commander": "^14.0.0",
|
|
105
|
+
"glob": "^11.0.0",
|
|
96
106
|
"gulp": "^4.0.2",
|
|
97
107
|
"gulp-connect": "^5.7.0",
|
|
98
108
|
"handlebars": "^4.7.8",
|
|
@@ -117,6 +127,7 @@
|
|
|
117
127
|
"@antora/cli": "3.1.4",
|
|
118
128
|
"@antora/site-generator": "3.1.4",
|
|
119
129
|
"@web/dev-server": "^0.2.5",
|
|
120
|
-
"jest": "^29.7.0"
|
|
130
|
+
"jest": "^29.7.0",
|
|
131
|
+
"jest-junit": "^16.0.0"
|
|
121
132
|
}
|
|
122
133
|
}
|
package/tools/bundle-openapi.js
CHANGED
|
@@ -12,8 +12,8 @@ const yaml = require('yaml');
|
|
|
12
12
|
* and validates that the result matches MAJOR.MINOR.PATCH with optional pre-release/build metadata.
|
|
13
13
|
* Throws if the input is not a non-empty string or does not conform to the expected version format.
|
|
14
14
|
*
|
|
15
|
-
* @param {string} tag - Git tag (
|
|
16
|
-
* @returns {string} Normalized version (
|
|
15
|
+
* @param {string} tag - Git tag (for example, 'v25.1.1', '25.1.1', or 'dev').
|
|
16
|
+
* @returns {string} Normalized version (for example, '25.1.1' or 'dev').
|
|
17
17
|
* @throws {Error} If `tag` is not a non-empty string or does not match the semantic version pattern.
|
|
18
18
|
*/
|
|
19
19
|
function normalizeTag(tag) {
|
|
@@ -44,8 +44,8 @@ function normalizeTag(tag) {
|
|
|
44
44
|
*
|
|
45
45
|
* Accepts a semantic version like `25.1.1` and yields `25.1`. The special value
|
|
46
46
|
* `'dev'` is returned unchanged.
|
|
47
|
-
* @param {string} version - Semantic version (
|
|
48
|
-
* @returns {string} The `major.minor` string (
|
|
47
|
+
* @param {string} version - Semantic version (for example, `'25.1.1'`) or `'dev'`.
|
|
48
|
+
* @returns {string} The `major.minor` string (for example, `'25.1'`) or `'dev'`.
|
|
49
49
|
* @throws {Error} If `version` is not a non-empty string, lacks major/minor parts, or if major/minor are not numeric.
|
|
50
50
|
*/
|
|
51
51
|
function getMajorMinor(version) {
|
|
@@ -554,13 +554,13 @@ function postProcessBundle(filePath, options, quiet = false) {
|
|
|
554
554
|
* Bundle OpenAPI fragments for the specified API surface(s) from a repository tag and write the resulting bundled YAML files to disk.
|
|
555
555
|
*
|
|
556
556
|
* @param {Object} options - Configuration options.
|
|
557
|
-
* @param {string} options.tag - Git tag to checkout (
|
|
557
|
+
* @param {string} options.tag - Git tag to checkout (for example, 'v25.1.1').
|
|
558
558
|
* @param {'admin'|'connect'|'both'} options.surface - API surface to process.
|
|
559
559
|
* @param {string} [options.output] - Standalone output file path; when provided, used for the single output file.
|
|
560
560
|
* @param {string} [options.outAdmin] - Output path for the admin API when integrating with doc-tools mode.
|
|
561
561
|
* @param {string} [options.outConnect] - Output path for the connect API when integrating with doc-tools mode.
|
|
562
562
|
* @param {string} [options.repo] - Repository URL to clone (defaults to https://github.com/redpanda-data/redpanda.git).
|
|
563
|
-
* @param {string} [options.adminMajor] - Admin API major version string used for metadata (
|
|
563
|
+
* @param {string} [options.adminMajor] - Admin API major version string used for metadata (for example, 'v2.0.0').
|
|
564
564
|
* @param {boolean} [options.useAdminMajorVersion] - When true and processing the admin surface, use `adminMajor` for the bundle info.version.
|
|
565
565
|
* @param {boolean} [options.quiet=false] - Suppress logging to stdout/stderr when true.
|
|
566
566
|
* @returns {Object|Object[]} An object (for a single surface) or an array of objects (for both surfaces) with fields:
|
|
@@ -625,9 +625,19 @@ async function bundleOpenAPI(options) {
|
|
|
625
625
|
if (!quiet) {
|
|
626
626
|
console.log('📥 Cloning redpanda repository...');
|
|
627
627
|
}
|
|
628
|
-
|
|
629
|
-
const
|
|
630
|
-
|
|
628
|
+
|
|
629
|
+
const { getAuthenticatedGitHubUrl, hasGitHubToken } = require('../cli-utils/github-token');
|
|
630
|
+
|
|
631
|
+
let repositoryUrl = repo || 'https://github.com/redpanda-data/redpanda.git';
|
|
632
|
+
|
|
633
|
+
// Use token if available for better rate limits and reliability
|
|
634
|
+
if (hasGitHubToken() && repositoryUrl.includes('github.com')) {
|
|
635
|
+
repositoryUrl = getAuthenticatedGitHubUrl(repositoryUrl);
|
|
636
|
+
if (!quiet) {
|
|
637
|
+
console.log('🔑 Using authenticated clone (token provided)');
|
|
638
|
+
}
|
|
639
|
+
}
|
|
640
|
+
|
|
631
641
|
try {
|
|
632
642
|
execSync(`git clone --depth 1 --branch ${tag} ${repositoryUrl} redpanda`, {
|
|
633
643
|
cwd: tempDir,
|
|
@@ -778,7 +788,7 @@ if (require.main === module) {
|
|
|
778
788
|
program
|
|
779
789
|
.name('bundle-openapi')
|
|
780
790
|
.description('Bundle OpenAPI fragments from Redpanda repository')
|
|
781
|
-
.requiredOption('-t, --tag <tag>', 'Git tag to checkout (
|
|
791
|
+
.requiredOption('-t, --tag <tag>', 'Git tag to checkout (for example, v25.1.1)')
|
|
782
792
|
.requiredOption('-s, --surface <surface>', 'API surface', (value) => {
|
|
783
793
|
if (!['admin', 'connect', 'both'].includes(value)) {
|
|
784
794
|
throw new Error('Invalid API surface. Must be "admin", "connect", or "both"');
|
|
@@ -203,7 +203,7 @@ function processCloudRegions(yamlText) {
|
|
|
203
203
|
* @param {string} options.repo - GitHub repository name.
|
|
204
204
|
* @param {string} options.path - Path to the YAML file within the repository.
|
|
205
205
|
* @param {string} [options.ref='main'] - Git reference (branch, tag, or commit SHA).
|
|
206
|
-
* @param {string} [options.format='md'] - The output format (
|
|
206
|
+
* @param {string} [options.format='md'] - The output format (for example, 'md' for Markdown).
|
|
207
207
|
* @param {string} [options.token] - Optional GitHub token for authentication.
|
|
208
208
|
* @param {string} [options.template] - Optional path to custom Handlebars template.
|
|
209
209
|
* @returns {string} The rendered cloud regions output.
|
|
@@ -27,20 +27,34 @@ async function saveFile(content, saveDir, filename) {
|
|
|
27
27
|
console.log(`Saved: ${target}`);
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
/**
|
|
31
|
+
* Fetch file or directory from GitHub repository
|
|
32
|
+
* @param {string} owner - Repository owner (for example, "redpanda-data")
|
|
33
|
+
* @param {string} repo - Repository name (for example, "redpanda-operator")
|
|
34
|
+
* @param {string} remotePath - Path to file or directory in repository
|
|
35
|
+
* @param {string} saveDir - Local directory to save files to
|
|
36
|
+
* @param {string} [customFilename] - Optional custom filename (for single files)
|
|
37
|
+
* @param {string} [ref=null] - Git ref (branch, tag, or commit SHA). Defaults to repository's default branch if null
|
|
38
|
+
* @returns {Promise<void>}
|
|
39
|
+
*/
|
|
40
|
+
async function fetchFromGithub(owner, repo, remotePath, saveDir, customFilename, ref = null) {
|
|
31
41
|
const octokit = await loadOctokit();
|
|
32
42
|
|
|
33
43
|
try {
|
|
34
|
-
const
|
|
44
|
+
const params = { owner, repo, path: remotePath };
|
|
45
|
+
if (ref) {
|
|
46
|
+
params.ref = ref;
|
|
47
|
+
}
|
|
48
|
+
const resp = await octokit.repos.getContent(params);
|
|
35
49
|
if (Array.isArray(resp.data)) {
|
|
36
50
|
// directory
|
|
37
51
|
for (const item of resp.data) {
|
|
38
52
|
if (item.type === 'file') {
|
|
39
|
-
await fetchFromGithub(owner, repo, item.path, saveDir, customFilename);
|
|
53
|
+
await fetchFromGithub(owner, repo, item.path, saveDir, customFilename, ref);
|
|
40
54
|
} else if (item.type === 'dir') {
|
|
41
55
|
// For directories, maintain the directory structure
|
|
42
56
|
const nestedDir = path.join(saveDir, path.basename(item.path));
|
|
43
|
-
await fetchFromGithub(owner, repo, item.path, nestedDir);
|
|
57
|
+
await fetchFromGithub(owner, repo, item.path, nestedDir, null, ref);
|
|
44
58
|
}
|
|
45
59
|
}
|
|
46
60
|
} else {
|
package/tools/gen-rpk-ascii.py
CHANGED
|
@@ -18,7 +18,9 @@ suggestedReadings = """
|
|
|
18
18
|
|
|
19
19
|
|
|
20
20
|
cmd_dict = {}
|
|
21
|
-
|
|
21
|
+
# Use 'docker exec' without -it flags for non-interactive/background execution
|
|
22
|
+
# -it flags require a TTY and fail in CI/background jobs
|
|
23
|
+
basic_commands_docker = ["docker", "exec"]
|
|
22
24
|
basic_commands_docker.append("redpanda-1")
|
|
23
25
|
rpk_basic_command = ["rpk"]
|
|
24
26
|
|