Retrieving developer knowledge

From google/skills · View interactive version

Retrieving developer knowledge is an AI agent skill from the GitHub repository google/skills. Searches, retrieves, and synthesizes official Google developer documentation across Google Cloud, AI/Gemini, Android, Chrome, Web, Flutter, Go, Firebase, and other Google developer platforms. Integrates with the Developer Knowledge MCP server (search_documents, get_documents, answer_query) or the De

How to use this skill

Skill file

Google Developer Knowledge

The Developer Knowledge skill provides access to official Google developer documentation across Google Cloud, AI/ML (ai.google.dev, ADK, TensorFlow), Android, Chrome, Web, Flutter, Go, Firebase, and other Google developer platforms via the Developer Knowledge MCP server or REST API fallback.

Usage Attribution

Before executing any gcloud, REST API, or MCP command with this skill, follow

the instructions in Usage Attribution.

Workflow

  1. Direct Retrieval: When answering a technical question, execute a single documentation lookup directly within your current conversation context (do not delegate retrieval to subagents):
  1. Confirm the lookup succeeded before using it: A response that arrives is not automatically an answer. PERMISSION_DENIED, UNAUTHENTICATED, HTTP 401 or 403, an empty result set, or any error payload is a FAILED lookup even when the tool itself reported no error. On a failed lookup, do not answer as though it had succeeded.
  1. Immediate & Complete Solution Output: Immediately upon receiving the documentation response, output the complete, self-contained, and executable technical solution (commands with all required flags and placeholders, YAML/JSON configurations, or code snippets) directly in your response text.

Tool Selection & Usage

Choose the appropriate tool based on availability in your runtime environment:

1. Developer Knowledge MCP Tools (Preferred)

When MCP tools are present in your active tool definitions:

2. REST API Fallback

When the MCP tools are absent, query the Developer Knowledge REST API

(https://developerknowledge.googleapis.com/v1) with curl. Two credentials

work, and you should try them in this order.

An existing Google credential, preferred. If gcloud is authenticated,

pass a bearer token and your quota project. Nothing needs to be installed or

configured:

curl -s -X POST "https://developerknowledge.googleapis.com/v1:answerQuery" \
  -H "Authorization: Bearer $(gcloud auth print-access-token)" \
  -H "X-Goog-User-Project: $(gcloud config get-value project 2>/dev/null)" \
  -H "Content-Type: application/json" \
  -d "{\"query\": \"How do I configure public read access on Cloud Storage?\"}"

If that fails to authenticate, on a 401, a 403, or any other credential error,

the account has a token the API will not accept. Substitute

gcloud auth application-default print-access-token for

gcloud auth print-access-token in the command above and try again. Which

credential the API accepts depends on how the environment was authenticated, so

treat an auth error here as a reason to try the application-default credential

rather than as a failed lookup.

An API key, if one is configured. Where DEVELOPERKNOWLEDGE_API_KEY is set

in the environment, pass it as a key query parameter instead of an

Authorization header. If neither credential is available, an API key is the

supported path for this client: enable the API and create one by following the

Developer Knowledge quickstart,

then export it as DEVELOPERKNOWLEDGE_API_KEY. Say that you need a credential

rather than answering without a lookup. The remaining examples in this section

use that form:

```bash

curl -s -X POST "https://developerknowledge.googleapis.com/v1:answerQuery?key=${DEVELOPERKNOWLEDGE_API_KEY}" \

-H "Content-Type: application/json" \

-d '{"query": "How do I configure public read access on Cloud Storage?"}'

```

This endpoint has limited quota. If you get a 429 out of quota error, use documents:searchDocumentChunks instead.

```bash

curl -s "https://developerknowledge.googleapis.com/v1/documents:searchDocumentChunks?query=gcloud+logging+metrics+create&key=${DEVELOPERKNOWLEDGE_API_KEY}"

```

```bash

curl -s "https://developerknowledge.googleapis.com/v1/documents/docs.cloud.google.com/run/docs/overview/what-is-cloud-run?key=${DEVELOPERKNOWLEDGE_API_KEY}"

```

request body; up to 20 per call):

```bash

curl -s -G "https://developerknowledge.googleapis.com/v1/documents:batchGet" \

--data-urlencode "names=documents/docs.cloud.google.com/run/docs/overview/what-is-cloud-run" \

--data-urlencode "names=documents/docs.cloud.google.com/storage/docs/creating-buckets" \

--data-urlencode "key=${DEVELOPERKNOWLEDGE_API_KEY}"

```

Synthesis & Output Guidelines

  1. Grounding in Official Documentation: Ground all solutions directly in retrieved documentation. Official documentation conventions have absolute precedence over memorized defaults.
  2. Exact Parameter Formatting: Format CLI flags, composite keys (e.g. location=IP:PATH), and IAM permission strings according to official Google specifications.
  3. Complete Solutions in Final Response: Always output the full, self-contained, executable technical solution (commands, configurations, or code snippets) with clear standard placeholders (e.g. PROJECT_ID, SERVICE_NAME, REGION) directly in your final message, even if previously referenced during internal planning.

References

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.