|
| 1 | +# Agent Workflow Rules for cloudflare-docs |
| 2 | + |
| 3 | +## Git Workflow Between Workstreams |
| 4 | + |
| 5 | +### Critical Rules |
| 6 | + |
| 7 | +1. **Always sync with main between workstreams** |
| 8 | + - Before starting new work, ensure you're on the latest main branch |
| 9 | + - Run `git checkout main && git pull origin main` |
| 10 | + |
| 11 | +2. **Create clean branches for each workstream** |
| 12 | + - Each new workstream gets a fresh branch from main |
| 13 | + - Branch naming conventions: |
| 14 | + - Browser Rendering: `br-<descriptive-name>` (e.g., `br-update-playwright-docs`) |
| 15 | + - Zaraz: `zaraz-<descriptive-name>` |
| 16 | + - Google Tag Gateway: `gtg-<descriptive-name>` |
| 17 | + - General: Use descriptive names for other products |
| 18 | + |
| 19 | +3. **Ensure PRs only contain relevant work** |
| 20 | + - Each PR should only include changes from its specific workstream |
| 21 | + - No leftover files or changes from previous workstreams |
| 22 | + |
| 23 | +### Standard Workflow |
| 24 | + |
| 25 | +#### Starting a New Workstream |
| 26 | + |
| 27 | +```bash |
| 28 | +# 1. Switch to main and update |
| 29 | +git checkout main |
| 30 | +git pull origin main |
| 31 | + |
| 32 | +# 2. Create new branch for the workstream |
| 33 | +git checkout -b <descriptive-branch-name> |
| 34 | +``` |
| 35 | + |
| 36 | +#### During Work |
| 37 | + |
| 38 | +```bash |
| 39 | +# Stage and commit changes as you work |
| 40 | +git add <files> |
| 41 | +git commit -m "descriptive message" |
| 42 | +``` |
| 43 | + |
| 44 | +#### Finishing a Workstream |
| 45 | + |
| 46 | +```bash |
| 47 | +# 1. Push branch |
| 48 | +git push origin <branch-name> |
| 49 | + |
| 50 | +# 2. Create PR (via GitHub UI or CLI) |
| 51 | + |
| 52 | +# 3. After PR is merged, clean up |
| 53 | +git checkout main |
| 54 | +git pull origin main |
| 55 | +git branch -d <branch-name> |
| 56 | +``` |
| 57 | + |
| 58 | +#### Between Workstreams Checklist |
| 59 | + |
| 60 | +- [ ] Current work is committed and pushed |
| 61 | +- [ ] PR is created for current workstream |
| 62 | +- [ ] Switched back to main: `git checkout main` |
| 63 | +- [ ] Pulled latest changes: `git pull origin main` |
| 64 | +- [ ] Ready to create new branch for next workstream |
| 65 | + |
| 66 | +## Cloudflare Docs Specific Rules |
| 67 | + |
| 68 | +### Changelog Locations |
| 69 | + |
| 70 | +1. **Product-specific release notes** (routine updates): `src/content/release-notes/*.yaml` |
| 71 | + - Use for: version bumps, bug fixes, minor features |
| 72 | + - Example: `src/content/release-notes/browser-rendering.yaml` |
| 73 | + |
| 74 | +2. **Cloudflare-wide changelog** (major announcements): `src/content/changelog/<product>/*.mdx` |
| 75 | + - Use for: major features, GA announcements, significant updates |
| 76 | + - Example: `src/content/changelog/browser-rendering/` |
| 77 | + |
| 78 | +### Content Guidelines |
| 79 | + |
| 80 | +- Follow all rules in `.windsurf/rules/general-rules.md` |
| 81 | +- Use absolute paths for links (e.g., `/1.1.1.1/check/`) not full URLs |
| 82 | +- Always include trailing slash for links without anchors |
| 83 | +- Import components at top of file below frontmatter |
| 84 | +- No contractions, exclamation marks, or non-standard quotes |
| 85 | + |
| 86 | +### Common Components |
| 87 | + |
| 88 | +- `DashButton` - Replace `https://dash.cloudflare.com` in steps |
| 89 | +- `APIRequest` - Replace `sh` blocks with API requests |
| 90 | +- `FileTree` - Replace `txt` file tree blocks |
| 91 | +- `PackageManagers` - Replace `sh` blocks with npm commands |
| 92 | +- `TypeScriptExample` - Replace `ts`/`typescript` code blocks (except in tutorials) |
| 93 | + |
| 94 | +## Cross-Reference Reminders |
| 95 | + |
| 96 | +When making changes to one part of the docs, review existing pages to see if there are other locations that should also be updated. Common scenarios: |
| 97 | + |
| 98 | +- **Updating a value** (e.g., version number, ID, limit) — Search the docs for other references |
| 99 | +- **Adding new functionality** — Check if related pages (FAQ, tutorials, reference) need updates |
| 100 | +- **Changing behavior** — Update any pages that describe the old behavior |
| 101 | + |
| 102 | +Example values that appear in multiple places: |
| 103 | + |
| 104 | +| Value | Source of Truth | Also Referenced In | |
| 105 | +| ----- | --------------- | ------------------ | |
| 106 | +| Bot detection ID (`128292352`) | `/browser-rendering/reference/automatic-request-headers.mdx` | `/browser-rendering/faq.mdx` | |
| 107 | + |
| 108 | +## Deployment Preference |
| 109 | + |
| 110 | +When building full-stack web apps: |
| 111 | +- Use single Cloudflare Worker for frontend + API |
| 112 | +- Configure `[assets]` in `wrangler.toml` for static files |
| 113 | +- Use Hono for API routes |
| 114 | +- Deploy with single `wrangler deploy` command |
| 115 | +- Do not use Cloudflare Pages separately |
0 commit comments