Skip to content

Skills for Claude Code CLI such as full stack dev Cloudflare, React, Tailwind v4, and AI integrations.

feat(integrations): add gws-setup and gws-install skills

Jez8e3e65e6fe74
diff --git a/CLAUDE.md b/CLAUDE.md
index 6dc8ca68..ea6f68ae 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -38,8 +38,10 @@ claude-skills/
│ │ ├── favicon-gen/
│ │ ├── icon-set-generator/
│ │ └── image-processing/
-│ ├── integrations/ # Google, ElevenLabs, MCP
+│ ├── integrations/ # Google Workspace, ElevenLabs, MCP
│ │ └── skills/
+│ │ ├── gws-setup/
+│ │ ├── gws-install/
│ │ ├── google-chat-messages/
│ │ ├── google-apps-script/
│ │ ├── elevenlabs-agents/
@@ -65,9 +67,16 @@ claude-skills/
│ │ ├── wordpress-setup/
│ │ ├── wordpress-content/
│ │ └── wordpress-elementor/
-│ └── writing/ # Australian business English
+│ └── writing/ # Business English + professional documents
│ └── skills/
-│ └── aussie-business-english/
+│ ├── aussie-business-english/
+│ ├── us-business-english/
+│ ├── uk-business-english/
+│ ├── nz-business-english/
+│ ├── resume-cover-letter/
+│ ├── proposal-writer/
+│ ├── award-application/
+│ └── strategy-document/
├── .claude-plugin/ # Marketplace + plugin config
│ ├── marketplace.json
│ └── plugin.json
diff --git a/plugins/integrations/.claude-plugin/plugin.json b/plugins/integrations/.claude-plugin/plugin.json
index 6b07f053..ef25464e 100644
--- a/plugins/integrations/.claude-plugin/plugin.json
+++ b/plugins/integrations/.claude-plugin/plugin.json
@@ -1,6 +1,6 @@
{
"name": "integrations",
- "description": "Google Chat webhooks, Google Apps Script automation, ElevenLabs voice agents, and MCP server building.",
+ "description": "Google Workspace CLI setup, Google Chat webhooks, Google Apps Script automation, ElevenLabs voice agents, and MCP server building.",
"author": {
"name": "Jeremy Dawes / Jezweb",
"email": "[email protected]"
diff --git a/plugins/integrations/skills/gws-install/SKILL.md b/plugins/integrations/skills/gws-install/SKILL.md
new file mode 100644
index 00000000..ed51b70f
--- /dev/null
+++ b/plugins/integrations/skills/gws-install/SKILL.md
@@ -0,0 +1,141 @@
+---
+name: gws-install
+description: >
+ Quick install of the Google Workspace CLI (gws) on an additional machine using existing
+ OAuth credentials. Requires client_secret.json from a previous gws-setup.
+ Use when setting up gws on a new computer, reinstalling after a fresh OS, or
+ configuring a second workstation. Triggers: "install gws", "gws on new machine",
+ "gws install", "set up gws again".
+compatibility: claude-code-only
+---
+
+# Google Workspace CLI — Quick Install
+
+Install `gws` on an additional machine using OAuth credentials from a previous setup. Produces an authenticated CLI with all agent skills ready to use.
+
+**Prerequisite**: The user must have `client_secret.json` from a previous `gws-setup` (or from Google Cloud Console). If they don't have it, use the `gws-setup` skill instead.
+
+## Workflow
+
+### Step 1: Pre-flight Checks
+
+```bash
+which gws && gws --version
+ls ~/.config/gws/client_secret.json
+gws auth status
+```
+
+If already authenticated with the right scopes, skip to Step 4.
+
+### Step 2: Install the CLI
+
+```bash
+npm install -g @googleworkspace/cli
+gws --version
+```
+
+### Step 3: Set Up Credentials
+
+Ask the user to provide their `client_secret.json`. Three options:
+
+**Option A — Paste the JSON content:**
+
+Ask the user to paste the JSON. Write it to `~/.config/gws/client_secret.json`:
+
+```bash
+mkdir -p ~/.config/gws
+```
+
+Expected format:
+
+```json
+{
+ "installed": {
+ "client_id": "...",
+ "project_id": "...",
+ "auth_uri": "https://accounts.google.com/o/oauth2/auth",
+ "token_uri": "https://oauth2.googleapis.com/token",
+ "client_secret": "...",
+ "redirect_uris": ["http://localhost"]
+ }
+}
+```
+
+**Option B — File path:**
+
+If the user has the file locally (e.g. in Downloads):
+
+```bash
+mkdir -p ~/.config/gws
+cp /path/to/client_secret.json ~/.config/gws/client_secret.json
+```
+
+**Option C — Environment variables:**
+
+```bash
+export GOOGLE_WORKSPACE_CLI_CLIENT_ID="your-client-id"
+export GOOGLE_WORKSPACE_CLI_CLIENT_SECRET="your-client-secret"
+```
+
+### Step 4: Authenticate
+
+Ask which Google account to use, then run:
+
+```bash
+gws auth login --full
+```
+
+Or with specific services to match the original setup:
+
+```bash
+gws auth login -s gmail,drive,calendar,sheets,docs,chat,tasks
+```
+
+The user can check their original machine's scopes with `gws auth status` to see what was granted.
+
+After browser approval, verify:
+
+```bash
+gws auth status
+```
+
+### Step 5: Install Agent Skills
+
+```bash
+npx skills add googleworkspace/cli -g --agent claude-code --all
+```
+
+This installs 90+ skills into `~/.claude/skills/`. Safe to re-run if skills are already installed.
+
+### Step 6: Verify
+
+```bash
+gws auth status
+gws calendar +agenda --today
+gws gmail +triage
+```
+
+---
+
+## Troubleshooting
+
+### "Auth error — credentials missing or invalid" (exit code 2)
+
+- Check `~/.config/gws/client_secret.json` exists and has valid JSON
+- Re-run `gws auth login`
+
+### Token expired
+
+- If the GCP app is in "Testing" status, tokens expire after 7 days
+- Re-run `gws auth login` to refresh
+- For permanent tokens, push the app to Production in GCP Console OAuth consent screen
+
+### Skills not appearing in Claude Code
+
+- Skills load at session start — restart Claude Code after installing
+- Verify: `ls ~/.claude/skills/gws-* | wc -l` should show 30+ directories
+
+## See Also
+
+- [gws-setup](../gws-setup/SKILL.md) — First-time setup including GCP project creation
+- [gws-shared](~/.claude/skills/gws-shared/SKILL.md) — Auth patterns and global flags
diff --git a/plugins/integrations/skills/gws-setup/SKILL.md b/plugins/integrations/skills/gws-setup/SKILL.md
new file mode 100644
index 00000000..bdac1000
--- /dev/null
+++ b/plugins/integrations/skills/gws-setup/SKILL.md
@@ -0,0 +1,251 @@
+---
+name: gws-setup
+description: >
+ Set up the Google Workspace CLI (gws) from scratch. Guides through GCP project creation,
+ OAuth credentials, authentication, and installing 90+ agent skills for Claude Code.
+ Use when setting up gws for the first time, configuring Google Workspace API access,
+ or troubleshooting gws auth issues. Triggers: "set up gws", "google workspace cli",
+ "gws setup", "install gws".
+compatibility: claude-code-only
+---
+
+# Google Workspace CLI — First-Time Setup
+
+Set up the `gws` CLI (@googleworkspace/cli) with OAuth credentials and 90+ agent skills for Claude Code. Produces a fully authenticated CLI with skills for Gmail, Drive, Calendar, Sheets, Docs, Chat, Tasks, and more.
+
+## Prerequisites
+
+- Node.js 18+
+- A Google account (personal or Workspace)
+- Access to Google Cloud Console (console.cloud.google.com)
+
+## Workflow
+
+### Step 1: Pre-flight Checks
+
+Check what's already done and skip completed steps:
+
+```bash
+# Check if gws is installed
+which gws && gws --version
+
+# Check if client_secret.json exists
+ls ~/.config/gws/client_secret.json
+
+# Check if already authenticated
+gws auth status
+```
+
+If `gws auth status` shows `"status": "success"` with scopes, skip to Step 6 (Install Skills).
+
+### Step 2: Install the CLI
+
+```bash
+npm install -g @googleworkspace/cli
+gws --version
+```
+
+### Step 3: Create a GCP Project and OAuth Credentials
+
+The user needs to create OAuth Desktop App credentials in Google Cloud Console. Walk them through each step.
+
+**3a. Create or select a GCP project:**
+
+Direct the user to: `https://console.cloud.google.com/projectcreate`
+
+Or use an existing project. Ask the user which they prefer.
+
+**3b. Enable Google Workspace APIs:**
+
+Direct the user to the API Library for their project: `https://console.cloud.google.com/apis/library?project=PROJECT_ID`
+
+Enable these APIs (search for each):
+- Gmail API
+- Google Drive API
+- Google Calendar API
+- Google Sheets API
+- Google Docs API
+- Google Chat API
+- Tasks API
+- People API
+- Google Slides API
+- Google Forms API
+- Admin SDK API (optional — for Workspace admin features)
+
+**3c. Configure OAuth consent screen:**
+
+Direct the user to: `https://console.cloud.google.com/apis/credentials/consent?project=PROJECT_ID`
+
+Settings:
+- User Type: **External** (works for any Google account)
+- App name: `gws CLI` (or any name)
+- User support email: their email
+- Developer contact: their email
+- Leave scopes blank (gws requests scopes at login time)
+- Add their Google account as a test user (required while app is in "Testing" status)
+- Save and continue through all screens
+
+**3d. Create OAuth client ID:**
+
+Direct the user to: `https://console.cloud.google.com/apis/credentials?project=PROJECT_ID`
+
+1. Click **Create Credentials** → **OAuth client ID**
+2. Application type: **Desktop app**
+3. Name: `gws CLI`
+4. Click **Create**
+5. Copy the JSON or download the `client_secret_*.json` file
+
+**3e. Save the credentials:**
+
+Ask the user to provide the client_secret.json content (paste the JSON or provide the downloaded file path).
+
+```bash
+mkdir -p ~/.config/gws
+```
+
+Write the JSON to `~/.config/gws/client_secret.json`. The expected format:
+
+```json
+{
+ "installed": {
+ "client_id": "...",
+ "project_id": "...",
+ "auth_uri": "https://accounts.google.com/o/oauth2/auth",
+ "token_uri": "https://oauth2.googleapis.com/token",
+ "client_secret": "...",
+ "redirect_uris": ["http://localhost"]
+ }
+}
+```
+
+### Step 4: Choose Scopes
+
+Ask the user what level of access they want:
+
+| Option | Command | What it grants |
+|--------|---------|----------------|
+| **Full access** (recommended) | `gws auth login --full` | All Workspace scopes including admin, pubsub, cloud-platform |
+| **Core services** | `gws auth login -s gmail,drive,calendar,sheets,docs,chat,tasks` | Most-used services only |
+| **Minimal** | `gws auth login -s gmail,calendar` | Just email and calendar |
+
+Recommend **full access** for power users. The OAuth consent screen shows all requested scopes so the user can review before granting.
+
+> **Note**: If the GCP app is in "Testing" status, scope selection is limited to ~25 scopes. Use `-s service1,service2` to request targeted scopes, or publish the app (Publish → In Production) for broader scope access.
+
+### Step 5: Authenticate
+
+Run the login command. This opens a browser — the user signs in with their chosen Google account and approves the scopes.
+
+```bash
+gws auth login --full
+# Or with specific services:
+gws auth login -s gmail,drive,calendar,sheets,docs,chat,tasks
+```
+
+After browser approval, gws stores encrypted credentials at `~/.config/gws/credentials.enc`.
+
+Verify:
+
+```bash
+gws auth status
+```
+
+Should show `"status": "success"` with the authenticated account and granted scopes.
+
+### Step 6: Install Agent Skills
+
+Install the 90+ gws agent skills globally for Claude Code:
+
+```bash
+npx skills add googleworkspace/cli -g --agent claude-code --all
+```
+
+Verify skills are installed:
+
+```bash
+ls ~/.claude/skills/gws-* | wc -l
+```
+
+Should show 30+ gws skill directories.
+
+### Step 7: Save Credentials for Other Machines
+
+If the user has other machines to set up, suggest exporting the client credentials:
+
+```bash
+gws auth export
+```
+
+This prints decrypted credentials (including refresh token) to stdout. The `client_secret.json` file is the portable part — the same OAuth client can be used on any machine, with `gws auth login` generating fresh user tokens per machine.
+
+Tell the user to save the `client_secret.json` content somewhere secure (password manager, encrypted note) for use with the `gws-install` skill on other machines.
+
+### Step 8: Verify Everything Works
+
+Run a few commands to confirm:
+
+```bash
+# Check auth
+gws auth status
+
+# Check calendar
+gws calendar +agenda --today
+
+# Check email
+gws gmail +triage
+```
+
+If any command fails with auth errors, re-run `gws auth login` with the needed scopes.
+
+---
+
+## Critical Patterns
+
+### Testing vs Production OAuth Apps
+
+GCP OAuth apps start in "Testing" status with a 7-day token expiry and ~25 scope limit. For long-term use:
+- Push the app to **Production** in the OAuth consent screen settings
+- Production apps have no token expiry limit
+- For personal/internal use, Google does not require verification
+
+### Scope Reference
+
+| Service flag | What it enables |
+|-------------|-----------------|
+| `gmail` | Send, read, manage email, labels, filters |
+| `drive` | Files, folders, shared drives |
+| `calendar` | Events, calendars, free/busy |
+| `sheets` | Read and write spreadsheets |
+| `docs` | Read and write documents |
+| `chat` | Spaces, messages |
+| `tasks` | Task lists and tasks |
+| `slides` | Presentations |
+| `forms` | Forms and responses |
+| `people` | Contacts and profiles |
+| `admin` | Workspace admin (directory, devices, groups) |
+
+### Environment Variable Alternative
+
+Instead of `client_secret.json`, credentials can be provided via environment variables:
+
+```bash
+export GOOGLE_WORKSPACE_CLI_CLIENT_ID="your-client-id"
+export GOOGLE_WORKSPACE_CLI_CLIENT_SECRET="your-client-secret"
+gws auth login
+```
+
+### Config Directory
+
+All gws config lives in `~/.config/gws/`:
+
+| File | Purpose |
+|------|---------|
+| `client_secret.json` | OAuth client credentials (portable) |
+| `credentials.enc` | Encrypted user tokens (per-machine) |
+| `token_cache.json` | Token refresh cache |
+| `cache/` | API discovery schema cache |
+
+## See Also
+
+- [gws-install](../gws-install/SKILL.md) — Quick setup on additional machines with existing credentials
+- [gws-shared](~/.claude/skills/gws-shared/SKILL.md) — Auth patterns and global flags for gws commands