cf-crawl
Skill này làm gì
Skill này hướng dẫn agent AI thu thập website thông qua dịch vụ crawl Browser Rendering của Cloudflare. Skill dành cho người muốn gom các trang tài liệu hoặc cơ sở tri thức để dùng cục bộ.
Khi nào nên dùng
- ✓Khi bạn muốn lưu một trang tài liệu thành các tệp markdown trong dự án.
- ✓Khi bạn cần thu thập các trang của một cơ sở tri thức để agent AI đọc.
- ✓Khi bạn muốn tác vụ crawl chạy nền và kiểm tra trạng thái cho đến khi hoàn tất.
Liên kết skill
https://github.com/davila7/claude-code-templates/blob/main/cli-tool/components/skills/utilities/cf-crawl/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Bạn có thể thu thập website tài liệu của chúng tôi và lưu mọi trang dưới dạng markdown trong thư mục dự án của tôi không?”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Agent tải thông tin xác thực Cloudflare, bắt đầu một tác vụ crawl, kiểm tra cho đến khi hoàn tất, rồi lưu kết quả thành các tệp markdown.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
Cloudflare Website Crawler
You are a web crawling assistant that uses Cloudflare's Browser Rendering /crawl REST API to crawl websites and save their content as markdown files for local use.
Prerequisites
The user must have:
- A Cloudflare account with Browser Rendering enabled
CLOUDFLARE_ACCOUNT_IDandCLOUDFLARE_API_TOKENavailable (see below)
Workflow
When the user asks to crawl a website, follow this exact workflow:
Step 1: Load Credentials
Look for CLOUDFLARE_ACCOUNT_ID and CLOUDFLARE_API_TOKEN in this order:
- Current environment variables - Check if already exported in the shell
- Project
.envfile - Read.envin the current working directory and extract the values - Project
.env.localfile - Read.env.localin the current working directory - Home directory
.env- Read~/.envas a last resort
To load from a .env file, parse it line by line looking for CLOUDFLARE_ACCOUNT_ID= and CLOUDFLARE_API_TOKEN= entries. Use this bash approach:
# Load from .env if vars are not already set
if [ -z "$CLOUDFLARE_ACCOUNT_ID" ] || [ -z "$CLOUDFLARE_API_TOKEN" ]; then
for envfile in .env .env.local "$HOME/.env"; do
if [ -f "$envfile" ]; then
eval "$(grep -E '^CLOUDFLARE_(ACCOUNT_ID|API_TOKEN)=' "$envfile" | sed 's/^/export /')"
fi
done
fi
If credentials are still missing after checking all sources, tell the user to add them to their project .env file:
CLOUDFLARE_ACCOUNT_ID=your-account-id
CLOUDFLARE_API_TOKEN=your-api-token
The API token needs "Browser Rendering - Edit" permission. Create one at Cloudflare Dashboard > API Tokens.
Step 2: Validate Credentials
Verify both variables are set and non-empty before proceeding.
Step 3: Initiate Crawl
Send a POST request to start the crawl job. Choose parameters based on user needs:
curl -s -X POST "https://api.cloudflare.com/client/v4/accounts/${CLOUDFLARE_ACCOUNT_ID}/browser-rendering/crawl" \
-H "Authorization: Bearer ${CLOUDFLARE_API_TOKEN}" \
-H "Content-Type: application/json" \
-d '{
"url": "<TARGET_URL>",
"limit": <NUMBER_OF_PAGES>,
"formats": ["markdown"],
"options": {
"excludePatterns": ["**/changelog/**", "**/api-reference/**"]
}
}'
For incremental crawls, add the modifiedSince parameter (Unix timestamp in seconds):
curl -s -X POST "https://api.cloudflare.com/client/v4/accounts/${CLOUDFLARE_ACCOUNT_ID}/browser-rendering/crawl" \
-H "Authorization: Bearer ${CLOUDFLARE_API_TOKEN}" \
-H "Content-Type: application/json" \
-d '{
"url": "<TARGET_URL>",
"limit": <NUMBER_OF_PAGES>,
"formats": ["markdown"],
"modifiedSince": <UNIX_TIMESTAMP>
}'
When --since is provided, convert to Unix timestamp: date -d "2026-03-10" +%s (Linux) or date -j -f "%Y-%m-%d" "2026-03-10" +%s (macOS).
The response returns a job ID:
{"success": true, "result": "job-uuid-here"}
Step 4: Poll for Completion
Poll the job status every 5 seconds until it completes:
curl -s -X GET "https://api.cloudflare.com/client/v4/accounts/${CLOUDFLARE_ACCOUNT_ID}/browser-rendering/crawl/<JOB_ID>?limit=1" \
-H "Authorization: Bearer ${CLOUDFLARE_API_TOKEN}" | python3 -c "import sys,json; d=json.load(sys.stdin); print(f'Status: {d[\"result\"][\"status\"]} | Finished: {d[\"result\"][\"finished\"]}/{d[\"result\"][\"total\"]}')"
Possible job statuses:
running- Still in progress, keep pollingcompleted- All pages processedcancelled_due_to_timeout- Exceeded 7-day limitcancelled_due_to_limits- Hit account limitserrored- Something went wrong
Step 5: Retrieve Results
When using modifiedSince, check for skipped pages to see what was unchanged:
# See which pages were skipped (not modified since the given timestamp)
curl -s -X GET "https://api.cloudflare.com/client/v4/accounts/${CLOUDFLARE_ACCOUNT_ID}/browser-rendering/crawl/<JOB_ID>?status=skipped&limit=50" \
-H "Authorization: Bearer ${CLOUDFLARE_API_TOKEN}"
Fetch all completed records using pagination (cursor-based):
curl -s -X GET "https://api.cloudflare.com/client/v4/accounts/${CLOUDFLARE_ACCOUNT_ID}/browser-rendering/crawl/<JOB_ID>?status=completed&limit=50" \
-H "Authorization: Bearer ${CLOUDFLARE_API_TOKEN}"
If there are more records, use the cursor value from the response:
curl -s -X GET "https://api.cloudf
Câu hỏi thường gặp
Cần chuẩn bị gì trước khi bắt đầu?
Bạn cần tài khoản Cloudflare đã bật Browser Rendering, cùng account ID và API token.
Thông tin xác thực được đọc từ đâu?
Skill kiểm tra biến môi trường trước, sau đó kiểm tra các tệp .env trong thư mục dự án hoặc thư mục home.
Kết quả là gì?
Kết quả là một tập các tệp markdown chứa nội dung của các trang đã thu thập.
Chi tiết
Mô tả gốc của tác giả
Crawl entire websites using Cloudflare Browser Rendering /crawl API. Initiates async crawl jobs, polls for completion, and saves results as markdown files. Useful for ingesting documentation sites, knowledge bases, or any web content into your project context. Requires CLOUDFLARE_ACCOUNT_ID and CLOUDFLARE_API_TOKEN environment variables.
Độ phổ biến
- Sao GitHub
- 33k
- Vị trí xếp hạng
- #9088
- Giấy phép
- MIT
- Cập nhật
- 2/11/2026
Bình luận
- …
Thêm skill từ kho mã này
owasp-security
33kDạy agent hướng dẫn bảo mật OWASP cho ứng dụng web, API, di động, container và agent AI, để nhận ra các điểm yếu phổ biến và gợi ý cách sửa.
agent-management
33kCho phép agent của bạn tạo, liệt kê, cho ngủ đông, đánh thức, đổi tên và xóa các agent AI bằng dòng lệnh AI Maestro, quản lý vòng đời của từng agent.
agent-messaging
33kCho phép agent của bạn gửi, nhận và trả lời tin nhắn có chữ ký giữa các agent AI, dùng Agent Messaging Protocol, chủ yếu trên máy của bạn.
docs-search
33kCho phép agent của bạn tìm trong tài liệu code được tạo tự động, như chữ ký hàm, định nghĩa lớp và chú thích, để kiểm tra API thật trước khi sửa code.
Skill tương tự
tavily
394kGiúp agent của bạn tìm kiếm web bằng Tavily và lấy văn bản từ các trang cụ thể, với tùy chọn về độ sâu, tên miền và ngày tháng.
blogwatcher
394kCho phép agent của bạn theo dõi blog và nguồn cấp RSS hoặc Atom, kiểm tra bài viết mới và đánh dấu những bài bạn đã đọc.
data-scraper-agent
280kGiúp agent tự động thu thập dữ liệu từ mọi nguồn công khai. Có thể lên lịch, bổ sung thông tin và lưu kết quả. Hữu ích để theo dõi dữ liệu trực tuyến.