Skip to content

feat: embed the Swarm cheatsheet, synced from swarm-cheatsheets#829

Merged
yjkellyjoo merged 5 commits into
masterfrom
feat/embed-swarm-cheatsheet
Jul 16, 2026
Merged

feat: embed the Swarm cheatsheet, synced from swarm-cheatsheets#829
yjkellyjoo merged 5 commits into
masterfrom
feat/embed-swarm-cheatsheet

Conversation

@yjkellyjoo

Copy link
Copy Markdown
Member

What does this PR resolve? 🚀

Adds a Swarm Cheatsheet to the docs, served from our own domain and kept in sync with the swarm-cheatsheets repo so the content is never maintained in two places.

  • New Setup card on the Start Building page linking to a Swarm Cheatsheet doc page.
  • The doc page embeds the cheatsheet via <iframe>; the page + its assets are mirrored from swarm-cheatsheets@main into static/ at build time.
  • swarm-cheatsheets stays the single source of truth — a fresh copy is fetched on every build, nothing is copied by hand.

Details 📝

  • Build-time mirror (scripts/fetch-cheatsheets.mjs, run from prebuild): fetches the cheatsheet HTML, its assets (fonts, QR lib, logos), and the PDF, rewriting ../../../assets/../assets/ and ../../../dist/../ (matching the source repo's own site.sh). Output lands in static/cheatsheets/ and is served at /cheatsheets/overview/.
  • Fetches run concurrently with a 20s per-request timeout, the output dir is pruned first, and any fetch failure fails the build — so a broken/missing mirror can never deploy.
  • Generated static/cheatsheets/ is gitignored (rebuilt each build, never committed), matching the existing awesome-swarm / openapi.yaml pattern.
  • The iframe doc page lives under Tools and Features (next to AI Agent Skills); a pointer line in static/llms.txt sends agents to the self-hosted page.
  • Explicit asset list over GitHub-API auto-discovery, and fail-hard over warn-and-skip, were deliberate choices for simplicity and deploy safety.

Checklist ✅

  • Merged latest master and resolved conflicts
  • npm run build succeeds
  • Links checked (npm run check:links) where relevant
  • static/llms.txt updated if pages were added / renamed / deleted
  • Content follows CODING.md conventions (Swarm vs swarm, ..)
  • Self-reviewed the diff
  • Commits are signed off (git commit -s)

yjkellyjoo and others added 2 commits July 16, 2026 16:40
- add scripts/fetch-cheatsheets.mjs to fetch the cheatsheet page, assets, and PDF from swarm-cheatsheets@main and mirror them into static/cheatsheets/ with asset paths rewritten
- fetch files concurrently with a per-request timeout, prune the output dir first, and fail the build on any fetch error
- wire the script into the prebuild chain and gitignore the generated static/cheatsheets output

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: Yejin Kelly Joo <yejinkellyjoo@gmail.com>
- add tools-and-features/cheatsheets page that embeds the mirrored cheatsheet via iframe and register it in the sidebar
- add a Swarm Cheatsheet card to the Setup section of the Start Building page
- add an llms.txt pointer to the self-hosted cheatsheet for agents

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: Yejin Kelly Joo <yejinkellyjoo@gmail.com>
@yjkellyjoo yjkellyjoo self-assigned this Jul 16, 2026
@netlify

netlify Bot commented Jul 16, 2026

Copy link
Copy Markdown

Deploy Preview for test-twitter-preview-testing-3 ready!

Name Link
🔨 Latest commit 00680ea
🔍 Latest deploy log https://app.netlify.com/projects/test-twitter-preview-testing-3/deploys/6a58d526bc7c2a00088e9519
😎 Deploy Preview https://deploy-preview-829--test-twitter-preview-testing-3.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@yjkellyjoo
yjkellyjoo requested a review from GasperX93 July 16, 2026 07:45
yjkellyjoo and others added 3 commits July 16, 2026 18:29
- grow the iframe to its content height on load so the page scrolls instead of the iframe
- re-measure with a ResizeObserver to track reflow after fonts load and QR codes render
- keep an 85vh min-height as a no-JS fallback

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: Yejin Kelly Joo <yejinkellyjoo@gmail.com>
- mirror cheatsheet.html (the A4 card) instead of index.html, dropping the source site's chrome, toolbar, and footer from the embed
- stop mirroring the chrome-only swarm-logo-white.svg
- replace the card's removed Download PDF button with Download PDF and open-in-new-tab links on the doc page

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: Yejin Kelly Joo <yejinkellyjoo@gmail.com>
- scale the fixed A4 card to fill the doc content column, removing the grey margins beside the centered sheet and enlarging it a bit
- size the wrapper to the scaled height so the page scrolls, refitting on reflow and window resize
- remove the redundant open-in-new-tab link

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: Yejin Kelly Joo <yejinkellyjoo@gmail.com>
@yjkellyjoo
yjkellyjoo force-pushed the feat/embed-swarm-cheatsheet branch from 60fce19 to 00680ea Compare July 16, 2026 12:57
@yjkellyjoo
yjkellyjoo merged commit 0c7a579 into master Jul 16, 2026
9 checks passed
@yjkellyjoo
yjkellyjoo deleted the feat/embed-swarm-cheatsheet branch July 16, 2026 13:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants