Mulla759/GWSforDummies / .claude/skills/gws-gmail-users-settings-filters-create
gws-gmail-users-settings-filters-create
VerifiedGmail: Create a server-side message filter (rule) that auto-labels matching mail.
gmail users settings filters create
Create a persistent server-side filter. Gmail applies it automatically to matching future mail (and offers to apply to existing matches in the UI). A mailbox can hold at most 1,000 filters.
⚠️ Filters are persistent and silent. Validate with
--dry-runfirst, and prefer label-only actions (addLabelIds) — never auto-archive (removeLabelIds: ["INBOX"]), delete (["TRASH"]), or mark read without explicit user intent.
Usage
gws gmail users settings filters create --params '<JSON_PARAMS>' --json '<JSON_BODY>'
Parameters (--params JSON)
| Parameter | Required | Description |
|---|---|---|
userId | ✓ | The user's email address or "me" for the authenticated user |
Request Body (--json JSON)
{
"criteria": { "from": "notifications@github.com" },
"action": { "addLabelIds": ["Label_42"] }
}
criteria fields (match conditions — combine with AND)
| Field | Type | Description |
|---|---|---|
from | String | Sender. Supports *@domain.com and domain.com. |
to | String | Recipient. |
subject | String | Subject contains. |
query | String | Any Gmail search query (e.g. "list:newsletters"). |
negatedQuery | String | Gmail search query that must NOT match. |
hasAttachment | Boolean | Only messages with attachments. |
action fields
| Field | Type | Description |
|---|---|---|
addLabelIds | [String] | Label IDs (not names) to apply. Use labels list. |
removeLabelIds | [String] | Label IDs to remove. Avoid for auto-curation. |
forward | String | Forwarding address. Do not use for auto-curation. |
Examples
# Validate locally first — does not call the API
gws gmail users settings filters create --params '{"userId": "me"}' \
--json '{"criteria": {"from": "notifications@github.com"}, "action": {"addLabelIds": ["Label_42"]}}' --dry-run
# Create the filter
gws gmail users settings filters create --params '{"userId": "me"}' \
--json '{"criteria": {"from": "notifications@github.com"}, "action": {"addLabelIds": ["Label_42"]}}'
Tips
addLabelIdstakes label IDs, not display names. Resolve them withgws gmail users labels listand match on thenamefield.- A sender filter generalizes; key it on the most specific stable criterion (an exact
from, or*@domain.comonly when the whole domain is consistent).
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack." | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |