Reads one Google Doc and writes three new documents from it: a study guide, a ten-minute briefing and a dated timeline.

UsesClaudeGoogle Docs

Turn one document into a study guide, a briefing and a timeline

Point it at one Google Doc, a chapter, a report, a policy or a set of minutes, and run it to get three new documents in your Google Drive: a study guide, a briefing for someone with ten minutes, and a timeline of the dated events the document states. The AI writes all three from that document and nothing else, told to add no outside knowledge and to say where the document is silent rather than fill the gap.

The timeline is checked mechanically as well as asked for politely, because an invented date reads exactly like a real one. Every entry must quote its date as the document writes it, any entry whose date cannot be found in the text is dropped and listed at the foot of the page, and if the document states no dates the page says so instead of inventing a sequence. The source is only ever read. Three fresh documents named after your pack are created every run, and if any draft comes back empty the run stops before creating anything, so you never get a half-built set.

Set sourceDocumentLink to blank.Set sourceDocumentLink to blank.
Set studyPackName to blank.Set studyPackName to blank.
Trim studyPackName and save it as packName.Trim studyPackName and save it as packName.
Trim sourceDocumentLink and save it as sourceLink.Trim sourceDocumentLink and save it as sourceLink.
Set sourceDocumentId to sourceLink.Set sourceDocumentId to sourceLink.
If sourceLink starts with “http” (ignoring case)If sourceLink starts with “http” (ignoring case)
Yes
If sourceLink doesn't contain “/d/”If sourceLink doesn't contain “/d/”
Yes
Stop and report a problem: The 'sourceDocumentLink' step is a web address but not a Google Docs one, so there is no document to read. A Docs link contains '/d/' - for example https://docs.google.com/document/d/1AbCdEf/edit.Stop and report a problem: The 'sourceDocumentLink' step is a web address but not a Google Docs one, so there is no document to read. A Docs link contains '/d/' - for example https://docs.google.com/document/d/1AbCdEf/edit.
No
No steps
Get the first item of the last item of sourceLink split by “/d/” split by “/” and save it as sourceDocumentId.Get the first item of the last item of sourceLink split by “/d/” split by “/” and save it as sourceDocumentId.
No
No steps
If sourceDocumentId is emptyIf sourceDocumentId is empty
Yes
Stop and report a problem: No document id could be read out of the 'sourceDocumentLink' step. Paste the whole link from your browser address bar.Stop and report a problem: No document id could be read out of the 'sourceDocumentLink' step. Paste the whole link from your browser address bar.
No
No steps
Set sourceText to blank.Set sourceText to blank.
If a step below fails, save the error as readErrorIf a step below fails, save the error as readError
Try
Google DocsGoogle DocsRead sourceDocumentId. Save it as readResult.Read sourceDocumentId. Save it as readResult.
Trim readResult.text and save it as sourceText.Trim readResult.text and save it as sourceText.
On error
Stop and report a problem: Could not read that document. Check the 'sourceDocumentLink' step points at a Google Doc your connected account can open. The reason given was: readError.message.Stop and report a problem: Could not read that document. Check the 'sourceDocumentLink' step points at a Google Doc your connected account can open. The reason given was: readError.message.
If sourceText is emptyIf sourceText is empty
Yes
Stop and report a problem: That document has no text in it, so there is nothing to study. Check the 'sourceDocumentLink' step points at the right document.Stop and report a problem: That document has no text in it, so there is nothing to study. Check the 'sourceDocumentLink' step points at the right document.
No
No steps
Set documentBlock to Set documentBlock to DOCUMENT STARTS sourceText truncated to 40000 characters (keeping words whole) DOCUMENT ENDS.
Set studyGuidePrompt to You are writing from ONE source document, which is reproduced in full below.Set studyGuidePrompt to You are writing from ONE source document, which is reproduced in full below. Every statement you write must be supported by that text and by nothing else. Do not add background knowledge. Do not add a name, a date, a figure, an event or a claim that is not in the text. Where the document does not cover something, write that the document does not say. Do not guess and do not fill gaps. Write plain text. Do not use markdown, asterisks or hash marks. Task: write a study guide for the document. Use exactly these five sections, each introduced by its name on its own line: SUMMARY KEY IDEAS KEY TERMS AND WHAT THE DOCUMENT SAYS THEY MEAN QUESTIONS TO TEST YOURSELF WHAT THIS DOCUMENT DOES NOT COVER Define a term only if the document defines it. Every question must be answerable from the document alone.@documentBlock.
Set studyGuideText to blank.Set studyGuideText to blank.
If a step below fails, save the error as studyGuideErrorIf a step below fails, save the error as studyGuideError
Try
ClaudeClaudeAsk Claude: studyGuidePrompt. Save it as studyGuideReply.Ask Claude: studyGuidePrompt. Save it as studyGuideReply. Maximum response length: 3000
Trim studyGuideReply.response_text and save it as studyGuideText.Trim studyGuideReply.response_text and save it as studyGuideText.
On error
Change studyGuideText to blank.Change studyGuideText to blank.
Set briefingPrompt to You are writing from ONE source document, which is reproduced in full below.Set briefingPrompt to You are writing from ONE source document, which is reproduced in full below. Every statement you write must be supported by that text and by nothing else. Do not add background knowledge. Do not add a name, a date, a figure, an event or a claim that is not in the text. Where the document does not cover something, write that the document does not say. Do not guess and do not fill gaps. Write plain text. Do not use markdown, asterisks or hash marks. Task: write a briefing for someone who has ten minutes and has not read the document. Use exactly these four sections, each introduced by its name on its own line: WHAT THIS IS WHAT IT SAYS WHAT IT ASKS FOR OR DECIDES QUESTIONS THE DOCUMENT LEAVES OPEN Keep it under 400 words. Attribute every point to the document rather than asserting it as general fact.@documentBlock.
Set briefingText to blank.Set briefingText to blank.
If a step below fails, save the error as briefingErrorIf a step below fails, save the error as briefingError
Try
ClaudeClaudeAsk Claude: briefingPrompt. Save it as briefingReply.Ask Claude: briefingPrompt. Save it as briefingReply. Maximum response length: 1500
Trim briefingReply.response_text and save it as briefingText.Trim briefingReply.response_text and save it as briefingText.
On error
Change briefingText to blank.Change briefingText to blank.
Set timelinePrompt to You are writing from ONE source document, which is reproduced in full below.Set timelinePrompt to You are writing from ONE source document, which is reproduced in full below. Every statement you write must be supported by that text and by nothing else. Do not add background knowledge. Do not add a name, a date, a figure, an event or a claim that is not in the text. Where the document does not cover something, write that the document does not say. Do not guess and do not fill gaps. Write plain text. Do not use markdown, asterisks or hash marks. Task: list every dated event the document states, earliest first. Write one event per line in exactly this format, with a vertical bar between the two parts: date exactly as written in the document | what happened, in one short sentence Copy the date text character for character from the document. Do not reformat it, do not complete a partial date, do not convert it to another calendar or style, and do not work out a date the document does not state. Write no heading, no numbering and no commentary - only the event lines. If the document states no dates at all, reply with exactly this one line and nothing else: NO DATES IN THIS DOCUMENT@documentBlock.
Set timelineText to blank.Set timelineText to blank.
If a step below fails, save the error as timelineErrorIf a step below fails, save the error as timelineError
Try
ClaudeClaudeAsk Claude: timelinePrompt. Save it as timelineReply.Ask Claude: timelinePrompt. Save it as timelineReply. Maximum response length: 2000
Trim timelineReply.response_text and save it as timelineText.Trim timelineReply.response_text and save it as timelineText.
On error
Change timelineText to blank.Change timelineText to blank.
If studyGuideText is empty or briefingText is empty or timelineText is emptyIf studyGuideText is empty or briefingText is empty or timelineText is empty
Yes
Stop and report a problem: One of the three drafts came back empty, so nothing has been created. Run it again; if it keeps happening the document may be too long to work through in one pass.Stop and report a problem: One of the three drafts came back empty, so nothing has been created. Run it again; if it keeps happening the document may be too long to work through in one pass.
No
No steps
Set timelineEvents to an empty list.Set timelineEvents to an empty list.
Set untraceableDates to an empty list.Set untraceableDates to an empty list.
Check whether timelineText contains “NO DATES IN THIS DOCUMENT” (ignoring case) and save it as sourceStatesNoDates.Check whether timelineText contains “NO DATES IN THIS DOCUMENT” (ignoring case) and save it as sourceStatesNoDates.
If sourceStatesNoDates is noIf sourceStatesNoDates is no
Yes
For each timelineLine in timelineText split by a new line:For each timelineLine in timelineText split by a new line:
Trim timelineLine and save it as entry. Trim timelineLine and save it as entry.
If entry isn't empty and entry contains “|” If entry isn't empty and entry contains “|”
Yes
Trim the first item of entry split by “|” and save it as dateText.Trim the first item of entry split by “|” and save it as dateText.
Trim the last item of entry split by “|” and save it as eventText.Trim the last item of entry split by “|” and save it as eventText.
If dateText isn't empty and eventText isn't emptyIf dateText isn't empty and eventText isn't empty
Yes
If sourceText contains dateText (ignoring case)If sourceText contains dateText (ignoring case)
Yes
Add dateText - eventText to the end of timelineEvents and save it as timelineEvents.Add dateText - eventText to the end of timelineEvents and save it as timelineEvents.
No
Add dateText to the end of untraceableDates and save it as untraceableDates.Add dateText to the end of untraceableDates and save it as untraceableDates.
No
No steps
No
No steps
No
No steps
Count the items in untraceableDates and save it as droppedCount.Count the items in untraceableDates and save it as droppedCount.
Count the items in timelineEvents and save it as tracedCount.Count the items in timelineEvents and save it as tracedCount.
Set sourceCredit to Set sourceCredit to Written from one source document only: sourceLink Drafted on today's date. Check anything you rely on against the source.
Trim the document id from the Google Docs “Create document” step and save it as studyGuideId.Trim the document id from the Google Docs “Create document” step and save it as studyGuideId.
Google DocsGoogle DocsAdd the heading 'Study guide: packName' to studyGuideId.Add the heading 'Study guide: packName' to studyGuideId.
Google DocsGoogle DocsAdd text to studyGuideId.Add text to studyGuideId.studyGuideText plus sourceCredit
Trim the document id from the Google Docs “Create document” step and save it as briefingId.Trim the document id from the Google Docs “Create document” step and save it as briefingId.
Google DocsGoogle DocsAdd the heading 'Briefing: packName' to briefingId.Add the heading 'Briefing: packName' to briefingId.
Google DocsGoogle DocsAdd text to briefingId.Add text to briefingId.briefingText plus sourceCredit
Trim the document id from the Google Docs “Create document” step and save it as timelineId.Trim the document id from the Google Docs “Create document” step and save it as timelineId.
Google DocsGoogle DocsAdd the heading 'Timeline: packName' to timelineId.Add the heading 'Timeline: packName' to timelineId.
If tracedCount is greater than 0If tracedCount is greater than 0
Yes
Google DocsGoogle DocsAdd a bulleted list to timelineId.Add a bulleted list to timelineId.
Else if @sourceStatesNoDates is yes
Google DocsGoogle DocsAdd text to timelineId.Add text to timelineId.The source document does not state any dates, so there is no timeline to build from it. Nothing has been invented to fill this page.
Otherwise
Google DocsGoogle DocsAdd text to timelineId.Add text to timelineId.No dated entry in the draft could be matched back to the wording of the source document, so nothing has been written here. Inventing a sequence would be worse than leaving this page empty.
Set timelineCredit to sourceCredit.Set timelineCredit to sourceCredit.
If droppedCount is greater than 0If droppedCount is greater than 0
Yes
Change timelineCredit to sourceCreditChange timelineCredit to sourceCredit Left out of this timeline: droppedCount entry or entries whose date does not appear in the source document, so they could not be traced back to it. The dates dropped were: untraceableDates joined by “; ”.
No
No steps
Google DocsGoogle DocsAdd text to timelineId.Add text to timelineId.timelineCredit
Show in the output: Made three documents from sourceLink: a study guide, a briefing, and a timeline holding tracedCount traced event(s) with droppedCount untraceable entry or entries left out.Show in the output: Made three documents from sourceLink: a study guide, a briefing, and a timeline holding tracedCount traced event(s) with droppedCount untraceable entry or entries left out.