progressive-web-app
यह क्या करती है
PWA एक वेबसाइट है जो ऐप की तरह काम करती है। इसे मोबाइल पर इंस्टॉल किया जा सकता है और यह इंटरनेट के बिना भी चल सकती है। यह आधुनिक तकनीकों का इस्तेमाल करती है, ताकि यह तेज़ और भरोसेमंद रहे।
कब इस्तेमाल करें
- ✓जब आप चाहते हैं कि आपकी वेबसाइट इंटरनेट न होने पर भी काम करे।
- ✓जब आप चाहते हैं कि आपकी वेबसाइट डिवाइस की होम स्क्रीन पर इंस्टॉल हो सके।
- ✓जब आप अपनी वेबसाइट की स्पीड और भरोसेमंदी बढ़ाना चाहते हैं।
Skill का लिंक
https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/progressive-web-app/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“मैं अपनी वेबसाइट को बिना इंटरनेट के चलने वाली और ऐप की तरह इंस्टॉल होने वाली कैसे बना सकता हूँ?”
हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।
यह कैसे काम करती है
यह 'manifest' नाम की फ़ाइल का इस्तेमाल करती है, जो ऐप के बारे में जानकारी देती है, और 'service worker' का, जो बैकग्राउंड में चलने वाला अतिरिक्त कोड है। यह कोड कैशिंग (यानी फ़ाइलों को सेव करके रखना) संभालता है और साइट को कनेक्शन के बिना भी काम करने देता है।
तकनीकी सामग्री (मूल SKILL.md)
लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।
Progressive Web Apps (PWAs)
Overview
A Progressive Web App is a web application that uses modern browser capabilities to deliver a fast, reliable, and installable experience — even on unreliable networks. The three required pillars are:
- HTTPS — Required in production for service workers to register (localhost is exempt for development).
- Web App Manifest (
manifest.json) — Makes the app installable and defines its appearance on device home screens. - Service Worker (
sw.js) — A background script that intercepts network requests, manages caches, and enables offline functionality.
When to Use This Skill
- Use when the user wants their web app to work offline or on unreliable networks.
- Use when building a mobile-first web project where users should be able to install the app to their home screen.
- Use when the user asks about caching strategies, service workers, or improving web app performance and resilience.
- Use when the user mentions Workbox, web app manifests, background sync, or push notifications for the web.
- Use when the user asks "can my website be installed like an app?" or "how do I make my site work offline?" — even if they don't use the word PWA.
Deliverables Checklist
Every PWA implementation must include these files at minimum:
-
index.html— Links manifest, registers service worker -
manifest.json— Full app metadata and icon set -
sw.js— Service worker with install, activate, and fetch handlers -
app.js— Main app logic with SW registration and install prompt handling -
offline.html— Fallback page shown when navigation fails offline (required — missing file will cause install to fail)
Step 1: Web App Manifest (manifest.json)
Defines how the app appears when installed. Must be linked from <head> via <link rel="manifest">.
{
"name": "My Awesome PWA",
"short_name": "MyPWA",
"description": "A fast, offline-capable Progressive Web App.",
"start_url": "/",
"scope": "/",
"display": "standalone",
"orientation": "portrait-primary",
"background_color": "#ffffff",
"theme_color": "#0055ff",
"icons": [
{
"src": "/assets/icons/icon-192x192.png",
"sizes": "192x192",
"type": "image/png",
"purpose": "any maskable"
},
{
"src": "/assets/icons/icon-512x512.png",
"sizes": "512x512",
"type": "image/png",
"purpose": "any maskable"
}
],
"screenshots": [
{
"src": "/assets/screenshots/desktop.png",
"sizes": "1280x720",
"type": "image/png",
"form_factor": "wide"
}
]
}
Key fields:
display:standalonehides browser UI;minimal-uishows minimal controls;browseris standard tab.purpose: "maskable"on icons enables adaptive icons on Android (safe zone matters — keep content in center 80%).screenshotsis optional but required for Chrome's enhanced install dialog on desktop.
Step 2: HTML Shell (index.html)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>My Awesome PWA</title>
<!-- PWA manifest -->
<link rel="manifest" href="/manifest.json">
<!-- Theme color for browser chrome -->
<meta name="theme-color" content="#0055ff">
<!-- iOS-specific (Safari doesn't fully use manifest) -->
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="default">
<meta name="apple-mobile-web-app-title" content="MyPWA">
<link rel="apple-touch-icon" href="/assets/icons/icon-192x192.png">
<link rel="stylesheet" href="/styles.css">
</head>
<body>
<div id="app">
<header><h1>My PWA</h1></header>
<main id="content">Loading...</main>
<!-- Optional: install button, hidden by default -->
<button id="install-btn" hidden>Install App</button>
</div>
<script src="/app.js"></script>
</body>
</html>
Step 3: Service Worker Registration & Install Prompt (app.js)
// ─── Service Worker Registration ───────────────────────────────────────────
if ('serviceWorker' in navigator) {
window.addEventListener('load', async () => {
try {
const registration = await navigator.serviceWorker.register('/sw.js');
console.log('[App] SW registered, scope:', registration.scope);
} catch (err) {
console.error('[App] SW registration failed:', err);
}
});
}
…
अक्सर पूछे जाने वाले सवाल
'service worker' क्या है?
यह एक स्क्रिप्ट (कोड) है जो ब्राउज़र में बैकग्राउंड में चलती है। यह नेटवर्क रिक्वेस्ट को रोक सकती है, फ़ाइलों की कैशिंग संभाल सकती है और आपकी वेबसाइट को ऑफ़लाइन काम करने देती है।
'Web App Manifest' क्या है?
यह एक JSON फ़ाइल है जिसमें आपकी वेब ऐप की जानकारी होती है, जैसे उसका नाम, आइकन, रंग, और इंस्टॉल होने पर वह कैसे व्यवहार करेगी। इसी से वेबसाइट को डिवाइस की होम स्क्रीन पर जोड़ा जा सकता है।
क्या मुझे HTTPS चाहिए?
हाँ, प्रोडक्शन (प्रकाशित वेबसाइट) में service workers चलाने के लिए HTTPS ज़रूरी है। localhost (डेवलपमेंट वातावरण) इसका अपवाद है।
जानकारी
लेखक का मूल विवरण
Build Progressive Web Apps (PWAs) with offline support, installability, and caching strategies. Trigger whenever the user mentions PWA, service workers, web app manifests, Workbox, 'add to home screen', or wants their web app to work offline, feel native, or be installable.
लोकप्रियता
- GitHub स्टार
- 48k
- रैंकिंग में स्थान
- #5515
- लाइसेंस
- MIT
- अपडेट की गई
- 15/10/2026
कमेंट
- …
इस repository की और skills
00-andruia-consultant
48kआपके एजेंट को AI प्रोजेक्ट शुरू करने या उन्हें बेहतर बनाने में मदद करता है। यह code का विश्लेषण करता है, tools सुझाता है और स्पेनिश भाषा में action plan बनाता है।
007
48kआपका एजेंट security audit और threat modeling करता है। यह प्रोजेक्ट को हमलों और कमजोरियों से बचाने में काम आता है।
10-andruia-skill-smith
48kआपके एजेंट को AI tools बनाने या उन्हें बेहतर करने में मदद करता है। यह तय करता है कि tools कैसे काम करेंगे, documentation लिखता है और structure की जांच करता है।
20-andruia-niche-intelligence
48kआपका एजेंट किसी खास industry का summary बनाता है। भरोसेमंद स्रोतों की मदद से यह प्रोजेक्ट का संदर्भ, नियम, इस्तेमाल के तरीके और जोखिम समझने में मदद करता है।
मिलती-जुलती skills
angular-developer
280kआपके एजेंट को Angular code बनाने और प्रोजेक्ट स्ट्रक्चर पर सलाह देने में मदद करता है। नए प्रोजेक्ट शुरू करने, code के हिस्से बनाने, या performance और accessibility सुधारने में उपयोगी है।
frontend-a11y
280kआपके एजेंट को web interfaces को सबके लिए accessible बनाने में मदद करता है। यह सुनिश्चित करता है कि websites और apps screen readers और keyboard navigation के साथ अच्छे से काम करें।
frontend-patterns
280kआपके एजेंट को React और Next.js में frontend development के modern patterns लागू करने में मदद करता है। यह performance optimize करता है, state manage करता है और best practices फॉलो करवाता है।