diagnose-seo

安装量: 1.2K
排名: #1175

安装

npx skills add https://github.com/calm-north/seojuice-skills --skill diagnose-seo

Diagnose SEO Structured diagnostic framework for crawl issues, canonicalization errors, indexation problems, and rendering failures. Diagnostic Approach Technical SEO problems fall into four categories. Diagnose in this order — each layer depends on the previous one working correctly: Crawlability — Can search engines find and access the pages? Indexability — Are the pages allowed to be indexed? Renderability — Can search engines see the full content? Signals — Are the right signals (titles, structured data, links) in place? Layer 1: Crawlability Check these in order: robots.txt Fetch [domain]/robots.txt and review the rules Look for overly broad Disallow rules blocking important paths Verify Sitemap: directive points to the correct sitemap URL Check for different rules per user-agent (Googlebot vs others) Common mistakes: Disallow: / blocking the entire site (often left from staging) Blocking CSS/JS files that Googlebot needs for rendering Blocking API or AJAX endpoints that load dynamic content Staging robots.txt accidentally deployed to production XML Sitemap Fetch the sitemap URL(s) and check: Does it return 200? Is it valid XML? Does it list all important pages? Does it exclude pages that shouldn't be indexed (404s, redirects, noindex pages)? Are dates accurate and recent? For large sites: is there a sitemap index? Site Architecture Pages should be reachable within 3 clicks from the homepage Check for orphan pages (no internal links pointing to them) Check for redirect chains (page A → B → C — should be A → C) Check for redirect loops Server Response Do all important pages return HTTP 200? Check for unexpected 301/302 redirects Check for soft 404s (page returns 200 but shows "not found" content) Verify HTTPS is enforced (HTTP should 301 to HTTPS) Layer 2: Indexability Meta Robots / X-Robots-Tag Check for on pages that should be indexed Check HTTP headers for X-Robots-Tag: noindex Common cause: CMS accidentally applying noindex to pagination, tag pages, or new pages Canonical Tags Every page should have a pointing to itself (self-referencing canonical) Check for canonical tags pointing to wrong pages (common in paginated content, filtered URLs) Check for conflicting signals: canonical says page A, but noindex is set, or the page redirects Canonical diagnosis checklist: Does the canonical URL match the actual URL? Is the canonical URL accessible (returns 200)? Does the canonical URL have the same content? Is there only one canonical tag on the page? Duplicate Content Check for the same content accessible at multiple URLs: With and without trailing slash ( /page vs /page/ ) With and without www ( example.com vs www.example.com ) HTTP vs HTTPS URL parameters creating duplicate pages ( ?sort=price , ?page=1 ) Each duplicate set needs one canonical URL; all others should redirect or use canonical tags Layer 3: Renderability JavaScript Rendering Does the page content appear in the raw HTML source? Or is it loaded via JavaScript? If JS-rendered: does Googlebot see the full content? (Use URL Inspection tool in Search Console) Check for content hidden behind click events, tabs, or accordions Check for lazy-loaded content that only appears on scroll Core Content Visibility Is the main content in the initial HTML? Or loaded async after page load? Are important elements (titles, headings, product details) in the DOM on first render? Check for content that requires login or cookies to view Layer 4: Signals Title Tags Every page has a unique Title includes the primary keyword Under 60 characters (to avoid truncation in SERPs) Descriptive and click-worthy Meta Descriptions Every important page has a meta description 150-160 characters Includes target keyword and a value proposition Unique per page Heading Structure One H1 per page containing the primary keyword Logical heading hierarchy (H1 → H2 → H3, no skips) Headings describe section content (not decorative) Structured Data Check for JSON-LD structured data appropriate to the page type Validate with Google's Rich Results Test Common types: Article, Product, FAQ, HowTo, BreadcrumbList, Organization Hreflang (multilingual sites) Check for correct hreflang tags linking language variants Verify reciprocal tags (page A points to B, B points back to A) Check for x-default tag Output Format Technical SEO Diagnosis: [domain] Summary Critical issues: [count] Warnings: [count] Passed checks: [count] Findings by Layer For each issue found: Layer Issue Severity Affected Pages Fix Crawlability robots.txt blocks /blog/ Critical All blog pages Remove Disallow: /blog/ from robots.txt Indexability Missing canonical tags Warning 15 pages Add self-referencing canonicals ... ... ... ... ... Priority Fix List Ordered by impact: [Critical fix] — affects [n] pages, blocks [crawling/indexing/ranking] [Warning fix] — affects [n] pages, reduces [signal quality] ... Pro Tip: Run the free SEO Audit for a quick technical check, the Broken Link Checker to find dead links, and the Robots.txt Generator to fix crawl directives. SEOJuice MCP users can run /seojuice:site-health for a full technical report and /seojuice:page-audit [domain] [url] to drill into specific pages.</p> </article> <a href="/" class="back-link">← <span data-i18n="detail.backToLeaderboard">返回排行榜</span></a> </div> <aside class="sidebar"> <section class="related-skills" id="relatedSkillsSection"> <h2 class="related-title" data-i18n="detail.relatedSkills">相关 Skills</h2> <div class="related-list" id="relatedSkillsList"> <div class="skeleton-card"></div> <div class="skeleton-card"></div> <div class="skeleton-card"></div> </div> </section> </aside> </div> </div> <script src="https://unpkg.com/i18next@23.11.5/i18next.min.js" defer></script> <script src="https://unpkg.com/i18next-browser-languagedetector@7.2.1/i18nextBrowserLanguageDetector.min.js" defer></script> <script defer> // Language resources - same pattern as index page const resources = { 'zh-CN': null, 'en': null, 'ja': null, 'ko': null, 'zh-TW': null, 'es': null, 'fr': null }; // Load language files (only current + fallback for performance) async function loadLanguageResources() { const savedLang = localStorage.getItem('i18nextLng') || 'en'; const langsToLoad = new Set([savedLang, 'en']); // current + fallback await Promise.all([...langsToLoad].map(async (lang) => { try { const response = await fetch(`/locales/${lang}.json`); if (response.ok) { resources[lang] = { translation: await response.json() }; } } catch (error) { console.warn(`Failed to load ${lang} language file:`, error); } })); } // Load a single language on demand (for language switching) async function loadLanguage(lang) { if (resources[lang]) return; try { const response = await fetch(`/locales/${lang}.json`); if (response.ok) { resources[lang] = { translation: await response.json() }; i18next.addResourceBundle(lang, 'translation', resources[lang].translation); } } catch (error) { console.warn(`Failed to load ${lang} language file:`, error); } } // Initialize i18next async function initI18n() { try { await loadLanguageResources(); // Filter out null values from resources const validResources = {}; for (const [lang, data] of Object.entries(resources)) { if (data !== null) { validResources[lang] = data; } } console.log('Loaded languages:', Object.keys(validResources)); console.log('zh-CN resource:', validResources['zh-CN']); console.log('detail.home in resource:', validResources['zh-CN']?.translation?.detail?.home); // 检查是否有保存的语言偏好 const savedLang = localStorage.getItem('i18nextLng'); // 如果没有保存的语言偏好,默认使用英文 const defaultLang = savedLang && ['zh-CN', 'en', 'ja', 'ko', 'zh-TW', 'es', 'fr'].includes(savedLang) ? savedLang : 'en'; await i18next .use(i18nextBrowserLanguageDetector) .init({ lng: defaultLang, // 强制设置初始语言 fallbackLng: 'en', supportedLngs: ['zh-CN', 'en', 'ja', 'ko', 'zh-TW', 'es', 'fr'], resources: validResources, detection: { order: ['localStorage'], // 只使用 localStorage,不检测浏览器语言 caches: ['localStorage'], lookupLocalStorage: 'i18nextLng' }, interpolation: { escapeValue: false } }); console.log('i18next initialized, language:', i18next.language); console.log('Test translation:', i18next.t('detail.home')); // Set initial language in selector const langSwitcher = document.getElementById('langSwitcher'); langSwitcher.value = i18next.language; // Update page language updatePageLanguage(); // Language switch event langSwitcher.addEventListener('change', async (e) => { await loadLanguage(e.target.value); // load on demand i18next.changeLanguage(e.target.value).then(() => { updatePageLanguage(); localStorage.setItem('i18nextLng', e.target.value); }); }); } catch (error) { console.error('i18next init failed:', error); } } // Translation helper function t(key, options = {}) { return i18next.t(key, options); } // Update all translatable elements function updatePageLanguage() { // Update HTML lang attribute document.documentElement.lang = i18next.language; // Update elements with data-i18n attribute document.querySelectorAll('[data-i18n]').forEach(el => { const key = el.getAttribute('data-i18n'); el.textContent = t(key); }); } // Copy command function function copyCommand() { const command = document.getElementById('installCommand').textContent; const btn = document.getElementById('copyBtn'); navigator.clipboard.writeText(command).then(() => { btn.textContent = t('copied'); btn.classList.add('copied'); setTimeout(() => { btn.textContent = t('copy'); btn.classList.remove('copied'); }, 2000); }).catch(() => { // Fallback for non-HTTPS const textArea = document.createElement('textarea'); textArea.value = command; textArea.style.position = 'fixed'; textArea.style.left = '-9999px'; document.body.appendChild(textArea); textArea.select(); document.execCommand('copy'); document.body.removeChild(textArea); btn.textContent = t('copied'); btn.classList.add('copied'); setTimeout(() => { btn.textContent = t('copy'); btn.classList.remove('copied'); }, 2000); }); } // Initialize document.getElementById('copyBtn').addEventListener('click', copyCommand); initI18n(); // 异步加载相关 Skills async function loadRelatedSkills() { const owner = 'calm-north'; const skillName = 'diagnose-seo'; const currentLang = 'ja'; const listContainer = document.getElementById('relatedSkillsList'); const section = document.getElementById('relatedSkillsSection'); try { const response = await fetch(`/api/related-skills/${encodeURIComponent(owner)}/${encodeURIComponent(skillName)}?limit=6`); if (!response.ok) { throw new Error('Failed to load'); } const data = await response.json(); const relatedSkills = data.related_skills || []; if (relatedSkills.length === 0) { // 没有相关推荐时隐藏整个区域 section.style.display = 'none'; return; } // 渲染相关 Skills listContainer.innerHTML = relatedSkills.map(skill => { const desc = skill.description || ''; const truncatedDesc = desc.length > 60 ? desc.substring(0, 60) + '...' : desc; return ` <a href="${currentLang === 'en' ? '' : '/' + currentLang}/skill/${skill.owner}/${skill.repo}/${skill.skill_name}" class="related-card"> <div class="related-name">${escapeHtml(skill.skill_name)}</div> <div class="related-meta"> <span class="related-owner">${escapeHtml(skill.owner)}</span> <span class="related-installs">${skill.installs}</span> </div> <div class="related-desc">${escapeHtml(truncatedDesc)}</div> </a> `; }).join(''); } catch (error) { console.error('Failed to load related skills:', error); // 加载失败时显示提示或隐藏 listContainer.innerHTML = '<div class="related-empty">暂无相关推荐</div>'; } } // HTML 转义 function escapeHtml(text) { const div = document.createElement('div'); div.textContent = text; return div.innerHTML; } // 页面加载完成后异步加载相关 Skills if (document.readyState === 'loading') { document.addEventListener('DOMContentLoaded', loadRelatedSkills); } else { loadRelatedSkills(); } </script> </body> </html>