Skip to content

feat(skills): hierarchical skill optimization and search command#507

Open
dumko2001 wants to merge 2 commits intogoogleworkspace:mainfrom
dumko2001:feature/issue-82-skill-optimization
Open

feat(skills): hierarchical skill optimization and search command#507
dumko2001 wants to merge 2 commits intogoogleworkspace:mainfrom
dumko2001:feature/issue-82-skill-optimization

Conversation

@dumko2001
Copy link

Description

This PR implements hierarchical skill optimization to solve the context-pollution problem raised in #82. Instead of loading all 40+ API service skills at once, we now use a "Discovery-First" architecture inspired by Claude and GitHub Copilot.

Key changes:

  • Hierarchical Structure: High-level Personas and Recipes remain in the root skills/ directory, while granular technical references for individual services/helpers are moved to skills/references/.
  • gws skills search <query>: A new command for semantic/keyword discovery of tools. This allows agents to find the right skill without pre-loading the entire library.
  • Enhanced gws-shared: Restored all safety rails (zsh expansion, JSON quoting) and added a "Discovery & Search" section.
  • Automated Generation: Refactored generate-skills to handle the new hierarchy and update all internal Markdown cross-references automatically.
  • Cleanup: Removed 188 committed Markdown files (6,000+ lines of bloat) from the repository.

Dry Run Output:
(Since gws skills search is a local discovery tool, it does not produce a JSON API request. Here is the command output instead):

$ gws skills search "email"
Searching for skills matching "email"...

[Service] gws-gmail - Send, read, and manage email
  Reference: skills/references/gws-gmail/SKILL.md

[Recipe] recipe-label-and-archive-emails - Label and Archive Gmail Threads
  Description: Apply Gmail labels to matching messages and archive them to keep your inbox clean.
  Skill: skills/recipe-label-and-archive-emails/SKILL.md
...
Found 8 matching skills.

Checklist:

  • My code follows the AGENTS.md guidelines (no generated google-* crates).
  • I have run cargo fmt --all to format the code perfectly.
  • I have run cargo clippy -- -D warnings and resolved all warnings.
  • I have added tests that prove my fix is effective or that my feature works.
  • I have provided a Changeset file (e.g. via pnpx changeset) to document my changes.

@dumko2001 dumko2001 requested a review from jpoehnelt as a code owner March 15, 2026 18:27
@changeset-bot
Copy link

changeset-bot bot commented Mar 15, 2026

🦋 Changeset detected

Latest commit: 0abc682

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@googleworkspace-bot googleworkspace-bot added area: skills area: docs area: core Core CLI parsing, commands, error handling, utilities labels Mar 15, 2026
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello, 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 skill management system by introducing a hierarchical structure and a powerful search capability. The changes aim to optimize agent performance by reducing unnecessary context loading and improving the discoverability of specific tools. This refactoring also streamlines the skill generation process and cleans up the repository by removing redundant files.

Highlights

  • Hierarchical Skill Structure: Implemented a new hierarchical organization for skills, moving granular technical references for individual services and helpers into a skills/references/ subdirectory to reduce context pollution for agents.
  • New Skill Search Command: Introduced a gws skills search <query> command, enabling semantic and keyword-based discovery of tools without pre-loading the entire skill library.
  • Enhanced gws-shared Skill: Restored essential safety features like zsh expansion and JSON quoting in the gws-shared skill and added a dedicated 'Discovery & Search' section to its documentation.
  • Automated Skill Generation Refactoring: Refactored the generate-skills logic to automatically handle the new hierarchical structure, update internal Markdown cross-references, and include a new link checking script.
  • Repository Cleanup: Removed 188 committed Markdown files, significantly reducing repository bloat by over 6,000 lines.
Changelog
  • .changeset/skill-optimization.md
    • Added a new changeset file detailing the hierarchical skill discovery and search command implementation.
  • .gitignore
    • Modified to ignore the skills/ directory, reflecting the new generated nature of many skill files.
  • check_links.py
    • Added a new Python script to validate local Markdown links within the skills/ and docs/ directories.
  • docs/skills.md
    • Updated the skill index to reflect the new hierarchical structure, renaming 'Services' and 'Helpers' sections to 'Services (Reference)' and 'Helpers (Reference)' respectively.
    • Adjusted all skill paths to point to the new skills/references/ subdirectory for service and helper skills.
    • Added a new 'Shared Patterns' section for the gws-shared skill.
  • skills/gws-shared/SKILL.md
    • Modified to include a new 'Discovery & Search' section with examples for using the gws skills search command.
  • skills/persona-content-creator/SKILL.md
    • Updated required skill paths in metadata and prerequisite text to use the new references/gws-* format.
  • skills/persona-customer-support/SKILL.md
    • Updated required skill paths in metadata and prerequisite text to use the new references/gws-* format.
  • skills/persona-event-coordinator/SKILL.md
    • Updated required skill paths in metadata and prerequisite text to use the new references/gws-* format.
  • skills/persona-exec-assistant/SKILL.md
    • Updated required skill paths in metadata and prerequisite text to use the new references/gws-* format.
  • skills/persona-hr-coordinator/SKILL.md
    • Updated required skill paths in metadata and prerequisite text to use the new references/gws-* format.
  • skills/persona-it-admin/SKILL.md
    • Updated required skill paths in metadata and prerequisite text to use the new references/gws-* format.
  • skills/persona-project-manager/SKILL.md
    • Updated required skill paths in metadata and prerequisite text to use the new references/gws-* format.
  • skills/persona-researcher/SKILL.md
    • Updated required skill paths in metadata and prerequisite text to use the new references/gws-* format.
  • skills/persona-sales-ops/SKILL.md
    • Updated required skill paths in metadata and prerequisite text to use the new references/gws-* format.
  • skills/persona-team-lead/SKILL.md
    • Updated required skill paths in metadata and prerequisite text to use the new references/gws-* format.
  • skills/recipe-backup-sheet-as-csv/SKILL.md
    • Updated required skill paths in metadata and prerequisite text to use the new references/gws-* format.
  • skills/recipe-batch-invite-to-event/SKILL.md
    • Updated required skill paths in metadata and prerequisite text to use the new references/gws-* format.
  • skills/recipe-block-focus-time/SKILL.md
    • Updated required skill paths in metadata and prerequisite text to use the new references/gws-* format.
  • skills/recipe-bulk-download-folder/SKILL.md
    • Updated required skill paths in metadata and prerequisite text to use the new references/gws-* format.
  • skills/recipe-collect-form-responses/SKILL.md
    • Updated required skill paths in metadata and prerequisite text to use the new references/gws-* format.
  • skills/recipe-compare-sheet-tabs/SKILL.md
    • Updated required skill paths in metadata and prerequisite text to use the new references/gws-* format.
  • skills/recipe-copy-sheet-for-new-month/SKILL.md
    • Updated required skill paths in metadata and prerequisite text to use the new references/gws-* format.
  • skills/recipe-create-classroom-course/SKILL.md
    • Updated required skill paths in metadata and prerequisite text to use the new references/gws-* format.
  • skills/recipe-create-doc-from-template/SKILL.md
    • Updated required skill paths in metadata and prerequisite text to use the new references/gws-* format.
  • skills/recipe-create-events-from-sheet/SKILL.md
    • Updated required skill paths in metadata and prerequisite text to use the new references/gws-* format.
  • skills/recipe-create-expense-tracker/SKILL.md
    • Updated required skill paths in metadata and prerequisite text to use the new references/gws-* format.
  • skills/recipe-create-feedback-form/SKILL.md
    • Updated required skill paths in metadata and prerequisite text to use the new references/gws-* format.
  • skills/recipe-create-gmail-filter/SKILL.md
    • Updated required skill paths in metadata and prerequisite text to use the new references/gws-* format.
  • skills/recipe-create-meet-space/SKILL.md
    • Updated required skill paths in metadata and prerequisite text to use the new references/gws-* format.
  • skills/recipe-create-presentation/SKILL.md
    • Updated required skill paths in metadata and prerequisite text to use the new references/gws-* format.
  • skills/recipe-create-shared-drive/SKILL.md
    • Updated required skill paths in metadata and prerequisite text to use the new references/gws-* format.
  • skills/recipe-create-task-list/SKILL.md
    • Updated required skill paths in metadata and prerequisite text to use the new references/gws-* format.
  • skills/recipe-create-vacation-responder/SKILL.md
    • Updated required skill paths in metadata and prerequisite text to use the new references/gws-* format.
  • skills/recipe-draft-email-from-doc/SKILL.md
    • Updated required skill paths in metadata and prerequisite text to use the new references/gws-* format.
  • skills/recipe-email-drive-link/SKILL.md
    • Updated required skill paths in metadata and prerequisite text to use the new references/gws-* format.
  • skills/recipe-find-free-time/SKILL.md
    • Updated required skill paths in metadata and prerequisite text to use the new references/gws-* format.
  • skills/recipe-find-large-files/SKILL.md
    • Updated required skill paths in metadata and prerequisite text to use the new references/gws-* format.
  • skills/recipe-forward-labeled-emails/SKILL.md
    • Updated required skill paths in metadata and prerequisite text to use the new references/gws-* format.
  • skills/recipe-generate-report-from-sheet/SKILL.md
    • Updated required skill paths in metadata and prerequisite text to use the new references/gws-* format.
  • skills/recipe-label-and-archive-emails/SKILL.md
    • Updated required skill paths in metadata and prerequisite text to use the new references/gws-* format.
  • skills/recipe-log-deal-update/SKILL.md
    • Updated required skill paths in metadata and prerequisite text to use the new references/gws-* format.
  • skills/recipe-organize-drive-folder/SKILL.md
    • Updated required skill paths in metadata and prerequisite text to use the new references/gws-* format.
  • skills/recipe-plan-weekly-schedule/SKILL.md
    • Updated required skill paths in metadata and prerequisite text to use the new references/gws-* format.
  • skills/recipe-post-mortem-setup/SKILL.md
    • Updated required skill paths in metadata and prerequisite text to use the new references/gws-* format.
  • skills/recipe-reschedule-meeting/SKILL.md
    • Updated required skill paths in metadata and prerequisite text to use the new references/gws-* format.
  • skills/recipe-review-meet-participants/SKILL.md
    • Updated required skill paths in metadata and prerequisite text to use the new references/gws-* format.
  • skills/recipe-review-overdue-tasks/SKILL.md
    • Updated required skill paths in metadata and prerequisite text to use the new references/gws-* format.
  • skills/recipe-save-email-attachments/SKILL.md
    • Updated required skill paths in metadata and prerequisite text to use the new references/gws-* format.
  • skills/recipe-save-email-to-doc/SKILL.md
    • Updated required skill paths in metadata and prerequisite text to use the new references/gws-* format.
  • skills/recipe-schedule-recurring-event/SKILL.md
    • Updated required skill paths in metadata and prerequisite text to use the new references/gws-* format.
  • skills/recipe-send-team-announcement/SKILL.md
    • Updated required skill paths in metadata and prerequisite text to use the new references/gws-* format.
  • skills/recipe-share-doc-and-notify/SKILL.md
    • Updated required skill paths in metadata and prerequisite text to use the new references/gws-* format.
  • skills/recipe-share-event-materials/SKILL.md
    • Updated required skill paths in metadata and prerequisite text to use the new references/gws-* format.
  • skills/recipe-share-folder-with-team/SKILL.md
    • Updated required skill paths in metadata and prerequisite text to use the new references/gws-* format.
  • skills/recipe-sync-contacts-to-sheet/SKILL.md
    • Updated required skill paths in metadata and prerequisite text to use the new references/gws-* format.
  • skills/recipe-watch-drive-changes/SKILL.md
    • Updated required skill paths in metadata and prerequisite text to use the new references/gws-* format.
  • skills/references/gws-admin-reports/SKILL.md
    • Renamed from skills/gws-admin-reports/SKILL.md to skills/references/gws-admin-reports/SKILL.md.
    • Updated relative paths for gws-shared and other cross-references to reflect the new directory structure.
    • Added a 'See Also' section linking to gws-shared.
  • skills/references/gws-calendar-agenda/SKILL.md
    • Renamed from skills/gws-calendar-agenda/SKILL.md to skills/references/gws-calendar-agenda/SKILL.md.
    • Updated relative paths for gws-shared and other cross-references to reflect the new directory structure.
    • Added a 'See Also' section linking to gws-shared and gws-calendar.
  • skills/references/gws-calendar-insert/SKILL.md
    • Renamed from skills/gws-calendar-insert/SKILL.md to skills/references/gws-calendar-insert/SKILL.md.
    • Updated relative paths for gws-shared and other cross-references to reflect the new directory structure.
    • Added a 'See Also' section linking to gws-shared and gws-calendar.
  • skills/references/gws-calendar/SKILL.md
    • Renamed from skills/gws-calendar/SKILL.md to skills/references/gws-calendar/SKILL.md.
    • Updated relative paths for gws-shared and other cross-references to reflect the new directory structure.
    • Added a 'See Also' section linking to gws-shared.
  • skills/references/gws-chat-send/SKILL.md
    • Renamed from skills/gws-chat-send/SKILL.md to skills/references/gws-chat-send/SKILL.md.
    • Updated relative paths for gws-shared and other cross-references to reflect the new directory structure.
    • Added a 'See Also' section linking to gws-shared and gws-chat.
  • skills/references/gws-chat/SKILL.md
    • Renamed from skills/gws-chat/SKILL.md to skills/references/gws-chat/SKILL.md.
    • Updated relative paths for gws-shared and other cross-references to reflect the new directory structure.
    • Added a 'See Also' section linking to gws-shared.
  • skills/references/gws-classroom/SKILL.md
    • Renamed from skills/gws-classroom/SKILL.md to skills/references/gws-classroom/SKILL.md.
    • Updated relative paths for gws-shared and other cross-references to reflect the new directory structure.
    • Added a 'See Also' section linking to gws-shared.
  • skills/references/gws-docs-write/SKILL.md
    • Renamed from skills/gws-docs-write/SKILL.md to skills/references/gws-docs-write/SKILL.md.
    • Updated relative paths for gws-shared and other cross-references to reflect the new directory structure.
    • Added a 'See Also' section linking to gws-shared and gws-docs.
  • skills/references/gws-docs/SKILL.md
    • Renamed from skills/gws-docs/SKILL.md to skills/references/gws-docs/SKILL.md.
    • Updated relative paths for gws-shared and other cross-references to reflect the new directory structure.
    • Added a 'See Also' section linking to gws-shared.
  • skills/references/gws-drive-upload/SKILL.md
    • Renamed from skills/gws-drive-upload/SKILL.md to skills/references/gws-drive-upload/SKILL.md.
    • Updated relative paths for gws-shared and other cross-references to reflect the new directory structure.
    • Added a 'See Also' section linking to gws-shared and gws-drive.
  • skills/references/gws-drive/SKILL.md
    • Renamed from skills/gws-drive/SKILL.md to skills/references/gws-drive/SKILL.md.
    • Updated relative paths for gws-shared and other cross-references to reflect the new directory structure.
    • Added a 'See Also' section linking to gws-shared.
  • skills/references/gws-events-renew/SKILL.md
    • Renamed from skills/gws-events-renew/SKILL.md to skills/references/gws-events-renew/SKILL.md.
    • Updated relative paths for gws-shared and other cross-references to reflect the new directory structure.
    • Added a 'See Also' section linking to gws-shared and gws-events.
  • skills/references/gws-events-subscribe/SKILL.md
    • Renamed from skills/gws-events-subscribe/SKILL.md to skills/references/gws-events-subscribe/SKILL.md.
    • Updated relative paths for gws-shared and other cross-references to reflect the new directory structure.
    • Added a 'See Also' section linking to gws-shared and gws-events.
  • skills/references/gws-events/SKILL.md
    • Renamed from skills/gws-events/SKILL.md to skills/references/gws-events/SKILL.md.
    • Updated relative paths for gws-shared and other cross-references to reflect the new directory structure.
    • Added a 'See Also' section linking to gws-shared.
  • skills/references/gws-forms/SKILL.md
    • Renamed from skills/gws-forms/SKILL.md to skills/references/gws-forms/SKILL.md.
    • Updated relative paths for gws-shared and other cross-references to reflect the new directory structure.
    • Added a 'See Also' section linking to gws-shared.
  • skills/references/gws-gmail-forward/SKILL.md
    • Renamed from skills/gws-gmail-forward/SKILL.md to skills/references/gws-gmail-forward/SKILL.md.
    • Updated relative paths for gws-shared and other cross-references to reflect the new directory structure.
    • Added a 'See Also' section linking to gws-shared and gws-gmail.
  • skills/references/gws-gmail-reply-all/SKILL.md
    • Renamed from skills/gws-gmail-reply-all/SKILL.md to skills/references/gws-gmail-reply-all/SKILL.md.
    • Updated relative paths for gws-shared and other cross-references to reflect the new directory structure.
    • Added a 'See Also' section linking to gws-shared and gws-gmail.
  • skills/references/gws-gmail-reply/SKILL.md
    • Renamed from skills/gws-gmail-reply/SKILL.md to skills/references/gws-gmail-reply/SKILL.md.
    • Updated relative paths for gws-shared and other cross-references to reflect the new directory structure.
    • Added a 'See Also' section linking to gws-shared and gws-gmail.
  • skills/references/gws-gmail-send/SKILL.md
    • Renamed from skills/gws-gmail-send/SKILL.md to skills/references/gws-gmail-send/SKILL.md.
    • Updated relative paths for gws-shared and other cross-references to reflect the new directory structure.
    • Added a 'See Also' section linking to gws-shared and gws-gmail.
  • skills/references/gws-gmail-triage/SKILL.md
    • Renamed from skills/gws-gmail-triage/SKILL.md to skills/references/gws-gmail-triage/SKILL.md.
    • Updated relative paths for gws-shared and other cross-references to reflect the new directory structure.
    • Added a 'See Also' section linking to gws-shared and gws-gmail.
  • skills/references/gws-gmail-watch/SKILL.md
    • Renamed from skills/gws-gmail-watch/SKILL.md to skills/references/gws-gmail-watch/SKILL.md.
    • Updated relative paths for gws-shared and other cross-references to reflect the new directory structure.
    • Added a 'See Also' section linking to gws-shared and gws-gmail.
  • skills/references/gws-gmail/SKILL.md
    • Renamed from skills/gws-gmail/SKILL.md to skills/references/gws-gmail/SKILL.md.
    • Updated relative paths for gws-shared and other cross-references to reflect the new directory structure.
    • Added a 'See Also' section linking to gws-shared.
  • skills/references/gws-keep/SKILL.md
    • Renamed from skills/gws-keep/SKILL.md to skills/references/gws-keep/SKILL.md.
    • Updated relative paths for gws-shared and other cross-references to reflect the new directory structure.
    • Added a 'See Also' section linking to gws-shared.
  • skills/references/gws-meet/SKILL.md
    • Renamed from skills/gws-meet/SKILL.md to skills/references/gws-meet/SKILL.md.
    • Updated relative paths for gws-shared and other cross-references to reflect the new directory structure.
    • Added a 'See Also' section linking to gws-shared.
  • skills/references/gws-modelarmor-create-template/SKILL.md
    • Renamed from skills/gws-modelarmor-create-template/SKILL.md to skills/references/gws-modelarmor-create-template/SKILL.md.
    • Updated relative paths for gws-shared and other cross-references to reflect the new directory structure.
    • Added a 'See Also' section linking to gws-shared and gws-modelarmor.
  • skills/references/gws-modelarmor-sanitize-prompt/SKILL.md
    • Renamed from skills/gws-modelarmor-sanitize-prompt/SKILL.md to skills/references/gws-modelarmor-sanitize-prompt/SKILL.md.
    • Updated relative paths for gws-shared and other cross-references to reflect the new directory structure.
    • Added a 'See Also' section linking to gws-shared and gws-modelarmor.
  • skills/references/gws-modelarmor-sanitize-response/SKILL.md
    • Renamed from skills/gws-modelarmor-sanitize-response/SKILL.md to skills/references/gws-modelarmor-sanitize-response/SKILL.md.
    • Updated relative paths for gws-shared and other cross-references to reflect the new directory structure.
    • Added a 'See Also' section linking to gws-shared and gws-modelarmor.
  • skills/references/gws-modelarmor/SKILL.md
    • Renamed from skills/gws-modelarmor/SKILL.md to skills/references/gws-modelarmor/SKILL.md.
    • Updated relative paths for gws-shared and other cross-references to reflect the new directory structure.
    • Added a 'See Also' section linking to gws-shared.
  • skills/references/gws-people/SKILL.md
    • Renamed from skills/gws-people/SKILL.md to skills/references/gws-people/SKILL.md.
    • Updated relative paths for gws-shared and other cross-references to reflect the new directory structure.
    • Added a 'See Also' section linking to gws-shared.
  • skills/references/gws-sheets-append/SKILL.md
    • Renamed from skills/gws-sheets-append/SKILL.md to skills/references/gws-sheets-append/SKILL.md.
    • Updated relative paths for gws-shared and other cross-references to reflect the new directory structure.
    • Added a 'See Also' section linking to gws-shared and gws-sheets.
  • skills/references/gws-sheets-read/SKILL.md
    • Renamed from skills/gws-sheets-read/SKILL.md to skills/references/gws-sheets-read/SKILL.md.
    • Updated relative paths for gws-shared and other cross-references to reflect the new directory structure.
    • Added a 'See Also' section linking to gws-shared and gws-sheets.
  • skills/references/gws-sheets/SKILL.md
    • Renamed from skills/gws-sheets/SKILL.md to skills/references/gws-sheets/SKILL.md.
    • Updated relative paths for gws-shared and other cross-references to reflect the new directory structure.
    • Added a 'See Also' section linking to gws-shared.
  • skills/references/gws-slides/SKILL.md
    • Renamed from skills/gws-slides/SKILL.md to skills/references/gws-slides/SKILL.md.
    • Updated relative paths for gws-shared and other cross-references to reflect the new directory structure.
    • Added a 'See Also' section linking to gws-shared.
  • skills/references/gws-tasks/SKILL.md
    • Renamed from skills/gws-tasks/SKILL.md to skills/references/gws-tasks/SKILL.md.
    • Updated relative paths for gws-shared and other cross-references to reflect the new directory structure.
    • Added a 'See Also' section linking to gws-shared.
  • skills/references/gws-workflow-email-to-task/SKILL.md
    • Renamed from skills/gws-workflow-email-to-task/SKILL.md to skills/references/gws-workflow-email-to-task/SKILL.md.
    • Updated relative paths for gws-shared and other cross-references to reflect the new directory structure.
    • Added a 'See Also' section linking to gws-shared and gws-workflow.
  • skills/references/gws-workflow-file-announce/SKILL.md
    • Renamed from skills/gws-workflow-file-announce/SKILL.md to skills/references/gws-workflow-file-announce/SKILL.md.
    • Updated relative paths for gws-shared and other cross-references to reflect the new directory structure.
    • Added a 'See Also' section linking to gws-shared and gws-workflow.
  • skills/references/gws-workflow-meeting-prep/SKILL.md
    • Renamed from skills/gws-workflow-meeting-prep/SKILL.md to skills/references/gws-workflow-meeting-prep/SKILL.md.
    • Updated relative paths for gws-shared and other cross-references to reflect the new directory structure.
    • Added a 'See Also' section linking to gws-shared and gws-workflow.
  • skills/references/gws-workflow-standup-report/SKILL.md
    • Renamed from skills/gws-workflow-standup-report/SKILL.md to skills/references/gws-workflow-standup-report/SKILL.md.
    • Updated relative paths for gws-shared and other cross-references to reflect the new directory structure.
    • Added a 'See Also' section linking to gws-shared and gws-workflow.
  • skills/references/gws-workflow-weekly-digest/SKILL.md
    • Renamed from skills/gws-workflow-weekly-digest/SKILL.md to skills/references/gws-workflow-weekly-digest/SKILL.md.
    • Updated relative paths for gws-shared and other cross-references to reflect the new directory structure.
    • Added a 'See Also' section linking to gws-shared and gws-workflow.
  • skills/references/gws-workflow/SKILL.md
    • Renamed from skills/gws-workflow/SKILL.md to skills/references/gws-workflow/SKILL.md.
    • Updated relative paths for gws-shared and other cross-references to reflect the new directory structure.
    • Added a 'See Also' section linking to gws-shared.
  • src/generate_skills.rs
    • Modified handle_generate_skills to categorize gws-shared as 'shared' instead of 'service'.
    • Added filtering logic to handle_generate_skills to skip services that do not match a specified filter, improving generation efficiency.
    • Updated calls to write_skill to include a new is_reference boolean parameter.
    • Modified the write_skill function to conditionally create skill directories under skills/references/ for reference skills.
    • Updated write_skills_index to include a 'Shared Patterns' section and adjust paths for 'Service' and 'Helper' skills to point to the references/ subdirectory.
    • Adjusted cross-reference paths in render_service_skill and render_helper_skill to use ../../gws-shared/SKILL.md and added a 'See Also' section to service skills.
    • Updated render_persona_skill and render_recipe_skill to reference required skills using the references/gws-{s} format.
  • src/main.rs
    • Added a new module skills_search.
    • Integrated handle_skills_command to process the new gws skills command.
    • Updated the print_usage function to include the new gws skills search <query> command and an example.
  • src/skills_search.rs
    • Added a new module implementing the gws skills search command.
    • Provided functionality to semantically search through service, persona, and recipe descriptions.
Activity
  • dumko2001 created the pull request with a detailed description outlining the problem (context pollution) and the proposed solution (hierarchical skill optimization and search command).
  • The pull request includes a dry run output demonstrating the functionality of the new gws skills search command.
  • The author has completed all checklist items, including code formatting, linting, adding tests, and providing a Changeset file.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Generative AI Prohibited Use Policy, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a 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 a hierarchical structure for skills to address context pollution, along with a new gws skills search command for discovery. The changes are extensive, refactoring the skill generation logic and updating numerous skill definition files.

My review has identified a few issues:

  • A critical bug in the new check_links.py script that prevents it from correctly identifying most local links.
  • A high-severity issue in the same script where file encoding is not specified, which could lead to errors on different operating systems.
  • A high-severity typo in .gitignore that will prevent the skills/ directory from being ignored correctly.

I've provided suggestions to fix these issues. The rest of the changes, particularly the refactoring of the Rust code for skill generation and the updates to the markdown files, appear to be correct and consistent with the goals of the pull request.

docsdir = Path("docs").resolve()

# regex to find markdown links: [text](path)
link_regex = re.compile(r'\[.*?\]\(([^http].*?)\)')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

The regular expression to find links is incorrect. The character set [^http] prevents matching any link that starts with 'h', 't', or 'p'. This will cause the script to miss many local links, such as [link](path/to/file.md), defeating the purpose of the link checker.

The regex should match any path, and then HTTP links should be filtered out inside the loop. After applying the suggested change to this line, you should also add a check for http: and https: links in the loop.

Suggested change
link_regex = re.compile(r'\[.*?\]\(([^http].*?)\)')
link_regex = re.compile(r'\[.*?\]\((.*?)\)')

# Generated
demo.mp4
download.html No newline at end of file
download.htmlskills/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The skills/ directory was appended to the same line as download.html, creating a single entry download.htmlskills/. This is likely a mistake and will not ignore the skills/ directory as intended. Each entry in .gitignore should be on its own line.

download.html
skills/

files_to_check = list(basedir.rglob("*.md")) + list(docsdir.rglob("*.md"))

for filepath in files_to_check:
with open(filepath, 'r') as f:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

It's best practice to specify the file encoding when opening text files. Without it, the script may fail on systems with a different default encoding (like Windows) if a file contains non-ASCII characters. Please add encoding='utf-8'.

Suggested change
with open(filepath, 'r') as f:
with open(filepath, 'r', encoding='utf-8') as f:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: core Core CLI parsing, commands, error handling, utilities area: docs area: skills

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants