-
Notifications
You must be signed in to change notification settings - Fork 2.8k
feat: Add Agent Skills standard support for ADK #4177
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Implements comprehensive support for the Agent Skills standard (https://agentskills.io), enabling skills bundled with SKILL.md documentation, scripts, and references for progressive disclosure. Key additions: - MarkdownSkill: Load skills from SKILL.md with YAML frontmatter - AgentSkillLoader: Discover and load skills from directories - ScriptExecutor: Safe execution of Python/Bash/JS scripts - SkillTool: Wrap skills as ADK tools for LLM invocation - SkillsManager: Registration and discovery management Built-in skills included: - bqml: BigQuery ML for model training and inference - bq-ai-operator: BigQuery AI operations (text, embeddings) Also includes demo agent and comprehensive test suite (130 tests). Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
|
Response from ADK Triaging Agent Hello @caohy1988, thank you for your contribution! This is a significant new feature, and we appreciate you taking the time to implement it. To help us review this PR, could you please create a GitHub issue that describes this new feature? You can then associate that issue with this PR. Also, it looks like you haven't signed the Contributor License Agreement (CLA) yet. You can find instructions on how to do that in the comment from the Once these items are addressed, we can proceed with the review. Thanks! |
Summary of ChangesHello @caohy1988, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the Agent Development Kit (ADK) by introducing robust support for the Agent Skills open standard. This integration empowers ADK agents with the ability to dynamically acquire and utilize specialized functionalities, including executable scripts and detailed documentation, all managed through a context-efficient progressive disclosure mechanism. The new architecture facilitates modular skill development and seamless LLM interaction, as demonstrated by the included BigQuery-focused skills and a comprehensive demo agent. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
Comprehensive documentation covering: - Agent Skills standard overview - SKILL.md specification - Progressive disclosure architecture - ADK implementation details - Usage examples and best practices Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request introduces comprehensive support for the Agent Skills standard, which is a significant and well-structured feature addition. The implementation of core abstractions like MarkdownSkill, AgentSkillLoader, and ScriptExecutor is robust and includes good practices like progressive disclosure and sandboxed execution. The new documentation and demo agent are also valuable additions. I've identified a few areas for improvement, mainly related to documentation consistency, a potential bug in a demo script, and opportunities for more robust code in a few places.
| ) | ||
|
|
||
| # Print summary on load | ||
| if __name__ == "__main__" or True: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The condition if __name__ == "__main__" or True: will always evaluate to true, causing the summary to be printed every time this module is imported. This was likely intended for debugging and should be corrected to if __name__ == "__main__": to ensure it only runs when the script is executed directly.
| if __name__ == "__main__" or True: | |
| if __name__ == "__main__": |
| async def use_{self.name.replace("-", "_")}(tools): | ||
| """Example orchestration for {self.name} skill.""" | ||
| {script_calls} | ||
| return {{"results": [result_0]}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The example orchestration template returns only result_0, even though the preceding code generates up to three results (result_0, result_1, result_2). This is misleading and could be a bug if copied. To accurately reflect the generated results, consider returning all of them. The implementation in markdown_skill.py handles this correctly by creating and using a result_list.
| "docker", "run", "--rm", | ||
| f"--memory={self.memory_limit_mb}m", | ||
| f"--cpus=1", | ||
| f"-v", f"{cwd}:/workspace:ro", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Docker volume in this documentation example is mounted as read-only (ro), which would prevent scripts from writing to the workspace. The implementation in script_executor.py correctly uses rw (read-write) for greater flexibility. To avoid confusion, the documentation should be consistent with the implementation.
| f"-v", f"{cwd}:/workspace:ro", | |
| f"-v", f"{cwd}:/workspace:rw", |
|
|
||
| ### Skills Loaded | ||
|
|
||
| The demo loads BigQuery ML skills from `src/google/adk/tools/bigquery/skills/`: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The path to the skills directory seems incorrect. The built-in BigQuery skills are located in src/google/adk/skills/, not src/google/adk/tools/bigquery/skills/.
| The demo loads BigQuery ML skills from `src/google/adk/tools/bigquery/skills/`: | |
| The demo loads BigQuery ML skills from `src/google/adk/skills/`: |
| os.environ.setdefault("GOOGLE_CLOUD_LOCATION", os.getenv("VERTEXAI_LOCATION", "us-central1")) | ||
|
|
||
| # Path to skills directory (now in main skills module) | ||
| SKILLS_DIR = Path(__file__).parent.parent.parent.parent / "src" / "google" / "adk" / "skills" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Constructing the SKILLS_DIR path using relative parent directories is fragile and can break if the file structure changes. A more robust approach is to import the SKILLS_DIR constant directly from the google.adk.skills package, where it is already defined.
| SKILLS_DIR = Path(__file__).parent.parent.parent.parent / "src" / "google" / "adk" / "skills" | |
| from google.adk.skills import SKILLS_DIR |
| ml_generate_text_result['candidates'][0]['content']['parts'][0]['text'] AS generated_text, | ||
| ml_generate_text_result['usageMetadata']['promptTokenCount'] AS prompt_tokens, | ||
| ml_generate_text_result['usageMetadata']['candidatesTokenCount'] AS output_tokens, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| ml_generate_embedding_result['embeddings'][0]['values'] AS embedding, | ||
| ml_generate_embedding_result['embeddings'][0]['statistics']['token_count'] AS token_count, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replaces bq-ai-operator with a comprehensive bigquery-ai skill covering all BigQuery AI capabilities following Agent Skills standard best practices. New bigquery-ai skill includes: - SKILL.md: Concise root with quick start and function reference - references/TEXT_GENERATION.md: Complete AI.GENERATE_TEXT guide - references/EMBEDDINGS.md: ML.GENERATE_EMBEDDING best practices - references/VECTOR_SEARCH.md: Semantic search patterns - references/RAG_WORKFLOW.md: End-to-end RAG implementation - references/REMOTE_MODELS.md: CREATE MODEL for all LLM providers - references/CLOUD_AI_SERVICES.md: Translation, NLP, Vision, etc. - scripts/: Helper scripts for setup and common operations Also updates: - bqml skill: Focused on traditional ML (classification, regression, etc.) - agent_skills_demo: Updated system instruction for new skill structure Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add 6 new BigQuery MarkdownSkills following the Agent Skills standard: - bigquery-data-management: Data loading, partitioning, clustering, external tables, and data formats - bigquery-analytics: Window functions, aggregations, geospatial analysis, and statistical functions - bigquery-storage: Table management, schema evolution, snapshots, clones, and time travel - bigquery-governance: IAM access control, column/row-level security, data masking, CMEK, and audit logging - bigquery-admin: Slot reservations, BI Engine, job management, monitoring, and cost optimization - bigquery-integration: Client libraries (Python/Java/Node.js), REST API, JDBC/ODBC, Data Transfer Service, and Dataflow Each skill includes: - SKILL.md with comprehensive documentation - Reference documents for detailed topics - Helper scripts for common operations Also includes unit tests for all new skills (38 tests). Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Summary
MarkdownSkill,AgentSkillLoader,ScriptExecutor,SkillTool,SkillsManagerbqml(ML model training/inference) andbq-ai-operator(AI operations)Key Features
SkillToolwraps skills as ADK tools for LLM invocationFiles Changed
src/google/adk/skills/- Core skill implementation (8 new files)src/google/adk/skills/bqml/- BQML skill with references and scriptssrc/google/adk/skills/bq-ai-operator/- BQ AI Operator skill with references and scriptstests/unittests/skills/- Comprehensive test suite (130 tests)contributing/samples/agent_skills_demo/- Demo agentagent_skill.md- Design documentationTest plan
pytest tests/unittests/skills/)🤖 Generated with Claude Code