FYJ Founder Bot

Founder ViewAgent View

Storage · /home/box/agents/fyj-founder-bot/directory/hashing-and-legal-tech-valuation/sources/gemini-share-archive.skill.md

/home/box/agents/fyj-founder-bot/directory/hashing-and-legal-tech-valuation/sources/gemini-share-archive.skill.md

30 Aug 2026 12:48 London · 10499 bytes · readable HTML from the file


name: gemini-share-archive
description: >
Export a public Gemini share (share.gemini.google or gemini.google.com/share)
into one complete, typeset Markdown file with every turn, attachment, tool
query, timestamp, and ID. Use when the user pastes a Gemini share URL, asks
to archive / export / transcribe a Gemini chat, or wants an MD file of a
Gemini conversation. Triggers on "gemini share", "share.gemini.google",
"gemini.google.com/share", "export this chat", "archive this conversation",
"turn this Gemini chat into markdown".
when-to-use: gemini share, export gemini chat, archive gemini conversation, share.gemini.google, markdown from gemini
argument-hint: "[Gemini share URL]"
user-invocable: true
disable-model-invocation: false
metadata:
author: "Janhavi Ravi Iyengar"
short-description: "Archive a public Gemini share as a complete Markdown file"


Gemini share → complete Markdown archive

Turn a public Gemini share link into one faithful Markdown file. Nothing in
the thread is summarised or omitted. User text is verbatim (including spelling).
Gemini replies keep their original Markdown.

Worked example from this project: public/hashing-and-legal-tech-valuation.md.

Read on demand:

1. When to use

Do not use for ChatGPT, Claude, Grok, or Gemini chats the user has not shared publicly.

2. Required inputs and access

Input Required Notes
Share URL yes Short or canonical
Login no Public shares render without a Google account
Video/image binaries no Metadata always; binary only if the share still hosts it

If the page is a sign-in wall with no conversation after JS load, stop and say the link is private or expired.

3. Sequence of work

3.1 Resolve the URL

  1. GET the short URL with a normal browser UA. It 301s to
    https://gemini.google.com/share/{shareId}?skid={uuid}.
  2. Record both the short URL and the canonical URL. Alternate short URLs
    (shown in the share header) often resolve to the same shareId.

Curl of the HTML is not enough. The document is a signed-out SPA; conversation
text is not in og:description.

3.2 Load with a real browser and capture ujx1Bf

Use Playwright (or equivalent) against the canonical share URL.

  1. Intercept POST responses to /_/BardChatUi/data/batchexecute.
  2. Keep the body whose query has rpcids=ujx1Bf. That RPC is the conversation.
  3. Wait until the page title is the chat title (not only “Gemini”) or until
    ujx1Bf has returned, then ~8s of settle time.
  4. Screenshot the share for QA; save innerText as a fallback transcript.

Other rpcids (otAQ7b, sJBwce, Te6DCf, …) are chrome, not the thread.

3.3 Parse the payload

The response body starts with )]}'. Find the line that is a JSON array whose
first element is ["wrb.fr","ujx1Bf", "<payload-string>", …].

import json
arr = json.loads(payload_line)
data = json.loads(arr[0][2])   # the inner conversation tree

Map fields from references/payload-schema.md.
For every turn, take:

3.4 Recover media

3.5 Write the Markdown file

Follow references/markdown-contract.md
exactly. Minimum sections: document control, contents, timeline, attached
media, full conversation, tools/search queries, technical identifiers,
thread status, provenance.

Timestamps: store UTC from the unix seconds and the user’s local zone
when known. Also keep the “Created with Pro / Published” labels from the
share page if they differ.

3.6 Deliver

4. How to validate

5. What to return

  1. The Markdown file (primary artifact).
  2. A short note of what was captured: title, turn count, model, media gaps
    (e.g. “MP4 listed but not recoverable”).
  3. The source URLs.

Do not dump the raw ujx1Bf JSON to the user unless they ask.

6. What requires approval


ujx1Bf conversation payload

After json.loads(arr[0][2]) the tree is:

data[0]                    conversation envelope
  [1]                      turns[]  (oldest first)
  [2][1]                   title (string)
  [2][7]                   [?, modelFingerprint, modelLabel]  e.g. [2, "e6fa…", "Pro"]
  [3]                      shareId  e.g. "eba53f5c0e60"
  [4]                      [publishedUnixSeconds, nanoRemainder]
  [6]                      share thumbnail URL (optional)
data[1]                    unused
data[2]                    unused

Each turn:

turn[0]                    [conversationId, requestId]
turn[1]                    parent pointer [conversationId, prevRequestId, prevResponseId] or null
turn[2][0][0]              user message (full string)
turn[2][0][4]              attachments
                           video example:
                           [[null, null, null, [[null, 2, "file.mp4", null,
                             [3, "generic", "Invalid file ID"], null, null, null, 1,
                             [uploadUnix, nano], null, "video/mp4"]]]]
turn[3]                    model response
  [0][0][1][0]             Gemini reply as Markdown (canonical body — use this)
  [1]                      Google Search queries, e.g. [["Harvey AI valuation 2025 2026", 1], …]
                           or null
  [3]                      responseId  e.g. "rc_59809d1bbf8c0840"
  [4], [5]                 tool-use chrome (Google Search labels) or null
  [14] / [17]              model fingerprint (repeat of envelope)
turn[4]                    [messageUnixSeconds, nanoRemainder]

IDs to archive: conversation c_…, request r_…, response rc_…, share id,
model fingerprint, skid query param(s).

Unix seconds → UTC with datetime.utcfromtimestamp(seconds). Remainder is
nanoseconds; keep it in the identifiers table, not in the displayed clock.


Markdown archive contract

One file, UTF-8, GitHub-flavored Markdown. Filename: {slug-of-title}.md.

Required sections (in order)

  1. Title# {share title}
  2. Deck — one line: complete archive of a Gemini {model} conversation
  3. Integrity note — faithful export; user text verbatim; Gemini Markdown original
  4. Document control — table: title, short URL, alternate short URL (if any),
    canonical URL, share ID, conversation ID, model + fingerprint, participants,
    turn count, created/published labels from the share page, first/last message
    in UTC and in the user’s timezone when known, attached media summary, tools used
  5. Contents — linked TOC. Heading slugs: lowercase, non-alphanumerics → -,
    trim hyphens. Keep TOC links in sync with those slugs.
  6. Timeline — table of turn #, role, UTC, local, message ID
  7. Attached media — every file: name, MIME, upload time, share-API status,
    subject. Embed recovered images. State clearly when a binary is unrecoverable.
  8. Conversation — one ### Turn N — {short heading} per turn:
    - one-line italic blurb
    - #### User · {timestamp}
    - attachment callout if any
    - user body in a ```text fence (verbatim, trailing spaces stripped only
    at the fence edge)
    - #### Gemini {model} · response \{rc_…}`- tools callout if search/etc. ran - Gemini body as **raw Markdown**, not re-fenced, not rewritten ----` between turns
  9. Search queries / tools — table of query × turn; note if citation URLs
    were absent from the payload
  10. Technical identifiers — IDs + unix/nano timestamp table
  11. Status of the thread — last open question; whether thinking blocks,
    Canvas, generated images, or code cells existed
  12. Provenance — source links; “archive, not legal advice / not independent
    verification” if the thread cites market figures

Rules

Raw file
---
name: gemini-share-archive
description: >
  Export a public Gemini share (share.gemini.google or gemini.google.com/share)
  into one complete, typeset Markdown file with every turn, attachment, tool
  query, timestamp, and ID. Use when the user pastes a Gemini share URL, asks
  to archive / export / transcribe a Gemini chat, or wants an MD file of a
  Gemini conversation. Triggers on "gemini share", "share.gemini.google",
  "gemini.google.com/share", "export this chat", "archive this conversation",
  "turn this Gemini chat into markdown".
when-to-use: gemini share, export gemini chat, archive gemini conversation, share.gemini.google, markdown from gemini
argument-hint: "[Gemini share URL]"
user-invocable: true
disable-model-invocation: false
metadata:
  author: "Janhavi Ravi Iyengar"
  short-description: "Archive a public Gemini share as a complete Markdown file"
---

# Gemini share → complete Markdown archive

Turn a **public Gemini share link** into one faithful Markdown file. Nothing in
the thread is summarised or omitted. User text is verbatim (including spelling).
Gemini replies keep their original Markdown.

Worked example from this project: [public/hashing-and-legal-tech-valuation.md](../../../public/hashing-and-legal-tech-valuation.md).

Read on demand:

- [references/payload-schema.md](references/payload-schema.md) — `ujx1Bf` JSON map
- [references/markdown-contract.md](references/markdown-contract.md) — required sections

## 1. When to use

- User pastes `https://share.gemini.google/…` or `https://gemini.google.com/share/…`
- User asks to export / archive / dump a Gemini chat to Markdown
- User asks to “turn this chat into a file / skill / brief” and the source is a Gemini share

Do **not** use for ChatGPT, Claude, Grok, or Gemini chats the user has not shared publicly.

## 2. Required inputs and access

| Input | Required | Notes |
|---|---|---|
| Share URL | yes | Short or canonical |
| Login | no | Public shares render without a Google account |
| Video/image binaries | no | Metadata always; binary only if the share still hosts it |

If the page is a sign-in wall with **no** conversation after JS load, stop and say the link is private or expired.

## 3. Sequence of work

### 3.1 Resolve the URL

1. `GET` the short URL with a normal browser UA. It 301s to
   `https://gemini.google.com/share/{shareId}?skid={uuid}`.
2. Record **both** the short URL and the canonical URL. Alternate short URLs
   (shown in the share header) often resolve to the **same** `shareId`.

Curl of the HTML is not enough. The document is a signed-out SPA; conversation
text is **not** in `og:description`.

### 3.2 Load with a real browser and capture `ujx1Bf`

Use Playwright (or equivalent) against the canonical share URL.

1. Intercept `POST` responses to `/_/BardChatUi/data/batchexecute`.
2. Keep the body whose query has `rpcids=ujx1Bf`. That RPC is the conversation.
3. Wait until the page title is the chat title (not only “Gemini”) **or** until
   `ujx1Bf` has returned, then ~8s of settle time.
4. Screenshot the share for QA; save `innerText` as a fallback transcript.

Other `rpcids` (`otAQ7b`, `sJBwce`, `Te6DCf`, …) are chrome, not the thread.

### 3.3 Parse the payload

The response body starts with `)]}'`. Find the line that is a JSON array whose
first element is `["wrb.fr","ujx1Bf", "<payload-string>", …]`.

```python
import json
arr = json.loads(payload_line)
data = json.loads(arr[0][2])   # the inner conversation tree
```

Map fields from [references/payload-schema.md](references/payload-schema.md).
For every turn, take:

- User text from `turn[2][0][0]` (not the collapsed “You said …” teaser)
- Attachments from `turn[2][0][4]`
- Gemini Markdown from `turn[3][0][0][1][0]`
- Search queries from `turn[3][1]`
- Unix timestamp from `turn[4]`

### 3.4 Recover media

- Download share thumbnails (`lh3.googleusercontent.com/gg/…`) when present.
- Video/file parts often come back as `[3, "generic", "Invalid file ID"]`.
  Keep filename, MIME type, upload timestamp, and Gemini’s transcript.
  Do **not** invent the binary or a fake screenshot of the video.
- Nested `share.gemini.google/…` links in the header are often **the same**
  conversation with a different `skid`. Confirm before treating as a second chat.

### 3.5 Write the Markdown file

Follow [references/markdown-contract.md](references/markdown-contract.md)
exactly. Minimum sections: document control, contents, timeline, attached
media, full conversation, tools/search queries, technical identifiers,
thread status, provenance.

Timestamps: store UTC from the unix seconds **and** the user’s local zone
when known. Also keep the “Created with Pro / Published” labels from the
share page if they differ.

### 3.6 Deliver

- Write the `.md` where the user can download it.
- If this is an App Builder session, also render it as a typeset reader with
  **Download .md** (see the worked example in this repo).
- Do not add commentary on the user’s business unless they asked for analysis.
  The archive is a record, not a rewrite.

## 4. How to validate

- Every user message in the payload appears **verbatim** in a fenced `text` block.
- Every Gemini reply’s `turn[3][0][0][1][0]` Markdown is included in full.
- Turn count matches `len(turns)`.
- Title, share ID, model label (`Pro` / fingerprint), and last Gemini question
  are present.
- Needles check: first user line, last user line, last Gemini question, share ID.
- If a typeset viewer exists: no `figure` inside `p` (hydration error), no
  console errors, no horizontal overflow at 390px.

## 5. What to return

1. The Markdown file (primary artifact).
2. A short note of what was captured: title, turn count, model, media gaps
   (e.g. “MP4 listed but not recoverable”).
3. The source URLs.

Do not dump the raw `ujx1Bf` JSON to the user unless they ask.

## 6. What requires approval

- Private / signed-in-only shares — do not attempt account takeover or cookie theft.
- Do not continue a shared chat as the user.
- Do not treat Gemini’s cited market figures as independently verified; label
  them as Gemini’s claims if you quote them outside the archive body.

---

# `ujx1Bf` conversation payload

After `json.loads(arr[0][2])` the tree is:

```
data[0]                    conversation envelope
  [1]                      turns[]  (oldest first)
  [2][1]                   title (string)
  [2][7]                   [?, modelFingerprint, modelLabel]  e.g. [2, "e6fa…", "Pro"]
  [3]                      shareId  e.g. "eba53f5c0e60"
  [4]                      [publishedUnixSeconds, nanoRemainder]
  [6]                      share thumbnail URL (optional)
data[1]                    unused
data[2]                    unused
```

Each `turn`:

```
turn[0]                    [conversationId, requestId]
turn[1]                    parent pointer [conversationId, prevRequestId, prevResponseId] or null
turn[2][0][0]              user message (full string)
turn[2][0][4]              attachments
                           video example:
                           [[null, null, null, [[null, 2, "file.mp4", null,
                             [3, "generic", "Invalid file ID"], null, null, null, 1,
                             [uploadUnix, nano], null, "video/mp4"]]]]
turn[3]                    model response
  [0][0][1][0]             Gemini reply as Markdown (canonical body — use this)
  [1]                      Google Search queries, e.g. [["Harvey AI valuation 2025 2026", 1], …]
                           or null
  [3]                      responseId  e.g. "rc_59809d1bbf8c0840"
  [4], [5]                 tool-use chrome (Google Search labels) or null
  [14] / [17]              model fingerprint (repeat of envelope)
turn[4]                    [messageUnixSeconds, nanoRemainder]
```

IDs to archive: conversation `c_…`, request `r_…`, response `rc_…`, share id,
model fingerprint, `skid` query param(s).

Unix seconds → UTC with `datetime.utcfromtimestamp(seconds)`. Remainder is
nanoseconds; keep it in the identifiers table, not in the displayed clock.

---

# Markdown archive contract

One file, UTF-8, GitHub-flavored Markdown. Filename: `{slug-of-title}.md`.

## Required sections (in order)

1. **Title** — `# {share title}`
2. **Deck** — one line: complete archive of a Gemini {model} conversation
3. **Integrity note** — faithful export; user text verbatim; Gemini Markdown original
4. **Document control** — table: title, short URL, alternate short URL (if any),
   canonical URL, share ID, conversation ID, model + fingerprint, participants,
   turn count, created/published labels from the share page, first/last message
   in UTC and in the user’s timezone when known, attached media summary, tools used
5. **Contents** — linked TOC. Heading slugs: lowercase, non-alphanumerics → `-`,
   trim hyphens. Keep TOC links in sync with those slugs.
6. **Timeline** — table of turn #, role, UTC, local, message ID
7. **Attached media** — every file: name, MIME, upload time, share-API status,
   subject. Embed recovered images. State clearly when a binary is unrecoverable.
8. **Conversation** — one `### Turn N — {short heading}` per turn:
   - one-line italic blurb
   - `#### User · {timestamp}`
   - attachment callout if any
   - user body in a ` ```text ` fence (verbatim, trailing spaces stripped only
     at the fence edge)
   - `#### Gemini {model} · response \`{rc_…}\``
   - tools callout if search/etc. ran
   - Gemini body as **raw Markdown**, not re-fenced, not rewritten
   - `---` between turns
9. **Search queries / tools** — table of query × turn; note if citation URLs
   were absent from the payload
10. **Technical identifiers** — IDs + unix/nano timestamp table
11. **Status of the thread** — last open question; whether thinking blocks,
    Canvas, generated images, or code cells existed
12. **Provenance** — source links; “archive, not legal advice / not independent
    verification” if the thread cites market figures

## Rules

- Do not summarise, paraphrase, or “clean up” user spelling (`sme’s`, `levarging`).
- Do not drop Gemini’s factual asides (e.g. security-by-obscurity correction).
- Do not add a new analysis section unless the user asked for one on top of the archive.
- Prefer tables over prose for metadata.
- If a typeset HTML reader wraps Markdown images, render `<img>` only — never
  `<figure>` inside a `<p>` (hydration mismatch).

Storage file view of FYJ Founder Bot. Not the Identity letter.