Skip to content

Commit 3a23d23

Browse files
Merge branch 'production' into patch-2
2 parents 75d5854 + 6a4e6f8 commit 3a23d23

File tree

327 files changed

+9063
-2614
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

327 files changed

+9063
-2614
lines changed

.github/workflows/publish-production.yml

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -41,34 +41,6 @@ jobs:
4141
run: sudo -v ; curl https://rclone.org/install.sh | sudo bash
4242
- name: Build vendored Markdown
4343
run: npx tsx bin/generate-index-md.ts
44-
- name: Upload vendored Markdown archives to Vendored Markdown bucket
45-
env:
46-
AWS_ACCESS_KEY_ID: ${{ secrets.VENDORED_DEVDOCS_ACCESS_KEY_ID }}
47-
AWS_SECRET_ACCESS_KEY: ${{ secrets.VENDORED_DEVDOCS_SECRET_ACCESS_KEY }}
48-
run: |
49-
cd distmd && zip -r markdown.zip .
50-
rclone copy \
51-
--config ../bin/rclone.conf \
52-
./markdown.zip \
53-
devdocs:vendored-markdown
54-
rm markdown.zip
55-
cd ..
56-
57-
cd distllms
58-
rclone copy --max-depth 2 \
59-
--config ../bin/rclone.conf \
60-
. \
61-
devdocs:vendored-markdown
62-
cd ..
63-
- name: Upload vendored Markdown files to ZT DevDocs bucket
64-
env:
65-
AWS_ACCESS_KEY_ID: ${{ secrets.ZT_DEVDOCS_ACCESS_KEY_ID }}
66-
AWS_SECRET_ACCESS_KEY: ${{ secrets.ZT_DEVDOCS_SECRET_ACCESS_KEY }}
67-
run: |
68-
rclone sync \
69-
--config bin/rclone.conf \
70-
distmd \
71-
zt:zt-dashboard-dev-docs
7244
- name: Upload vendored Markdown files to AI Search DevDocs bucket
7345
env:
7446
AWS_ACCESS_KEY_ID: ${{ secrets.AUTORAG_DEVDOCS_ACCESS_KEY_ID }}

.github/workflows/semgrep.yml

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ on:
44
- cron: "0 4 * * *"
55
pull_request: {}
66

7-
name: Semgrep config
7+
name: Semgrep rules checking results
88
permissions:
99
contents: read
1010

1111
jobs:
1212
semgrep:
13-
name: semgrep
13+
name: Semgrep
1414
runs-on: ubuntu-latest
1515
env:
1616
SEMGREP_APP_TOKEN: ${{ secrets.SEMGREP_APP_TOKEN }}
@@ -25,31 +25,48 @@ jobs:
2525
# fetch full history so Semgrep can compare against the base branch
2626
fetch-depth: 0
2727

28+
# Configure
29+
# add git safe directory to enable git commands on checkout path
30+
# set COMMIT_MESSAGE environment variable to be able to skip semgrep if requested
31+
- name: Configure
32+
run: |
33+
git config --global --add safe.directory $PWD
34+
echo "COMMIT_MESSAGE='$(git log --format=%B -n 1 ${{ github.event.pull_request.head.sha }} | sed "s/\"/'/g" | tr "\n" " ") '" | tee /dev/stderr >> "$GITHUB_ENV"
35+
echo "(if the last commit message contains '[skip style guide checks]' Semgrep style guide rule checks will be skipped)"
36+
2837
# Semgrep CI to run on Schedule (Cron) or Manual Dispatch
2938
# scans using managed rules at cloudflare.semgrep.dev
30-
- name: Semgrep CI Rules (Managed rules at cloudflare.semgrep.dev)
39+
- name: Semgrep managed rules (managed at cloudflare.semgrep.dev)
3140
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
3241
run: semgrep ci
3342

3443
# Semgrep Scan to run on Pull Request events
3544
# scans using rules inside the .semgrep/ folder and fails on error
3645
# include [skip semgrep] in top-most commit message to skip scan
37-
- name: Semgrep Repo Rules (Custom rules found in .semgrep/)
38-
if: github.event_name == 'pull_request' && !contains(github.event.head_commit.message, '[skip semgrep]')
46+
- name: Semgrep style guide rules (stored in .semgrep/)
47+
shell: bash
48+
if: github.event_name == 'pull_request' && !contains(env.COMMIT_MESSAGE, '[skip style guide checks]')
3949
run: |
4050
41-
git config --global --add safe.directory $PWD
51+
echo "env.COMMIT_MESSAGE: ${{ env.COMMIT_MESSAGE }}"
52+
4253
base_commit=$(git merge-base HEAD origin/$GITHUB_BASE_REF)
4354
git diff $base_commit... --diff-filter=ACMRT --name-only | grep -E '\.(htm|html|yaml|yml|md|mdx)$' > tools/relevant_changed_files.txt || true
4455
4556
# Check if file list is empty to prevent errors
4657
if [ -s tools/relevant_changed_files.txt ]; then
4758
list_of_files=$(cat tools/relevant_changed_files.txt | tr '\n' ' ')
59+
60+
# when ready to show errors add back --error below
4861
semgrep scan \
4962
--config .semgrep --metrics=off \
5063
--include "*.mdx" --include "*.mdx" \
51-
$list_of_files
52-
# add '--error' to return error code to workflow
64+
--json \
65+
$list_of_files \
66+
| jq --raw-output ".results[] | \"::warning file=\(.path),line=\(.start.line),title=\(.check_id)::\(.extra.message)\""
67+
#exit ${PIPESTATUS[0]}
68+
# for the moment always return a successful run
69+
exit 0
5370
else
54-
echo "No relevant files changed."
71+
echo "No relevant files changed"
5572
fi

.opencode/agent/docs.md

Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
1+
---
2+
description: ALWAYS use this when writing docs
3+
---
4+
5+
You are an expert technical documentation writer for a developer/cloud platform.
6+
7+
## Core Writing Principles
8+
9+
Ensure language is not overly verbose, LLM-like, or inconsistent with existing documentation and language conventions.
10+
11+
- Use active voice and present tense
12+
- Use second person ("you") to address the reader
13+
- Write in plain language (8-12 words per sentence)
14+
- Do not use contractions
15+
- Avoid future tense except for actions that have not happened yet
16+
17+
## Page Structure
18+
19+
### Frontmatter (required)
20+
21+
Every page must have valid frontmatter including:
22+
23+
- `title`: A word or 2-3 word phrase
24+
- `pcx_content_type`: One of `how-to`, `tutorial`, `concept`, `get-started`, `overview`, `reference`, `faq`, `changelog`, `navigation`, `configuration`, `troubleshooting`
25+
26+
### Description
27+
28+
- One short line (5-10 words)
29+
- Should not start with "The"
30+
- Avoid repeating the page title
31+
32+
## Content Guidelines
33+
34+
### Paragraphs
35+
36+
- Chunks of text should not be more than 2 sentences long
37+
- Avoid walls of text - use headers, lists, or asides to break up content
38+
39+
### Section titles (H2, H3, etc.)
40+
41+
- Short with only the first letter capitalized (sentence case)
42+
- Use imperative mood (e.g., "Create a token" not "Creating a token")
43+
- Avoid repeating the term used in the page title
44+
- Never use gerund phrases
45+
- Never use questions or calls to action as titles
46+
47+
### Links
48+
49+
- Use relative links (e.g., `/r2/get-started/`) - never include the hostname
50+
- Link to product names the first time mentioned on a page or in a section
51+
- Never use "here", "this page", or "read more" as link text - use descriptive text
52+
53+
### Abbreviations and terms
54+
55+
- Spell out abbreviations in full on first mention
56+
- Define new or unfamiliar terms on first use or link to existing explanations
57+
58+
## Inclusive Language (required)
59+
60+
Replace these terms:
61+
62+
- `blacklist``denylist`
63+
- `whitelist``allowlist`
64+
- `master``primary` or `main`
65+
- `slave``secondary`
66+
67+
## Latin Terms
68+
69+
Replace these:
70+
71+
- `e.g.``for example`
72+
- `i.e.``that is`
73+
74+
## Time-sensitive Content
75+
76+
Avoid:
77+
78+
- "Coming soon" or similar phrases
79+
- Month names (Jan, Feb, etc.) unless in changelogs
80+
- Year references (2024, 2025, etc.) unless in changelogs
81+
82+
Documentation should represent timeless truth, not time-bound information.
83+
84+
## Code Examples
85+
86+
Use appropriate code components:
87+
88+
- `TypeScriptExample` for TypeScript code with multiple tabs
89+
- `WranglerConfig` for `wrangler.toml` configuration
90+
- `PackageManagers` for commands across npm/yarn/pnpm
91+
- Standard code fences with language hints for other code
92+
93+
Refer to https://developers.cloudflare.com/style-guide/components/ for code components and https://developers.cloudflare.com/style-guide/formatting/code-block-guidelines/ for code block formatting.
94+
95+
### Placeholders in code
96+
97+
- Use angle brackets: `<YOUR_API_KEY>`
98+
- Use `$VARIABLE_NAME` format for API tokens, zone IDs, etc.
99+
- Include `title="filename.js"` for file-specific code
100+
101+
### Terminal commands
102+
103+
- Use `sh` for one-line Linux/macOS commands
104+
- Use `bash` for multi-line commands or those with JSON bodies
105+
- Use `powershell` for Windows PowerShell
106+
- Use `txt` for Windows console or when no syntax highlighting applies
107+
108+
Every code example should include a description of what it does and any relevant context or assumptions.
109+
110+
## Notes and Warnings
111+
112+
Use Starlight aside syntax:
113+
114+
```
115+
:::note[Optional Title]
116+
Content here
117+
:::
118+
119+
:::caution[Optional Title]
120+
Warning content here
121+
:::
122+
```
123+
124+
Use sparingly - maximum one of each type per section.
125+
126+
## Components
127+
128+
Pages must import any components used. Remove unused imports.
129+
130+
Import pattern: `import { ComponentName } from "~/components";`
131+
132+
Key components available:
133+
134+
- `Tabs` / `TabItem` - Switchable content sections
135+
- `Details` - Collapsible content blocks
136+
- `Render` - Include partial content
137+
- `GlossaryTooltip` - Hover definitions
138+
- `Plan` / `InlineBadge` - Plan/status badges
139+
- `DirectoryListing` - Auto-generated sub-page lists
140+
141+
Refer to https://developers.cloudflare.com/style-guide/components/ for full component documentation.
142+
143+
## File Conventions
144+
145+
- Filenames: lowercase, dash-separated, semantically meaningful (e.g., `create-api-token.mdx`)
146+
- Every folder must have an `index.mdx` file
147+
- Images go in `/src/assets/images/{product_folder}/`

.opencode/command/changelog.md

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
---
2+
description: Generate a product changelog entry
3+
---
4+
5+
Generate a changelog entry for the Cloudflare documentation site based on the user's request.
6+
7+
## User Request
8+
9+
$ARGUMENTS
10+
11+
## Instructions
12+
13+
1. **Validate the request**: Ensure the user has provided:
14+
- A clear product name (for example, Workers, KV, Hyperdrive, Containers, R2, etc.)
15+
- A description of the change or feature being documented
16+
- Enough context to explain the "why" and use-cases
17+
18+
If any of these are missing or unclear, ask the user for clarification before proceeding.
19+
20+
2. **Determine the product folder**: Use the product name to identify the correct changelog folder under `src/content/changelog/{product}/`. Refer to existing folders for valid product names.
21+
22+
3. **Create the changelog file**: Create a new file at:
23+
```
24+
src/content/changelog/{product}/{YYYY-MM-DD}-{useful-short-name}.mdx
25+
```
26+
Use today's date and a concise, hyphenated slug describing the change.
27+
28+
4. **Frontmatter format**:
29+
```yaml
30+
---
31+
title: {Concise title describing the change}
32+
description: {One-sentence summary of what changed and why it matters}
33+
products:
34+
- {product}
35+
date: {YYYY-MM-DD}
36+
---
37+
```
38+
39+
5. **Writing style guidelines**:
40+
- Use imperative mood and active voice
41+
- The opening sentence must clearly explain what the new feature/change is and what problem it solves
42+
- Expand on usage, use-cases, and the "why" in subsequent paragraphs
43+
- Assume a technical developer/cloud audience
44+
- Keep sentences concise (8-12 words where possible)
45+
- Avoid contractions
46+
- Avoid LLM-like phrases ("It's important to note", "leverage", "seamless", etc.)
47+
- Replace `e.g.` with "for example" and `i.e.` with "that is"
48+
49+
6. **Code examples for Developer Platform products**:
50+
For products in the Developer Platform group (Workers, Durable Objects, Pipelines, KV, Hyperdrive, R2, D1, Queues, Containers, etc.):
51+
- Include a code block demonstrating usage of the new feature
52+
- Use plain JavaScript/TypeScript code blocks (```js or ```ts)
53+
- If showing wrangler.json config, use ```jsonc
54+
- Keep code snippets short and focused on the new feature
55+
- Minimize boilerplate and unnecessary code
56+
- Add imports at the top if using components: `import { Render, TypeScriptExample, WranglerConfig } from "~/components";`
57+
58+
7. **Documentation links**: End the changelog with a link to relevant documentation:
59+
- Use relative paths (for example, `/workers/configuration/placement/`)
60+
- Link text should describe the destination, not "click here" or "read more"
61+
- Check for any uncommitted/staged .md/.mdx files that might be the related documentation
62+
63+
## Reference Examples
64+
65+
Review these existing changelogs for style and format guidance:
66+
- `src/content/changelog/workers/` - Workers changelogs with code examples
67+
- `src/content/changelog/kv/` - KV changelogs
68+
- `src/content/changelog/hyperdrive/` - Hyperdrive changelogs
69+
- `src/content/changelog/containers/` - Container changelogs
70+
71+
## Output
72+
73+
Create the changelog file and show the user the complete file path and content.

.opencode/command/styleguide.md

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
---
2+
description: "validate against the style guide"
3+
model: opencode/claude-opus-4-5
4+
---
5+
6+
Look at all the unstaged changes to markdown (.md, .mdx) files, pull out the lines that have changed, and validate against these rules:
7+
8+
## Writing Style
9+
10+
1. **Voice and tense**: Active voice and present tense should be used. Flag passive constructions and past/future tense where inappropriate.
11+
12+
2. **Plain language**: Sentences should be 8-12 words. Flag overly complex or verbose sentences.
13+
14+
3. **Contractions**: Should not be used. Flag any contractions (don't, won't, can't, etc.).
15+
16+
4. **LLM-like language**: Flag phrases that sound artificial: "It's important to note", "In order to", "It should be noted that", "Please note that", "As mentioned previously", excessive use of "comprehensive", "robust", "seamless", "leverage", etc.
17+
18+
## Terminology
19+
20+
5. **Inclusive language**: Flag and suggest replacements for:
21+
- `blacklist``denylist`
22+
- `whitelist``allowlist`
23+
- `master``primary` or `main`
24+
- `slave``secondary`
25+
26+
6. **Latin terms**: Replace:
27+
- `e.g.``for example`
28+
- `i.e.``that is`
29+
30+
7. **Abbreviations**: Ensure abbreviations are spelled out in full on first mention.
31+
32+
## Time-sensitive Content
33+
34+
8. **Avoid time-bound language**: Flag:
35+
- "Coming soon" or similar phrases
36+
- Month names (unless in changelog content)
37+
- Year references (unless in changelog content)
38+
39+
## Structure and Formatting
40+
41+
9. **Code blocks**: Ensure code blocks use appropriate components (`TypeScriptExample`, `WranglerConfig`, `PackageManagers`) or proper language hints. Code should include descriptions of what it does.
42+
43+
10. **Paragraphs**: Flag extremely long paragraphs (more than 2-3 sentences). Suggest breaking up with headers, lists, or asides.
44+
45+
11. **Link text**: Flag links with unhelpful text like "here", "this page", "read more", or "click here". Link text should describe the destination.
46+
47+
12. **Links format**: Flag full URLs to developers.cloudflare.com - should use relative paths (e.g., `/workers/get-started/`).
48+
49+
## Output Format
50+
51+
For each issue found, report:
52+
- The problematic text (quote it)
53+
- Which rule it violates
54+
- A suggested fix
55+
56+
Then provide a short 1-3 sentence summary of the overall changes needed and their rationale.
57+
58+
If no issues are found, report that the changes align with the style guide.

0 commit comments

Comments
 (0)