yaas-gmail-reply

Send threaded Gmail replies with correct RFC 2822 headers via the gws CLI.

4|1|Updated Jul 22, 2026
One-click install
npx skills add https://github.com/circlefin/sidequestor --skill yaas-gmail-reply-circlefin
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: yaas-gmail-reply
Source: https://github.com/circlefin/sidequestor/tree/main/src/sidequestor/runtime/yaas-triage/skills/yaas-gmail-reply
Command: npx skills add https://github.com/circlefin/sidequestor --skill yaas-gmail-reply-circlefin

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? The gws CLI's messages.send command does not set In-Reply-To or References headers, so Gmail replies sent through it appear as new conversations instead of threading under the original message. This Skill fetches the original message metadata and builds a properly threaded RFC 2822 reply. ## Core Features & Use Cases - Threaded Replies: Fetches the original message's threadId, Message-ID, and References headers, then constructs In-Reply-To and References headers so the reply lands in the correct thread. - Header Sanitization: Strips CR/LF characters from inbound-derived header values to prevent header injection from crafted From or Message-ID fields. - Fresh Message Sending: Includes a companion script for sending new (non-reply) Gmail messages with a specified recipient, subject, and body file. - Use Case: An automated worker agent receives a quest to reply to a customer email; it invokes the script with the Gmail message ID and reply body, and the recipient sees the response threaded under their original email. ## Quick Start Reply to a Gmail message by running the gmail-reply.py script with the message ID and a --body argument containing your reply text.

Frequently Asked Questions about yaas-gmail-reply

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I send a threaded Gmail reply from the command line?▼

Run gmail-reply.py with the Gmail message ID and a --body argument, or pipe the body via stdin. The script fetches the original message's Message-ID and References headers, builds In-Reply-To and References headers, and sends through the gws CLI so the reply threads correctly.

Why do Gmail API replies show up as new conversations?▼

The Gmail API's messages.send does not automatically set In-Reply-To or References headers, so replies appear as new threads. You must fetch the original message metadata and explicitly include those headers plus the original threadId in the send request.

What environment variables does the Gmail reply script need?▼

The script uses GWS_BIN to locate the gws CLI (defaulting to gws on PATH) and SIDEQUESTOR_FROM_EMAIL for the sender address, falling back to YAAS_FROM_EMAIL. Without a sender address, the From header will be empty.

Can I send a new Gmail message instead of a reply?▼

Yes, use the send_fresh.py companion script with --to, --subject, and --body-file arguments. It builds a plain EmailMessage without threading headers and sends it via gws gmail users messages send.

Does the script protect against email header injection?▼

Yes, it strips carriage return and line feed characters from all header values derived from the inbound message, such as From, Message-ID, and References. This prevents a crafted original message from folding extra headers into the reply.