Skip to content

Commit f8f34dd

Browse files
authored
Add-diataxis-plugin (#247)
* add diataxis plugin and instructions * improve docs-reviewer, align with diataxis standards
1 parent 6cb2bc3 commit f8f34dd

3 files changed

Lines changed: 163 additions & 5 deletions

File tree

.claude/agents/docs-reviewer.md

Lines changed: 105 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,65 @@ Each part should follow this standard structure where applicable:
3636
5. **Common pitfalls**: Warnings and cautions (if applicable)
3737
6. **Cross-references**: Links to related parts or sections
3838

39+
#### 1.3 How-To Guide Structure
40+
For how-to guides and method comparison documents, verify the presence of these standard sections:
41+
42+
**Opening Summary ("This guide shows you:")**
43+
- Must appear at the top of the document after frontmatter
44+
- 2-4 bullet points outlining what the user will learn
45+
- Sets clear expectations about the guide's scope
46+
- Example:
47+
```markdown
48+
**This guide shows you:**
49+
- How to translate between language variants (e.g., `en-US` to `en-GB`)
50+
- Which method to choose: Write API, style rules, or custom instructions
51+
- Example workflow for converting American English to British English
52+
```
53+
54+
**Method Sections with "When to use" Guidance**
55+
- Each method/approach should have its own subsection
56+
- Include a "**When to use this:**" section with clear decision-making bullets
57+
- Focus on use cases, not just features
58+
- Example:
59+
```markdown
60+
### 1. Method Name
61+
62+
Brief description of the method.
63+
64+
**When to use this:**
65+
- Use case scenario 1
66+
- Use case scenario 2
67+
- Use case scenario 3
68+
```
69+
70+
**Method Comparison Table**
71+
- When document presents multiple approaches, include a comparison table
72+
- Rows should be use cases, columns should be methods
73+
- Use ✅, ❌, or ⚠️ for at-a-glance comparison
74+
- Include practical use cases like "Short texts", "Longer texts", "Reusable rules"
75+
76+
**Technical Details Section**
77+
- Should include subsections for:
78+
- **Cost**: Billing information for parameters
79+
- **Limits**: Size limits, rate limits, parameter limits
80+
- **Recommendations**: Best practices for the feature (e.g., model type recommendations)
81+
- Place before "Next steps" section
82+
83+
**Next Steps Section**
84+
- Must be titled "Next steps" (not "Related Documentation")
85+
- Opening sentence: "Now that you understand [topic]:"
86+
- Use bold lead-ins for each bullet point
87+
- Lead-ins should be action-oriented: "Try it yourself:", "Learn about:", "Explore:"
88+
- Example:
89+
```markdown
90+
## Next steps
91+
92+
Now that you understand how to translate between language variants:
93+
94+
- **Try it yourself:** Review the [API reference](/link) for specifications
95+
- **Learn about X:** Explore the [feature](/link) for advanced usage
96+
```
97+
3998
### 2. Document Style
4099

41100
#### 2.1 Writing Voice and Tone
@@ -132,15 +191,59 @@ Each code example should include:
132191
3. **Explanation**: Key points explained after the code
133192
4. **Variations** (if applicable): Alternative approaches with pros/cons
134193

135-
#### 3.3 Code Consistency
194+
#### 3.3 Inline Method Examples
195+
For how-to guides that present multiple methods/approaches, each method section should include a short, focused code example:
196+
197+
**Requirements:**
198+
- **Placement**: Code example should appear immediately after the "When to use this:" bullets
199+
- **Labels**: Use proper labels like "Example cURL request" or "Example request"
200+
- **Request AND Response**: Always show both the request and the response
201+
- **Brevity**: Keep examples short and focused on the key differentiator of the method
202+
- **Consistency**: Use the same example text/scenario across all methods for easy comparison
203+
204+
**Example structure:**
205+
```markdown
206+
### 1. Method Name
207+
208+
Brief description of the method.
209+
210+
**When to use this:**
211+
- Use case 1
212+
- Use case 2
213+
214+
```bash Example cURL request
215+
curl -X POST 'https://api.example.com/endpoint' \
216+
--header 'Authorization: API-Key [yourKey]' \
217+
--data '{
218+
"parameter": "value"
219+
}'
220+
```
221+
222+
```json Example response
223+
{
224+
"result": "output"
225+
}
226+
```
227+
228+
<Warning>
229+
Any warnings or caveats specific to this method.
230+
</Warning>
231+
```
232+
233+
**When NOT to include inline examples:**
234+
- If the guide has a comprehensive example section later (but this should be rare)
235+
- If the method requires setup steps that can't be shown inline
236+
- In these cases, add a note directing users to the detailed example section
237+
238+
#### 3.4 Code Consistency
136239
- **Import statements**: Show imports when first introducing a concept
137240
- **Variable naming**:
138241
- Use descriptive names: `live_request_queue` not `lrq`
139242
- Follow Python conventions: `snake_case` for variables/functions, `PascalCase` for classes
140243
- **Type hints**: Include type hints in function signatures when helpful for understanding
141244
- **Error handling**: Show error handling in production-like examples, omit in minimal examples
142245

143-
#### 3.4 Code Example Types
246+
#### 3.5 Code Example Types
144247
Distinguish between:
145248
- **Minimal examples**: Simplest possible demonstration of a concept
146249
- **Production-like examples**: Include error handling, logging, edge cases

.claude/settings.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"enabledPlugins": {
3+
"diataxis-documentation@deepl-claude-code-marketplace": true
4+
}
5+
}

README.md

Lines changed: 53 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,61 @@ Install our Github App to auto propagate changes from your repo to your deployme
2727

2828
## AI Workflow
2929

30-
We have a subagent, `docs-reviewer.md`, designed to help us edit our docs. It's based on a sub-agent created by a GCP technical writer. (Read more in [this article](https://medium.com/google-cloud/supercharge-tech-writing-with-claude-code-subagents-and-agent-skills-44eb43e5a9b7), or [this repo](https://github.com/kazunori279/gcp-blogs/blob/main/.claude/agents/docs-reviewer.md).) It can be triggered via a Claude Code command like:
30+
### Setting Up the DeepL Claude Code Marketplace (DeepL Internal Only)
3131

32-
`Use the docs-reviewer subagent on [filename]`
32+
**DeepL team members:** Install our internal Claude Code marketplace to access the `diataxis-documentation` plugin for structured technical writing:
3333

34-
Future plans for AI workflows:
34+
1. **Add the marketplace:**
35+
```
36+
/plugin marketplace add https://git.deepl.dev/deepl/devex/ai-tooling/claude-code-marketplace.git
37+
```
38+
39+
2. **Install the diataxis-documentation plugin:**
40+
```
41+
/plugin install diataxis-documentation@deepl-claude-code-marketplace
42+
```
43+
44+
This gives you access to the Diátaxis framework for creating tutorials, how-to guides, references, and explanations.
45+
46+
**The skill activates automatically** when you ask Claude to:
47+
- "write documentation", "create tutorial", "create guide"
48+
- "write how-to", "document this", "add documentation"
49+
- "review documentation", "improve docs", "check documentation quality"
50+
- Mention "technical writing", "reference docs", "explanation"
51+
52+
When creating new documentation, the skill will:
53+
1. Help identify the correct documentation type (tutorial, how-to, reference, or explanation)
54+
2. Guide you through following Diátaxis writing principles
55+
3. Provide examples of good documentation structure
56+
57+
### Subagents (Available to Everyone)
58+
59+
We have a custom subagent in `.claude/agents/` that is **automatically available to anyone** who clones this repo (no installation required):
60+
61+
- **`docs-reviewer.md`**: Designed to help edit our docs. Based on a sub-agent created by a GCP technical writer. (Read more in [this article](https://medium.com/google-cloud/supercharge-tech-writing-with-claude-code-subagents-and-agent-skills-44eb43e5a9b7), or [this repo](https://github.com/kazunori279/gcp-blogs/blob/main/.claude/agents/docs-reviewer.md).)
62+
63+
### Recommended Documentation Review Workflow
64+
65+
For the highest quality documentation, use both the diataxis plugin and docs-reviewer subagent together:
66+
67+
1. **Write or update documentation** - Simply ask Claude naturally:
68+
- "Create a tutorial for [feature]"
69+
- "Write a how-to guide for [task]"
70+
- "Document this API endpoint"
71+
72+
The diataxis skill will activate automatically and ensure your content follows the correct documentation type (tutorial, how-to, reference, or explanation).
73+
74+
If you prefer to write the documentation by hand, you can also say "Review this documentation".
75+
76+
2. **Review with the docs-reviewer subagent:**
77+
```
78+
Use the docs-reviewer subagent on [filename]
79+
```
80+
This checks for style, clarity, and consistency with our documentation standards.
81+
82+
This two-pass approach ensures both structural correctness (via diataxis) and editorial quality (via docs-reviewer).
83+
84+
### Future Plans
3585

3686
- Add a subagent to search our codebase and backstage
3787
- Further customize subagents to match our writing style

0 commit comments

Comments
 (0)