Build the review sheet’s Apps Script and a document’s Config tab
Builds Code.gs (--script), the one Google Apps Script every review sheet runs (from review-sheet.gs), and one document’s Config tab rows (--config), filled from the folio’s review/public-comment/sheet-sync.json, its review anchors and the draft’s pdf-line-map.json. The script keeps a public-comment review sheet’s links and joins current: each comment No. links to its comment page; Sections, Page and Line no(s) link to the page of the frozen review draft; Review Change Sets joins its comments, suggested revisions, feedback and dispositions, each No. n linking to its row; and on both tabs Agentic status lists each pull request of the change-set, linked, with its status and what it changed, from the Agent tab. It reads the document’s URLs, tab and column names and data from the sheet’s Config tab (visible, locked to the owner), which the agent writes from these rows. A person pastes the script (one file) into the sheet once (Extensions > Apps Script) and runs installTriggers; from then on the sheet rebuilds itself within about a minute of an edit, with no agent. With "mode": "drafting" in the config it builds the drafting sheet instead: one Contributor Feedback tab where each row is a change set (ids assigned by the script), Sections picked from the document’s table of contents and linked to it, and Issue and Agentic status from the Agent tab.
Skills it satisfies
A skill states the capability; this Tool is one way to exercise it. Each skill’s declared input and output contract follows, where it has one.
review-sheet-script
Build, install and reuse the Google Apps Script that keeps a review sheet’s links and joined columns current (Tool review-sheet-sync). Public-comment mode: comment numbers, sections, pages and lines link into the frozen review draft, and Review Change Sets joins its comments. Drafting mode: one Contributor Feedback tab where each row is a change set with its own GitHub issue, and Sections pick from the document’s table of contents. Use when setting up either sheet for a document, when its links are missing or stale, or after a tab, header, anchor or draft link changes.
Source: folio-assistant-core/skills/content/folio-document-adapter/review-sheet-script.md.
The skill declares no I/O contract (schemas/skills/review-sheet-script/{input,output}.schema.json).
Inputs and outputs
Each port names a shared type by IRI, so two Tools for one skill can be checked for interchangeability.
| port | type | required | description | constraint | |
|---|---|---|---|---|---|
| in | script | RepoPath | Where to write the generic Code.gs. The same for every document. | string · pattern ^[A-Za-z0-9._][A-Za-z0-9._/-]*$ · A path relative to the repository root. No .. segments. | |
| in | repo | RepoPath | The folio repository. Default the current directory. | string · pattern ^[A-Za-z0-9._][A-Za-z0-9._/-]*$ · A path relative to the repository root. No .. segments. | |
| in | config | RepoPath | The folio’s sheet settings, e.g. review/public-comment/sheet-sync.json: anchors, lineMap, draftUrl, commentUrl, and optional namedSections, aliases, tabs and columns. A drafting sheet’s config (review/drafting/sheet-sync.json) has mode drafting, anchors and sectionUrl. | string · pattern ^[A-Za-z0-9._][A-Za-z0-9._/-]*$ · A path relative to the repository root. No .. segments. | |
| in | out | RepoPath | Where to write the Config tab’s rows (JSON). Default standard output. | string · pattern ^[A-Za-z0-9._][A-Za-z0-9._/-]*$ · A path relative to the repository root. No .. segments. | |
| out | script | RepoPath | Code.gs, ready to paste into any review sheet’s Apps Script editor. Never committed: it is rebuilt from the template. | string · pattern ^[A-Za-z0-9._][A-Za-z0-9._/-]*$ · A path relative to the repository root. No .. segments. | |
| out | configRows | RepoPath | The Config tab’s rows for one document, which the agent writes into the sheet. Never committed: rebuilt from the config. | string · pattern ^[A-Za-z0-9._][A-Za-z0-9._/-]*$ · A path relative to the repository root. No .. segments. |
Processes and tasks
Steps this Tool can carry out, because each names a skill it satisfies:
| process | step | lane | via skill |
|---|---|---|---|
| Release a draft for public comment | Set up the comment channels, with instructions and links | Editor | review-sheet-script |
| Contributor feedback on a working draft | Start a change-set row | Authoring Committee | review-sheet-script |
| Contributor feedback on a working draft | Propose a direction | Authoring agent | review-sheet-script |
| Contributor feedback on a working draft | Set Ready for agent to Yes | Editor | review-sheet-script |
| Contributor feedback on a working draft | Edit the document in the row’s pull request | Authoring agent | review-sheet-script |
| Contributor feedback on a working draft | Review the preview and answer | Authoring Committee | review-sheet-script |
| Contributor feedback on a working draft | QA gate: check dispositions and PR | QA reviewer (independent) | review-sheet-script |
| Contributor feedback on a working draft | Set Ready for merge to Yes | Editor | review-sheet-script |
| Contributor feedback on a working draft | Merge the pull request | Authoring agent | review-sheet-script |
| Review and publish a folio | Contributor feedback | Authoring Committee | review-sheet-script |
| Record agent step | Write Feedback (agent) from that row | Authoring agent | review-sheet-script |
| Review-log watch | Agent pass on the changed rows | Log watcher (authoring agent) | review-sheet-script |
How it is deployed and reached
- Command line. From the repository root:
bun run folio-assistant-core/tools/review-sheet-sync/build-review-sheet-script.ts. - GitHub Actions. No workflow in this checkout runs its command.
As an API: its operation in the OpenAPI document and the MCP tool list of its layer.
| install | service: Google Apps Script bound to the review sheet: copy the template, have the agent write its Config tab, add editors to the "Ready columns: editors" lock, paste Code.gs, run installTriggers (skill review-sheet-script, "Setting up a sheet for a new document") |
| runtime | bun |
| network | no |
| when to choose it | |
|---|---|
| when | A public review is kept in a shared Google Sheet with the public-comment tabs (Review Public Comments, Review Change Sets, Agent - Comments, Agent - Change Sets), and its links or joined columns must stay current without an agent re-pasting them. Also after the review anchors, the draft’s link prefix or a tab or column name changes: rewrite the Config tab (the script stays). |
| limits | Builds the script only; installing it is a person’s step in the sheet, since the sheet’s owner must authorise it. It reads only the tabs and headers named in the config. In the reviewers’ columns the link text must be in the cell already: it links what reviewers wrote and does not rewrite their words. The joined columns and Agentic status it writes whole. |
| cost | Reads three JSON files and writes one file of about 20 kB. In the sheet, a full refresh of 800 rows takes about 20 seconds. |
What it is made of
| role | file | |
|---|---|---|
| definition | folio-assistant-core/tools/review-sheet-sync/review-sheet-sync.ts | |
| script | folio-assistant-core/tools/review-sheet-sync/build-review-sheet-script.ts |
Linked data
The Tool is published as its own JSON-LD document at its IRI, https://litlfred.github.io/folio-assistant/folio-assistant-core/tools/review-sheet-sync.jsonld, partOf its layer’s document. The node below is the definition this page was drawn from, and is embedded in the page as application/ld+json.
{
"@context": "https://litlfred.github.io/folio-assistant/folio-assistant-core/folio-assistant-core.context.jsonld",
"@id": "https://litlfred.github.io/folio-assistant/folio-assistant-core/tools/review-sheet-sync.jsonld",
"@type": "https://litlfred.github.io/cat-harness/v0/ns/Tool",
"partOf": "https://litlfred.github.io/folio-assistant/folio-assistant-core/folio-assistant-core.jsonld",
"name": "review-sheet-sync",
"title": "Build the review sheet's Apps Script and a document's Config tab",
"description": "Builds `Code.gs` (`--script`), the one Google Apps Script every review sheet runs (from `review-sheet.gs`), and one document's Config tab rows (`--config`), filled from the folio's `review/public-comment/sheet-sync.json`, its review anchors and the draft's `pdf-line-map.json`. The script keeps a public-comment review sheet's links and joins current: each comment No. links to its comment page; Sections, Page and Line no(s) link to the page of the frozen review draft; Review Change Sets joins its comments, suggested revisions, feedback and dispositions, each `No. n` linking to its row; and on both tabs Agentic status lists each pull request of the change-set, linked, with its status and what it changed, from the Agent tab. It reads the document's URLs, tab and column names and data from the sheet's Config tab (visible, locked to the owner), which the agent writes from these rows. A person pastes the script (one file) into the sheet once (Extensions > Apps Script) and runs `installTriggers`; from then on the sheet rebuilds itself within about a minute of an edit, with no agent. With `\"mode\": \"drafting\"` in the config it builds the drafting sheet instead: one Contributor Feedback tab where each row is a change set (ids assigned by the script), Sections picked from the document's table of contents and linked to it, and Issue and Agentic status from the Agent tab.",
"install": {
"service": "Google Apps Script bound to the review sheet: copy the template, have the agent write its Config tab, add editors to the \"Ready columns: editors\" lock, paste Code.gs, run installTriggers (skill review-sheet-script, \"Setting up a sheet for a new document\")"
},
"invoke": {
"shell": "bun run folio-assistant-core/tools/review-sheet-sync/build-review-sheet-script.ts"
},
"io": {
"inputs": [
{
"name": "script",
"schema": "https://litlfred.github.io/folio-assistant/cat-harness/tool-types.schema.json#/$defs/RepoPath",
"description": "Where to write the generic Code.gs. The same for every document.",
"required": false,
"arg": {
"flag": "--script"
}
},
{
"name": "repo",
"schema": "https://litlfred.github.io/folio-assistant/cat-harness/tool-types.schema.json#/$defs/RepoPath",
"description": "The folio repository. Default the current directory.",
"required": false,
"arg": {
"flag": "--repo"
}
},
{
"name": "config",
"schema": "https://litlfred.github.io/folio-assistant/cat-harness/tool-types.schema.json#/$defs/RepoPath",
"description": "The folio's sheet settings, e.g. `review/public-comment/sheet-sync.json`: anchors, lineMap, draftUrl, commentUrl, and optional namedSections, aliases, tabs and columns. A drafting sheet's config (`review/drafting/sheet-sync.json`) has mode `drafting`, anchors and sectionUrl.",
"required": false,
"arg": {
"flag": "--config"
}
},
{
"name": "out",
"schema": "https://litlfred.github.io/folio-assistant/cat-harness/tool-types.schema.json#/$defs/RepoPath",
"description": "Where to write the Config tab's rows (JSON). Default standard output.",
"required": false,
"arg": {
"flag": "--out"
}
}
],
"outputs": [
{
"name": "script",
"schema": "https://litlfred.github.io/folio-assistant/cat-harness/tool-types.schema.json#/$defs/RepoPath",
"description": "Code.gs, ready to paste into any review sheet's Apps Script editor. Never committed: it is rebuilt from the template."
},
{
"name": "configRows",
"schema": "https://litlfred.github.io/folio-assistant/cat-harness/tool-types.schema.json#/$defs/RepoPath",
"description": "The Config tab's rows for one document, which the agent writes into the sheet. Never committed: rebuilt from the config."
}
]
},
"satisfies": [
"review-sheet-script"
],
"requirements": {
"runtime": [
"bun"
],
"network": false
},
"selection": {
"when": "A public review is kept in a shared Google Sheet with the public-comment tabs (Review Public Comments, Review Change Sets, Agent - Comments, Agent - Change Sets), and its links or joined columns must stay current without an agent re-pasting them. Also after the review anchors, the draft's link prefix or a tab or column name changes: rewrite the Config tab (the script stays).",
"limits": "Builds the script only; installing it is a person's step in the sheet, since the sheet's owner must authorise it. It reads only the tabs and headers named in the config. In the reviewers' columns the link text must be in the cell already: it links what reviewers wrote and does not rewrite their words. The joined columns and Agentic status it writes whole.",
"cost": "Reads three JSON files and writes one file of about 20 kB. In the sheet, a full refresh of 800 rows takes about 20 seconds."
}
}