This skill guides the user through scaffolding a new environment for the DB Data Agent auto context generation. It handles creating tracking files, output directories, and configuring database connections.
Initialization Workflow
Follow these steps when the user asks to initialize the environment:
- Confirm Working Directory: Explicitly state the current working directory to the user. Explain that the initialization will create an
autoctx/folder in this directory to holdtools.yaml,state.md, andexperiments/. Ask them to confirm if this is the correct location before proceeding. - Check Existing Infrastructure:
- Check if the
autoctx/directory exists. - If it exists, verify if it contains valid
tools.yamlandstate.mdfiles. If it appears to be an unrelated folder or corrupted, STOP and ask the user how to proceed (e.g., use a different name or overwrite). - If it is a valid Autoctx folder and contains all items, inform the user it's already initialized. Otherwise, proceed to create missing items inside
autoctx/.
- Check if the
- Setup Toolbox Configuration: If
tools.yamlis missing insideautoctx/, follow the primary "1. Create a New tools.yaml" workflow documented below in the Toolbox Config Helper section. - Create State Tracker: If
state.mdis missing insideautoctx/, create it with header “context authoring experiment state tracking”. - Initialize Experiments Directory: If
experiments/is missing insideautoctx/, create an emptyexperiments/directory insideautoctx/.
Output
Upon successful completion, the workspace must contain:
autoctx/: The dedicated workspace directory.tools.yaml: A structurally sound configuration file for the Toolbox MCP Server.state.md: The external state tracker for hill-climbing iterations.experiments/: The base directory prepared to store all hill-climbing run artifacts (e.g. baseline contexts, evaluation reports).
Final Summary
Conclude by providing a succinct summary to the user:
- State whether the workspace was initialized newly or if existing files were preserved.
- Instruct the user to reload the MCP toolbox so any new database connections take effect:
- Gemini CLI: run
/mcp reload. - Claude Code: run
/reload-plugins. - Antigravity CLI: run
/mcp, selecttoolbox, and selectRestart.
- Gemini CLI: run
- Inform them they are now ready to proceed to the next phase (e.g., the Bootstrap workflow).
Toolbox Config Helper
This section contains standalone instructions for managing the tools.yaml file for the GenAI Toolbox. You can execute these if the user explicitly asks to add or list database connections.
Credentials
For Google Cloud databases, the system uses Application Default Credentials (ADC) and IAM Authentication. Providing a user and password is not supported.
When collecting information from the user, inform the user that only Application Default Credentials (ADC) are supported for authentication. They do not need to provide a username or password.
Sample Message:
"I'll help you configure the database connection in
tools.yaml. Note that the system only supports Application Default Credentials (ADC) for authentication, so you don't need to provide a username or password. Please ensure that the IAM account you are using has the required permissions to access the database.Could you please provide the following details:
- Google Cloud Project ID:
- Region: ... (other required fields based on database type)"
Primary Workflows
1. Create a New tools.yaml
- Identify Database Type: Ask the user which database they want to configure:
- Cloud SQL Postgres
- Cloud SQL MySQL
- AlloyDB Postgres
- Spanner
- Collect Information: Request all Required Information based on the templates inside the
references/folder. Do NOT assume missing fields; ask the user for them explicitly. - Generate Configuration: Replace all placeholders with the user's provided values and generate the complete
tools.yamlcontent. Save it to the target location (e.g.,autoctx/tools.yamlfor Autoctx workflows, ortools.yamlin the current directory for standalone use). - Validate: After saving, validate the new connection using the toolbox script, replacing
<config_path>with the actual path to the file:npx -y @toolbox-sdk/server --config <config_path> invoke <data_source_name>-list-schemas
2. Add a Database to an Existing tools.yaml
- Identify Database Type: Ask the user for the type of the new database connection they wish to add.
- Collect Information: Request the required information for the new connection, including a new, unique
<data_source_name>. - Read Existing File: Read the content of the existing
tools.yamlfrom the target location. - Generate and Append: Generate the YAML snippets for the new
sourcesandtoolssections. Append these new entries to the respective sections in the existing file content. - Save Configuration: Save the updated content back to the file.
- Validate: Validate only the newly added connection, replacing
<config_path>with the actual path to the file:npx -y @toolbox-sdk/server --config <config_path> invoke <data_source_name>-list-schemas
3. List Existing Database Connections
- Check and Read
tools.yaml: Check for thetools.yamlfile. If it doesn't exist, inform the user. - Parse and List: Parse the YAML content and list the names of all configured data sources found under the
sources:key limit.
Validation
To verify that a specific database connection is configured correctly at any time, run the validation script with the target data source name:
npx -y @toolbox-sdk/server --config tools.yaml invoke <data_source_name>-list-schemas
Templates & Reference
For the specific fields required for each database type and the exact YAML structure to use, refer to the references/ directory.