agentleFS
notum-cznotum-cz/strapi-next-monorepo-starter/.claude/skills/remove-cdn-purge/SKILL.md

remove-cdn-purge

Skill316 starsChanged 5 months agoMITView on GitHub

Uninstalls the optional CDN purge integration (Azure Front Door example provider, CDN cache widget, /api/cdn-purge route) while keeping the core cache revalidation feature intact. Triggers: remove CDN purge, remove Front Door, uninstall CDN, drop cdn-purge, remove Azure Front Door integration, disable CDN cache widget.

  • Reads credentials
  • Deletes or force-pushes

The file

We split this skill into the rules it gives an agent

9 rules. About 0 are common, 0 are distinctive, and 9 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 9

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Remove the optional CDN purge integration from the project.

    line 6
  2. Very specific:

    Remove the import import { purgeCDNCache } from "../services/cdn-cache".

    line 31
  3. Very specific:

    Remove the entire purgeCdn(ctx) method (the second handler in the default export object).

    line 32
  4. Very specific:

    Remove the purgeCdnBodySchema const at the bottom of the file (only used by purgeCdn).

    line 33
  5. Very specific:

    Keep the run(ctx) method, revalidateBodySchema, nonEmptyStringArray, and the validateAdminToken import.

    line 34
  6. Very specific:

    Remove the app.widgets.register({ ...

    line 46
  7. Very specific:

    Remove the import { Cloud } from "@strapi/icons" line (only used by that widget).

    line 47
  8. Very specific:

    Keep the DataRevalidate edit-view injection (that belongs to core revalidation).

    line 48
  9. Very specific:

    All typechecks/tests/build must pass.

    line 75

≈ “Common” is an estimate: at least 1 in 5 of the 372,429 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Remove the optional CDN purge integration from the project. This is the operator-driven CDN cache eviction layer (the bundled Azure Front Door example provider, the Strapi "CDN cache" homepage widget, and the /api/cdn-purge route). It sits on top of the core cache revalidation feature.

Scope

  • This removes ONLY the CDN purge layer. The core cache revalidation (Strapi → Next.js revalidatePath/revalidateTag on publish) keeps working.
  • To remove the entire revalidation feature instead, use the remove-cache-revalidation skill (which also removes this CDN layer).
  • STRAPI_REVALIDATE_SECRET, CLIENT_URL, apps/ui/src/lib/cache-paths.ts, apps/ui/src/lib/verify-bearer-token.ts (shared with the revalidate endpoint), and the apps/strapi/src/api/revalidate service/controller/routes belong to core revalidation — do NOT remove them here.

Steps

1. Delete CDN-only files

rm -rf apps/ui/src/lib/cdn
rm -rf apps/ui/src/app/api/cdn-purge
rm -f  apps/strapi/src/api/revalidate/services/cdn-cache.ts
rm -rf apps/strapi/src/admin/widgets/CdnCacheWidget
rm -f  apps/strapi/tests/cdn-cache.test.ts
rm -f  apps/docs/docs/reference/integrations/cdn.md

2. Strip the CDN purge action from the Strapi revalidate controller

Edit apps/strapi/src/api/revalidate/controllers/revalidate.ts:

  • Remove the import import { purgeCDNCache } from "../services/cdn-cache".
  • Remove the entire purgeCdn(ctx) method (the second handler in the default export object).
  • Remove the purgeCdnBodySchema const at the bottom of the file (only used by purgeCdn).
  • Keep the run(ctx) method, revalidateBodySchema, nonEmptyStringArray, and the validateAdminToken import.

3. Remove the CDN purge route

Edit apps/strapi/src/api/revalidate/routes/revalidate.ts: delete the route object whose path is "/revalidate/cdn-purge" (handler revalidate.purgeCdn). Keep the "/revalidate" route.

Then edit apps/strapi/src/api/revalidate/services/helpers.ts: remove the now-orphaned readCdnPurgeConfig export (only cdn-cache.ts used it). Keep readClientCallConfig and readRevalidationConfig; if STRAPI_CDN_PURGE_SECRET is no longer referenced, drop it from the SecretEnvVar union too.

4. Unregister the CDN cache widget

Edit apps/strapi/src/admin/app.tsx:

  • Remove the app.widgets.register({ ... id: "cdn-cache" ... }) block in bootstrap.
  • Remove the import { Cloud } from "@strapi/icons" line (only used by that widget).
  • Keep the DataRevalidate edit-view injection (that belongs to core revalidation).

5. Remove the optional CDN env vars

  • apps/ui/src/env.mjs: remove these keys from BOTH the server schema and the runtimeEnv map: STRAPI_CDN_PURGE_SECRET, AZURE_SUBSCRIPTION_ID, AZURE_RESOURCE_GROUP, AZURE_FRONT_DOOR_PROFILE, AZURE_MI_CLIENT_ID, IDENTITY_ENDPOINT, IDENTITY_HEADER. Keep STRAPI_REVALIDATE_SECRET (core revalidation).
  • apps/ui/.env.local.example: remove the STRAPI_CDN_PURGE_SECRET line and the "Azure Front Door CDN purge provider" comment block with its commented AZURE_* lines. Keep STRAPI_REVALIDATE_SECRET.
  • apps/strapi/.env.example: remove the STRAPI_CDN_PURGE_SECRET entry and its comment. Keep STRAPI_REVALIDATE_SECRET and CLIENT_URL.
  • turbo.json (globalEnv): remove STRAPI_CDN_PURGE_SECRET, AZURE_SUBSCRIPTION_ID, AZURE_RESOURCE_GROUP, AZURE_FRONT_DOOR_PROFILE, AZURE_MI_CLIENT_ID, IDENTITY_ENDPOINT, IDENTITY_HEADER. Keep CLIENT_URL and STRAPI_REVALIDATE_SECRET.

6. Remove the CDN reference from the revalidation doc

Edit apps/docs/docs/reference/cache-revalidation.md: remove the ## CDN purge (optional) section (the paragraph and the link to ./integrations/cdn.md). Leave the rest of the page.

7. Verify

# No dangling references to the removed CDN pieces
grep -rn "cdn-purge\|purgeCdn\|purgeCDNCache\|CdnCacheWidget\|@/lib/cdn\|cdn-cache\|AZURE_\|IDENTITY_ENDPOINT\|IDENTITY_HEADER\|front-door\|FrontDoor" apps packages turbo.json | grep -v node_modules | grep -v "\.next"
# Expect: no matches (an empty result).

pnpm -F @repo/strapi exec tsc --noEmit
pnpm -F @repo/ui exec tsc --noEmit
pnpm -F @repo/strapi exec vitest run tests/revalidate.test.ts tests/hierarchy-revalidate.test.ts
pnpm -F @repo/ui exec vitest run src/app/api/strapi-revalidate/route.test.ts src/lib/cache-paths.test.ts
pnpm -F @repo/docs build

All typechecks/tests/build must pass. The core revalidation tests (revalidate.test.ts, hierarchy-revalidate.test.ts, strapi-revalidate/route.test.ts, cache-paths.test.ts) must still be green — confirming core revalidation survived.

8. Commit

git add -A
git commit -m "chore: remove optional CDN purge integration"

Notes

  • The fast path, if the CDN purge code was added in isolated commits and nothing since depends on it, is git revert of those commits. The steps above are the robust manual path for when the feature is intermixed with later work.
  • apps/ui/src/lib/cache-paths.ts is intentionally kept — it is still used by the core /api/strapi-revalidate route.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.