Skip to content

Get cloudflare skills from middlecache#28658

Open
mvvmm wants to merge 7 commits intoproductionfrom
get-skills-from-middlecache
Open

Get cloudflare skills from middlecache#28658
mvvmm wants to merge 7 commits intoproductionfrom
get-skills-from-middlecache

Conversation

@mvvmm
Copy link
Contributor

@mvvmm mvvmm commented Feb 27, 2026

Summary

Removes the committed copy of Cloudflare Skills from the repo and replaces it with a fetch-at-build-time approach sourcing from middlecache.

  • bin/fetch-skills.ts — fetches skills.tar.gz from middlecache and extracts into skills/. Skips if skills/ already exists; --force overrides. --soft mode (used by predev) warns on failure instead of blocking.
  • package.json — adds prebuild and predev hooks to run the script automatically
  • skills/ — removed from git, added to .gitignore

In dev, fetch runs once and is skipped on subsequent restarts; network failures warn but don't block. In CI, skills/ is always fetched fresh since it isn't committed — fetch failure fails the build.

The well known skills can be verified here: https://11705275.preview.developers.cloudflare.com/.well-known/skills/index.json

@github-actions
Copy link
Contributor

This pull request requires reviews from CODEOWNERS as it changes files that match the following patterns:

Pattern Owners
* @cloudflare/pcx-technical-writing
*.ts @cloudflare/content-engineering, @kodster28
package.json @cloudflare/content-engineering

@mvvmm
Copy link
Contributor Author

mvvmm commented Feb 27, 2026

/bonk please review this PR for any issues

Copy link
Contributor

@ask-bonk ask-bonk bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One issue found — filename typo in AGENTS.md.

@ask-bonk
Copy link
Contributor

ask-bonk bot commented Feb 27, 2026

Posted review on PR #28658. Here's the summary:

One issue found — filename typo in AGENTS.md.

  • MEDIUMAGENTS.md:41 references bin/fetch-skills.js but the actual file is bin/fetch-skills.ts. Posted an inline suggestion to fix.

The rest of the PR looks solid:

  • bin/fetch-skills.ts has good error handling with --soft/--force flags, proper streaming to tar, and clean skip-if-exists logic.
  • prebuild and predev hooks in package.json are correctly wired — --soft on predev ensures local dev is not blocked by network failures.
  • .gitignore correctly excludes skills/ with a descriptive comment.
  • AGENTS.md formatting improvements (table alignment, code block fencing) are all correct.
  • The ~54k lines of deletions are all the previously-committed skills content being removed as expected.

github run

@github-actions
Copy link
Contributor

github-actions bot commented Feb 27, 2026

Co-authored-by: ask-bonk[bot] <249159057+ask-bonk[bot]@users.noreply.github.com>
@elithrar
Copy link
Collaborator

this is great @mvvmm - thank you

Copy link
Collaborator

@cdrubin cdrubin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you make use of this function perhaps: https://github.com/cloudflare/cloudflare-docs/blob/production/src/util/custom-loaders.ts#L20 for grabbing the file from middlecache?

Also, is there a way to re-use some of the content collection pattern for doing any of this? Or not really useful because all the changes are done before the tarball is generated?

@mvvmm
Copy link
Contributor Author

mvvmm commented Mar 2, 2026

Could you make use of this function perhaps: https://github.com/cloudflare/cloudflare-docs/blob/production/src/util/custom-loaders.ts#L20 for grabbing the file from middlecache?

No for a couple of reasons I think. This function saves to .tmp but we need these in /skills/, and the need for the tarball streaming/extraction. This is also "pre-astro" in the build/dev lifecycle.

Also, is there a way to re-use some of the content collection pattern for doing any of this? Or not really useful because all the changes are done before the tarball is generated?

I think the astro-skills is already using the content-collection pattern? See https://github.com/cloudflare/cloudflare-docs/blob/production/src/content.config.ts#L128, but let me know if I misunderstand something here.

@mvvmm mvvmm requested a review from cdrubin March 2, 2026 16:44
@mvvmm
Copy link
Contributor Author

mvvmm commented Mar 2, 2026

Used downloadToDotTempIfNotPresent.

@mvvmm
Copy link
Contributor Author

mvvmm commented Mar 2, 2026

/bonk mind reviewing this one one more time after my new changes?

@ask-bonk
Copy link
Contributor

ask-bonk bot commented Mar 2, 2026

UnknownError: "Overloaded"

github run

@ask-bonk
Copy link
Contributor

ask-bonk bot commented Mar 2, 2026

@mvvmm Bonk workflow failed. Check the logs for details.

View workflow run · To retry, trigger Bonk again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants