dentvega/firebase-agent-skills/firebase-hosting
Claude Code and agent skill by dentvega/firebase-agent-skills
- community
Checking that the SKILL.md file is still in the repository.
Deploys static sites, single-page apps, and Next.js / Angular SSR apps to Firebase Hosting — configuring redirects, rewrites, custom headers, preview channels for PR previews, and integration with Cloud Functions / Cloud Run for dynamic routes. Use whenever the user wants to host a web app, marketing site, or landing page on Firebase.
Install
npx vskill@latest install dentvega/firebase-agent-skills/firebase-hostingSKILL.md
The same SKILL.md was published earlier as dentvega/firebase-agent-skills/firebase-hosting.
Firebase Hosting
Minimum viable example
Three commands. The whole point of Hosting is that it's frictionless:
That's a fully cached, HTTPS-served, globally CDN-distributed site at https://<project-id>.web.app.
1. Initialize
The wizard asks:
- Public directory — where your built site lives. For Vite:
dist. For Next.js static export:out. For raw HTML:public. - Single-page app? — answer yes if you use client-side routing (React Router, Vue Router). This adds a rewrite that sends every path to
/index.html. - GitHub Actions setup — say yes if you want auto-deploys on push. Generates
.github/workflows/firebase-hosting-{merge,pull-request}.yml.
Generated firebase.json:
2. Deploy
Output ends with two URLs:
https://<project-id>.web.app(primary)https://<project-id>.firebaseapp.com(legacy alias, same content)
Both are HTTPS-only with a managed cert. No CDN config needed — every asset is cached at edge by default.
3. Preview channels (one per PR)
Channels give you an ephemeral preview URL without overwriting prod:
Returns https://<project-id>--pr-123-<hash>.web.app. Expires automatically after the TTL. Wire into CI to comment the URL on every PR:
The action handles channel creation, deploy, and PR comment with the preview URL.
4. Redirects, rewrites, headers
Redirects (308 by default — type overrides)
Rewrites (serve content from another path or backend)
function rewrites send the request to a Cloud Function; run rewrites send it to a Cloud Run service. Both use the same auth, cookies, and headers — no CORS hop. The catch-all to /index.html for SPA routing must be last (rules are evaluated top to bottom).
Custom headers
The default is max-age=3600 for everything, which is wrong for both ends — assets with hashed names should be immutable, HTML should never be cached. Set headers explicitly.
5. Custom domains
Firebase auto-provisions a Let's Encrypt cert. DNS propagation takes 0–24h; cert issuance takes a few minutes after DNS resolves.
For apex domains (example.com not www.example.com), use A records pointing to the IPs Firebase shows. For www, use CNAME to <project-id>.web.app.
6. SSR with Cloud Functions
For dynamic rendering, route to a function:
firebase.json:
For Next.js or Angular Universal specifically, prefer Firebase App Hosting (separate product) — handles SSR, edge caching, and CDN config automatically. App Hosting is covered by the official firebase/agent-skills package.
7. Multi-site projects
firebase.json:
Deploy a specific target:
Useful for monorepos with separate marketing + product sites on the same Firebase project.
8. Common mistakes
- Catch-all rewrite first. Rules are top-to-bottom. If
{ "source": "**", "destination": "/index.html" }comes before your/api/**rewrite, the API rewrite never matches. - Default cache headers. Without explicit headers, JS bundles cache for 1h but HTML caches the same — meaning users can't even see new deploys for an hour. Always override.
- Deploying without ignoring build artifacts. Adding
dist/node_modulesto the upload becauseignorewas misconfigured. Check the deploy log for total file count. - Treating preview channels as private. They're publicly accessible to anyone with the URL. For private review, gate with Firebase Auth or use IAP.
- Forgetting that rewrites are server-side, not redirects. A rewrite serves different content at the same URL (no client navigation). For SEO-friendly URL changes that should reflect in the browser bar, use a redirect.
- Hosting an SPA without the rewrite. Refreshing on
/dashboardreturns 404 because the file doesn't exist; the rewrite to/index.htmlis what lets the client router handle it. - Using Hosting for huge files (>10 MB). Treat Hosting as a CDN for app assets. Large user-uploaded files go to Cloud Storage, served via a signed URL or a Storage rewrite.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/firebase-hosting/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/dentvega/firebase-agent-skills/firebase-hosting)