项目简介
该仓库收录了可复用的谷歌产品与云技术 Agent 技能,涵盖 Gemini API、BigQuery 基础、Cloud Run 等,帮助开发者快速为智能体添加能力。
README 预览
# Agent Skills\n\n[](https://skills.sh/google/skills)\n\nThis repository contains [Agent Skills](https://agentskills.io/home) for Google\nproducts and technologies, including [Google Cloud](https://cloud.google.com).\n\n> [!NOTE]\n> This repository is under active development.\n\n## Installation\n\n```bash\nnpx skills add google/skills\n```\n\nFrom the `npx install` command, you can select the specific skills from this\nrepo to install.\n\n## Available Skills\n\n- [**Gemini API on Agent Platform**](./skills/cloud/gemini-api)\n- [**Gemini Interactions API on Agent Platform**](./skills/cloud/gemini-api)\n- [**Managed Agents API on Agent Platform**](./skills/cloud/gemini-agents-api)\n- [**Skill Registry API on Agent Platform**](./skills/cloud/agent-platform-skill-registry)\n- [**AlloyDB Basics**](./skills/cloud/alloydb-basics)\n- [**BigQuery Basics**](./skills/cloud/bigquery-basics)\n- [**Cloud Run Basics**](./skills/cloud/cloud-run-basics)\n- [**Cloud SQL Basics**](./skills/cloud/cloud-sql-basics)\n- [**Firebase Basics**](./skills/cloud/firebase-basics)\n- [**Kubernetes Engine (GKE) Basics**](./skills/cloud/gke-basics)\n- [**Recipe: Onboarding to Google Cloud**](./skills/cloud/google-cloud-recipe-onboarding)\n- [**Recipe: Authenticating to Google Cloud**](./skills/cloud/google-cloud-recipe-auth)\n- [**Recipe: Google Cloud Network Observability**](./skills/cloud/google-cloud-networking-observability)\n- **Google Cloud Well-Architected Framework**:\n - [Security](./skills/cloud/google-cloud-waf-security)\n - [Reliability](./skills/cloud/google-cloud-waf-reliability)\n - [Cost optimization](./skills/cloud/google-cloud-waf-cost-optimization)\n - [Operational excellence](./skills/cloud/google-cloud-waf-operational-excellence)\n - [Performance optimization](./skills/cloud/google-cloud-waf-performance-optimization)\n - [Sustainability](./skills/cloud/google-cloud-waf-sustainability)\n\n## Support\n\nIf you need help or encounter
常见问题 (3)
故障排除安装 google-ads-api-account-diagnostics 技能时,如何修复 "Nested mappings are not allowed in compact mappings" YAML 解析错误?
出现此错误是因为 skills/ads/google-ads-api-account-diagnostics/SKILL.md 的 frontmatter 中,compatibility 行包含一个未加引号的冒号(tools: search, ...),YAML 会将其解析为嵌套映射。该 bug 在提交 300d74bfee 中引入,并在提交 6f82b205c0acbe185ce513ce0390bc4b57caa877 中修复。请将 google/skills 仓库更新至最新版本,然后重新运行:npx skills add google/skills --skill google-ads-api-account-diagnostics -g -y。如果你维护自己的 SKILL.md 并遇到此错误,请为任何包含冒号的 frontmatter 值加上引号,例如 compatibility: "Google Ads MCP Server (tools: search, list_accessible_customers, get_resource_metadata); ..."。
故障排除如何修复 Claude Code 中 google-cloud-developer Developer Knowledge MCP 服务器显示 "Failed to connect" 或缺少身份验证凭据的问题?
Claude Code 插件的 mcp.json 注册了 https://developerknowledge.googleapis.com/mcp,但未配置 API 密钥请求头或 OAuth,而工具调用需要 Google 身份验证。
变通方法:使用限制为 developerknowledge.googleapis.com 的 API 密钥自行注册 MCP 服务器:
claude mcp add --transport http --scope user google-dev-knowledge \
https://developerknowledge.googleapis.com/mcp \
--header "X-Goog-Api-Key: YOUR_API_KEY"
--header 选项必须出现在服务器名称和 URL 之后。重启 Claude Code,并使用以下命令验证:
claude mcp list
插件自带的 developer-knowledge 条目可能仍显示"Failed to connect",但这并无影响;插件技能可以使用你单独注册的 google-dev-knowledge 服务器。
仅供测试,该端点还接受短期有效的 gcloud 令牌:
curl -X POST https://developerknowledge.googleapis.com/mcp \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H 'Content-Type: application/json' \
-H 'Accept: application/json, text/event-stream' \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}'
插件的永久修复方案可以是在 mcp.json 中添加支持环境变量展开的 X-Goog-Api-Key 请求头、支持 OAuth 发现,或者移除未经身份验证的服务器条目并改用 curl 作为后备方案。
故障排除为什么 references/ 目录中的相对 Markdown 链接在 GitHub 上会以 references/references/ 的形式返回 404?
由于链接文件本身已经位于 references/ 目录中,像 [Guide](references/ima-sdk-ios-guide.md) 这样的链接会解析为 references/references/ima-sdk-ios-guide.md。请移除 references/ 前缀,直接链接到同级文件:[Guide](ima-sdk-ios-guide.md)。使用以下命令查找失效链接:
grep -rnE '\]\(references/' skills/*/*/references/*.md
在每个受影响的文件中应用此修复,例如:
<!-- Before -->
[iOS Guide](references/ima-sdk-ios-guide.md)
<!-- After -->
[iOS Guide](ima-sdk-ios-guide.md)
可以使用以下命令执行批量替换:
find skills -path '*/references/*.md' -exec perl -pi -e 's/\]\(references\//](/g' {} +
目标文件无需移动;只有链接前缀是错误的。此问题已在提交 a54d506fb1ae95870e10cbf5cf1660f3af0bdc8b 中修复。