Back to V8

Environment Abstraction Skill

agents/skills/env-abstraction/SKILL.md

15.0.202.1 KB
Original Source

Environment Abstraction Skill

This skill provides a layer of abstraction over environment-specific tools and commands, allowing skills to be reused across different platforms like jetski and gemini-cli.

Core Principles

  1. Decoupling: Keep tool calls independent from platform specific implementations inside general workflow skills.
  2. Detection: Determine the environment at startup (e.g., via environment variables or tool availability).
  3. Mapping: Map abstract actions to concrete commands or tool calls based on the environment.

Environment Definitions

Jetski Environment

  • Characteristics: Rich set of specialized tools (e.g., code_search, moma_search, gdb-mcp, v8-utils).
  • Usage: Prefer specialized tools over generic shell commands to maximize efficiency and respect workspace constraints (e.g., avoid heavy searches in large workspaces).

Gemini-CLI Environment

  • Characteristics: May rely more on standard shell commands or a different set of MCP servers.
  • Usage: Fall back to standard tools like grep, find, or standard gdb via run_command if specialized Jetski tools are unavailable.

Abstract Action Mapping

When performing common actions, refer to this mapping to choose the correct tool:

Abstract ActionJetski ImplementationGemini-CLI Implementation (Fallback)
Code Searchcode_searchgrep_search (if outside Google3) or standard grep
File Searchfind_by_name (if safe)Standard find or fd
Debugginggdb-mcpStandard gdb via run_command
Buildingtools/dev/gm.py (use use_remoteexec=true)tools/dev/gm.py
Testingtools/run-tests.pytools/run-tests.py
Starting Agentsinvoke_subagent (tool)agentapi new-conversation (CLI)

Implementation Guidelines

  • When writing or updating skills, refer to actions by their abstract names.
  • Check for the existence of specialized tools before falling back to generic commands.
  • Document any environment-specific assumptions in the skill file.