Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .changeset/skill-optimization.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
"gws": patch
---

feat(skills): implement hierarchical skill discovery and search command

- Restructure skills/ into hierarchical references/ subdirectory to avoid agent context pollution.
- Add `gws skills search <query>` command for semantic/keyword discovery of 40+ API services.
- Restore essential safety tips (zsh ! expansion, JSON quoting) in the gws-shared skill.
- Refactor generate-skills logic to automate artifact generation and link validation.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,4 @@ docs/plans/

# Generated
demo.mp4
download.html
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/

55 changes: 55 additions & 0 deletions check_links.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
import os
import re
from pathlib import Path

def check_links():
basedir = Path("skills").resolve()
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'\[.*?\]\((.*?)\)')


broken_links = 0
total_links = 0

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:

content = f.read()

for match in link_regex.finditer(content):
link_path = match.group(1).strip()

# Skip empty links, mailto:, etc
if not link_path or link_path.startswith(('mailto:', 'tel:')):
continue

# Skip absolute web paths like /chat/api/guides/...
if link_path.startswith('/'):
continue

# Skip anchor-only links
if link_path.startswith('#'):
continue

# Remove anchor from filename
file_part = link_path.split('#')[0]
if not file_part:
continue

total_links += 1
target_path = (filepath.parent / file_part).resolve()
if not target_path.exists():
print(f"Broken link in {filepath}: {link_path} (resolved to {target_path})")
broken_links += 1

print(f"Checked {total_links} local links.")
if broken_links > 0:
print(f"Found {broken_links} broken links!")
exit(1)
else:
print("All local links are valid!")

if __name__ == "__main__":
check_links()
99 changes: 53 additions & 46 deletions docs/skills.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,60 +2,67 @@

> Auto-generated by `gws generate-skills`. Do not edit manually.

## Services
## Shared Patterns

Core Google Workspace API skills.
Global flags, authentication, and security rules.

| Skill | Description |
|-------|-------------|
| [gws-shared](../skills/gws-shared/SKILL.md) | gws CLI: Shared patterns for authentication, global flags, and output formatting. |
| [gws-drive](../skills/gws-drive/SKILL.md) | Google Drive: Manage files, folders, and shared drives. |
| [gws-sheets](../skills/gws-sheets/SKILL.md) | Google Sheets: Read and write spreadsheets. |
| [gws-gmail](../skills/gws-gmail/SKILL.md) | Gmail: Send, read, and manage email. |
| [gws-calendar](../skills/gws-calendar/SKILL.md) | Google Calendar: Manage calendars and events. |
| [gws-admin-reports](../skills/gws-admin-reports/SKILL.md) | Google Workspace Admin SDK: Audit logs and usage reports. |
| [gws-docs](../skills/gws-docs/SKILL.md) | Read and write Google Docs. |
| [gws-slides](../skills/gws-slides/SKILL.md) | Google Slides: Read and write presentations. |
| [gws-tasks](../skills/gws-tasks/SKILL.md) | Google Tasks: Manage task lists and tasks. |
| [gws-people](../skills/gws-people/SKILL.md) | Google People: Manage contacts and profiles. |
| [gws-chat](../skills/gws-chat/SKILL.md) | Google Chat: Manage Chat spaces and messages. |
| [gws-classroom](../skills/gws-classroom/SKILL.md) | Google Classroom: Manage classes, rosters, and coursework. |
| [gws-forms](../skills/gws-forms/SKILL.md) | Read and write Google Forms. |
| [gws-keep](../skills/gws-keep/SKILL.md) | Manage Google Keep notes. |
| [gws-meet](../skills/gws-meet/SKILL.md) | Manage Google Meet conferences. |
| [gws-events](../skills/gws-events/SKILL.md) | Subscribe to Google Workspace events. |
| [gws-modelarmor](../skills/gws-modelarmor/SKILL.md) | Google Model Armor: Filter user-generated content for safety. |
| [gws-workflow](../skills/gws-workflow/SKILL.md) | Google Workflow: Cross-service productivity workflows. |

## Helpers

Shortcut commands for common operations.

## Services (Reference)

Core Google Workspace API technical references.

| Skill | Description |
|-------|-------------|
| [gws-drive](../skills/references/gws-drive/SKILL.md) | Google Drive: Manage files, folders, and shared drives. |
| [gws-sheets](../skills/references/gws-sheets/SKILL.md) | Google Sheets: Read and write spreadsheets. |
| [gws-gmail](../skills/references/gws-gmail/SKILL.md) | Gmail: Send, read, and manage email. |
| [gws-calendar](../skills/references/gws-calendar/SKILL.md) | Google Calendar: Manage calendars and events. |
| [gws-admin-reports](../skills/references/gws-admin-reports/SKILL.md) | Google Workspace Admin SDK: Audit logs and usage reports. |
| [gws-docs](../skills/references/gws-docs/SKILL.md) | Read and write Google Docs. |
| [gws-slides](../skills/references/gws-slides/SKILL.md) | Google Slides: Read and write presentations. |
| [gws-tasks](../skills/references/gws-tasks/SKILL.md) | Google Tasks: Manage task lists and tasks. |
| [gws-people](../skills/references/gws-people/SKILL.md) | Google People: Manage contacts and profiles. |
| [gws-chat](../skills/references/gws-chat/SKILL.md) | Google Chat: Manage Chat spaces and messages. |
| [gws-classroom](../skills/references/gws-classroom/SKILL.md) | Google Classroom: Manage classes, rosters, and coursework. |
| [gws-forms](../skills/references/gws-forms/SKILL.md) | Read and write Google Forms. |
| [gws-keep](../skills/references/gws-keep/SKILL.md) | Manage Google Keep notes. |
| [gws-meet](../skills/references/gws-meet/SKILL.md) | Manage Google Meet conferences. |
| [gws-events](../skills/references/gws-events/SKILL.md) | Subscribe to Google Workspace events. |
| [gws-modelarmor](../skills/references/gws-modelarmor/SKILL.md) | Google Model Armor: Filter user-generated content for safety. |
| [gws-workflow](../skills/references/gws-workflow/SKILL.md) | Google Workflow: Cross-service productivity workflows. |

## Helpers (Reference)

Technical references for shortcut commands.

| Skill | Description |
|-------|-------------|
| [gws-drive-upload](../skills/gws-drive-upload/SKILL.md) | Google Drive: Upload a file with automatic metadata. |
| [gws-sheets-append](../skills/gws-sheets-append/SKILL.md) | Google Sheets: Append a row to a spreadsheet. |
| [gws-sheets-read](../skills/gws-sheets-read/SKILL.md) | Google Sheets: Read values from a spreadsheet. |
| [gws-gmail-send](../skills/gws-gmail-send/SKILL.md) | Gmail: Send an email. |
| [gws-gmail-triage](../skills/gws-gmail-triage/SKILL.md) | Gmail: Show unread inbox summary (sender, subject, date). |
| [gws-gmail-reply](../skills/gws-gmail-reply/SKILL.md) | Gmail: Reply to a message (handles threading automatically). |
| [gws-gmail-reply-all](../skills/gws-gmail-reply-all/SKILL.md) | Gmail: Reply-all to a message (handles threading automatically). |
| [gws-gmail-forward](../skills/gws-gmail-forward/SKILL.md) | Gmail: Forward a message to new recipients. |
| [gws-gmail-watch](../skills/gws-gmail-watch/SKILL.md) | Gmail: Watch for new emails and stream them as NDJSON. |
| [gws-calendar-insert](../skills/gws-calendar-insert/SKILL.md) | Google Calendar: Create a new event. |
| [gws-calendar-agenda](../skills/gws-calendar-agenda/SKILL.md) | Google Calendar: Show upcoming events across all calendars. |
| [gws-docs-write](../skills/gws-docs-write/SKILL.md) | Google Docs: Append text to a document. |
| [gws-chat-send](../skills/gws-chat-send/SKILL.md) | Google Chat: Send a message to a space. |
| [gws-events-subscribe](../skills/gws-events-subscribe/SKILL.md) | Google Workspace Events: Subscribe to Workspace events and stream them as NDJSON. |
| [gws-events-renew](../skills/gws-events-renew/SKILL.md) | Google Workspace Events: Renew/reactivate Workspace Events subscriptions. |
| [gws-modelarmor-sanitize-prompt](../skills/gws-modelarmor-sanitize-prompt/SKILL.md) | Google Model Armor: Sanitize a user prompt through a Model Armor template. |
| [gws-modelarmor-sanitize-response](../skills/gws-modelarmor-sanitize-response/SKILL.md) | Google Model Armor: Sanitize a model response through a Model Armor template. |
| [gws-modelarmor-create-template](../skills/gws-modelarmor-create-template/SKILL.md) | Google Model Armor: Create a new Model Armor template. |
| [gws-workflow-standup-report](../skills/gws-workflow-standup-report/SKILL.md) | Google Workflow: Today's meetings + open tasks as a standup summary. |
| [gws-workflow-meeting-prep](../skills/gws-workflow-meeting-prep/SKILL.md) | Google Workflow: Prepare for your next meeting: agenda, attendees, and linked docs. |
| [gws-workflow-email-to-task](../skills/gws-workflow-email-to-task/SKILL.md) | Google Workflow: Convert a Gmail message into a Google Tasks entry. |
| [gws-workflow-weekly-digest](../skills/gws-workflow-weekly-digest/SKILL.md) | Google Workflow: Weekly summary: this week's meetings + unread email count. |
| [gws-workflow-file-announce](../skills/gws-workflow-file-announce/SKILL.md) | Google Workflow: Announce a Drive file in a Chat space. |
| [gws-drive-upload](../skills/references/gws-drive-upload/SKILL.md) | Google Drive: Upload a file with automatic metadata. |
| [gws-sheets-append](../skills/references/gws-sheets-append/SKILL.md) | Google Sheets: Append a row to a spreadsheet. |
| [gws-sheets-read](../skills/references/gws-sheets-read/SKILL.md) | Google Sheets: Read values from a spreadsheet. |
| [gws-gmail-send](../skills/references/gws-gmail-send/SKILL.md) | Gmail: Send an email. |
| [gws-gmail-triage](../skills/references/gws-gmail-triage/SKILL.md) | Gmail: Show unread inbox summary (sender, subject, date). |
| [gws-gmail-reply](../skills/references/gws-gmail-reply/SKILL.md) | Gmail: Reply to a message (handles threading automatically). |
| [gws-gmail-reply-all](../skills/references/gws-gmail-reply-all/SKILL.md) | Gmail: Reply-all to a message (handles threading automatically). |
| [gws-gmail-forward](../skills/references/gws-gmail-forward/SKILL.md) | Gmail: Forward a message to new recipients. |
| [gws-gmail-watch](../skills/references/gws-gmail-watch/SKILL.md) | Gmail: Watch for new emails and stream them as NDJSON. |
| [gws-calendar-insert](../skills/references/gws-calendar-insert/SKILL.md) | Google Calendar: Create a new event. |
| [gws-calendar-agenda](../skills/references/gws-calendar-agenda/SKILL.md) | Google Calendar: Show upcoming events across all calendars. |
| [gws-docs-write](../skills/references/gws-docs-write/SKILL.md) | Google Docs: Append text to a document. |
| [gws-chat-send](../skills/references/gws-chat-send/SKILL.md) | Google Chat: Send a message to a space. |
| [gws-events-subscribe](../skills/references/gws-events-subscribe/SKILL.md) | Google Workspace Events: Subscribe to Workspace events and stream them as NDJSON. |
| [gws-events-renew](../skills/references/gws-events-renew/SKILL.md) | Google Workspace Events: Renew/reactivate Workspace Events subscriptions. |
| [gws-modelarmor-sanitize-prompt](../skills/references/gws-modelarmor-sanitize-prompt/SKILL.md) | Google Model Armor: Sanitize a user prompt through a Model Armor template. |
| [gws-modelarmor-sanitize-response](../skills/references/gws-modelarmor-sanitize-response/SKILL.md) | Google Model Armor: Sanitize a model response through a Model Armor template. |
| [gws-modelarmor-create-template](../skills/references/gws-modelarmor-create-template/SKILL.md) | Google Model Armor: Create a new Model Armor template. |
| [gws-workflow-standup-report](../skills/references/gws-workflow-standup-report/SKILL.md) | Google Workflow: Today's meetings + open tasks as a standup summary. |
| [gws-workflow-meeting-prep](../skills/references/gws-workflow-meeting-prep/SKILL.md) | Google Workflow: Prepare for your next meeting: agenda, attendees, and linked docs. |
| [gws-workflow-email-to-task](../skills/references/gws-workflow-email-to-task/SKILL.md) | Google Workflow: Convert a Gmail message into a Google Tasks entry. |
| [gws-workflow-weekly-digest](../skills/references/gws-workflow-weekly-digest/SKILL.md) | Google Workflow: Weekly summary: this week's meetings + unread email count. |
| [gws-workflow-file-announce](../skills/references/gws-workflow-file-announce/SKILL.md) | Google Workflow: Announce a Drive file in a Chat space. |

## Personas

Expand Down
9 changes: 9 additions & 0 deletions skills/gws-shared/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,15 @@ metadata:

# gws — Shared Reference

## Discovery & Search

With 40+ API services and hundreds of methods, use the search command to find the right tool for a task:

```bash
gws skills search "send email"
gws skills search "upload file"
```

## Installation

The `gws` binary must be on `$PATH`. See the project README for install options.
Expand Down
4 changes: 2 additions & 2 deletions skills/persona-content-creator/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ metadata:
category: "persona"
requires:
bins: ["gws"]
skills: ["gws-docs", "gws-drive", "gws-gmail", "gws-chat", "gws-slides"]
skills: ["references/gws-docs", "references/gws-drive", "references/gws-gmail", "references/gws-chat", "references/gws-slides"]
---

# Content Creator

> **PREREQUISITE:** Load the following utility skills to operate as this persona: `gws-docs`, `gws-drive`, `gws-gmail`, `gws-chat`, `gws-slides`
> **PREREQUISITE:** Load the following utility skills to operate as this persona: `references/gws-docs`, `references/gws-drive`, `references/gws-gmail`, `references/gws-chat`, `references/gws-slides`

Create, organize, and distribute content across Workspace.

Expand Down
4 changes: 2 additions & 2 deletions skills/persona-customer-support/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ metadata:
category: "persona"
requires:
bins: ["gws"]
skills: ["gws-gmail", "gws-sheets", "gws-chat", "gws-calendar"]
skills: ["references/gws-gmail", "references/gws-sheets", "references/gws-chat", "references/gws-calendar"]
---

# Customer Support Agent

> **PREREQUISITE:** Load the following utility skills to operate as this persona: `gws-gmail`, `gws-sheets`, `gws-chat`, `gws-calendar`
> **PREREQUISITE:** Load the following utility skills to operate as this persona: `references/gws-gmail`, `references/gws-sheets`, `references/gws-chat`, `references/gws-calendar`

Manage customer support — track tickets, respond, escalate issues.

Expand Down
4 changes: 2 additions & 2 deletions skills/persona-event-coordinator/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ metadata:
category: "persona"
requires:
bins: ["gws"]
skills: ["gws-calendar", "gws-gmail", "gws-drive", "gws-chat", "gws-sheets"]
skills: ["references/gws-calendar", "references/gws-gmail", "references/gws-drive", "references/gws-chat", "references/gws-sheets"]
---

# Event Coordinator

> **PREREQUISITE:** Load the following utility skills to operate as this persona: `gws-calendar`, `gws-gmail`, `gws-drive`, `gws-chat`, `gws-sheets`
> **PREREQUISITE:** Load the following utility skills to operate as this persona: `references/gws-calendar`, `references/gws-gmail`, `references/gws-drive`, `references/gws-chat`, `references/gws-sheets`

Plan and manage events — scheduling, invitations, and logistics.

Expand Down
4 changes: 2 additions & 2 deletions skills/persona-exec-assistant/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ metadata:
category: "persona"
requires:
bins: ["gws"]
skills: ["gws-gmail", "gws-calendar", "gws-drive", "gws-chat"]
skills: ["references/gws-gmail", "references/gws-calendar", "references/gws-drive", "references/gws-chat"]
---

# Executive Assistant

> **PREREQUISITE:** Load the following utility skills to operate as this persona: `gws-gmail`, `gws-calendar`, `gws-drive`, `gws-chat`
> **PREREQUISITE:** Load the following utility skills to operate as this persona: `references/gws-gmail`, `references/gws-calendar`, `references/gws-drive`, `references/gws-chat`

Manage an executive's schedule, inbox, and communications.

Expand Down
4 changes: 2 additions & 2 deletions skills/persona-hr-coordinator/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ metadata:
category: "persona"
requires:
bins: ["gws"]
skills: ["gws-gmail", "gws-calendar", "gws-drive", "gws-chat"]
skills: ["references/gws-gmail", "references/gws-calendar", "references/gws-drive", "references/gws-chat"]
---

# HR Coordinator

> **PREREQUISITE:** Load the following utility skills to operate as this persona: `gws-gmail`, `gws-calendar`, `gws-drive`, `gws-chat`
> **PREREQUISITE:** Load the following utility skills to operate as this persona: `references/gws-gmail`, `references/gws-calendar`, `references/gws-drive`, `references/gws-chat`

Handle HR workflows — onboarding, announcements, and employee comms.

Expand Down
4 changes: 2 additions & 2 deletions skills/persona-it-admin/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ metadata:
category: "persona"
requires:
bins: ["gws"]
skills: ["gws-gmail", "gws-drive", "gws-calendar"]
skills: ["references/gws-gmail", "references/gws-drive", "references/gws-calendar"]
---

# IT Administrator

> **PREREQUISITE:** Load the following utility skills to operate as this persona: `gws-gmail`, `gws-drive`, `gws-calendar`
> **PREREQUISITE:** Load the following utility skills to operate as this persona: `references/gws-gmail`, `references/gws-drive`, `references/gws-calendar`

Administer IT — monitor security and configure Workspace.

Expand Down
4 changes: 2 additions & 2 deletions skills/persona-project-manager/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ metadata:
category: "persona"
requires:
bins: ["gws"]
skills: ["gws-drive", "gws-sheets", "gws-calendar", "gws-gmail", "gws-chat"]
skills: ["references/gws-drive", "references/gws-sheets", "references/gws-calendar", "references/gws-gmail", "references/gws-chat"]
---

# Project Manager

> **PREREQUISITE:** Load the following utility skills to operate as this persona: `gws-drive`, `gws-sheets`, `gws-calendar`, `gws-gmail`, `gws-chat`
> **PREREQUISITE:** Load the following utility skills to operate as this persona: `references/gws-drive`, `references/gws-sheets`, `references/gws-calendar`, `references/gws-gmail`, `references/gws-chat`

Coordinate projects — track tasks, schedule meetings, and share docs.

Expand Down
4 changes: 2 additions & 2 deletions skills/persona-researcher/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ metadata:
category: "persona"
requires:
bins: ["gws"]
skills: ["gws-drive", "gws-docs", "gws-sheets", "gws-gmail"]
skills: ["references/gws-drive", "references/gws-docs", "references/gws-sheets", "references/gws-gmail"]
---

# Researcher

> **PREREQUISITE:** Load the following utility skills to operate as this persona: `gws-drive`, `gws-docs`, `gws-sheets`, `gws-gmail`
> **PREREQUISITE:** Load the following utility skills to operate as this persona: `references/gws-drive`, `references/gws-docs`, `references/gws-sheets`, `references/gws-gmail`

Organize research — manage references, notes, and collaboration.

Expand Down
4 changes: 2 additions & 2 deletions skills/persona-sales-ops/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ metadata:
category: "persona"
requires:
bins: ["gws"]
skills: ["gws-gmail", "gws-calendar", "gws-sheets", "gws-drive"]
skills: ["references/gws-gmail", "references/gws-calendar", "references/gws-sheets", "references/gws-drive"]
---

# Sales Operations

> **PREREQUISITE:** Load the following utility skills to operate as this persona: `gws-gmail`, `gws-calendar`, `gws-sheets`, `gws-drive`
> **PREREQUISITE:** Load the following utility skills to operate as this persona: `references/gws-gmail`, `references/gws-calendar`, `references/gws-sheets`, `references/gws-drive`

Manage sales workflows — track deals, schedule calls, client comms.

Expand Down
4 changes: 2 additions & 2 deletions skills/persona-team-lead/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ metadata:
category: "persona"
requires:
bins: ["gws"]
skills: ["gws-calendar", "gws-gmail", "gws-chat", "gws-drive", "gws-sheets"]
skills: ["references/gws-calendar", "references/gws-gmail", "references/gws-chat", "references/gws-drive", "references/gws-sheets"]
---

# Team Lead

> **PREREQUISITE:** Load the following utility skills to operate as this persona: `gws-calendar`, `gws-gmail`, `gws-chat`, `gws-drive`, `gws-sheets`
> **PREREQUISITE:** Load the following utility skills to operate as this persona: `references/gws-calendar`, `references/gws-gmail`, `references/gws-chat`, `references/gws-drive`, `references/gws-sheets`

Lead a team — run standups, coordinate tasks, and communicate.

Expand Down
Loading
Loading