Add Gmail compose domain skill#428
Conversation
…, draft autosave Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
✅ Skill review passedReviewed 1 file(s) — no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 575b711491
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
|
||
| ## Account routing | ||
|
|
||
| Multi-account sessions: `https://mail.google.com/mail/u/<email>/` routes to that signed-in account directly — no clicking through the account switcher. Works with `#drafts`, `#sent`, etc. appended. First load sometimes lands on a "Temporary Error" page title that resolves itself; wait a beat and re-check `page_info()` before assuming failure. |
There was a problem hiding this comment.
Put Gmail skill where goto_url can discover it
When agents follow this documented Gmail URL, goto_url() will not surface the new skill: helpers.py:52 maps a hostname to domain-skills/<first-label> after stripping only www, so https://mail.google.com/... looks under domain-skills/mail, not domain-skills/gmail. In the normal navigation flow the returned domain_skills hint is therefore missing for Gmail, so this compose guidance is easy to miss unless the agent manually searches the repo; move it to the directory the loader uses or update the loader to alias mail.google.com to gmail.
Useful? React with 👍 / 👎.
|
|
||
| ```js | ||
| const p = window.trustedTypes.createPolicy('fill-' + Math.floor(Math.random()*1e6), {createHTML: s => s}); | ||
| const b = document.querySelector("div[aria-label='Message Body']"); |
There was a problem hiding this comment.
Scope body lookup to the active compose window
If Gmail already has another compose or reply editor open, this querySelector grabs the first message body in the document rather than the compose window opened for the current draft. Gmail supports multiple compose windows/minimized drafts, so following this snippet can overwrite and autosave the wrong draft; scope the lookup to the visible compose dialog/container you just opened before assigning innerHTML.
Useful? React with 👍 / 👎.
Adds
domain-skills/gmail/compose.mdcovering field-tested compose mechanics:/mail/u/<email>/account routing for multi-account sessions (+ transient "Temporary Error" on first load)[gh="cm"]compose button, To/Subject/Body fieldsoffsetParentnull) and restorerequire-trusted-types-forCSP blocksinsertHTML/innerHTML— documented thetrustedTypes.createPolicybypass (policy names are unrestricted) plus theInputEventdispatch required for autosave to register the change🤖 Generated with Claude Code
Summary by cubic
Adds a new Gmail compose domain skill documenting a stable, end-to-end flow for opening, filling, and saving drafts, including a Trusted Types-safe HTML insert. This reduces flakiness by using robust selectors and covers autosave nuances.
trustedTypes.createPolicyandInputEventdispatch so autosave registers content.Written for commit 575b711. Summary will update on new commits.