This repo uses Astro, Tailwind CSS v4, and bun.
- Always use
buninstead ofnpmoryarn. - Always use
bunxinstead ofnpx.
- Always prefer the current Tailwind v4 canonical utility names.
- Do not introduce deprecated utility aliases when editing templates or styles.
- Example: prefer
bg-linear-to-roverbg-gradient-to-r.
- When old Tailwind utility names need to be migrated, use the official upgrader:
bunx @tailwindcss/upgrade --force- Use that command to fix deprecated class syntax across the repo instead of doing large manual replacements.
- Do not switch Open Graph or Twitter/X social meta images to
webp; usepngorjpg/jpegfor those assets and tags.
- Never hardcode the number of Capgo plugins in text, marketing copy, docs, or UI.
- Use the real registry-derived count from
apps/web/src/config/plugins.ts(pluginCountorpluginCountLabel) anywhere code can import it. - In Markdown or static content that cannot import the registry value, avoid stating a plugin count and link to the live plugin directory instead.
- Add the plugin registry entry in
apps/web/src/config/plugins.tsinsideactionDefinitionRowswith the package name, title, short description, and GitHub URL. - Add the plugin docs in
apps/docs/src/content/docs/docs/plugins/<docs-slug>/index.mdxandapps/docs/src/content/docs/docs/plugins/<docs-slug>/getting-started.mdx. - Add the English tutorial in
apps/web/src/content/plugins-tutorials/en/<tutorial-slug>.md. - The tutorial slug must match the GitHub URL slug used by
item.hrefon the plugin entry because/plugins/[slug]resolves from that repo slug. Examples:https://github.com/Cap-go/capacitor-live-activities/->apps/web/src/content/plugins-tutorials/en/capacitor-live-activities.mdhttps://github.com/Cap-go/electron-updater/->apps/web/src/content/plugins-tutorials/en/electron-updater.md - Register documented plugins in
apps/docs/src/config/sidebar.mjsso they appear in the Starlight plugin sidebar. - Register documented plugins in
apps/docs/src/config/llmsCustomSets.tsso they appear in the docs search and LLM sets. - Refresh metadata after adding a plugin with
bun run fetch:starsandbun run fetch:downloads. - Validate the change with
bunx prettier --write <touched-files>andNODE_OPTIONS=--max-old-space-size=16384 bunx astro checkin bothapps/webandapps/docs, orbun run checkfrom the repo root.
- Never change an existing public URL slug (blog posts, pages, docs) once it has been published and indexed.
- If a slug must change, add redirects for the old path in the same change: prefer
apps/shared/legacyPathRedirects.ts(web + translation workers) and docs worker code for/docs/*. Useapps/web/public/_redirectsonly for a small set of static exact-path rules — never re-add bulk blog renames or splat/*rules there (Cloudflare caps dynamic_redirectsat 100, and any splat makes later rules count as dynamic). - Preserve locale prefixes (
/de/,/fr/, etc.) so each language keeps working backlinks. - Prefer permanent (301) redirects so earned backlinks are not lost.
- An Outrank-imported post is any blog file added or updated by a
chore: import Outrank articlescommit (Outrank also pushes updates to existing posts). Check on a full (non-shallow) clone withgit log --follow --format=%s -- <file> | grep -Fx 'chore: import Outrank articles'. - Never remove or change outbound links in these posts. They are backlink exchanges we must keep, including during SEO rewrites. Rewrite the prose around a link if needed, but keep the link URL and anchor text.
- Never prune, redirect, or delete an Outrank-imported post without asking Martin first.
Use the visual diff tool whenever a PR changes page layout, styling, components, or marketing copy that affects rendered HTML.
- Before starting visual work: capture a
beforebaseline frommain(or the PR base branch). - Before opening the PR: capture
after, compare, and paste the report into the PR description. - After each new push to the PR when the author or reviewer asked for visual verification: rebuild, re-capture
after, re-compare, and post an updated report as a new PR comment.
bun install
bun run visual-diff:setupRequires ImageMagick (compare CLI) for pixel diffs.
# 1. Baseline (on main or base branch, before your changes)
bun run build
bun run visual-diff:capture:before
# 2. After your visual changes
bun run build
bun run visual-diff:capture:after
# 3. Compare + PR markdown
bun run visual-diff:compare
bun run visual-diff:reportPaste the ## Visual diff section from bun run visual-diff:report into the PR description. On follow-up pushes with visual changes, run steps 2–3 again and post the updated markdown in a new comment.
Default routes live in visual-diff.config.json. Override for a targeted PR:
bun run visual-diff:capture:before -- --suite web --routes /,/pricing/
bun run visual-diff:capture:after -- --suite web --routes /,/pricing/- Confirm the PR includes visual/UI changes (or the user explicitly requested visual verification).
- Run the workflow above before marking the PR ready.
- Include the visual diff markdown in the PR body.
- After subsequent pushes that change visuals, re-run
capture:after,compare, andreport; post the fresh results. - Do not commit
.visual-diff/artifacts — they are gitignored.
Applies to every AI feature in this repo (workers such as apps/translation-worker,
scripts, CI) and to services it calls.
- Never ship or keep a model whose release is more than 5 months old.
- Treat a model more than 3 months old as already old: when you touch an AI feature, move it to the newest good model.
- Check the age and planned deprecation against the provider's live catalog,
never from memory. For Workers AI:
GET https://api.cloudflare.com/client/v4/accounts/<account>/ai/models/search?task=Text%20Generation&per_page=200(usecreated_atandproperties.planned_deprecation_date).GET https://api.cloudflare.com/client/v4/accounts/<account>/ai/models/schema?model=<id>for the inputs the model supports (reasoning_effort,chat_template_kwargs,response_format, ...).
- Never pick a model that has a planned deprecation date.
- Reasoning models used for short structured output must turn thinking off
(
chat_template_kwargs: { enable_thinking: false }orreasoning_effort: 'none', whichever the model schema supports), or they burn the token budget and return empty content. Confirm with one real call that thinking is actually off: some models ignore the flag (GLM-5.3 still reasoned withenable_thinking: false). In the translation worker, add the model family toTHINKING_MODEL_PREFIXES. - Keep the model overridable by env var (for example
TRANSLATION_MODEL,TRANSLATION_REVIEW_MODEL), and note the catalogcreated_atnext to the default. - A model swap can trigger mass regeneration (for example bumping
TRANSLATION_MEMORY_VERSIONre-translates the whole site): decide it deliberately and state the impact in the PR.