convert-sc-design-hblab
Original:🇺🇸 English
Translated
3 scriptsChecked / no sensitive code detected
Use when a Google Sheets URL (docs.google.com/spreadsheets/d/) or raw spreadsheet ID is present, or when the user says "read the sheet", "fetch spreadsheet", "convert sheet", "doc sheet", "import from Google Sheet", "get data from sheet", "đọc sheet", "doc sheet", "lay du lieu tu sheet", "lay data tu google sheet", or wants to export, document, or convert Google Sheet data into markdown, a table, a report, or documentation. Do NOT trigger for: Excel (.xlsx), CSV, Google Docs (docs.google.com/document), databases, or how-to questions about Google Sheets.
13installs
Added on
NPX Install
npx skill4agent add datht-hblab-company/convert-sc-design-hblab convert-sc-design-hblabTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →convert-sc-design-hblab
Read a Google Sheet by and turn the result into usable markdown.
SPREADSHEET_IDRequirements
- OAuth credentials at with:
~/.config/google-sheets/oauth-token.jsonclient_idclient_secretrefresh_token
- Google Sheets API enabled for that OAuth app
Output Policy
- Use the installed script from the skill directory, but write any authored markdown into of the current workspace.
./docs - If does not exist, create it before writing files.
./docs - Do not save generated documents into the installed skill directory.
Usage
Step 1: Resolve the installed script path
SKILL_DIRSKILL.mdscripts/read_sheet.pyStep 1.5: Extract the spreadsheet ID
If the user gave a URL like:
https://docs.google.com/spreadsheets/d/1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms/edit#gid=0The spreadsheet ID is the segment between and the next :
/d//1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upmsbash
# Extract from URL (bash)
SPREADSHEET_ID=$(echo "$URL" | sed 's|.*/d/\([^/]*\).*|\1|')If the user gave a raw alphanumeric ID with no slashes, use it directly.
Step 2: Fetch sheet data
bash
python3 "$SKILL_DIR/scripts/read_sheet.py" --spreadsheet-id "$SPREADSHEET_ID" --sheet-name <SHEET_NAME>If the caller already has a Google Sheets tab id from the URL, they can target it directly:
bash
python3 "$SKILL_DIR/scripts/read_sheet.py" --spreadsheet-id "$SPREADSHEET_ID" --gid <GID>Step 2.5: Discover the sheet name
If the user did not specify a sheet name, omit — the script reads the first sheet by default.
If the user provides both and , overrides .
--sheet-name--sheet-name--gid--gid--sheet-nameTo inspect headers and data shape before committing to a format, always run json first:
bash
python3 "$SKILL_DIR/scripts/read_sheet.py" \
--spreadsheet-id "$SPREADSHEET_ID" \
--format jsonAsk the user whether they want to read additional sheets if the spreadsheet has multiple tabs.
Always preserve the full sheet content unless the user explicitly asks for summarization.
Step 3: Classify data shape and format accordingly
After inspecting the JSON output, classify the data:
| Shape | Signs | Recommended approach |
|---|---|---|
| Tabular | Row 0 = headers, rows 1+ = records | |
| Key-value / config | Two columns (key, value) | Don't use a table — render as |
| Pivot / cross-tab | First col = label, remaining = categories | |
| Free text / notes | Irregular rows, no clear header | |
Step 4: Write the markdown document
Structure:
# <Spreadsheet Title or User-Provided Name>
> Source: Google Sheet — <Sheet Name> (ID: <SPREADSHEET_ID>)
## <Section heading derived from content>
<Formatted content>- Derive the title from context or ask the user.
- Always include the source line.
- Save to . Create
./docs/<sheet-name-kebab-case>.mdfirst:./docsmkdir -p ./docs
Parameters
| Parameter | Required | Description |
|---|---|---|
| Yes | The Google Spreadsheet ID |
| No | Sheet name to read. Defaults to the first sheet. |
| No | Google Sheets tab id / |
| No | OAuth credentials path. Defaults to |
| No | Output file path. Defaults to stdout. |
| No | Output format: |
| No | Keep empty columns instead of cleaning them. |
Example
bash
# Fetch as JSON
python3 "$SKILL_DIR/scripts/read_sheet.py" \
--spreadsheet-id "1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms" \
--gid "0"
# Fetch as markdown table
python3 "$SKILL_DIR/scripts/read_sheet.py" \
--spreadsheet-id "1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms" \
--sheet-name "Sheet1" \
--format table
# Save raw output directly into the current workspace docs folder
mkdir -p ./docs
python3 "$SKILL_DIR/scripts/read_sheet.py" \
--spreadsheet-id "1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms" \
--gid "0" \
--format table \
--output ./docs/sheet1.mdOAuth Credentials Format
json
{
"type": "oauth",
"client_id": "your-client-id.apps.googleusercontent.com",
"client_secret": "your-client-secret",
"refresh_token": "your-refresh-token"
}First-Run Setup
If credentials don't exist at :
~/.config/google-sheets/oauth-token.json- Create a Google Cloud project, enable the Google Sheets API
- Create an OAuth 2.0 Desktop app credential → download JSON
- Get a refresh token via https://developers.google.com/oauthplayground/
- Use scope:
https://www.googleapis.com/auth/spreadsheets.readonly
- Use scope:
- Create the credentials file:
bash
mkdir -p ~/.config/google-sheets # Write the JSON with client_id, client_secret, refresh_token
For detailed steps, see in the source repo.
docs/troubleshooting.md