Google logo

Google

Community
rainday
google

Smart Blog Google API 整合。PageSpeed Insights + CrUX Core Web Vitals 查詢。 無 API key 時使用免費端點,有 key 時解鎖 CrUX 真實用戶數據。 Config 儲存於 ~/.config/smart-blog-skills/。 Use when user says "pagespeed", "core web vitals", "CrUX", "page speed", "網頁速度", "效能檢測", "smart-blog google", "google api setup".

Overview

Publisherrainday
Repositorysmart-blog-skills
Skill namegoogle
Stars
34
Forks
3
Bundled files
Instructions only
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by rainday on GitHub. Read the source before you install it.

Installation

Install the Google AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/rainday/smart-blog-skills/tree/main/skills/google
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/rainday/smart-blog-skills.git /tmp/smart-blog-skills
mkdir -p .claude/skills
cp -r /tmp/smart-blog-skills/skills/google .claude/skills/google
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Google in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Google on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Google is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Google API — 效能檢測

整合 Google PageSpeed Insights 和 CrUX API,為 blog analyze 提供真實效能數據。

指令一覽

指令功能需要 API Key
/smart-blog-skills:google setup設定 API key否
/smart-blog-skills:google pagespeed <URL>PageSpeed Insights 分析否(建議有)
/smart-blog-skills:google crux <URL>CrUX 真實用戶數據是

Tier 系統

Tier需要什麼解鎖功能限制
0(免費)無需任何設定PageSpeed Insights(無 key)25 次/天(共用配額,可能被限流)
1(API Key)Google Cloud Console 免費 API KeyPageSpeed(專屬配額)+ CrUXPageSpeed 400 次/天,CrUX 150 次/天

如何取得 API Key(免費)

  1. 前往 Google Cloud Console
  2. 建立專案(或選擇現有專案)
  3. 啟用 API:
    • PageSpeed Insights API
    • Chrome UX Report API
  4. 建立憑證 → API Key
  5. 執行 /smart-blog-skills:google setup 輸入 key

Config 管理

儲存位置

~/.config/smart-blog-skills/
├── config.json          ← API key 和偏好設定
└── .gitignore           ← 防止意外提交

config.json 格式

json
{
  "google_api_key": "",
  "default_strategy": "mobile",
  "locale": "zh-TW",
  "created": "2026-04-06",
  "updated": "2026-04-06"
}

安全措施

  1. 檔案權限:建立後設定 chmod 600 config.json(Unix)
  2. 不在專案目錄:config 在 ~/.config/ 下,不會被 git commit
  3. config 目錄 .gitignore:額外防護,目錄內含 * 排除規則
  4. 環境變數備援:也支援 SMART_BLOG_GOOGLE_API_KEY 環境變數
  5. API Key 限制建議:在 Google Cloud Console 設定 HTTP referrer 或 IP 限制

Setup 流程

Step 1:建立 config 目錄

bash
mkdir -p ~/.config/smart-blog-skills
echo '*' > ~/.config/smart-blog-skills/.gitignore

Step 2:詢問 API Key

問使用者:

要設定 Google API Key 嗎?

  • 有 Key:輸入 key,解鎖 CrUX + 專屬 PageSpeed 配額
  • 沒有 Key:按 Enter 跳過,仍可使用免費 PageSpeed(共用配額)

API Key 儲存在 ~/.config/smart-blog-skills/config.json,不會進入 git。

Step 3:寫入 config

將使用者提供的資訊寫入 ~/.config/smart-blog-skills/config.json。

Step 4:設定檔案權限

bash
chmod 600 ~/.config/smart-blog-skills/config.json

Windows 環境跳過此步驟(NTFS 權限由系統管理)。

PageSpeed 分析流程

Step 1:讀取 Config

  1. 讀取 ~/.config/smart-blog-skills/config.json
  2. 如果 google_api_key 有值 → Tier 1 模式
  3. 如果沒有 → Tier 0 模式(免費端點)

Step 2:呼叫 API

Tier 0(無 key):

WebFetch: https://www.googleapis.com/pagespeedonline/v5/runPagespeed?url={URL}&strategy=mobile&locale=zh-TW

Tier 1(有 key):

WebFetch: https://www.googleapis.com/pagespeedonline/v5/runPagespeed?url={URL}&strategy=mobile&locale=zh-TW&key={API_KEY}

Step 3:解析結果

從回傳的 JSON 提取:

指標欄位路徑好待改善差
Performance ScorelighthouseResult.categories.performance.score≥0.90.5-0.89<0.5
FCPlighthouseResult.audits.first-contentful-paint≤1.8s1.8-3s>3s
LCPlighthouseResult.audits.largest-contentful-paint≤2.5s2.5-4s>4s
TBTlighthouseResult.audits.total-blocking-time≤200ms200-600ms>600ms
CLSlighthouseResult.audits.cumulative-layout-shift≤0.10.1-0.25>0.25
Speed IndexlighthouseResult.audits.speed-index≤3.4s3.4-5.8s>5.8s

Step 4:輸出報告

markdown
## PageSpeed 報告:{URL}

**策略:** Mobile
**Performance Score:** {score}/100

### Core Web Vitals

| 指標 | 數值 | 狀態 |
|------|------|------|
| LCP(最大內容繪製) | {value} | {好/待改善/差} |
| FCP(首次內容繪製) | {value} | {好/待改善/差} |
| TBT(總阻塞時間) | {value} | {好/待改善/差} |
| CLS(累積版面偏移) | {value} | {好/待改善/差} |
| Speed Index | {value} | {好/待改善/差} |

### 改善建議(前 5 項)

| 優先級 | 問題 | 預估節省 |
|--------|------|---------|
| {高/中/低} | {描述} | {時間} |

CrUX 分析流程(Tier 1 only)

呼叫 API

WebFetch: https://chromeuxreport.googleapis.com/v1/records:queryRecord?key={API_KEY}

POST body:

json
{
  "url": "{URL}",
  "formFactor": "PHONE"
}

解析結果

提取真實用戶的 Core Web Vitals 分佈(p75 值):

  • LCP、FID/INP、CLS
  • 好/待改善/差的百分比分佈

輸出

附加到 PageSpeed 報告後方:

markdown
### CrUX 真實用戶數據(28 天)

| 指標 | p75 | 好 | 待改善 | 差 |
|------|-----|---|--------|---|
| LCP | {value} | {%} | {%} | {%} |
| INP | {value} | {%} | {%} | {%} |
| CLS | {value} | {%} | {%} | {%} |

與 analyze 整合

當使用者執行 /smart-blog-skills:analyze 且文章的 frontmatter 包含 url 或 canonical 欄位時:

  1. 自動偵測是否有 config
  2. 如果有 → 在技術元素評分中加入 PageSpeed 數據
  3. 如果沒有 → 跳過,使用原有的純內容分析

這讓 analyze 的「技術元素」類別(15 分)可以基於真實數據評分,而非只檢查 HTML 結構。

錯誤處理

情境行為
無 API Key + 被限流提示使用者申請免費 API Key
API Key 無效提示檢查 key,退回 Tier 0
URL 無法存取報告錯誤,跳過效能檢測
CrUX 無數據說明該 URL 流量不足,CrUX 無法提供數據

Frequently asked questions

What does the Google AI skill do?

Smart Blog Google API 整合。PageSpeed Insights + CrUX Core Web Vitals 查詢。 無 API key 時使用免費端點,有 key 時解鎖 CrUX 真實用戶數據。 Config 儲存於 ~/.config/smart-blog-skills/。 Use when user says "pagespeed", "core web vitals", "CrUX", "page speed", "網頁速度", "效能檢測", "smart-blog google", "google api setup".

Why use Google on TypingMind?

Because you install it once and use it with any model. Google is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Google in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/rainday/smart-blog-skills/tree/main/skills/google. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Google?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Google?

As many as you like. As long as a model supports skills, you can use Google with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Google AI skill free?

It is published on GitHub by rainday. Check the repository for licensing terms. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇