agentleFS
RuslanKhisRuslanKhis/agentic-engineering-skills/skills/optimise-adk-on-google-cloud/SKILL.md

optimise-adk-on-google-cloud

Skill9 starsChanged 17 days agoMITView on GitHub

Diagnose, implement or review Python Google ADK optimisations on Cloud Run, Agent Runtime and GKE involving model/tool work, in-session history and context growth (trimming, summarising), streaming completion, session handling, startup, concurrency or workload scaling. Use for measured changes or actionable optimisation plans. Do not activate for hosting selection or first deployment alone (deploy-adk-on-google-cloud), general Kubernetes administration, cross-session memory or RAG architecture (adk-memory-architecture), model choice or thinking settings (adk-model-and-output-contracts), production alerting and SLOs (adk-agent-observability), non-ADK performance work, or unrelated prompt and UI edits (adk-agent-instructions owns prompt wording).

  • Reads credentials

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 4 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Read project instructions, status, dependency declarations and locks, agent exports, serving and tool code, deployment definitions and …

    line 35
  2. Distinctive:

    Use the existing project interpreter.

    line 39
  3. Distinctive:

    Read lifecycle.md before preparing a cloud mutation, paid comparison, export, cache experiment or cleanup.

    line 97
  4. Distinctive:

    Read validation.md for mode-specific tests, the offline saved-event checker and the offline context budget helper, which estimates request …

    line 124

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Optimise ADK on Google Cloud

Reduce avoidable work while preserving correct, authorised and complete results. This one skill covers all three parts of Chapter 4: application optimisation, Cloud Run, Agent Runtime and GKE. The book and companion repository are optional provenance, never runtime dependencies.

Inspect and define acceptance

  1. Read project instructions, status, dependency declarations and locks, agent exports, serving and tool code, deployment definitions and relevant tests. Establish whether the user wants advice, an audit, an implementation or a live comparison. Preserve the domain, package manager, versions and customisations.
  2. Use the existing project interpreter. The read-only project inspector (its baseline gate records ADK 2.8.0; baseline_gate_passed: false on a newer pin means "not the recorded baseline", so read the dated 2.12 notes in the references rather than treating it as a project failure) accepts --project, --mode (auto, application, cloud-run, agent-runtime, gke) and --require-baseline. It reads bounded dependency manifests and reports configuration presence; it does not import application code, read .env contents or execute cloud commands. Manually inspect its uncovered files and lock resolution. Read compatibility.md before using an ADK recipe. Compare installed distribution metadata with declared Python and ADK pins. A mismatch requires contract verification or a specific blocked path, never an automatic upgrade or downgrade.
  3. Trace the actual request: server and session service, ADK App or bare agent, model requests, tools, child handoffs, result storage and client consumption. Record model/backend and configuration keys without exposing secret values. Nested environment files can override root configuration. Inspect the image's actual source package and entrypoint, not just a similarly named example.
  4. Separate external request time, platform startup/queueing and application spans. Identify one candidate boundary and its evidence. If measurements are absent, deliver an instrumentation/comparison plan; do not invent a bottleneck. Define correct output, permitted effects, completion, work limits and relevant quality checks before selecting an optimisation.

Inspection ends with the current architecture, version status, selected mode, acceptance criteria and missing prerequisites. Missing cloud credentials still permit local inspection, implementation and offline validation.

Select the smallest useful mode

Observed work or requested decisionRead when entering this modeEvidence needed
Remote adapter overhead, repeated schema, oversized results, unnecessary child history/output or serial independent I/OApplication pathSame authorised result, bounded handoff, complete answer and relevant request-boundary observations
Large repeated instructions or uncertain prefix-cache benefitSkills and cacheActual instruction loading or outgoing request/usage metadata, with correctness and separate cache lifecycle
Long sessions, token growth per turn, cache misses, oversized tool results or sub-agent context isolationContext windowCaptured request composition, cached-token counts, bounded tool results and preserved correctness
Cloud Run startup, concurrency, CPU allocation, session locality or revision comparisonCloud RunEffective revision configuration, external/platform/application measurements and state/security checks
Agent Runtime session reuse, App/compaction propagation, model or hosting workAgent RuntimeActual execution location, retained session events, selected model input and observed capacity
Agent Runtime streaming, buffered persistence, optional memory writes or deferred jobsState and streamsComplete outputs, bounded admission, immutable batches and correctly correlated recovery
GKE startup, resources, rollout capacity, scaling or identity delaysGKE workloadActual manifest generator/build inputs, admitted Pods, scheduling events and pressure measurements
GKE session continuity, HTTP/draining, tracing privacy or streamingGKE serving pathWired session backend, trusted caller, complete responses and final exported telemetry
Optimisation review or greenfield design without measurementsRead only the relevant references abovePrioritised hypotheses, concrete implementation seams and a validation plan; no claimed speedup

Combine modes only when the request needs them. A general deployment, SQL security overhaul or UI rewrite is not an implied optimisation task.

Implement or recommend

  1. Present a short plan before broad changes: affected files, one principal mechanism, preserved behaviour and validation. For advice/review, provide the decision and actionable changes without generating an unsolicited application.
  2. Adapt the current implementation. Keep trusted policy at tool/backend boundaries; model instructions, Skills and structured output cannot grant access. Wire new components into the actual Runner/server and build inputs. An unused formatter or unshipped file is not an implemented optimisation.
  3. Preserve explicit failure and uncertainty. Provider failure must not become fabricated fallback data. A token cap, timeout, nonempty answer or HTTP 200 does not establish completion. Limit logical calls, provider attempts, nested work and elapsed time independently where the task needs bounds.
  4. Read lifecycle.md before preparing a cloud mutation, paid comparison, export, cache experiment or cleanup. Finish reviewable configuration and exact commands before seeking approval. For Agent Runtime packaging or operation recovery, also read runtime-lifecycle.md. For GKE deployment, capacity retries or teardown, read gke-lifecycle.md. A saved reference manifest is not necessarily the applied configuration; inspect the actual delivery path.

Authority and safety

<!-- shared:consequential-operations-brief -->

Inspection is read-only, and code generation authorises no deployment, paid call or live test. Before any consequential operation (an API, billing or quota change, a billable resource, a secret, IAM, a data migration, a deployment, a deletion, or a paid or destructive test), read consequential operations, present the exact scope and limits, obtain explicit approval and end the turn to wait for it. Cleanup is a separate confirmed operation on resources this workflow created.

<!-- /shared:consequential-operations-brief -->

Billing linkage and quota increases require their own approval. Verify owned cleanup of caches separately from sessions.

Validate and finish

Read validation.md for mode-specific tests, the offline saved-event checker and the offline context budget helper, which estimates request composition, tool-result sizes and compaction coverage from a saved session export. Run relevant local tests and static/build checks first, after inspecting their side effects. Check the actual boundary: tool results and correlation, outgoing child input, complete outputs, result durability or revision configuration. Mocked execution proves only the exercised local contract. Historical companion PASS results do not verify this target.

For an approved live experiment, retain failed observations, compare equivalent workloads and report sample counts, cold/warm/cache state and errors. Verify owned cleanup, including caches separately from sessions. Repeat the local adaptation to check for duplicate wiring or needless changes.

Report files changed, commands actually executed, exact versions, actual results, manual steps and remaining uncertainty. State what the change improves and what the evidence cannot establish.

<!-- shared:evidence-labels-brief -->

Label each result with its tier (offline, local, live or release) and outcome (pass, fail, blocked or not run) as evidence labels defines them; earlier, vendor and documentation-only results are historical, vendor-measured or guidance, never this session's evidence.

<!-- /shared:evidence-labels-brief -->

Independent community project; not affiliated with or endorsed by Google.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.