

Also from Kynth Studios


Also from Kynth Studios


Also from Kynth Studios
1234567891011# 部署架构与流程1213## 资源拓扑1415```mermaid16flowchart LR17 user[Browser] -->|"https://docs.cutcli.com/*"| dns[Cloudflare DNS]18 dns -->|"proxied A 192.0.2.1"| route[Worker Route]19 route -->|"docs.cutcli.com/*"| worker[Worker docs-cutcli]20 worker -->|"R2 binding DOCS"| r2[(R2 cutcli-docs)]21```2223## 资源清单2425| 资源 | 标识 |26|---|---|27| R2 bucket | `cutcli-docs`(专放 VitePress build 产物) |28| Worker | `docs-cutcli`(src 在本仓 `worker/`) |29| Worker route | `docs.cutcli.com/*` + `docs.cutcli.com` |30| DNS 记录 | `docs.cutcli.com` A 192.0.2.1 (proxied) |31| Cloudflare account | `xuliang2022@gmail.com` (id `11c47779f0d4c3d0e69ccc6c484dc589`) |32| Zone | `cutcli.com` (zone id `064059cb21d36956c11381995b964467`) |3334## 路径解析(worker 行为)3536`worker/src/index.ts` 收到请求时按下面顺序解析 R2 key:37381. `/` → `index.html`392. `/foo/` → `foo/index.html`403. `/foo/bar.html` → `foo/bar.html` (直接命中)414. `/foo/bar`(无扩展名)→ 依次试 `foo/bar.html` → `foo/bar/index.html`425. 都不命中 → 返回 R2 中的 `404.html`,HTTP 4044344## 缓存策略4546| 路径 | Cache-Control |47|---|---|48| `assets/<hash>.{js,css}` | `public, max-age=31536000, immutable` (VitePress 文件名带 hash,安全) |49| 其他(含 `.html`) | `public, max-age=3600, must-revalidate` |5051## 本地部署5253```bash54# 一键55npm run deploy5657# 等价于58npm run docs:build # vitepress build → docs/.vitepress/dist59npm run r2:upload # 增量上传,仅 etag 变化的文件 (~10s)60npm run worker:deploy # 仅 worker 改动时需要61```6263`r2:upload` 用并发 6 路调用 `worker/node_modules/.bin/wrangler`,跳过 md5 相同的文件。设置 `UPLOAD_CONCURRENCY=8` 可提速。6465## CI 部署(推荐)6667合并到 `main` 后,`.github/workflows/deploy-docs.yml` 自动跑:6869```text70checkout71 → setup-node v2272 → npm ci (root + worker)73 → npm run docs:build74 → node scripts/upload-r2.mjs # 增量上传75 → cloudflare/wrangler-action@v3 deploy worker (仅 worker 有改动时)76 → smoke test (curl 5 个关键路径)77```7879触发条件(`paths`):8081- `docs/**`82- `worker/**`83- `scripts/upload-r2.mjs`84- `package.json` / `package-lock.json`85- `.github/workflows/deploy-docs.yml`8687也可手动 `gh workflow run deploy-docs.yml`。8889## CF API Token 权限9091GitHub Secrets 必须配:9293| Secret | 用途 |94|---|---|95| `CLOUDFLARE_API_TOKEN` | wrangler 鉴权 |96| `CLOUDFLARE_ACCOUNT_ID` | `11c47779f0d4c3d0e69ccc6c484dc589` |9798Token 推荐**最小权限**(不要用 Global API Key):99100- Account → Workers Scripts → Edit101- Account → Workers R2 Storage → Edit102- Zone → Workers Routes → Edit (resource: `cutcli.com`)103- Zone → DNS → Edit (resource: `cutcli.com`,仅首次绑域名时需要)104105## 监控106107```bash108# 实时 worker 日志109cd worker && npx wrangler tail110111# 查 7 日错误率(目标 < 0.1%)112# Cloudflare Dashboard → Workers & Pages → docs-cutcli → Logs / Analytics113```114115`scheduled-cases-test.yml` 每晚跑案例校验,失败自动开 issue。116117## 回滚118119### 文档内容回滚(最常见)120121```bash122# 回滚到上一个 commit123git revert HEAD124git push125126# CI 自动重跑 deploy-docs,约 1 分钟内全球 R2 + worker 边缘节点同步完127```128129### Worker 回滚130131```bash132# Cloudflare Dashboard → Workers & Pages → docs-cutcli → Deployments133# 选上一版本 → Rollback134```135136或用 wrangler:137138```bash139cd worker140npx wrangler deployments list141npx wrangler rollback --version-id <previous-id>142```143144### R2 整体回滚(极端情况)145146R2 没有自动版本控制;需要从最近一次成功的 build 重新上传:147148```bash149git checkout <good-sha>150npm run docs:build && npm run r2:upload151# 再 git checkout main 回到当前152```153154## 周级 GC(清孤儿)155156VitePress 每次 build 会生成新的 `assets/<hash>.{js,css}`,旧的会留在 R2。每周一次清理:157158```bash159CLOUDFLARE_API_TOKEN=$CLOUDFLARE_API_TOKEN \160CLOUDFLARE_ACCOUNT_ID=11c47779f0d4c3d0e69ccc6c484dc589 \161node scripts/r2-gc.mjs --dry-run # 预览要删什么162node scripts/r2-gc.mjs --yes # 实际删163```164165## 首次部署 checklist(参考 .github/RELEASE_GUIDE.md)166167- [x] R2 bucket `cutcli-docs` 已建168- [x] Worker `docs-cutcli` 已部署169- [x] DNS `docs.cutcli.com` A 192.0.2.1 proxied170- [x] Worker routes 已绑171- [x] GitHub repo 已创建并 push172- [x] GitHub secrets 已配173- [x] CI / Deploy 跑过一次全绿174- [ ] `main` 分支保护(待开)175- [ ] 90s demo 视频(待人手)176
One repository carrying more than one format is the comparison this product exists for: does anyone actually write different content in each file, or is one a copy of the other?
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| xuliang2024/cutcli-cookbook.cursor/rules/commands.mdc · 167 | Cursor rules | lint-formatgitsecuritydeployment+1 | 78/100 | 14 days ago | |
| xuliang2024/cutcli-cookbook.cursor/rules/commit-flow.mdc · 167 | Cursor rules | gitdeploymentdocs | 74/100 | 14 days ago | |
| xuliang2024/cutcli-cookbook.cursor/rules/example-spec.mdc · 167 | Cursor rules | typessecuritydatabasedocs | 69/100 | 14 days ago | |
| xuliang2024/cutcli-cookbook.cursor/rules/open-source-boundary.mdc · 167 | Cursor rules | setup | 69/100 | 14 days ago | |
| xuliang2024/cutcli-cookbook.cursor/rules/docs-style.mdc · 167 | Cursor rules | builddocs | 73/100 | 14 days ago | |
| xuliang2024/cutcli-cookbook.cursor/rules/project-info.mdc · 167 | Cursor rules | no sections | 50/100 | 14 days ago | |
| xuliang2024/cutcli-cookbook.cursor/rules/directory-index.mdc · 167 | Cursor rules | do-notagent-behaviourdocs | 69/100 | 14 days ago |
Same format, overlapping stack, ranked by quality.
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| hiromaily/go-crypto-wallet.cursor/rules/typescript.mdc · 126 | Cursor rules | setupbuildtestlint-format+6 | 100/100 | 14 days ago | |
| TechSquidTV/Hermes.cursor/rules/10-hermes-api.mdc · 46 | Cursor rules | testlint-formatstylearch+5 | 100/100 | 14 days ago | |
| Allymahmoud/case-intake-platform.cursor/rules/frontend.mdc · 0 | Cursor rules | setuptestlint-formatstyle+7 | 99/100 | 14 days ago | |
| dodgecfr/combatfilms-webapp.cursor/rules/frontend.mdc · 0 | Cursor rules | setuptestlint-formatstyle+7 | 99/100 | 14 days ago | |
| deifos/clipmira-subtitles.cursor/rules/frontend.mdc · 1 | Cursor rules | setuptestlint-formatstyle+7 | 99/100 | 14 days ago | |
| markstev/mark-starter.cursor/rules/frontend.mdc · 0 | Cursor rules | setuptestlint-formatstyle+6 | 99/100 | 14 days ago | |
| langflow-ai/langflow.cursor/rules/docs_development.mdc · 153k | Cursor rules | setupbuildtestlint-format+7 | 97/100 | 14 days ago | |
| bybren-llc/safe-agentic-workflow.cursor/rules/10-backend-python.mdc · 399 | Cursor rules | testlint-formatstylegit+4 | 97/100 | today |
A badge carrying the measured quality of the strongest agent config file in this repository, out of 100. It reads from this index every time somebody loads your page, so it changes when the measurement changes and there is nothing to keep up to date. Free, no account, and the value is not something you or we can set by hand.
[](https://rulestack.kynth.studio/configs/xuliang2024-cutcli-cookbook-cursor-rules-deploy)Would rather not hotlink us? Every badge is also served in shields.io’s endpoint schema, so shields renders the image and your readers never talk to our domain:
Published by Toolproof, the masthead over this index and eight others. The method behind the number is at toolproof.kynth.studio/methodology, and the whole thing is readable as JSON with no key at /api.